[U-Boot] [PATCH 1/3] efi: fix issue for 32bit targets with ram_top at 4G

Patrick Wildt patrick at blueri.se
Wed Apr 10 16:40:02 UTC 2019


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


More information about the U-Boot mailing list