From patchwork Fri Feb 4 13:25:17 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfgang Denk X-Patchwork-Id: 81888 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 9A45CB7125 for ; Sat, 5 Feb 2011 00:25:36 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E750B2842F; Fri, 4 Feb 2011 14:25:32 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3Kk0GNaD2lGS; Fri, 4 Feb 2011 14:25:32 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9357B2840E; Fri, 4 Feb 2011 14:25:31 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 834C02840E for ; Fri, 4 Feb 2011 14:25:29 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vy-KX2Bp+lBv for ; Fri, 4 Feb 2011 14:25:27 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.10]) by theia.denx.de (Postfix) with ESMTP id 0D5DA2840D for ; Fri, 4 Feb 2011 14:25:25 +0100 (CET) Received: from frontend1.mail.m-online.net (frontend1.mail.intern.m-online.net [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id F154C188B581; Fri, 4 Feb 2011 14:25:22 +0100 (CET) X-Auth-Info: t5al0qlMYHkc/6Wk72sRJdl3rDaUJOK+9FlFZKbX1NM= Received: from diddl.denx.de (host-80-81-18-216.customer.m-online.net [80.81.18.216]) by smtp-auth.mnet-online.de (Postfix) with ESMTPA id 0BFB51C000EC; Fri, 4 Feb 2011 14:25:23 +0100 (CET) Received: from gemini.denx.de (gemini.denx.de [10.0.0.2]) by diddl.denx.de (Postfix) with ESMTP id E7C003066F70; Fri, 4 Feb 2011 14:25:22 +0100 (CET) Received: by gemini.denx.de (Postfix, from userid 500) id C1390D2B4BD; Fri, 4 Feb 2011 14:25:22 +0100 (CET) From: Wolfgang Denk To: u-boot@lists.denx.de Date: Fri, 4 Feb 2011 14:25:17 +0100 Message-Id: <1296825917-31025-1-git-send-email-wd@denx.de> X-Mailer: git-send-email 1.7.3.4 Cc: Shinya Kuribayashi , Tsi Chung Liew Subject: [U-Boot] [PATCH] [NEXT] Make STANDALONE_LOAD_ADDR configurable per board X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de 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 Cc: Mike Frysinger Cc: Shinya Kuribayashi Cc: Daniel Hellstrom Cc: Tsi Chung Liew Cc: Nobuhiro Iwamatsu --- Note that some architectures (blackfin, coldfire, mips, sh, sparc) misuse the CONFIG_STANDALONE_LOAD_ADDR variable to not only specify the load address (as the name suggests), but also to supply additional linker options: arch/blackfin/config.mk:CONFIG_STANDALONE_LOAD_ADDR ?= 0x1000 -m elf32bfin arch/m68k/config.mk:CONFIG_STANDALONE_LOAD_ADDR ?= 0x20000 -L $(clibdir) arch/mips/config.mk:CONFIG_STANDALONE_LOAD_ADDR ?= 0x80200000 -T mips.lds arch/sh/config.mk:CONFIG_STANDALONE_LOAD_ADDR += -EB arch/sparc/config.mk:CONFIG_STANDALONE_LOAD_ADDR ?= 0x00000000 -L $(gcclibdir) -T sparc.lds Please clean this up! Thanks -- wd README | 8 ++++++++ arch/arm/config.mk | 8 +++----- arch/avr32/config.mk | 2 +- arch/blackfin/config.mk | 2 +- arch/i386/config.mk | 2 +- arch/m68k/config.mk | 2 +- arch/microblaze/config.mk | 2 +- arch/mips/config.mk | 2 +- arch/powerpc/config.mk | 2 +- arch/sh/config.mk | 4 ++-- arch/sparc/config.mk | 2 +- examples/standalone/Makefile | 2 +- include/configs/omap2420h4.h | 2 ++ 13 files changed, 24 insertions(+), 16 deletions(-) diff --git a/README b/README index 755d17c..e8567c7 100644 --- a/README +++ b/README @@ -1952,6 +1952,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 diff --git a/arch/arm/config.mk b/arch/arm/config.mk index a6a4742..fcc26a2 100644 --- a/arch/arm/config.mk +++ b/arch/arm/config.mk @@ -23,13 +23,11 @@ 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 diff --git a/arch/avr32/config.mk b/arch/avr32/config.mk index 1121ca1..9488c49 100644 --- a/arch/avr32/config.mk +++ b/arch/avr32/config.mk @@ -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 diff --git a/arch/blackfin/config.mk b/arch/blackfin/config.mk index 0cba294..441c23e 100644 --- a/arch/blackfin/config.mk +++ b/arch/blackfin/config.mk @@ -23,7 +23,7 @@ CROSS_COMPILE ?= bfin-uclinux- -STANDALONE_LOAD_ADDR = 0x1000 -m elf32bfin +CONFIG_STANDALONE_LOAD_ADDR ?= 0x1000 -m elf32bfin CONFIG_BFIN_BOOT_MODE := $(strip $(subst ",,$(CONFIG_BFIN_BOOT_MODE))) diff --git a/arch/i386/config.mk b/arch/i386/config.mk index 3fb97c1..27ac3de 100644 --- a/arch/i386/config.mk +++ b/arch/i386/config.mk @@ -23,7 +23,7 @@ CROSS_COMPILE ?= i386-linux- -STANDALONE_LOAD_ADDR = 0x40000 +CONFIG_STANDALONE_LOAD_ADDR ?= 0x40000 PLATFORM_CPPFLAGS += -fno-strict-aliasing PLATFORM_CPPFLAGS += -Wstrict-prototypes diff --git a/arch/m68k/config.mk b/arch/m68k/config.mk index 749c389..863f3dd 100644 --- a/arch/m68k/config.mk +++ b/arch/m68k/config.mk @@ -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 diff --git a/arch/microblaze/config.mk b/arch/microblaze/config.mk index c3c9f95..abea70b 100644 --- a/arch/microblaze/config.mk +++ b/arch/microblaze/config.mk @@ -26,6 +26,6 @@ CROSS_COMPILE ?= mb- -STANDALONE_LOAD_ADDR = 0x80F00000 +CONFIG_STANDALONE_LOAD_ADDR ?= 0x80F00000 PLATFORM_CPPFLAGS += -ffixed-r31 -D__microblaze__ diff --git a/arch/mips/config.mk b/arch/mips/config.mk index aa06761..318d34b 100644 --- a/arch/mips/config.mk +++ b/arch/mips/config.mk @@ -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__ diff --git a/arch/powerpc/config.mk b/arch/powerpc/config.mk index 64191c7..fa24131 100644 --- a/arch/powerpc/config.mk +++ b/arch/powerpc/config.mk @@ -23,7 +23,7 @@ CROSS_COMPILE ?= ppc_8xx- -STANDALONE_LOAD_ADDR = 0x40000 +CONFIG_STANDALONE_LOAD_ADDR ?= 0x40000 LDFLAGS_u-boot = --gc-sections PLATFORM_RELFLAGS += -mrelocatable -ffunction-sections -fdata-sections PLATFORM_CPPFLAGS += -DCONFIG_PPC -D__powerpc__ diff --git a/arch/sh/config.mk b/arch/sh/config.mk index 4ef85e3..41ac8f8 100644 --- a/arch/sh/config.mk +++ b/arch/sh/config.mk @@ -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__ diff --git a/arch/sparc/config.mk b/arch/sparc/config.mk index 4de6515..cae7478 100644 --- a/arch/sparc/config.mk +++ b/arch/sparc/config.mk @@ -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__ diff --git a/examples/standalone/Makefile b/examples/standalone/Makefile index c1dfdce..66b5d24 100644 --- a/examples/standalone/Makefile +++ b/examples/standalone/Makefile @@ -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 diff --git a/include/configs/omap2420h4.h b/include/configs/omap2420h4.h index 7161ab1..2888c7b 100644 --- a/include/configs/omap2420h4.h +++ b/include/configs/omap2420h4.h @@ -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 */