aboutsummaryrefslogtreecommitdiff
path: root/hw/misc
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2019-02-28 10:55:16 +0000
committerPeter Maydell <peter.maydell@linaro.org>2019-02-28 11:03:04 +0000
commitaab7a3786f085cb4c6842c3c8ea0c86e2c835248 (patch)
tree7092ff3025bb665a92832a83a3d313c6f9089a8f /hw/misc
parent0f862986e02f5cc188e56b8bd6a8a203091c1dc2 (diff)
downloadqemu-aab7a3786f085cb4c6842c3c8ea0c86e2c835248.zip
qemu-aab7a3786f085cb4c6842c3c8ea0c86e2c835248.tar.gz
qemu-aab7a3786f085cb4c6842c3c8ea0c86e2c835248.tar.bz2
hw/arm/armsse: Unify init-svtor and cpuwait handling
At the moment the handling of init-svtor and cpuwait initial values is split between armsse.c and iotkit-sysctl.c: the code in armsse.c sets the initial state of the CPU object by setting the init-svtor and start-powered-off properties, but the iotkit-sysctl.c code has its own code setting the reset values of its registers (which are then used when updating the CPU when the guest makes runtime changes). Clean this up by making the armsse.c code set properties on the iotkit-sysctl object to define the initial values of the registers, so they always match the initial CPU state, and update the comments in armsse.c accordingly. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20190219125808.25174-9-peter.maydell@linaro.org
Diffstat (limited to 'hw/misc')
-rw-r--r--hw/misc/iotkit-sysctl.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/hw/misc/iotkit-sysctl.c b/hw/misc/iotkit-sysctl.c
index e333c81..54064a3 100644
--- a/hw/misc/iotkit-sysctl.c
+++ b/hw/misc/iotkit-sysctl.c
@@ -404,18 +404,9 @@ static void iotkit_sysctl_reset(DeviceState *dev)
s->reset_syndrome = 1;
s->reset_mask = 0;
s->gretreg = 0;
- s->initsvtor0 = 0x10000000;
- s->initsvtor1 = 0x10000000;
- if (s->is_sse200) {
- /*
- * CPU 0 starts on, CPU 1 starts off. In real hardware this is
- * configurable by the SoC integrator as a verilog parameter.
- */
- s->cpuwait = 2;
- } else {
- /* CPU 0 starts on */
- s->cpuwait = 0;
- }
+ s->initsvtor0 = s->initsvtor0_rst;
+ s->initsvtor1 = s->initsvtor1_rst;
+ s->cpuwait = s->cpuwait_rst;
s->wicctrl = 0;
s->scsecctrl = 0;
s->fclk_div = 0;
@@ -500,6 +491,11 @@ static const VMStateDescription iotkit_sysctl_vmstate = {
static Property iotkit_sysctl_props[] = {
DEFINE_PROP_UINT32("SYS_VERSION", IoTKitSysCtl, sys_version, 0),
+ DEFINE_PROP_UINT32("CPUWAIT_RST", IoTKitSysCtl, cpuwait_rst, 0),
+ DEFINE_PROP_UINT32("INITSVTOR0_RST", IoTKitSysCtl, initsvtor0_rst,
+ 0x10000000),
+ DEFINE_PROP_UINT32("INITSVTOR1_RST", IoTKitSysCtl, initsvtor1_rst,
+ 0x10000000),
DEFINE_PROP_END_OF_LIST()
};