]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - arch/blackfin/config.mk
blackfin: Fix up board_type global data
[karo-tx-uboot.git] / arch / blackfin / config.mk
index 92520e85ebf3f05afe63e6a1f03b9fed56684831..3595aa2a9922d72bc1ce04492134e8f8d23ac2f8 100644 (file)
 
 CROSS_COMPILE ?= bfin-uclinux-
 
-STANDALONE_LOAD_ADDR = 0x1000 -m elf32bfin
+CONFIG_STANDALONE_LOAD_ADDR ?= 0x1000 -m elf32bfin
 
+ifeq ($(CONFIG_BFIN_CPU),)
+CONFIG_BFIN_CPU := \
+       $(shell awk '$$2 == "CONFIG_BFIN_CPU" { print $$3 }' \
+               $(src)include/configs/$(BOARD).h)
+else
+CONFIG_BFIN_CPU := $(strip $(subst ",,$(CONFIG_BFIN_CPU)))
+endif
 CONFIG_BFIN_BOOT_MODE := $(strip $(subst ",,$(CONFIG_BFIN_BOOT_MODE)))
 
 PLATFORM_RELFLAGS += -ffixed-P3 -fomit-frame-pointer -mno-fdpic
@@ -34,17 +41,17 @@ LDFLAGS_FINAL += --gc-sections
 LDFLAGS += -m elf32bfin
 PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections
 
-PLATFORM_CPPFLAGS += -DBFIN_CPU='"$(CONFIG_BFIN_CPU)"'
 PLATFORM_RELFLAGS += -mcpu=$(CONFIG_BFIN_CPU)
 
 ifneq ($(CONFIG_BFIN_BOOT_MODE),BFIN_BOOT_BYPASS)
-ALL += $(obj)u-boot.ldr
+ALL-y += $(obj)u-boot.ldr
 endif
 ifeq ($(CONFIG_ENV_IS_EMBEDDED_IN_LDR),y)
 CREATE_LDR_ENV = $(obj)tools/envcrc --binary > $(obj)env-ldr.o
-HOSTCFLAGS_NOPED += \
+HOSTCFLAGS_NOPED_ADSP := \
        $(shell $(CPP) -dD - -mcpu=$(CONFIG_BFIN_CPU) </dev/null \
                | awk '$$2 ~ /ADSP/ { print "-D" $$2 }')
+HOSTCFLAGS_NOPED += $(HOSTCFLAGS_NOPED_ADSP)
 else
 CREATE_LDR_ENV =
 endif
@@ -67,9 +74,8 @@ endif
 
 LDR_FLAGS += $(LDR_FLAGS-y)
 
-ifeq ($(wildcard $(TOPDIR)/board/$(BOARD)/u-boot.lds*),)
-LDSCRIPT = $(obj)arch/$(ARCH)/lib/u-boot.lds.S
-endif
+# Set some default LDR flags based on boot mode.
+LDR_FLAGS += $(LDR_FLAGS-$(CONFIG_BFIN_BOOT_MODE))
 
 ifneq ($(CONFIG_SYS_TEXT_BASE),)
 $(error do not set CONFIG_SYS_TEXT_BASE for Blackfin boards)