[PATCH] arm11mpcore: initialize SCTLR reset value

vpyr posted 1 patch 2 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260912183110.502358-1-vpyr@vpyr.dev
Maintainers: Peter Maydell <peter.maydell@linaro.org>
target/arm/tcg/cpu32.c | 1 +
1 file changed, 1 insertion(+)
[PATCH] arm11mpcore: initialize SCTLR reset value
Posted by vpyr 2 weeks ago
From: vpyr <vpyr@proton.me>

Initialize reset_sctlr to 0x00054078 in arm11mpcore_initfn.

Previously, the generic reset mechanism initialized SCTLR to zero because
reset_sctlr was not set by the ARM11 MPCore CPU initialization function.
The new value follows the fixed-bit requirements documented in ARM DDI 0360F,
section 3.4.7, Table 3-20:

- Bits [21:16]: 000101, contributing 0x00050000
- Bit [14]: Should Be One / Read As One, contributing 0x00004000
- Bits [6:3]: Should Be One, contributing 0x00000078

V, U, and EE remain clear because their reset values depend on the VINITHI
and CFGEND configuration signals.

After rebuilding, the test read SCTLR as 0x00054078 instead of zero, and the
0x00050078 mask check passed.

Signed-off-by: Felipe Junger <vpyr@vpyr.dev>
---
 target/arm/tcg/cpu32.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/arm/tcg/cpu32.c b/target/arm/tcg/cpu32.c
index f292a269bf..1999e50290 100644
--- a/target/arm/tcg/cpu32.c
+++ b/target/arm/tcg/cpu32.c
@@ -218,6 +218,7 @@ static void arm11mpcore_initfn(Object *obj)
     cpu->isar.mvfr0 = 0x11111111;
     cpu->isar.mvfr1 = 0x00000000;
     cpu->ctr = 0x1d192992; /* 32K icache 32K dcache */
+    cpu->reset_sctlr = 0x00054078;
     SET_IDREG(isar, ID_PFR0, 0x111);
     SET_IDREG(isar, ID_PFR1, 0x1);
     SET_IDREG(isar, ID_DFR0, 0);
-- 
2.55.0
Re: [PATCH] arm11mpcore: initialize SCTLR reset value
Posted by Peter Maydell 1 week, 5 days ago
On Sat, 12 Sept 2026 at 19:31, vpyr <vpyr@vpyr.dev> wrote:
>
> From: vpyr <vpyr@proton.me>
>
> Initialize reset_sctlr to 0x00054078 in arm11mpcore_initfn.
>
> Previously, the generic reset mechanism initialized SCTLR to zero because
> reset_sctlr was not set by the ARM11 MPCore CPU initialization function.
> The new value follows the fixed-bit requirements documented in ARM DDI 0360F,
> section 3.4.7, Table 3-20:
>
> - Bits [21:16]: 000101, contributing 0x00050000
> - Bit [14]: Should Be One / Read As One, contributing 0x00004000
> - Bits [6:3]: Should Be One, contributing 0x00000078
>
> V, U, and EE remain clear because their reset values depend on the VINITHI
> and CFGEND configuration signals.
>
> After rebuilding, the test read SCTLR as 0x00054078 instead of zero, and the
> 0x00050078 mask check passed.

Thanks. This matches the reset value documented in the summary
table 3.2 in the 11MPCore TRM.

Applied to target-arm.next, thanks. (I added the
Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/4454
line to the commit message which will cause the bug to be
auto-closed when this is committed.)

-- PMM