Nico Huber has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/56215 )
Change subject: drivers/pc80/rtc: Make use of legacy BIOS checksum configurable ......................................................................
drivers/pc80/rtc: Make use of legacy BIOS checksum configurable
The legacy BIOS checksum has a fixed location amidst CMOS and often conflicts with our option tables. Oddly, we only ever handle it when USE_OPTION_TABLE is selected. Let's disable it by default and if nobody complains, remove it later.
Change-Id: If6512b019c3cc0441db311a3b590ab67b8db27f3 Signed-off-by: Nico Huber nico.h@gmx.de --- M src/drivers/pc80/rtc/Kconfig M src/drivers/pc80/rtc/mc146818rtc.c 2 files changed, 14 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/15/56215/1
diff --git a/src/drivers/pc80/rtc/Kconfig b/src/drivers/pc80/rtc/Kconfig index 7958682..a8c6f38 100644 --- a/src/drivers/pc80/rtc/Kconfig +++ b/src/drivers/pc80/rtc/Kconfig @@ -9,3 +9,12 @@ depends on DRIVERS_MC146818 help May be useful for legacy OSs that assume its presence. + +config USE_PC_CMOS_CHECKSUM + bool "Maintain legacy-BIOS checksum in CMOS" + default y if !USE_OPTION_TABLE + depends on DRIVERS_MC146818 && USE_OPTION_TABLE + help + May be useful for legacy OSs that assume its presence. Also, + Linux' /dev/nvram checks it (but seems incompatible to our + option table). diff --git a/src/drivers/pc80/rtc/mc146818rtc.c b/src/drivers/pc80/rtc/mc146818rtc.c index e0c2400..a26ae2d 100644 --- a/src/drivers/pc80/rtc/mc146818rtc.c +++ b/src/drivers/pc80/rtc/mc146818rtc.c @@ -86,7 +86,7 @@ /* See if there has been a CMOS power problem. */ cmos_invalid = cmos_error();
- if (CONFIG(USE_OPTION_TABLE)) { + if (CONFIG(USE_PC_CMOS_CHECKSUM)) { /* See if there is a CMOS checksum error */ checksum_invalid = !cmos_checksum_valid(PC_CKS_RANGE_START, PC_CKS_RANGE_END, PC_CKS_LOC); @@ -128,8 +128,10 @@ if (checksum_invalid) printk(BIOS_DEBUG, "RTC: coreboot checksum invalid\n");
- /* Make certain we have a valid checksum */ - cmos_set_checksum(PC_CKS_RANGE_START, PC_CKS_RANGE_END, PC_CKS_LOC); + if (CONFIG(USE_PC_CMOS_CHECKSUM)) { + /* Make certain we have a valid checksum */ + cmos_set_checksum(PC_CKS_RANGE_START, PC_CKS_RANGE_END, PC_CKS_LOC); + } }
/* Clear any pending interrupts */