diff options
| author | Tom Rini <trini@konsulko.com> | 2026-08-24 13:48:45 -0600 |
|---|---|---|
| committer | Tom Rini <trini@konsulko.com> | 2026-09-03 13:21:42 -0600 |
| commit | b9cd57c5cefab330ec91e9c5143470c2811ef87a (patch) | |
| tree | b36460371d118e7fc0199b57d3b81a82bdf72318 | |
| parent | 6f0719e4c420d9e3b1cbe92b2934e03f2f57e6fc (diff) | |
| download | u-boot-b9cd57c5cefab330ec91e9c5143470c2811ef87a.tar.gz u-boot-b9cd57c5cefab330ec91e9c5143470c2811ef87a.zip | |
dts: Correct behavior of OF_OMIT_DTB
When we have enabled CONFIG_OF_OMIT_DTB, we really should then be not
forcing a device tree to be built. This involves two things. First, when
OF_SEPARATE is set, don't say we still need to build dts/dt.dtb. Second,
our init_sp_bss_offset_check check can only cover the non-dtb portion.
Reviewed-by: Yao Zi <me@ziyao.cc>
Signed-off-by: Tom Rini <trini@konsulko.com>
| -rw-r--r-- | Makefile | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -1237,7 +1237,7 @@ INPUTS-$(CONFIG_TPL) += tpl/u-boot-tpl.bin INPUTS-$(CONFIG_VPL) += vpl/u-boot-vpl.bin # Allow omitting the .dtb output if it is not normally used -INPUTS-$(CONFIG_OF_SEPARATE) += $(if $(CONFIG_OF_OMIT_DTB),dts/dt.dtb,u-boot.dtb) +INPUTS-$(CONFIG_OF_SEPARATE) += $(if $(CONFIG_OF_OMIT_DTB),,u-boot.dtb) ifeq ($(CONFIG_SPL_FRAMEWORK),y) INPUTS-$(CONFIG_OF_SEPARATE) += u-boot-dtb.img endif @@ -1615,12 +1615,18 @@ endif # The 1/4 margin below is somewhat arbitrary. The likely initial SP usage is # so low that the DTB could probably use 90%+ of the available space, for # current values of CONFIG_SYS_INIT_SP_BSS_OFFSET at least. However, let's be -# safe for now and tweak this later if space becomes tight. +# safe for now and tweak this later if space becomes tight. When we omit the +# DTB we simply have to have accounted for this when configuring U-Boot. # A rejected alternative would be to check that some absolute minimum stack # space was available. However, since CONFIG_SYS_INIT_SP_BSS_OFFSET is # deliberately build-specific, to take account of build-to-build stack usage # differences due to different feature sets, there is no common absolute value # to check against. +ifneq ($(CONFIG_OF_OMIT_DTB),) +init_sp_bss_offset_check: FORCE + space=$(CONFIG_SYS_INIT_SP_BSS_OFFSET) ; \ + $(subtract_sys_malloc_f_len) +else init_sp_bss_offset_check: u-boot.dtb FORCE @dtb_size=$(shell wc -c u-boot.dtb | awk '{print $$1}') ; \ space=$(CONFIG_SYS_INIT_SP_BSS_OFFSET) ; \ @@ -1632,6 +1638,7 @@ init_sp_bss_offset_check: u-boot.dtb FORCE exit 1 ; \ fi endif +endif shell_cmd = { $(call echo-cmd,$(1)) $(cmd_$(1)); } |
