[PATCH 5/9] PBL: fdt: make minimum fdt size configurable
Michael Tretter
m.tretter at pengutronix.de
Mon May 26 07:38:11 PDT 2025
Adding or modifying nodes in the fdt may change the size of the fdt.
This needs some reserved space in the fdt to avoid overriding memory
that comes after the fdt and is already used.
Signed-off-by: Michael Tretter <m.tretter at pengutronix.de>
---
pbl/Kconfig | 11 +++++++++++
scripts/Makefile.lib | 2 ++
2 files changed, 13 insertions(+)
diff --git a/pbl/Kconfig b/pbl/Kconfig
index 6e3581829d589c7b06ed878b09bf74e16a0c3086..489b2001a855d62e11a2159311332b0e67f3a754 100644
--- a/pbl/Kconfig
+++ b/pbl/Kconfig
@@ -60,6 +60,17 @@ config PBL_VERIFY_PIGGY
config PBL_CLOCKSOURCE
bool
+config PBL_FDT_MIN_SIZE
+ hex
+ default 0x0
+ prompt "Minimum size of the FDT blob"
+ help
+ The TF-A or OP-TEE may modify the FDT or add nodes to the FDT. This
+ may increases the size of the device tree. This may override the
+ barebox binary.
+
+ The minimum size should be at least CFG_DTB_MAX_SIZE for OP-TEE.
+
config BOARD_GENERIC_DT
bool
select LIBFDT
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index b10119797686ea31fe927d29a7849ad525c8c835..f50006f57200a76a86c7e29175dd7e35ab138e26 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -396,6 +396,8 @@ ifeq ($(CONFIG_OF_OVERLAY_LIVE), y)
DTC_FLAGS.dtb += -@
endif
+DTC_FLAGS.dtb += --space $(CONFIG_PBL_FDT_MIN_SIZE)
+
DTC_FLAGS.dtbo += -Wno-avoid_default_addr_size -Wno-reg_format
# Generate an assembly file to wrap the output of the device tree compiler
--
2.39.5
More information about the barebox
mailing list