diff mbox

[U-Boot,v4] arm, davinci: Fix clear bss loop for zero length bss

Message ID 1322563736-6672-1-git-send-email-christian.riesch@omicron.at
State Superseded
Headers show

Commit Message

Christian Riesch Nov. 29, 2011, 10:48 a.m. UTC
This patch fixes the clear bss loop for bss sections that have
zero length, i.e., where __bss_start == __bss_end__.

Signed-off-by: Christian Riesch <christian.riesch@omicron.at>
Cc: Albert Aribaud <albert.u.boot@aribaud.net>
---
Hi,
this is v4 of a patch out of my recent patchset

[PATCH v3 00/15] Add an SPL to boot the da850evm from SPI
http://lists.denx.de/pipermail/u-boot/2011-November/111182.html

Changes for v4:
- split the patchset since it is getting quite big

Regards, Christian

 arch/arm/cpu/arm926ejs/start.S |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

Comments

Christian Riesch Nov. 29, 2011, 10:56 a.m. UTC | #1
On Tue, Nov 29, 2011 at 11:48 AM, Christian Riesch
<christian.riesch@omicron.at> wrote:
> This patch fixes the clear bss loop for bss sections that have
> zero length, i.e., where __bss_start == __bss_end__.
>
> Signed-off-by: Christian Riesch <christian.riesch@omicron.at>
> Cc: Albert Aribaud <albert.u.boot@aribaud.net>

Oh, wrong subject line, this is for arm, not only for 'arm, davinci'.
Sorry, I'll repost.
Christian
diff mbox

Patch

diff --git a/arch/arm/cpu/arm926ejs/start.S b/arch/arm/cpu/arm926ejs/start.S
index 8b5355b..772793c 100644
--- a/arch/arm/cpu/arm926ejs/start.S
+++ b/arch/arm/cpu/arm926ejs/start.S
@@ -299,10 +299,12 @@  clear_bss:
 #endif
 	mov	r2, #0x00000000		/* clear			    */
 
-clbss_l:str	r2, [r0]		/* clear loop...		    */
+clbss_l:cmp	r0, r1			/* clear loop...		    */
+	beq	clbss_e
+	str	r2, [r0]
 	add	r0, r0, #4
-	cmp	r0, r1
-	bne	clbss_l
+	b	clbss_l
+clbss_e:
 
 #ifndef CONFIG_SPL_BUILD
 	bl coloured_LED_init