[PATCH master 2/3] efi: efi-iomem: don't add EFI loader code/data as memory banks

Ahmad Fatoum a.fatoum at pengutronix.de
Mon Nov 15 01:00:22 PST 2021


The loader code and data memory descriptors describe code used by the
currently running barebox instance. This is already used memory, so
registering it as available SDRAM is wrong. Instead, just reserve the
IO MEM region for informational purposes.

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 common/efi/efi-iomem.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/common/efi/efi-iomem.c b/common/efi/efi-iomem.c
index e223c595c478..11ea94f6a2a6 100644
--- a/common/efi/efi-iomem.c
+++ b/common/efi/efi-iomem.c
@@ -36,9 +36,13 @@ static int efi_parse_mmap(struct efi_memory_desc *desc)
 		flags = IORESOURCE_MEM | IORESOURCE_DISABLED;
 		break;
 	case EFI_LOADER_CODE:
-		return barebox_add_memory_bank("loader code", va_base, va_size);
+		name = "loader code";
+		flags = IORESOURCE_MEM | IORESOURCE_READONLY;
+		break;
 	case EFI_LOADER_DATA:
-		return barebox_add_memory_bank("loader data", va_base, va_size);
+		name = "loader data";
+		flags = IORESOURCE_MEM;
+		break;
 	case EFI_BOOT_SERVICES_CODE:
 		if (!IS_ENABLED(DEBUG))
 			return 0;
-- 
2.30.2




More information about the barebox mailing list