From: Stephan Gerhold Date: Mon, 7 Apr 2025 16:59:22 +0000 (+0200) Subject: mach-snapdragon: Fix EL2 boot on DragonBoard 410c X-Git-Tag: v2025.07-rc1~78^2~12 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fa9eb2f1e6a4feb28f2fa489e153fac249b117fb;p=pandora-u-boot.git mach-snapdragon: Fix EL2 boot on DragonBoard 410c The workaround for the "PSCI bug" on DragonBoard 410c implemented in arch/arm/mach-snapdragon/include/mach/boot0.h clobbers the x0 register by storing the CurrentEL in there. When running in EL1, the mode switch sequence implemented there later clears the register again, but this is skipped when U-Boot is booted in EL2. This causes crashes in the mach-snapdragon board_fdt_blob_setup() later, because the invalid address stored in x0 gets dereferenced to check if it points to a valid DTB. We can't rely on having a valid values in the CPU registers for the first stage bootloader configuration on DB410c, and nothing would place a DTB there anyway. Skip selecting the SAVE_PREV_BL_FDT_ADDR option for the boot0 hook case to avoid crashing with the clobbered register value. Fixes: 059d526af312 ("mach-snapdragon: generalise board support") Signed-off-by: Stephan Gerhold Reviewed-by: Neil Armstrong Reviewed-by: Link: https://lore.kernel.org/r/20250407-db410c-fixes-v1-1-524aefbc8bb4@linaro.org Signed-off-by: Caleb Connolly --- diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 6e234af4ac9..d8c99d3ab19 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -1120,7 +1120,7 @@ config ARCH_SNAPDRAGON select SPMI select BOARD_LATE_INIT select OF_BOARD - select SAVE_PREV_BL_FDT_ADDR + select SAVE_PREV_BL_FDT_ADDR if !ENABLE_ARM_SOC_BOOT0_HOOK select LINUX_KERNEL_IMAGE_HEADER if !ENABLE_ARM_SOC_BOOT0_HOOK select SYSRESET select SYSRESET_PSCI