summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2023-01-20 22:23:20 +0300
committerTom Rini <trini@konsulko.com>2023-01-20 22:23:20 +0300
commitdd31cd58b02729807934cb699b164b1f8736620f (patch)
tree58d933861545e5950932f2911109610b98397a8e /lib
parent0b9b01517f0b1398ec27dbb47faf3645b719e02c (diff)
parente10fffe8b56f4430e0e242977bfa67ab589b8235 (diff)
downloadu-boot-dd31cd58b02729807934cb699b164b1f8736620f.tar.xz
Merge tag 'efi-2023-04-rc1-2' of https://source.denx.de/u-boot/custodians/u-boot-efi
Pull request for efi-2023-04-rc1-2 Documentation * man-pages for source, blkcache, bdinfo * fix references to distro documentation UEFI: * allow clear screen by scrolling * ensure that file ubootefi.var is created * fix CapsuleMax variable reporting Others: * reduce verbosity of fat_read_file()
Diffstat (limited to 'lib')
-rw-r--r--lib/efi_loader/Kconfig9
-rw-r--r--lib/efi_loader/efi_console.c19
-rw-r--r--lib/efi_loader/efi_setup.c2
-rw-r--r--lib/efi_loader/efi_tcg2.c2
-rw-r--r--lib/efi_loader/efi_variable.c8
5 files changed, 34 insertions, 6 deletions
diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig
index b630d88ef9..c56904afc2 100644
--- a/lib/efi_loader/Kconfig
+++ b/lib/efi_loader/Kconfig
@@ -124,6 +124,15 @@ config EFI_SET_TIME
Provide the SetTime() runtime service at boottime. This service
can be used by an EFI application to adjust the real time clock.
+config EFI_SCROLL_ON_CLEAR_SCREEN
+ bool "Avoid overwriting previous output on clear screen"
+ help
+ Instead of erasing the screen content when the console screen should
+ be cleared, emit blank new lines so that previous output is scrolled
+ out of sight rather than overwritten. On serial consoles this allows
+ to capture complete boot logs (except for interactive menus etc.)
+ and can ease debugging related issues.
+
config EFI_HAVE_CAPSULE_SUPPORT
bool
diff --git a/lib/efi_loader/efi_console.c b/lib/efi_loader/efi_console.c
index 4d08dd3763..1ed8c7aa36 100644
--- a/lib/efi_loader/efi_console.c
+++ b/lib/efi_loader/efi_console.c
@@ -461,10 +461,21 @@ static efi_status_t EFIAPI efi_cout_set_attribute(
}
/**
- * efi_cout_clear_screen() - clear screen
+ * efi_clear_screen() - clear screen
*/
static void efi_clear_screen(void)
{
+ if (CONFIG_IS_ENABLED(EFI_SCROLL_ON_CLEAR_SCREEN)) {
+ unsigned int row, screen_rows, screen_columns;
+
+ /* Avoid overwriting previous outputs on streaming consoles */
+ screen_rows = efi_cout_modes[efi_con_mode.mode].rows;
+ screen_columns = efi_cout_modes[efi_con_mode.mode].columns;
+ printf(ESC "[%u;%uH", screen_rows, screen_columns);
+ for (row = 1; row < screen_rows; row++)
+ printf("\n");
+ }
+
/*
* The Linux console wants both a clear and a home command. The video
* uclass does not support <ESC>[H without coordinates, yet.
@@ -489,6 +500,12 @@ static efi_status_t EFIAPI efi_cout_clear_screen(
{
EFI_ENTRY("%p", this);
+ /* Set default colors if not done yet */
+ if (efi_con_mode.attribute == 0) {
+ efi_con_mode.attribute = 0x07;
+ printf(ESC "[0;37;40m");
+ }
+
efi_clear_screen();
return EFI_EXIT(EFI_SUCCESS);
diff --git a/lib/efi_loader/efi_setup.c b/lib/efi_loader/efi_setup.c
index 5437641135..f0f01d3b1d 100644
--- a/lib/efi_loader/efi_setup.c
+++ b/lib/efi_loader/efi_setup.c
@@ -128,7 +128,7 @@ static efi_status_t efi_init_capsule(void)
{
efi_status_t ret = EFI_SUCCESS;
- if (IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_UPDATE)) {
+ if (IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT)) {
ret = efi_set_variable_int(u"CapsuleMax",
&efi_guid_capsule_report,
EFI_VARIABLE_READ_ONLY |
diff --git a/lib/efi_loader/efi_tcg2.c b/lib/efi_loader/efi_tcg2.c
index a525ebf75b..918e9a2686 100644
--- a/lib/efi_loader/efi_tcg2.c
+++ b/lib/efi_loader/efi_tcg2.c
@@ -2417,7 +2417,7 @@ efi_status_t efi_tcg2_register(void)
ret = platform_get_tpm2_device(&dev);
if (ret != EFI_SUCCESS) {
- log_warning("Unable to find TPMv2 device\n");
+ log_warning("Missing TPMv2 device for EFI_TCG_PROTOCOL\n");
return EFI_SUCCESS;
}
diff --git a/lib/efi_loader/efi_variable.c b/lib/efi_loader/efi_variable.c
index 503a33ed65..7c32adf6e5 100644
--- a/lib/efi_loader/efi_variable.c
+++ b/lib/efi_loader/efi_variable.c
@@ -334,9 +334,11 @@ efi_status_t efi_set_variable_int(const u16 *variable_name,
else
ret = EFI_SUCCESS;
- /* Write non-volatile EFI variables to file */
- if (attributes & EFI_VARIABLE_NON_VOLATILE &&
- ret == EFI_SUCCESS && efi_obj_list_initialized == EFI_SUCCESS)
+ /*
+ * Write non-volatile EFI variables to file
+ * TODO: check if a value change has occured to avoid superfluous writes
+ */
+ if (attributes & EFI_VARIABLE_NON_VOLATILE)
efi_var_to_file();
return EFI_SUCCESS;