[U-Boot] [RFC PATCH 03/13] arm: move SYS_ARCH_TIMER to KConfig

Andre Przywara
2017-11-30T01:25:01Z

SYS_ARCH_TIMER guards the usage of the ARM Generic Timer (aka arch
timer) in U-Boot.
At the moment it is mandatory for ARMv8 and used by two ARMv7 boards.
Add a proper Kconfig symbol to express this dependency properly,
allowing certain board configuration to later disable arch timer in case
there are any problems with it.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
arch/arm/Kconfig | 11 +++++++++++
arch/arm/cpu/armv8/Makefile | 2 +-
arch/arm/mach-imx/mx7ulp/Kconfig | 1 +
include/configs/mx7ulp_evk.h | 1 -
include/configs/ti_armv7_keystone2.h | 1 -
scripts/config_whitelist.txt | 1 -
6 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 88c8417120..cfde0758ef 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -209,6 +209,16 @@ config SYS_CACHELINE_SIZE
default 64 if SYS_CACHE_SHIFT_6
default 32 if SYS_CACHE_SHIFT_5

+config SYS_ARCH_TIMER
+ bool "ARM Generic Timer support"
+ depends on CPU_V7 || ARM64
+ default y if ARM64
+ help
+ The ARM Generic Timer (aka arch-timer) provides an architected
+ interface to a timer source on an SoC.
+ It is mandantory for ARMv8 implementation and widely available
+ on ARMv7 systems.
+
config ARM_SMCCC
bool "Support for ARM SMC Calling Convention (SMCCC)"
depends on CPU_V7 || ARM64
@@ -586,6 +596,7 @@ config ARCH_KEYSTONE
select SUPPORT_SPL
select SYS_THUMB_BUILD
select CMD_POWEROFF
+ select SYS_ARCH_TIMER
imply CMD_MTDPARTS
imply FIT
imply CMD_SAVES
diff --git a/arch/arm/cpu/armv8/Makefile b/arch/arm/cpu/armv8/Makefile
index 1249547436..d18b38eb9e 100644
--- a/arch/arm/cpu/armv8/Makefile
+++ b/arch/arm/cpu/armv8/Makefile
@@ -9,7 +9,7 @@ extra-y := start.o

obj-y += cpu.o
ifndef CONFIG_$(SPL_TPL_)TIMER
-obj-y += generic_timer.o
+obj-$(CONFIG_SYS_ARCH_TIMER) += generic_timer.o
endif
obj-y += cache_v8.o
obj-y += exceptions.o
diff --git a/arch/arm/mach-imx/mx7ulp/Kconfig b/arch/arm/mach-imx/mx7ulp/Kconfig
index 1bdc85a9a0..d4b0299dbd 100644
--- a/arch/arm/mach-imx/mx7ulp/Kconfig
+++ b/arch/arm/mach-imx/mx7ulp/Kconfig
@@ -9,6 +9,7 @@ choice

config TARGET_MX7ULP_EVK
bool "Support mx7ulp EVK board"
+ select SYS_ARCH_TIMER

endchoice

diff --git a/include/configs/mx7ulp_evk.h b/include/configs/mx7ulp_evk.h
index 6ab8db36a8..3d08ba233c 100644
--- a/include/configs/mx7ulp_evk.h
+++ b/include/configs/mx7ulp_evk.h
@@ -47,7 +47,6 @@
/* Using ULP WDOG for reset */
#define WDOG_BASE_ADDR WDG1_RBASE

-#define CONFIG_SYS_ARCH_TIMER
#define CONFIG_SYS_HZ_CLOCK 1000000 /* Fixed at 1Mhz from TSTMR */

#define CONFIG_INITRD_TAG
diff --git a/include/configs/ti_armv7_keystone2.h b/include/configs/ti_armv7_keystone2.h
index 562bb65636..dca6cf004c 100644
--- a/include/configs/ti_armv7_keystone2.h
+++ b/include/configs/ti_armv7_keystone2.h
@@ -17,7 +17,6 @@

/* SoC Configuration */
#define CONFIG_ARCH_CPU_INIT
-#define CONFIG_SYS_ARCH_TIMER
#ifndef CONFIG_SYS_TEXT_BASE
#define CONFIG_SYS_TEXT_BASE 0x0c000000
#endif
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index 4ce87484c3..b222ae1172 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -2285,7 +2285,6 @@ CONFIG_SYS_APP1_BASE
CONFIG_SYS_APP1_SIZE
CONFIG_SYS_APP2_BASE
CONFIG_SYS_APP2_SIZE
-CONFIG_SYS_ARCH_TIMER
CONFIG_SYS_ARM_CACHE_WRITETHROUGH
CONFIG_SYS_AT91_CPU_NAME
CONFIG_SYS_AT91_MAIN_CLOCK
--
2.14.1