diff mbox series

[U-Boot,1/2] Makefile: Add target to generate hex output for combined spl and dtb

Message ID 20190322153208.8440-1-dalon.westergreen@linux.intel.com
State Superseded
Delegated to: Marek Vasut
Headers show
Series [U-Boot,1/2] Makefile: Add target to generate hex output for combined spl and dtb | expand

Commit Message

Dalon L Westergreen March 22, 2019, 3:32 p.m. UTC
From: Dalon Westergreen <dalon.westergreen@intel.com>

Some architectures, Stratix10, require a hex formatted spl that combines
the spl image and dtb.  This adds a target to create said hex file with
and offset of SPL_TEXT_BASE.

Signed-off-by: Dalon Westergreen <dalon.westergreen@intel.com>
---
 Makefile | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Simon Glass March 30, 2019, 9:18 p.m. UTC | #1
Hi,

On Fri, 22 Mar 2019 at 09:32, Dalon Westergreen
<dalon.westergreen@linux.intel.com> wrote:
>
> From: Dalon Westergreen <dalon.westergreen@intel.com>
>
> Some architectures, Stratix10, require a hex formatted spl that combines
> the spl image and dtb.  This adds a target to create said hex file with
> and offset of SPL_TEXT_BASE.
>
> Signed-off-by: Dalon Westergreen <dalon.westergreen@intel.com>
> ---
>  Makefile | 9 +++++++++
>  1 file changed, 9 insertions(+)

Reviewed-by: Simon Glass <sjg@chromium.org>

Please see below.

>
> diff --git a/Makefile b/Makefile
> index c52a33b403..ecba06ffce 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1074,6 +1074,11 @@ OBJCOPYFLAGS_u-boot-spl.hex = $(OBJCOPYFLAGS_u-boot.hex)
>  spl/u-boot-spl.hex: spl/u-boot-spl FORCE
>         $(call if_changed,objcopy)
>
> +OBJCOPYFLAGS_u-boot-spl-dtb.hex := -I binary -O ihex --change-address=$(CONFIG_SPL_TEXT_BASE)

Can we drop the -dtb part here? u-boot-spl includes the DTB anyway. It
is the -nodtb version which does not.

> +
> +spl/u-boot-spl-dtb.hex: spl/u-boot-spl-dtb.bin FORCE
> +       $(call if_changed,objcopy)
> +
>  binary_size_check: u-boot-nodtb.bin FORCE
>         @file_size=$(shell wc -c u-boot-nodtb.bin | awk '{print $$1}') ; \
>         map_size=$(shell cat u-boot.map | \
> @@ -1643,6 +1648,10 @@ u-boot.lds: $(LDSCRIPT) prepare FORCE
>
>  spl/u-boot-spl.bin: spl/u-boot-spl
>         @:
> +
> +spl/u-boot-spl-dtb.bin: spl/u-boot-spl
> +       @:
> +
>  spl/u-boot-spl: tools prepare \
>                 $(if $(CONFIG_OF_SEPARATE)$(CONFIG_OF_EMBED)$(CONFIG_SPL_OF_PLATDATA),dts/dt.dtb) \
>                 $(if $(CONFIG_OF_SEPARATE)$(CONFIG_OF_EMBED)$(CONFIG_TPL_OF_PLATDATA),dts/dt.dtb)
> --
> 2.20.1
>

Regards,
Simon
Dalon L Westergreen April 2, 2019, 1:12 p.m. UTC | #2
On Sat, 2019-03-30 at 15:18 -0600, Simon Glass wrote:
> Hi,
> On Fri, 22 Mar 2019 at 09:32, Dalon Westergreen<
> dalon.westergreen@linux.intel.com> wrote:
> > From: Dalon Westergreen <dalon.westergreen@intel.com>
> > Some architectures, Stratix10, require a hex formatted spl that combinesthe
> > spl image and dtb.  This adds a target to create said hex file withand
> > offset of SPL_TEXT_BASE.
> > Signed-off-by: Dalon Westergreen <dalon.westergreen@intel.com>--- Makefile |
> > 9 +++++++++ 1 file changed, 9 insertions(+)
> 
> Reviewed-by: Simon Glass <sjg@chromium.org>
> Please see below.
> > diff --git a/Makefile b/Makefileindex c52a33b403..ecba06ffce 100644---
> > a/Makefile+++ b/Makefile@@ -1074,6 +1074,11 @@ OBJCOPYFLAGS_u-boot-spl.hex =
> > $(OBJCOPYFLAGS_u-boot.hex) spl/u-boot-spl.hex: spl/u-boot-spl
> > FORCE        $(call if_changed,objcopy)
> > +OBJCOPYFLAGS_u-boot-spl-dtb.hex := -I binary -O ihex --change-
> > address=$(CONFIG_SPL_TEXT_BASE)
> 
> Can we drop the -dtb part here? u-boot-spl includes the DTB anyway. Itis the
> -nodtb version which does not.

sure thing.

> 
> > +
> > +spl/u-boot-spl-dtb.hex: spl/u-boot-spl-dtb.bin FORCE
> > +       $(call if_changed,objcopy)
> > +
> >  binary_size_check: u-boot-nodtb.bin FORCE
> >         @file_size=$(shell wc -c u-boot-nodtb.bin | awk '{print $$1}') ; \
> >         map_size=$(shell cat u-boot.map | \
> > @@ -1643,6 +1648,10 @@ u-boot.lds: $(LDSCRIPT) prepare FORCE
> > 
> >  spl/u-boot-spl.bin: spl/u-boot-spl
> >         @:
> > +
> > +spl/u-boot-spl-dtb.bin: spl/u-boot-spl
> > +       @:
> > +
> >  spl/u-boot-spl: tools prepare \
> >                 $(if $(CONFIG_OF_SEPARATE)$(CONFIG_OF_EMBED)$(CONFIG_SPL_OF_PLATDATA),dts/dt.dtb) \
> >                 $(if $(CONFIG_OF_SEPARATE)$(CONFIG_OF_EMBED)$(CONFIG_TPL_OF_PLATDATA),dts/dt.dtb)
> > --
> > 2.20.1
> > 
> 
> Regards,
> Simon
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index c52a33b403..ecba06ffce 100644
--- a/Makefile
+++ b/Makefile
@@ -1074,6 +1074,11 @@  OBJCOPYFLAGS_u-boot-spl.hex = $(OBJCOPYFLAGS_u-boot.hex)
 spl/u-boot-spl.hex: spl/u-boot-spl FORCE
 	$(call if_changed,objcopy)
 
+OBJCOPYFLAGS_u-boot-spl-dtb.hex := -I binary -O ihex --change-address=$(CONFIG_SPL_TEXT_BASE)
+
+spl/u-boot-spl-dtb.hex: spl/u-boot-spl-dtb.bin FORCE
+	$(call if_changed,objcopy)
+
 binary_size_check: u-boot-nodtb.bin FORCE
 	@file_size=$(shell wc -c u-boot-nodtb.bin | awk '{print $$1}') ; \
 	map_size=$(shell cat u-boot.map | \
@@ -1643,6 +1648,10 @@  u-boot.lds: $(LDSCRIPT) prepare FORCE
 
 spl/u-boot-spl.bin: spl/u-boot-spl
 	@:
+
+spl/u-boot-spl-dtb.bin: spl/u-boot-spl
+	@:
+
 spl/u-boot-spl: tools prepare \
 		$(if $(CONFIG_OF_SEPARATE)$(CONFIG_OF_EMBED)$(CONFIG_SPL_OF_PLATDATA),dts/dt.dtb) \
 		$(if $(CONFIG_OF_SEPARATE)$(CONFIG_OF_EMBED)$(CONFIG_TPL_OF_PLATDATA),dts/dt.dtb)