From fa11dbe56da5283a56f6ec044a1049645dd2e036 Mon Sep 17 00:00:00 2001 From: Wolfgang Denk Date: Sun, 21 Nov 2010 16:34:05 +0100 Subject: arch/powerpc/*/config.mk: make CONFIG_SYS_LDSCRIPT settings work As we try to get rid of board specific config.mk files we must provide a way for board specific settings of the LDSCRIPT variable (path to the linker script) where needed. We now implement the following hierarchy: - Highest priority has a "#define CONFIG_SYS_LDCONFIG" in the board config file. - If CONFIG_SYS_LDCONFIG is not set, and the system is booting from NAND (CONFIG_NAND_SPL is set), then a board specific linker script board/$(BOARDDIR)/u-boot-nand.lds gets used. - If we are not booting from NAND, we test if a processor specific linker script arch/powerpc/cpu/$(CPU)/u-boot.lds exists; if so we use that. - As default, arch/powerpc/config.mk gets used. Signed-off-by: Wolfgang Denk Cc: Stefan Roese Cc: Kim Phillips Cc: Kumar Gala Cc: Andy Fleming Acked-by: Stefan Roese --- arch/powerpc/config.mk | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'arch/powerpc/config.mk') diff --git a/arch/powerpc/config.mk b/arch/powerpc/config.mk index 06a3b10..5bc849c 100644 --- a/arch/powerpc/config.mk +++ b/arch/powerpc/config.mk @@ -1,5 +1,5 @@ # -# (C) Copyright 2000-2002 +# (C) Copyright 2000-2010 # Wolfgang Denk, DENX Software Engineering, wd@denx.de. # # See file CREDITS for list of people who contributed to this @@ -29,6 +29,17 @@ PLATFORM_RELFLAGS += -mrelocatable PLATFORM_CPPFLAGS += -DCONFIG_PPC -D__powerpc__ PLATFORM_LDFLAGS += -n +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 +ifneq ($(wildcard $(SRCTREE)/arch/powerpc/cpu/$(CPU)/u-boot.lds),) +LDSCRIPT := $(SRCTREE)/arch/powerpc/cpu/$(CPU)/u-boot.lds +endif +endif + # # When cross-compiling on NetBSD, we have to define __PPC__ or else we # will pick up a va_list declaration that is incompatible with the -- cgit v1.1