Subrata Banik has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/86278?usp=email )
Change subject: soc/intel/alderlake: Use helper for UX messages ......................................................................
soc/intel/alderlake: Use helper for UX messages
This commit introduces `ux_inform_user_of_operation` to reduce code duplication when displaying UX messages.
`ux_inform_user_of_update_operation` now calls this helper, passing the descriptor and default text. This allows easier addition of other UX messages.
BUG=b:339673254 TEST=Built and booted google/brox. Verified display eSOL.
Change-Id: Ib31f7633e7b3f84122419e4ce39e2b5044cb9a96 Signed-off-by: Subrata Banik subratabanik@google.com --- M src/soc/intel/alderlake/romstage/ux.c 1 file changed, 12 insertions(+), 5 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/78/86278/1
diff --git a/src/soc/intel/alderlake/romstage/ux.c b/src/soc/intel/alderlake/romstage/ux.c index 0fb73c18..2e25dbf 100644 --- a/src/soc/intel/alderlake/romstage/ux.c +++ b/src/soc/intel/alderlake/romstage/ux.c @@ -9,8 +9,12 @@ #include "ux.h"
#define UX_MEMORY_TRAINING_DESC "memory_training_desc" +#define UX_MEMORY_TRAINING_MSG "Your device is finishing an update. " \ + "This may take 1-2 minutes.\n" \ + "Please do not turn off your device."
-bool ux_inform_user_of_update_operation(const char *name) +static bool ux_inform_user_of_operation(const char *name, const char *ux_locale_desc, + const char *default_text) { timestamp_add_now(TS_ESOL_START);
@@ -22,15 +26,18 @@
printk(BIOS_INFO, "Informing user on-display of %s.\n", name);
- const char *text = ux_locales_get_text(UX_MEMORY_TRAINING_DESC); + const char *text = ux_locales_get_text(ux_locale_desc); /* No localized text found; fallback to built-in English. */ if (!text) - text = "Your device is finishing an update. " - "This may take 1-2 minutes.\n" - "Please do not turn off your device."; + text = default_text; vga_write_text(VGA_TEXT_CENTER, VGA_TEXT_HORIZONTAL_MIDDLE, (const unsigned char *)text); ux_locales_unmap(); timestamp_add_now(TS_ESOL_END); return true; } + +bool ux_inform_user_of_update_operation(const char *name) +{ + return ux_inform_user_of_operation(name, UX_MEMORY_TRAINING_DESC, UX_MEMORY_TRAINING_MSG); +}