problem to run ipxe from u-boot on arm64/nvidia jetson tx2

Hi!

As a hw platform to run iPXE I using nVidia jetson devboard with arm64 cpu

u-boot is a part of flow in this board so I want to load iPXE efi app and run it:

I have build IPXE efi app using vi this make args:

make bin-arm64-efi/snp.efi -j6

and then in u-boot have load from tftp:

Tegra186 (P2771-0000-500) # tftp b0000000 192.168.1.1:snp.efi
ethernet@2490000 Waiting for PHY auto negotiation to complete… done
Using ethernet@2490000 device
TFTP from server 192.168.1.1; our IP address is 192.168.1.100
Filename ‘snp.efi’.
Load address: 0xb0000000
Loading: ###########
28.3 KiB/s
done
Bytes transferred = 148992 (24600 hex)

after this I calling bootefi:

Tegra186 (P2771-0000-500) # bootefi b0000000 80000000

Starting EFI application at 0xb0000000 …

efi_load_pe:132 arm64 arch
efi_load_pe:136 image size 0xa5620
efi_load_pe:138 efi realoc 0xfea88000
efi_load_pe:146 AddressOfEntryPoint 0x57c4
efi_load_pe:147 entry 0xfea8d7c4
efi_load_pe:177 Load sections into RAM
efi_load_pe:189 Run through relocations
efi_load_pe:193 Flush cache
efi_load_pe:205 retunr entry 0xfea8d7c4
Scanning disks on mmc…
MMC: no card present
MMC Device 2 not found
MMC Device 3 not found
Found 1 disks
do_bootefi_exec:216 set jump to 0xfff99e08
do_bootefi_exec:223 Jumping to 0xfea8d7c4
do_bootefi_exec:225 first command to 0xfea8d7c4: a9017bf5a9be53f3
do_bootefi_exec:226 second command to 0xfea8d7cc: d3481c134b0003e0
do_bootefi_exec:227 third command to 0xfea8d7d4: a8c253f3a9417bf5
“Synchronous Abort” handler, esr 0x02000000
ELR: fea89758
LR: fea8d7d4
x0 : 00000000fff99da0 x1 : 00000000fff9f5c8
x2 : 00000000feb2c000 x3 : 0000000003100000
x4 : 0000000000000000 x5 : 0000000000000035
x6 : 00000000fff8663d x7 : 000000000000000f
x8 : 000000000000000e x9 : 0000000000000008
x10: 00000000ffb2d4a2 x11: 00000000ffffffff
x12: 00000000ffffffff x13: 00000000fff71d00
x14: 0000000080000000 x15: 00000000fffed71c
x16: 0000000000004030 x17: 0000000100000000
x18: 00000000ffb30de0 x19: 00000000fff9f5c8
x20: 00000000b0000000 x21: 00000000fff99da0
x22: 00000000ffb397b0 x23: 00000000feb2c000
x24: 0000000000000003 x25: 0000000000000000
x26: 00000000fff99da0 x27: 00000000fea8d7c4
x28: 0000000000000000 x29: 00000000ffb2dd50

all before printf I have add in u-boot bootefi handler to understad what is going wrong.

I have calculate offsets and exception have been occurred:

ELR: fea89758 -> 1758
LR: fea8d7d4 -> 57d4

0000000000001744 <efi_init>:
1744:<----->a9b853f3 <----->stp<—>x19, x20, [sp, #-128]!
1748:<----->f0000502 <----->adrp<–>x2, a4000 <heap+0x7f560>
174c:<----->a90263f7 <----->stp<—>x23, x24, [sp, #32]
1750:<----->f0000517 <----->adrp<–>x23, a4000 <heap+0x7f560>
1754:<----->f9061440 <----->str<—>x0, [x2, #3112]
1758:<----->f9061ae1 <----->str<—>x1, [x23, #3120] >> so address in x23

00000000000057c4 <_efi_start>:
57c4:<----->a9be53f3 <----->stp<—>x19, x20, [sp, #-32]!
57c8:<----->a9017bf5 <----->stp<—>x21, x30, [sp, #16]
57cc:<----->aa0003f5 <----->mov<—>x21, x0
57d0:<----->97ffefdd <----->bl<---->1744 <efi_init>
57d4:<----->aa0003f3 <----->mov<—>x19, x0

looks like 0xfeb2c000 (ie a4000) should be in .relock section and probably this is correct:

readpe ./bin-arm64-efi/snp.efi

Section
Name: .reloc
Virtual Address: 0xa4ca0
Physical Address: 0x928
Size: 0x940 (2368 bytes)
Pointer To Data: 0x23c80
Relocations: 0
Characteristics: 0x48000040
Characteristic Names
IMAGE_SCN_CNT_INITIALIZED_DATA
IMAGE_SCN_MEM_NOT_PAGED
IMAGE_SCN_MEM_READ

toolchain is aarch64-linux-gnu-gcc -v

gcc 8.3.0 (GNU Toolchain for the A-profile Architecture 8.3-2019.03 (arm-rel-8.36))

with Linaro 7.3.1 (recommended by nvidia ) behavior the same

may be linker script or u-boot sections parser\relocation is not ok?
My knowledge not enough to understand a reason of this crush and how to fix it, are some one could help/direct me with this?

Sorry that we don’t support ipxe.

https://devtalk.nvidia.com/default/topic/1061298/jetson-nano/ipxe-boot-jetson-nano/

I will let other user share their experience here.

it this case question not only about iPXE but about u-boot, so may be your engineers can look over my info in first message and may be this can help to direct my what are missing?