Skip to contentSkip to conversation

m68k: stop grepping and refactor CPU flags

PATCH New Masahiro Yamada 2 participants 17 messages Mar 27, 2015 – Mar 28, 2015 m68k architecture

lore
Share & tools
lore
#0 lore raw

cover m68k: stop grepping and refactor CPU flags

arch/m68k/cpu/mcf52x2/config.mk
arch/m68k/cpu/mcf530x/config.mk
arch/m68k/cpu/mcf532x/config.mk

are not very nice. They use "grep" to decide the CPU type. They can be tidied up by moving the CPU type CONFIGs to Kconfig.

I built all the M68k boards and compared MD5SUM for each of them. I confirmed this series still produces the same output binaries.

Masahiro Yamada (8):
m68k: mcf52x2: move CPU type to Kconfig and refactor config.mk
m68k: mcf530x: move CPU type to Kconfig and refactor config.mk
m68k: mcf532x: move CPU type to Kconfig and refactor config.mk
m68k: mcf5445x: move CPU type to Kconfig and refactor config.mk
m68k: mcf5227x: move CPU type to Kconfig and refactor config.mk
m68k: mcf523x: move CPU type to Kconfig and refactor config.mk
m68k: mcf547x_8x: move CPU type to Kconfig and refactor config.mk
m68k: merge per-CPU config.mk into arch/m68k/Makefile

 arch/m68k/Kconfig                  | 129 +++++++++++++++++++++++++++++++++++++
 arch/m68k/Makefile                 |  29 +++++++++
 arch/m68k/cpu/mcf5227x/config.mk   |  10 ---
 arch/m68k/cpu/mcf523x/config.mk    |  10 ---
 arch/m68k/cpu/mcf52x2/config.mk    |  39 -----------
 arch/m68k/cpu/mcf530x/config.mk    |  12 ----
 arch/m68k/cpu/mcf532x/config.mk    |  19 ------
 arch/m68k/cpu/mcf5445x/config.mk   |  25 -------
 arch/m68k/cpu/mcf547x_8x/config.mk |  16 -----
 include/configs/M5208EVBE.h        |   3 -
 include/configs/M52277EVB.h        |   2 -
 include/configs/M5235EVB.h         |   2 -
 include/configs/M5249EVB.h         |   3 -
 include/configs/M5253DEMO.h        |   2 -
 include/configs/M5253EVBE.h        |   2 -
 include/configs/M5272C3.h          |   3 -
 include/configs/M5275EVB.h         |   2 -
 include/configs/M5282EVB.h         |   3 -
 include/configs/M53017EVB.h        |   2 -
 include/configs/M5329EVB.h         |   2 -
 include/configs/M5373EVB.h         |   2 -
 include/configs/M54418TWR.h        |   2 -
 include/configs/M54451EVB.h        |   2 -
 include/configs/M54455EVB.h        |   2 -
 include/configs/M5475EVB.h         |   3 -
 include/configs/M5485EVB.h         |   3 -
 include/configs/amcore.h           |   3 -
 include/configs/astro_mcf5373l.h   |  10 ---
 include/configs/cobra5272.h        |  10 ---
 include/configs/eb_cpu5282.h       |   3 -
 30 files changed, 158 insertions(+), 197 deletions(-)
 delete mode 100644 arch/m68k/cpu/mcf5227x/config.mk
 delete mode 100644 arch/m68k/cpu/mcf523x/config.mk
 delete mode 100644 arch/m68k/cpu/mcf52x2/config.mk
 delete mode 100644 arch/m68k/cpu/mcf530x/config.mk
 delete mode 100644 arch/m68k/cpu/mcf532x/config.mk
 delete mode 100644 arch/m68k/cpu/mcf5445x/config.mk
 delete mode 100644 arch/m68k/cpu/mcf547x_8x/config.mk
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/8 m68k: mcf52x2: move CPU type to Kconfig and refactor config.mk

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

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

Cc Alison Wang <[email protected]>
Cc Angelo Dureghello <[email protected]>

---

 arch/m68k/Kconfig               | 45 +++++++++++++++++++++++++++++++++++++++++
 arch/m68k/cpu/mcf52x2/config.mk | 37 ++++++++-------------------------
 include/configs/M5208EVBE.h     |  3 ---
 include/configs/M5249EVB.h      |  3 ---
 include/configs/M5253DEMO.h     |  2 --
 include/configs/M5253EVBE.h     |  2 --
 include/configs/M5272C3.h       |  3 ---
 include/configs/M5275EVB.h      |  2 --
 include/configs/M5282EVB.h      |  3 ---
 include/configs/cobra5272.h     | 10 ---------
 include/configs/eb_cpu5282.h    |  3 ---
 11 files changed, 53 insertions(+), 60 deletions(-)
arch/m68k/Kconfig +45 -0
index 53c4aab..0bd780a 100644
@@ -4,6 +4,42 @@ menu "M68000 architecture"
 config SYS_ARCH
 	default "m68k"
 
+# processor family
+config MCF520x
+	bool
+
+config MCF52x2
+	bool
+
+# processor type
+config M5208
+	bool
+	select MCF520x
+
+config M5249
+	bool
+	select MCF52x2
+
+config M5253
+	bool
+	select MCF52x2
+
+config M5271
+	bool
+	select MCF52x2
+
+config M5272
+	bool
+	select MCF52x2
+
+config M5275
+	bool
+	select MCF52x2
+
+config M5282
+	bool
+	select MCF52x2
+
 choice
 	prompt "Target select"
 
@@ -15,30 +51,39 @@ config TARGET_M5235EVB
 
 config TARGET_COBRA5272
 	bool "Support cobra5272"
+	select M5272
 
 config TARGET_EB_CPU5282
 	bool "Support eb_cpu5282"
+	select M5282
 
 config TARGET_M5208EVBE
 	bool "Support M5208EVBE"
+	select M5208
 
 config TARGET_M5249EVB
 	bool "Support M5249EVB"
+	select M5249
 
 config TARGET_M5253DEMO
 	bool "Support M5253DEMO"
+	select M5253
 
 config TARGET_M5253EVBE
 	bool "Support M5253EVBE"
+	select M5253
 
 config TARGET_M5272C3
 	bool "Support M5272C3"
+	select M5272
 
 config TARGET_M5275EVB
 	bool "Support M5275EVB"
+	select M5275
 
 config TARGET_M5282EVB
 	bool "Support M5282EVB"
+	select M5282
 
 config TARGET_ASTRO_MCF5373L
 	bool "Support astro_mcf5373l"
arch/m68k/cpu/mcf52x2/config.mk +8 -29
index f66000b..f8fdefd 100644
@@ -7,33 +7,12 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-cfg=$(srctree)/include/configs/$(CONFIG_SYS_CONFIG_NAME:"%"=%).h
-is5208:=$(shell grep CONFIG_M5208 $(cfg))
-is5249:=$(shell grep CONFIG_M5249 $(cfg))
-is5253:=$(shell grep CONFIG_M5253 $(cfg))
-is5271:=$(shell grep CONFIG_M5271 $(cfg))
-is5272:=$(shell grep CONFIG_M5272 $(cfg))
-is5275:=$(shell grep CONFIG_M5275 $(cfg))
-is5282:=$(shell grep CONFIG_M5282 $(cfg))
+cpuflags-$(CONFIG_M5208) := -mcpu=5208
+cpuflags-$(CONFIG_M5249) := -mcpu=5249
+cpuflags-$(CONFIG_M5253) := -mcpu=5253
+cpuflags-$(CONFIG_M5271) := -mcpu=5271
+cpuflags-$(CONFIG_M5272) := -mcpu=5272
+cpuflags-$(CONFIG_M5275) := -mcpu=5275
+cpuflags-$(CONFIG_M5282) := -mcpu=5282
 
-ifneq (,$(findstring CONFIG_M5208,$(is5208)))
-PLATFORM_CPPFLAGS += -mcpu=5208
-endif
-ifneq (,$(findstring CONFIG_M5249,$(is5249)))
-PLATFORM_CPPFLAGS += -mcpu=5249
-endif
-ifneq (,$(findstring CONFIG_M5253,$(is5253)))
-PLATFORM_CPPFLAGS += -mcpu=5253
-endif
-ifneq (,$(findstring CONFIG_M5271,$(is5271)))
-PLATFORM_CPPFLAGS += -mcpu=5271
-endif
-ifneq (,$(findstring CONFIG_M5272,$(is5272)))
-PLATFORM_CPPFLAGS += -mcpu=5272
-endif
-ifneq (,$(findstring CONFIG_M5275,$(is5275)))
-PLATFORM_CPPFLAGS += -mcpu=5275
-endif
-ifneq (,$(findstring CONFIG_M5282,$(is5282)))
-PLATFORM_CPPFLAGS += -mcpu=5282
-endif
+PLATFORM_CPPFLAGS += $(cpuflags-y)
include/configs/M5208EVBE.h +0 -3
index 6630377..9390464 100644
@@ -14,9 +14,6 @@
  * High Level Configuration Options
  * (easy to change)
  */
-#define CONFIG_MCF520x		/* define processor family */
-#define CONFIG_M5208		/* define processor type */
-
 #define CONFIG_MCFUART
 #define CONFIG_SYS_UART_PORT		(0)
 #define CONFIG_BAUDRATE			115200
include/configs/M5249EVB.h +0 -3
index ae4fe45..60e5b45 100644
@@ -18,9 +18,6 @@
  * High Level Configuration Options
  * (easy to change)
  */
-#define CONFIG_MCF52x2			/* define processor family */
-#define CONFIG_M5249			/* define processor type */
-
 #define CONFIG_MCFTMR
 
 #define CONFIG_MCFUART
include/configs/M5253DEMO.h +0 -2
index 3a1cbca..7421b57 100644
@@ -7,8 +7,6 @@
 #ifndef _M5253DEMO_H
 #define _M5253DEMO_H
 
-#define CONFIG_MCF52x2		/* define processor family */
-#define CONFIG_M5253		/* define processor type */
 #define CONFIG_M5253DEMO	/* define board type */
 
 #define CONFIG_MCFTMR
include/configs/M5253EVBE.h +0 -2
index fabfdb9..8fd3907 100644
@@ -8,8 +8,6 @@
 #ifndef _M5253EVBE_H
 #define _M5253EVBE_H
 
-#define CONFIG_MCF52x2		/* define processor family */
-#define CONFIG_M5253		/* define processor type */
 #define CONFIG_M5253EVBE	/* define board type */
 
 #define CONFIG_MCFTMR
include/configs/M5272C3.h +0 -3
index 4c84126..2c056b1 100644
@@ -17,9 +17,6 @@
  * High Level Configuration Options
  * (easy to change)
  */
-#define CONFIG_MCF52x2		/* define processor family */
-#define CONFIG_M5272		/* define processor type */
-
 #define CONFIG_MCFTMR
 
 #define CONFIG_MCFUART
include/configs/M5275EVB.h +0 -2
index 4dddab7..7eb3172 100644
@@ -21,8 +21,6 @@
  * High Level Configuration Options
  * (easy to change)
  */
-#define CONFIG_MCF52x2			/* define processor family */
-#define CONFIG_M5275			/* define processor type */
 #define CONFIG_M5275EVB			/* define board type */
 
 #define CONFIG_MCFTMR
include/configs/M5282EVB.h +0 -3
index fd970d0..569ad42 100644
@@ -17,9 +17,6 @@
  * High Level Configuration Options
  * (easy to change)
  */
-#define	CONFIG_MCF52x2		/* define processor family */
-#define CONFIG_M5282		/* define processor type */
-
 #define CONFIG_MCFTMR
 
 #define CONFIG_MCFUART
include/configs/cobra5272.h +0 -10
index 4644369..b9f0b0b 100644
@@ -25,16 +25,6 @@
 #define _CONFIG_COBRA5272_H
 
 /* ---
- * Define processor
- * possible values for Sentec board: only Coldfire M5272 processor supported
- * (please do not change)
- * ---
- */
-
-#define CONFIG_MCF52x2			/* define processor family */
-#define CONFIG_M5272			/* define processor type */
-
-/* ---
  * Defines processor clock - important for correct timings concerning serial
  * interface etc.
  * ---
include/configs/eb_cpu5282.h +0 -3
index bdca705..e2b9326 100644
@@ -15,9 +15,6 @@
  * High Level Configuration Options (easy to change)                    *
  *----------------------------------------------------------------------*/
 
-#define	CONFIG_MCF52x2			/* define processor family */
-#define CONFIG_M5282			/* define processor type */
-
 #define CONFIG_MISC_INIT_R
 
 #define CONFIG_MCFUART
Signature · 1 line
1.9.1
#2 lore raw

PATCH 1/8 m68k: mcf52x2: move CPU type to Kconfig and refactor config.mk

Quoted 10 lines · Masahiro Yamada

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

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

Cc Alison Wang <[email protected]>
Cc Angelo Dureghello <[email protected]>

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150328/dd94e95b/attachment.sig>
#3 lore raw

PATCH 2/8 m68k: mcf530x: move CPU type to Kconfig and refactor config.mk

In reply to Masahiro Yamada

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.

Cc Alison Wang <[email protected]>
Cc Angelo Dureghello <[email protected]>

---

 arch/m68k/Kconfig               | 8 ++++++++
 arch/m68k/cpu/mcf530x/config.mk | 7 ++-----
 include/configs/amcore.h        | 3 ---
 3 files changed, 10 insertions(+), 8 deletions(-)
arch/m68k/Kconfig +8 -0
index 0bd780a..8f9b4a7 100644
@@ -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
 
arch/m68k/cpu/mcf530x/config.mk +2 -5
index aef72d7..25845aa 100644
@@ -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)
include/configs/amcore.h +0 -3
index 37aa124..229fa5a 100644
@@ -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
Signature · 1 line
1.9.1
#4 lore raw

PATCH 2/8 m68k: mcf530x: move CPU type to Kconfig and refactor config.mk

Quoted 10 lines · Masahiro Yamada

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.

Cc Alison Wang <[email protected]>
Cc Angelo Dureghello <[email protected]>

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150328/a8a67ca0/attachment.sig>
#5 lore raw

PATCH 3/8 m68k: mcf532x: move CPU type to Kconfig and refactor config.mk

In reply to Masahiro Yamada

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

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

Cc Alison Wang <[email protected]>
Cc Angelo Dureghello <[email protected]>

---

 arch/m68k/Kconfig                | 26 ++++++++++++++++++++++++++
 arch/m68k/cpu/mcf532x/config.mk  | 12 +++---------
 include/configs/M53017EVB.h      |  2 --
 include/configs/M5329EVB.h       |  2 --
 include/configs/M5373EVB.h       |  2 --
 include/configs/astro_mcf5373l.h | 10 ----------
 6 files changed, 29 insertions(+), 25 deletions(-)
arch/m68k/Kconfig +26 -0
index 8f9b4a7..67308eb 100644
@@ -14,6 +14,15 @@ config MCF52x2
 config MCF530x
 	bool
 
+config MCF5301x
+	bool
+
+config MCF532x
+	bool
+
+config MCF537x
+	bool
+
 # processor type
 config M5208
 	bool
@@ -47,6 +56,19 @@ config M5307
 	bool
 	select MCF530x
 
+config M53015
+	bool
+	select MCF5301x
+
+config M5329
+	bool
+	select MCF532x
+
+config M5373
+	bool
+	select MCF532x
+	select MCF537x
+
 choice
 	prompt "Target select"
 
@@ -94,15 +116,19 @@ config TARGET_M5282EVB
 
 config TARGET_ASTRO_MCF5373L
 	bool "Support astro_mcf5373l"
+	select M5373
 
 config TARGET_M53017EVB
 	bool "Support M53017EVB"
+	select M53015
 
 config TARGET_M5329EVB
 	bool "Support M5329EVB"
+	select M5329
 
 config TARGET_M5373EVB
 	bool "Support M5373EVB"
+	select M5373
 
 config TARGET_M54418TWR
 	bool "Support M54418TWR"
arch/m68k/cpu/mcf532x/config.mk +3 -9
index 2efb60f..470d22f 100644
@@ -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) := -mcpu=53015 -fPIC
+cpuflags-$(CONFIG_MCF532x)  := -mcpu=5329 -fPIC
 
-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)
include/configs/M53017EVB.h +0 -2
index a100d9f..83ac70f 100644
@@ -18,8 +18,6 @@
  * High Level Configuration Options
  * (easy to change)
  */
-#define CONFIG_MCF5301x		/* define processor family */
-#define CONFIG_M53015		/* define processor type */
 
 #define CONFIG_MCFUART
 #define CONFIG_SYS_UART_PORT		(0)
include/configs/M5329EVB.h +0 -2
index 78ea384..795f359 100644
@@ -18,8 +18,6 @@
  * High Level Configuration Options
  * (easy to change)
  */
-#define CONFIG_MCF532x		/* define processor family */
-#define CONFIG_M5329		/* define processor type */
 
 #define CONFIG_MCFUART
 #define CONFIG_SYS_UART_PORT		(0)
include/configs/M5373EVB.h +0 -2
index 849c265..d75b43c 100644
@@ -18,8 +18,6 @@
  * High Level Configuration Options
  * (easy to change)
  */
-#define CONFIG_MCF532x		/* define processor family */
-#define CONFIG_M5373		/* define processor type */
 
 #define CONFIG_MCFUART
 #define CONFIG_SYS_UART_PORT		(0)
include/configs/astro_mcf5373l.h +0 -10
index fa64a68..de837cf 100644
@@ -39,16 +39,6 @@
 #error No card type defined!
 #endif
 
-/*
- * Define processor
- * possible values for Urmel board: only Coldfire M5373 processor supported
- * (please do not change)
- */
-
-/* it seems not clear yet which processor defines we should use */
-#define CONFIG_MCF537x			/* define processor family */
-#define CONFIG_MCF532x			/* define processor family */
-#define CONFIG_M5373			/* define processor type */
 #define CONFIG_ASTRO5373L		/* define board type */
 
 /* Command line configuration */
Signature · 1 line
1.9.1
#6 lore raw

PATCH 3/8 m68k: mcf532x: move CPU type to Kconfig and refactor config.mk

Quoted 10 lines · Masahiro Yamada

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

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

Cc Alison Wang <[email protected]>
Cc Angelo Dureghello <[email protected]>

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150328/58088bd5/attachment.sig>
#7 lore raw

PATCH 4/8 m68k: mcf5445x: move CPU type to Kconfig and refactor config.mk

In reply to Masahiro Yamada

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

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

Cc Alison Wang <[email protected]>
Cc Angelo Dureghello <[email protected]>

---

 arch/m68k/Kconfig                | 21 +++++++++++++++++++++
 arch/m68k/cpu/mcf5445x/config.mk | 10 ++--------
 include/configs/M54418TWR.h      |  2 --
 include/configs/M54451EVB.h      |  2 --
 include/configs/M54455EVB.h      |  2 --
 5 files changed, 23 insertions(+), 14 deletions(-)
arch/m68k/Kconfig +21 -0
index 67308eb..eecef95 100644
@@ -23,6 +23,12 @@ config MCF532x
 config MCF537x
 	bool
 
+config MCF5441x
+	bool
+
+config MCF5445x
+	bool
+
 # processor type
 config M5208
 	bool
@@ -69,6 +75,18 @@ config M5373
 	select MCF532x
 	select MCF537x
 
+config M54418
+	bool
+	select MCF5441x
+
+config M54451
+	bool
+	select MCF5445x
+
+config M54455
+	bool
+	select MCF5445x
+
 choice
 	prompt "Target select"
 
@@ -132,12 +150,15 @@ config TARGET_M5373EVB
 
 config TARGET_M54418TWR
 	bool "Support M54418TWR"
+	select M54418
 
 config TARGET_M54451EVB
 	bool "Support M54451EVB"
+	select M54451
 
 config TARGET_M54455EVB
 	bool "Support M54455EVB"
+	select M54455
 
 config TARGET_M5475EVB
 	bool "Support M5475EVB"
arch/m68k/cpu/mcf5445x/config.mk +2 -8
index 13f8a9f..c3923c6 100644
@@ -9,14 +9,8 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-cfg=$(srctree)/include/configs/$(CONFIG_SYS_CONFIG_NAME:"%"=%).h
-is5441x:=$(shell grep CONFIG_MCF5441x $(cfg))
-
-ifneq (,$(findstring CONFIG_MCF5441x,$(is5441x)))
-PLATFORM_CPPFLAGS += -mcpu=54418 -fPIC
-else
-PLATFORM_CPPFLAGS += -mcpu=54455 -fPIC
-endif
+cpuflags-$(CONFIG_MCF5441x) := -mcpu=54418 -fPIC
+cpuflags-$(CONFIG_MCF5445x) := -mcpu=54455 -fPIC
 
 ifneq (,$(findstring -linux-,$(shell $(CC) --version)))
 ifneq (,$(findstring GOT,$(shell $(LD) --help)))
include/configs/M54418TWR.h +0 -2
index 3d7dc1f..be1750f 100644
@@ -18,8 +18,6 @@
  * High Level Configuration Options
  * (easy to change)
  */
-#define CONFIG_MCF5441x	/* define processor family */
-#define CONFIG_M54418		/* define processor type */
 #define CONFIG_M54418TWR	/* M54418TWR board */
 
 #define CONFIG_MCFUART
include/configs/M54451EVB.h +0 -2
index 734a77f..1b3598a 100644
@@ -18,8 +18,6 @@
  * High Level Configuration Options
  * (easy to change)
  */
-#define CONFIG_MCF5445x		/* define processor family */
-#define CONFIG_M54451		/* define processor type */
 #define CONFIG_M54451EVB	/* M54451EVB board */
 
 #define CONFIG_DISPLAY_BOARDINFO
include/configs/M54455EVB.h +0 -2
index 2faf581..2288bff 100644
@@ -18,8 +18,6 @@
  * High Level Configuration Options
  * (easy to change)
  */
-#define CONFIG_MCF5445x		/* define processor family */
-#define CONFIG_M54455		/* define processor type */
 #define CONFIG_M54455EVB	/* M54455EVB board */
 
 #define CONFIG_DISPLAY_BOARDINFO
Signature · 1 line
1.9.1
#8 lore raw

PATCH 4/8 m68k: mcf5445x: move CPU type to Kconfig and refactor config.mk

Quoted 10 lines · Masahiro Yamada

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

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

Cc Alison Wang <[email protected]>
Cc Angelo Dureghello <[email protected]>

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150328/e9900b27/attachment.sig>
#9 lore raw

PATCH 5/8 m68k: mcf5227x: move CPU type to Kconfig and refactor config.mk

In reply to Masahiro Yamada

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

Cc Alison Wang <[email protected]>
Cc Angelo Dureghello <[email protected]>

---

 arch/m68k/Kconfig                | 8 ++++++++
 arch/m68k/cpu/mcf5227x/config.mk | 4 +++-
 include/configs/M52277EVB.h      | 2 --
 3 files changed, 11 insertions(+), 3 deletions(-)
arch/m68k/Kconfig +8 -0
index eecef95..a645d95 100644
@@ -29,6 +29,9 @@ config MCF5441x
 config MCF5445x
 	bool
 
+config MCF5227x
+	bool
+
 # processor type
 config M5208
 	bool
@@ -87,11 +90,16 @@ config M54455
 	bool
 	select MCF5445x
 
+config M52277
+	bool
+	select MCF5227x
+
 choice
 	prompt "Target select"
 
 config TARGET_M52277EVB
 	bool "Support M52277EVB"
+	select M52277
 
 config TARGET_M5235EVB
 	bool "Support M5235EVB"
arch/m68k/cpu/mcf5227x/config.mk +3 -1
index b5c26e4..a6814d8 100644
@@ -7,4 +7,6 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-PLATFORM_CPPFLAGS += -mcpu=52277 -fPIC
+cpuflags-$(CONFIG_M52277) := -mcpu=52277 -fPIC
+
+PLATFORM_CPPFLAGS += $(cpuflags-y)
include/configs/M52277EVB.h +0 -2
index cde7305..e9424b4 100644
@@ -18,8 +18,6 @@
  * High Level Configuration Options
  * (easy to change)
  */
-#define CONFIG_MCF5227x		/* define processor family */
-#define CONFIG_M52277		/* define processor type */
 #define CONFIG_M52277EVB	/* M52277EVB board */
 
 #define CONFIG_MCFUART
Signature · 1 line
1.9.1
#10 lore raw

PATCH 5/8 m68k: mcf5227x: move CPU type to Kconfig and refactor config.mk

Quoted 7 lines · Masahiro Yamada

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

Cc Alison Wang <[email protected]>
Cc Angelo Dureghello <[email protected]>

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150328/97fbe201/attachment.sig>
#11 lore raw

PATCH 6/8 m68k: mcf523x: move CPU type to Kconfig and refactor config.mk

In reply to Masahiro Yamada

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

Cc Alison Wang <[email protected]>
Cc Angelo Dureghello <[email protected]>

---

 arch/m68k/Kconfig               | 8 ++++++++
 arch/m68k/cpu/mcf523x/config.mk | 4 +++-
 include/configs/M5235EVB.h      | 2 --
 3 files changed, 11 insertions(+), 3 deletions(-)
arch/m68k/Kconfig +8 -0
index a645d95..a3f0cbc 100644
@@ -11,6 +11,9 @@ config MCF520x
 config MCF52x2
 	bool
 
+config MCF523x
+	bool
+
 config MCF530x
 	bool
 
@@ -37,6 +40,10 @@ config M5208
 	bool
 	select MCF520x
 
+config M5235
+	bool
+	select MCF523x
+
 config M5249
 	bool
 	select MCF52x2
@@ -103,6 +110,7 @@ config TARGET_M52277EVB
 
 config TARGET_M5235EVB
 	bool "Support M5235EVB"
+	select M5235
 
 config TARGET_COBRA5272
 	bool "Support cobra5272"
arch/m68k/cpu/mcf523x/config.mk +3 -1
index c9435ab..4795f6a 100644
@@ -7,4 +7,6 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-PLATFORM_CPPFLAGS += -mcpu=5235 -fPIC
+cpuflags-$(CONFIG_M5235) := -mcpu=5235 -fPIC
+
+PLATFORM_CPPFLAGS += $(cpuflags-y)
include/configs/M5235EVB.h +0 -2
index 0f6e2f7..883347b 100644
@@ -18,8 +18,6 @@
  * High Level Configuration Options
  * (easy to change)
  */
-#define CONFIG_MCF523x		/* define processor family */
-#define CONFIG_M5235		/* define processor type */
 
 #define CONFIG_MCFUART
 #define CONFIG_SYS_UART_PORT		(0)
Signature · 1 line
1.9.1
#12 lore raw

PATCH 6/8 m68k: mcf523x: move CPU type to Kconfig and refactor config.mk

Quoted 7 lines · Masahiro Yamada

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

Cc Alison Wang <[email protected]>
Cc Angelo Dureghello <[email protected]>

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150328/75f5f307/attachment.sig>
#13 lore raw

PATCH 7/8 m68k: mcf547x_8x: move CPU type to Kconfig and refactor config.mk

In reply to Masahiro Yamada

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

Cc Alison Wang <[email protected]>
Cc Angelo Dureghello <[email protected]>

---

 arch/m68k/Kconfig                  | 13 +++++++++++++
 arch/m68k/cpu/mcf547x_8x/config.mk |  4 +++-
 include/configs/M5475EVB.h         |  3 ---
 include/configs/M5485EVB.h         |  3 ---
 4 files changed, 16 insertions(+), 7 deletions(-)
arch/m68k/Kconfig +13 -0
index a3f0cbc..69cb0f7 100644
@@ -35,6 +35,9 @@ config MCF5445x
 config MCF5227x
 	bool
 
+config MCF547x_8x
+	bool
+
 # processor type
 config M5208
 	bool
@@ -101,6 +104,14 @@ config M52277
 	bool
 	select MCF5227x
 
+config M547x
+	bool
+	select MCF547x_8x
+
+config M548x
+	bool
+	select MCF547x_8x
+
 choice
 	prompt "Target select"
 
@@ -178,9 +189,11 @@ config TARGET_M54455EVB
 
 config TARGET_M5475EVB
 	bool "Support M5475EVB"
+	select M547x
 
 config TARGET_M5485EVB
 	bool "Support M5485EVB"
+	select M548x
 
 config TARGET_AMCORE
 	bool "Support AMCORE"
arch/m68k/cpu/mcf547x_8x/config.mk +3 -1
index 825f6cc..240dd27 100644
@@ -7,7 +7,9 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-PLATFORM_CPPFLAGS += -mcpu=5485 -fPIC
+cpuflags-$(CONFIG_MCF547x_8x) := -mcpu=5485 -fPIC
+
+PLATFORM_CPPFLAGS += $(cpuflags-y)
 
 ifneq (,$(findstring -linux-,$(shell $(CC) --version)))
 ifneq (,$(findstring GOT,$(shell $(LD) --help)))
include/configs/M5475EVB.h +0 -3
index 2f4549f..91d6a1a 100644
@@ -18,9 +18,6 @@
  * High Level Configuration Options
  * (easy to change)
  */
-#define CONFIG_MCF547x_8x	/* define processor family */
-#define CONFIG_M547x		/* define processor type */
-#define CONFIG_M5475		/* define processor type */
 
 #define CONFIG_DISPLAY_BOARDINFO
 
include/configs/M5485EVB.h +0 -3
index 9aa02f7..ce9f3b0 100644
@@ -18,9 +18,6 @@
  * High Level Configuration Options
  * (easy to change)
  */
-#define CONFIG_MCF547x_8x	/* define processor family */
-#define CONFIG_M548x		/* define processor type */
-#define CONFIG_M5485		/* define processor type */
 
 #define CONFIG_DISPLAY_BOARDINFO
 
Signature · 1 line
1.9.1
#14 lore raw

PATCH 7/8 m68k: mcf547x_8x: move CPU type to Kconfig and refactor config.mk

Quoted 7 lines · Masahiro Yamada

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

Cc Alison Wang <[email protected]>
Cc Angelo Dureghello <[email protected]>

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150328/5e5c36ae/attachment.sig>
#15 lore raw

PATCH 8/8 m68k: merge per-CPU config.mk into arch/m68k/Makefile

In reply to Masahiro Yamada

Collect CPU specific flags into the single place.

Cc Alison Wang <[email protected]>
Cc Angelo Dureghello <[email protected]>

---

 arch/m68k/Makefile                 | 29 +++++++++++++++++++++++++++++
 arch/m68k/cpu/mcf5227x/config.mk   | 12 ------------
 arch/m68k/cpu/mcf523x/config.mk    | 12 ------------
 arch/m68k/cpu/mcf52x2/config.mk    | 18 ------------------
 arch/m68k/cpu/mcf530x/config.mk    |  9 ---------
 arch/m68k/cpu/mcf532x/config.mk    | 13 -------------
 arch/m68k/cpu/mcf5445x/config.mk   | 19 -------------------
 arch/m68k/cpu/mcf547x_8x/config.mk | 18 ------------------
 8 files changed, 29 insertions(+), 101 deletions(-)
 delete mode 100644 arch/m68k/cpu/mcf5227x/config.mk
 delete mode 100644 arch/m68k/cpu/mcf523x/config.mk
 delete mode 100644 arch/m68k/cpu/mcf52x2/config.mk
 delete mode 100644 arch/m68k/cpu/mcf530x/config.mk
 delete mode 100644 arch/m68k/cpu/mcf532x/config.mk
 delete mode 100644 arch/m68k/cpu/mcf5445x/config.mk
 delete mode 100644 arch/m68k/cpu/mcf547x_8x/config.mk
arch/m68k/Makefile +29 -0
index aa3d2fa..e6f3b48 100644
@@ -6,3 +6,32 @@ head-y := arch/m68k/cpu/$(CPU)/start.o
 
 libs-y += arch/m68k/cpu/$(CPU)/
 libs-y += arch/m68k/lib/
+
+cpuflags-$(CONFIG_M5208)	:= -mcpu=5208
+cpuflags-$(CONFIG_M5235)	:= -mcpu=5235 -fPIC
+cpuflags-$(CONFIG_M52277)	:= -mcpu=52277 -fPIC
+cpuflags-$(CONFIG_M5249)	:= -mcpu=5249
+cpuflags-$(CONFIG_M5253)	:= -mcpu=5253
+cpuflags-$(CONFIG_M5271)	:= -mcpu=5271
+cpuflags-$(CONFIG_M5272)	:= -mcpu=5272
+cpuflags-$(CONFIG_M5275)	:= -mcpu=5275
+cpuflags-$(CONFIG_M5282)	:= -mcpu=5282
+cpuflags-$(CONFIG_M5307)	:= -mcpu=5307
+cpuflags-$(CONFIG_MCF5301x)	:= -mcpu=53015 -fPIC
+cpuflags-$(CONFIG_MCF532x)	:= -mcpu=5329 -fPIC
+cpuflags-$(CONFIG_MCF5441x)	:= -mcpu=54418 -fPIC
+cpuflags-$(CONFIG_MCF5445x)	:= -mcpu=54455 -fPIC
+cpuflags-$(CONFIG_MCF547x_8x)	:= -mcpu=5485 -fPIC
+
+PLATFORM_CPPFLAGS += $(cpuflags-y)
+
+
+ldflags-$(CONFIG_MCF5441x)	:= --got=single
+ldflags-$(CONFIG_MCF5445x)	:= --got=single
+ldflags-$(CONFIG_MCF547x_8x)	:= --got=single
+
+ifneq (,$(findstring -linux-,$(shell $(CC) --version)))
+ifneq (,$(findstring GOT,$(shell $(LD) --help)))
+PLATFORM_LDFLAGS += $(ldflags-y)
+endif
+endif
arch/m68k/cpu/mcf5227x/config.mk deleted +0 -12
deleted file mode 100644
index a6814d8..0000000
@@ -1,12 +0,0 @@
-#
-# (C) Copyright 2003 Josef Baumgartner <[email protected]>
-#
-# (C) Copyright 2000-2004
-# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
-#
-# SPDX-License-Identifier:	GPL-2.0+
-#
-
-cpuflags-$(CONFIG_M52277) := -mcpu=52277 -fPIC
-
-PLATFORM_CPPFLAGS += $(cpuflags-y)
arch/m68k/cpu/mcf523x/config.mk deleted +0 -12
deleted file mode 100644
index 4795f6a..0000000
@@ -1,12 +0,0 @@
-#
-# (C) Copyright 2003 Josef Baumgartner <[email protected]>
-#
-# (C) Copyright 2000-2004
-# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
-#
-# SPDX-License-Identifier:	GPL-2.0+
-#
-
-cpuflags-$(CONFIG_M5235) := -mcpu=5235 -fPIC
-
-PLATFORM_CPPFLAGS += $(cpuflags-y)
arch/m68k/cpu/mcf52x2/config.mk deleted +0 -18
deleted file mode 100644
index f8fdefd..0000000
@@ -1,18 +0,0 @@
-#
-# (C) Copyright 2003 Josef Baumgartner <[email protected]>
-#
-# (C) Copyright 2000-2004
-# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
-#
-# SPDX-License-Identifier:	GPL-2.0+
-#
-
-cpuflags-$(CONFIG_M5208) := -mcpu=5208
-cpuflags-$(CONFIG_M5249) := -mcpu=5249
-cpuflags-$(CONFIG_M5253) := -mcpu=5253
-cpuflags-$(CONFIG_M5271) := -mcpu=5271
-cpuflags-$(CONFIG_M5272) := -mcpu=5272
-cpuflags-$(CONFIG_M5275) := -mcpu=5275
-cpuflags-$(CONFIG_M5282) := -mcpu=5282
-
-PLATFORM_CPPFLAGS += $(cpuflags-y)
arch/m68k/cpu/mcf530x/config.mk deleted +0 -9
deleted file mode 100644
index 25845aa..0000000
@@ -1,9 +0,0 @@
-#
-# (C) Copyright 2014  Angelo Dureghello <[email protected]>
-#
-# SPDX-License-Identifier:     GPL-2.0+
-#
-
-cpuflags-$(CONFIG_M5307) := -mcpu=5307
-
-PLATFORM_CPPFLAGS += $(cpuflags-y)
arch/m68k/cpu/mcf532x/config.mk deleted +0 -13
deleted file mode 100644
index 470d22f..0000000
@@ -1,13 +0,0 @@
-#
-# (C) Copyright 2003 Josef Baumgartner <[email protected]>
-#
-# (C) Copyright 2000-2004
-# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
-#
-# SPDX-License-Identifier:	GPL-2.0+
-#
-
-cpuflags-$(CONFIG_MCF5301x) := -mcpu=53015 -fPIC
-cpuflags-$(CONFIG_MCF532x)  := -mcpu=5329 -fPIC
-
-PLATFORM_CPPFLAGS += $(cpuflags-y)
arch/m68k/cpu/mcf5445x/config.mk deleted +0 -19
deleted file mode 100644
index c3923c6..0000000
@@ -1,19 +0,0 @@
-#
-# (C) Copyright 2003 Josef Baumgartner <[email protected]>
-#
-# (C) Copyright 2000-2004
-# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
-#
-# Copyright 2011-2012 Freescale Semiconductor, Inc.
-#
-# SPDX-License-Identifier:	GPL-2.0+
-#
-
-cpuflags-$(CONFIG_MCF5441x) := -mcpu=54418 -fPIC
-cpuflags-$(CONFIG_MCF5445x) := -mcpu=54455 -fPIC
-
-ifneq (,$(findstring -linux-,$(shell $(CC) --version)))
-ifneq (,$(findstring GOT,$(shell $(LD) --help)))
-PLATFORM_LDFLAGS += --got=single
-endif
-endif
arch/m68k/cpu/mcf547x_8x/config.mk deleted +0 -18
deleted file mode 100644
index 240dd27..0000000
@@ -1,18 +0,0 @@
-#
-# (C) Copyright 2003 Josef Baumgartner <[email protected]>
-#
-# (C) Copyright 2000-2004
-# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
-#
-# SPDX-License-Identifier:	GPL-2.0+
-#
-
-cpuflags-$(CONFIG_MCF547x_8x) := -mcpu=5485 -fPIC
-
-PLATFORM_CPPFLAGS += $(cpuflags-y)
-
-ifneq (,$(findstring -linux-,$(shell $(CC) --version)))
-ifneq (,$(findstring GOT,$(shell $(LD) --help)))
-PLATFORM_LDFLAGS += --got=single
-endif
-endif
Signature · 1 line
1.9.1
#16 lore raw

PATCH 8/8 m68k: merge per-CPU config.mk into arch/m68k/Makefile

Quoted 5 lines · Masahiro Yamada

Collect CPU specific flags into the single place.

Cc Alison Wang <[email protected]>
Cc Angelo Dureghello <[email protected]>

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150328/b94e016e/attachment.sig>