public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] tools: make imxheader size align on page size
@ 2014-04-16 13:29 stefan at agner.ch
  2014-04-16 15:44 ` Stefano Babic
  0 siblings, 1 reply; 10+ messages in thread
From: stefan at agner.ch @ 2014-04-16 13:29 UTC (permalink / raw)
  To: u-boot

From: Stefan Agner <stefan@agner.ch>

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.

Signed-off-by: Stefan Agner <stefan@agner.ch>
---
I'm not 100% sure wheather this is the right approach solving
this issue. This works for me, also tested with DCD data.

 tools/imximage.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/imximage.h b/tools/imximage.h
index 01f861e..b596fb1 100644
--- a/tools/imximage.h
+++ b/tools/imximage.h
@@ -149,6 +149,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;
 
-- 
1.9.2

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-04-23 18:07 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-16 13:29 [U-Boot] [PATCH] tools: make imxheader size align on page size stefan at agner.ch
2014-04-16 15:44 ` Stefano Babic
2014-04-16 13:17   ` Stefan Agner
2014-04-16 13:36     ` Stefan Agner
2014-04-17  8:50       ` Stefano Babic
2014-04-23  2:34         ` Stefan Agner
2014-04-23 15:19           ` Stefano Babic
2014-04-23  9:55             ` Stefan Agner
2014-04-23 18:07               ` Stefano Babic
2014-04-17 12:34     ` Stefano Babic

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox