public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH] riscv: Only enable OF_BOARD_FIXUP for S-Mode
@ 2020-09-05 13:22 Sean Anderson
  2020-09-06 11:18 ` Heinrich Schuchardt
  2020-09-11  7:29 ` Bin Meng
  0 siblings, 2 replies; 10+ messages in thread
From: Sean Anderson @ 2020-09-05 13:22 UTC (permalink / raw)
  To: u-boot

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: 1c17e55594a394ced7de88d91be294eaf8c564c1
Signed-off-by: Sean Anderson <seanga2@gmail.com>
---

 arch/riscv/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index 009a545fcf..13fac51483 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -288,6 +288,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.28.0

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-09-16  9:41 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-05 13:22 [PATCH] riscv: Only enable OF_BOARD_FIXUP for S-Mode Sean Anderson
2020-09-06 11:18 ` Heinrich Schuchardt
2020-09-06 12:56   ` Sean Anderson
2020-09-11  7:29 ` Bin Meng
2020-09-11 10:20   ` Sean Anderson
2020-09-11 14:43     ` Bin Meng
2020-09-11 18:25       ` Sean Anderson
2020-09-14  6:38         ` Bin Meng
2020-09-14 11:57           ` Sean Anderson
2020-09-16  9:41             ` Leo Liang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox