Attention is currently required from: Intel coreboot Reviewers.
Subrata Banik has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/86419?usp=email )
Change subject: soc/intel/common/reset: Add low battery indicator delay ......................................................................
soc/intel/common/reset: Add low battery indicator delay
This commit adds a delay to the `do_low_battery_poweroff()` function, allowing time for the low battery indicator to be displayed before powering off. The delay is configurable through the `PLATFORM_LOW_BATTERY_SHUTDOWN_DELAY_SEC` Kconfig option.
Additionally, a low battery indicator event is logged using `elog` before the delay.
This functionality is enabled when the `PLATFORM_HAS_LOW_BATTERY_INDICATOR` Kconfig option is selected.
BUG=b:339673254 TEST=Able to build and boot google/brox.
Change-Id: I56bff7af8c9ddd9b34d19d2c0b6a76172eff3f31 Signed-off-by: Subrata Banik subratabanik@google.com --- M src/soc/intel/common/reset.c 1 file changed, 7 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/19/86419/1
diff --git a/src/soc/intel/common/reset.c b/src/soc/intel/common/reset.c index 4cbf996..3fefa57 100644 --- a/src/soc/intel/common/reset.c +++ b/src/soc/intel/common/reset.c @@ -3,6 +3,8 @@ #include <arch/cache.h> #include <cf9_reset.h> #include <console/console.h> +#include <delay.h> +#include <elog.h> #include <halt.h> #include <reset.h>
@@ -24,5 +26,10 @@
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); + } + poweroff(); }