All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 2/6] dm: timer: normalise SPL and TPL support
Date: Wed,  2 Aug 2017 22:39:58 +0200	[thread overview]
Message-ID: <1501706406-10284-3-git-send-email-philipp.tomsich@theobroma-systems.com> (raw)
In-Reply-To: <1501706406-10284-1-git-send-email-philipp.tomsich@theobroma-systems.com>

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>
---

Changes in v2: None

 arch/arm/cpu/armv8/Makefile         |  2 ++
 common/spl/Kconfig                  |  8 --------
 configs/chromebook_link64_defconfig |  2 +-
 configs/qemu-x86_64_defconfig       |  2 +-
 drivers/Makefile                    |  3 +--
 drivers/timer/Kconfig               | 18 ++++++++++++++++++
 drivers/timer/Makefile              |  2 +-
 7 files changed, 24 insertions(+), 13 deletions(-)

diff --git a/arch/arm/cpu/armv8/Makefile b/arch/arm/cpu/armv8/Makefile
index c447085..1249547 100644
--- a/arch/arm/cpu/armv8/Makefile
+++ b/arch/arm/cpu/armv8/Makefile
@@ -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
diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index 08013b7..1386760 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -602,14 +602,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
diff --git a/configs/chromebook_link64_defconfig b/configs/chromebook_link64_defconfig
index 11ceb76..5cf409c 100644
--- a/configs/chromebook_link64_defconfig
+++ b/configs/chromebook_link64_defconfig
@@ -28,7 +28,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
diff --git a/configs/qemu-x86_64_defconfig b/configs/qemu-x86_64_defconfig
index fc1c70d..9517001 100644
--- a/configs/qemu-x86_64_defconfig
+++ b/configs/qemu-x86_64_defconfig
@@ -29,7 +29,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
diff --git a/drivers/Makefile b/drivers/Makefile
index b98550e..9d4680a 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -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/
@@ -82,7 +82,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/
diff --git a/drivers/timer/Kconfig b/drivers/timer/Kconfig
index 17e7dfe..fb5af4d 100644
--- a/drivers/timer/Kconfig
+++ b/drivers/timer/Kconfig
@@ -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
diff --git a/drivers/timer/Makefile b/drivers/timer/Makefile
index ced7bd6..d16ea53 100644
--- a/drivers/timer/Makefile
+++ b/drivers/timer/Makefile
@@ -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
-- 
2.1.4

  parent reply	other threads:[~2017-08-02 20:39 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-02 20:39 [U-Boot] [PATCH v2 0/6] rockchip: rk3368: remove secure timer usage and use DM timer Philipp Tomsich
2017-08-02 20:39 ` [U-Boot] [PATCH v2 1/6] timer: add OF_PLATDATA support for timer-uclass Philipp Tomsich
2017-08-06 17:18   ` [U-Boot] [U-Boot, v2, " Philipp Tomsich
2017-08-02 20:39 ` Philipp Tomsich [this message]
2017-08-06 17:18   ` [U-Boot] [U-Boot, v2, 2/6] dm: timer: normalise SPL and TPL support Philipp Tomsich
2017-08-02 20:39 ` [U-Boot] [PATCH v2 3/6] rockchip: timer: add device-model timer driver for RK3368 (and similar) Philipp Tomsich
2017-08-06 17:18   ` [U-Boot] [U-Boot, v2, " Philipp Tomsich
2017-08-02 20:40 ` [U-Boot] [PATCH v2 4/6] dts: rk3368: make timer0 accessible for SPL and TPL Philipp Tomsich
2017-08-06 17:18   ` [U-Boot] [U-Boot, v2, " Philipp Tomsich
2017-08-02 20:40 ` [U-Boot] [PATCH v2 5/6] rockchip: lion-rk3368: defconfig: enable DM timer for all stages Philipp Tomsich
2017-08-06 17:18   ` [U-Boot] [U-Boot, v2, " Philipp Tomsich
2017-08-02 20:40 ` [U-Boot] [PATCH v2 6/6] rockchip: rk3368: remove setup of secure timer from TPL/SPL Philipp Tomsich
2017-08-06 17:18   ` [U-Boot] [U-Boot, v2, " Philipp Tomsich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1501706406-10284-3-git-send-email-philipp.tomsich@theobroma-systems.com \
    --to=philipp.tomsich@theobroma-systems.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.