diff --git a/src/Kconfig b/src/Kconfig index 58c2e07ea9..1a49a8ba55 100644 --- a/src/Kconfig +++ b/src/Kconfig @@ -1563,3 +1563,12 @@ config HAVE_RAMSTAGE config SEPARATE_ROMSTAGE default y + +config POSTPONE_SPI_ACCESS + bool + help + Enable this option to postpone SPI access to later boot phase + (BS_PAYLOAD_BOOT) to prevent flash write access delays caused by + simultaneous accesses from other SPI masters like CSE. This symptom + was found in Intel SoCs (Panther Lake and Wildcat Lake) but it can be + used other SOCs. diff --git a/src/security/vboot/vbnv_cmos.c b/src/security/vboot/vbnv_cmos.c index 5073509fc9..916e1ca03e 100644 --- a/src/security/vboot/vbnv_cmos.c +++ b/src/security/vboot/vbnv_cmos.c @@ -115,5 +115,10 @@ static void back_up_vbnv_cmos(void *unused) /* Save to flash, will only be saved if different. */ save_vbnv_flash(vbnv_cmos); } + +#if CONFIG(POSTPONE_SPI_ACCESS) +BOOT_STATE_INIT_ENTRY(BS_PAYLOAD_LOAD, BS_ON_EXIT, back_up_vbnv_cmos, NULL); +#else BOOT_STATE_INIT_ENTRY(BS_POST_DEVICE, BS_ON_EXIT, back_up_vbnv_cmos, NULL); #endif +#endif