[Bug 269181] sysutils/u-boot-rpi-arm64: RPi4/8G fails to boot: "** Reading file would overwrite reserved memory **"

From: <bugzilla-noreply_at_freebsd.org>
Date: Sun, 05 Feb 2023 01:56:51 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=269181

Mark Millard <marklmi26-fbsd@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |marklmi26-fbsd@yahoo.com

--- Comment #1 from Mark Millard <marklmi26-fbsd@yahoo.com> ---
Just a possibility for possible further investigation . . .

I did some experimenting and discovered that u-boot.bin and bootaa64.efi
are being loaded to the same starting location. Probably U-Boot had been
relocated before that point --and might be known relocate far enough way
to  not be a problem? I'll note that u-boot.bin is smaller than
bootaa64.efi (at least for the ones I looked at).

(RPi* firmware debug output to start with . . .)
MESS:00:00:07.664888:0: Loaded 'u-boot.bin.2023.01.arm64' to 0x80000 size
0x93208
MESS:00:00:07.672108:0: Device tree loaded to 0x4000 (size 0xd3b9)

(NOTE above [vs. later]: 0x80000 for where u-boot.bin was loaded.)
. . .
U-Boot> printenv
. . .
boot_efi_binary=load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r}
efi/boot/bootaa64.efi; if fdt addr -q ${fdt_addr_r}; then bootefi
${kernel_addr_r} ${fdt_addr_r};else bootefi ${kernel_addr_r}
${fdtcontroladdr};fi
. . .
kernel_addr_r=0x00080000
. . .
U-Boot> env run usb_boot
. . .
Found EFI removable media binary efi/boot/bootaa64.efi
** Reading file would overwrite reserved memory **
Failed to load 'efi/boot/bootaa64.efi'
No UEFI binary known at 0x00080000
EFI LOAD FAILED: continuing...

(NOTE vs. earlier: 0x80000 for where u-boot.bin was loaded
                   and for where efi/boot/bootaa64.efi
                   was to be loaded.)
. . .
U-Boot> echo load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r}
efi/boot/bootaa64.efi 
load usb :1 0x00080000 efi/boot/bootaa64.efi
. . .
U-Boot> load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r}
efi/boot/bootaa64.efi     
** Reading file would overwrite reserved memory **
Failed to load 'efi/boot/bootaa64.efi'


NOTE: I see the same double load (u-boot.bin and bootaa64.efi)
to 0x00080000 for the prior 2020.10 of U-Boot. (May be it just
does not check for such and it happened to work but was not
guaranteed to? May be it is supposed to be okay? Unsure.)

-- 
You are receiving this mail because:
You are the assignee for the bug.