From de3025f4e2bc063c274f561f9daf2b696910ad3b Mon Sep 17 00:00:00 2001 From: Jie Zhang Date: Mon, 25 Jun 2007 18:04:12 +0800 Subject: [PATCH] Blackfin arch: Add proper -mcpu option according to the cpu and silicon revision configuration Add silicon revision "any" and "none". Add proper -mcpu option according to the cpu and silicon revision configuration. Need update to use latest Blackfin cross compile toolchain. Signed-off-by: Jie Zhang Signed-off-by: Mike Frysinger Signed-off-by: Bryan Wu --- arch/blackfin/Kconfig | 6 ++++++ arch/blackfin/Makefile | 21 +++++++++++++++++++++ arch/blackfin/kernel/setup.c | 18 ++++++++++++++---- include/asm-blackfin/processor.h | 4 ++++ 4 files changed, 45 insertions(+), 4 deletions(-) diff --git a/arch/blackfin/Kconfig b/arch/blackfin/Kconfig index 1fad8560c7af..d98bafcaca59 100644 --- a/arch/blackfin/Kconfig +++ b/arch/blackfin/Kconfig @@ -142,6 +142,12 @@ config BF_REV_0_5 bool "0.5" depends on (BF561 || BF533 || BF532 || BF531) +config BF_REV_ANY + bool "any" + +config BF_REV_NONE + bool "none" + endchoice config BFIN_DUAL_CORE diff --git a/arch/blackfin/Makefile b/arch/blackfin/Makefile index 75e89c324756..6971a4418dfe 100644 --- a/arch/blackfin/Makefile +++ b/arch/blackfin/Makefile @@ -28,6 +28,27 @@ machine-$(CONFIG_BF561) := bf561 MACHINE := $(machine-y) export MACHINE +cpu-$(CONFIG_BF531) := bf531 +cpu-$(CONFIG_BF532) := bf532 +cpu-$(CONFIG_BF533) := bf533 +cpu-$(CONFIG_BF534) := bf534 +cpu-$(CONFIG_BF536) := bf536 +cpu-$(CONFIG_BF537) := bf537 +cpu-$(CONFIG_BF548) := bf548 +cpu-$(CONFIG_BF549) := bf549 +cpu-$(CONFIG_BF561) := bf561 + +rev-$(CONFIG_BF_REV_0_0) := 0.0 +rev-$(CONFIG_BF_REV_0_1) := 0.1 +rev-$(CONFIG_BF_REV_0_2) := 0.2 +rev-$(CONFIG_BF_REV_0_3) := 0.3 +rev-$(CONFIG_BF_REV_0_4) := 0.4 +rev-$(CONFIG_BF_REV_0_5) := 0.5 +rev-$(CONFIG_BF_REV_NONE) := none +rev-$(CONFIG_BF_REV_ANY) := any + +CFLAGS += -mcpu=$(cpu-y)-$(rev-y) +AFLAGS += -mcpu=$(cpu-y)-$(rev-y) head-y := arch/$(ARCH)/mach-$(MACHINE)/head.o arch/$(ARCH)/kernel/init_task.o diff --git a/arch/blackfin/kernel/setup.c b/arch/blackfin/kernel/setup.c index 5b9b434c1ed9..83060f98d15d 100644 --- a/arch/blackfin/kernel/setup.c +++ b/arch/blackfin/kernel/setup.c @@ -307,10 +307,20 @@ void __init setup_arch(char **cmdline_p) init_leds(); printk(KERN_INFO "Blackfin support (C) 2004-2007 Analog Devices, Inc.\n"); - printk(KERN_INFO "Compiled for ADSP-%s Rev 0.%d\n", CPU, bfin_compiled_revid()); - if (bfin_revid() != bfin_compiled_revid()) - printk(KERN_ERR "Warning: Compiled for Rev %d, but running on Rev %d\n", - bfin_compiled_revid(), bfin_revid()); + if (bfin_compiled_revid() == 0xffff) + printk(KERN_INFO "Compiled for ADSP-%s Rev any\n", CPU); + else if (bfin_compiled_revid() == -1) + printk(KERN_INFO "Compiled for ADSP-%s Rev none\n", CPU); + else + printk(KERN_INFO "Compiled for ADSP-%s Rev 0.%d\n", CPU, bfin_compiled_revid()); + if (bfin_revid() != bfin_compiled_revid()) { + if (bfin_compiled_revid() == -1) + printk(KERN_ERR "Warning: Compiled for Rev none, but running on Rev %d\n", + bfin_revid()); + else if (bfin_compiled_revid() != 0xffff) + printk(KERN_ERR "Warning: Compiled for Rev %d, but running on Rev %d\n", + bfin_compiled_revid(), bfin_revid()); + } if (bfin_revid() < SUPPORTED_REVID) printk(KERN_ERR "Warning: Unsupported Chip Revision ADSP-%s Rev 0.%d detected\n", CPU, bfin_revid()); diff --git a/include/asm-blackfin/processor.h b/include/asm-blackfin/processor.h index aba2b30a8ed8..6bb3e0d4705d 100644 --- a/include/asm-blackfin/processor.h +++ b/include/asm-blackfin/processor.h @@ -124,6 +124,10 @@ static inline __attribute_pure__ uint32_t bfin_compiled_revid(void) return 4; #elif defined(CONFIG_BF_REV_0_5) return 5; +#elif defined(CONFIG_BF_REV_ANY) + return 0xffff; +#else + return -1; #endif } -- 2.20.1