kwbimage: Align payload size to 4 bytes
authorStefan Roese <sr@denx.de>
Tue, 1 Sep 2015 11:46:35 +0000 (13:46 +0200)
committerLuka Perkov <luka.perkov@sartura.hr>
Wed, 21 Oct 2015 00:25:01 +0000 (02:25 +0200)
The MVEBU BootROM does not allow non word aligned payloads.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Luka Perkov <luka.perkov@sartura.hr>
tools/kwbimage.c

index 5e62d08a80799ac1f5d707d81589d35982574ce8..d33f1b6974f7cbfdbcacd0adf37096b448d47813 100644 (file)
@@ -681,6 +681,9 @@ static void kwbimage_set_header(void *ptr, struct stat *sbuf, int ifd,
                exit(EXIT_FAILURE);
        }
 
+       /* The MVEBU BootROM does not allow non word aligned payloads */
+       sbuf->st_size = ALIGN_SUP(sbuf->st_size, 4);
+
        version = image_get_version();
        switch (version) {
                /*