Martin Roth has uploaded this change for review. ( https://review.coreboot.org/25468
Change subject: src/soc/stoneyridge: Add a check for CMOS failure
......................................................................
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(a)google.com>
---
M src/soc/amd/stoneyridge/pmutil.c
1 file changed, 3 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/68/25468/1
diff --git a/src/soc/amd/stoneyridge/pmutil.c b/src/soc/amd/stoneyridge/pmutil.c
index 25c9ec1..baabba5 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)
--
To view, visit https://review.coreboot.org/25468
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Idbf0254e197a6d282e618a98bced52ea5a44917f
Gerrit-Change-Number: 25468
Gerrit-PatchSet: 1
Gerrit-Owner: Martin Roth <martinroth(a)google.com>