All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Benoît Thébaudeau" <benoit.thebaudeau.dev@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/2] arm: Fix _start for CONFIG_SYS_DV_NOR_BOOT_CFG
Date: Wed,  3 Sep 2014 23:32:34 +0200	[thread overview]
Message-ID: <1409779954-14542-2-git-send-email-benoit.thebaudeau.dev@gmail.com> (raw)
In-Reply-To: <1409779954-14542-1-git-send-email-benoit.thebaudeau.dev@gmail.com>

The boards using CONFIG_SYS_DV_NOR_BOOT_CFG (i.e. calimain,
da850evm_direct_nor and enbw_cmc) had the _start symbol defined after
the CONFIG_SYS_DV_NOR_BOOT_CFG word rather than before it in
arch/arm/lib/vectors.S. Because of that, if by lack of luck
'gd->mon_len = (ulong)&__bss_end - (ulong)_start' (see setup_mon_len())
was a multiple of 4 kiB (see reserve_uboot()), then the last BSS word
overlapped the first word of the following reserved RAM area (or went
beyond the top of RAM without such an area) after relocation because
__image_copy_start did not match _start (see relocate_code()).

This was broken by commit 41623c9 'arm: move exception handling out of
start.S files', which defined _start twice (before and after the
CONFIG_SYS_DV_NOR_BOOT_CFG word), then by commit 0a26e1d 'arm: fix a
double-definition error of _start symbol', which kept the definition of
the _start symbol after the CONFIG_SYS_DV_NOR_BOOT_CFG word. This new
commit fixes this issue by restoring the original behavior, i.e. by
defining the _start symbol before the CONFIG_SYS_DV_NOR_BOOT_CFG word.

Signed-off-by: Beno?t Th?baudeau <benoit.thebaudeau.dev@gmail.com>
Cc: Albert Aribaud <albert.u.boot@aribaud.net>
Cc: Manfred Rudigier <manfred.rudigier@omicron.at>
Cc: Christian Riesch <christian.riesch@omicron.at>
Cc: Sudhakar Rajashekhara <sudhakar.raj@ti.com>
Cc: Heiko Schocher <hs@denx.de>
---
 arch/arm/lib/vectors.S |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/lib/vectors.S b/arch/arm/lib/vectors.S
index 843b18f..0cb87ce 100644
--- a/arch/arm/lib/vectors.S
+++ b/arch/arm/lib/vectors.S
@@ -45,11 +45,12 @@
  *************************************************************************
  */
 
+_start:
+
 #ifdef CONFIG_SYS_DV_NOR_BOOT_CFG
 	.word	CONFIG_SYS_DV_NOR_BOOT_CFG
 #endif
 
-_start:
 	b	reset
 	ldr	pc, _undefined_instruction
 	ldr	pc, _software_interrupt
-- 
1.7.10.4

  reply	other threads:[~2014-09-03 21:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-03 21:32 [U-Boot] [PATCH 1/2] arm: Make reset position-independent Benoît Thébaudeau
2014-09-03 21:32 ` Benoît Thébaudeau [this message]
2014-09-12  5:52   ` [U-Boot] [PATCH 2/2] arm: Fix _start for CONFIG_SYS_DV_NOR_BOOT_CFG Albert ARIBAUD
2014-09-03 21:52 ` [U-Boot] [PATCH 1/2] arm: Make reset position-independent Benoît Thébaudeau
2014-09-03 21:55 ` Benoît Thébaudeau
2014-09-05 18:41 ` Magnus Lilja
2014-09-09 20:24   ` Fabio Estevam
2014-09-12  5:51 ` Albert ARIBAUD

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=1409779954-14542-2-git-send-email-benoit.thebaudeau.dev@gmail.com \
    --to=benoit.thebaudeau.dev@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 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.