[U-Boot] [PATCH 4/5] tools: mkimage: fix imximage header size

Stefan Agner stefan at agner.ch
Tue Jul 14 12:29:52 CEST 2015


Hi Stefano,

On 2015-07-10 10:14, Stefano Babic wrote:
> On 19/06/2015 14:18, Albert ARIBAUD (3ADEV) wrote:
>> imximage header size is 4-byte, not 8-byte aligned.
>> This produces .imx images that a Vybrid cannot boot
>> on.
>>
>> Fix by adding a "padding" field in header.
>>
>> Signed-off-by: Albert ARIBAUD (3ADEV) <albert.aribaud at 3adev.fr>
>> ---
>>
>>  tools/imximage.h | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/tools/imximage.h b/tools/imximage.h
>> index 36fe095..a913329 100644
>> --- a/tools/imximage.h
>> +++ b/tools/imximage.h
>> @@ -129,6 +129,7 @@ typedef struct {
>>  	ivt_header_t header;
>>  	write_dcd_command_t write_dcd_command;
>>  	dcd_addr_data_t addr_data[MAX_HW_CFG_SIZE_V2];
>> +	uint32_t padding[1]; /* end up on an 8-byte boundary */
>>  } dcd_v2_t;
>>
>>  typedef struct {
>>
> 
> Applied to u-boot-imx, thanks !

Sorry, just stumbled over this message now.

We discussed exactly this issue already more than a year ago, see:
http://lists.denx.de/pipermail/u-boot/2014-April/177580.html

Back then you asked whether I asked Freescale about it. Earlier this
year I tried to get hold of that issue and asked Freescale on Community,
see:
https://community.freescale.com/thread/355161

However, no official confirmation or explanation so far.

I think my patch back then solves the issue nicer. The struct dcd_v2_t
is not the reason the whole header is not aligned by 8-byte, it is a
problem of the boot_data_t header which is 12 bytes long. So inserting
the padding just after struct boot_data_t (or inside of struct
boot_data_t) seems to be more appropriate.

--
Stefan






More information about the U-Boot mailing list