mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23:55 -06:00
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
This commit is contained in:
parent
0f862986e0
commit
aab7a3786f
3 changed files with 42 additions and 30 deletions
|
@ -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()
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue