[LinuxBIOS] RE: CMOS options questions
Steven J. Magnani
steve at digidescorp.com
Thu Sep 8 22:12:37 CEST 2005
See http://openbios.org/pipermail/linuxbios/2005-August/012255.html for
an explanation of the issue that spawned this patch. I've run out of
time for a complete solution, so as a compromise I propose a patch that
prevents LB from modifying CMOS when HAVE_OPTION_TABLE = 0:
PATCH:
Don't write to CMOS when HAVE_OPTION_TABLE = 0.
This allows single-image (normal) LinuxBIOS to co-exist with factory
BIOSs
whose CMOS usage is incompatible (i.e. Intel XE7501DevKit).
--- src/pc80/mc146818rtc.c.orig 2005-09-08 13:35:36.312500000 -0500
+++ src/pc80/mc146818rtc.c 2005-09-08 14:10:06.187500000 -0500
@@ -127,6 +127,8 @@
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 @@
}
#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);
}
------------------------------------------------------------------------
Steven J. Magnani "I claim this network for MARS!
www.digidescorp.com Earthling, return my space modulator!"
#include <standard.disclaimer>
More information about the coreboot
mailing list