Skip to contentSkip to conversation

powerpc/mpc85xx: The end address of the bss in the SPL should be 4byte alignment

PATCH New ying.zhang at freescale.com 3 participants 3 messages May 14, 2013 – May 15, 2013 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 powerpc/mpc85xx: The end address of the bss in the SPL should be 4byte alignment

From: Ying Zhang <[email protected]>

There will clear the BSS in the function clear_bss(), the reset address of the BSS started from the __bss_start, and increased by four-byte increments, finally stoped depending on the adress is equal to the _bss_end. If the end address __bss_end is not alignment to 4byte, it will be an infinite loop.

The end address of the bss should be 4byte aligned.

This patch is on top of the patch "powerpc/mpc85xx: support application without resetvec segment in the linker script".

---
 arch/powerpc/cpu/mpc85xx/u-boot-spl.lds |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
arch/powerpc/cpu/mpc85xx/u-boot-spl.lds +2 -1
index dff2398..154438b 100644
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2006
+ * (C) Copyright 2013
  * Wolfgang Denk, DENX Software Engineering, wd at denx.de
  *
  * Copyright 2009 Freescale Semiconductor, Inc.
@@ -98,5 +98,6 @@ SECTIONS
 		*(.sbss*)
 		*(.bss*)
 	}
+	. = ALIGN(4);
 	__bss_end = .;
 }
Signature · 1 line
1.7.0.4
#1 lore raw

PATCH v2 1/1 powerpc/mpc85xx: The end address of the bss in the SPL should be 4byte alignment

Dear ying.zhang at freescale.com,

Quoted 1 line · In message <[email protected]> you…

From: Ying Zhang <[email protected]>

You mark this patch as V2 but there is no history of changes. Please always include information what exactly was changed.

Quoted 6 lines

There will clear the BSS in the function clear_bss(), the reset address of the BSS started from the __bss_start, and increased by four-byte increments, finally stoped depending on the adress is equal to the _bss_end. If the end address __bss_end is not alignment to 4byte, it will be an infinite loop.

The end address of the bss should be 4byte aligned.

NAK. This is the wrong way to fix this.

Instead, the test in the loop should be fixed to test for "<=".

Quoted 4 lines

/*
- * (C) Copyright 2006
+ * (C) Copyright 2013
* Wolfgang Denk, DENX Software Engineering, wd at denx.de

And PLEASE do not mess with _my_ copyrights!!!

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
God runs electromagnetics by wave theory on  Monday,  Wednesday,  and
Friday,  and the Devil runs them by quantum theory on Tuesday, Thurs-
day, and Saturday.                                   -- William Bragg
#2 lore raw

PATCH v2 1/1 powerpc/mpc85xx: The end address of the bss in the SPL should be 4byte alignment

Quoted 16 lines · Wolfgang Denk

Dear ying.zhang at freescale.com,

In message <[email protected]> you

Quoted 1 line · wrote:

From: Ying Zhang <[email protected]>

You mark this patch as V2 but there is no history of changes. Please always include information what exactly was changed.

Quoted 1 line

There will clear the BSS in the function clear_bss(), the reset

address of

Quoted 1 line

the BSS started from the __bss_start, and increased by four-byte

increments,

Quoted 1 line

finally stoped depending on the adress is equal to the _bss_end. If

the end

Quoted 8 lines
Quoted 1 line

address __bss_end is not alignment to 4byte, it will be an infinite

loop.

Quoted 2 lines

The end address of the bss should be 4byte aligned.

NAK. This is the wrong way to fix this.

Instead, the test in the loop should be fixed to test for "<=".

I agree that we should use <= in the loop, but 4-byte alignment is also needed unless we change it from an stw loop to an stb loop.

-Scott