From d738749d475663716b7036ab5fb2a1d91a87f6e6 Mon Sep 17 00:00:00 2001 From: Martin Roth Date: Sat, 31 Mar 2018 22:52:51 -0500 Subject: src/soc/stoneyridge: Add a check for CMOS failure BUG=b:77345148 TEST=Pull power from grunt, verify CMOS power failure is detected. Reboot and verify that CMOS power failure is not detected. Change-Id: Idbf0254e197a6d282e618a98bced52ea5a44917f Signed-off-by: Martin Roth Reviewed-on: https://review.coreboot.org/25468 Reviewed-by: Aaron Durbin Reviewed-by: Marc Jones Reviewed-by: Paul Menzel Tested-by: build bot (Jenkins) --- src/soc/amd/stoneyridge/pmutil.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/soc/amd/stoneyridge/pmutil.c') diff --git a/src/soc/amd/stoneyridge/pmutil.c b/src/soc/amd/stoneyridge/pmutil.c index 25c9ec15c1..baabba5fbb 100644 --- a/src/soc/amd/stoneyridge/pmutil.c +++ b/src/soc/amd/stoneyridge/pmutil.c @@ -17,11 +17,12 @@ #include #include #include +#include int vbnv_cmos_failed(void) { - /* FIXME: RTC failure checking not supported. */ - return 0; + /* If CMOS power has failed, the century will be set to 0xff */ + return cmos_read(RTC_CLK_ALTCENTURY) == 0xff; } int vboot_platform_is_resuming(void) -- cgit v1.2.3