config MCF537x
        bool
 
+config MCF5441x
+       bool
+
+config MCF5445x
+       bool
+
 # processor type
 config M5208
        bool
        select MCF532x
        select MCF537x
 
+config M54418
+       bool
+       select MCF5441x
+
+config M54451
+       bool
+       select MCF5445x
+
+config M54455
+       bool
+       select MCF5445x
+
 choice
        prompt "Target select"
 
 
 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"
 
 # 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)))
 
  * 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
 
  * 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
 
  * 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