lib: Generalize low-battery shutdown delay to post-render delay
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 <subratabanik@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/91104 Reviewed-by: Jérémy Compostella <jeremy.compostella@intel.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
parent
283359601e
commit
546707da25
2 changed files with 9 additions and 8 deletions
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue