[U-Boot] [RFC PATCH 13/17] m68k: remove redundant CPU family definition

Masahiro Yamada
2014-03-17T08:53:08Z

- CONFIG_MCF5227x
- CONFIG_MCF523x
- CONFIG_MCF52x2
- CONFIG_MCF520x
- CONFIG_MCF532x
- CONFIG_MCF5301x
- CONFIG_MCF5441x
- CONFIG_MCF5445x
- CONFIG_MCF547x_8x
are defined in Kconfig.

Remove the redundant definition in config headers.

Besides, refactor tricky grepping
in arch/m68k/cpu/{mcf532x,mcf5445x}/config.mk.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
---

arch/m68k/cpu/mcf532x/config.mk | 12 +++---------
arch/m68k/cpu/mcf5445x/config.mk | 10 +++-------
include/configs/M5208EVBE.h | 1 -
include/configs/M52277EVB.h | 1 -
include/configs/M5235EVB.h | 1 -
include/configs/M5249EVB.h | 1 -
include/configs/M5253DEMO.h | 1 -
include/configs/M5253EVBE.h | 1 -
include/configs/M5272C3.h | 1 -
include/configs/M5275EVB.h | 1 -
include/configs/M5282EVB.h | 1 -
include/configs/M53017EVB.h | 1 -
include/configs/M5329EVB.h | 1 -
include/configs/M5373EVB.h | 1 -
include/configs/M54418TWR.h | 1 -
include/configs/M54451EVB.h | 1 -
include/configs/M54455EVB.h | 1 -
include/configs/M5475EVB.h | 1 -
include/configs/M5485EVB.h | 1 -
include/configs/TASREG.h | 1 -
include/configs/astro_mcf5373l.h | 1 -
include/configs/cobra5272.h | 1 -
include/configs/eb_cpu5282.h | 1 -
23 files changed, 6 insertions(+), 37 deletions(-)

diff --git a/arch/m68k/cpu/mcf532x/config.mk b/arch/m68k/cpu/mcf532x/config.mk
index 2efb60f..92846c9 100644
--- a/arch/m68k/cpu/mcf532x/config.mk
+++ b/arch/m68k/cpu/mcf532x/config.mk
@@ -7,13 +7,7 @@
# SPDX-License-Identifier: GPL-2.0+
#

-cfg=$(srctree)/include/configs/$(CONFIG_SYS_CONFIG_NAME:"%"=%).h
-is5301x:=$(shell grep CONFIG_MCF5301x $(cfg))
-is532x:=$(shell grep CONFIG_MCF532x $(cfg))
+cpuflags-$(CONFIG_MCF5301x) := $(call cc-option,-mcpu=53015)
+cpuflags-$(CONFIG_MCF532x) := $(call cc-option,-mcpu=5329)

-ifneq (,$(findstring CONFIG_MCF5301x,$(is5301x)))
-PLATFORM_CPPFLAGS += -mcpu=53015 -fPIC
-endif
-ifneq (,$(findstring CONFIG_MCF532x,$(is532x)))
-PLATFORM_CPPFLAGS += -mcpu=5329 -fPIC
-endif
+PLATFORM_CPPFLAGS += $(cpuflags-y) -fPIC
diff --git a/arch/m68k/cpu/mcf5445x/config.mk b/arch/m68k/cpu/mcf5445x/config.mk
index 13f8a9f..726fcd3 100644
--- a/arch/m68k/cpu/mcf5445x/config.mk
+++ b/arch/m68k/cpu/mcf5445x/config.mk
@@ -9,14 +9,10 @@
# SPDX-License-Identifier: GPL-2.0+
#

-cfg=$(srctree)/include/configs/$(CONFIG_SYS_CONFIG_NAME:"%"=%).h
-is5441x:=$(shell grep CONFIG_MCF5441x $(cfg))
+cpuflags-$(CONFIG_MCF5441x) := $(call cc-option,-mcpu=54418)
+cpuflags-$(CONFIG_MCF5445x) := $(call cc-option,-mcpu=54455)

-ifneq (,$(findstring CONFIG_MCF5441x,$(is5441x)))
-PLATFORM_CPPFLAGS += -mcpu=54418 -fPIC
-else
-PLATFORM_CPPFLAGS += -mcpu=54455 -fPIC
-endif
+PLATFORM_CPPFLAGS += $(cpuflags-y) -fPIC

ifneq (,$(findstring -linux-,$(shell $(CC) --version)))
ifneq (,$(findstring GOT,$(shell $(LD) --help)))
diff --git a/include/configs/M5208EVBE.h b/include/configs/M5208EVBE.h
index 0b22106..33fad48 100644
--- a/include/configs/M5208EVBE.h
+++ b/include/configs/M5208EVBE.h
@@ -14,7 +14,6 @@
* High Level Configuration Options
* (easy to change)
*/
-#define CONFIG_MCF520x 1 /* define processor family */
#define CONFIG_M5208 /* define processor type */

#define CONFIG_MCFUART
diff --git a/include/configs/M52277EVB.h b/include/configs/M52277EVB.h
index 2b58045..30b6577 100644
--- a/include/configs/M52277EVB.h
+++ b/include/configs/M52277EVB.h
@@ -18,7 +18,6 @@
* High Level Configuration Options
* (easy to change)
*/
-#define CONFIG_MCF5227x 1 /* define processor family */
#define CONFIG_M52277 /* define processor type */
#define CONFIG_M52277EVB /* M52277EVB board */

diff --git a/include/configs/M5235EVB.h b/include/configs/M5235EVB.h
index f2e5154..1fc4da6 100644
--- a/include/configs/M5235EVB.h
+++ b/include/configs/M5235EVB.h
@@ -18,7 +18,6 @@
* High Level Configuration Options
* (easy to change)
*/
-#define CONFIG_MCF523x 1 /* define processor family */
#define CONFIG_M5235 /* define processor type */

#define CONFIG_MCFUART
diff --git a/include/configs/M5249EVB.h b/include/configs/M5249EVB.h
index 58cf6be..fec4752 100644
--- a/include/configs/M5249EVB.h
+++ b/include/configs/M5249EVB.h
@@ -18,7 +18,6 @@
* High Level Configuration Options
* (easy to change)
*/
-#define CONFIG_MCF52x2 1 /* define processor family */
#define CONFIG_M5249 /* define processor type */

#define CONFIG_MCFTMR
diff --git a/include/configs/M5253DEMO.h b/include/configs/M5253DEMO.h
index 767065e..5bbd594 100644
--- a/include/configs/M5253DEMO.h
+++ b/include/configs/M5253DEMO.h
@@ -7,7 +7,6 @@
#ifndef _M5253DEMO_H
#define _M5253DEMO_H

-#define CONFIG_MCF52x2 1 /* define processor family */
#define CONFIG_M5253 /* define processor type */
#define CONFIG_M5253DEMO /* define board type */

diff --git a/include/configs/M5253EVBE.h b/include/configs/M5253EVBE.h
index 0db23b4..c0342f6 100644
--- a/include/configs/M5253EVBE.h
+++ b/include/configs/M5253EVBE.h
@@ -8,7 +8,6 @@
#ifndef _M5253EVBE_H
#define _M5253EVBE_H

-#define CONFIG_MCF52x2 1 /* define processor family */
#define CONFIG_M5253 /* define processor type */
#define CONFIG_M5253EVBE /* define board type */

diff --git a/include/configs/M5272C3.h b/include/configs/M5272C3.h
index 1c2981d..b039523 100644
--- a/include/configs/M5272C3.h
+++ b/include/configs/M5272C3.h
@@ -17,7 +17,6 @@
* High Level Configuration Options
* (easy to change)
*/
-#define CONFIG_MCF52x2 1 /* define processor family */
#define CONFIG_M5272 /* define processor type */

#define CONFIG_MCFTMR
diff --git a/include/configs/M5275EVB.h b/include/configs/M5275EVB.h
index 596c38f..e1df79b 100644
--- a/include/configs/M5275EVB.h
+++ b/include/configs/M5275EVB.h
@@ -21,7 +21,6 @@
* High Level Configuration Options
* (easy to change)
*/
-#define CONFIG_MCF52x2 1 /* define processor family */
#define CONFIG_M5275 /* define processor type */
#define CONFIG_M5275EVB /* define board type */

diff --git a/include/configs/M5282EVB.h b/include/configs/M5282EVB.h
index f27d1e7..4c9a4fe 100644
--- a/include/configs/M5282EVB.h
+++ b/include/configs/M5282EVB.h
@@ -17,7 +17,6 @@
* High Level Configuration Options
* (easy to change)
*/
-#define CONFIG_MCF52x2 1 /* define processor family */
#define CONFIG_M5282 /* define processor type */

#define CONFIG_MCFTMR
diff --git a/include/configs/M53017EVB.h b/include/configs/M53017EVB.h
index 7baae44..29e6112 100644
--- a/include/configs/M53017EVB.h
+++ b/include/configs/M53017EVB.h
@@ -18,7 +18,6 @@
* High Level Configuration Options
* (easy to change)
*/
-#define CONFIG_MCF5301x 1 /* define processor family */
#define CONFIG_M53015 /* define processor type */

#define CONFIG_MCFUART
diff --git a/include/configs/M5329EVB.h b/include/configs/M5329EVB.h
index d09c132..6c69cc9 100644
--- a/include/configs/M5329EVB.h
+++ b/include/configs/M5329EVB.h
@@ -18,7 +18,6 @@
* High Level Configuration Options
* (easy to change)
*/
-#define CONFIG_MCF532x 1 /* define processor family */
#define CONFIG_M5329 /* define processor type */

#define CONFIG_MCFUART
diff --git a/include/configs/M5373EVB.h b/include/configs/M5373EVB.h
index d1c5c5a..14eaa59 100644
--- a/include/configs/M5373EVB.h
+++ b/include/configs/M5373EVB.h
@@ -18,7 +18,6 @@
* High Level Configuration Options
* (easy to change)
*/
-#define CONFIG_MCF532x 1 /* define processor family */
#define CONFIG_M5373 /* define processor type */

#define CONFIG_MCFUART
diff --git a/include/configs/M54418TWR.h b/include/configs/M54418TWR.h
index d3155e4..aa7e312 100644
--- a/include/configs/M54418TWR.h
+++ b/include/configs/M54418TWR.h
@@ -18,7 +18,6 @@
* High Level Configuration Options
* (easy to change)
*/
-#define CONFIG_MCF5441x 1 /* define processor family */
#define CONFIG_M54418 /* define processor type */
#define CONFIG_M54418TWR /* M54418TWR board */

diff --git a/include/configs/M54451EVB.h b/include/configs/M54451EVB.h
index a52a827..ac240ca 100644
--- a/include/configs/M54451EVB.h
+++ b/include/configs/M54451EVB.h
@@ -18,7 +18,6 @@
* High Level Configuration Options
* (easy to change)
*/
-#define CONFIG_MCF5445x 1 /* define processor family */
#define CONFIG_M54451 /* define processor type */
#define CONFIG_M54451EVB /* M54451EVB board */

diff --git a/include/configs/M54455EVB.h b/include/configs/M54455EVB.h
index 880684c..1d854ac 100644
--- a/include/configs/M54455EVB.h
+++ b/include/configs/M54455EVB.h
@@ -18,7 +18,6 @@
* High Level Configuration Options
* (easy to change)
*/
-#define CONFIG_MCF5445x 1 /* define processor family */
#define CONFIG_M54455 /* define processor type */
#define CONFIG_M54455EVB /* M54455EVB board */

diff --git a/include/configs/M5475EVB.h b/include/configs/M5475EVB.h
index 4443ff0..1118f25 100644
--- a/include/configs/M5475EVB.h
+++ b/include/configs/M5475EVB.h
@@ -18,7 +18,6 @@
* High Level Configuration Options
* (easy to change)
*/
-#define CONFIG_MCF547x_8x 1 /* define processor family */
#define CONFIG_M547x /* define processor type */
#define CONFIG_M5475 /* define processor type */

diff --git a/include/configs/M5485EVB.h b/include/configs/M5485EVB.h
index 35065a0..8c7f257 100644
--- a/include/configs/M5485EVB.h
+++ b/include/configs/M5485EVB.h
@@ -18,7 +18,6 @@
* High Level Configuration Options
* (easy to change)
*/
-#define CONFIG_MCF547x_8x 1 /* define processor family */
#define CONFIG_M548x /* define processor type */
#define CONFIG_M5485 /* define processor type */

diff --git a/include/configs/TASREG.h b/include/configs/TASREG.h
index e2353f8..322220d 100644
--- a/include/configs/TASREG.h
+++ b/include/configs/TASREG.h
@@ -22,7 +22,6 @@
* High Level Configuration Options
* (easy to change)
*/
-#define CONFIG_MCF52x2 1 /* define processor family */
#define CONFIG_M5249 /* define processor type */

#define CONFIG_MISC_INIT_R 1 /* call misc_init_r() */
diff --git a/include/configs/astro_mcf5373l.h b/include/configs/astro_mcf5373l.h
index 5803cbc..3c6878f 100644
--- a/include/configs/astro_mcf5373l.h
+++ b/include/configs/astro_mcf5373l.h
@@ -47,7 +47,6 @@

/* it seems not clear yet which processor defines we should use */
#define CONFIG_MCF537x /* define processor family */
-#define CONFIG_MCF532x 1 /* define processor family */
#define CONFIG_M5373 /* define processor type */
#define CONFIG_ASTRO5373L /* define board type */

diff --git a/include/configs/cobra5272.h b/include/configs/cobra5272.h
index 3cfb54f..a86c716 100644
--- a/include/configs/cobra5272.h
+++ b/include/configs/cobra5272.h
@@ -31,7 +31,6 @@
* ---
*/

-#define CONFIG_MCF52x2 1 /* define processor family */
#define CONFIG_M5272 /* define processor type */

/* ---
diff --git a/include/configs/eb_cpu5282.h b/include/configs/eb_cpu5282.h
index a986af2..9391712 100644
--- a/include/configs/eb_cpu5282.h
+++ b/include/configs/eb_cpu5282.h
@@ -15,7 +15,6 @@
* High Level Configuration Options (easy to change) *
*----------------------------------------------------------------------*/

-#define CONFIG_MCF52x2 1 /* define processor family */
#define CONFIG_M5282 /* define processor type */

#define CONFIG_MISC_INIT_R
--
1.8.3.2