[U-Boot] [PATCH v2] tools: imximage: Load a size that is multiple of 512

Stefano Babic sbabic at denx.de
Fri Jan 4 10:03:41 CET 2013


On 04/01/2013 07:20, Dirk Behme wrote:
> On 03.01.2013 19:24, Fabio Estevam wrote:
>> In order to mx53 ROM to properly load the U-boot image, its header
>> size should be multiple of 512 bytes.
>>

Hi Dirk,

> ...
>> Signed-off-by: Troy Kisky <troy.kisky at boundarydevices.com>
>> Signed-off-by: Fabio Estevam <fabio.estevam at freescale.com>
>> ---
>> Changes since v1:
>> - Improvec commit log
>>  include/image.h  |    3 +++
>>  tools/imximage.c |    9 ++++++++-
>>  2 files changed, 11 insertions(+), 1 deletion(-)
>>
>> diff --git a/include/image.h b/include/image.h
>> index f54d983..e1e83b4 100644
>> --- a/include/image.h
>> +++ b/include/image.h
>> @@ -179,6 +179,9 @@
>>  #define IH_MAGIC    0x27051956    /* Image Magic Number        */
>>  #define IH_NMLEN        32    /* Image Name Length        */
>>  
>> +/* Reused from common.h */
>> +#define ROUND(a, b)        (((a) + (b) - 1) & ~((b) - 1))
>> +
>>  /*
>>   * Legacy format image header,
>>   * all data in network byte order (aka natural aka bigendian).
>> diff --git a/tools/imximage.c b/tools/imximage.c
>> index 63f88b6..a93d7eb 100644
>> --- a/tools/imximage.c
>> +++ b/tools/imximage.c
>> @@ -515,7 +515,14 @@ static void imximage_set_header(void *ptr, struct
>> stat *sbuf, int ifd,
>>  
>>      /* Set the imx header */
>>      (*set_imx_hdr)(imxhdr, dcd_len, params->ep, imxhdr->flash_offset);
>> -    *header_size_ptr = sbuf->st_size + imxhdr->flash_offset;
>> +
>> +    /*
>> +     * ROM bug alert
>> +     * mx53 only loads 512 byte multiples.
> 
> Is this i.MX53 specific or is this valid for i.MX6, too?

It seems that i.MX6 is not afflicted by this issue. For i.MX6 it adds
only some padding to the resulting image.

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
=====================================================================


More information about the U-Boot mailing list