From 7f3092d71317552735bd3f1784b16c31af89dd68 Mon Sep 17 00:00:00 2001
From: Tom Rini <trini@konsulko.com>
Date: Wed, 23 Mar 2022 17:19:57 -0400
Subject: [PATCH] Convert CONFIG_KM_COGE5UN et al to Kconfig

This converts the following to Kconfig:
   CONFIG_KM_COGE5UN
   CONFIG_KM_KIRKWOOD_128M16
   CONFIG_KM_KIRKWOOD
   CONFIG_KM_KIRKWOOD_PCI
   CONFIG_KM_NUSA
   CONFIG_KM_SUSE2

Cc: Holger Brunck <holger.brunck@hitachienergy.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Holger Brunck <holger.brunck@hitachienergy.com>
---
 board/keymile/km_arm/Kconfig         | 23 +++++++++++++++++++++++
 configs/km_kirkwood_128m16_defconfig |  2 +-
 configs/km_kirkwood_defconfig        |  2 +-
 configs/km_kirkwood_pci_defconfig    |  2 +-
 configs/kmcoge5un_defconfig          |  1 -
 configs/kmnusa_defconfig             |  2 +-
 configs/kmsuse2_defconfig            |  2 +-
 7 files changed, 28 insertions(+), 6 deletions(-)

diff --git a/board/keymile/km_arm/Kconfig b/board/keymile/km_arm/Kconfig
index c52b365b17..9d222d7136 100644
--- a/board/keymile/km_arm/Kconfig
+++ b/board/keymile/km_arm/Kconfig
@@ -60,4 +60,27 @@ config BOARD_SPECIFIC_OPTIONS # dummy
 	imply FS_CRAMFS
 	imply CMD_USB
 
+choice
+	prompt "Board model"
+
+config KM_COGE5UN
+	bool "Hitachi Power Grids COGE5UN"
+
+config KM_KIRKWOOD_128M16
+	bool "Hitachi Power Grids Kirkwood 128M16"
+
+config KM_KIRKWOOD
+	bool "Hitachi Power Grids Kirkwood"
+
+config KM_KIRKWOOD_PCI
+	bool "Hitachi Power Grids Kirkwood PCI"
+
+config KM_NUSA
+	bool "Hitachi Power Grids Kirkwood (NUSA)"
+
+config KM_SUSE2
+	bool "Hitachi Power Grids Kirkwood (SUSE2)"
+
+endchoice
+
 endif
diff --git a/configs/km_kirkwood_128m16_defconfig b/configs/km_kirkwood_128m16_defconfig
index 470c6e69e8..36bb19f403 100644
--- a/configs/km_kirkwood_128m16_defconfig
+++ b/configs/km_kirkwood_128m16_defconfig
@@ -6,6 +6,7 @@ CONFIG_ARCH_KIRKWOOD=y
 CONFIG_SYS_KWD_CONFIG="board/keymile/km_arm/kwbimage_128M16_1.cfg"
 CONFIG_SYS_TEXT_BASE=0x07d00000
 CONFIG_TARGET_KM_KIRKWOOD=y
+CONFIG_KM_KIRKWOOD_128M16=y
 CONFIG_ENV_SIZE=0x2000
 CONFIG_ENV_OFFSET=0x0
 CONFIG_DEFAULT_DEVICE_TREE="kirkwood-km_kirkwood"
@@ -13,7 +14,6 @@ CONFIG_BOOTCOUNT_BOOTLIMIT=3
 CONFIG_ENV_OFFSET_REDUND=0x2000
 CONFIG_IDENT_STRING="\nHitachi Power Grids Kirkwood 128M16"
 CONFIG_SYS_LOAD_ADDR=0x800000
-CONFIG_SYS_EXTRA_OPTIONS="KM_KIRKWOOD_128M16"
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Hit <SPACE> key to stop autoboot in %2ds\n"
 CONFIG_AUTOBOOT_STOP_STR=" "
diff --git a/configs/km_kirkwood_defconfig b/configs/km_kirkwood_defconfig
index 7caa9edae2..a2213b698e 100644
--- a/configs/km_kirkwood_defconfig
+++ b/configs/km_kirkwood_defconfig
@@ -6,6 +6,7 @@ CONFIG_ARCH_KIRKWOOD=y
 CONFIG_SYS_KWD_CONFIG="board/keymile/km_arm/kwbimage.cfg"
 CONFIG_SYS_TEXT_BASE=0x07d00000
 CONFIG_TARGET_KM_KIRKWOOD=y
+CONFIG_KM_KIRKWOOD=y
 CONFIG_ENV_SIZE=0x2000
 CONFIG_ENV_OFFSET=0x0
 CONFIG_DEFAULT_DEVICE_TREE="kirkwood-km_kirkwood"
@@ -13,7 +14,6 @@ CONFIG_BOOTCOUNT_BOOTLIMIT=3
 CONFIG_ENV_OFFSET_REDUND=0x2000
 CONFIG_IDENT_STRING="\nHitachi Power Grids Kirkwood"
 CONFIG_SYS_LOAD_ADDR=0x800000
-CONFIG_SYS_EXTRA_OPTIONS="KM_KIRKWOOD"
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Hit <SPACE> key to stop autoboot in %2ds\n"
 CONFIG_AUTOBOOT_STOP_STR=" "
diff --git a/configs/km_kirkwood_pci_defconfig b/configs/km_kirkwood_pci_defconfig
index db2d532af2..a2d6ec8f35 100644
--- a/configs/km_kirkwood_pci_defconfig
+++ b/configs/km_kirkwood_pci_defconfig
@@ -7,6 +7,7 @@ CONFIG_SYS_KWD_CONFIG="board/keymile/km_arm/kwbimage.cfg"
 CONFIG_SYS_TEXT_BASE=0x07d00000
 CONFIG_TARGET_KM_KIRKWOOD=y
 CONFIG_KM_FPGA_CONFIG=y
+CONFIG_KM_KIRKWOOD_PCI=y
 CONFIG_ENV_SIZE=0x2000
 CONFIG_ENV_OFFSET=0x0
 CONFIG_DEFAULT_DEVICE_TREE="kirkwood-km_kirkwood"
@@ -14,7 +15,6 @@ CONFIG_BOOTCOUNT_BOOTLIMIT=3
 CONFIG_ENV_OFFSET_REDUND=0x2000
 CONFIG_IDENT_STRING="\nHitachi Power Grids Kirkwood PCI"
 CONFIG_SYS_LOAD_ADDR=0x800000
-CONFIG_SYS_EXTRA_OPTIONS="KM_KIRKWOOD_PCI"
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Hit <SPACE> key to stop autoboot in %2ds\n"
 CONFIG_AUTOBOOT_STOP_STR=" "
diff --git a/configs/kmcoge5un_defconfig b/configs/kmcoge5un_defconfig
index 25db57fc16..5cae77bf8e 100644
--- a/configs/kmcoge5un_defconfig
+++ b/configs/kmcoge5un_defconfig
@@ -17,7 +17,6 @@ CONFIG_BOOTCOUNT_BOOTLIMIT=3
 CONFIG_ENV_OFFSET_REDUND=0xD0000
 CONFIG_IDENT_STRING="\nHitachi Power Grids COGE5UN"
 CONFIG_SYS_LOAD_ADDR=0x800000
-CONFIG_SYS_EXTRA_OPTIONS="KM_COGE5UN"
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Hit <SPACE> key to stop autoboot in %2ds\n"
 CONFIG_AUTOBOOT_STOP_STR=" "
diff --git a/configs/kmnusa_defconfig b/configs/kmnusa_defconfig
index 690cb3cfa5..5b17ed516f 100644
--- a/configs/kmnusa_defconfig
+++ b/configs/kmnusa_defconfig
@@ -9,6 +9,7 @@ CONFIG_TARGET_KM_KIRKWOOD=y
 CONFIG_KM_FPGA_CONFIG=y
 CONFIG_KM_ENV_IS_IN_SPI_NOR=y
 CONFIG_KM_PIGGY4_88E6352=y
+CONFIG_KM_NUSA=y
 CONFIG_ENV_SIZE=0x2000
 CONFIG_ENV_OFFSET=0xC0000
 CONFIG_ENV_SECT_SIZE=0x10000
@@ -17,7 +18,6 @@ CONFIG_BOOTCOUNT_BOOTLIMIT=3
 CONFIG_ENV_OFFSET_REDUND=0xD0000
 CONFIG_IDENT_STRING="\nHitachi Power Grids Kirkwood"
 CONFIG_SYS_LOAD_ADDR=0x800000
-CONFIG_SYS_EXTRA_OPTIONS="KM_NUSA"
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Hit <SPACE> key to stop autoboot in %2ds\n"
 CONFIG_AUTOBOOT_STOP_STR=" "
diff --git a/configs/kmsuse2_defconfig b/configs/kmsuse2_defconfig
index 409eb456e0..5575c7611b 100644
--- a/configs/kmsuse2_defconfig
+++ b/configs/kmsuse2_defconfig
@@ -10,6 +10,7 @@ CONFIG_KM_FPGA_CONFIG=y
 CONFIG_KM_FPGA_FORCE_CONFIG=y
 CONFIG_KM_FPGA_NO_RESET=y
 CONFIG_KM_ENV_IS_IN_SPI_NOR=y
+CONFIG_KM_SUSE2=y
 CONFIG_ENV_SIZE=0x2000
 CONFIG_ENV_OFFSET=0xC0000
 CONFIG_ENV_SECT_SIZE=0x10000
@@ -18,7 +19,6 @@ CONFIG_BOOTCOUNT_BOOTLIMIT=3
 CONFIG_ENV_OFFSET_REDUND=0xD0000
 CONFIG_IDENT_STRING="\nHitachi Power Grids Kirkwood"
 CONFIG_SYS_LOAD_ADDR=0x800000
-CONFIG_SYS_EXTRA_OPTIONS="KM_SUSE2"
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Hit <SPACE> key to stop autoboot in %2ds\n"
 CONFIG_AUTOBOOT_STOP_STR=" "
-- 
2.39.5