blob: af8c7832ac075f8e25f81767ab26536b6b2bc474 [file] [log] [blame]
Jeremy Compostellae3884a12023-01-19 11:41:30 -07001/* SPDX-License-Identifier: GPL-2.0-only */
2
3#include <console/console.h>
4#include <intelblocks/early_graphics.h>
5#include <pc80/vga.h>
Hsuan Ting Chen3c2cdb62023-05-02 17:55:50 +08006#include <ux_locales.h>
Jeremy Compostellae3884a12023-01-19 11:41:30 -07007
8#include "ux.h"
9
Hsuan Ting Chen3c2cdb62023-05-02 17:55:50 +080010#define UX_MEMORY_TRAINING_DESC "memory_training_desc"
11
Tarun Tulieed31cb2023-01-31 18:14:35 +000012bool ux_inform_user_of_update_operation(const char *name)
Jeremy Compostellae3884a12023-01-19 11:41:30 -070013{
14 if (!CONFIG(MAINBOARD_HAS_EARLY_LIBGFXINIT) ||
15 !early_graphics_init())
Tarun Tulieed31cb2023-01-31 18:14:35 +000016 return false;
Jeremy Compostellae3884a12023-01-19 11:41:30 -070017
18 printk(BIOS_INFO, "Informing user on-display of %s.\n", name);
Hsuan Ting Chen3c2cdb62023-05-02 17:55:50 +080019
20 const char *text = ux_locales_get_text(UX_MEMORY_TRAINING_DESC);
21 /* No localized text found; fallback to built-in English. */
22 if (!text)
23 text = "Your device is finishing an update. "
Hsuan Ting Chen26a95552023-02-20 11:49:35 +080024 "This may take 1-2 minutes.\n"
Hsuan Ting Chen3c2cdb62023-05-02 17:55:50 +080025 "Please do not turn off your device.";
26 vga_write_text(VGA_TEXT_CENTER, VGA_TEXT_HORIZONTAL_MIDDLE,
27 (const unsigned char *)text);
28 ux_locales_unmap();
Tarun Tulieed31cb2023-01-31 18:14:35 +000029 return true;
Jeremy Compostellae3884a12023-01-19 11:41:30 -070030}