All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Subject: Re: [flasher PATCH 2/4] Increase padding between U-Boot binary and flash image
Date: Fri, 6 Dec 2013 16:12:15 +0100	[thread overview]
Message-ID: <20131206151214.GB32372@ulmo.nvidia.com> (raw)
In-Reply-To: <1386281582-18561-2-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 1741 bytes --]

On Thu, Dec 05, 2013 at 03:13:00PM -0700, Stephen Warren wrote:
> From: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
> 
> The flasher currently places the flash image in RAM almost directly above
> the initial U-Boot binary location, with just a little padding/alignment
> in between. This is also where U-Boot's BSS is located, prior to U-Boot
> relocating itself to the top of RAM. Hence, if U-Boot touches its BSS, it
> will corrupt the flash image. Increase the padding between U-Boot/DT and
> the flash image to avoid this. U-Boot's BSS is roughly 300K at present.
> Make the pad size 1M to allow plenty of room for growth.
> 
> Signed-off-by: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
> ---
>  tegra-uboot-flasher | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tegra-uboot-flasher b/tegra-uboot-flasher
> index d97b9e43aa45..06e297730112 100755
> --- a/tegra-uboot-flasher
> +++ b/tegra-uboot-flasher
> @@ -143,9 +143,9 @@ def func_flash():
>      if args.debug:
>          print 'u_boot_plus_dtb_size %d 0x%x' % (u_boot_plus_dtb_size, u_boot_plus_dtb_size)
>  
> -    # Add 32k in case size changes due to fdtput
> +    # Add 1024k to avoid U-Boot's BSS, and in case the DT size changes due to fdtput
>      # Align to 4k, so flash writes don't need a bounce buffer for DMA
> -    padded_size = (u_boot_plus_dtb_size + (32 * 1024) + (4 * 1024) - 1) & ~((4 * 1024) - 1)
> +    padded_size = (u_boot_plus_dtb_size + (1024 * 1024) + (4 * 1024) - 1) & ~((4 * 1024) - 1)

You could save a multiplication here by extracting the common factor
1024... =)

Reviewed-by: Thierry Reding <treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

  parent reply	other threads:[~2013-12-06 15:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-05 22:12 [flasher PATCH 1/4] Add crc32 verification of the flash image Stephen Warren
     [not found] ` <1386281582-18561-1-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-12-05 22:13   ` [flasher PATCH 2/4] Increase padding between U-Boot binary and " Stephen Warren
     [not found]     ` <1386281582-18561-2-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-12-06 15:12       ` Thierry Reding [this message]
2013-12-05 22:13   ` [flasher PATCH 3/4] Allow overriding environment variables during flashing Stephen Warren
     [not found]     ` <1386281582-18561-3-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-12-06 15:16       ` Thierry Reding
2013-12-05 22:13   ` [flasher PATCH 4/4] Provide progress messages Stephen Warren
     [not found]     ` <1386281582-18561-4-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-12-06 15:18       ` Thierry Reding
2013-12-06 15:09   ` [flasher PATCH 1/4] Add crc32 verification of the flash image Thierry Reding

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=20131206151214.GB32372@ulmo.nvidia.com \
    --to=thierry.reding-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org \
    --cc=swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
    /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.