From e5949cfef846f969c7631c2661230a14cb424b0a Mon Sep 17 00:00:00 2001 From: Subrata Banik Date: Thu, 30 Jan 2025 09:49:48 +0000 Subject: [PATCH] soc/intel/alderlake: Display low battery message on screen MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit adds a function ux_inform_user_of_poweroff_operation to display a message on the screen when the system is powering off due to critically low battery. The message is centered on the screen and displays a localized string "Battery critically low. Shutting down.". If no localized string is found, a default English message is displayed. This implementation relies on CHROMEOS_ENABLE_ESOL Kconfig which is used to render text message for early sign-of-life. BUG=b:339673254 TEST=Able to capture the eventlog for low battery boot event. Change-Id: I3b24d2c89ade8cc62b7e47c487d52d47b7f3376d Signed-off-by: Subrata Banik Reviewed-on: https://review.coreboot.org/c/coreboot/+/86224 Reviewed-by: Karthik Ramasubramanian Reviewed-by: Jérémy Compostella Reviewed-by: Julius Werner Reviewed-by: Dinesh Gehlot Tested-by: build bot (Jenkins) --- src/soc/intel/alderlake/romstage/ux.c | 5 +++++ src/soc/intel/alderlake/romstage/ux.h | 1 + 2 files changed, 6 insertions(+) diff --git a/src/soc/intel/alderlake/romstage/ux.c b/src/soc/intel/alderlake/romstage/ux.c index 4e647275ce..03e6acdaa5 100644 --- a/src/soc/intel/alderlake/romstage/ux.c +++ b/src/soc/intel/alderlake/romstage/ux.c @@ -32,3 +32,8 @@ bool ux_inform_user_of_update_operation(const char *name) { return ux_inform_user_of_operation(name, UX_LOCALE_MSG_MEMORY_TRAINING); } + +bool ux_inform_user_of_poweroff_operation(const char *name) +{ + return ux_inform_user_of_operation(name, UX_LOCALE_MSG_LOW_BATTERY); +} diff --git a/src/soc/intel/alderlake/romstage/ux.h b/src/soc/intel/alderlake/romstage/ux.h index 14c10e7ffd..c556c63df1 100644 --- a/src/soc/intel/alderlake/romstage/ux.h +++ b/src/soc/intel/alderlake/romstage/ux.h @@ -4,5 +4,6 @@ #define _SOC_INTEL_ALDERLAKE_ROMSTAGE_UX_H_ bool ux_inform_user_of_update_operation(const char *name); +bool ux_inform_user_of_poweroff_operation(const char *name); #endif /* _SOC_INTEL_ALDERLAKE_ROMSTAGE_UX_H_ */