On MediaTek boards we cannot override the SYS_BOARD / SYS_CONFIG_NAME
variables from defconfig.
This is because in board/mediatek/mt/Kconfig this value was override
by default due to the if CONFIG_TARGET_MT condition.
Merge all the Kconfigs to the mach-medatek/Kconfig.
This way:
- we only define SYS_{SOC,VENDOR} once
- all board definitions are in a single place, simplifying the build logic.
Signed-off-by: Guillaume La Roque
---
arch/arm/mach-mediatek/Kconfig | 42 +++-
arch/mips/mach-mtmips/Kconfig| 3 ++
arch/mips/mach-mtmips/mt7620/Kconfig | 8 +-
arch/mips/mach-mtmips/mt7628/Kconfig | 11 +++-
board/mediatek/mt7620/Kconfig| 12
board/mediatek/mt7622/Kconfig| 17 ---
board/mediatek/mt7623/Kconfig| 13 -
board/mediatek/mt7628/Kconfig| 12
board/mediatek/mt7629/Kconfig| 17 ---
board/mediatek/mt8183/Kconfig| 13 -
board/mediatek/mt8512/Kconfig| 14 --
board/mediatek/mt8516/Kconfig| 13 -
board/mediatek/mt8518/Kconfig| 14 --
13 files changed, 55 insertions(+), 134 deletions(-)
delete mode 100644 board/mediatek/mt7620/Kconfig
delete mode 100644 board/mediatek/mt7622/Kconfig
delete mode 100644 board/mediatek/mt7623/Kconfig
delete mode 100644 board/mediatek/mt7628/Kconfig
delete mode 100644 board/mediatek/mt7629/Kconfig
delete mode 100644 board/mediatek/mt8183/Kconfig
delete mode 100644 board/mediatek/mt8512/Kconfig
delete mode 100644 board/mediatek/mt8516/Kconfig
delete mode 100644 board/mediatek/mt8518/Kconfig
diff --git a/arch/arm/mach-mediatek/Kconfig b/arch/arm/mach-mediatek/Kconfig
index e067604d9b..43979838e0 100644
--- a/arch/arm/mach-mediatek/Kconfig
+++ b/arch/arm/mach-mediatek/Kconfig
@@ -80,12 +80,40 @@ config TARGET_MT8518
endchoice
-source "board/mediatek/mt7622/Kconfig"
-source "board/mediatek/mt7623/Kconfig"
-source "board/mediatek/mt7629/Kconfig"
-source "board/mediatek/mt8183/Kconfig"
-source "board/mediatek/mt8512/Kconfig"
-source "board/mediatek/mt8516/Kconfig"
-source "board/mediatek/mt8518/Kconfig"
+config SYS_BOARD
+ string "Board name"
+ default "mt7622" if TARGET_MT7622
+ default "mt7623" if TARGET_MT7623
+ default "mt7629" if TARGET_MT7629
+ default "mt8183" if TARGET_MT8183
+ default "mt8512" if TARGET_MT8512
+ default "mt8516" if TARGET_MT8516
+ default "mt8518" if TARGET_MT8518
+ default ""
+ help
+ This option contains information about board name.
+ Based on this option board// will
+ be used.
+
+config SYS_CONFIG_NAME
+ string "Board configuration name"
+ default "mt7622" if TARGET_MT7622
+ default "mt7623" if TARGET_MT7623
+ default "mt7629" if TARGET_MT7629
+ default "mt8183" if TARGET_MT8183
+ default "mt8512" if TARGET_MT8512
+ default "mt8516" if TARGET_MT8516
+ default "mt8518" if TARGET_MT8518
+ default ""
+ help
+ This option contains information about board configuration name.
+ Based on this option include/configs/.h header
+ will be used for board configuration.
+
+config MTK_BROM_HEADER_INFO
+ string
+ default "media=nor" if TARGET_MT8518 || TARGET_MT8512 || TARGET_MT7629
|| TARGET_MT7622
+ default "media=emmc" if TARGET_MT8516 || TARGET_MT8365 || TARGET_MT8183
+ default "lk=1" if TARGET_MT7623
endif
diff --git a/arch/mips/mach-mtmips/Kconfig b/arch/mips/mach-mtmips/Kconfig
index 8756cadb0b..cd078c03ad 100644
--- a/arch/mips/mach-mtmips/Kconfig
+++ b/arch/mips/mach-mtmips/Kconfig
@@ -1,6 +1,9 @@
menu "MediaTek MIPS platforms"
depends on ARCH_MTMIPS
+config SYS_VENDOR
+ default "mediatek"
+
config SYS_MALLOC_F_LEN
default 0x1000
diff --git a/arch/mips/mach-mtmips/mt7620/Kconfig
b/arch/mips/mach-mtmips/mt7620/Kconfig
index 5db83eb9d9..3ca711ad0f 100644
--- a/arch/mips/mach-mtmips/mt7620/Kconfig
+++ b/arch/mips/mach-mtmips/mt7620/Kconfig
@@ -66,6 +66,12 @@ config CPU_FREQ_MULTI
default 6 if CPU_FREQ_600MHZ
default 7 if CPU_FREQ_620MHZ
-source "board/mediatek/mt7620/Kconfig"
+config SYS_CONFIG_NAME
+ string "Board configuration name"
+ default "mt7620" if BOARD_MT7620_RFB || BOARD_MT7620_MT7530_RFB
+
+config SYS_BOARD
+ string "Board name"
+ default "mt7620" if BOARD_MT7620_RFB || BOARD_MT7620_MT7530_RFB
endif
diff --git a/arch/mips/mach-mtmips/mt7628/Kconfig
b/arch/mips/mach-mtmips/mt7628/Kconfig
index e3f56e782e..9b8e588c66 100644
--- a/arch/mips/mach-mtmips/mt7628/Kconfig
+++ b/arch/mips/mach-mtmips/mt7628/Kconfig
@@ -45,8 +45,17 @@ config SPL_UART2_SPIS_PINMUX
Select this if the UART2 of your board is connected to GPIO 16/17
(shared with SPIS) rather than the usual GPIO 20/21.
+config SYS_BOARD
+ string "Board name"
+ default "mt7628" if BOARD_MT