U-boot fails to load device tree - data abort

Dear fellow engineers,

I run into problem trying to boot Linux. It fails at the last stage where it loads the device tree image.
See output below. I’m rather stuck here. Has anyone received similar problem as I’m facing? Also, I attached my u-boot environment variables at the end of this post.

------------------- SERIAL DEBUG OUTPUT FROM u-boot -------------------

U-Boot 2020.04-06636-gbad0daff34-dirty (Jan 27 2021 - 15:15:14 +0100)

CPU: Altera SoCFPGA Platform
FPGA: Altera Cyclone V, SE/A5 or SX/C5 or ST/D5, version 0x0
BOOT: SD/MMC Internal Transceiver (3.0V)
Watchdog enabled
DRAM: 128 MiB
MMC: dwmmc0@ff704000: 0
Loading Environment from MMC… OK
In: serial
Out: serial
Err: serial
Model: Altera SOCFPGA Cyclone V SoC Development Kit
Net: Could not get PHY for ethernet@ff702000: addr -1
No ethernet found.

Hit any key to stop autoboot: 0
6701 bytes read in 7 ms (934.6 KiB/s)

Executing script at 03000000

— starting u-boot boot sequence scipt (boot.scr) —
– for Intel Cyclone V SoC-FPGAs to boot rsYocto –
— by Robin Sebastian (https://github.com/robseb) —
— Contact: git@robseb.de

Resetting to default environment

— Set the kernel image —
— Set the devicetree image –
— set kernel boot arguments, then boot the kernel
— load linux kernel image and device tree to memory
— command to be executed to read from sdcard —
— sdcard fat32 partition number —
— sdcard ext3 identifier —
— standard input/output —
Saving Environment to MMC… Writing to MMC(0)… OK
— Programming FPGA —
— load FPGA config to memory
7007204 bytes read in 673 ms (9.9 MiB/s)
— write the FPGA configuration —
— HPS is not programming the FPGA —
— enable HPS-to-FPGA, FPGA-to-HPS, LWHPS-to-FPGA bridges —
— enable FPGA2HPS peripherals access –
for OSC
for on-chip RAM
Reset Bridges
— Booting the Yocto Linux —
-> load linux kernel image and device tree to memory
5095888 bytes read in 486 ms (10 MiB/s)
26628 bytes read in 7 ms (3.6 MiB/s)
— set kernel boot arguments, then boot the kernel —
*** leaving the u-boot boot sequence scipt (boot.script) ***

Flattened Device Tree blob at 02000000

Booting using the fdt blob at 0x2000000
Loading Device Tree to 09ff6000, end 09fff803 … data abort
pc : [<07fadde6>] lr : [<07fa4971>]
reloc pc : [<01054e26>] lr : [<0104b9b1>]
sp : 03f50830 ip : 00000000 fp : 00005e28
r10: 00000020 r9 : 03f56ee0 r8 : 00009804
r7 : 00006804 r6 : 00009804 r5 : 09ff6000 r4 : fe000000
r3 : 00000000 r2 : 09ffc804 r1 : 02006803 r0 : 09ff6000
Flags: nzCv IRQs off FIQs off Mode SVC_32 (T)
Code: 42e1 d0f8 f811 3d01 (f802) 3d01
Resetting CPU …

resetting …
------------------- / END OF SERIAL DEBUG OUTPUT FROM u-boot -------------------

------------------- OUTPUT FROM COMMAND printenv -------------------
Hit any key to stop autoboot: 0
=> printenv
boot_a_script=load ${devtype} ${devnum}:${distro_bootpart} ${scriptaddr} ${prefix}${script}; source ${scriptaddr}
boot_efi_binary=if fdt addr ${fdt_addr_r}; then bootefi bootmgr ${fdt_addr_r};else bootefi bootmgr ${fdtcontroladdr};fi;load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} efi/boot/bootarm.efi; if fdt addr ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${fdt_addr_r};else bootefi ${kernel_addr_r} ${fdtcontroladdr};fi
boot_extlinux=sysboot ${devtype} ${devnum}:${distro_bootpart} any ${scriptaddr} ${prefix}${boot_syslinux_conf}
boot_net_usb_start=usb start
boot_prefixes=/ /boot/
boot_scripts=boot.scr.uimg boot.scr
boot_targets=mmc0 pxe dhcp
bootcmd=run callscript;
bootcmd_dhcp=run boot_net_usb_start; if dhcp ${scriptaddr} ${boot_script_dhcp}; then source ${scriptaddr}; fi;setenv efi_fdtfile ${fdtfile}; if test -z “${fdtfile}” -a -n “${soc}”; then setenv efi_fdtfile ${soc}-${board}${boardver}.dtb; fi; setenv efi_old_vci ${bootp_vci};setenv efi_old_arch ${bootp_arch};setenv bootp_vci PXEClient:Arch:00010:UNDI:003000;setenv bootp_arch 0xa;if dhcp ${kernel_addr_r}; then tftpboot ${fdt_addr_r} dtb/${efi_fdtfile};if fdt addr ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${fdt_addr_r}; else bootefi ${kernel_addr_r} ${fdtcontroladdr};fi;fi;setenv bootp_vci ${efi_old_vci};setenv bootp_arch ${efi_old_arch};setenv efi_fdtfile;setenv efi_old_arch;setenv efi_old_vci;
bootcmd_mmc0=devnum=0; run mmc_boot
bootcmd_pxe=run boot_net_usb_start; dhcp; if pxe get; then pxe boot; fi
callscript=fatload mmc 0:1 $fpgadata $scriptfile;source $fpgadata
distro_bootcmd=for target in ${boot_targets}; do run bootcmd_${target}; done
efi_dtb_prefixes=/ /dtb/ /dtb/current/
load_efi_dtb=load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${prefix}${efi_fdtfile}
mmc_boot=if mmc dev ${devnum}; then devtype=mmc; run scan_dev_for_boot_part; fi
mmcboot=setenv bootargs mem=128M console=ttyS0,115200 root=${mmcroot} rw rootwait; bootz ${loadaddr} - ${fdtaddr}
mmcload=mmc rescan; ${mmcloadcmd} mmc 0:${mmcloadpart} ${loadaddr} ${bootimage}; ${mmcloadcmd} mmc 0:${mmcloadpart} ${fdtaddr} ${fdtimage}
scan_dev_for_boot=echo Scanning ${devtype} ${devnum}:${distro_bootpart}…; for prefix in ${boot_prefixes}; do run scan_dev_for_extlinux; run scan_dev_for_scripts; done;run scan_dev_for_efi;
scan_dev_for_boot_part=part list ${devtype} ${devnum} -bootable devplist; env exists devplist || setenv devplist 1; for distro_bootpart in ${devplist}; do if fstype ${devtype} ${devnum}:${distro_bootpart} bootfstype; then run scan_dev_for_boot; fi; done; setenv devplist
scan_dev_for_efi=setenv efi_fdtfile ${fdtfile}; if test -z “${fdtfile}” -a -n “${soc}”; then setenv efi_fdtfile ${soc}-${board}${boardver}.dtb; fi; for prefix in ${efi_dtb_prefixes}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${efi_fdtfile}; then run load_efi_dtb; fi;done;if test -e ${devtype} ${devnum}:${distro_bootpart} efi/boot/bootarm.efi; then echo Found EFI removable media binary efi/boot/bootarm.efi; run boot_efi_binary; echo EFI LOAD FAILED: continuing…; fi; setenv efi_fdtfile
scan_dev_for_extlinux=if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${boot_syslinux_conf}; then echo Found ${prefix}${boot_syslinux_conf}; run boot_extlinux; echo SCRIPT FAILED: continuing…; fi
scan_dev_for_scripts=for script in ${boot_scripts}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${script}; then echo Found U-Boot script ${prefix}${script}; run boot_a_script; echo SCRIPT FAILED: continuing…; fi; done
ubifs_boot=env exists bootubipart || env set bootubipart UBI; env exists bootubivol || env set bootubivol boot; if ubi part ${bootubipart} && ubifsmount ubi${devnum}:${bootubivol}; then devtype=ubi; run scan_dev_for_boot; fi
usb_boot=usb start; if usb dev ${devnum}; then devtype=usb; run scan_dev_for_boot_part; fi
ver=U-Boot 2020.04-06636-gbad0daff34-dirty (Jan 27 2021 - 15:15:14 +0100)

Environment size: 4577/8188 bytes

How are you generating your kernel device tree? It was a pain in the ass for me to figure out. You can start with the one built into the kernel, but you have to ensure it is all correct.

You also need to make sure u-boot is being generated correctly with bsp-create-settings which MUST be based on your compiled FPGA. You must load your FPGA before you boot linux. If you are using the FPGA -> DRAM interface you must add them to your dts.

There is a lot that can go wrong. Please give me more details.