mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH] u-boot: Add support for custom make options
@ 2020-02-14 11:07 Guillermo Rodríguez
  2020-02-14 11:13 ` Guillermo Rodriguez Garcia
  0 siblings, 1 reply; 4+ messages in thread
From: Guillermo Rodríguez @ 2020-02-14 11:07 UTC (permalink / raw)
  To: ptxdist; +Cc: Guillermo Rodríguez

Add a generic mechanism to allow passing custom make options to
U-boot. This can be used for example to pass a DEVICE_TREE= value.

Signed-off-by: Guillermo Rodriguez <guille.rodriguez@gmail.com>
---
 platforms/u-boot.in | 7 +++++++
 rules/u-boot.make   | 3 ++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/platforms/u-boot.in b/platforms/u-boot.in
index 50fb008a3..491faed60 100644
--- a/platforms/u-boot.in
+++ b/platforms/u-boot.in
@@ -71,6 +71,13 @@ config U_BOOT_CONFIG
 
 endif
 
+config U_BOOT_CUSTOM_MAKE_OPTS
+	prompt "Custom make options"
+	string
+	help
+	  List of custom make options passed at build time. Can be
+	  used for example to pass a DEVICE_TREE= value.
+
 choice
 	prompt "Generate environment image"
 	default U_BOOT_ENV_IMAGE_NONE
diff --git a/rules/u-boot.make b/rules/u-boot.make
index 0c6bccc71..e386dc4d2 100644
--- a/rules/u-boot.make
+++ b/rules/u-boot.make
@@ -55,7 +55,8 @@ U_BOOT_WRAPPER_BLACKLIST := \
 U_BOOT_CONF_OPT		:= \
 	-C $(U_BOOT_DIR) \
 	O=$(U_BOOT_BUILD_DIR) \
-	V=$(PTXDIST_VERBOSE)
+	V=$(PTXDIST_VERBOSE) \
+	$(call remove_quotes,$(PTXCONF_U_BOOT_CUSTOM_MAKE_OPTS))
 
 U_BOOT_MAKE_ENV		:= \
 	CROSS_COMPILE=$(BOOTLOADER_CROSS_COMPILE) \
-- 
2.21.0


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] [PATCH] u-boot: Add support for custom make options
  2020-02-14 11:07 [ptxdist] [PATCH] u-boot: Add support for custom make options Guillermo Rodríguez
@ 2020-02-14 11:13 ` Guillermo Rodriguez Garcia
  2020-02-15  9:07   ` Michael Olbrich
  0 siblings, 1 reply; 4+ messages in thread
From: Guillermo Rodriguez Garcia @ 2020-02-14 11:13 UTC (permalink / raw)
  To: ptxdist

Hi all,

A little explanation on this.

I need to pass DEVICE_TREE=xxx to uboot as this is the "official" way
to build u-boot for the stm32mp1 platform with a device tree other
than the board's default. I started preparing a patch to allow setting
a DEVICE_TREE value specifically, but there are other ways to do the
same, e.g. EXT_DTB to specify a precompiled device tree instead. So I
though perhaps a generic mechanism would be more useful. I also had a
look at buildroot and a similar (generic) mechanism exists as well, so
I ended up doing it like that.

Comments welcome.

Guillermo

El vie., 14 feb. 2020 a las 12:07, Guillermo Rodríguez
(<guille.rodriguez@gmail.com>) escribió:
>
> Add a generic mechanism to allow passing custom make options to
> U-boot. This can be used for example to pass a DEVICE_TREE= value.
>
> Signed-off-by: Guillermo Rodriguez <guille.rodriguez@gmail.com>
> ---
>  platforms/u-boot.in | 7 +++++++
>  rules/u-boot.make   | 3 ++-
>  2 files changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/platforms/u-boot.in b/platforms/u-boot.in
> index 50fb008a3..491faed60 100644
> --- a/platforms/u-boot.in
> +++ b/platforms/u-boot.in
> @@ -71,6 +71,13 @@ config U_BOOT_CONFIG
>
>  endif
>
> +config U_BOOT_CUSTOM_MAKE_OPTS
> +       prompt "Custom make options"
> +       string
> +       help
> +         List of custom make options passed at build time. Can be
> +         used for example to pass a DEVICE_TREE= value.
> +
>  choice
>         prompt "Generate environment image"
>         default U_BOOT_ENV_IMAGE_NONE
> diff --git a/rules/u-boot.make b/rules/u-boot.make
> index 0c6bccc71..e386dc4d2 100644
> --- a/rules/u-boot.make
> +++ b/rules/u-boot.make
> @@ -55,7 +55,8 @@ U_BOOT_WRAPPER_BLACKLIST := \
>  U_BOOT_CONF_OPT                := \
>         -C $(U_BOOT_DIR) \
>         O=$(U_BOOT_BUILD_DIR) \
> -       V=$(PTXDIST_VERBOSE)
> +       V=$(PTXDIST_VERBOSE) \
> +       $(call remove_quotes,$(PTXCONF_U_BOOT_CUSTOM_MAKE_OPTS))
>
>  U_BOOT_MAKE_ENV                := \
>         CROSS_COMPILE=$(BOOTLOADER_CROSS_COMPILE) \
> --
> 2.21.0
>


-- 
Guillermo Rodriguez Garcia
guille.rodriguez@gmail.com

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] [PATCH] u-boot: Add support for custom make options
  2020-02-14 11:13 ` Guillermo Rodriguez Garcia
@ 2020-02-15  9:07   ` Michael Olbrich
  2020-02-17  8:17     ` [ptxdist] [PATCH v2] " Guillermo Rodríguez
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Olbrich @ 2020-02-15  9:07 UTC (permalink / raw)
  To: ptxdist

On Fri, Feb 14, 2020 at 12:13:31PM +0100, Guillermo Rodriguez Garcia wrote:
> Hi all,
> 
> A little explanation on this.
> 
> I need to pass DEVICE_TREE=xxx to uboot as this is the "official" way
> to build u-boot for the stm32mp1 platform with a device tree other
> than the board's default. I started preparing a patch to allow setting
> a DEVICE_TREE value specifically, but there are other ways to do the
> same, e.g. EXT_DTB to specify a precompiled device tree instead. So I
> though perhaps a generic mechanism would be more useful. I also had a
> look at buildroot and a similar (generic) mechanism exists as well, so
> I ended up doing it like that.

Can you put that explanation in the commit message please? It'll ensure
that I won't remove the option in the future because I think its not
needed.

Michael

> Comments welcome.
> 
> Guillermo
> 
> El vie., 14 feb. 2020 a las 12:07, Guillermo Rodríguez
> (<guille.rodriguez@gmail.com>) escribió:
> >
> > Add a generic mechanism to allow passing custom make options to
> > U-boot. This can be used for example to pass a DEVICE_TREE= value.
> >
> > Signed-off-by: Guillermo Rodriguez <guille.rodriguez@gmail.com>
> > ---
> >  platforms/u-boot.in | 7 +++++++
> >  rules/u-boot.make   | 3 ++-
> >  2 files changed, 9 insertions(+), 1 deletion(-)
> >
> > diff --git a/platforms/u-boot.in b/platforms/u-boot.in
> > index 50fb008a3..491faed60 100644
> > --- a/platforms/u-boot.in
> > +++ b/platforms/u-boot.in
> > @@ -71,6 +71,13 @@ config U_BOOT_CONFIG
> >
> >  endif
> >
> > +config U_BOOT_CUSTOM_MAKE_OPTS
> > +       prompt "Custom make options"
> > +       string
> > +       help
> > +         List of custom make options passed at build time. Can be
> > +         used for example to pass a DEVICE_TREE= value.
> > +
> >  choice
> >         prompt "Generate environment image"
> >         default U_BOOT_ENV_IMAGE_NONE
> > diff --git a/rules/u-boot.make b/rules/u-boot.make
> > index 0c6bccc71..e386dc4d2 100644
> > --- a/rules/u-boot.make
> > +++ b/rules/u-boot.make
> > @@ -55,7 +55,8 @@ U_BOOT_WRAPPER_BLACKLIST := \
> >  U_BOOT_CONF_OPT                := \
> >         -C $(U_BOOT_DIR) \
> >         O=$(U_BOOT_BUILD_DIR) \
> > -       V=$(PTXDIST_VERBOSE)
> > +       V=$(PTXDIST_VERBOSE) \
> > +       $(call remove_quotes,$(PTXCONF_U_BOOT_CUSTOM_MAKE_OPTS))
> >
> >  U_BOOT_MAKE_ENV                := \
> >         CROSS_COMPILE=$(BOOTLOADER_CROSS_COMPILE) \
> > --
> > 2.21.0
> >
> 
> 
> -- 
> Guillermo Rodriguez Garcia
> guille.rodriguez@gmail.com
> 
> _______________________________________________
> ptxdist mailing list
> ptxdist@pengutronix.de

-- 
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 |

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

* [ptxdist] [PATCH v2] u-boot: Add support for custom make options
  2020-02-15  9:07   ` Michael Olbrich
@ 2020-02-17  8:17     ` Guillermo Rodríguez
  0 siblings, 0 replies; 4+ messages in thread
From: Guillermo Rodríguez @ 2020-02-17  8:17 UTC (permalink / raw)
  To: ptxdist; +Cc: Guillermo Rodríguez

For some platforms (e.g. stm32mp1) the official way to build U-boot
with a device tree other than the board's default requires passing
additional make options such as DEVICE_TREE=xxx or EXT_DTB=xxx.
Instead of adding each possible option as a parameter in the .in
file, add a generic mechanism to allow passing custom make options
to U-boot. A similar approach has been adopted by buildroot.

Signed-off-by: Guillermo Rodriguez <guille.rodriguez@gmail.com>
---
v2: Rewrite commit message including rationale

 platforms/u-boot.in | 7 +++++++
 rules/u-boot.make   | 3 ++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/platforms/u-boot.in b/platforms/u-boot.in
index 50fb008a3..491faed60 100644
--- a/platforms/u-boot.in
+++ b/platforms/u-boot.in
@@ -71,6 +71,13 @@ config U_BOOT_CONFIG
 
 endif
 
+config U_BOOT_CUSTOM_MAKE_OPTS
+	prompt "Custom make options"
+	string
+	help
+	  List of custom make options passed at build time. Can be
+	  used for example to pass a DEVICE_TREE= value.
+
 choice
 	prompt "Generate environment image"
 	default U_BOOT_ENV_IMAGE_NONE
diff --git a/rules/u-boot.make b/rules/u-boot.make
index 0c6bccc71..e386dc4d2 100644
--- a/rules/u-boot.make
+++ b/rules/u-boot.make
@@ -55,7 +55,8 @@ U_BOOT_WRAPPER_BLACKLIST := \
 U_BOOT_CONF_OPT		:= \
 	-C $(U_BOOT_DIR) \
 	O=$(U_BOOT_BUILD_DIR) \
-	V=$(PTXDIST_VERBOSE)
+	V=$(PTXDIST_VERBOSE) \
+	$(call remove_quotes,$(PTXCONF_U_BOOT_CUSTOM_MAKE_OPTS))
 
 U_BOOT_MAKE_ENV		:= \
 	CROSS_COMPILE=$(BOOTLOADER_CROSS_COMPILE) \
-- 
2.21.0


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

end of thread, other threads:[~2020-02-17  8:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-14 11:07 [ptxdist] [PATCH] u-boot: Add support for custom make options Guillermo Rodríguez
2020-02-14 11:13 ` Guillermo Rodriguez Garcia
2020-02-15  9:07   ` Michael Olbrich
2020-02-17  8:17     ` [ptxdist] [PATCH v2] " Guillermo Rodríguez

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