Hi Chris,

On 15.02.19 23:49, Chris Packham wrote:
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.

Thanks for the explanation. I'm wondering if it would be better (if
possible) to auto detect this situation of using a bin_hdr from Marvell
vs U-Boot SPL instead in this tool. This would help especially if we
have full DDR init support in mainline U-Boot for this SoC at some
time, as we then need to differentiate between those two options for
this SoC.

Would this be possible?

Thanks,
Stefan
Signed-off-by: Chris Packham <judge.pack...@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;


Viele Grüße,
Stefan

--
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: s...@denx.de
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot

Reply via email to