arm: move SYS_ARCH_TIMER to KConfig
authorAndre Przywara <andre.przywara@arm.com>
Thu, 12 Apr 2018 01:24:46 +0000 (04:24 +0300)
committerTom Rini <trini@konsulko.com>
Sat, 28 Apr 2018 22:30:43 +0000 (18:30 -0400)
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 a few 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>
[tuomas: rebase + fix conflicts and resync with moveconfig & use select]
Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
arch/arm/Kconfig
arch/arm/cpu/armv8/Makefile
arch/arm/mach-imx/mx7ulp/Kconfig
arch/arm/mach-qemu/Kconfig
arch/arm/mach-stm32mp/Kconfig
include/configs/mx7ulp_evk.h
include/configs/qemu-arm.h
include/configs/stm32mp1.h
include/configs/ti_armv7_keystone2.h
scripts/config_whitelist.txt

index 6812cdd4ab16e787b75ee2185e1b210a5fb0d5d3..35fcd2427412dbc088c982b6b76a272c31128bb6 100644 (file)
@@ -242,6 +242,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
@@ -570,6 +580,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
index 12495474360b6508584a606475e49392803c521c..d18b38eb9e866ef9874653840c018790c726bf09 100644 (file)
@@ -9,7 +9,7 @@ extra-y := start.o
 
 obj-y  += cpu.o
 ifndef CONFIG_$(SPL_TPL_)TIMER
-obj- += generic_timer.o
+obj-$(CONFIG_SYS_ARCH_TIMER) += generic_timer.o
 endif
 obj-y  += cache_v8.o
 obj-y  += exceptions.o
index 1bdc85a9a0331fe4acb89ad6d3338f4480d81933..d4b0299dbd1d350d1bf509d2d1b5bfb2d0de21e2 100644 (file)
@@ -9,6 +9,7 @@ choice
 
 config TARGET_MX7ULP_EVK
         bool "Support mx7ulp EVK board"
+       select SYS_ARCH_TIMER
 
 endchoice
 
index 133163aecfcc6b18a389bde7ac1c5d6e76422306..226dfa362f2e14c82fb2b5e7ab44781a1b887604 100644 (file)
@@ -16,6 +16,7 @@ config TARGET_QEMU_ARM_32BIT
        depends on ARCH_QEMU
        select CPU_V7
        select ARCH_SUPPORT_PSCI
+       select SYS_ARCH_TIMER
 
 config TARGET_QEMU_ARM_64BIT
        bool "Support qemu_arm64"
index 8ca97bf0c960885b81811cc6585901fe7ffa57d7..4d59480c197f35439c1c8c4327d5ee74b636e28c 100644 (file)
@@ -27,6 +27,7 @@ config TARGET_STM32MP1
        select CPU_V7
        select PINCTRL_STM32
        select STM32_RESET
+       select SYS_ARCH_TIMER
        select SYSRESET_SYSCON
        help
                target STMicroelectronics SOC STM32MP1 family
index c2223bd858d6fe248614b7493a4ec084468633a9..3dcda9ea7728bc1e0d03228a050b9548b4a684a2 100644 (file)
@@ -46,7 +46,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
index b29a54ef892535d41722659807b9d5540d4ca0f5..f306b416352083ac2c6bcd7dddd193737e21dbd9 100644 (file)
@@ -20,7 +20,6 @@
 #define CONFIG_SYS_MALLOC_LEN          SZ_16M
 
 /* For timer, QEMU emulates an ARMv7/ARMv8 architected timer */
-#define CONFIG_SYS_ARCH_TIMER
 #define CONFIG_SYS_HZ                       1000
 
 /* For block devices, QEMU emulates an ICH9 AHCI controller over PCI */
index da0e259736a6bec9538699c255adb9cd10a3e22b..b2b654ca7a9a60796f6b7495d4cb5e915af743b5 100644 (file)
@@ -17,7 +17,6 @@
  * Number of clock ticks in 1 sec
  */
 #define CONFIG_SYS_HZ                          1000
-#define CONFIG_SYS_ARCH_TIMER
 
 /*
  * malloc() pool size
index e87acca65005dbd6181d0a76b198a3cbddd7035c..6f2a33e18720dd22d60c304d584913af66ed5542 100644 (file)
@@ -17,7 +17,6 @@
 
 /* SoC Configuration */
 #define CONFIG_ARCH_CPU_INIT
-#define CONFIG_SYS_ARCH_TIMER
 #define CONFIG_SPL_TARGET              "u-boot-spi.gph"
 #define CONFIG_SYS_DCACHE_OFF
 
index 901bf0df9534cf0ca2387f158719aa654a8b152c..bbc44e3291c49cd8763c3ccbe1f2febdd582c5d1 100644 (file)
@@ -2074,7 +2074,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