From b4d14bc81ad580000277deae5d51e3e3ef09875f Mon Sep 17 00:00:00 2001
From: Patrick Delaunay <patrick.delaunay@st.com>
Date: Wed, 17 Jun 2020 18:19:18 +0200
Subject: [PATCH] Convert CONFIG_ARMV7_PSCI_1_0 and CONFIG_ARMV7_PSCI_0_2 to
 Kconfig

This converts the following to Kconfig:
CONFIG_ARMV7_PSCI_1_0
CONFIG_ARMV7_PSCI_0_2

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
---
 arch/arm/cpu/armv7/Kconfig   | 14 ++++++++++++++
 include/configs/ls1021aqds.h |  2 --
 include/configs/ls1021atwr.h |  2 --
 include/configs/mx7_common.h |  2 --
 include/configs/stm32mp1.h   |  1 -
 include/configs/uniphier.h   |  2 --
 scripts/config_whitelist.txt |  1 -
 7 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/arch/arm/cpu/armv7/Kconfig b/arch/arm/cpu/armv7/Kconfig
index 14569e560b..8eee801dce 100644
--- a/arch/arm/cpu/armv7/Kconfig
+++ b/arch/arm/cpu/armv7/Kconfig
@@ -41,6 +41,20 @@ config ARMV7_PSCI
 	help
 	  Say Y here to enable PSCI support.
 
+choice
+	prompt "Supported PSCI version"
+	depends on ARMV7_PSCI
+	default ARMV7_PSCI_1_0
+	help
+	  Select the supported PSCI version.
+
+config ARMV7_PSCI_1_0
+	bool "PSCI V1.0"
+
+config ARMV7_PSCI_0_2
+	bool "PSCI V0.2"
+endchoice
+
 config ARMV7_PSCI_NR_CPUS
 	int "Maximum supported CPUs for PSCI"
 	depends on ARMV7_NONSEC
diff --git a/include/configs/ls1021aqds.h b/include/configs/ls1021aqds.h
index 0779b595c3..18800ea07a 100644
--- a/include/configs/ls1021aqds.h
+++ b/include/configs/ls1021aqds.h
@@ -7,8 +7,6 @@
 #ifndef __CONFIG_H
 #define __CONFIG_H
 
-#define CONFIG_ARMV7_PSCI_1_0
-
 #define CONFIG_ARMV7_SECURE_BASE	OCRAM_BASE_S_ADDR
 
 #define CONFIG_SYS_FSL_CLK
diff --git a/include/configs/ls1021atwr.h b/include/configs/ls1021atwr.h
index 16c30d09dc..6f7d051bd8 100644
--- a/include/configs/ls1021atwr.h
+++ b/include/configs/ls1021atwr.h
@@ -7,8 +7,6 @@
 #ifndef __CONFIG_H
 #define __CONFIG_H
 
-#define CONFIG_ARMV7_PSCI_1_0
-
 #define CONFIG_ARMV7_SECURE_BASE	OCRAM_BASE_S_ADDR
 
 #define CONFIG_SYS_FSL_CLK
diff --git a/include/configs/mx7_common.h b/include/configs/mx7_common.h
index 3ed578ffc0..c17cabc02f 100644
--- a/include/configs/mx7_common.h
+++ b/include/configs/mx7_common.h
@@ -43,8 +43,6 @@
 
 #define CONFIG_ARMV7_SECURE_BASE	0x00900000
 
-#define CONFIG_ARMV7_PSCI_1_0
-
 #ifdef CONFIG_SPL_BUILD
 #define CONFIG_SPL_DRIVERS_MISC_SUPPORT
 #endif
diff --git a/include/configs/stm32mp1.h b/include/configs/stm32mp1.h
index ed20b842ac..de9f8cb9bf 100644
--- a/include/configs/stm32mp1.h
+++ b/include/configs/stm32mp1.h
@@ -12,7 +12,6 @@
 
 #ifndef CONFIG_TFABOOT
 /* PSCI support */
-#define CONFIG_ARMV7_PSCI_1_0
 #define CONFIG_ARMV7_SECURE_BASE		STM32_SYSRAM_BASE
 #define CONFIG_ARMV7_SECURE_MAX_SIZE		STM32_SYSRAM_SIZE
 #endif
diff --git a/include/configs/uniphier.h b/include/configs/uniphier.h
index 03bbbab3cf..d0841a7d55 100644
--- a/include/configs/uniphier.h
+++ b/include/configs/uniphier.h
@@ -39,8 +39,6 @@
 #define BOOTENV
 #endif
 
-#define CONFIG_ARMV7_PSCI_1_0
-
 #define CONFIG_SYS_MALLOC_LEN		(4 * 1024 * 1024)
 
 #define CONFIG_TIMESTAMP
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index e3bebe94c4..da495f545b 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -44,7 +44,6 @@ CONFIG_ARMADA100
 CONFIG_ARMADA100_FEC
 CONFIG_ARMADA168
 CONFIG_ARMADA_39X
-CONFIG_ARMV7_PSCI_1_0
 CONFIG_ARMV7_SECURE_BASE
 CONFIG_ARMV7_SECURE_MAX_SIZE
 CONFIG_ARMV7_SECURE_RESERVE_SIZE
-- 
2.39.5