public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v2] powerpc/mpc85xx: The end address of the bss in the SPL should be 4byte alignment
@ 2013-05-14  8:41 ying.zhang at freescale.com
  2013-05-14 10:30 ` Wolfgang Denk
  0 siblings, 1 reply; 3+ messages in thread
From: ying.zhang at freescale.com @ 2013-05-14  8:41 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 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".

Signed-off-by: Ying Zhang <b40530@freescale.com>
---
 arch/powerpc/cpu/mpc85xx/u-boot-spl.lds |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds b/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds
index dff2398..154438b 100644
--- a/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds
+++ b/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds
@@ -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 = .;
 }
-- 
1.7.0.4

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

* [U-Boot] [PATCH v2] powerpc/mpc85xx: The end address of the bss in the SPL should be 4byte alignment
  2013-05-14  8:41 [U-Boot] [PATCH v2] powerpc/mpc85xx: The end address of the bss in the SPL should be 4byte alignment ying.zhang at freescale.com
@ 2013-05-14 10:30 ` Wolfgang Denk
  2013-05-15 16:50   ` Scott Wood
  0 siblings, 1 reply; 3+ messages in thread
From: Wolfgang Denk @ 2013-05-14 10:30 UTC (permalink / raw)
  To: u-boot

Dear ying.zhang at freescale.com,

In message <1368520918-22496-1-git-send-email-ying.zhang@freescale.com> you wrote:
> From: Ying Zhang <b40530@freescale.com>

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

> 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 "<=".

>  /*
> - * (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

-- 
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

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

* [U-Boot] [PATCH v2] powerpc/mpc85xx: The end address of the bss in the SPL should be 4byte alignment
  2013-05-14 10:30 ` Wolfgang Denk
@ 2013-05-15 16:50   ` Scott Wood
  0 siblings, 0 replies; 3+ messages in thread
From: Scott Wood @ 2013-05-15 16:50 UTC (permalink / raw)
  To: u-boot

On 05/14/2013 05:30:05 AM, Wolfgang Denk wrote:
> Dear ying.zhang at freescale.com,
> 
> In message  
> <1368520918-22496-1-git-send-email-ying.zhang@freescale.com> you  
> wrote:
> > From: Ying Zhang <b40530@freescale.com>
> 
> You mark this patch as V2 but there is no history of changes.  Please
> always include information what exactly was changed.
> 
> > 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 "<=".

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

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

end of thread, other threads:[~2013-05-15 16:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-14  8:41 [U-Boot] [PATCH v2] powerpc/mpc85xx: The end address of the bss in the SPL should be 4byte alignment ying.zhang at freescale.com
2013-05-14 10:30 ` Wolfgang Denk
2013-05-15 16:50   ` Scott Wood

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox