From d87dfc0c389563e4bac3c2726adce4f4800aad06 Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Fri, 14 Oct 2011 15:24:03 -0700 Subject: [PATCH] Fix our CMOS checksum algorithm so it matches what /dev/nvram expects Our cmos checksum is inverted to what the Linux /dev/nvram device expects (and BIOSes use). This makes it impossible to use /dev/nvram with coreboot. Fix it! Change-Id: I239f7e3aca05d3691aee16490dd801df2ccaefd1 Signed-off-by: Vadim Bendebury Signed-off-by: Stefan Reinauer Reviewed-on: http://review.coreboot.org/279 Tested-by: build bot (Jenkins) Reviewed-by: Marc Jones --- src/pc80/mc146818rtc.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pc80/mc146818rtc.c b/src/pc80/mc146818rtc.c index f3bee9bdc..034957acf 100644 --- a/src/pc80/mc146818rtc.c +++ b/src/pc80/mc146818rtc.c @@ -98,7 +98,6 @@ static void rtc_set_checksum(int range_start, int range_end, int cks_loc) for(i = range_start; i <= range_end; i++) { sum += cmos_read(i); } - sum = ~(sum & 0x0ffff); cmos_write(((sum >> 8) & 0x0ff), cks_loc); cmos_write(((sum >> 0) & 0x0ff), cks_loc+1); } -- 2.25.1