qemu-devel
[Top][All Lists]
Advanced

[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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]