mirror of
https://github.com/AsahiLinux/u-boot
synced 2025-01-10 12:18:55 +00:00
push LOAD_ADDR out to arch mk files
Rather than maintain/extend the current ifeq($(ARCH)) mess that exists in the standalone Makefile, push the setting up of LOAD_ADDR out to the arch config.mk (and rename to STANDALONE_LOAD_ADDR in the process). This keeps the common code clean and lets the arch do whatever crazy crap it wants in its own area. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
This commit is contained in:
parent
aa0c9e34d5
commit
8eb7e28014
13 changed files with 37 additions and 64 deletions
|
@ -21,65 +21,6 @@
|
||||||
# MA 02111-1307 USA
|
# MA 02111-1307 USA
|
||||||
#
|
#
|
||||||
|
|
||||||
ifeq ($(ARCH),ppc)
|
|
||||||
LOAD_ADDR = 0x40000
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(ARCH),i386)
|
|
||||||
LOAD_ADDR = 0x40000
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(ARCH),arm)
|
|
||||||
ifeq ($(BOARD),omap2420h4)
|
|
||||||
LOAD_ADDR = 0x80300000
|
|
||||||
else
|
|
||||||
ifeq ($(SOC),omap3)
|
|
||||||
LOAD_ADDR = 0x80300000
|
|
||||||
else
|
|
||||||
LOAD_ADDR = 0xc100000
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(ARCH),mips)
|
|
||||||
LOAD_ADDR = 0x80200000 -T mips.lds
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(ARCH),nios)
|
|
||||||
LOAD_ADDR = 0x00800000 -L $(gcclibdir)/m32 -T nios.lds
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(ARCH),nios2)
|
|
||||||
LOAD_ADDR = 0x02000000 -L $(gcclibdir) -T nios2.lds
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(ARCH),m68k)
|
|
||||||
LOAD_ADDR = 0x20000 -L $(clibdir)
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(ARCH),microblaze)
|
|
||||||
LOAD_ADDR = 0x80F00000
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(ARCH),blackfin)
|
|
||||||
LOAD_ADDR = 0x1000
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(ARCH),avr32)
|
|
||||||
LOAD_ADDR = 0x00000000
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(ARCH),sh)
|
|
||||||
LOAD_ADDR = 0x8C000000
|
|
||||||
ifeq ($(CPU),sh2)
|
|
||||||
BIG_ENDIAN=y
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(ARCH),sparc)
|
|
||||||
LOAD_ADDR = 0x00000000 -L $(gcclibdir) -T sparc.lds
|
|
||||||
endif
|
|
||||||
|
|
||||||
include $(TOPDIR)/config.mk
|
include $(TOPDIR)/config.mk
|
||||||
|
|
||||||
ELF = hello_world
|
ELF = hello_world
|
||||||
|
@ -143,9 +84,6 @@ SREC += eepro100_eeprom.srec
|
||||||
BIN += eepro100_eeprom.bin
|
BIN += eepro100_eeprom.bin
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(BIG_ENDIAN),y)
|
|
||||||
EX_LDFLAGS += -EB
|
|
||||||
endif
|
|
||||||
|
|
||||||
COBJS := $(SREC:.srec=.o)
|
COBJS := $(SREC:.srec=.o)
|
||||||
|
|
||||||
|
@ -168,7 +106,6 @@ BIN := $(addprefix $(obj),$(BIN))
|
||||||
SREC := $(addprefix $(obj),$(SREC))
|
SREC := $(addprefix $(obj),$(SREC))
|
||||||
|
|
||||||
gcclibdir := $(shell dirname `$(CC) -print-libgcc-file-name`)
|
gcclibdir := $(shell dirname `$(CC) -print-libgcc-file-name`)
|
||||||
clibdir := $(shell dirname `$(CC) $(CFLAGS) -print-file-name=libc.a`)
|
|
||||||
|
|
||||||
CPPFLAGS += -I..
|
CPPFLAGS += -I..
|
||||||
|
|
||||||
|
@ -180,7 +117,7 @@ $(LIB): $(obj).depend $(LIBOBJS)
|
||||||
|
|
||||||
$(ELF):
|
$(ELF):
|
||||||
$(obj)%: $(obj)%.o $(LIB)
|
$(obj)%: $(obj)%.o $(LIB)
|
||||||
$(LD) -g $(EX_LDFLAGS) -Ttext $(LOAD_ADDR) \
|
$(LD) -g -Ttext $(STANDALONE_LOAD_ADDR) \
|
||||||
-o $@ -e $(SYM_PREFIX)$(notdir $(<:.o=)) $< $(LIB) \
|
-o $@ -e $(SYM_PREFIX)$(notdir $(<:.o=)) $< $(LIB) \
|
||||||
-L$(gcclibdir) -lgcc
|
-L$(gcclibdir) -lgcc
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,16 @@
|
||||||
|
|
||||||
CROSS_COMPILE ?= arm-linux-
|
CROSS_COMPILE ?= arm-linux-
|
||||||
|
|
||||||
|
ifeq ($(BOARD),omap2420h4)
|
||||||
|
STANDALONE_LOAD_ADDR = 0x80300000
|
||||||
|
else
|
||||||
|
ifeq ($(SOC),omap3)
|
||||||
|
STANDALONE_LOAD_ADDR = 0x80300000
|
||||||
|
else
|
||||||
|
STANDALONE_LOAD_ADDR = 0xc100000
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
PLATFORM_CPPFLAGS += -DCONFIG_ARM -D__ARM__
|
PLATFORM_CPPFLAGS += -DCONFIG_ARM -D__ARM__
|
||||||
|
|
||||||
# Explicitly specifiy 32-bit ARM ISA since toolchain default can be -mthumb:
|
# Explicitly specifiy 32-bit ARM ISA since toolchain default can be -mthumb:
|
||||||
|
|
|
@ -23,5 +23,7 @@
|
||||||
|
|
||||||
CROSS_COMPILE ?= avr32-linux-
|
CROSS_COMPILE ?= avr32-linux-
|
||||||
|
|
||||||
|
STANDALONE_LOAD_ADDR = 0x00000000
|
||||||
|
|
||||||
PLATFORM_RELFLAGS += -ffixed-r5 -fPIC -mno-init-got -mrelax
|
PLATFORM_RELFLAGS += -ffixed-r5 -fPIC -mno-init-got -mrelax
|
||||||
PLATFORM_LDFLAGS += --relax
|
PLATFORM_LDFLAGS += --relax
|
||||||
|
|
|
@ -23,6 +23,8 @@
|
||||||
|
|
||||||
CROSS_COMPILE ?= bfin-uclinux-
|
CROSS_COMPILE ?= bfin-uclinux-
|
||||||
|
|
||||||
|
STANDALONE_LOAD_ADDR = 0x1000
|
||||||
|
|
||||||
CONFIG_BFIN_CPU := $(strip $(subst ",,$(CONFIG_BFIN_CPU)))
|
CONFIG_BFIN_CPU := $(strip $(subst ",,$(CONFIG_BFIN_CPU)))
|
||||||
CONFIG_BFIN_BOOT_MODE := $(strip $(subst ",,$(CONFIG_BFIN_BOOT_MODE)))
|
CONFIG_BFIN_BOOT_MODE := $(strip $(subst ",,$(CONFIG_BFIN_BOOT_MODE)))
|
||||||
CONFIG_ENV_OFFSET := $(strip $(subst ",,$(CONFIG_ENV_OFFSET)))
|
CONFIG_ENV_OFFSET := $(strip $(subst ",,$(CONFIG_ENV_OFFSET)))
|
||||||
|
|
|
@ -23,4 +23,6 @@
|
||||||
|
|
||||||
CROSS_COMPILE ?= i386-linux-
|
CROSS_COMPILE ?= i386-linux-
|
||||||
|
|
||||||
|
STANDALONE_LOAD_ADDR = 0x40000
|
||||||
|
|
||||||
PLATFORM_CPPFLAGS += -DCONFIG_I386 -D__I386__
|
PLATFORM_CPPFLAGS += -DCONFIG_I386 -D__I386__
|
||||||
|
|
|
@ -23,5 +23,8 @@
|
||||||
|
|
||||||
CROSS_COMPILE ?= m68k-elf-
|
CROSS_COMPILE ?= m68k-elf-
|
||||||
|
|
||||||
|
clibdir = $(shell dirname `$(CC) $(CFLAGS) -print-file-name=libc.a`)
|
||||||
|
STANDALONE_LOAD_ADDR = 0x20000 -L $(clibdir)
|
||||||
|
|
||||||
PLATFORM_CPPFLAGS += -DCONFIG_M68K -D__M68K__
|
PLATFORM_CPPFLAGS += -DCONFIG_M68K -D__M68K__
|
||||||
PLATFORM_LDFLAGS += -n
|
PLATFORM_LDFLAGS += -n
|
||||||
|
|
|
@ -26,4 +26,6 @@
|
||||||
|
|
||||||
CROSS_COMPILE ?= mb-
|
CROSS_COMPILE ?= mb-
|
||||||
|
|
||||||
|
STANDALONE_LOAD_ADDR = 0x80F00000
|
||||||
|
|
||||||
PLATFORM_CPPFLAGS += -ffixed-r31 -D__microblaze__
|
PLATFORM_CPPFLAGS += -ffixed-r31 -D__microblaze__
|
||||||
|
|
|
@ -23,6 +23,8 @@
|
||||||
|
|
||||||
CROSS_COMPILE ?= mips_4KC-
|
CROSS_COMPILE ?= mips_4KC-
|
||||||
|
|
||||||
|
STANDALONE_LOAD_ADDR = 0x80200000 -T mips.lds
|
||||||
|
|
||||||
PLATFORM_CPPFLAGS += -DCONFIG_MIPS -D__MIPS__
|
PLATFORM_CPPFLAGS += -DCONFIG_MIPS -D__MIPS__
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
|
@ -24,4 +24,6 @@
|
||||||
|
|
||||||
CROSS_COMPILE ?= nios-elf-
|
CROSS_COMPILE ?= nios-elf-
|
||||||
|
|
||||||
|
STANDALONE_LOAD_ADDR = 0x00800000 -L $(gcclibdir)/m32 -T nios.lds
|
||||||
|
|
||||||
PLATFORM_CPPFLAGS += -m32 -DCONFIG_NIOS -D__NIOS__ -ffixed-g7 -gstabs
|
PLATFORM_CPPFLAGS += -m32 -DCONFIG_NIOS -D__NIOS__ -ffixed-g7 -gstabs
|
||||||
|
|
|
@ -24,5 +24,7 @@
|
||||||
|
|
||||||
CROSS_COMPILE ?= nios2-elf-
|
CROSS_COMPILE ?= nios2-elf-
|
||||||
|
|
||||||
|
STANDALONE_LOAD_ADDR = 0x02000000 -L $(gcclibdir) -T nios2.lds
|
||||||
|
|
||||||
PLATFORM_CPPFLAGS += -DCONFIG_NIOS2 -D__NIOS2__
|
PLATFORM_CPPFLAGS += -DCONFIG_NIOS2 -D__NIOS2__
|
||||||
PLATFORM_CPPFLAGS += -ffixed-r15 -G0
|
PLATFORM_CPPFLAGS += -ffixed-r15 -G0
|
||||||
|
|
|
@ -23,6 +23,8 @@
|
||||||
|
|
||||||
CROSS_COMPILE ?= ppc_8xx-
|
CROSS_COMPILE ?= ppc_8xx-
|
||||||
|
|
||||||
|
STANDALONE_LOAD_ADDR = 0x40000
|
||||||
|
|
||||||
PLATFORM_CPPFLAGS += -DCONFIG_PPC -D__powerpc__
|
PLATFORM_CPPFLAGS += -DCONFIG_PPC -D__powerpc__
|
||||||
PLATFORM_LDFLAGS += -n
|
PLATFORM_LDFLAGS += -n
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,11 @@
|
||||||
|
|
||||||
CROSS_COMPILE ?= sh4-linux-
|
CROSS_COMPILE ?= sh4-linux-
|
||||||
|
|
||||||
|
STANDALONE_LOAD_ADDR = 0x8C000000
|
||||||
|
ifeq ($(CPU),sh2)
|
||||||
|
STANDALONE_LOAD_ADDR += -EB
|
||||||
|
endif
|
||||||
|
|
||||||
PLATFORM_CPPFLAGS += -DCONFIG_SH -D__SH__
|
PLATFORM_CPPFLAGS += -DCONFIG_SH -D__SH__
|
||||||
PLATFORM_LDFLAGS += -e $(TEXT_BASE) --defsym reloc_dst=$(TEXT_BASE)
|
PLATFORM_LDFLAGS += -e $(TEXT_BASE) --defsym reloc_dst=$(TEXT_BASE)
|
||||||
|
|
||||||
|
|
|
@ -23,4 +23,6 @@
|
||||||
|
|
||||||
CROSS_COMPILE ?= sparc-elf-
|
CROSS_COMPILE ?= sparc-elf-
|
||||||
|
|
||||||
|
STANDALONE_LOAD_ADDR = 0x00000000 -L $(gcclibdir) -T sparc.lds
|
||||||
|
|
||||||
PLATFORM_CPPFLAGS += -DCONFIG_SPARC -D__sparc__
|
PLATFORM_CPPFLAGS += -DCONFIG_SPARC -D__sparc__
|
||||||
|
|
Loading…
Reference in a new issue