From 93ce7858e37f84bc0e8c7ef7a1571f54b1799d37 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 6 Nov 2025 15:47:58 +0100 Subject: [PATCH] efi: Allow memory messages to be optional Add a 'verbose' argument to setup_memory() so that the memory messages can be suppressed if desired. For now, keep them as they are. Signed-off-by: Simon Glass --- lib/efi_client/efi_app.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/efi_client/efi_app.c b/lib/efi_client/efi_app.c index 0a817839f26..98702da1cd3 100644 --- a/lib/efi_client/efi_app.c +++ b/lib/efi_client/efi_app.c @@ -90,7 +90,7 @@ int efi_get_mmap(struct efi_mem_desc **descp, int *sizep, uint *keyp, return 0; } -static efi_status_t setup_memory(struct efi_priv *priv) +static efi_status_t setup_memory(struct efi_priv *priv, bool verbose) { struct efi_boot_services *boot = priv->boot; struct global_data *ptr; @@ -119,19 +119,23 @@ static efi_status_t setup_memory(struct efi_priv *priv) ret = boot->allocate_pages(EFI_ALLOCATE_MAX_ADDRESS, priv->image_data_type, pages, &addr); if (ret) { - log_info("(any address) "); + if (verbose) + log_info("(any address) "); ret = boot->allocate_pages(EFI_ALLOCATE_ANY_PAGES, priv->image_data_type, pages, &addr); } if (ret) { - log_info("(using pool %lx) ", ret); + if (verbose) + log_info("(using pool %lx) ", ret); priv->ram_base = (ulong)efi_malloc(priv, CONFIG_EFI_RAM_SIZE, &ret); if (!priv->ram_base) return ret; priv->use_pool_for_malloc = true; } else { - log_info("(using allocated RAM address %lx) ", (ulong)addr); + if (verbose) + log_info("(using allocated RAM address %lx) ", + (ulong)addr); priv->ram_base = addr; } gd->ram_base = addr; @@ -443,7 +447,7 @@ efi_status_t efi_startup(efi_handle_t image, struct efi_system_table *systab) */ debug_uart_init(); - ret = setup_memory(priv); + ret = setup_memory(priv, true); if (ret) { printf("Failed to set up memory: ret=%lx\n", ret); return ret;