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