* [ptxdist] [PATCH 0/3] u-boot: Extend for using external firmware
@ 2024-05-06 13:12 Alexander Dahl
2024-05-06 13:12 ` [ptxdist] [PATCH 1/3] u-boot: Add option to pass additional make env Alexander Dahl
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Alexander Dahl @ 2024-05-06 13:12 UTC (permalink / raw)
To: ptxdist
Hello everyone,
for quite some new boards external firmware blobs are required to build
a working bootloader image. This series is the follow-up to the
reworked ptxdist inject mechanism and allows to build U-Boot for modern
boards with i.MX8 or i.MX9 SoCs (and probably more).
Greets
Alex
Alexander Dahl (3):
u-boot: Add option to pass additional make env
u-boot: Allow other packages to inject dependencies
u-boot: Add integration of firmware blobs
platforms/u-boot.firmware.in | 7 +++++++
platforms/u-boot.in | 22 ++++++++++++++++++++++
rules/u-boot.make | 24 +++++++++++++++++++-----
3 files changed, 48 insertions(+), 5 deletions(-)
create mode 100644 platforms/u-boot.firmware.in
base-commit: 5a720c419cd1fabde04e8de8d1d1367c76a2666b
--
2.39.2
^ permalink raw reply [flat|nested] 7+ messages in thread
* [ptxdist] [PATCH 1/3] u-boot: Add option to pass additional make env
2024-05-06 13:12 [ptxdist] [PATCH 0/3] u-boot: Extend for using external firmware Alexander Dahl
@ 2024-05-06 13:12 ` 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-06 13:12 ` [ptxdist] [PATCH 3/3] u-boot: Add integration of firmware blobs Alexander Dahl
2 siblings, 1 reply; 7+ messages in thread
From: Alexander Dahl @ 2024-05-06 13:12 UTC (permalink / raw)
To: ptxdist
Some things need to be set in environment instead of passing them as
additional make opts.
Signed-off-by: Alexander Dahl <ada@thorsis.com>
---
platforms/u-boot.in | 9 +++++++++
rules/u-boot.make | 4 +++-
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/platforms/u-boot.in b/platforms/u-boot.in
index 000ca491a..53db146e1 100644
--- a/platforms/u-boot.in
+++ b/platforms/u-boot.in
@@ -85,6 +85,15 @@ config U_BOOT_CONFIG
endif
+config U_BOOT_CUSTOM_MAKE_ENV
+ prompt "Custom (additional) make environment"
+ string
+ help
+ List of additional env variables set for make at build time.
+ Can be used for example to set BINMAN_INDIRS= to a path
+ containing firmware files (preferably somewhere in
+ sysroot-target).
+
config U_BOOT_CUSTOM_MAKE_OPTS
prompt "Custom make options"
string
diff --git a/rules/u-boot.make b/rules/u-boot.make
index 4bc7f3f78..e4c963d0c 100644
--- a/rules/u-boot.make
+++ b/rules/u-boot.make
@@ -63,7 +63,9 @@ U_BOOT_CONF_OPT := \
U_BOOT_MAKE_ENV := \
CROSS_COMPILE=$(BOOTLOADER_CROSS_COMPILE) \
- HOSTCC=$(HOSTCC)
+ HOSTCC=$(HOSTCC) \
+ $(call remove_quotes,$(PTXCONF_U_BOOT_CUSTOM_MAKE_ENV))
+
U_BOOT_MAKE_OPT := $(U_BOOT_CONF_OPT)
U_BOOT_TAGS_OPT := ctags cscope etags
--
2.39.2
^ permalink raw reply [flat|nested] 7+ messages in thread
* [ptxdist] [PATCH 2/3] u-boot: Allow other packages to inject dependencies
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-06 13:12 ` Alexander Dahl
2024-05-12 13:16 ` [ptxdist] [APPLIED] " Michael Olbrich
2024-05-06 13:12 ` [ptxdist] [PATCH 3/3] u-boot: Add integration of firmware blobs Alexander Dahl
2 siblings, 1 reply; 7+ messages in thread
From: Alexander Dahl @ 2024-05-06 13:12 UTC (permalink / raw)
To: ptxdist
Same approach as in barebox packages.
Signed-off-by: Alexander Dahl <ada@thorsis.com>
---
platforms/u-boot.in | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/platforms/u-boot.in b/platforms/u-boot.in
index 53db146e1..9163a8378 100644
--- a/platforms/u-boot.in
+++ b/platforms/u-boot.in
@@ -1,6 +1,11 @@
## SECTION=bootloader
+config U_BOOT_DEPENDENCIES
+ tristate
+ select VIRTUAL
+
menuconfig U_BOOT
+ select U_BOOT_DEPENDENCIES
select BOOTLOADER
select HOST_SYSTEM_PYTHON3
select HOST_OPENSSL if U_BOOT_NEEDS_HOST_OPENSSL
--
2.39.2
^ permalink raw reply [flat|nested] 7+ messages in thread
* [ptxdist] [PATCH 3/3] u-boot: Add integration of firmware blobs
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-06 13:12 ` [ptxdist] [PATCH 2/3] u-boot: Allow other packages to inject dependencies Alexander Dahl
@ 2024-05-06 13:12 ` Alexander Dahl
2024-05-12 13:16 ` [ptxdist] [APPLIED] " Michael Olbrich
2 siblings, 1 reply; 7+ messages in thread
From: Alexander Dahl @ 2024-05-06 13:12 UTC (permalink / raw)
To: ptxdist
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [ptxdist] [APPLIED] u-boot: Add option to pass additional make env
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 ` Michael Olbrich
0 siblings, 0 replies; 7+ messages in thread
From: Michael Olbrich @ 2024-05-12 13:16 UTC (permalink / raw)
To: ptxdist; +Cc: Alexander Dahl
Thanks, applied as 32707042153ff15d17e4cf7810f84b1e558e8369.
Michael
[sent from post-receive hook]
On Sun, 12 May 2024 15:16:44 +0200, Alexander Dahl <ada@thorsis.com> wrote:
> Some things need to be set in environment instead of passing them as
> additional make opts.
>
> Signed-off-by: Alexander Dahl <ada@thorsis.com>
> Message-Id: <20240506131244.401909-2-ada@thorsis.com>
> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
>
> diff --git a/platforms/u-boot.in b/platforms/u-boot.in
> index 000ca491a1c2..53db146e18ad 100644
> --- a/platforms/u-boot.in
> +++ b/platforms/u-boot.in
> @@ -85,6 +85,15 @@ config U_BOOT_CONFIG
>
> endif
>
> +config U_BOOT_CUSTOM_MAKE_ENV
> + prompt "Custom (additional) make environment"
> + string
> + help
> + List of additional env variables set for make at build time.
> + Can be used for example to set BINMAN_INDIRS= to a path
> + containing firmware files (preferably somewhere in
> + sysroot-target).
> +
> config U_BOOT_CUSTOM_MAKE_OPTS
> prompt "Custom make options"
> string
> diff --git a/rules/u-boot.make b/rules/u-boot.make
> index 4bc7f3f781fc..e4c963d0c5a3 100644
> --- a/rules/u-boot.make
> +++ b/rules/u-boot.make
> @@ -63,7 +63,9 @@ U_BOOT_CONF_OPT := \
>
> U_BOOT_MAKE_ENV := \
> CROSS_COMPILE=$(BOOTLOADER_CROSS_COMPILE) \
> - HOSTCC=$(HOSTCC)
> + HOSTCC=$(HOSTCC) \
> + $(call remove_quotes,$(PTXCONF_U_BOOT_CUSTOM_MAKE_ENV))
> +
> U_BOOT_MAKE_OPT := $(U_BOOT_CONF_OPT)
>
> U_BOOT_TAGS_OPT := ctags cscope etags
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [ptxdist] [APPLIED] u-boot: Allow other packages to inject dependencies
2024-05-06 13:12 ` [ptxdist] [PATCH 2/3] u-boot: Allow other packages to inject dependencies Alexander Dahl
@ 2024-05-12 13:16 ` Michael Olbrich
0 siblings, 0 replies; 7+ messages in thread
From: Michael Olbrich @ 2024-05-12 13:16 UTC (permalink / raw)
To: ptxdist; +Cc: Alexander Dahl
Thanks, applied as 3d8f856576f96e24869f24dd58f90eee2496a2e4.
Michael
[sent from post-receive hook]
On Sun, 12 May 2024 15:16:45 +0200, Alexander Dahl <ada@thorsis.com> wrote:
> Same approach as in barebox packages.
>
> Signed-off-by: Alexander Dahl <ada@thorsis.com>
> Message-Id: <20240506131244.401909-3-ada@thorsis.com>
> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
>
> diff --git a/platforms/u-boot.in b/platforms/u-boot.in
> index 53db146e18ad..9163a837827a 100644
> --- a/platforms/u-boot.in
> +++ b/platforms/u-boot.in
> @@ -1,6 +1,11 @@
> ## SECTION=bootloader
>
> +config U_BOOT_DEPENDENCIES
> + tristate
> + select VIRTUAL
> +
> menuconfig U_BOOT
> + select U_BOOT_DEPENDENCIES
> select BOOTLOADER
> select HOST_SYSTEM_PYTHON3
> select HOST_OPENSSL if U_BOOT_NEEDS_HOST_OPENSSL
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [ptxdist] [APPLIED] u-boot: Add integration of firmware blobs
2024-05-06 13:12 ` [ptxdist] [PATCH 3/3] u-boot: Add integration of firmware blobs Alexander Dahl
@ 2024-05-12 13:16 ` Michael Olbrich
0 siblings, 0 replies; 7+ messages in thread
From: Michael Olbrich @ 2024-05-12 13:16 UTC (permalink / raw)
To: ptxdist; +Cc: Alexander Dahl
Thanks, applied as a5e90b02053a4173471a6dba5ab0f31a2aefeea2.
Michael
[sent from post-receive hook]
On Sun, 12 May 2024 15:16:46 +0200, Alexander Dahl <ada@thorsis.com> wrote:
> 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>
> Message-Id: <20240506131244.401909-4-ada@thorsis.com>
> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
>
> diff --git a/platforms/u-boot.firmware.in b/platforms/u-boot.firmware.in
> new file mode 100644
> index 000000000000..da7f8128f14d
> --- /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 9163a837827a..5ce7387e495d 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 e4c963d0c5a3..2a8059170ad5 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)
> +
> +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)
> - @$(call touch)
> endif
>
> +ifdef PTXCONF_U_BOOT_FIRMWARE
> + @$(call world/inject, U_BOOT)
> +endif
> +
> + @$(call touch)
> +
> # ----------------------------------------------------------------------------
> # Compile
> # ----------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-05-12 13:18 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [ptxdist] [PATCH 3/3] u-boot: Add integration of firmware blobs Alexander Dahl
2024-05-12 13:16 ` [ptxdist] [APPLIED] " Michael Olbrich
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox