Skip to contentSkip to conversation

ARM: mxs: tools: Add mkimage support for MXS bootstream

PATCH Superseded Marek Vasut 2 participants 5 messages Aug 6, 2013 – Aug 19, 2013

Subsystems (2)

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ARM: mxs: tools: Add mkimage support for MXS bootstream

Add mkimage support for generating and verifying MXS bootstream. The implementation here is mostly a glue code between MXSSB v0.4 and mkimage, but the long-term goal is to rectify this and merge MXSSB with mkimage more tightly. Once this code is properly in U-Boot, MXSSB shall be deprecated in favor of mkimage-mxsimage support.

Note that the mxsimage generator needs libcrypto from OpenSSL, I therefore enabled the libcrypto/libssl unconditionally.

MXSSB: http://git.denx.de/?p=mxssb.git;a=summary

The code is based on research presented at:
http://www.rockbox.org/wiki/SbFileFormat

Cc Tom Rini <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Otavio Salvador <[email protected]>
---
 arch/arm/cpu/arm926ejs/mxs/mxsimage.mx23.cfg |    6 +
 arch/arm/cpu/arm926ejs/mxs/mxsimage.mx28.cfg |    8 +
 common/image.c                               |    1 +
 config.mk                                    |    6 +
 doc/README.mxsimage                          |  165 ++
 include/image.h                              |    1 +
 tools/Makefile                               |    2 +
 tools/mkimage.c                              |    2 +
 tools/mkimage.h                              |    1 +
 tools/mxsimage.c                             | 2312 ++++++++++++++++++++++++++
 tools/mxsimage.h                             |  203 +++
 11 files changed, 2707 insertions(+)
 create mode 100644 arch/arm/cpu/arm926ejs/mxs/mxsimage.mx23.cfg
 create mode 100644 arch/arm/cpu/arm926ejs/mxs/mxsimage.mx28.cfg
 create mode 100644 doc/README.mxsimage
 create mode 100644 tools/mxsimage.c
 create mode 100644 tools/mxsimage.h

V2: Remove the time hack fixing timestamp at certain time
Enable -lssl and -lcrypto only if CONFIG_MX23/CONFIG_MX28 is set

arch/arm/cpu/arm926ejs/mxs/mxsimage.mx23.cfg new file +6 -0
new file mode 100644
index 0000000..8118767
@@ -0,0 +1,6 @@
+SECTION 0x0 BOOTABLE
+ TAG LAST
+ LOAD     0x0        spl/u-boot-spl.bin
+ CALL     0x14       0x0
+ LOAD     0x40000100 u-boot.bin
+ CALL     0x40000100 0x0
arch/arm/cpu/arm926ejs/mxs/mxsimage.mx28.cfg new file +8 -0
new file mode 100644
index 0000000..ea772f0
@@ -0,0 +1,8 @@
+SECTION 0x0 BOOTABLE
+ TAG LAST
+ LOAD     0x0        spl/u-boot-spl.bin
+ LOAD IVT 0x8000     0x14
+ CALL HAB 0x8000     0x0
+ LOAD     0x40000100 u-boot.bin
+ LOAD IVT 0x8000     0x40000100
+ CALL HAB 0x8000     0x0
common/image.c +1 -0
index 56a5a62..2c88091 100644
@@ -135,6 +135,7 @@ static const table_entry_t uimage_type[] = {
 	{	IH_TYPE_SCRIPT,     "script",	  "Script",		},
 	{	IH_TYPE_STANDALONE, "standalone", "Standalone Program", },
 	{	IH_TYPE_UBLIMAGE,   "ublimage",   "Davinci UBL image",},
+	{	IH_TYPE_MXSIMAGE,   "mxsimage",   "Freescale MXS Boot Image",},
 	{	-1,		    "",		  "",			},
 };
 
config.mk +6 -0
index 499eed1..58fa8ec 100644
@@ -194,6 +194,12 @@ LDFLAGS_FINAL += --gc-sections
 endif
 
 # TODO(sjg at chromium.org): Is this correct on Mac OS?
+
+# MXSImage needs LibSSL
+ifneq ($(CONFIG_MX23)$(CONFIG_MX28),)
+HOSTLIBS	+= -lssl -lcrypto
+endif
+
 ifdef CONFIG_FIT_SIGNATURE
 HOSTLIBS	+= -lssl -lcrypto
 
doc/README.mxsimage new file +165 -0

165 lines not on this page · raw message

include/image.h +1 -0
index f93a393..ee6eb8d 100644
@@ -212,6 +212,7 @@ struct lmb;
 #define IH_TYPE_AISIMAGE	13	/* TI Davinci AIS Image		*/
 #define IH_TYPE_KERNEL_NOLOAD	14	/* OS Kernel Image, can run from any load address */
 #define IH_TYPE_PBLIMAGE	15	/* Freescale PBL Boot Image	*/
+#define IH_TYPE_MXSIMAGE	16	/* Freescale MXSBoot Image	*/
 
 /*
  * Compression Types
tools/Makefile +2 -0
index 33fad6b..bbae5a2 100644
@@ -83,6 +83,7 @@ NOPED_OBJ_FILES-y += aisimage.o
 NOPED_OBJ_FILES-y += kwbimage.o
 NOPED_OBJ_FILES-y += pblimage.o
 NOPED_OBJ_FILES-y += imximage.o
+NOPED_OBJ_FILES-y += mxsimage.o
 NOPED_OBJ_FILES-y += image-host.o
 NOPED_OBJ_FILES-y += omapimage.o
 NOPED_OBJ_FILES-y += mkenvimage.o
@@ -209,6 +210,7 @@ $(obj)mkimage$(SFX):	$(obj)aisimage.o \
 			$(obj)image-host.o \
 			$(FIT_SIG_OBJS) \
 			$(obj)imximage.o \
+			$(obj)mxsimage.o \
 			$(obj)kwbimage.o \
 			$(obj)pblimage.o \
 			$(obj)md5.o \
tools/mkimage.c +2 -0
index b700b9e..635df02 100644
@@ -144,6 +144,8 @@ main (int argc, char **argv)
 	init_kwb_image_type ();
 	/* Init Freescale imx Boot image generation/list support */
 	init_imx_image_type ();
+	/* Init Freescale mxs Boot image generation/list support */
+	init_mxs_image_type ();
 	/* Init FIT image generation/list support */
 	init_fit_image_type ();
 	/* Init TI OMAP Boot image generation/list support */
tools/mkimage.h +1 -0
index 950e190..66f7596 100644
@@ -158,6 +158,7 @@ void init_pbl_image_type(void);
 void init_ais_image_type(void);
 void init_kwb_image_type (void);
 void init_imx_image_type (void);
+void init_mxs_image_type (void);
 void init_default_image_type (void);
 void init_fit_image_type (void);
 void init_ubl_image_type(void);
tools/mxsimage.c new file +2312 -0

2,312 lines not on this page · raw message

tools/mxsimage.h new file +203 -0

203 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#1 lore raw

PATCH v3 1/1 ARM: mxs: tools: Add mkimage support for MXS bootstream

Add mkimage support for generating and verifying MXS bootstream. The implementation here is mostly a glue code between MXSSB v0.4 and mkimage, but the long-term goal is to rectify this and merge MXSSB with mkimage more tightly. Once this code is properly in U-Boot, MXSSB shall be deprecated in favor of mkimage-mxsimage support.

Note that the mxsimage generator needs libcrypto from OpenSSL, I therefore enabled the libcrypto/libssl unconditionally.

MXSSB: http://git.denx.de/?p=mxssb.git;a=summary

The code is based on research presented at:
http://www.rockbox.org/wiki/SbFileFormat

Cc Tom Rini <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Otavio Salvador <[email protected]>
---
 arch/arm/cpu/arm926ejs/mxs/mxsimage.mx23.cfg |    6 +
 arch/arm/cpu/arm926ejs/mxs/mxsimage.mx28.cfg |    8 +
 common/image.c                               |    1 +
 config.mk                                    |    6 +
 doc/README.mxsimage                          |  165 ++
 include/image.h                              |    1 +
 tools/Makefile                               |    2 +
 tools/mkimage.c                              |    2 +
 tools/mkimage.h                              |    1 +
 tools/mxsimage.c                             | 2339 ++++++++++++++++++++++++++
 tools/mxsimage.h                             |  230 +++
 11 files changed, 2761 insertions(+)
 create mode 100644 arch/arm/cpu/arm926ejs/mxs/mxsimage.mx23.cfg
 create mode 100644 arch/arm/cpu/arm926ejs/mxs/mxsimage.mx28.cfg
 create mode 100644 doc/README.mxsimage
 create mode 100644 tools/mxsimage.c
 create mode 100644 tools/mxsimage.h

V2: Remove the time hack fixing timestamp at certain time
Enable -lssl and -lcrypto only if CONFIG_MX23/CONFIG_MX28 is set
V3: Checkpatch fixes for all but openssl

arch/arm/cpu/arm926ejs/mxs/mxsimage.mx23.cfg new file +6 -0
new file mode 100644
index 0000000..8118767
@@ -0,0 +1,6 @@
+SECTION 0x0 BOOTABLE
+ TAG LAST
+ LOAD     0x0        spl/u-boot-spl.bin
+ CALL     0x14       0x0
+ LOAD     0x40000100 u-boot.bin
+ CALL     0x40000100 0x0
arch/arm/cpu/arm926ejs/mxs/mxsimage.mx28.cfg new file +8 -0
new file mode 100644
index 0000000..ea772f0
@@ -0,0 +1,8 @@
+SECTION 0x0 BOOTABLE
+ TAG LAST
+ LOAD     0x0        spl/u-boot-spl.bin
+ LOAD IVT 0x8000     0x14
+ CALL HAB 0x8000     0x0
+ LOAD     0x40000100 u-boot.bin
+ LOAD IVT 0x8000     0x40000100
+ CALL HAB 0x8000     0x0
common/image.c +1 -0
index 56a5a62..2c88091 100644
@@ -135,6 +135,7 @@ static const table_entry_t uimage_type[] = {
 	{	IH_TYPE_SCRIPT,     "script",	  "Script",		},
 	{	IH_TYPE_STANDALONE, "standalone", "Standalone Program", },
 	{	IH_TYPE_UBLIMAGE,   "ublimage",   "Davinci UBL image",},
+	{	IH_TYPE_MXSIMAGE,   "mxsimage",   "Freescale MXS Boot Image",},
 	{	-1,		    "",		  "",			},
 };
 
config.mk +6 -0
index 499eed1..58fa8ec 100644
@@ -194,6 +194,12 @@ LDFLAGS_FINAL += --gc-sections
 endif
 
 # TODO(sjg at chromium.org): Is this correct on Mac OS?
+
+# MXSImage needs LibSSL
+ifneq ($(CONFIG_MX23)$(CONFIG_MX28),)
+HOSTLIBS	+= -lssl -lcrypto
+endif
+
 ifdef CONFIG_FIT_SIGNATURE
 HOSTLIBS	+= -lssl -lcrypto
 
doc/README.mxsimage new file +165 -0

165 lines not on this page · raw message

include/image.h +1 -0
index f93a393..ee6eb8d 100644
@@ -212,6 +212,7 @@ struct lmb;
 #define IH_TYPE_AISIMAGE	13	/* TI Davinci AIS Image		*/
 #define IH_TYPE_KERNEL_NOLOAD	14	/* OS Kernel Image, can run from any load address */
 #define IH_TYPE_PBLIMAGE	15	/* Freescale PBL Boot Image	*/
+#define IH_TYPE_MXSIMAGE	16	/* Freescale MXSBoot Image	*/
 
 /*
  * Compression Types
tools/Makefile +2 -0
index 33fad6b..bbae5a2 100644
@@ -83,6 +83,7 @@ NOPED_OBJ_FILES-y += aisimage.o
 NOPED_OBJ_FILES-y += kwbimage.o
 NOPED_OBJ_FILES-y += pblimage.o
 NOPED_OBJ_FILES-y += imximage.o
+NOPED_OBJ_FILES-y += mxsimage.o
 NOPED_OBJ_FILES-y += image-host.o
 NOPED_OBJ_FILES-y += omapimage.o
 NOPED_OBJ_FILES-y += mkenvimage.o
@@ -209,6 +210,7 @@ $(obj)mkimage$(SFX):	$(obj)aisimage.o \
 			$(obj)image-host.o \
 			$(FIT_SIG_OBJS) \
 			$(obj)imximage.o \
+			$(obj)mxsimage.o \
 			$(obj)kwbimage.o \
 			$(obj)pblimage.o \
 			$(obj)md5.o \
tools/mkimage.c +2 -0
index b700b9e..0e92a71 100644
@@ -144,6 +144,8 @@ main (int argc, char **argv)
 	init_kwb_image_type ();
 	/* Init Freescale imx Boot image generation/list support */
 	init_imx_image_type ();
+	/* Init Freescale mxs Boot image generation/list support */
+	init_mxs_image_type();
 	/* Init FIT image generation/list support */
 	init_fit_image_type ();
 	/* Init TI OMAP Boot image generation/list support */
tools/mkimage.h +1 -0
index 950e190..8f56584 100644
@@ -158,6 +158,7 @@ void init_pbl_image_type(void);
 void init_ais_image_type(void);
 void init_kwb_image_type (void);
 void init_imx_image_type (void);
+void init_mxs_image_type(void);
 void init_default_image_type (void);
 void init_fit_image_type (void);
 void init_ubl_image_type(void);
tools/mxsimage.c new file +2339 -0

2,339 lines not on this page · raw message

tools/mxsimage.h new file +230 -0

230 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#2 lore raw

PATCH v2 1/1 ARM: mxs: tools: Add mkimage support for MXS bootstream

In reply to Marek Vasut
Quoted 39 lines · Marek Vasut

Add mkimage support for generating and verifying MXS bootstream. The implementation here is mostly a glue code between MXSSB v0.4 and mkimage, but the long-term goal is to rectify this and merge MXSSB with mkimage more tightly. Once this code is properly in U-Boot, MXSSB shall be deprecated in favor of mkimage-mxsimage support.

Note that the mxsimage generator needs libcrypto from OpenSSL, I therefore enabled the libcrypto/libssl unconditionally.

MXSSB: http://git.denx.de/?p=mxssb.git;a=summary

The code is based on research presented at:
http://www.rockbox.org/wiki/SbFileFormat

Cc Tom Rini <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Otavio Salvador <[email protected]>
---
 arch/arm/cpu/arm926ejs/mxs/mxsimage.mx23.cfg |    6 +
 arch/arm/cpu/arm926ejs/mxs/mxsimage.mx28.cfg |    8 +
 common/image.c                               |    1 +
 config.mk                                    |    6 +
 doc/README.mxsimage                          |  165 ++
 include/image.h                              |    1 +
 tools/Makefile                               |    2 +
 tools/mkimage.c                              |    2 +
 tools/mkimage.h                              |    1 +
 tools/mxsimage.c                             | 2312 ++++++++++++++++++++++++++
 tools/mxsimage.h                             |  203 +++
 11 files changed, 2707 insertions(+)
 create mode 100644 arch/arm/cpu/arm926ejs/mxs/mxsimage.mx23.cfg
 create mode 100644 arch/arm/cpu/arm926ejs/mxs/mxsimage.mx28.cfg
 create mode 100644 doc/README.mxsimage
 create mode 100644 tools/mxsimage.c
 create mode 100644 tools/mxsimage.h
Quoted 2 lines

V2: Remove the time hack fixing timestamp at certain time
Enable -lssl and -lcrypto only if CONFIG_MX23/CONFIG_MX28 is set

I think this now breaks non-MX23/28 builds as we still build and try and link all of the crypto stuff. Please double check this with how Simon handled this for FIT signature stuff.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130819/06c8f5e3/attachment.pgp>
#3 lore raw

PATCH v2 1/1 ARM: mxs: tools: Add mkimage support for MXS bootstream

Dear Tom Rini,

Quoted 42 lines · Marek Vasut
Quoted 41 lines

Add mkimage support for generating and verifying MXS bootstream. The implementation here is mostly a glue code between MXSSB v0.4 and mkimage, but the long-term goal is to rectify this and merge MXSSB with mkimage more tightly. Once this code is properly in U-Boot, MXSSB shall be deprecated in favor of mkimage-mxsimage support.

Note that the mxsimage generator needs libcrypto from OpenSSL, I therefore enabled the libcrypto/libssl unconditionally.

MXSSB: http://git.denx.de/?p=mxssb.git;a=summary

The code is based on research presented at:
http://www.rockbox.org/wiki/SbFileFormat

Cc Tom Rini <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Otavio Salvador <[email protected]>

---

 arch/arm/cpu/arm926ejs/mxs/mxsimage.mx23.cfg |    6 +
 arch/arm/cpu/arm926ejs/mxs/mxsimage.mx28.cfg |    8 +
 common/image.c                               |    1 +
 config.mk                                    |    6 +
 doc/README.mxsimage                          |  165 ++
 include/image.h                              |    1 +
 tools/Makefile                               |    2 +
 tools/mkimage.c                              |    2 +
 tools/mkimage.h                              |    1 +
 tools/mxsimage.c                             | 2312
 ++++++++++++++++++++++++++ tools/mxsimage.h                            
 |  203 +++
 11 files changed, 2707 insertions(+)
 create mode 100644 arch/arm/cpu/arm926ejs/mxs/mxsimage.mx23.cfg
 create mode 100644 arch/arm/cpu/arm926ejs/mxs/mxsimage.mx28.cfg
 create mode 100644 doc/README.mxsimage
 create mode 100644 tools/mxsimage.c
 create mode 100644 tools/mxsimage.h
Quoted 6 lines
Quoted 3 lines

V2: Remove the time hack fixing timestamp at certain time

Enable -lssl and -lcrypto only if CONFIG_MX23/CONFIG_MX28 is set

I think this now breaks non-MX23/28 builds as we still build and try and link all of the crypto stuff.

It will, but only if CONFIG_MX23/MX28 is selected, so what's the problem exactly?

Quoted 2 lines

Please double check this with how Simon
handled this for FIT signature stuff.

I wonder if we shouldn't just unconditionally link openssl anyway. But that's for another discussion.

Best regards,
Marek Vasut

#4 lore raw

PATCH v2 1/1 ARM: mxs: tools: Add mkimage support for MXS bootstream

Quoted 46 lines · Marek Vasut

Dear Tom Rini,

Quoted 44 lines · Marek Vasut
Quoted 43 lines

Add mkimage support for generating and verifying MXS bootstream. The implementation here is mostly a glue code between MXSSB v0.4 and mkimage, but the long-term goal is to rectify this and merge MXSSB with mkimage more tightly. Once this code is properly in U-Boot, MXSSB shall be deprecated in favor of mkimage-mxsimage support.

Note that the mxsimage generator needs libcrypto from OpenSSL, I therefore enabled the libcrypto/libssl unconditionally.

MXSSB: http://git.denx.de/?p=mxssb.git;a=summary

The code is based on research presented at:
http://www.rockbox.org/wiki/SbFileFormat

Cc Tom Rini <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Otavio Salvador <[email protected]>

---

 arch/arm/cpu/arm926ejs/mxs/mxsimage.mx23.cfg |    6 +
 arch/arm/cpu/arm926ejs/mxs/mxsimage.mx28.cfg |    8 +
 common/image.c                               |    1 +
 config.mk                                    |    6 +
 doc/README.mxsimage                          |  165 ++
 include/image.h                              |    1 +
 tools/Makefile                               |    2 +
 tools/mkimage.c                              |    2 +
 tools/mkimage.h                              |    1 +
 tools/mxsimage.c                             | 2312
 ++++++++++++++++++++++++++ tools/mxsimage.h                            
 |  203 +++
 11 files changed, 2707 insertions(+)
 create mode 100644 arch/arm/cpu/arm926ejs/mxs/mxsimage.mx23.cfg
 create mode 100644 arch/arm/cpu/arm926ejs/mxs/mxsimage.mx28.cfg
 create mode 100644 doc/README.mxsimage
 create mode 100644 tools/mxsimage.c
 create mode 100644 tools/mxsimage.h

V2: Remove the time hack fixing timestamp at certain time

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

Enable -lssl and -lcrypto only if CONFIG_MX23/CONFIG_MX28 is set

I think this now breaks non-MX23/28 builds as we still build and try and link all of the crypto stuff.

It will, but only if CONFIG_MX23/MX28 is selected, so what's the problem exactly?

The code will still make calls that require those libraries, yes?

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130819/a5f4dcaa/attachment.pgp>