summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMartin Roth <martinroth@google.com>2018-03-31 22:52:51 -0500
committerAaron Durbin <adurbin@chromium.org>2018-04-02 21:03:34 +0000
commitd738749d475663716b7036ab5fb2a1d91a87f6e6 (patch)
tree399564026114c28fae2263bbb77cc3bebc5aaea7 /src
parent8dce5bcca5cdb2c34f394508ce5c9b63bf063ae8 (diff)
downloadcoreboot-d738749d475663716b7036ab5fb2a1d91a87f6e6.tar.xz
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 <martinroth@google.com> Reviewed-on: https://review.coreboot.org/25468 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Marc Jones <marc@marcjonesconsulting.com> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src')
-rw-r--r--src/soc/amd/stoneyridge/pmutil.c5
1 files changed, 3 insertions, 2 deletions
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 <soc/southbridge.h>
#include <security/vboot/vboot_common.h>
#include <security/vboot/vbnv.h>
+#include <pc80/mc146818rtc.h>
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)