From bcd78dec2f8a40bec121eafb5aa87df616ebb729 Mon Sep 17 00:00:00 2001 From: Sean Anderson Date: Sat, 5 Sep 2020 09:22:11 -0400 Subject: [PATCH] riscv: Only enable OF_BOARD_FIXUP for S-Mode It is unsafe to enable OF_BOARD_FIXUP only based on OF_SEPARATE. OF_SEPARATE may indicate that the user wishes U-Boot to use a different device tree than one obtained via OF_PRIOR_STAGE. However, OF_SEPARATE may also indicate that the device tree which would be obtained via OF_PRIOR_STAGE is invalid, nonexistant, or otherwise unusable. In this latter case, enabling OF_BOARD_FIXUP will result in corruption of the device tree. To remedy this, only enable OF_BOARD_FIXUP if U-Boot is configured for S-Mode. Fixes: e01f8fd3ef16f478cffc332171fae0e045ce62fe Signed-off-by: Sean Anderson Reviewed-by: Leo Liang --- arch/riscv/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index aaa3b833a5..756047636d 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -272,6 +272,6 @@ config STACK_SIZE_SHIFT default 14 config OF_BOARD_FIXUP - default y if OF_SEPARATE + default y if OF_SEPARATE && RISCV_SMODE endmenu -- 2.39.5