U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: u-boot@lists.denx.de
Subject: [PATCH 3/7] dts: Correct behavior of OF_OMIT_DTB
Date: Tue,  7 Jul 2026 19:25:13 -0600	[thread overview]
Message-ID: <20260708013019.288985-4-trini@konsulko.com> (raw)
In-Reply-To: <20260708013019.288985-1-trini@konsulko.com>

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.

Signed-off-by: Tom Rini <trini@konsulko.com>
---
 Makefile | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 56f59c24cf89..bca5a718f2aa 100644
--- a/Makefile
+++ b/Makefile
@@ -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
@@ -1614,12 +1614,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) ; \
@@ -1631,6 +1637,7 @@ init_sp_bss_offset_check: u-boot.dtb FORCE
 		exit 1 ; \
 	fi
 endif
+endif
 
 shell_cmd = { $(call echo-cmd,$(1)) $(cmd_$(1)); }
 
-- 
2.43.0


  parent reply	other threads:[~2026-07-08  1:30 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-08  1:25 [PATCH 0/7] Correct behavior of OF_OMIT_DTB Tom Rini
2026-07-08  1:25 ` [PATCH 1/7] lib/fdtdec.c: Disallow overriding the fdt address with mandatory passage Tom Rini
2026-07-08 16:26   ` Raymond Mao
2026-07-08 16:32     ` Tom Rini
2026-07-08 17:00       ` Tom Rini
2026-07-08  1:25 ` [PATCH 2/7] vexpress64: Correct CONFIG symbol logic around device tree passage Tom Rini
2026-07-08 16:27   ` Raymond Mao
2026-07-10  7:11   ` Ilias Apalodimas
2026-07-08  1:25 ` Tom Rini [this message]
2026-07-08  1:25 ` [PATCH 4/7] dts: Make DEFAULT_DEVICE_TREE depend on !OF_OMIT_DTB Tom Rini
2026-07-08  1:25 ` [PATCH 5/7] dts: Correct entry for OF_OMIT_DTB Tom Rini
2026-07-08  1:25 ` [PATCH 6/7] powerpc: drop qemu-ppce500 dts Tom Rini
2026-07-08  1:25 ` [PATCH 7/7] arm: Drop unused dts files Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260708013019.288985-4-trini@konsulko.com \
    --to=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox