All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [RFC PATCH v1 0/1] Generating kwb image for custom board
@ 2015-02-22 22:25 Chris Packham
  2015-02-22 22:25 ` [U-Boot] [RFC PATCH v1] kwbimage: Align v1 binary header to 4B Chris Packham
  0 siblings, 1 reply; 4+ messages in thread
From: Chris Packham @ 2015-02-22 22:25 UTC (permalink / raw)
  To: u-boot

Hi,

I'm trying to get u-boot 2015.01 up and running on a custom board using
an integrated version of Marvell's Armada-XP in a switch ASIC (the
Marvell term is MSYS).

One thing I ran into after extracting the DDR initialisation from the
Marvell bootloader was that the Bootrom Firmware (Marvell's
pre-bootloader) reported the following

  BootROM 1.34
  Booting from SPI flash
  BootROM: Bad header at offset 00000000
  BootROM: Bad header at offset 00200000
  ...

After a bit of debugging I found that this was because the binary.0 for
my board had a length of 0x0148ec which doesn't conform to the following
requirement in the Marvell functional spec -- "The header length in
bytes. The value must be aligned to 4B." While I could pad out my
binary.0 it seems safer to update kwbimage.c to conform with the
specification.

The original issue still exists in master but I suspect now that master
is using a u-boot-spl image for the Armada-XP boards the spl image is
implicitly conformant.


Chris Packham (1):
  kwbimage: Align v1 binary header to 4B

 tools/kwbimage.c | 1 +
 1 file changed, 1 insertion(+)

-- 
2.2.0.rc0

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

* [U-Boot] [RFC PATCH v1] kwbimage: Align v1 binary header to 4B
  2015-02-22 22:25 [U-Boot] [RFC PATCH v1 0/1] Generating kwb image for custom board Chris Packham
@ 2015-02-22 22:25 ` Chris Packham
  2015-02-23  8:04   ` Stefan Roese
  0 siblings, 1 reply; 4+ messages in thread
From: Chris Packham @ 2015-02-22 22:25 UTC (permalink / raw)
  To: u-boot

According to the Armada-XP documentation the binary header format
requires the header length to be aligned to 4B.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
---

 tools/kwbimage.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/kwbimage.c b/tools/kwbimage.c
index de5c808..9540e7e 100644
--- a/tools/kwbimage.c
+++ b/tools/kwbimage.c
@@ -498,6 +498,7 @@ static void *image_create_v1(size_t *imagesz, struct image_tool_params *params,
 		binhdrsz = sizeof(struct opt_hdr_v1) +
 			(binarye->binary.nargs + 1) * sizeof(unsigned int) +
 			s.st_size;
+		binhdrsz = ALIGN_SUP(binhdrsz, 32);
 		hdr->headersz_lsb = binhdrsz & 0xFFFF;
 		hdr->headersz_msb = (binhdrsz & 0xFFFF0000) >> 16;
 
-- 
2.2.0.rc0

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

* [U-Boot] [RFC PATCH v1] kwbimage: Align v1 binary header to 4B
  2015-02-22 22:25 ` [U-Boot] [RFC PATCH v1] kwbimage: Align v1 binary header to 4B Chris Packham
@ 2015-02-23  8:04   ` Stefan Roese
       [not found]     ` <F766E4F80769BD478052FB6533FA745D610F296212@SC-VEXCH4.marvell.com>
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Roese @ 2015-02-23  8:04 UTC (permalink / raw)
  To: u-boot

Hi Chris,

(added Prafulla and Luka to Cc)

On 22.02.2015 23:25, Chris Packham wrote:
> According to the Armada-XP documentation the binary header format
> requires the header length to be aligned to 4B.
>
> Signed-off-by: Chris Packham <judge.packham@gmail.com>

Thanks for spotting this:

Acked-by: Stefan Roese <sr@denx.de>

Thanks,
Stefan

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

* [U-Boot] [RFC PATCH v1] kwbimage: Align v1 binary header to 4B
       [not found]     ` <F766E4F80769BD478052FB6533FA745D610F296212@SC-VEXCH4.marvell.com>
@ 2015-02-23 17:27       ` Luka Perkov
  0 siblings, 0 replies; 4+ messages in thread
From: Luka Perkov @ 2015-02-23 17:27 UTC (permalink / raw)
  To: u-boot

On Mon, Feb 23, 2015 at 01:06:49AM -0800, Prafulla Wadaskar wrote:
> > Hi Chris,
> > 
> > (added Prafulla and Luka to Cc)
> > 
> > On 22.02.2015 23:25, Chris Packham wrote:
> > > According to the Armada-XP documentation the binary header format
> > > requires the header length to be aligned to 4B.
> > >
> > > Signed-off-by: Chris Packham <judge.packham@gmail.com>
> > 
> > Thanks for spotting this:
> > 
> > Acked-by: Stefan Roese <sr@denx.de>
> 
> Acked-by: Prafulla Wadaskar <Prafulla@marvell.com>

Pushed to u-boot-marvell master branch. Thank you.

Luka

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

end of thread, other threads:[~2015-02-23 17:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-22 22:25 [U-Boot] [RFC PATCH v1 0/1] Generating kwb image for custom board Chris Packham
2015-02-22 22:25 ` [U-Boot] [RFC PATCH v1] kwbimage: Align v1 binary header to 4B Chris Packham
2015-02-23  8:04   ` Stefan Roese
     [not found]     ` <F766E4F80769BD478052FB6533FA745D610F296212@SC-VEXCH4.marvell.com>
2015-02-23 17:27       ` Luka Perkov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.