public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Chris Packham <judge.packham@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 4/5] tools: kwbimage: don't adjust for image_header for Armada MSYS
Date: Sat, 16 Feb 2019 11:49:01 +1300	[thread overview]
Message-ID: <20190215224902.28351-5-judge.packham@gmail.com> (raw)
In-Reply-To: <20190215224902.28351-1-judge.packham@gmail.com>

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@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

  parent reply	other threads:[~2019-02-15 22:49 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-15 22:48 [U-Boot] [PATCH v2 0/5] Marvell DB-XC3-24G4XG board support Chris Packham
2019-02-15 22:48 ` [U-Boot] [PATCH v2 1/5] arm: sync armada-xp dts files from Linux 5.0 Chris Packham
2019-02-19  6:33   ` Stefan Roese
2019-04-11 11:50   ` Stefan Roese
2019-02-15 22:48 ` [U-Boot] [PATCH v2 2/5] arm: mvebu: Add Marvell's integrated CPUs Chris Packham
2019-02-19  6:34   ` Stefan Roese
2019-02-15 22:49 ` [U-Boot] [PATCH v2 3/5] arm: mvebu: NAND clock support for MSYS devices Chris Packham
2019-02-19  6:34   ` Stefan Roese
2019-02-15 22:49 ` Chris Packham [this message]
2019-02-18  7:13   ` [U-Boot] [PATCH v2 4/5] tools: kwbimage: don't adjust for image_header for Armada MSYS Stefan Roese
2019-02-18 22:23     ` Chris Packham
2019-02-19  6:18       ` Stefan Roese
2019-02-15 22:49 ` [U-Boot] [PATCH v2 5/5] arm: mvebu: Add DB-XC3-24G4XG board Chris Packham
2019-02-19  6:37   ` Stefan Roese
2019-04-11  6:45   ` Stefan Roese
2019-04-11  7:23     ` Chris Packham
2019-04-11  8:21       ` Chris Packham
2019-04-11  8:35         ` Stefan Roese
2019-04-11 10:16           ` Chris Packham

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190215224902.28351-5-judge.packham@gmail.com \
    --to=judge.packham@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox