From 686018988c5f5416945c6fd2faad9953d86d66d6 Mon Sep 17 00:00:00 2001 From: Werner Zeh Date: Tue, 25 May 2021 14:26:06 +0200 Subject: drivers/pc80/mc146818rtc: Check date and time for sanity There are cases where the RTC_VRT bit in register D stays set after a power failure while the real date and time registers can contain rubbish values (can happen when RTC is not buffered). If we do not detect this invalid date and/or time here and keep it, Linux will use these bad values for the initial timekeeper init. This in turn can lead to dates before 1970 in user land which can break a lot assumptions. To fix this, check date and time sanity when the RTC is initialized and reset the values if needed. Change-Id: I5bc600c78bab50c70372600347f63156df127012 Signed-off-by: Werner Zeh Reviewed-on: https://review.coreboot.org/c/coreboot/+/54914 Reviewed-by: Arthur Heymans Reviewed-by: Paul Menzel Tested-by: build bot (Jenkins) --- src/lib/Makefile.inc | 1 + 1 file changed, 1 insertion(+) (limited to 'src/lib') diff --git a/src/lib/Makefile.inc b/src/lib/Makefile.inc index 358035d9d8..baf9c4d651 100644 --- a/src/lib/Makefile.inc +++ b/src/lib/Makefile.inc @@ -59,6 +59,7 @@ bootblock-y += memchr.c bootblock-y += memcmp.c bootblock-y += boot_device.c bootblock-y += fmap.c +bootblcok-y += rtc.c verstage-y += prog_loaders.c verstage-y += prog_ops.c -- cgit v1.2.3