[coreboot-gerrit] Patch set updated for coreboot: 596460b rtc: add config flag to denote rtc API availability

Patrick Georgi (pgeorgi@google.com) gerrit at coreboot.org
Wed Apr 22 13:33:38 CEST 2015


Patrick Georgi (pgeorgi at google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/9953

-gerrit

commit 596460b5abecc62ec4b4a6696b48442f43e9353d
Author: Patrick Georgi <pgeorgi at chromium.org>
Date:   Wed Apr 22 13:28:21 2015 +0200

    rtc: add config flag to denote rtc API availability
    
    RTC drivers now select RTC, so that code which depends on them
    can implement fallback behavior for systems that lack the
    hardware or driver.
    
    elog is one such instance, and uses the flag.
    
    Change-Id: I0f5a15d643b0c45c511f1151a98e071b4155fb5a
    Signed-off-by: Patrick Georgi <pgeorgi at chromium.org>
---
 src/Kconfig                     | 4 ++++
 src/drivers/ams/Kconfig         | 1 +
 src/drivers/elog/elog.c         | 6 +++++-
 src/drivers/pc80/Kconfig        | 1 +
 src/drivers/ti/tps65913/Kconfig | 1 +
 src/soc/rockchip/rk3288/Kconfig | 1 +
 6 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/src/Kconfig b/src/Kconfig
index 8c55837..d7fff15 100644
--- a/src/Kconfig
+++ b/src/Kconfig
@@ -345,6 +345,10 @@ menu "Generic Drivers"
 source "src/drivers/*/Kconfig"
 endmenu
 
+config RTC
+	bool
+	default n
+
 config TPM
 	bool
 	default n
diff --git a/src/drivers/ams/Kconfig b/src/drivers/ams/Kconfig
index 44b89c5..6729443 100644
--- a/src/drivers/ams/Kconfig
+++ b/src/drivers/ams/Kconfig
@@ -1,6 +1,7 @@
 config DRIVERS_AS3722_RTC
 	bool "AS3722 RTC support"
 	default n
+	select RTC
 
 config DRIVERS_AS3722_RTC_BUS
 	int "AS3722 RTC bus"
diff --git a/src/drivers/elog/elog.c b/src/drivers/elog/elog.c
index de18d5d..d7751c2 100644
--- a/src/drivers/elog/elog.c
+++ b/src/drivers/elog/elog.c
@@ -649,6 +649,7 @@ int elog_init(void)
  */
 static void elog_fill_timestamp(struct event_header *event)
 {
+#if IS_ENABLED(CONFIG_RTC)
 	struct rtc_time time;
 
 	rtc_get(&time);
@@ -659,9 +660,12 @@ static void elog_fill_timestamp(struct event_header *event)
 	event->month = bin2bcd(time.mon);
 	event->year = bin2bcd(time.year) & 0xff;
 
+
 	/* Basic sanity check of expected ranges */
 	if (event->month > 0x12 || event->day > 0x31 || event->hour > 0x23 ||
-	    event->minute > 0x59 || event->second > 0x59) {
+	    event->minute > 0x59 || event->second > 0x59)
+#endif
+	{
 		event->year   = 0;
 		event->month  = 0;
 		event->day    = 0;
diff --git a/src/drivers/pc80/Kconfig b/src/drivers/pc80/Kconfig
index a1e94ab..0ed1ecf 100644
--- a/src/drivers/pc80/Kconfig
+++ b/src/drivers/pc80/Kconfig
@@ -20,6 +20,7 @@ config DRIVERS_PS2_KEYBOARD
 config DRIVERS_MC146818
 	bool
 	default y if ARCH_X86
+	select RTC
 
 source src/drivers/pc80/tpm/Kconfig
 
diff --git a/src/drivers/ti/tps65913/Kconfig b/src/drivers/ti/tps65913/Kconfig
index bd24bae..5184c68 100644
--- a/src/drivers/ti/tps65913/Kconfig
+++ b/src/drivers/ti/tps65913/Kconfig
@@ -25,6 +25,7 @@ config DRIVERS_TI_TPS65913_RTC
 	bool "TI TPS65913 RTC support"
 	default n
 	select DRIVERS_TI_TPS65913
+	select RTC
 
 config DRIVERS_TI_TPS65913_RTC_BUS
 	int "TI TPS65913 RTC bus"
diff --git a/src/soc/rockchip/rk3288/Kconfig b/src/soc/rockchip/rk3288/Kconfig
index ed8001d..4cdbeea 100644
--- a/src/soc/rockchip/rk3288/Kconfig
+++ b/src/soc/rockchip/rk3288/Kconfig
@@ -32,6 +32,7 @@ config SOC_ROCKCHIP_RK3288
 	select BOOTBLOCK_CONSOLE
 	select UNCOMPRESSED_RAMSTAGE
 	select GENERIC_GPIO_LIB
+	select RTC
 
 if SOC_ROCKCHIP_RK3288
 



More information about the coreboot-gerrit mailing list