From 0990fbf2d9b8a0070866788b185bdd4bf6e5537e Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Fri, 15 Sep 2017 15:23:04 -0600 Subject: vboot: reset vbnv in cmos when cmos failure occurs There's an occasional issue on machines which use CMOS for their vbnv storage. The machine that just powers up from complete G3 would have had their RTC rail not held up. The contents of vbnv in CMOS could pass the crc8 though the values could be bad. In order to fix this introduce two functions: 1. vbnv_init_cmos() 2. vbnv_cmos_failed() At the start of vboot the CMOS is queried for failure. If there is a failure indicated then the vbnv data is restored from flash backup or reset to known values when there is no flash backup. BUG=b:63054105 Change-Id: I8bd6f28f64a116b84a08ce4779cd4dc73c0f2f3d Signed-off-by: Aaron Durbin Reviewed-on: https://review.coreboot.org/21560 Tested-by: build bot (Jenkins) Reviewed-by: Julius Werner Reviewed-by: Furquan Shaikh --- src/mainboard/intel/galileo/vboot.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/mainboard') diff --git a/src/mainboard/intel/galileo/vboot.c b/src/mainboard/intel/galileo/vboot.c index ffea7698b0..b0fa2f2956 100644 --- a/src/mainboard/intel/galileo/vboot.c +++ b/src/mainboard/intel/galileo/vboot.c @@ -25,6 +25,7 @@ #include "gen2.h" #include #include +#include int clear_recovery_mode_switch(void) { @@ -98,3 +99,9 @@ void __attribute__((weak)) vboot_platform_prepare_reboot(void) /* Reset the TPM */ reg_script_run(script); } + +int vbnv_cmos_failed(void) +{ + /* Indicate no failure until RTC failure bits are supported. */ + return 0; +} -- cgit v1.2.3