From d0361193e0ec135e21f0611d7fa6e5c02f2b2bfc Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sat, 11 Jun 2016 10:43:13 -0600 Subject: [PATCH] gru: Show the current time on start-up Display the current time from the EC. BUG=chrome-os-partner:52220 BRANCH=none TEST=(partial) boot on gru and see output: Date: 1970-01-17 (Saturday) Time: 1:42:44 Then reboot ~10 seconds later and see output: Date: 1970-01-17 (Saturday) Time: 1:42:53 Change-Id: I04a072c788ba3fc915e6d73703f966955bbd3e7e Signed-off-by: Simon Glass Reviewed-on: https://chromium-review.googlesource.com/351783 Commit-Ready: Vadim Bendebury Tested-by: Vadim Bendebury Reviewed-by: Vadim Bendebury --- src/mainboard/google/gru/mainboard.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/mainboard/google/gru/mainboard.c b/src/mainboard/google/gru/mainboard.c index 69d9d76fd7..e398cd96a3 100644 --- a/src/mainboard/google/gru/mainboard.c +++ b/src/mainboard/google/gru/mainboard.c @@ -18,7 +18,9 @@ #include #include #include +#include #include +#include #include #include #include @@ -166,6 +168,17 @@ static void setup_usb(void) setup_usb_drd1_dwc3(); } +static void setup_rtc(void) +{ + struct rtc_time time; + int ret; + + /* Show the current time to see that the EC RTC is working */ + google_chromeec_init(); + ret = rtc_get(&time); + rtc_display(&time); +} + static void mainboard_init(device_t dev) { configure_sdmmc(); @@ -175,6 +188,7 @@ static void mainboard_init(device_t dev) setup_usb(); register_reset_to_bl31(); register_poweroff_to_bl31(); + setup_rtc(); } static void enable_backlight_booster(void)