]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
dm: timer: normalise SPL and TPL support
authorPhilipp Tomsich <philipp.tomsich@theobroma-systems.com>
Fri, 28 Jul 2017 15:38:42 +0000 (17:38 +0200)
committerPhilipp Tomsich <philipp.tomsich@theobroma-systems.com>
Sun, 13 Aug 2017 15:12:36 +0000 (17:12 +0200)
To fully support DM timer in SPL and TPL, we need a few things cleaned
up and normalised:
- inclusion of the uclass and drivers should be an all-or-nothing
  decision for each stage and under control of $(SPL_TPL_)TIMER
  instead of having the two-level configuration with TIMER and
  $(SPL_TPL_)TIMER_SUPPORT
- when $(SPL_TPL_)TIMER is enabled, the ARMv8 generic timer code can
  not be compiled in

This normalises configuration to $(SPL_TPL_)TIMER and moves the config
options to drivers/timer/Kconfig (and cleans up the collateral damage
to some defconfigs that had SPL_TIMER_SUPPORT enabled).

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
arch/arm/cpu/armv8/Makefile
common/spl/Kconfig
configs/chromebook_link64_defconfig
configs/qemu-x86_64_defconfig
drivers/Makefile
drivers/timer/Kconfig
drivers/timer/Makefile

index c447085fe4317cbedcbd853db2673b4a85ef5d2c..12495474360b6508584a606475e49392803c521c 100644 (file)
@@ -8,7 +8,9 @@
 extra-y        := start.o
 
 obj-y  += cpu.o
+ifndef CONFIG_$(SPL_TPL_)TIMER
 obj-y  += generic_timer.o
+endif
 obj-y  += cache_v8.o
 obj-y  += exceptions.o
 obj-y  += cache.o
index 192f7f66ddf2c1fa0e3b1d3df1cef3a903293226..51768575064dbc0ed4a8033c0b4bc581368d1017 100644 (file)
@@ -603,14 +603,6 @@ config SPL_SPI_SUPPORT
          enable SPI drivers that are needed for other purposes also, such
          as a SPI PMIC.
 
-config SPL_TIMER_SUPPORT
-       bool "Support timer drivers"
-       help
-         Enable support for timer drivers in SPL. These can be used to get
-         a timer value when in SPL, or perhaps for implementing a delay
-         function. This enables the drivers in drivers/timer as part of an
-         SPL build.
-
 config SPL_USB_HOST_SUPPORT
        bool "Support USB host drivers"
        help
index 34b9a56ee6cf1472dc68b758c4c588f0c5c98f99..f01b98da4d40f3b20994eee0fa0f887796ec4b12 100644 (file)
@@ -27,7 +27,7 @@ CONFIG_SPL_NET_SUPPORT=y
 CONFIG_SPL_PCI_SUPPORT=y
 CONFIG_SPL_PCH_SUPPORT=y
 CONFIG_SPL_RTC_SUPPORT=y
-CONFIG_SPL_TIMER_SUPPORT=y
+CONFIG_SPL_TIMER=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_CPU=y
 # CONFIG_CMD_BOOTEFI_HELLO_COMPILE is not set
index 0c40788e3fc0634ef8562de4e5e839bb14a9f978..44a15368ce3d5299222e8f489aba4b9d462338d6 100644 (file)
@@ -26,7 +26,7 @@ CONFIG_SPL_NET_SUPPORT=y
 CONFIG_SPL_PCI_SUPPORT=y
 CONFIG_SPL_PCH_SUPPORT=y
 CONFIG_SPL_RTC_SUPPORT=y
-CONFIG_SPL_TIMER_SUPPORT=y
+CONFIG_SPL_TIMER=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_CPU=y
 # CONFIG_CMD_BOOTEFI_HELLO_COMPILE is not set
index a41444ace14b381860eec9bb4752742c7eb8252a..0e0fdf0208917d327813feaf4b34f40403eb94e7 100644 (file)
@@ -15,6 +15,7 @@ obj-$(CONFIG_$(SPL_TPL_)RAM) += ram/
 obj-$(CONFIG_$(SPL_TPL_)SERIAL_SUPPORT) += serial/
 obj-$(CONFIG_$(SPL_TPL_)SPI_FLASH_SUPPORT) += mtd/spi/
 obj-$(CONFIG_$(SPL_TPL_)SPI_SUPPORT) += spi/
+obj-$(CONFIG_$(SPL_TPL_)TIMER) += timer/
 
 ifndef CONFIG_TPL_BUILD
 ifdef CONFIG_SPL_BUILD
@@ -38,7 +39,6 @@ obj-$(CONFIG_SPL_USBETH_SUPPORT) += net/phy/
 obj-$(CONFIG_SPL_PCI_SUPPORT) += pci/
 obj-$(CONFIG_SPL_PCH_SUPPORT) += pch/
 obj-$(CONFIG_SPL_RTC_SUPPORT) += rtc/
-obj-$(CONFIG_SPL_TIMER_SUPPORT) += timer/
 obj-$(CONFIG_SPL_MUSB_NEW_SUPPORT) += usb/musb-new/
 obj-$(CONFIG_SPL_USB_GADGET_SUPPORT) += usb/gadget/
 obj-$(CONFIG_SPL_USB_GADGET_SUPPORT) += usb/gadget/udc/
@@ -83,7 +83,6 @@ obj-y += scsi/
 obj-y += sound/
 obj-y += spmi/
 obj-y += sysreset/
-obj-y += timer/
 obj-y += tpm/
 obj-y += video/
 obj-y += watchdog/
index c666303331165dcf2e100adcf3fea41a0db660c1..ac4832be20db75d2ff80dde415b16954802c2937 100644 (file)
@@ -9,6 +9,24 @@ config TIMER
          will be used. The timer is usually a 32 bits free-running up
          counter. There may be no real tick, and no timer interrupt.
 
+config SPL_TIMER
+       bool "Enable driver model for timer drivers in SPL"
+       depends on TIMER && SPL
+       help
+         Enable support for timer drivers in SPL. These can be used to get
+         a timer value when in SPL, or perhaps for implementing a delay
+         function. This enables the drivers in drivers/timer as part of an
+         SPL build.
+
+config TPL_TIMER
+       bool "Enable driver model for timer drivers in TPL"
+       depends on TIMER && TPL
+       help
+         Enable support for timer drivers in TPL. These can be used to get
+         a timer value when in TPL, or perhaps for implementing a delay
+         function. This enables the drivers in drivers/timer as part of an
+         TPL build.
+
 config TIMER_EARLY
        bool "Allow timer to be used early in U-Boot"
        depends on TIMER
index ced7bd66bd30407d692bd71257461fb1b129eb8e..d16ea5391e671e930d60a3716db2b953a21a0367 100644 (file)
@@ -4,7 +4,7 @@
 # SPDX-License-Identifier:     GPL-2.0+
 #
 
-obj-$(CONFIG_TIMER)            += timer-uclass.o
+obj-y += timer-uclass.o
 obj-$(CONFIG_ALTERA_TIMER)     += altera_timer.o
 obj-$(CONFIG_SANDBOX_TIMER)    += sandbox_timer.o
 obj-$(CONFIG_X86_TSC_TIMER)    += tsc_timer.o