All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Roese <sr@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] tools: kwboot: patch destaddr only for SoCs with header version 1
Date: Tue, 9 Aug 2016 10:27:33 +0200	[thread overview]
Message-ID: <089f93b6-5857-5d79-d633-b484ddafd2a2@denx.de> (raw)
In-Reply-To: <1470681585-24848-1-git-send-email-gmbnomis@gmail.com>

Hi Simon,

On 08.08.2016 20:39, Simon Baatz wrote:
> Commit f4db6c976cf ("arm: mvebu: Add runtime detection of UART (xmodem)
> boot-mode") added a change to hdr->destaddr when dynamically patching an
> image for UART boot mode.  With this change, kwboot ceases to work on
> Kirkwood.
>
> Thus, let's change hdr->destaddr only when we are patching an image with
> header version 1 (Orion and Kirkwood use header version 0).
>
> Signed-off-by: Simon Baatz <gmbnomis@gmail.com>
> Fixes: f4db6c976cf ("arm: mvebu: Add runtime detection of UART (xmodem) boot-mode")
> Cc: Stefan Roese <sr@denx.de>
> Cc: Luka Perkov <luka.perkov@sartura.hr>
> Cc: Kevin Smith <kevin.smith@elecsyscorp.com>
> ---
>
> Hi,
>
> this patch makes kwboot work again on Kirkwood for me.  However, I could not
> verify whether Armada XP / 38x still works, since I don't have such
> hardware.

Thanks for the patch. I'll test it AXP / A38x next week. One comment
below.

> - Simon
>
>  tools/kwboot.c | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/tools/kwboot.c b/tools/kwboot.c
> index e00958a..4160e5b 100644
> --- a/tools/kwboot.c
> +++ b/tools/kwboot.c
> @@ -655,14 +655,6 @@ kwboot_img_patch_hdr(void *img, size_t size)
>
>  	hdr->blockid = IBR_HDR_UART_ID;
>
> -	/*
> -	 * Subtract mkimage header size from destination address
> -	 * as this header is not expected by the Marvell BootROM.
> -	 * This way, the execution address is identical to the
> -	 * one the image is compiled for (TEXT_BASE).
> -	 */
> -	hdr->destaddr = hdr->destaddr - sizeof(struct image_header);
> -
>  	if (image_ver == 0) {
>  		struct main_hdr_v0 *hdr_v0 = img;
>
> @@ -672,6 +664,14 @@ kwboot_img_patch_hdr(void *img, size_t size)
>  		hdr_v0->srcaddr = hdr_v0->ext
>  			? sizeof(struct kwb_header)
>  			: sizeof(*hdr_v0);
> +	} else {
> +	  /*
> +	   * Subtract mkimage header size from destination address
> +	   * as this header is not expected by the Marvell BootROM.
> +	   * This way, the execution address is identical to the
> +	   * one the image is compiled for (TEXT_BASE).
> +	   */
> +	  hdr->destaddr = hdr->destaddr - sizeof(struct image_header);

Indentation looks incorrect here. Please change and send v2. I'll
apply it next after I return from my short vacation.

Thanks,
Stefan

      reply	other threads:[~2016-08-09  8:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-08 18:39 [U-Boot] [PATCH] tools: kwboot: patch destaddr only for SoCs with header version 1 Simon Baatz
2016-08-09  8:27 ` Stefan Roese [this message]

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=089f93b6-5857-5d79-d633-b484ddafd2a2@denx.de \
    --to=sr@denx.de \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.