summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2022-01-05 21:08:45 +0300
committerTom Rini <trini@konsulko.com>2022-01-05 21:08:45 +0300
commitc00c147dae51f06e012841371f9baffb4b9dc1b3 (patch)
tree126947ea7614970b1e7d8bb889a626a00222651b
parentb3f84a939f514a266a5a3aa97cbe2787c2d73d89 (diff)
parent9203c73895ab410f7a57f56ec26201253a1f008b (diff)
downloadu-boot-c00c147dae51f06e012841371f9baffb4b9dc1b3.tar.xz
Merge https://source.denx.de/u-boot/custodians/u-boot-marvell
- kwbimage: Fix checksum calculation for v1 images (Pierre)
-rw-r--r--tools/kwbimage.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/kwbimage.c b/tools/kwbimage.c
index da8bfe0518..224d8156be 100644
--- a/tools/kwbimage.c
+++ b/tools/kwbimage.c
@@ -1400,9 +1400,6 @@ static void *image_create_v1(size_t *imagesz, struct image_tool_params *params,
headersz, image, secure_hdr))
return NULL;
- /* Calculate and set the header checksum */
- main_hdr->checksum = image_checksum8(main_hdr, headersz);
-
*imagesz = headersz;
/* Fill the real header size without padding into the main header */
@@ -1412,6 +1409,9 @@ static void *image_create_v1(size_t *imagesz, struct image_tool_params *params,
main_hdr->headersz_lsb = cpu_to_le16(headersz & 0xFFFF);
main_hdr->headersz_msb = (headersz & 0xFFFF0000) >> 16;
+ /* Calculate and set the header checksum */
+ main_hdr->checksum = image_checksum8(main_hdr, headersz);
+
return image;
}