[U-Boot] [PATCH v2 4/5] tools: kwbimage: don't adjust for image_header for Armada MSYS

Chris Packham judge.packham at gmail.com
Fri Feb 15 22:49:01 UTC 2019


For the time being the Armada MSYS SoCs need to use the bin_hdr from the
Marvell U-Boot. Because of this the binary.0 does not contain the image
header that a proper u-boot SPL would so the adjustment introduced by
commit 94084eea3bd3 ("tools: kwbimage: Fix dest addr") does not apply.

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

Changes in v2:
- new, split out from Add DB-XC3-24G4XG board with a better explanation

 tools/Makefile   | 4 ++++
 tools/kwbimage.c | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/tools/Makefile b/tools/Makefile
index 081383d7a790..d99098d6167a 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -148,6 +148,10 @@ ifneq ($(CONFIG_ARMADA_38X)$(CONFIG_ARMADA_39X),)
 HOSTCFLAGS_kwbimage.o += -DCONFIG_KWB_SECURE
 endif
 
+ifneq ($(CONFIG_ARMADA_MSYS),)
+HOSTCFLAGS_kwbimage.o += -DCONFIG_KWB_DESTADDR_COMPAT
+endif
+
 # MXSImage needs LibSSL
 ifneq ($(CONFIG_MX23)$(CONFIG_MX28)$(CONFIG_ARMADA_38X)$(CONFIG_ARMADA_39X)$(CONFIG_FIT_SIGNATURE),)
 HOSTLOADLIBES_mkimage += \
diff --git a/tools/kwbimage.c b/tools/kwbimage.c
index a88a3830c0c8..4c60679fbb53 100644
--- a/tools/kwbimage.c
+++ b/tools/kwbimage.c
@@ -1252,8 +1252,12 @@ static void *image_create_v1(size_t *imagesz, struct image_tool_params *params,
 		cpu_to_le32(payloadsz - headersz + sizeof(uint32_t));
 	main_hdr->headersz_lsb = cpu_to_le16(headersz & 0xFFFF);
 	main_hdr->headersz_msb = (headersz & 0xFFFF0000) >> 16;
+#ifdef CONFIG_KWB_DESTADDR_COMPAT
+	main_hdr->destaddr     = cpu_to_le32(params->addr);
+#else
 	main_hdr->destaddr     = cpu_to_le32(params->addr)
 				 - sizeof(image_header_t);
+#endif
 	main_hdr->execaddr     = cpu_to_le32(params->ep);
 	main_hdr->srcaddr      = cpu_to_le32(headersz);
 	main_hdr->ext          = hasext;
-- 
2.20.1



More information about the U-Boot mailing list