Jeremy Compostella | e3884a1 | 2023-01-19 11:41:30 -0700 | [diff] [blame] | 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> |
Hsuan Ting Chen | 3c2cdb6 | 2023-05-02 17:55:50 +0800 | [diff] [blame^] | 6 | #include <ux_locales.h> |
Jeremy Compostella | e3884a1 | 2023-01-19 11:41:30 -0700 | [diff] [blame] | 7 | |
| 8 | #include "ux.h" |
| 9 | |
Hsuan Ting Chen | 3c2cdb6 | 2023-05-02 17:55:50 +0800 | [diff] [blame^] | 10 | #define UX_MEMORY_TRAINING_DESC "memory_training_desc" |
| 11 | |
Tarun Tuli | eed31cb | 2023-01-31 18:14:35 +0000 | [diff] [blame] | 12 | bool ux_inform_user_of_update_operation(const char *name) |
Jeremy Compostella | e3884a1 | 2023-01-19 11:41:30 -0700 | [diff] [blame] | 13 | { |
| 14 | if (!CONFIG(MAINBOARD_HAS_EARLY_LIBGFXINIT) || |
| 15 | !early_graphics_init()) |
Tarun Tuli | eed31cb | 2023-01-31 18:14:35 +0000 | [diff] [blame] | 16 | return false; |
Jeremy Compostella | e3884a1 | 2023-01-19 11:41:30 -0700 | [diff] [blame] | 17 | |
| 18 | printk(BIOS_INFO, "Informing user on-display of %s.\n", name); |
Hsuan Ting Chen | 3c2cdb6 | 2023-05-02 17:55:50 +0800 | [diff] [blame^] | 19 | |
| 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 Chen | 26a9555 | 2023-02-20 11:49:35 +0800 | [diff] [blame] | 24 | "This may take 1-2 minutes.\n" |
Hsuan Ting Chen | 3c2cdb6 | 2023-05-02 17:55:50 +0800 | [diff] [blame^] | 25 | "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 Tuli | eed31cb | 2023-01-31 18:14:35 +0000 | [diff] [blame] | 29 | return true; |
Jeremy Compostella | e3884a1 | 2023-01-19 11:41:30 -0700 | [diff] [blame] | 30 | } |