Since some people disapprove of white space cleanups mixed in regular commits
[coreboot.git] / src / pc80 / mc146818rtc_early.c
index 7a1492102a77bd6abe6812f1ee8c46608c0af012..fa1f388804b5ac0812827eee607ae3f5946ff695 100644 (file)
@@ -1,5 +1,8 @@
 #include <pc80/mc146818rtc.h>
 #include <fallback.h>
+#if CONFIG_HAVE_OPTION_TABLE
+#include <option_table.h>
+#endif
 
 #ifndef CONFIG_MAX_REBOOT_CNT
 #error "CONFIG_MAX_REBOOT_CNT not defined"
@@ -40,6 +43,7 @@ static int cmos_error(void)
 
 static int cmos_chksum_valid(void)
 {
+#if CONFIG_HAVE_OPTION_TABLE == 1
        unsigned char addr;
        unsigned long sum, old_sum;
        sum = 0;
@@ -54,6 +58,9 @@ static int cmos_chksum_valid(void)
        old_sum |=  cmos_read(LB_CKS_LOC+1);
 
        return sum == old_sum;
+#else
+       return 0;
+#endif
 }
 
 
@@ -81,7 +88,7 @@ static inline int do_normal_boot(void)
 
        /* The RTC_BOOT_BYTE is now o.k. see where to go. */
        byte = cmos_read(RTC_BOOT_BYTE);
-       
+
        /* Are we in normal mode? */
        if (byte & 1) {
                byte &= 0x0f; /* yes, clear the boot count */