[PATCH RFC 06/14] efi: stub: log EFI memory banks

Caleb Connolly caleb.connolly at linaro.org
Sun Nov 24 21:27:02 CET 2024


Add a debug log for these since its often useful to inspect the memory
map from the EFI we're jumping from.

Signed-off-by: Caleb Connolly <caleb.connolly at linaro.org>
---
 lib/efi/efi_info.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/lib/efi/efi_info.c b/lib/efi/efi_info.c
index 3754c913b54d..f9743a3e7fad 100644
--- a/lib/efi/efi_info.c
+++ b/lib/efi/efi_info.c
@@ -144,9 +144,9 @@ static bool efi_mem_type_is_usable(u32 type)
 int dram_init_banksize_from_efi(void)
 {
 	struct efi_mem_desc *desc, *end;
 	struct efi_entry_memmap *map;
-	int ret, size;
+	int ret, size, bank = 0;
 	int num_banks;
 
 	ret = efi_info_get(EFIET_MEMORY_MAP, (void **)&map, &size);
 	if (ret) {
@@ -162,9 +162,14 @@ int dram_init_banksize_from_efi(void)
 		/*
 		 * We only use conventional memory and ignore
 		 * anything less than 1MB.
 		 */
-		if (!efi_mem_type_is_usable(desc->type) || (desc->num_pages << EFI_PAGE_SHIFT) < 1 << 20)
+		log_debug("EFI bank #%d: start %llx, size %llx type %u\n",
+			  bank, desc->physical_start,
+			  desc->num_pages << EFI_PAGE_SHIFT, desc->type);
+		bank++;
+		if (!efi_mem_type_is_usable(desc->type) ||
+		    (desc->num_pages << EFI_PAGE_SHIFT) < 1 << 20)
 			continue;
 		gd->bd->bi_dram[num_banks].start = desc->physical_start;
 		gd->bd->bi_dram[num_banks].size = desc->num_pages <<
 			EFI_PAGE_SHIFT;

-- 
2.47.0



More information about the U-Boot mailing list