aarch64: correct SCTLR_EL1_KERNEL for AA32 kernels

Bits [31:0] of the AArch64 SCTLR_EL1 register are architecturally mapped
to bits [31:0] of the AArch32 SCTLR register. This means that any
individual bit always has the same value across the two registers.

Across the two registers, the same bit may have distinct meanings,
distinct RESx behaviour, and distinct reset behaviour. For example,
SCTLR_EL1[28] is nTLSMD, which we wich to initialize to 0b1, whereas
SCTLR[28] is TRE, which we wish to initialize to 0b0.

To avoid setting bits which we did not intend to, and in preparation for
configuring more AArch64 RES1 bits, this patch decouples the
SCTLR_EL1_KERNEL value used for AArch32 kernels from the SCTLR_EL1_RES1
definitions such that is does not inherit AArch64 SCTLR_EL1 bits which
would be problematic in the AArch32 SCTLR. For now we open-code a copy
of the bits defined in arch/aarch64/include/asm/cpu.h.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
1 file changed