diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/drivers/pc80/rtc/option.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/drivers/pc80/rtc/option.c b/src/drivers/pc80/rtc/option.c index 0954335762..cb18e14ae9 100644 --- a/src/drivers/pc80/rtc/option.c +++ b/src/drivers/pc80/rtc/option.c @@ -213,9 +213,12 @@ void sanitize_cmos(void) return; u8 control_state = cmos_disable_rtc(); - /* Max length of 256 spans bank 0 and bank 1 */ - for (i = 14; i < MIN(256, length); i++) + /* Copy checked range and the checksum from the default */ + for (i = LB_CKS_RANGE_START; i < MIN(LB_CKS_RANGE_END + 1, length); i++) cmos_write_inner(cmos_default[i], i); + /* CMOS checksum takes 2 bytes */ + cmos_write_inner(cmos_default[LB_CKS_LOC], LB_CKS_LOC); + cmos_write_inner(cmos_default[LB_CKS_LOC + 1], LB_CKS_LOC + 1); cmos_restore_rtc(control_state); } } |