rework RTC driver output to make it more consistent.

Also add a meaningful define (Not hooked up in Kconfig, that might
or might not follow)

Change-Id: I9cc4bca0d23d75e6a1d767932ec62e8c68b39d71
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/278
Tested-by: build bot (Jenkins)
Reviewed-by: Marc Jones <marcj303@gmail.com>
This commit is contained in:
Stefan Reinauer 2011-10-14 15:22:52 -07:00 committed by Stefan Reinauer
parent fbadc499a6
commit 1babddb202
1 changed files with 8 additions and 5 deletions

View File

@ -132,12 +132,14 @@ void rtc_init(int invalid)
checksum_invalid = !rtc_checksum_valid(PC_CKS_RANGE_START, checksum_invalid = !rtc_checksum_valid(PC_CKS_RANGE_START,
PC_CKS_RANGE_END,PC_CKS_LOC); PC_CKS_RANGE_END,PC_CKS_LOC);
#define CLEAR_CMOS 0
if (invalid || cmos_invalid || checksum_invalid) { if (invalid || cmos_invalid || checksum_invalid) {
printk(BIOS_WARNING, "RTC:%s%s%s zeroing cmos\n", printk(BIOS_WARNING, "RTC:%s%s%s%s\n",
invalid?" Clear requested":"", invalid?" Clear requested":"",
cmos_invalid?" Power Problem":"", cmos_invalid?" Power Problem":"",
checksum_invalid?" Checksum invalid":""); checksum_invalid?" Checksum invalid":"",
#if 0 CLEAR_CMOS?" zeroing cmos":"");
#if CLEAR_CMOS
cmos_write(0, 0x01); cmos_write(0, 0x01);
cmos_write(0, 0x03); cmos_write(0, 0x03);
cmos_write(0, 0x05); cmos_write(0, 0x05);
@ -169,7 +171,7 @@ void rtc_init(int invalid)
checksum_invalid = !rtc_checksum_valid(LB_CKS_RANGE_START, checksum_invalid = !rtc_checksum_valid(LB_CKS_RANGE_START,
LB_CKS_RANGE_END,LB_CKS_LOC); LB_CKS_RANGE_END,LB_CKS_LOC);
if(checksum_invalid) if(checksum_invalid)
printk(BIOS_DEBUG, "Invalid CMOS LB checksum\n"); printk(BIOS_DEBUG, "RTC: coreboot checksum invalid\n");
/* Make certain we have a valid checksum */ /* Make certain we have a valid checksum */
rtc_set_checksum(PC_CKS_RANGE_START, rtc_set_checksum(PC_CKS_RANGE_START,
@ -229,7 +231,8 @@ int get_option(void *dest, const char *name)
/* find the requested entry record */ /* find the requested entry record */
ct=cbfs_find_file("cmos_layout.bin", CBFS_COMPONENT_CMOS_LAYOUT); ct=cbfs_find_file("cmos_layout.bin", CBFS_COMPONENT_CMOS_LAYOUT);
if (!ct) { if (!ct) {
printk(BIOS_ERR, "cmos_layout.bin could not be found. Options are disabled\n"); printk(BIOS_ERR, "RTC: cmos_layout.bin could not be found. "
"Options are disabled\n");
return(-2); return(-2);
} }
ce=(struct cmos_entries*)((unsigned char *)ct + ct->header_length); ce=(struct cmos_entries*)((unsigned char *)ct + ct->header_length);