From e12b313844da92ff91dd0ff47a85c2fd0789a475 Mon Sep 17 00:00:00 2001 From: Jonathon Hall Date: Mon, 1 May 2023 10:19:56 -0400 Subject: [PATCH] drivers/pc80/rtc/option.c: Allow CMOS defaults to extend to bank 1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CMOS defaults greater than 128 bytes long will extend to bank 1. Change-Id: I9ee8364d01dd8520be101de3f83d2302d50c7283 Signed-off-by: Jonathon Hall Reviewed-on: https://review.coreboot.org/c/coreboot/+/74902 Tested-by: build bot (Jenkins) Reviewed-by: Matt DeVillier Reviewed-by: Kyösti Mälkki --- src/drivers/pc80/rtc/option.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/drivers/pc80/rtc/option.c b/src/drivers/pc80/rtc/option.c index e8e2345133..bb295cc3d8 100644 --- a/src/drivers/pc80/rtc/option.c +++ b/src/drivers/pc80/rtc/option.c @@ -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); }