From mboxrd@z Thu Jan 1 00:00:00 1970 From: Patrick Wildt Date: Wed, 10 Apr 2019 18:40:02 +0200 Subject: [U-Boot] [PATCH 1/3] efi: fix issue for 32bit targets with ram_top at 4G In-Reply-To: <1554886979-22890-1-git-send-email-patrick.delaunay@st.com> References: <1554886979-22890-1-git-send-email-patrick.delaunay@st.com> Message-ID: <20190410164002.GA6987@nyx.fritz.box> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Wed, Apr 10, 2019 at 11:02:57AM +0200, Patrick Delaunay wrote: > Avoid ram_end = 0 on 32bit targets with ram_end at 4G. > > Signed-off-by: Patrick Delaunay > --- > 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 > > _______________________________________________ > U-Boot mailing list > U-Boot at lists.denx.de > https://lists.denx.de/listinfo/u-boot Hi, I had the exact same issue yesterday and posted a diff which I think is a better approach: https://patchwork.ozlabs.org/patch/1082739/ Best regards, another Patrick