[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH-for-6.1 3/9] hw/arm: Use new machine_create_constant_clock()
From: |
Philippe Mathieu-Daudé |
Subject: |
[RFC PATCH-for-6.1 3/9] hw/arm: Use new machine_create_constant_clock() helper |
Date: |
Fri, 9 Apr 2021 08:23:55 +0200 |
Use the newly added machine_create_constant_clock() helper
to create the SYSCLKs.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
hw/arm/mps2-tz.c | 6 ++----
hw/arm/mps2.c | 3 +--
hw/arm/musca.c | 6 ++----
3 files changed, 5 insertions(+), 10 deletions(-)
diff --git a/hw/arm/mps2-tz.c b/hw/arm/mps2-tz.c
index 3fbe3d29f95..86481fbe40d 100644
--- a/hw/arm/mps2-tz.c
+++ b/hw/arm/mps2-tz.c
@@ -740,10 +740,8 @@ static void mps2tz_common_init(MachineState *machine)
}
/* These clocks don't need migration because they are fixed-frequency */
- mms->sysclk = clock_new(OBJECT(machine), "SYSCLK");
- clock_set_hz(mms->sysclk, mmc->sysclk_frq);
- mms->s32kclk = clock_new(OBJECT(machine), "S32KCLK");
- clock_set_hz(mms->s32kclk, S32KCLK_FRQ);
+ mms->sysclk = machine_create_constant_clock(machine, "SYSCLK",
mmc->sysclk_frq);
+ mms->s32kclk = machine_create_constant_clock(machine, "S32KCLK",
S32KCLK_FRQ);
object_initialize_child(OBJECT(machine), TYPE_IOTKIT, &mms->iotkit,
mmc->armsse_type);
diff --git a/hw/arm/mps2.c b/hw/arm/mps2.c
index 81413b7133e..5d9250da615 100644
--- a/hw/arm/mps2.c
+++ b/hw/arm/mps2.c
@@ -143,8 +143,7 @@ static void mps2_common_init(MachineState *machine)
}
/* This clock doesn't need migration because it is fixed-frequency */
- mms->sysclk = clock_new(OBJECT(machine), "SYSCLK");
- clock_set_hz(mms->sysclk, SYSCLK_FRQ);
+ mms->sysclk = machine_create_constant_clock(machine, "SYSCLK", SYSCLK_FRQ);
/* The FPGA images have an odd combination of different RAMs,
* because in hardware they are different implementations and
diff --git a/hw/arm/musca.c b/hw/arm/musca.c
index 7a83f7dda7d..e15149f3a27 100644
--- a/hw/arm/musca.c
+++ b/hw/arm/musca.c
@@ -372,10 +372,8 @@ static void musca_init(MachineState *machine)
exit(1);
}
- mms->sysclk = clock_new(OBJECT(machine), "SYSCLK");
- clock_set_hz(mms->sysclk, SYSCLK_FRQ);
- mms->s32kclk = clock_new(OBJECT(machine), "S32KCLK");
- clock_set_hz(mms->s32kclk, S32KCLK_FRQ);
+ mms->sysclk = machine_create_constant_clock(machine, "SYSCLK", SYSCLK_FRQ);
+ mms->s32kclk = machine_create_constant_clock(machine, "S32KCLK",
S32KCLK_FRQ);
object_initialize_child(OBJECT(machine), "sse-200", &mms->sse,
TYPE_SSE200);
--
2.26.3
- [RFC PATCH-for-6.1 0/9] hw/clock: Strengthen machine (non-qdev) clock propagation, Philippe Mathieu-Daudé, 2021/04/09
- [RFC PATCH-for-6.1 1/9] hw/core/clock: Increase clock propagation trace events verbosity, Philippe Mathieu-Daudé, 2021/04/09
- [RFC PATCH-for-6.1 2/9] hw/core/machine: Add machine_create_constant_clock() helper, Philippe Mathieu-Daudé, 2021/04/09
- [RFC PATCH-for-6.1 3/9] hw/arm: Use new machine_create_constant_clock() helper,
Philippe Mathieu-Daudé <=
- [RFC PATCH-for-6.1 4/9] hw/mips: Use new machine_create_constant_clock() helper, Philippe Mathieu-Daudé, 2021/04/09
- [RFC PATCH-for-6.1 5/9] hw/core/qdev-clock: Add qdev_ground_clock() helper, Philippe Mathieu-Daudé, 2021/04/09
- [RFC PATCH-for-6.1 6/9] hw/misc/bcm2835_cprman: Use qdev_ground_clock() helper, Philippe Mathieu-Daudé, 2021/04/09
- [RFC PATCH-for-6.1 7/9] hw/misc/bcm2835_cprman: Feed 'xosc' from the board, Philippe Mathieu-Daudé, 2021/04/09
- [RFC PATCH-for-6.1 8/9] hw/clock: Declare clock_new() internally, Philippe Mathieu-Daudé, 2021/04/09
- [RFC PATCH-for-6.1 9/9] hw/core/machine: Reset machine clocks using qemu_register_reset(), Philippe Mathieu-Daudé, 2021/04/09