mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Alexander Dahl <ada@thorsis.com>
To: ptxdist@pengutronix.de
Subject: [ptxdist] [PATCH 3/3] u-boot: Add integration of firmware blobs
Date: Mon,  6 May 2024 15:12:44 +0200	[thread overview]
Message-ID: <20240506131244.401909-4-ada@thorsis.com> (raw)
In-Reply-To: <20240506131244.401909-1-ada@thorsis.com>

Almost same approach as done for barebox with commit
6684c552fbd7 ("barebox: add integration of firmware blobs") already.

For some boards it is required to inject files to build dir.  This is
cleaner and not cluttering your source dir.  In U-Boot it seems to work
in both ways, injecting to source or build dir, so we opt for build dir.

Signed-off-by: Alexander Dahl <ada@thorsis.com>
---
 platforms/u-boot.firmware.in |  7 +++++++
 platforms/u-boot.in          |  8 ++++++++
 rules/u-boot.make            | 20 ++++++++++++++++----
 3 files changed, 31 insertions(+), 4 deletions(-)
 create mode 100644 platforms/u-boot.firmware.in

diff --git a/platforms/u-boot.firmware.in b/platforms/u-boot.firmware.in
new file mode 100644
index 000000000..da7f8128f
--- /dev/null
+++ b/platforms/u-boot.firmware.in
@@ -0,0 +1,7 @@
+## SECTION=u_boot_firmware
+
+#
+# This file does only exist to create a defined entry in the "u_boot_firmware"
+# section, so that the toplevel Kconfig can include generated/u_boot_firmware.in
+# even if no package is in that category.
+#
diff --git a/platforms/u-boot.in b/platforms/u-boot.in
index 9163a8378..5ce7387e4 100644
--- a/platforms/u-boot.in
+++ b/platforms/u-boot.in
@@ -90,6 +90,14 @@ config U_BOOT_CONFIG
 
 endif
 
+menuconfig U_BOOT_FIRMWARE
+	bool
+	prompt "integrate firmware blobs      "
+
+if U_BOOT_FIRMWARE
+source "generated/u_boot_firmware.in"
+endif
+
 config U_BOOT_CUSTOM_MAKE_ENV
 	prompt "Custom (additional) make environment"
 	string
diff --git a/rules/u-boot.make b/rules/u-boot.make
index e4c963d0c..2a8059170 100644
--- a/rules/u-boot.make
+++ b/rules/u-boot.make
@@ -36,6 +36,9 @@ endif
 # Prepare
 # ----------------------------------------------------------------------------
 
+U_BOOT_INJECT_PATH	:= ${PTXDIST_SYSROOT_TARGET}/usr/lib/firmware
+U_BOOT_INJECT_OOT	:= $(call ptx/ifdef, PTXCONF_U_BOOT_BUILD_OOT,YES,NO)
+
 ifdef PTXCONF_U_BOOT_BOOT_SCRIPT
 U_BOOT_BOOT_SCRIPT_TXT := $(call ptx/in-platformconfigdir, uboot.scr)
 U_BOOT_BOOT_SCRIPT_BIN := $(call remove_quotes, \
@@ -93,14 +96,23 @@ $(U_BOOT_CONFIG):
 	@exit 1
 endif
 
-
-ifdef PTXCONF_U_BOOT_CONFIGSYSTEM_LEGACY
 $(STATEDIR)/u-boot.prepare:
 	@$(call targetinfo)
-	$(U_BOOT_CONF_ENV) $(MAKE) $(U_BOOT_CONF_OPT)
-	@$(call touch)
+
+ifdef PTXCONF_U_BOOT_CONFIGSYSTEM_KCONFIG
+	@$(call world/prepare, U_BOOT)
 endif
 
+ifdef PTXCONF_U_BOOT_CONFIGSYSTEM_LEGACY
+	$(U_BOOT_CONF_ENV) $(MAKE) $(U_BOOT_CONF_OPT)
+endif
+
+ifdef PTXCONF_U_BOOT_FIRMWARE
+	@$(call world/inject, U_BOOT)
+endif
+
+	@$(call touch)
+
 # ----------------------------------------------------------------------------
 # Compile
 # ----------------------------------------------------------------------------
-- 
2.39.2




  parent reply	other threads:[~2024-05-06 13:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-06 13:12 [ptxdist] [PATCH 0/3] u-boot: Extend for using external firmware Alexander Dahl
2024-05-06 13:12 ` [ptxdist] [PATCH 1/3] u-boot: Add option to pass additional make env Alexander Dahl
2024-05-12 13:16   ` [ptxdist] [APPLIED] " Michael Olbrich
2024-05-06 13:12 ` [ptxdist] [PATCH 2/3] u-boot: Allow other packages to inject dependencies Alexander Dahl
2024-05-12 13:16   ` [ptxdist] [APPLIED] " Michael Olbrich
2024-05-06 13:12 ` Alexander Dahl [this message]
2024-05-12 13:16   ` [ptxdist] [APPLIED] u-boot: Add integration of firmware blobs Michael Olbrich

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=20240506131244.401909-4-ada@thorsis.com \
    --to=ada@thorsis.com \
    --cc=ptxdist@pengutronix.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