Patchwork [U-Boot] common, image: introduce new uimage types

login
register
mail settings
Submitter Heiko Schocher
Date Jan. 15, 2012, 7:45 a.m.
Message ID <1326613549-23724-1-git-send-email-hs@denx.de>
Download mbox | patch
Permalink /patch/136157/
State Superseded
Headers show

Comments

Heiko Schocher - Jan. 15, 2012, 7:45 a.m.
- ubootimage
  U-Boot image
- splimage
  SPL image
- dfenvimage
  Default Environment image
- ublheader
  TI davinci UBL header image

Signed-off-by: Heiko Schocher <hs@denx.de>
---
 common/image.c  |    6 +++++-
 include/image.h |    4 ++++
 2 files changed, 9 insertions(+), 1 deletions(-)
Mike Frysinger - Jan. 15, 2012, 5:30 p.m.
On Sunday 15 January 2012 02:45:49 Heiko Schocher wrote:
> - ubootimage
>   U-Boot image
> - splimage
>   SPL image
> - dfenvimage
>   Default Environment image
> - ublheader
>   TI davinci UBL header image

for ... ?

is it even possible to `bootm` these currently ?
-mike
Heiko Schocher - Jan. 16, 2012, 6:26 a.m.
Hello Mike,

Mike Frysinger wrote:
> On Sunday 15 January 2012 02:45:49 Heiko Schocher wrote:
>> - ubootimage
>>   U-Boot image
>> - splimage
>>   SPL image
>> - dfenvimage
>>   Default Environment image
>> - ublheader
>>   TI davinci UBL header image
> 
> for ... ?

Oh, right, forgotten to add this in the commit message.

They are needed for cam_enc_4xx update:

http://patchwork.ozlabs.org/patch/136165/

There, the UBL-header, SPL-image, U-Boot image and an default image
are wrapped in one FIT image.

> is it even possible to `bootm` these currently ?

No.

bye,
Heiko
Wolfgang Denk - Jan. 16, 2012, 8:51 a.m.
Dear Heiko Schocher,

In message <4F13C325.3010200@denx.de> you wrote:
> 
> >> - ubootimage
> >>   U-Boot image
> >> - splimage
> >>   SPL image
> >> - dfenvimage
> >>   Default Environment image
> >> - ublheader
> >>   TI davinci UBL header image
> > 
> > for ... ?
> 
> Oh, right, forgotten to add this in the commit message.
> 
> They are needed for cam_enc_4xx update:
> 
> http://patchwork.ozlabs.org/patch/136165/
> 
> There, the UBL-header, SPL-image, U-Boot image and an default image
> are wrapped in one FIT image.

But this is conceptually broken.  The IH_TYPE_* definitions are
actually only relevant for legacy images.

FIX images use an XML based, extendable data format.  The whole idea
of this is that we do NOT have to change to code when anybody needs a
new (probably private) entry or type or whatever.

In your case, it should be possible to use an existing image type
(say, IH_TYPE_FIRMWARE) for your code, and use other distinguishing
marks to determine which parts you work on.  Probably it makes sense
to define your own entry for each of the parts.  Then only your own
code needs to understand this.

Thanks.

Best regards,

Wolfgang Denk
Heiko Schocher - Jan. 16, 2012, 9:03 a.m.
Hello Wolfgang,

Wolfgang Denk wrote:
> Dear Heiko Schocher,
> 
> In message <4F13C325.3010200@denx.de> you wrote:
>>>> - ubootimage
>>>>   U-Boot image
>>>> - splimage
>>>>   SPL image
>>>> - dfenvimage
>>>>   Default Environment image
>>>> - ublheader
>>>>   TI davinci UBL header image
>>> for ... ?
>> Oh, right, forgotten to add this in the commit message.
>>
>> They are needed for cam_enc_4xx update:
>>
>> http://patchwork.ozlabs.org/patch/136165/
>>
>> There, the UBL-header, SPL-image, U-Boot image and an default image
>> are wrapped in one FIT image.
> 
> But this is conceptually broken.  The IH_TYPE_* definitions are
> actually only relevant for legacy images.
> 
> FIX images use an XML based, extendable data format.  The whole idea
> of this is that we do NOT have to change to code when anybody needs a
> new (probably private) entry or type or whatever.
> 
> In your case, it should be possible to use an existing image type
> (say, IH_TYPE_FIRMWARE) for your code, and use other distinguishing
> marks to determine which parts you work on.  Probably it makes sense
> to define your own entry for each of the parts.  Then only your own
> code needs to understand this.

Yep, you are right, rework this.

bye,
Heiko

Patch

diff --git a/common/image.c b/common/image.c
index 202c8a1..aca1318 100644
--- a/common/image.c
+++ b/common/image.c
@@ -133,6 +133,7 @@  static const table_entry_t uimage_os[] = {
 
 static const table_entry_t uimage_type[] = {
 	{	IH_TYPE_AISIMAGE,   "aisimage",   "Davinci AIS image",},
+	{	IH_TYPE_DFENVIMAGE, "dfenvimage", "default Env image",  },
 	{	IH_TYPE_FILESYSTEM, "filesystem", "Filesystem Image",	},
 	{	IH_TYPE_FIRMWARE,   "firmware",	  "Firmware",		},
 	{	IH_TYPE_FLATDT,     "flat_dt",    "Flat Device Tree",	},
@@ -145,8 +146,11 @@  static const table_entry_t uimage_type[] = {
 	{	IH_TYPE_OMAPIMAGE,  "omapimage",  "TI OMAP SPL With GP CH",},
 	{	IH_TYPE_RAMDISK,    "ramdisk",	  "RAMDisk Image",	},
 	{	IH_TYPE_SCRIPT,     "script",	  "Script",		},
+	{	IH_TYPE_SPLIMAGE,   "splimage",   "SPL image",          },
 	{	IH_TYPE_STANDALONE, "standalone", "Standalone Program", },
-	{	IH_TYPE_UBLIMAGE,   "ublimage",   "Davinci UBL image",},
+	{	IH_TYPE_UBOOTIMAGE, "ubootimage", "U-Boot image",       },
+	{	IH_TYPE_UBLHEADER,  "ublheader",  "UBL header image",   },
+	{	IH_TYPE_UBLIMAGE,   "ublimage",   "Davinci UBL image",  },
 	{	-1,		    "",		  "",			},
 };
 
diff --git a/include/image.h b/include/image.h
index bbf80f0..3b5bd51 100644
--- a/include/image.h
+++ b/include/image.h
@@ -164,6 +164,10 @@ 
 #define IH_TYPE_OMAPIMAGE	12	/* TI OMAP Config Header Image	*/
 #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_UBOOTIMAGE	15	/* U-Boot image			*/
+#define IH_TYPE_SPLIMAGE	16	/* SPL image			*/
+#define IH_TYPE_DFENVIMAGE	17	/* default Environment Image	*/
+#define IH_TYPE_UBLHEADER	18	/* UBL Header image		*/
 
 /*
  * Compression Types