Don't write to CMOS when HAVE_OPTION_TABLE = 0.

git-svn-id: svn://svn.coreboot.org/coreboot/trunk@2025 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
Steven J. Magnani 2005-09-12 18:43:27 +00:00
parent d94e1d6e9d
commit 8cbc4751d1
1 changed files with 12 additions and 4 deletions

View File

@ -127,6 +127,8 @@ void rtc_init(int invalid)
int cmos_invalid, checksum_invalid;
printk_debug("RTC Init\n");
#if HAVE_OPTION_TABLE
/* See if there has been a CMOS power problem. */
x = CMOS_READ(RTC_VALID);
cmos_invalid = !(x & RTC_VRT);
@ -160,19 +162,25 @@ void rtc_init(int invalid)
}
#endif
}
#endif
/* Setup the real time clock */
CMOS_WRITE(RTC_CONTROL_DEFAULT, RTC_CONTROL);
/* Setup the frequency it operates at */
CMOS_WRITE(RTC_FREQ_SELECT_DEFAULT, RTC_FREQ_SELECT);
#if HAVE_OPTION_TABLE
/* See if there is a LB CMOS checksum error */
checksum_invalid = !rtc_checksum_valid(LB_CKS_RANGE_START,
LB_CKS_RANGE_END,LB_CKS_LOC);
if(checksum_invalid)
printk_debug("Invalid CMOS LB checksum\n");
/* Setup the real time clock */
CMOS_WRITE(RTC_CONTROL_DEFAULT, RTC_CONTROL);
/* Setup the frequency it operates at */
CMOS_WRITE(RTC_FREQ_SELECT_DEFAULT, RTC_FREQ_SELECT);
/* Make certain we have a valid checksum */
rtc_set_checksum(PC_CKS_RANGE_START,
PC_CKS_RANGE_END,PC_CKS_LOC);
#endif
/* Clear any pending interrupts */
(void) CMOS_READ(RTC_INTR_FLAGS);
}