* [U-Boot] [PATCH v3] ARM: mxs: tools: Use mkimage for BootStream generation
@ 2013-09-24 15:39 Marek Vasut
2013-09-24 16:13 ` Otavio Salvador
2013-10-10 15:13 ` Stefano Babic
0 siblings, 2 replies; 6+ messages in thread
From: Marek Vasut @ 2013-09-24 15:39 UTC (permalink / raw)
To: u-boot
Now that mkimage can generate an BootStream for i.MX23 and i.MX28,
use the mkimage as a default tool to generate the BootStreams instead
of the elftosb tool. This cuts out another obscure dependency.
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <fabio.estevam@freescale.com>
Cc: Otavio Salvador <otavio@ossystems.com.br>
Cc: Stefano Babic <sbabic@denx.de>
---
arch/arm/cpu/arm926ejs/mxs/Makefile | 11 ++++----
arch/arm/cpu/arm926ejs/mxs/mxsimage.mx23.cfg | 4 +--
arch/arm/cpu/arm926ejs/mxs/mxsimage.mx28.cfg | 4 +--
doc/README.mxs | 39 ++++++++++++++++++++++------
4 files changed, 41 insertions(+), 17 deletions(-)
V2: Replace the ELFTOSB_TARGET with MKIMAGE_TARGET in mxs Makefile
V3: Fix sude->sudo , move libssl-dev installation instructions.
diff --git a/arch/arm/cpu/arm926ejs/mxs/Makefile b/arch/arm/cpu/arm926ejs/mxs/Makefile
index 3d66892..ea397c7 100644
--- a/arch/arm/cpu/arm926ejs/mxs/Makefile
+++ b/arch/arm/cpu/arm926ejs/mxs/Makefile
@@ -25,14 +25,15 @@ $(LIB): $(OBJS)
$(call cmd_link_o_target, $(OBJS))
# Specify the target for use in elftosb call
-ELFTOSB_TARGET-$(CONFIG_MX23) = imx23
-ELFTOSB_TARGET-$(CONFIG_MX28) = imx28
+MKIMAGE_TARGET-$(CONFIG_MX23) = mx23
+MKIMAGE_TARGET-$(CONFIG_MX28) = mx28
-$(OBJTREE)/u-boot.bd: $(SRCTREE)/$(CPUDIR)/$(SOC)/u-boot-$(ELFTOSB_TARGET-y).bd
+$(OBJTREE)/mxsimage.cfg: $(SRCTREE)/$(CPUDIR)/$(SOC)/mxsimage.$(MKIMAGE_TARGET-y).cfg
sed "s at OBJTREE@$(OBJTREE)@g" $^ > $@
-$(OBJTREE)/u-boot.sb: $(OBJTREE)/u-boot.bin $(OBJTREE)/spl/u-boot-spl.bin $(OBJTREE)/u-boot.bd
- elftosb -zf $(ELFTOSB_TARGET-y) -c $(OBJTREE)/u-boot.bd -o $(OBJTREE)/u-boot.sb
+$(OBJTREE)/u-boot.sb: $(OBJTREE)/u-boot.bin $(OBJTREE)/spl/u-boot-spl.bin $(OBJTREE)/mxsimage.cfg
+ $(OBJTREE)/tools/mkimage -n $(OBJTREE)/mxsimage.cfg -T mxsimage $@
+
#########################################################################
diff --git a/arch/arm/cpu/arm926ejs/mxs/mxsimage.mx23.cfg b/arch/arm/cpu/arm926ejs/mxs/mxsimage.mx23.cfg
index 8118767..c9cf4b3 100644
--- a/arch/arm/cpu/arm926ejs/mxs/mxsimage.mx23.cfg
+++ b/arch/arm/cpu/arm926ejs/mxs/mxsimage.mx23.cfg
@@ -1,6 +1,6 @@
SECTION 0x0 BOOTABLE
TAG LAST
- LOAD 0x0 spl/u-boot-spl.bin
+ LOAD 0x0 OBJTREE/spl/u-boot-spl.bin
CALL 0x14 0x0
- LOAD 0x40000100 u-boot.bin
+ LOAD 0x40000100 OBJTREE/u-boot.bin
CALL 0x40000100 0x0
diff --git a/arch/arm/cpu/arm926ejs/mxs/mxsimage.mx28.cfg b/arch/arm/cpu/arm926ejs/mxs/mxsimage.mx28.cfg
index ea772f0..676f5c8 100644
--- a/arch/arm/cpu/arm926ejs/mxs/mxsimage.mx28.cfg
+++ b/arch/arm/cpu/arm926ejs/mxs/mxsimage.mx28.cfg
@@ -1,8 +1,8 @@
SECTION 0x0 BOOTABLE
TAG LAST
- LOAD 0x0 spl/u-boot-spl.bin
+ LOAD 0x0 OBJTREE/spl/u-boot-spl.bin
LOAD IVT 0x8000 0x14
CALL HAB 0x8000 0x0
- LOAD 0x40000100 u-boot.bin
+ LOAD 0x40000100 OBJTREE/u-boot.bin
LOAD IVT 0x8000 0x40000100
CALL HAB 0x8000 0x0
diff --git a/doc/README.mxs b/doc/README.mxs
index 2919bbf..0235a5a 100644
--- a/doc/README.mxs
+++ b/doc/README.mxs
@@ -27,9 +27,25 @@ Contents
1) Prerequisites
----------------
-To make a MXS based board bootable, some tools are necessary. The first one is
-the "elftosb" tool distributed by Freescale Semiconductor. The other one is the
-"mxsboot" tool found in U-Boot source tree.
+To make a MXS based board bootable, some tools are necessary. The only
+mandatory tool is the "mxsboot" tool found in U-Boot source tree. The
+tool is built automatically when compiling U-Boot for i.MX23 or i.MX28.
+
+The production of BootStream image is handled via "mkimage", which is
+also part of the U-Boot source tree. The "mkimage" requires OpenSSL
+development libraries to be installed. In case of Debian and derivates,
+this is installed by running:
+
+ $ sudo apt-get install libssl-dev
+
+NOTE: The "elftosb" tool distributed by Freescale Semiconductor is no
+ longer necessary for general use of U-Boot on i.MX23 and i.MX28.
+ The mkimage supports generation of BootStream images encrypted
+ with a zero key, which is the vast majority of use-cases. In
+ case you do need to produce image encrypted with non-zero key
+ or other special features, please use the "elftosb" tool,
+ otherwise continue to section 2). The installation procedure of
+ the "elftosb" is outlined below:
Firstly, obtain the elftosb archive from the following location:
@@ -63,11 +79,6 @@ copy the binary by hand:
Make sure the "elftosb" binary can be found in your $PATH, in this case this
means "/usr/local/bin/" has to be in your $PATH.
-Install the 'libssl-dev' package as well. On a Debian-based distribution, this
-package can be installed as follows:
-
- $ sudo apt-get install libssl-dev
-
2) Compiling U-Boot for a MXS based board
-------------------------------------------
@@ -112,6 +123,18 @@ The code produces "u-boot.sb" file. This file needs to be augmented with a
proper header to allow successful boot from SD or NAND. Adding the header is
discussed in the following chapters.
+NOTE: The process that produces u-boot.sb uses the mkimage to generate the
+ BootStream. The BootStream is encrypted with zero key. In case you need
+ some special features of the BootStream and plan on using the "elftosb"
+ tool instead, the invocation to produce a compatible BootStream with the
+ one produced by mkimage is outlined below. For further details, refer to
+ the documentation bundled with the "elftosb" package.
+
+ $ elftosb -zf imx23 -c arch/arm/cpu/arm926ejs/mxs/u-boot-imx23.bd \
+ -o u-boot.sb
+ $ elftosb -zf imx28 -c arch/arm/cpu/arm926ejs/mxs/u-boot-imx28.bd \
+ -o u-boot.sb
+
3) Installation of U-Boot for a MXS based board to SD card
----------------------------------------------------------
--
1.8.4.rc3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH v3] ARM: mxs: tools: Use mkimage for BootStream generation
2013-09-24 15:39 [U-Boot] [PATCH v3] ARM: mxs: tools: Use mkimage for BootStream generation Marek Vasut
@ 2013-09-24 16:13 ` Otavio Salvador
2013-09-24 16:28 ` Marek Vasut
2013-10-10 15:13 ` Stefano Babic
1 sibling, 1 reply; 6+ messages in thread
From: Otavio Salvador @ 2013-09-24 16:13 UTC (permalink / raw)
To: u-boot
On Tue, Sep 24, 2013 at 12:39 PM, Marek Vasut <marex@denx.de> wrote:
> Now that mkimage can generate an BootStream for i.MX23 and i.MX28,
> use the mkimage as a default tool to generate the BootStreams instead
> of the elftosb tool. This cuts out another obscure dependency.
>
> Signed-off-by: Marek Vasut <marex@denx.de>
..
> # Specify the target for use in elftosb call
> -ELFTOSB_TARGET-$(CONFIG_MX23) = imx23
> -ELFTOSB_TARGET-$(CONFIG_MX28) = imx28
> +MKIMAGE_TARGET-$(CONFIG_MX23) = mx23
> +MKIMAGE_TARGET-$(CONFIG_MX28) = mx28
>
> -$(OBJTREE)/u-boot.bd: $(SRCTREE)/$(CPUDIR)/$(SOC)/u-boot-$(ELFTOSB_TARGET-y).bd
> +$(OBJTREE)/mxsimage.cfg: $(SRCTREE)/$(CPUDIR)/$(SOC)/mxsimage.$(MKIMAGE_TARGET-y).cfg
> sed "s at OBJTREE@$(OBJTREE)@g" $^ > $@
This is clearly a mxsimage thing; I do believe MXSIMAGE_TARGET is more clear.
--
Otavio Salvador O.S. Systems
http://www.ossystems.com.br http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854 Mobile: +1 (347) 903-9750
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH v3] ARM: mxs: tools: Use mkimage for BootStream generation
2013-09-24 16:13 ` Otavio Salvador
@ 2013-09-24 16:28 ` Marek Vasut
2013-09-24 16:37 ` Otavio Salvador
0 siblings, 1 reply; 6+ messages in thread
From: Marek Vasut @ 2013-09-24 16:28 UTC (permalink / raw)
To: u-boot
Dear Otavio Salvador,
> On Tue, Sep 24, 2013 at 12:39 PM, Marek Vasut <marex@denx.de> wrote:
> > Now that mkimage can generate an BootStream for i.MX23 and i.MX28,
> > use the mkimage as a default tool to generate the BootStreams instead
> > of the elftosb tool. This cuts out another obscure dependency.
> >
> > Signed-off-by: Marek Vasut <marex@denx.de>
>
> ..
>
> > # Specify the target for use in elftosb call
> >
> > -ELFTOSB_TARGET-$(CONFIG_MX23) = imx23
> > -ELFTOSB_TARGET-$(CONFIG_MX28) = imx28
> > +MKIMAGE_TARGET-$(CONFIG_MX23) = mx23
> > +MKIMAGE_TARGET-$(CONFIG_MX28) = mx28
> >
> > -$(OBJTREE)/u-boot.bd:
> > $(SRCTREE)/$(CPUDIR)/$(SOC)/u-boot-$(ELFTOSB_TARGET-y).bd
> > +$(OBJTREE)/mxsimage.cfg:
> > $(SRCTREE)/$(CPUDIR)/$(SOC)/mxsimage.$(MKIMAGE_TARGET-y).cfg
> >
> > sed "s at OBJTREE@$(OBJTREE)@g" $^ > $@
>
> This is clearly a mxsimage thing; I do believe MXSIMAGE_TARGET is more
> clear.
Please read the patch again, the tool that is invoked is called "mkimage" . I
disagree.
Best regards,
Marek Vasut
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH v3] ARM: mxs: tools: Use mkimage for BootStream generation
2013-09-24 16:28 ` Marek Vasut
@ 2013-09-24 16:37 ` Otavio Salvador
2013-09-24 16:51 ` Marek Vasut
0 siblings, 1 reply; 6+ messages in thread
From: Otavio Salvador @ 2013-09-24 16:37 UTC (permalink / raw)
To: u-boot
On Tue, Sep 24, 2013 at 1:28 PM, Marek Vasut <marex@denx.de> wrote:
> Dear Otavio Salvador,
>
>> On Tue, Sep 24, 2013 at 12:39 PM, Marek Vasut <marex@denx.de> wrote:
>> > Now that mkimage can generate an BootStream for i.MX23 and i.MX28,
>> > use the mkimage as a default tool to generate the BootStreams instead
>> > of the elftosb tool. This cuts out another obscure dependency.
>> >
>> > Signed-off-by: Marek Vasut <marex@denx.de>
>>
>> ..
>>
>> > # Specify the target for use in elftosb call
>> >
>> > -ELFTOSB_TARGET-$(CONFIG_MX23) = imx23
>> > -ELFTOSB_TARGET-$(CONFIG_MX28) = imx28
>> > +MKIMAGE_TARGET-$(CONFIG_MX23) = mx23
>> > +MKIMAGE_TARGET-$(CONFIG_MX28) = mx28
>> >
>> > -$(OBJTREE)/u-boot.bd:
>> > $(SRCTREE)/$(CPUDIR)/$(SOC)/u-boot-$(ELFTOSB_TARGET-y).bd
>> > +$(OBJTREE)/mxsimage.cfg:
>> > $(SRCTREE)/$(CPUDIR)/$(SOC)/mxsimage.$(MKIMAGE_TARGET-y).cfg
>> >
>> > sed "s at OBJTREE@$(OBJTREE)@g" $^ > $@
>>
>> This is clearly a mxsimage thing; I do believe MXSIMAGE_TARGET is more
>> clear.
>
> Please read the patch again, the tool that is invoked is called "mkimage" . I
> disagree.
But it is used to generate the mxsimage.cfg in
.../mxsimage.$(MKIMAGE_TARGET-y).cfg
So it is really an mxsimage thing.
For something named MKIMAGE_TARGET I would expect it being in the mkimage call.
--
Otavio Salvador O.S. Systems
http://www.ossystems.com.br http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854 Mobile: +1 (347) 903-9750
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH v3] ARM: mxs: tools: Use mkimage for BootStream generation
2013-09-24 16:37 ` Otavio Salvador
@ 2013-09-24 16:51 ` Marek Vasut
0 siblings, 0 replies; 6+ messages in thread
From: Marek Vasut @ 2013-09-24 16:51 UTC (permalink / raw)
To: u-boot
Dear Otavio Salvador,
> On Tue, Sep 24, 2013 at 1:28 PM, Marek Vasut <marex@denx.de> wrote:
> > Dear Otavio Salvador,
> >
> >> On Tue, Sep 24, 2013 at 12:39 PM, Marek Vasut <marex@denx.de> wrote:
> >> > Now that mkimage can generate an BootStream for i.MX23 and i.MX28,
> >> > use the mkimage as a default tool to generate the BootStreams instead
> >> > of the elftosb tool. This cuts out another obscure dependency.
> >> >
> >> > Signed-off-by: Marek Vasut <marex@denx.de>
> >>
> >> ..
> >>
> >> > # Specify the target for use in elftosb call
> >> >
> >> > -ELFTOSB_TARGET-$(CONFIG_MX23) = imx23
> >> > -ELFTOSB_TARGET-$(CONFIG_MX28) = imx28
> >> > +MKIMAGE_TARGET-$(CONFIG_MX23) = mx23
> >> > +MKIMAGE_TARGET-$(CONFIG_MX28) = mx28
> >> >
> >> > -$(OBJTREE)/u-boot.bd:
> >> > $(SRCTREE)/$(CPUDIR)/$(SOC)/u-boot-$(ELFTOSB_TARGET-y).bd
> >> > +$(OBJTREE)/mxsimage.cfg:
> >> > $(SRCTREE)/$(CPUDIR)/$(SOC)/mxsimage.$(MKIMAGE_TARGET-y).cfg
> >> >
> >> > sed "s at OBJTREE@$(OBJTREE)@g" $^ > $@
> >>
> >> This is clearly a mxsimage thing; I do believe MXSIMAGE_TARGET is more
> >> clear.
> >
> > Please read the patch again, the tool that is invoked is called "mkimage"
> > . I disagree.
>
> But it is used to generate the mxsimage.cfg in
> .../mxsimage.$(MKIMAGE_TARGET-y).cfg
>
> So it is really an mxsimage thing.
>
> For something named MKIMAGE_TARGET I would expect it being in the mkimage
> call.
IFF you look at the pattern above (-ELFTOSB -> +MKIMAGE), you can see the name
of the variable contains the name of the tool. I want to stick with MKIMAGE_
here.
Best regards,
Marek Vasut
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH v3] ARM: mxs: tools: Use mkimage for BootStream generation
2013-09-24 15:39 [U-Boot] [PATCH v3] ARM: mxs: tools: Use mkimage for BootStream generation Marek Vasut
2013-09-24 16:13 ` Otavio Salvador
@ 2013-10-10 15:13 ` Stefano Babic
1 sibling, 0 replies; 6+ messages in thread
From: Stefano Babic @ 2013-10-10 15:13 UTC (permalink / raw)
To: u-boot
Hi Marek,
On 24/09/2013 17:39, Marek Vasut wrote:
> Now that mkimage can generate an BootStream for i.MX23 and i.MX28,
> use the mkimage as a default tool to generate the BootStreams instead
> of the elftosb tool. This cuts out another obscure dependency.
>
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Fabio Estevam <fabio.estevam@freescale.com>
> Cc: Otavio Salvador <otavio@ossystems.com.br>
> Cc: Stefano Babic <sbabic@denx.de>
> ---
Applied to u-boot-imx, -next branch, thanks !
Best regards,
Stefano Babic
--
=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-10-10 15:13 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-24 15:39 [U-Boot] [PATCH v3] ARM: mxs: tools: Use mkimage for BootStream generation Marek Vasut
2013-09-24 16:13 ` Otavio Salvador
2013-09-24 16:28 ` Marek Vasut
2013-09-24 16:37 ` Otavio Salvador
2013-09-24 16:51 ` Marek Vasut
2013-10-10 15:13 ` Stefano Babic
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox