[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH-for-6.1 4/9] hw/mips: Use new machine_create_constant_clock()
From: |
Philippe Mathieu-Daudé |
Subject: |
[RFC PATCH-for-6.1 4/9] hw/mips: Use new machine_create_constant_clock() helper |
Date: |
Fri, 9 Apr 2021 08:23:56 +0200 |
Use the newly added machine_create_constant_clock() helper
to create the CPU reference clocks.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
hw/mips/fuloong2e.c | 4 ++--
hw/mips/jazz.c | 6 +++---
hw/mips/loongson3_virt.c | 4 ++--
hw/mips/mipssim.c | 7 ++++---
4 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/hw/mips/fuloong2e.c b/hw/mips/fuloong2e.c
index 4f61f2c873b..72dc5702727 100644
--- a/hw/mips/fuloong2e.c
+++ b/hw/mips/fuloong2e.c
@@ -259,8 +259,8 @@ static void mips_fuloong2e_init(MachineState *machine)
CPUMIPSState *env;
DeviceState *dev;
- cpuclk = clock_new(OBJECT(machine), "cpu-refclk");
- clock_set_hz(cpuclk, 533080000); /* ~533 MHz */
+ cpuclk = machine_create_constant_clock(machine, "cpu-refclk",
+ 533080000); /* ~533 MHz */
/* init CPUs */
cpu = mips_cpu_create_with_clock(machine->cpu_type, cpuclk);
diff --git a/hw/mips/jazz.c b/hw/mips/jazz.c
index 1a0888a0fd5..3c220b4df6b 100644
--- a/hw/mips/jazz.c
+++ b/hw/mips/jazz.c
@@ -185,9 +185,9 @@ static void mips_jazz_init(MachineState *machine,
exit(EXIT_FAILURE);
}
- cpuclk = clock_new(OBJECT(machine), "cpu-refclk");
- clock_set_hz(cpuclk, ext_clk[jazz_model].freq_hz
- * ext_clk[jazz_model].pll_mult);
+ cpuclk = machine_create_constant_clock(machine, "cpu-refclk",
+ ext_clk[jazz_model].freq_hz
+ * ext_clk[jazz_model].pll_mult);
/* init CPUs */
cpu = mips_cpu_create_with_clock(machine->cpu_type, cpuclk);
diff --git a/hw/mips/loongson3_virt.c b/hw/mips/loongson3_virt.c
index b15071defc6..b9f18ecd911 100644
--- a/hw/mips/loongson3_virt.c
+++ b/hw/mips/loongson3_virt.c
@@ -530,8 +530,8 @@ static void mips_loongson3_virt_init(MachineState *machine)
sysbus_create_simple("goldfish_rtc", virt_memmap[VIRT_RTC].base,
qdev_get_gpio_in(liointc, RTC_IRQ));
- cpuclk = clock_new(OBJECT(machine), "cpu-refclk");
- clock_set_hz(cpuclk, DEF_LOONGSON3_FREQ);
+ cpuclk = machine_create_constant_clock(machine, "cpu-refclk",
+ DEF_LOONGSON3_FREQ);
for (i = 0; i < machine->smp.cpus; i++) {
int ip;
diff --git a/hw/mips/mipssim.c b/hw/mips/mipssim.c
index f5d0da05aa1..af11cf9ac25 100644
--- a/hw/mips/mipssim.c
+++ b/hw/mips/mipssim.c
@@ -153,11 +153,12 @@ mips_mipssim_init(MachineState *machine)
ResetData *reset_info;
int bios_size;
- cpuclk = clock_new(OBJECT(machine), "cpu-refclk");
#ifdef TARGET_MIPS64
- clock_set_hz(cpuclk, 6000000); /* 6 MHz */
+ cpuclk = machine_create_constant_clock(machine, "cpu-refclk",
+ 6000000); /* 6 MHz */
#else
- clock_set_hz(cpuclk, 12000000); /* 12 MHz */
+ cpuclk = machine_create_constant_clock(machine, "cpu-refclk",
+ 12000000); /* 12 MHz */
#endif
/* Init CPUs. */
--
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 3/9] hw/arm: Use new machine_create_constant_clock() helper, 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 4/9] hw/mips: Use new machine_create_constant_clock() helper,
Philippe Mathieu-Daudé <=
- [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