drivers/pc80/rtc/option.c: Allow CMOS defaults to extend to bank 1

CMOS defaults greater than 128 bytes long will extend to bank 1.

Change-Id: I9ee8364d01dd8520be101de3f83d2302d50c7283
Signed-off-by: Jonathon Hall <jonathon.hall@puri.sm>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/74902
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
This commit is contained in:
Jonathon Hall 2023-05-01 10:19:56 -04:00 committed by Matt DeVillier
parent d6e0a90aa0
commit e12b313844
1 changed files with 2 additions and 1 deletions

View File

@ -211,7 +211,8 @@ void sanitize_cmos(void)
return;
u8 control_state = cmos_disable_rtc();
for (i = 14; i < MIN(128, length); i++)
/* Max length of 256 spans bank 0 and bank 1 */
for (i = 14; i < MIN(256, length); i++)
cmos_write_inner(cmos_default[i], i);
cmos_restore_rtc(control_state);
}