From fbcf8e8c753d1afa8a22b9e8d66bafe8b4a05f18 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Thu, 23 Dec 2010 14:58:37 -0500 Subject: Blackfin: move CONFIG_BFIN_CPU back to board config.h This is a revert of 821ad16fa9900c as Wolfgang doesn't like the new code. Signed-off-by: Mike Frysinger --- arch/blackfin/config.mk | 8 +++++++- arch/blackfin/include/asm/config.h | 5 +++++ arch/blackfin/lib/board.c | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) (limited to 'arch') diff --git a/arch/blackfin/config.mk b/arch/blackfin/config.mk index 4102c6f..95cf7db 100644 --- a/arch/blackfin/config.mk +++ b/arch/blackfin/config.mk @@ -25,6 +25,13 @@ CROSS_COMPILE ?= bfin-uclinux- 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,7 +41,6 @@ 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) diff --git a/arch/blackfin/include/asm/config.h b/arch/blackfin/include/asm/config.h index 0437252..f0f3a39 100644 --- a/arch/blackfin/include/asm/config.h +++ b/arch/blackfin/include/asm/config.h @@ -12,6 +12,11 @@ /* Some of our defines use this (like CONFIG_SYS_GBL_DATA_ADDR) */ #include +/* Sanity check CONFIG_BFIN_CPU */ +#ifndef CONFIG_BFIN_CPU +# error CONFIG_BFIN_CPU: your board config needs to define this +#endif + #ifndef CONFIG_BFIN_SCRATCH_REG # define CONFIG_BFIN_SCRATCH_REG retn #endif diff --git a/arch/blackfin/lib/board.c b/arch/blackfin/lib/board.c index 59a0810..2b1f78c 100644 --- a/arch/blackfin/lib/board.c +++ b/arch/blackfin/lib/board.c @@ -254,7 +254,7 @@ void board_init_f(ulong bootflag) memset((void *)bd, 0, sizeof(bd_t)); bd->bi_r_version = version_string; - bd->bi_cpu = BFIN_CPU; + bd->bi_cpu = MK_STR(CONFIG_BFIN_CPU); bd->bi_board_name = BFIN_BOARD_NAME; bd->bi_vco = get_vco(); bd->bi_cclk = get_cclk(); -- cgit v1.1