U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: Simon Glass <sjg@chromium.org>
Cc: "U-Boot Mailing List" <u-boot@lists.denx.de>,
	"Caleb Connolly" <caleb.connolly@linaro.org>,
	"Jan Kiszka" <jan.kiszka@siemens.com>,
	"Jerry Van Baren" <vanbaren@cideas.com>,
	"Marek Mojík" <marek.mojik@nic.cz>, "Marek Vasut" <marex@denx.de>,
	"Neil Armstrong" <neil.armstrong@linaro.org>,
	"Sumit Garg" <sumit.garg@linaro.org>,
	"This contributor prefers not to receive mails"
	<noreply@example.com>
Subject: Re: [PATCH] fdt: Allow OF_HAS_PRIOR_STAGE to be disabled in defconfig
Date: Thu, 3 Apr 2025 13:02:40 -0600	[thread overview]
Message-ID: <20250403190240.GM5495@bill-the-cat> (raw)
In-Reply-To: <20250403175408.2211779-1-sjg@chromium.org>

[-- Attachment #1: Type: text/plain, Size: 2028 bytes --]

On Fri, Apr 04, 2025 at 06:53:49AM +1300, Simon Glass wrote:

> At present it is impossible to change the qemu_arm64 defconfig to
> obtain a devicetree from the U-Boot build.
> 
> This is necessary for FIT validation, for example, where the signature
> node must be compiled into U-Boot.
> 
> A proposed change to QEMU has been blocked for several years. As a
> workaround, the only option is to use QEMU's dumpdtb option, merge in
> the signature node manually and then disable OF_HAS_PRIOR_STAGE
> 
> Unfortunately the only way to disable OF_HAS_PRIOR_STAGE at present is
> to hack the Kconfig. So update it to allow use from defconfig. This
> avoids needing to patch U-Boot to get this working.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>
> Link: https://patchwork.kernel.org/project/qemu-devel/patch/20210926183410.256484-1-sjg@chromium.org/#24481799

How about instead we do something like:
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index b7311d3b754b..44e45a304cd0 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1080,7 +1080,7 @@ config ARCH_QEMU
 	imply DM_RNG
 	imply DM_RTC
 	imply RTC_PL031
-	imply OF_HAS_PRIOR_STAGE if !TARGET_QEMU_ARM_SBSA
+	imply OF_HAS_PRIOR_STAGE if !QEMU_MANUAL_DTB
 	imply VIDEO
 	imply VIDEO_BOCHS
 	imply SYS_WHITE_ON_BLACK
diff --git a/board/emulation/common/Kconfig b/board/emulation/common/Kconfig
index 4c15c8bcb891..9053f2ff2f55 100644
--- a/board/emulation/common/Kconfig
+++ b/board/emulation/common/Kconfig
@@ -13,3 +13,10 @@ config MTDPARTS_NOR1
 	help
 	  This define the partition of nor1 used to build mtparts dynamically
 	  for the u-boot env stored on nor1.
+
+config QEMU_MANUAL_DTB
+	bool "Manually provide a device tree to QEMU"
+	depends on ARCH_QEMU # Expand more if needed
+	help
+	  For some use cases, such as FIT validation of U-Boot itself we need
+	  to override the device tree that QEMU would normally provide to us.

This way we don't start opening asking OF_HAS_PRIOR_STAGE.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

  reply	other threads:[~2025-04-03 19:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-03 17:53 [PATCH] fdt: Allow OF_HAS_PRIOR_STAGE to be disabled in defconfig Simon Glass
2025-04-03 19:02 ` Tom Rini [this message]
2025-04-03 20:40   ` Simon Glass
2025-04-03 21:48     ` 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=20250403190240.GM5495@bill-the-cat \
    --to=trini@konsulko.com \
    --cc=caleb.connolly@linaro.org \
    --cc=jan.kiszka@siemens.com \
    --cc=marek.mojik@nic.cz \
    --cc=marex@denx.de \
    --cc=neil.armstrong@linaro.org \
    --cc=noreply@example.com \
    --cc=sjg@chromium.org \
    --cc=sumit.garg@linaro.org \
    --cc=u-boot@lists.denx.de \
    --cc=vanbaren@cideas.com \
    /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