1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 3 #include <console/console.h> 4 #include <intelblocks/early_graphics.h> 5 #include <pc80/vga.h> 6 #include <timestamp.h> 7 #include <ux_locales.h> 8 9 #include "ux.h" 10 11 #define UX_MEMORY_TRAINING_DESC "memory_training_desc" 12 ux_inform_user_of_update_operation(const char * name)13bool ux_inform_user_of_update_operation(const char *name) 14 { 15 timestamp_add_now(TS_ESOL_START); 16 17 if (!CONFIG(MAINBOARD_HAS_EARLY_LIBGFXINIT) || 18 !early_graphics_init()) { 19 timestamp_add_now(TS_ESOL_END); 20 return false; 21 } 22 23 printk(BIOS_INFO, "Informing user on-display of %s.\n", name); 24 25 const char *text = ux_locales_get_text(UX_MEMORY_TRAINING_DESC); 26 /* No localized text found; fallback to built-in English. */ 27 if (!text) 28 text = "Your device is finishing an update. " 29 "This may take 1-2 minutes.\n" 30 "Please do not turn off your device."; 31 vga_write_text(VGA_TEXT_CENTER, VGA_TEXT_HORIZONTAL_MIDDLE, 32 (const unsigned char *)text); 33 ux_locales_unmap(); 34 timestamp_add_now(TS_ESOL_END); 35 return true; 36 } 37