From: Patrick DELAUNAY Date: Thu, 11 Apr 2019 08:03:15 +0000 Subject: [U-Boot] [PATCH 1/3] efi: fix issue for 32bit targets with ram_top at 4G In-Reply-To: <20190410164002.GA6987@nyx.fritz.box> References: <1554886979-22890-1-git-send-email-patrick.delaunay@st.com> <20190410164002.GA6987@nyx.fritz.box> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Patrick, > From: Patrick Wildt > > 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: I tested your patch and yes that also correct my issue. And I am agree that it is a better approach: So I will hack your patch and I abandon this patch (1/3) of this serie. Regards Patrick > https://patchwork.ozlabs.org/patch/1082739/ > > Best regards, > another Patrick