mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH 1/2] tf-a: add new host-tf-a recipe
@ 2022-06-02  6:38 Ahmad Fatoum
  2022-06-02  6:38 ` [ptxdist] [PATCH 2/2] tf-a: support multiple wildcard patterns in TF_A_ARTIFACTS Ahmad Fatoum
  2022-06-03  9:38 ` [ptxdist] [PATCH 1/2] tf-a: add new host-tf-a recipe Michael Olbrich
  0 siblings, 2 replies; 4+ messages in thread
From: Ahmad Fatoum @ 2022-06-02  6:38 UTC (permalink / raw)
  To: ptxdist; +Cc: Christian Melki, Ahmad Fatoum, Uwe Kleine-König

FIP is becoming the standard for firmware booted by ARM Trusted
Firmware. While TF-A provides a fip target to assemble such images,
building them outside the TF-A build by means of fiptool (e.g. via
genimage[0]) can provide more flexibility.
Add a host-tf-a rule to facilitate this.

[0]: https://github.com/pengutronix/genimage/pull/190

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 platforms/host-tf-a.in |  7 +++++++
 rules/host-tf-a.make   | 20 ++++++++++++++++++++
 2 files changed, 27 insertions(+)
 create mode 100644 platforms/host-tf-a.in
 create mode 100644 rules/host-tf-a.make

diff --git a/platforms/host-tf-a.in b/platforms/host-tf-a.in
new file mode 100644
index 000000000000..825f3a38b97c
--- /dev/null
+++ b/platforms/host-tf-a.in
@@ -0,0 +1,7 @@
+## SECTION=hosttools_noprompt
+
+config HOST_TF_A
+	tristate
+	default y if ALLYES
+	help
+	  This provides fiptool
diff --git a/rules/host-tf-a.make b/rules/host-tf-a.make
new file mode 100644
index 000000000000..9b4a94f7ab93
--- /dev/null
+++ b/rules/host-tf-a.make
@@ -0,0 +1,20 @@
+# -*-makefile-*-
+# Copyright (C) 2021 by Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+HOST_PACKAGES-$(PTXCONF_HOST_TF_A) += host-tf-a
+
+HOST_TF_A_MAKE_OPT = fiptool
+
+$(STATEDIR)/host-tf-a.install:
+	@$(call targetinfo)
+	install -vD -m755 $(HOST_TF_A_DIR)/tools/fiptool/fiptool $(HOST_TF_A_PKGDIR)/bin/fiptool
+	@$(call touch)
+
+# vim: syntax=make
-- 
2.30.2




^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ptxdist] [PATCH 2/2] tf-a: support multiple wildcard patterns in TF_A_ARTIFACTS
  2022-06-02  6:38 [ptxdist] [PATCH 1/2] tf-a: add new host-tf-a recipe Ahmad Fatoum
@ 2022-06-02  6:38 ` Ahmad Fatoum
  2022-06-03  6:33   ` Michael Olbrich
  2022-06-03  9:38 ` [ptxdist] [PATCH 1/2] tf-a: add new host-tf-a recipe Michael Olbrich
  1 sibling, 1 reply; 4+ messages in thread
From: Ahmad Fatoum @ 2022-06-02  6:38 UTC (permalink / raw)
  To: ptxdist; +Cc: Christian Melki, Ahmad Fatoum, Uwe Kleine-König

To assemble FIT images outside TF-A, we will need to collect more
than can be expressed by a single wildcard, so extend TF_A_ARTIFACTS
to support multiple space separated patterns.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 rules/tf-a.make | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/rules/tf-a.make b/rules/tf-a.make
index 7695a4c546e3..e96aaf3aa6f9 100644
--- a/rules/tf-a.make
+++ b/rules/tf-a.make
@@ -89,7 +89,8 @@ $(STATEDIR)/tf-a.compile:
 # ----------------------------------------------------------------------------
 
 tf-a/inst_plat = $(foreach artifact, \
-	$(wildcard $(TF_A_BUILDDIR)/$(1)/$(if $(filter DEBUG=1,$(call remove_quotes,$(PTXCONF_TF_A_EXTRA_ARGS))),debug,release)/$(TF_A_ARTIFACTS)), \
+	$(foreach pattern, $(TF_A_ARTIFACTS), \
+	$(wildcard $(TF_A_BUILDDIR)/$(1)/$(if $(filter DEBUG=1,$(call remove_quotes,$(PTXCONF_TF_A_EXTRA_ARGS))),debug,release)/$(pattern))), \
 	install -v -D -m 644 $(artifact) \
 		$(2)/$(1)-$(notdir $(artifact))$(ptx/nl))
 
-- 
2.30.2




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ptxdist] [PATCH 2/2] tf-a: support multiple wildcard patterns in TF_A_ARTIFACTS
  2022-06-02  6:38 ` [ptxdist] [PATCH 2/2] tf-a: support multiple wildcard patterns in TF_A_ARTIFACTS Ahmad Fatoum
@ 2022-06-03  6:33   ` Michael Olbrich
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Olbrich @ 2022-06-03  6:33 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: Christian Melki, ptxdist, Uwe Kleine-König

On Thu, Jun 02, 2022 at 08:38:23AM +0200, Ahmad Fatoum wrote:
> To assemble FIT images outside TF-A, we will need to collect more
> than can be expressed by a single wildcard, so extend TF_A_ARTIFACTS
> to support multiple space separated patterns.
> 
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
>  rules/tf-a.make | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/rules/tf-a.make b/rules/tf-a.make
> index 7695a4c546e3..e96aaf3aa6f9 100644
> --- a/rules/tf-a.make
> +++ b/rules/tf-a.make
> @@ -89,7 +89,8 @@ $(STATEDIR)/tf-a.compile:
>  # ----------------------------------------------------------------------------
>  
>  tf-a/inst_plat = $(foreach artifact, \
> -	$(wildcard $(TF_A_BUILDDIR)/$(1)/$(if $(filter DEBUG=1,$(call remove_quotes,$(PTXCONF_TF_A_EXTRA_ARGS))),debug,release)/$(TF_A_ARTIFACTS)), \
> +	$(foreach pattern, $(TF_A_ARTIFACTS), \
> +	$(wildcard $(TF_A_BUILDDIR)/$(1)/$(if $(filter DEBUG=1,$(call remove_quotes,$(PTXCONF_TF_A_EXTRA_ARGS))),debug,release)/$(pattern))), \

This gets rather long and use addprefix.

Maybe like this:

TF_A_EXTRA_ARGS	:= $(call remove_quotes,$(PTXCONF_TF_A_EXTRA_ARGS))

This can be reuses in the TF_A_MAKE_OPT as well.

TF_A_BINDIR	:= $(TF_A_BUILDDIR)/$(1)/$(if $(filter DEBUG=1,$(TF_A_EXTRA_ARGS)),debug,release)

[...]
	$(wildcard $(addprefix $(TF_A_BINDIR),$(TF_A_ARTIFACTS))), \

Michael

>  	install -v -D -m 644 $(artifact) \
>  		$(2)/$(1)-$(notdir $(artifact))$(ptx/nl))
>  
> -- 
> 2.30.2
> 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ptxdist] [PATCH 1/2] tf-a: add new host-tf-a recipe
  2022-06-02  6:38 [ptxdist] [PATCH 1/2] tf-a: add new host-tf-a recipe Ahmad Fatoum
  2022-06-02  6:38 ` [ptxdist] [PATCH 2/2] tf-a: support multiple wildcard patterns in TF_A_ARTIFACTS Ahmad Fatoum
@ 2022-06-03  9:38 ` Michael Olbrich
  1 sibling, 0 replies; 4+ messages in thread
From: Michael Olbrich @ 2022-06-03  9:38 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: Christian Melki, ptxdist, Uwe Kleine-König

On Thu, Jun 02, 2022 at 08:38:22AM +0200, Ahmad Fatoum wrote:
> FIP is becoming the standard for firmware booted by ARM Trusted
> Firmware. While TF-A provides a fip target to assemble such images,
> building them outside the TF-A build by means of fiptool (e.g. via
> genimage[0]) can provide more flexibility.
> Add a host-tf-a rule to facilitate this.
> 
> [0]: https://github.com/pengutronix/genimage/pull/190
> 
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
>  platforms/host-tf-a.in |  7 +++++++
>  rules/host-tf-a.make   | 20 ++++++++++++++++++++
>  2 files changed, 27 insertions(+)
>  create mode 100644 platforms/host-tf-a.in
>  create mode 100644 rules/host-tf-a.make
> 
> diff --git a/platforms/host-tf-a.in b/platforms/host-tf-a.in
> new file mode 100644
> index 000000000000..825f3a38b97c
> --- /dev/null
> +++ b/platforms/host-tf-a.in
> @@ -0,0 +1,7 @@
> +## SECTION=hosttools_noprompt
> +
> +config HOST_TF_A
> +	tristate
> +	default y if ALLYES

This is a problem: The package inherits the version from tf-a so if that is
not enabled, then the version is missing. It will be selected by image
packages right? So it's ok if it is only available in the platformconfig.
So:

## SECTION=hosttools_platform

config HOST_TF_A
	tristate
	default y if ALLYES && TF_A

> +	help
> +	  This provides fiptool
> diff --git a/rules/host-tf-a.make b/rules/host-tf-a.make
> new file mode 100644
> index 000000000000..9b4a94f7ab93
> --- /dev/null
> +++ b/rules/host-tf-a.make
> @@ -0,0 +1,20 @@
> +# -*-makefile-*-
> +# Copyright (C) 2021 by Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> +#
> +# For further information about the PTXdist project and license conditions
> +# see the README file.
> +#
> +
> +#
> +# We provide this package
> +#
> +HOST_PACKAGES-$(PTXCONF_HOST_TF_A) += host-tf-a
> +
> +HOST_TF_A_MAKE_OPT = fiptool
> +
> +$(STATEDIR)/host-tf-a.install:
> +	@$(call targetinfo)
> +	install -vD -m755 $(HOST_TF_A_DIR)/tools/fiptool/fiptool \
		$(HOST_TF_A_PKGDIR)/bin/fiptool

break.

Michael

> +	@$(call touch)
> +
> +# vim: syntax=make
> -- 
> 2.30.2
> 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-06-03  9:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-02  6:38 [ptxdist] [PATCH 1/2] tf-a: add new host-tf-a recipe Ahmad Fatoum
2022-06-02  6:38 ` [ptxdist] [PATCH 2/2] tf-a: support multiple wildcard patterns in TF_A_ARTIFACTS Ahmad Fatoum
2022-06-03  6:33   ` Michael Olbrich
2022-06-03  9:38 ` [ptxdist] [PATCH 1/2] tf-a: add new host-tf-a recipe Michael Olbrich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox