Move TPM code to romstage
[coreboot.git] / src / pc80 / mc146818rtc_early.c
index ed1f0926f0ab72c24d544f0e37f43f630cdd39f0..0652f27c47ff5967eb4a270e8fc37de4b2775b22 100644 (file)
@@ -1,5 +1,9 @@
+#include <stdint.h>
 #include <pc80/mc146818rtc.h>
 #include <fallback.h>
+#if CONFIG_USE_OPTION_TABLE
+#include "option_table.h"
+#endif
 
 #ifndef CONFIG_MAX_REBOOT_CNT
 #error "CONFIG_MAX_REBOOT_CNT not defined"
@@ -20,13 +24,12 @@ static int cmos_chksum_valid(void)
 {
 #if CONFIG_USE_OPTION_TABLE
        unsigned char addr;
-       unsigned long sum, old_sum;
+       u16 sum, old_sum;
        sum = 0;
-       /* Comput the cmos checksum */
+       /* Compute the cmos checksum */
        for(addr = LB_CKS_RANGE_START; addr <= LB_CKS_RANGE_END; addr++) {
                sum += cmos_read(addr);
        }
-       sum = (sum & 0xffff) ^ 0xffff;
 
        /* Read the stored checksum */
        old_sum = cmos_read(LB_CKS_LOC) << 8;
@@ -89,7 +92,7 @@ static inline int do_normal_boot(void)
        return (byte & (1<<1));
 }
 
-unsigned read_option(unsigned start, unsigned size, unsigned def)
+unsigned read_option_lowlevel(unsigned start, unsigned size, unsigned def)
 {
 #if CONFIG_USE_OPTION_TABLE
        unsigned byte;