[coreboot-gerrit] New patch to review for coreboot: 247dd53 elog: use CONFIG_RTC

Patrick Georgi (pgeorgi@google.com) gerrit at coreboot.org
Wed Apr 22 15:06:25 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/9955

-gerrit

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

    elog: use CONFIG_RTC
    
    When RTC is not selected, return all 0.
    
    Change-Id: I892a9489fc1d82fb8e61cf02666f797dc6412e05
    Signed-off-by: Patrick Georgi <pgeorgi at chromium.org>
---
 src/drivers/elog/elog.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

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;



More information about the coreboot-gerrit mailing list