Make STANDALONE_LOAD_ADDR configurable per board
authorWolfgang Denk <wd@denx.de>
Fri, 4 Feb 2011 13:25:17 +0000 (14:25 +0100)
committerWolfgang Denk <wd@denx.de>
Tue, 12 Apr 2011 20:58:32 +0000 (22:58 +0200)
Rename STANDALONE_LOAD_ADDR into CONFIG_STANDALONE_LOAD_ADDR
and allow that the architecture-specific default value gets
overwritten by defining the value in the board header file.

Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Mike Frysinger <vapier@gentoo.org>
Cc: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
Cc: Daniel Hellstrom <daniel@gaisler.com>
Cc: Tsi Chung Liew <tsi-chung.liew@freescale.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
13 files changed:
README
arch/arm/config.mk
arch/avr32/config.mk
arch/blackfin/config.mk
arch/i386/config.mk
arch/m68k/config.mk
arch/microblaze/config.mk
arch/mips/config.mk
arch/powerpc/config.mk
arch/sh/config.mk
arch/sparc/config.mk
examples/standalone/Makefile
include/configs/omap2420h4.h

diff --git a/README b/README
index c128a6c..c9fedd8 100644 (file)
--- a/README
+++ b/README
@@ -1997,6 +1997,14 @@ The following options need to be configured:
                example, some LED's) on your board. At the moment,
                the following checkpoints are implemented:
 
+- Standalone program support:
+               CONFIG_STANDALONE_LOAD_ADDR
+
+               This option allows to define board specific values
+               for the address where standalone program gets loaded,
+               thus overwriting the architecutre dependent default
+               settings.
+
 Legacy uImage format:
 
   Arg  Where                   When
index a6a4742..fcc26a2 100644 (file)
 
 CROSS_COMPILE ?= arm-linux-
 
-ifeq ($(BOARD),omap2420h4)
-STANDALONE_LOAD_ADDR = 0x80300000
-else
+ifndef CONFIG_STANDALONE_LOAD_ADDR
 ifeq ($(SOC),omap3)
-STANDALONE_LOAD_ADDR = 0x80300000
+CONFIG_STANDALONE_LOAD_ADDR = 0x80300000
 else
-STANDALONE_LOAD_ADDR = 0xc100000
+CONFIG_STANDALONE_LOAD_ADDR = 0xc100000
 endif
 endif
 
index 1121ca1..9488c49 100644 (file)
@@ -23,7 +23,7 @@
 
 CROSS_COMPILE ?= avr32-linux-
 
-STANDALONE_LOAD_ADDR = 0x00000000
+CONFIG_STANDALONE_LOAD_ADDR ?= 0x00000000
 
 PLATFORM_RELFLAGS      += -ffixed-r5 -fPIC -mno-init-got -mrelax
 PLATFORM_LDFLAGS       += --relax
index 95cf7db..f0909e9 100644 (file)
@@ -23,7 +23,7 @@
 
 CROSS_COMPILE ?= bfin-uclinux-
 
-STANDALONE_LOAD_ADDR = 0x1000 -m elf32bfin
+CONFIG_STANDALONE_LOAD_ADDR ?= 0x1000 -m elf32bfin
 
 ifeq ($(CONFIG_BFIN_CPU),)
 CONFIG_BFIN_CPU := \
index 47e0fb4..e945201 100644 (file)
@@ -21,7 +21,7 @@
 # MA 02111-1307 USA
 #
 
-STANDALONE_LOAD_ADDR = 0x40000
+CONFIG_STANDALONE_LOAD_ADDR ?= 0x40000
 
 PLATFORM_CPPFLAGS += -fno-strict-aliasing
 PLATFORM_CPPFLAGS += -Wstrict-prototypes
index 749c389..863f3dd 100644 (file)
@@ -24,7 +24,7 @@
 CROSS_COMPILE ?= m68k-elf-
 
 clibdir = $(shell dirname `$(CC) $(CFLAGS) -print-file-name=libc.a`)
-STANDALONE_LOAD_ADDR = 0x20000 -L $(clibdir)
+CONFIG_STANDALONE_LOAD_ADDR ?= 0x20000 -L $(clibdir)
 
 PLATFORM_CPPFLAGS += -DCONFIG_M68K -D__M68K__
 PLATFORM_LDFLAGS  += -n
index c3c9f95..abea70b 100644 (file)
@@ -26,6 +26,6 @@
 
 CROSS_COMPILE ?= mb-
 
-STANDALONE_LOAD_ADDR = 0x80F00000
+CONFIG_STANDALONE_LOAD_ADDR ?= 0x80F00000
 
 PLATFORM_CPPFLAGS += -ffixed-r31 -D__microblaze__
index aa06761..318d34b 100644 (file)
@@ -23,7 +23,7 @@
 
 CROSS_COMPILE ?= mips_4KC-
 
-STANDALONE_LOAD_ADDR = 0x80200000 -T mips.lds
+CONFIG_STANDALONE_LOAD_ADDR ?= 0x80200000 -T mips.lds
 
 PLATFORM_CPPFLAGS += -DCONFIG_MIPS -D__MIPS__
 
index 8d72fbd..3afc439 100644 (file)
@@ -23,7 +23,7 @@
 
 CROSS_COMPILE ?= ppc_8xx-
 
-STANDALONE_LOAD_ADDR = 0x40000
+CONFIG_STANDALONE_LOAD_ADDR ?= 0x40000
 LDFLAGS_FINAL += --gc-sections
 PLATFORM_RELFLAGS += -fpic -mrelocatable -ffunction-sections -fdata-sections
 PLATFORM_RELFLAGS += $(call cc-option,-msingle-pic-base,)
index cd851f5..af57307 100644 (file)
@@ -23,9 +23,9 @@
 
 CROSS_COMPILE ?= sh4-linux-
 
-STANDALONE_LOAD_ADDR = 0x8C000000
+CONFIG_STANDALONE_LOAD_ADDR ?= 0x8C000000
 ifeq ($(CPU),sh2)
-STANDALONE_LOAD_ADDR += -EB
+CONFIG_STANDALONE_LOAD_ADDR += -EB
 endif
 
 PLATFORM_CPPFLAGS += -DCONFIG_SH -D__SH__
index 4de6515..cae7478 100644 (file)
@@ -23,6 +23,6 @@
 
 CROSS_COMPILE ?= sparc-elf-
 
-STANDALONE_LOAD_ADDR = 0x00000000 -L $(gcclibdir) -T sparc.lds
+CONFIG_STANDALONE_LOAD_ADDR ?= 0x00000000 -L $(gcclibdir) -T sparc.lds
 
 PLATFORM_CPPFLAGS += -DCONFIG_SPARC -D__sparc__
index c1dfdce..66b5d24 100644 (file)
@@ -95,7 +95,7 @@ $(LIB):       $(obj).depend $(LIBOBJS)
 
 $(ELF):
 $(obj)%:       $(obj)%.o $(LIB)
-               $(LD) -g -Ttext $(STANDALONE_LOAD_ADDR) \
+               $(LD) -g -Ttext $(CONFIG_STANDALONE_LOAD_ADDR) \
                        -o $@ -e $(SYM_PREFIX)$(notdir $(<:.o=)) $< $(LIB) \
                        -L$(gcclibdir) -lgcc
 
index 7161ab1..2888c7b 100644 (file)
@@ -38,6 +38,8 @@
 /*#define CONFIG_APTIX           1    #* define if on APTIX test chip */
 /*#define CONFIG_VIRTIO          1    #* Using Virtio simulator */
 
+#define CONFIG_STANDALONE_LOAD_ADDR    0x80300000
+
 /* Clock config to target*/
 #define PRCM_CONFIG_II 1
 /* #define PRCM_CONFIG_III             1 */