]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
tools/kwbimage.c: Make sure that the resulting image is 4-byte aligned
authorStefan Roese <sr@denx.de>
Tue, 24 Nov 2015 08:14:59 +0000 (09:14 +0100)
committerLuka Perkov <luka.perkov@sartura.hr>
Sun, 29 Nov 2015 15:02:44 +0000 (16:02 +0100)
With the dtb added to the main U-Boot image, it can happen, that
the resulting image is not 4-byte aligned. As the dtb tends to
be unaligned. But the image needs to be 4-byte aligned. At least the
Marvell hdrparser tool complains if its unaligned. By returning 1 here
in kwbimage_generate(), called via tparams->vrec_header() in mkimage.c,
mkimage will automatically pad the resulting image to a 4-byte size
if necessary.

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

index 5f6d91c486559e5982333b9e2b50d46183817f6b..8fe3bf41e9d0c7d33c3e15a498342e7d04b77075 100644 (file)
@@ -810,7 +810,15 @@ static int kwbimage_generate(struct image_tool_params *params,
        tparams->header_size = alloc_len;
        tparams->hdr = hdr;
 
-       return 0;
+       /*
+        * The resulting image needs to be 4-byte aligned. At least
+        * the Marvell hdrparser tool complains if its unaligned.
+        * By returning 1 here in this function, called via
+        * tparams->vrec_header() in mkimage.c, mkimage will
+        * automatically pad the the resulting image to a 4-byte
+        * size if necessary.
+        */
+       return 1;
 }
 
 /*