All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 2/8 v2] powerpc/mpc85xx: modify the functionality clear_bss and aligning the end address of the BSS
@ 2013-06-07  9:25 ying.zhang at freescale.com
  2013-06-07  9:25 ` [U-Boot] [PATCH 5/8] powerpc: spl: deleted unused symbol CONFIG_SPL_NAND_MINIMAL and introduced new symbol CONFIG_SPL_MINIMAL ying.zhang at freescale.com
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: ying.zhang at freescale.com @ 2013-06-07  9:25 UTC (permalink / raw)
  To: u-boot

From: Ying Zhang <b40530@freescale.com>

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 address is equal to the _bss_end. If the end
address __bss_end is not alignment to 4byte, it will be an infinite loop.

1. The reset action stoped depending on the reset address is greater
than or equal the end address of the BSS.
2. The end address of the BSS should be 4byte aligned. Because the reset unit
is 4 Bytes.

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

Signed-off-by: Ying Zhang <b40530@freescale.com>
---
Compared with the previous version, add explicit alignment of the BSS start
address.

 arch/powerpc/cpu/mpc85xx/start.S        |    2 +-
 arch/powerpc/cpu/mpc85xx/u-boot-spl.lds |    2 ++
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/cpu/mpc85xx/start.S b/arch/powerpc/cpu/mpc85xx/start.S
index 4f0480b..2657982 100644
--- a/arch/powerpc/cpu/mpc85xx/start.S
+++ b/arch/powerpc/cpu/mpc85xx/start.S
@@ -1795,7 +1795,7 @@ clear_bss:
 	stw	r0,0(r3)
 	addi	r3,r3,4
 	cmplw	0,r3,r4
-	bne	5b
+	blt	5b
 6:
 
 	mr	r3,r9		/* Init Data pointer		*/
diff --git a/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds b/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds
index c613e58..5c7c598 100644
--- a/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds
+++ b/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds
@@ -89,10 +89,12 @@ SECTIONS
 	 */
 	. |= 0x10;
 
+	. = ALIGN(4);
 	__bss_start = .;
 	.bss : {
 		*(.sbss*)
 		*(.bss*)
 	}
+	. = ALIGN(4);
 	__bss_end = .;
 }
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2013-06-21 20:48 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-07  9:25 [U-Boot] [PATCH 2/8 v2] powerpc/mpc85xx: modify the functionality clear_bss and aligning the end address of the BSS ying.zhang at freescale.com
2013-06-07  9:25 ` [U-Boot] [PATCH 5/8] powerpc: spl: deleted unused symbol CONFIG_SPL_NAND_MINIMAL and introduced new symbol CONFIG_SPL_MINIMAL ying.zhang at freescale.com
2013-06-07 17:20   ` Scott Wood
2013-06-08  2:14     ` Zhang Ying-B40530
2013-06-10 18:32       ` Scott Wood
2013-06-10 22:40         ` Zhang Ying-B40530
2013-06-07  9:25 ` [U-Boot] [PATCH 6/8 v2] spl: env_common.c: make CONFIG_SPL_BUILD contain function env_import ying.zhang at freescale.com
2013-06-07  9:25 ` [U-Boot] [PATCH 8/8] powerpc/p1022ds: boot from spi flash with SPL ying.zhang at freescale.com
2013-06-19 16:36   ` Andy Fleming
2013-06-21 10:12     ` Zhang Ying-B40530
2013-06-21 20:48 ` [U-Boot] [U-Boot, 2/8, v2] powerpc/mpc85xx: modify the functionality clear_bss and aligning the end address of the BSS Andy Fleming

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.