diff options
author | Duncan Laurie <dlaurie@chromium.org> | 2012-08-16 16:06:03 -0700 |
---|---|---|
committer | Stefan Reinauer <stefan.reinauer@coreboot.org> | 2012-11-07 18:39:21 +0100 |
commit | 5c103aa8ae56c0758a3e8af11dc70fb62f833f7e (patch) | |
tree | d679e0c68f23f8266a5a134fd51c57ff654529f6 /src/include/pc80 | |
parent | 93ded5905c36d34c4e4f132623c854bbd895b8c9 (diff) | |
download | coreboot-5c103aa8ae56c0758a3e8af11dc70fb62f833f7e.tar.xz |
RTC: Write build date in BCD when clearing RTC CMOS
Check the RTC on boot after RTC battery failure and ensure
that the reported build date matches what is reported:
> grep ^rtc /proc/driver/rtc
rtc_time : 01:00:21
rtc_date : 2012-08-16
Change-Id: If23f436796754c68ae6244ef7633ff4fa0a93603
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: http://review.coreboot.org/1709
Reviewed-by: Marc Jones <marcj303@gmail.com>
Tested-by: build bot (Jenkins)
Diffstat (limited to 'src/include/pc80')
-rw-r--r-- | src/include/pc80/mc146818rtc.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/include/pc80/mc146818rtc.h b/src/include/pc80/mc146818rtc.h index a916761222..61b522ca74 100644 --- a/src/include/pc80/mc146818rtc.h +++ b/src/include/pc80/mc146818rtc.h @@ -63,6 +63,8 @@ # define RTC_24H 0x02 /* 24 hour mode - else hours bit 7 means pm */ # define RTC_DST_EN 0x01 /* auto switch DST - works f. USA only */ +#define RTC_TO_BCD(value) (((value / 10) << 4) | (value % 10)) + /**********************************************************************/ #define RTC_INTR_FLAGS RTC_REG_C /* caution - cleared by read */ |