[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 19/20] hw/mips/cps: Do not allow use without input clock
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v3 19/20] hw/mips/cps: Do not allow use without input clock |
Date: |
Sat, 10 Oct 2020 22:43:18 +0200 |
Now than all QOM users provides the input clock, do not allow
using a CPS without input clock connected.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
hw/mips/cps.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/hw/mips/cps.c b/hw/mips/cps.c
index 915655b91e0..c624821315a 100644
--- a/hw/mips/cps.c
+++ b/hw/mips/cps.c
@@ -74,6 +74,11 @@ static void mips_cps_realize(DeviceState *dev, Error **errp)
bool itu_present = false;
bool saar_present = false;
+ if (!clock_get(s->clock)) {
+ error_setg(errp, "CPS input clock is not connected to an output
clock");
+ return;
+ }
+
for (i = 0; i < s->num_vp; i++) {
cpu = MIPS_CPU(object_new(s->cpu_type));
@@ -82,6 +87,7 @@ static void mips_cps_realize(DeviceState *dev, Error **errp)
errp)) {
return;
}
+ /* All cores use the same clock tree */
qdev_connect_clock_in(DEVICE(cpu), "clk-in", s->clock);
if (!qdev_realize_and_unref(DEVICE(cpu), NULL, errp)) {
--
2.26.2
- Re: [PATCH v3 12/20] hw/mips/r4k: Explicit CPU frequency is 200 MHz, (continued)
[PATCH v3 14/20] hw/mips/mipssim: Correct CPU frequency, Philippe Mathieu-Daudé, 2020/10/10
[PATCH v3 18/20] hw/mips/malta: Set CPU frequency to 320 MHz, Philippe Mathieu-Daudé, 2020/10/10
[PATCH v3 20/20] target/mips/cpu: Display warning when CPU is used without input clock, Philippe Mathieu-Daudé, 2020/10/10
[PATCH v3 17/20] hw/mips/boston: Set CPU frequency to 1 GHz, Philippe Mathieu-Daudé, 2020/10/10
[PATCH v3 13/20] hw/mips/fuloong2e: Set CPU frequency to 533 MHz, Philippe Mathieu-Daudé, 2020/10/10
[PATCH v3 16/20] hw/mips/cps: Expose input clock and connect it to CPU cores, Philippe Mathieu-Daudé, 2020/10/10
[PATCH v3 15/20] hw/mips/jazz: Correct CPU frequencies, Philippe Mathieu-Daudé, 2020/10/10
[PATCH v3 19/20] hw/mips/cps: Do not allow use without input clock,
Philippe Mathieu-Daudé <=