From a8b03da4a8e301c6659398431ab3e6a6ffa7a1c1 Mon Sep 17 00:00:00 2001 From: Werner Zeh Date: Mon, 9 Feb 2015 08:17:40 +0100 Subject: [PATCH] drivers/pc80/mc146818rtc: Enable RTC reset on power loss If function cmos_init() was called with parameter invalid set, this indicates, that the caller has found a power loss event in the RTC registers. In this case, we need to load the default date and time because it can be corrupted. Change-Id: Ib8d58a14da0182ceb8167e67440a0f1ea2a20eb7 Signed-off-by: Werner Zeh Reviewed-on: http://review.coreboot.org/8373 Reviewed-by: Alexandru Gagniuc Tested-by: build bot (Jenkins) --- src/drivers/pc80/mc146818rtc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/drivers/pc80/mc146818rtc.c b/src/drivers/pc80/mc146818rtc.c index fe669caa98..4f034a2db6 100644 --- a/src/drivers/pc80/mc146818rtc.c +++ b/src/drivers/pc80/mc146818rtc.c @@ -86,7 +86,7 @@ static void cmos_set_checksum(int range_start, int range_end, int cks_loc) #ifndef __SMM__ void cmos_init(bool invalid) { - bool cmos_invalid = false; + bool cmos_invalid = invalid; bool checksum_invalid = false; bool clear_cmos; size_t i;