[U-Boot] [PATCH 2/8] m68k: mcf530x: move CPU type to Kconfig and refactor config.mk

Masahiro Yamada yamada.masahiro at socionext.com
Fri Mar 27 09:01:07 CET 2015


This commit intends to stop grepping CPU type in
arch/m68k/cpu/mcf530x/config.mk.

Move the CPU type config options from include/configs/amcore.h
to arch/m68k/Kconfig and refactor the CPU flags select in
arch/m68k/cpu/mcf530x/config.mk.

Signed-off-by: Masahiro Yamada <yamada.masahiro at socionext.com>
Cc: Alison Wang <alison.wang at freescale.com>
Cc: Angelo Dureghello <angelo at sysam.it>
---

 arch/m68k/Kconfig               | 8 ++++++++
 arch/m68k/cpu/mcf530x/config.mk | 7 ++-----
 include/configs/amcore.h        | 3 ---
 3 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig
index 0bd780a..8f9b4a7 100644
--- a/arch/m68k/Kconfig
+++ b/arch/m68k/Kconfig
@@ -11,6 +11,9 @@ config MCF520x
 config MCF52x2
 	bool
 
+config MCF530x
+	bool
+
 # processor type
 config M5208
 	bool
@@ -40,6 +43,10 @@ config M5282
 	bool
 	select MCF52x2
 
+config M5307
+	bool
+	select MCF530x
+
 choice
 	prompt "Target select"
 
@@ -114,6 +121,7 @@ config TARGET_M5485EVB
 
 config TARGET_AMCORE
 	bool "Support AMCORE"
+	select M5307
 
 endchoice
 
diff --git a/arch/m68k/cpu/mcf530x/config.mk b/arch/m68k/cpu/mcf530x/config.mk
index aef72d7..25845aa 100644
--- a/arch/m68k/cpu/mcf530x/config.mk
+++ b/arch/m68k/cpu/mcf530x/config.mk
@@ -4,9 +4,6 @@
 # SPDX-License-Identifier:     GPL-2.0+
 #
 
-cfg=$(srctree)/include/configs/$(CONFIG_SYS_CONFIG_NAME:"%"=%).h
-is5307:=$(shell grep CONFIG_M5307 $(cfg))
+cpuflags-$(CONFIG_M5307) := -mcpu=5307
 
-ifneq (,$(findstring CONFIG_M5307,$(is5307)))
-PLATFORM_CPPFLAGS += -mcpu=5307
-endif
+PLATFORM_CPPFLAGS += $(cpuflags-y)
diff --git a/include/configs/amcore.h b/include/configs/amcore.h
index 37aa124..229fa5a 100644
--- a/include/configs/amcore.h
+++ b/include/configs/amcore.h
@@ -12,9 +12,6 @@
 #define CONFIG_AMCORE
 #define CONFIG_HOSTNAME			AMCORE
 
-#define CONFIG_MCF530x
-#define CONFIG_M5307
-
 #define CONFIG_MCFTMR
 #define CONFIG_MCFUART
 #define CONFIG_SYS_UART_PORT		0
-- 
1.9.1



More information about the U-Boot mailing list