diff mbox

[U-Boot] powerpc: fix LDSCRIPT in NAND boot

Message ID 1296202676-30873-1-git-send-email-b35336@freescale.com
State Superseded
Delegated to: Scott Wood
Headers show

Commit Message

Zhao Chenhui Jan. 28, 2011, 8:17 a.m. UTC
ONFIG_NAND_U_BOOT indicates whether the SPL is used, while
CONFIG_NAND_SPL is set only when building the SPL itself (and isn't
available in makefiles anyway).  This is the linker script for the
main U-Boot when SPL is in use, so CONFIG_NAND_U_BOOT is the
variable to use.

Also, refrain from overriding LDSCRIPT with a NAND-specific script,
unless such a script exists.

Signed-off-by: Zhao Chenhui <b35336@freescale.com>
Acked-by: Scott Wood <scottwood@freescale.com>
---
 arch/powerpc/config.mk |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

Comments

Wolfgang Denk April 12, 2011, 6:39 p.m. UTC | #1
Dear Zhao Chenhui,

In message <1296202676-30873-1-git-send-email-b35336@freescale.com> you wrote:
> ONFIG_NAND_U_BOOT indicates whether the SPL is used, while
> CONFIG_NAND_SPL is set only when building the SPL itself (and isn't
> available in makefiles anyway).  This is the linker script for the
> main U-Boot when SPL is in use, so CONFIG_NAND_U_BOOT is the
> variable to use.
> 
> Also, refrain from overriding LDSCRIPT with a NAND-specific script,
> unless such a script exists.
> 
> Signed-off-by: Zhao Chenhui <b35336@freescale.com>
> Acked-by: Scott Wood <scottwood@freescale.com>
> ---
>  arch/powerpc/config.mk |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk
Scott Wood April 12, 2011, 6:43 p.m. UTC | #2
On Tue, 12 Apr 2011 20:39:21 +0200
Wolfgang Denk <wd@denx.de> wrote:

> Dear Zhao Chenhui,
> 
> In message <1296202676-30873-1-git-send-email-b35336@freescale.com> you wrote:
> > ONFIG_NAND_U_BOOT indicates whether the SPL is used, while
> > CONFIG_NAND_SPL is set only when building the SPL itself (and isn't
> > available in makefiles anyway).  This is the linker script for the
> > main U-Boot when SPL is in use, so CONFIG_NAND_U_BOOT is the
> > variable to use.
> > 
> > Also, refrain from overriding LDSCRIPT with a NAND-specific script,
> > unless such a script exists.
> > 
> > Signed-off-by: Zhao Chenhui <b35336@freescale.com>
> > Acked-by: Scott Wood <scottwood@freescale.com>
> > ---
> >  arch/powerpc/config.mk |    6 ++++--
> >  1 files changed, 4 insertions(+), 2 deletions(-)
> 
> Applied, thanks.

This patch is incorrect and was supposed to be superseded by
http://patchwork.ozlabs.org/patch/90112/

-Scott
Wolfgang Denk April 12, 2011, 9:07 p.m. UTC | #3
Dear Scott Wood,

In message <20110412134338.7b5d0eaa@schlenkerla.am.freescale.net> you wrote:
> On Tue, 12 Apr 2011 20:39:21 +0200
> Wolfgang Denk <wd@denx.de> wrote:
> 
> > Dear Zhao Chenhui,
> > 
> > In message <1296202676-30873-1-git-send-email-b35336@freescale.com> you wrote:
> > > ONFIG_NAND_U_BOOT indicates whether the SPL is used, while
> > > CONFIG_NAND_SPL is set only when building the SPL itself (and isn't
> > > available in makefiles anyway).  This is the linker script for the
> > > main U-Boot when SPL is in use, so CONFIG_NAND_U_BOOT is the
> > > variable to use.
> > > 
> > > Also, refrain from overriding LDSCRIPT with a NAND-specific script,
> > > unless such a script exists.
> > > 
> > > Signed-off-by: Zhao Chenhui <b35336@freescale.com>
> > > Acked-by: Scott Wood <scottwood@freescale.com>
> > > ---
> > >  arch/powerpc/config.mk |    6 ++++--
> > >  1 files changed, 4 insertions(+), 2 deletions(-)
> > 
> > Applied, thanks.
> 
> This patch is incorrect and was supposed to be superseded by
> http://patchwork.ozlabs.org/patch/90112/

Ouch. Thanks for the heads up, it was just in time so I could still
drop that patch.  The new one (90112) is on my todo list.

Best regards,

Wolfgang Denk
diff mbox

Patch

diff --git a/arch/powerpc/config.mk b/arch/powerpc/config.mk
index 2912604..08ad333 100644
--- a/arch/powerpc/config.mk
+++ b/arch/powerpc/config.mk
@@ -32,8 +32,10 @@  PLATFORM_LDFLAGS  += -n --gc-sections
 ifdef CONFIG_SYS_LDSCRIPT
 # need to strip off double quotes
 LDSCRIPT := $(subst ",,$(CONFIG_SYS_LDSCRIPT))
-else ifdef CONFIG_NAND_SPL
-LDSCRIPT := $(SRCTREE)/$(CONFIG_BOARDDIR)/u-boot-nand.lds
+else ifdef CONFIG_NAND_U_BOOT
+ifneq ($(wildcard $(SRCTREE)/$(CPUDIR)/u-boot-nand.lds),)
+LDSCRIPT := $(SRCTREE)/$(CPUDIR)/u-boot-nand.lds
+endif
 else
 ifneq ($(wildcard $(SRCTREE)/arch/powerpc/cpu/$(CPU)/u-boot.lds),)
 LDSCRIPT := $(SRCTREE)/arch/powerpc/cpu/$(CPU)/u-boot.lds