summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSteven J. Magnani <steve@digidescorp.com>2005-09-12 18:43:27 +0000
committerSteven J. Magnani <steve@digidescorp.com>2005-09-12 18:43:27 +0000
commit8cbc4751d1991f02efdefcaa8c91c187bbc1d987 (patch)
tree5ac367e2c5f31a35c4579d696a18837276e1fe8b /src
parentd94e1d6e9dc794401041e0eb4de20c741d3ac71b (diff)
downloadcoreboot-8cbc4751d1991f02efdefcaa8c91c187bbc1d987.tar.xz
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
Diffstat (limited to 'src')
-rw-r--r--src/pc80/mc146818rtc.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/pc80/mc146818rtc.c b/src/pc80/mc146818rtc.c
index cc37f04f85..e182955e65 100644
--- a/src/pc80/mc146818rtc.c
+++ b/src/pc80/mc146818rtc.c
@@ -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);
}