From: Patrick Wildt <patrick@blueri.se>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/3] efi: fix issue for 32bit targets with ram_top at 4G
Date: Wed, 10 Apr 2019 18:40:02 +0200 [thread overview]
Message-ID: <20190410164002.GA6987@nyx.fritz.box> (raw)
In-Reply-To: <1554886979-22890-1-git-send-email-patrick.delaunay@st.com>
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 <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
>
> _______________________________________________
> 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
next prev parent reply other threads:[~2019-04-10 16:40 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Patrick Wildt [this message]
2019-04-11 8:03 ` [U-Boot] [PATCH 1/3] efi: fix issue for 32bit targets with ram_top at 4G Patrick DELAUNAY
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=20190410164002.GA6987@nyx.fritz.box \
--to=patrick@blueri.se \
--cc=u-boot@lists.denx.de \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox