summaryrefslogtreecommitdiffstats
path: root/hw/mips/cps.c
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé2020-10-12 11:58:03 +0200
committerPhilippe Mathieu-Daudé2020-10-17 13:59:40 +0200
commitba25670c1d3e122bfa5a43cd785f5eb4988861d9 (patch)
tree151b52b34266a44542cd167261335a3531ab171b /hw/mips/cps.c
parenthw/mips/malta: Set CPU frequency to 320 MHz (diff)
downloadqemu-ba25670c1d3e122bfa5a43cd785f5eb4988861d9.tar.gz
qemu-ba25670c1d3e122bfa5a43cd785f5eb4988861d9.tar.xz
qemu-ba25670c1d3e122bfa5a43cd785f5eb4988861d9.zip
hw/mips/cps: Do not allow use without input clock
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> Message-Id: <20201012095804.3335117-21-f4bug@amsat.org>
Diffstat (limited to 'hw/mips/cps.c')
-rw-r--r--hw/mips/cps.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/hw/mips/cps.c b/hw/mips/cps.c
index af7b58c4bd..c624821315 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));