Move TPM code to romstage
[coreboot.git] / src / pc80 / mc146818rtc_early.c
index abddf87661e096b1fd2882cb67503ed9792b7bca..0652f27c47ff5967eb4a270e8fc37de4b2775b22 100644 (file)
@@ -1,3 +1,4 @@
+#include <stdint.h>
 #include <pc80/mc146818rtc.h>
 #include <fallback.h>
 #if CONFIG_USE_OPTION_TABLE
@@ -23,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;