[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 05/16] target/mips/cpu: Set default CPU frequency to 200 MHz
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 05/16] target/mips/cpu: Set default CPU frequency to 200 MHz |
Date: |
Mon, 28 Sep 2020 19:15:28 +0200 |
Since the introduction of the 'r4k' machine in commit 6af0bf9c7c3,
the MIPS target assumes a CPU running at 200 MHz.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
target/mips/cpu.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/target/mips/cpu.c b/target/mips/cpu.c
index c1c0f2e12ba..8d07a293a2e 100644
--- a/target/mips/cpu.c
+++ b/target/mips/cpu.c
@@ -141,6 +141,14 @@ static void mips_cpu_realizefn(DeviceState *dev, Error
**errp)
MIPSCPUClass *mcc = MIPS_CPU_GET_CLASS(dev);
Error *local_err = NULL;
+ if (!clock_get(cs->clock)) {
+ /*
+ * Initialize the frequency to 200MHz in case
+ * the clock remains unconnected.
+ */
+ clock_set_hz(cs->clock, 200000000);
+ }
+
cpu_exec_realizefn(cs, &local_err);
if (local_err != NULL) {
error_propagate(errp, local_err);
--
2.26.2
- [PATCH 00/16] hw/mips: Set CPU frequency, Philippe Mathieu-Daudé, 2020/09/28
- [PATCH 05/16] target/mips/cpu: Set default CPU frequency to 200 MHz,
Philippe Mathieu-Daudé <=
- [PATCH 04/16] target/mips/cpu: Introduce mips_cpu_properties[], Philippe Mathieu-Daudé, 2020/09/28
- [PATCH 01/16] hw/core/cpu: Let CPU object have a clock source, Philippe Mathieu-Daudé, 2020/09/28
- [PATCH 09/16] hw/mips/mipssim: Correct CPU frequency, Philippe Mathieu-Daudé, 2020/09/28
- [PATCH 02/16] target/mips: Move cpu_mips_get_random() with CP0 helpers, Philippe Mathieu-Daudé, 2020/09/28
- [PATCH 03/16] target/mips/cp0_timer: Explicit unit in variable name, Philippe Mathieu-Daudé, 2020/09/28
- [PATCH 08/16] hw/mips/fuloong2e: Set CPU frequency to 533 MHz, Philippe Mathieu-Daudé, 2020/09/28