public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/3] efi: fix issue for 32bit targets with ram_top at 4G
@ 2019-04-10  9:02 Patrick Delaunay
  2019-04-10  9:02 ` [U-Boot] [PATCH 2/3] efi: add protection for block_dev Patrick Delaunay
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Patrick Delaunay @ 2019-04-10  9:02 UTC (permalink / raw)
  To: u-boot

Avoid ram_end = 0 on 32bit targets with ram_end at 4G.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
---
example of issue in stm32mp1 board ev1:
  ram_start = c0000000
  size = 40000000
  ram_end = 100000000
  ram_end &= ~EFI_PAGE_MASK => result is 0

 lib/efi_loader/efi_memory.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c
index 55622d2..81dc5fc 100644
--- a/lib/efi_loader/efi_memory.c
+++ b/lib/efi_loader/efi_memory.c
@@ -574,6 +574,10 @@ __weak void efi_add_known_memory(void)
 
 		/* Remove partial pages */
 		ram_end &= ~EFI_PAGE_MASK;
+		/* Fix for 32bit targets with ram_top at 4G */
+		if (!ram_end)
+			ram_end = 0x100000000ULL;
+
 		ram_start = (ram_start + EFI_PAGE_MASK) & ~EFI_PAGE_MASK;
 
 		if (ram_end <= ram_start) {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-04-11 18:12 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-10  9:02 [U-Boot] [PATCH 1/3] efi: fix issue for 32bit targets with ram_top at 4G Patrick Delaunay
2019-04-10  9:02 ` [U-Boot] [PATCH 2/3] efi: add protection for block_dev Patrick Delaunay
2019-04-10 17:42   ` Heinrich Schuchardt
2019-04-11  9:30     ` Patrick DELAUNAY
2019-04-11 17:26   ` Heinrich Schuchardt
2019-04-10  9:02 ` [U-Boot] [PATCH 3/3] efi: update virtual address in efi_mem_carve_out Patrick Delaunay
2019-04-11 18:12   ` Heinrich Schuchardt
2019-04-10 16:40 ` [U-Boot] [PATCH 1/3] efi: fix issue for 32bit targets with ram_top at 4G Patrick Wildt
2019-04-11  8:03   ` Patrick DELAUNAY

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