tools: make imxheader size align on page size
authorStefan Agner <stefan@agner.ch>
Wed, 16 Apr 2014 13:18:34 +0000 (15:18 +0200)
committerStefan Agner <stefan@agner.ch>
Tue, 14 Apr 2015 07:08:09 +0000 (09:08 +0200)
The i.MX V2 headers total size is 0x7fc. The header is placed
in front of the U-Boot binary which of course is aligned to
text base. Hence the header starting point is not page
aligned (e.g. at 0x3f400404). This is still a valid header,
which boots fine using serial loader. However, the image
fails to boot from NAND (tested on a VF61x SoC).

Most parts of the header have a length of a multiply of 16
bytes.The rest of the header is filled with 8 bytes long DCD
data. Only the boot data header is 3 word long (12 bytes).

This patch makes sure the whole image is exactly 0x800 by
adding one padding word after the boot data header. Since
the individual data structures are referenced by pointers,
this still results in a valid i.MX V2 header while
maintaining page alignment.

tools/imximage.h

index 36fe0958fee3023763b8fb4860d5c1fe98c69616..9a9c4d9fb2981a24b0b59f950c0daf5caf7281b9 100644 (file)
@@ -151,6 +151,7 @@ typedef struct {
 typedef struct {
        flash_header_v2_t fhdr;
        boot_data_t boot_data;
+       uint32_t reserved1;
        dcd_v2_t dcd_table;
 } imx_header_v2_t;