diff --git a/src/drivers/intel/fsp2_0/Kconfig b/src/drivers/intel/fsp2_0/Kconfig index c5c485bad2..42551503ff 100644 --- a/src/drivers/intel/fsp2_0/Kconfig +++ b/src/drivers/intel/fsp2_0/Kconfig @@ -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 diff --git a/src/lib/Makefile.mk b/src/lib/Makefile.mk index 93e76d4af3..5e1e81a5d0 100644 --- a/src/lib/Makefile.mk +++ b/src/lib/Makefile.mk @@ -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))