sunxi: armv8: FEL: save and restore SP_IRQ
authorAndre Przywara <andre.przywara@arm.com>
Mon, 10 Feb 2025 00:25:29 +0000 (00:25 +0000)
committerTom Rini <trini@konsulko.com>
Mon, 28 Apr 2025 18:45:44 +0000 (12:45 -0600)
commit1d26da5a6abaa9ef9cecce2df382d564458de6d8
tree2024e3214e6b769b2a7f9d7a0c791b7fde51dab4
parent5a9014a8ea3823c469f421df3d3ba667326f8a2c
sunxi: armv8: FEL: save and restore SP_IRQ

Thanks for Jernej's JTAG debugging effort, it turns out that the BROM
expects SP_IRQ to be saved and restored, when we want to enter back into
FEL after the SPL's AArch64 stint.
Save and restore SP_IRQ as part of the FEL state handling. The banked
MRS/MSR access to SP_IRQ, without actually being in IRQ mode, was
introduced with the ARMv7 virtualisation extensions. The Arm Cortex-A8
cores used in the A10/A13s or older F1C100s SoCs would not support that,
but this code here is purely in the ARMv8/AArch64 code path, so it's
safe to use unconditionally.

Reported-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
arch/arm/cpu/armv8/fel_utils.S
arch/arm/include/asm/arch-sunxi/boot0.h
arch/arm/mach-sunxi/board.c
arch/arm/mach-sunxi/rmr_switch.S