diff mbox

[v2,1/2] boot/uboot: add support for i.MX28 SD format

Message ID 1427030715-1737-2-git-send-email-arnout@mind.be
State Accepted
Headers show

Commit Message

Arnout Vandecappelle March 22, 2015, 1:25 p.m. UTC
From: Vincent Stehlé <vincent.stehle@freescale.com>

Allow to generate u-boot.sd, Freescale i.MX28 SB format with a header for
booting from an SD card.

U-boot includes an mxsboot tool to generate this format, starting from
v2011.12.

See u-boot doc/README.mxs (or doc/README.mx28_common before 2013.07).

[Arnout:
 - Wrap Config.in help text at 72 columns.
 - Remove v from U-Boot version specifier.
 - Refer to different README name before 2013.07.
 - Depend on host-elftosb
 - Add comment to clarify sb -> sd conversion.]

Signed-off-by: Vincent Stehlé <vincent.stehle@freescale.com>
Tested-by: Jörg Krause <joerg.krause@embedded.rocks>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
 boot/uboot/Config.in | 12 ++++++++++++
 boot/uboot/uboot.mk  |  7 +++++++
 2 files changed, 19 insertions(+)

Comments

Jörg Krause March 22, 2015, 9:02 p.m. UTC | #1
Hi Arnout,

On So, 2015-03-22 at 14:25 +0100, Arnout Vandecappelle (Essensium/Mind)
wrote:
> From: Vincent Stehlé <vincent.stehle@freescale.com>
> 
> Allow to generate u-boot.sd, Freescale i.MX28 SB format with a header for
> booting from an SD card.
> 
> U-boot includes an mxsboot tool to generate this format, starting from
> v2011.12.
> 
> See u-boot doc/README.mxs (or doc/README.mx28_common before 2013.07).
> 
> [Arnout:
>  - Wrap Config.in help text at 72 columns.
>  - Remove v from U-Boot version specifier.
>  - Refer to different README name before 2013.07.
>  - Depend on host-elftosb

host-elftosb is not necessary anymore. BootStream support has been
merged upstream and it's not necessary to convert the u-boot binary with
elftosb. This should be removed for u-boot.sb make target as well. 

>  - Add comment to clarify sb -> sd conversion.]
> 
> Signed-off-by: Vincent Stehlé <vincent.stehle@freescale.com>
> Tested-by: Jörg Krause <joerg.krause@embedded.rocks>
> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
> Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
> ---
>  boot/uboot/Config.in | 12 ++++++++++++
>  boot/uboot/uboot.mk  |  7 +++++++
>  2 files changed, 19 insertions(+)
> 
> diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in
> index 03e6acc..3f39ee8 100644
> --- a/boot/uboot/Config.in
> +++ b/boot/uboot/Config.in
> @@ -117,6 +117,18 @@ config BR2_TARGET_UBOOT_FORMAT_SB
>  	depends on BR2_arm
>  	bool "u-boot.sb"
>  
> +config BR2_TARGET_UBOOT_FORMAT_SD
> +	depends on BR2_arm
> +	bool "u-boot.sd"
> +	help
> +	  This is Freescale i.MX28 SB format, with a header for booting

i.MX28 BootStream (.sb) format

> +	  from an SD card.
> +
> +	  U-boot includes an mxsboot tool to generate this format,
> +	  starting from 2011.12.
> +
> +	  See doc/README.mxs (or doc/README.mx28_common before 2013.07)
> +
>  config BR2_TARGET_UBOOT_FORMAT_CUSTOM
>  	bool "Custom (specify below)"
>  	help
> diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
> index a9ba054..630619a 100644
> --- a/boot/uboot/uboot.mk
> +++ b/boot/uboot/uboot.mk
> @@ -49,6 +49,11 @@ else ifeq ($(BR2_TARGET_UBOOT_FORMAT_SB),y)
>  UBOOT_BIN = u-boot.sb
>  UBOOT_MAKE_TARGET = $(UBOOT_BIN)
>  UBOOT_DEPENDENCIES += host-elftosb
> +else ifeq ($(BR2_TARGET_UBOOT_FORMAT_SD),y)
> +# BootStream (.sb) is generated by U-Boot, we convert it to SD format
> +UBOOT_BIN = u-boot.sd
> +UBOOT_MAKE_TARGET = u-boot.sb
> +UBOOT_DEPENDENCIES += host-elftosb
>  else ifeq ($(BR2_TARGET_UBOOT_FORMAT_CUSTOM),y)
>  UBOOT_BIN = $(call qstrip,$(BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME))
>  else
> @@ -116,6 +121,8 @@ define UBOOT_BUILD_CMDS
>  	$(TARGET_CONFIGURE_OPTS) 	\
>  		$(MAKE) -C $(@D) $(UBOOT_MAKE_OPTS) 		\
>  		$(UBOOT_MAKE_TARGET)
> +	$(if $(BR2_TARGET_UBOOT_FORMAT_SD),
> +		$(@D)/tools/mxsboot sd $(@D)/u-boot.sb $(@D)/u-boot.sd)
>  endef
>  
>  define UBOOT_BUILD_OMAP_IFT

Best regards
Jörg
Jörg Krause March 22, 2015, 9:15 p.m. UTC | #2
Hi Arnout,

On So, 2015-03-22 at 22:02 +0100, Jörg Krause wrote:
> Hi Arnout,
> 
> On So, 2015-03-22 at 14:25 +0100, Arnout Vandecappelle (Essensium/Mind)
> wrote:
> > From: Vincent Stehlé <vincent.stehle@freescale.com>
> > 
> > Allow to generate u-boot.sd, Freescale i.MX28 SB format with a header for
> > booting from an SD card.
> > 
> > U-boot includes an mxsboot tool to generate this format, starting from
> > v2011.12.
> > 
> > See u-boot doc/README.mxs (or doc/README.mx28_common before 2013.07).
> > 
> > [Arnout:
> >  - Wrap Config.in help text at 72 columns.
> >  - Remove v from U-Boot version specifier.
> >  - Refer to different README name before 2013.07.
> >  - Depend on host-elftosb
> 
> host-elftosb is not necessary anymore. BootStream support has been
> merged upstream and it's not necessary to convert the u-boot binary with
> elftosb. This should be removed for u-boot.sb make target as well. 

Sorry, I just saw your comment on this in the other mail. Would it make
sense to extract the version from the Makefile in uboots build
directory?

Best regards
Jörg
Jörg Krause March 22, 2015, 9:30 p.m. UTC | #3
Hi Arnout,

On So, 2015-03-22 at 22:15 +0100, Jörg Krause wrote:
> Hi Arnout,
> 
> On So, 2015-03-22 at 22:02 +0100, Jörg Krause wrote:
> > Hi Arnout,
> > 
> > On So, 2015-03-22 at 14:25 +0100, Arnout Vandecappelle (Essensium/Mind)
> > wrote:
> > > From: Vincent Stehlé <vincent.stehle@freescale.com>
> > > 
> > > Allow to generate u-boot.sd, Freescale i.MX28 SB format with a header for
> > > booting from an SD card.
> > > 
> > > U-boot includes an mxsboot tool to generate this format, starting from
> > > v2011.12.
> > > 
> > > See u-boot doc/README.mxs (or doc/README.mx28_common before 2013.07).
> > > 
> > > [Arnout:
> > >  - Wrap Config.in help text at 72 columns.
> > >  - Remove v from U-Boot version specifier.
> > >  - Refer to different README name before 2013.07.
> > >  - Depend on host-elftosb
> > 
> > host-elftosb is not necessary anymore. BootStream support has been
> > merged upstream and it's not necessary to convert the u-boot binary with
> > elftosb. This should be removed for u-boot.sb make target as well. 
> 
> Sorry, I just saw your comment on this in the other mail. Would it make
> sense to extract the version from the Makefile in uboots build
> directory?
> 

Stupid idea from me, it's about build dependency. Please, forget this :)
Jörg Krause March 24, 2015, 7:37 a.m. UTC | #4
On So, 2015-03-22 at 14:25 +0100, Arnout Vandecappelle (Essensium/Mind)
wrote:
> From: Vincent Stehlé <vincent.stehle@freescale.com>
> 
> Allow to generate u-boot.sd, Freescale i.MX28 SB format with a header for
> booting from an SD card.
> 
> U-boot includes an mxsboot tool to generate this format, starting from
> v2011.12.
> 
> See u-boot doc/README.mxs (or doc/README.mx28_common before 2013.07).
> 
> [Arnout:
>  - Wrap Config.in help text at 72 columns.
>  - Remove v from U-Boot version specifier.
>  - Refer to different README name before 2013.07.
>  - Depend on host-elftosb
>  - Add comment to clarify sb -> sd conversion.]
> 
> Signed-off-by: Vincent Stehlé <vincent.stehle@freescale.com>
> Tested-by: Jörg Krause <joerg.krause@embedded.rocks>
> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
> Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
> ---
>  boot/uboot/Config.in | 12 ++++++++++++
>  boot/uboot/uboot.mk  |  7 +++++++
>  2 files changed, 19 insertions(+)
> 
> diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in
> index 03e6acc..3f39ee8 100644
> --- a/boot/uboot/Config.in
> +++ b/boot/uboot/Config.in
> @@ -117,6 +117,18 @@ config BR2_TARGET_UBOOT_FORMAT_SB
>  	depends on BR2_arm
>  	bool "u-boot.sb"
>  
> +config BR2_TARGET_UBOOT_FORMAT_SD
> +	depends on BR2_arm
> +	bool "u-boot.sd"
> +	help
> +	  This is Freescale i.MX28 SB format, with a header for booting
> +	  from an SD card.
> +
> +	  U-boot includes an mxsboot tool to generate this format,
> +	  starting from 2011.12.
> +
> +	  See doc/README.mxs (or doc/README.mx28_common before 2013.07)
> +
>  config BR2_TARGET_UBOOT_FORMAT_CUSTOM
>  	bool "Custom (specify below)"
>  	help
> diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
> index a9ba054..630619a 100644
> --- a/boot/uboot/uboot.mk
> +++ b/boot/uboot/uboot.mk
> @@ -49,6 +49,11 @@ else ifeq ($(BR2_TARGET_UBOOT_FORMAT_SB),y)
>  UBOOT_BIN = u-boot.sb
>  UBOOT_MAKE_TARGET = $(UBOOT_BIN)
>  UBOOT_DEPENDENCIES += host-elftosb
> +else ifeq ($(BR2_TARGET_UBOOT_FORMAT_SD),y)
> +# BootStream (.sb) is generated by U-Boot, we convert it to SD format
> +UBOOT_BIN = u-boot.sd
> +UBOOT_MAKE_TARGET = u-boot.sb
> +UBOOT_DEPENDENCIES += host-elftosb
>  else ifeq ($(BR2_TARGET_UBOOT_FORMAT_CUSTOM),y)
>  UBOOT_BIN = $(call qstrip,$(BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME))
>  else
> @@ -116,6 +121,8 @@ define UBOOT_BUILD_CMDS
>  	$(TARGET_CONFIGURE_OPTS) 	\
>  		$(MAKE) -C $(@D) $(UBOOT_MAKE_OPTS) 		\
>  		$(UBOOT_MAKE_TARGET)
> +	$(if $(BR2_TARGET_UBOOT_FORMAT_SD),
> +		$(@D)/tools/mxsboot sd $(@D)/u-boot.sb $(@D)/u-boot.sd)
>  endef
>  
>  define UBOOT_BUILD_OMAP_IFT

After understanding that host-elftosb is needed for older U-Boot versions:

Reviewed-by: Jörg Krause <joerg.krause@embedded.rocks>
diff mbox

Patch

diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in
index 03e6acc..3f39ee8 100644
--- a/boot/uboot/Config.in
+++ b/boot/uboot/Config.in
@@ -117,6 +117,18 @@  config BR2_TARGET_UBOOT_FORMAT_SB
 	depends on BR2_arm
 	bool "u-boot.sb"
 
+config BR2_TARGET_UBOOT_FORMAT_SD
+	depends on BR2_arm
+	bool "u-boot.sd"
+	help
+	  This is Freescale i.MX28 SB format, with a header for booting
+	  from an SD card.
+
+	  U-boot includes an mxsboot tool to generate this format,
+	  starting from 2011.12.
+
+	  See doc/README.mxs (or doc/README.mx28_common before 2013.07)
+
 config BR2_TARGET_UBOOT_FORMAT_CUSTOM
 	bool "Custom (specify below)"
 	help
diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
index a9ba054..630619a 100644
--- a/boot/uboot/uboot.mk
+++ b/boot/uboot/uboot.mk
@@ -49,6 +49,11 @@  else ifeq ($(BR2_TARGET_UBOOT_FORMAT_SB),y)
 UBOOT_BIN = u-boot.sb
 UBOOT_MAKE_TARGET = $(UBOOT_BIN)
 UBOOT_DEPENDENCIES += host-elftosb
+else ifeq ($(BR2_TARGET_UBOOT_FORMAT_SD),y)
+# BootStream (.sb) is generated by U-Boot, we convert it to SD format
+UBOOT_BIN = u-boot.sd
+UBOOT_MAKE_TARGET = u-boot.sb
+UBOOT_DEPENDENCIES += host-elftosb
 else ifeq ($(BR2_TARGET_UBOOT_FORMAT_CUSTOM),y)
 UBOOT_BIN = $(call qstrip,$(BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME))
 else
@@ -116,6 +121,8 @@  define UBOOT_BUILD_CMDS
 	$(TARGET_CONFIGURE_OPTS) 	\
 		$(MAKE) -C $(@D) $(UBOOT_MAKE_OPTS) 		\
 		$(UBOOT_MAKE_TARGET)
+	$(if $(BR2_TARGET_UBOOT_FORMAT_SD),
+		$(@D)/tools/mxsboot sd $(@D)/u-boot.sb $(@D)/u-boot.sd)
 endef
 
 define UBOOT_BUILD_OMAP_IFT