RTC: Add a routine to check if the CMOS date is valid
commita1e6a9c25a1d897fbb06f634bbee6e7983a95524
authorzbao <fishbaozi@gmail.com>
Thu, 2 Aug 2012 11:02:26 +0000 (2 19:02 +0800)
committerStefan Reinauer <stefan.reinauer@coreboot.org>
Thu, 2 Aug 2012 21:40:09 +0000 (2 23:40 +0200)
tree0d8617a90978ddc546582ba1e98dc3131c6dd77f
parentd462736dfbedba7daec0c9812470a88a535b7c43
RTC: Add a routine to check if the CMOS date is valid

If the CMOS is cleared or someone writes some random date/time
on purpose, the CMOS date register has a invalid date. This will
hurts some OS, like Windows 7, which hangs at MS logo forever.
When we detect that, we need to write a reasonable date in CMOS.

Alexandru Gagniuc:
Hmm, it would be interesting to use the date the coreboot image
was built and set that as the default date. At least until time
travel is invented.

Change-Id: Ic1c7a2d60e711265686441c77bdf7891a7efb42e
Signed-off-by: Zheng Bao <zheng.bao@amd.com>
Signed-off-by: zbao <fishbaozi@gmail.com>
Reviewed-on: http://review.coreboot.org/1389
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
src/drivers/pc80/mc146818rtc.c
src/include/pc80/mc146818rtc.h