From 546707da25f0c0837bc25c44e2e434646702b99d Mon Sep 17 00:00:00 2001 From: Subrata Banik Date: Thu, 5 Feb 2026 11:59:25 +0530 Subject: [PATCH] lib: Generalize low-battery shutdown delay to post-render delay MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The existing PLATFORM_LOW_BATTERY_SHUTDOWN_DELAY_SEC was strictly tied to the low-battery indicator logic. This change renames and generalizes the configuration to PLATFORM_POST_RENDER_DELAY_SEC. By moving this out of the low-battery specific conditional block in Kconfig, the delay can now be utilized more broadly. While it still ensures the low-battery warning remains visible before power-off, it can now also be used to ensure display synchronization or user notifications are visible before passing control to the OS in normal boot flows. Updated Intel common reset logic to utilize the renamed config. BUG=b:473480933 TEST=Verified that low-battery shutdown still respects the 5-second default delay on target hardware. Change-Id: I0277ea278fb299499f6eab2be983761a8f6ba536 Signed-off-by: Subrata Banik Reviewed-on: https://review.coreboot.org/c/coreboot/+/91104 Reviewed-by: Jérémy Compostella Tested-by: build bot (Jenkins) --- src/lib/Kconfig | 15 ++++++++------- src/soc/intel/common/reset.c | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/lib/Kconfig b/src/lib/Kconfig index 6407c82cfa..0c8fc454ff 100644 --- a/src/lib/Kconfig +++ b/src/lib/Kconfig @@ -229,16 +229,17 @@ config PLATFORM_HAS_LOW_BATTERY_INDICATOR This option requires that the system have a display and that the BMP_LOGO option is enabled. -if PLATFORM_HAS_LOW_BATTERY_INDICATOR - -config PLATFORM_LOW_BATTERY_SHUTDOWN_DELAY_SEC +config PLATFORM_POST_RENDER_DELAY_SEC int default 5 help - Delay, in seconds, before system shutdown due to low battery. - This delay allows the user to observe the low-battery indicator. - The default value of 5 seconds aligns with standard user experience (UX) practices. - Platforms may override this value based on specific product requirements. + Delay, in seconds, after rendering a splash screen element. + In low-battery mode, this ensures the warning is visible before shutdown. + In normal modes, this can be used to ensure the display has finished + teardown/synchronization after user notification before passing control + to the OS. + +if PLATFORM_HAS_LOW_BATTERY_INDICATOR config PLATFORM_HAS_EARLY_LOW_BATTERY_INDICATOR bool "Display low battery indicator in romstage" diff --git a/src/soc/intel/common/reset.c b/src/soc/intel/common/reset.c index 307be5769a..40cea6bccc 100644 --- a/src/soc/intel/common/reset.c +++ b/src/soc/intel/common/reset.c @@ -28,7 +28,7 @@ void do_low_battery_poweroff(void) { if (CONFIG(PLATFORM_HAS_LOW_BATTERY_INDICATOR)) { elog_add_event_byte(ELOG_TYPE_LOW_BATTERY_INDICATOR, ELOG_FW_ISSUE_SHUTDOWN); - delay(CONFIG_PLATFORM_LOW_BATTERY_SHUTDOWN_DELAY_SEC); + delay(CONFIG_PLATFORM_POST_RENDER_DELAY_SEC); } poweroff();