mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH master 2/3] efi: efi-iomem: don't add EFI loader code/data as memory banks
Date: Mon, 15 Nov 2021 10:00:22 +0100	[thread overview]
Message-ID: <20211115090023.4192546-2-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20211115090023.4192546-1-a.fatoum@pengutronix.de>

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@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


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


  reply	other threads:[~2021-11-15  9:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-15  9:00 [PATCH master 1/3] pci: efi: skip driver model fixup for non-EFI PCI busses Ahmad Fatoum
2021-11-15  9:00 ` Ahmad Fatoum [this message]
2021-11-15  9:00 ` [PATCH master 3/3] efi: efi-iomem: fix erroneous use of IS_ENABLED() Ahmad Fatoum
2021-11-15  9:39 ` [PATCH master 1/3] pci: efi: skip driver model fixup for non-EFI PCI busses Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211115090023.4192546-2-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --subject='Re: [PATCH master 2/3] efi: efi-iomem: don'\''t add EFI loader code/data as memory banks' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox