diff mbox

[U-Boot,RFC,v1] kwbimage: Align v1 binary header to 4B

Message ID 1424643920-2237-2-git-send-email-judge.packham@gmail.com
State RFC
Delegated to: Prafulla Wadaskar
Headers show

Commit Message

Chris Packham Feb. 22, 2015, 10:25 p.m. UTC
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(+)

Comments

Stefan Roese Feb. 23, 2015, 8:04 a.m. UTC | #1
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
Luka Perkov Feb. 23, 2015, 5:27 p.m. UTC | #2
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
diff mbox

Patch

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;