[U-Boot] [PATCH v3 4/4] tools: mkimage: Add: Kirkwood Boot Image support (kwbimage)

Prafulla Wadaskar prafulla at marvell.com
Thu Sep 3 16:15:48 CEST 2009


 

> -----Original Message-----
> From: Simon Kagstrom [mailto:simon.kagstrom at netinsight.net] 
> Sent: Thursday, September 03, 2009 5:30 PM
> To: Prafulla Wadaskar
> Cc: u-boot at lists.denx.de; Ashish Karkare; Prabhanjan Sarnaik
> Subject: Re: [U-Boot] [PATCH v3 4/4] tools: mkimage: Add: 
> Kirkwood Boot Image support (kwbimage)
> 
> On Mon, 24 Aug 2009 23:03:59 +0530
> Prafulla Wadaskar <prafulla at marvell.com> wrote:
> 
> > This patch adds type kwbimabe support for new mkimage core
> > For more details refer docs/README.kwbimage
> 
> > +Command syntax:
> > +--------------
> > +./tools/mkimage -l <kwboot_file>
> > +		to list the kwb image file details
> > +
> > +./tools/mkimage -n <board specific configuration file> \
> > +                -T kwbimage -a <start address> -e 
> <execution address> \
> > +		-d <input_raw_binary> <output_kwboot_file>
> > +
> > +for ex.
> > +./tools/mkimage -n ./board/Marvell/openrd_base/kwbimage.cfg \
> > +                -T kwbimage -a 0x00600000 -e 0x00600000 \
> > +		-d u-boot.bin u-boot.kwb
> 
> I think it could also be useful to be able to produce just the boot
> header without the U-boot image. For example if you want to place
> U-boot at some other location on the flash or (as a developer)
> frequently re-flash U-boot, but don't want to write to the first block
> all the time (you only need to rewrite it when moving U-boot).
Hi Simon
This is not possible.
Boot Header is a part of Kirkwood boot image,
Header contains u-boot imagesize so for this, first block need to be written each time.
Secondly u-boot header is of 512bytes only whereas minimum sector size could be 4kbytes (typical),
so rest part of first sector will be a waste.
Also at the end of boot image checksum need to be calculated on entire image including header.

If one need just header, just use only initial 512 byte
I don't see any good use case for this at this moment.

Regards..
Prafulla . .

> 
> Perhaps something like
> 
> > +Typical example of kwimage.cfg file:
> > +-----------------------------------
> > +
> > +# Boot Media configurations
> > +BOOT_FROM	nand
> > +NAND_ECC_MODE	default
> > +NAND_PAGE_SIZE	0x0800
> 
> SOURCE_OFFSET 0x0   # Relative to the header or NAND start?
> 
> > +static void kwbimage_set_header (void *ptr, struct stat 
> *sbuf, int ifd,
> > +				struct mkimage_params *params)
> > +{
> > +	struct kwb_header *hdr = (struct kwb_header *)ptr;
> > [...]
> > +	mhdr->srcaddr = sizeof(struct kwb_header);
> 
> and this could then be changed to have this info.
> 
> // Simon
> 


More information about the U-Boot mailing list