[Concept,03/15] riscv: Disable OF_BOARD_FIXUP for EFI applications

Message ID 20260212001410.1919749-4-sjg@u-boot.org
State New
Headers
Series riscv: Add EFI-application support |

Commit Message

Simon Glass Feb. 12, 2026, 12:13 a.m. UTC
  From: Simon Glass <simon.glass@canonical.com>

The OF_BOARD_FIXUP event handler riscv_fdt_copy_resv_mem_node() tries
to expand the FDT in place by 1 KiB to copy reserved-memory nodes from
the firmware device tree. For EFI applications the FDT is embedded with
no extra space, so fdt_open_into() fails and causes a crash.

Disable OF_BOARD_FIXUP for EFI_APP builds. The EFI application does not
need to copy firmware reserved-memory nodes since it runs on top of the
UEFI firmware which manages its own memory map.

Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
---

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

Patch

diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index 3434dd0e169..378a974f06c 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -500,7 +500,7 @@  config STACK_SIZE_SHIFT
 	default 14
 
 config OF_BOARD_FIXUP
-	default y if OF_SEPARATE && RISCV_SMODE
+	default y if OF_SEPARATE && RISCV_SMODE && !EFI_APP
 
 menu "Use assembly optimized implementation of memory routines"