target/arm: Correct reset value of SCTLR for arm926
PATCH 1/1 target/arm: Correct reset value of SCTLR for arm926
For the arm926 CPU we reset the SCTLR to 0x00090078. This is not the value specified in the ARM926EJ-S TRM (ARM DDI 0198E), which states that bits 16 and 18 are SBO, bit 17 is SBZ, and bits [31:19] are SBZ. It's also not the value seen on real hardware.
This has been wrong in QEMU since 2007 when we first started actively resetting the SCTLR to some fixed value rather than zero.
This wrong value didn't affect any of QEMU's behaviour, because we don't implement any handling of the old pre-v6 meanings of these bits (which were IMPDEF), and their v8 reuse is guarded by appropriate version checks.
Correct the reset value to 0x00050078 (i.e set bit 18 and not 19).
(We use the same reset value for the arm1020; this might also be wrong, but as the ARM1020 TRM doesn't seem to be available we can't check, so leave it as-is.)
Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/4202
--- target/arm/tcg/cpu32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
target/arm/tcg/cpu32.c +1 -1
@@ -33,7 +33,7 @@ static void arm926_initfn(Object *obj) cpu->midr =0x41069265 ; cpu->reset_fpsid =0x41011090 ; cpu->ctr =0x1dd20d2 ; - cpu->reset_sctlr =0x00090078 ; + cpu->reset_sctlr =0x00050078 ;/* * ARMv5 does not have the ID_ISAR registers, but we can still
Signature · 1 line
2.43.0
Quoted 13 lines · Peter Maydell
For the arm926 CPU we reset the SCTLR to
0x00090078. This is not the value specified in the ARM926EJ-S TRM (ARM DDI 0198E), which states that bits 16 and 18 are SBO, bit 17 is SBZ, and bits [31:19] are SBZ. It's also not the value seen on real hardware.This has been wrong in QEMU since 2007 when we first started actively resetting the SCTLR to some fixed value rather than zero.
This wrong value didn't affect any of QEMU's behaviour, because we don't implement any handling of the old pre-v6 meanings of these bits (which were IMPDEF), and their v8 reuse is guarded by appropriate version checks.
Quoted 5 lines
Correct the reset value to
0x00050078(i.e set bit 18 and not 19).(We use the same reset value for the arm1020; this might also be wrong, but as the ARM1020 TRM doesn't seem to be available we can't check, so leave it as-is.)
Found ARM DDI 0244C, ARM1026EJ-S r0p2:
https://www.datasheetarchive.com/datasheet/ARM1026EJ-S/ARM?term=ARM1026EJ-S%25E2%2584%25A2&version=1
which appears to be what arm1026_initfn is modeling.
It also has [23:19] SBZ, [18] SBO, 17 [SBZ], 16 [SBO].
Quoted 8 lines
Fixes 610c3c8afd99f4f11 ("Reset ARM cp15.c1_sys to default values. Fix XScale cp15 accesses.")Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/4202
Signed-off-by Peter Maydell <[email protected]>--- target/arm/tcg/cpu32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Anyway, for this one,
r~