rtc: Allow use of RTC in SPL and TPL
authorSimon Glass <sjg@chromium.org>
Mon, 1 Oct 2018 18:22:15 +0000 (12:22 -0600)
committerSimon Glass <sjg@chromium.org>
Tue, 9 Oct 2018 10:40:27 +0000 (04:40 -0600)
Add Kconfig options so that the RTC can be used in SPL and TPL. This is
helpful for accessing the contents of CMOS RAM, for example.

Signed-off-by: Simon Glass <sjg@chromium.org>
configs/chromebook_link64_defconfig
drivers/rtc/Kconfig
drivers/rtc/Makefile

index fe6544b..2c51a2f 100644 (file)
@@ -69,6 +69,7 @@ CONFIG_DM_I2C=y
 CONFIG_SYS_I2C_INTEL=y
 CONFIG_CROS_EC=y
 CONFIG_CROS_EC_LPC=y
+CONFIG_SPL_DM_RTC=y
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_SPL_TIMER=y
index 97cf7d8..bcc01b1 100644 (file)
@@ -13,6 +13,24 @@ config DM_RTC
          drivers to perform the actual functions. See rtc.h for a
          description of the API.
 
+config SPL_DM_RTC
+       bool "Enable Driver Model for RTC drivers in SPL"
+       depends on SPL_DM
+       help
+         Enable drver model for real-time-clock drivers. The RTC uclass
+         then provides the rtc_get()/rtc_set() interface, delegating to
+         drivers to perform the actual functions. See rtc.h for a
+         description of the API.
+
+config TPL_DM_RTC
+       bool "Enable Driver Model for RTC drivers in TPL"
+       depends on TPL_DM
+       help
+         Enable drver model for real-time-clock drivers. The RTC uclass
+         then provides the rtc_get()/rtc_set() interface, delegating to
+         drivers to perform the actual functions. See rtc.h for a
+         description of the API.
+
 config RTC_PCF2127
        bool "Enable PCF2127 driver"
        depends on DM_RTC
index 513e3ff..1724602 100644 (file)
@@ -4,7 +4,7 @@
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #ccflags-y += -DDEBUG
 
-obj-$(CONFIG_DM_RTC) += rtc-uclass.o
+obj-$(CONFIG_$(SPL_TPL_)DM_RTC) += rtc-uclass.o
 
 obj-$(CONFIG_RTC_AT91SAM9_RTT) += at91sam9_rtt.o
 obj-y += date.o