drivers/intel/fsp2_0: Add low battery indicator screen

This commit adds low battery indicator bitmap into CBFS. This screen
is displayed when the system detects a critically low battery condition.

The screen displays a logo and can be configured with a custom path.

An option to display an early low battery indicator in text mode is also
included. This early indicator can defer the firmware update.

This feature is controlled by the PLATFORM_HAS_LOW_BATTERY_INDICATOR
Kconfig option.

BUG=b:339673254
TEST=Able to see low-battery user notification in text mode before
memory init. Verified low-battery boot event listed in the eventlog.

Change-Id: I711c53455639b449fe85903139bbc06cdab08d09
Signed-off-by: Subrata Banik <subratabanik@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/86225
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
This commit is contained in:
Subrata Banik 2025-02-11 15:16:31 +00:00
commit 1c8a058c08
2 changed files with 52 additions and 0 deletions

View file

@ -522,4 +522,53 @@ config BUILDING_WITH_DEBUG_FSP
Enable this option if you are using a debug build of the FSP (Firmware Support Package)
in your project.
config PLATFORM_HAS_LOW_BATTERY_INDICATOR
bool "Display low battery indicator"
depends on BMP_LOGO
help
If enabled, this option displays a low battery indicator screen. This screen can be
used to warn the user that the battery is low and that they should plug in the device.
This option requires that the system have a display and that the BMP_LOGO option is
enabled.
config PLATFORM_LOW_BATTERY_SHUTDOWN_DELAY_SEC
int
default 5
depends on PLATFORM_HAS_LOW_BATTERY_INDICATOR
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.
config HAVE_ESOL_SUPPORT_FOR_LOW_BATTERY_INDICATOR
bool
depends on FSP_UGOP_EARLY_SIGN_OF_LIFE || MAINBOARD_HAS_EARLY_LIBGFXINIT
help
Enable low-battery indicator support in eSOL.
This option should be selected if the eSOL feature (using either libgfxinit or FSP uGOP)
supports displaying a low-battery indicator.
Platforms selecting `MAINBOARD_HAS_EARLY_LIBGFXINIT` can default enable this option.
For platforms using FSP uGOP, this option should only be enabled if uGOP has implemented
the necessary low-battery handling. This allows platforms to control low-battery
indicator support based on uGOP readiness.
config PLATFORM_HAS_EARLY_LOW_BATTERY_INDICATOR
bool "Display low battery indicator in romstage"
depends on PLATFORM_HAS_LOW_BATTERY_INDICATOR && HAVE_ESOL_SUPPORT_FOR_LOW_BATTERY_INDICATOR
help
If enabled, this option displays a low battery indicator during romstage (before memory
is available) in text mode in the firmware and defer the firmware update. This screen
can be used to warn the user that the battery is low and that they should plug in the
device.
config PLATFORM_LOW_BATTERY_INDICATOR_LOGO_PATH
string "Path to low battery logo file"
depends on PLATFORM_HAS_LOW_BATTERY_INDICATOR
default "3rdparty/blobs/mainboard/\$(MAINBOARDDIR)/low_battery.bmp"
endif

View file

@ -440,3 +440,6 @@ ifneq ($(CONFIG_HAVE_CUSTOM_BMP_LOGO),y)
$(eval $(call add_bmp_logo_file_to_cbfs,CONFIG_BMP_LOGO, logo.bmp,\
CONFIG_FSP2_0_LOGO_FILE_NAME))
endif
$(eval $(call add_bmp_logo_file_to_cbfs,CONFIG_PLATFORM_HAS_LOW_BATTERY_INDICATOR, \
low_battery.bmp,CONFIG_PLATFORM_LOW_BATTERY_INDICATOR_LOGO_PATH))