cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
drew
Visitor
Visitor
256 Views
Registered: ‎04-20-2021

Stuck in ATF while booting u-boot / linux with petalinux via JTAG

Hi,

We are trying to boot a petalinux image using the JTAG cable on a custom board that contains a Zynq UltraScale+ MPSoC.
The board is a htg_z922: http://www.hitechglobal.com/Boards/Zynq_UltraScale+_PCIe.htm

To create the petalinux project we've followed these steps. We are using a RHEL 7.6 machine:

Note: the vendor provided BSP that we were given was created using petalinux 2018.3.
source /opt/pkg/petalinux/2018.3/settings.sh

Created a petalinux poject using the vendor provided BSP.
petalinux-create -t project -s htg_z922.BSP.bsp

Ran petalinux-config using the default configuration.
petalinux-config

Ran petalinux-build.
petalinux-build

Tested booting linux in a QEMU VM. This worked successfully.
petalinux-boot --qemu --kernel

Next we tried to boot linux on the board using JTAG. This is where we started running into issues.
The firmware files and linux image got downloaded to the board. However, we appear to get stuck in the ATF as shown below.

$ petalinux-boot --jtag --kernel
INFO: Launching XSDB for file download and boot.
INFO: This may take a few minutes, depending on the size of your image.
INFO: Downloading ELF file: /home/landmaa/petalinux_test/htg_z922/images/linux/pmufw.elf to the target.
INFO: Downloading ELF file: /home/landmaa/petalinux_test/htg_z922/images/linux/zynqmp_fsbl.elf to the target.
INFO: Loading image: /home/landmaa/petalinux_test/htg_z922/images/linux/Image at 0x00080000
INFO: Loading image: /home/landmaa/petalinux_test/htg_z922/images/linux/system.dtb at 0x1407f000
INFO: Downloading ELF file: /home/landmaa/petalinux_test/htg_z922/build/misc/linux-boot/linux-boot.elf to the target.
INFO: Downloading ELF file: /home/landmaa/petalinux_test/htg_z922/images/linux/bl31.elf to the target.

$ sudo cu -l /dev/ttyUSB0 -s 115200
Connected.
Xilinx Zynq MP First Stage Boot Loader
Release 2018.3 Apr 3 2021 - 00:28:17
NOTICE: ATF running on XCZU19EG/silicon v4/RTL5.1 at 0xfffea000
NOTICE: BL31: Secure code at 0x60000000
NOTICE: BL31: Non secure code at 0x8000000
NOTICE: BL31: v1.5(release):xilinx-v2018.2-919-g08560c36
NOTICE: BL31: Built : 00:27:05, Apr 3 2021


We also tried booting u-boot which worked successfully in a QEMU VM.
petalinux-boot --qemu --u-boot

However, u-boot also fails to boot on the board. The firmware files get downloaded to the board but it appears to get stuck in the ATF as well.

$ petalinux-boot --jtag --u-boot
INFO: Launching XSDB for file download and boot.
INFO: This may take a few minutes, depending on the size of your image.
INFO: Downloading ELF file: /home/landmaa/petalinux_test/htg_z922/images/linux/pmufw.elf to the target.
INFO: Downloading ELF file: /home/landmaa/petalinux_test/htg_z922/images/linux/zynqmp_fsbl.elf to the target.
INFO: Downloading ELF file: /home/landmaa/petalinux_test/htg_z922/images/linux/u-boot.elf to the target.
INFO: Downloading ELF file: /home/landmaa/petalinux_test/htg_z922/images/linux/bl31.elf to the target.

$ sudo cu -l /dev/ttyUSB0 -s 115200
[sudo] password for landmaa:
Connected.
Xilinx Zynq MP First Stage Boot Loader
Release 2018.3 Apr 3 2021 - 00:28:17
NOTICE: ATF running on XCZU19EG/silicon v4/RTL5.1 at 0xfffea000
NOTICE: BL31: Secure code at 0x60000000
NOTICE: BL31: Non secure code at 0x8000000
NOTICE: BL31: v1.5(release):xilinx-v2018.2-919-g08560c36
NOTICE: BL31: Built : 00:27:05, Apr 3 2021


Any idea why we are getting stuck in the ATF while trying to boot both linux and u-boot on the board?

Thanks in advance.

 

Thanks,
Andrew

0 Kudos
3 Replies
shabbirk
Moderator
Moderator
192 Views
Registered: ‎12-04-2016

Hi Andrew,

Try appending the bitstream while JTAG boot and see if that helps. Something like this:

petalinux-boot  --jtag --fpga --bitstream <path to bitstream> --v --kernel

 

Regards

Shabbir

 

0 Kudos
drew
Visitor
Visitor
167 Views
Registered: ‎04-20-2021

Hi Shabbir,

Still getting stuck in the ATF when specifying the bitstream using that command. See output below:

 

$ petalinux-boot --jtag --fpga --bitstream images/linux/system.bit --v --kernel
XSDB Script:
INFO: Launching XSDB for file download and boot.
INFO: This may take a few minutes, depending on the size of your image.

connect
puts stderr "INFO: Configuring the FPGA..."
puts stderr "INFO: Downloading bitstream: images/linux/system.bit to the target."
fpga "images/linux/system.bit"
targets -set -nocase -filter {name =~ "*PSU*"}
mask_write 0xFFCA0038 0x1C0 0x1C0
targets -set -nocase -filter {name =~ "*MicroBlaze PMU*"}

catch {stop}; after 1000
puts stderr "INFO: Downloading ELF file: /home/landmaa/petalinux_hdf3/htg_z922/images/linux/pmufw.elf to the target."
dow "/home/landmaa/petalinux_hdf3/htg_z922/images/linux/pmufw.elf"
after 2000
con
targets -set -nocase -filter {name =~ "*APU*"}
mwr 0xffff0000 0x14000000
mask_write 0xFD1A0104 0x501 0x0
targets -set -nocase -filter {name =~ "*A53*#0"}

source /home/landmaa/petalinux_hdf3/htg_z922/project-spec/hw-description/psu_init.tcl
puts stderr "INFO: Downloading ELF file: /home/landmaa/petalinux_hdf3/htg_z922/images/linux/zynqmp_fsbl.elf to the target."
dow "/home/landmaa/petalinux_hdf3/htg_z922/images/linux/zynqmp_fsbl.elf"
after 2000
con
after 4000; stop; catch {stop}; psu_ps_pl_isolation_removal; psu_ps_pl_reset_config
targets -set -nocase -filter {name =~ "*A53*#0"}
puts stderr "INFO: Loading image: /home/landmaa/petalinux_hdf3/htg_z922/images/linux/Image at 0x00080000"
dow -data "/home/landmaa/petalinux_hdf3/htg_z922/images/linux/Image" 0x00080000
after 2000
targets -set -nocase -filter {name =~ "*A53*#0"}
puts stderr "INFO: Loading image: /home/landmaa/petalinux_hdf3/htg_z922/images/linux/system.dtb at 0x1407f000"
dow -data "/home/landmaa/petalinux_hdf3/htg_z922/images/linux/system.dtb" 0x1407f000
after 2000
targets -set -nocase -filter {name =~ "*A53*#0"}
puts stderr "INFO: Downloading ELF file: /home/landmaa/petalinux_hdf3/htg_z922/build/misc/linux-boot/linux-boot.elf to the target."
dow "/home/landmaa/petalinux_hdf3/htg_z922/build/misc/linux-boot/linux-boot.elf"
after 2000
targets -set -nocase -filter {name =~ "*A53*#0"}
puts stderr "INFO: Downloading ELF file: /home/landmaa/petalinux_hdf3/htg_z922/images/linux/bl31.elf to the target."
dow "/home/landmaa/petalinux_hdf3/htg_z922/images/linux/bl31.elf"
after 2000
con
exit
INFO: Configuring the FPGA...
INFO: Downloading bitstream: images/linux/system.bit to the target.
100% 34MB 0.3MB/s 01:41
INFO: Downloading ELF file: /home/landmaa/petalinux_hdf3/htg_z922/images/linux/pmufw.elf to the target.
Downloading Program -- /home/landmaa/petalinux_hdf3/htg_z922/images/linux/pmufw.elf
section, .vectors.reset: 0xffdc0000 - 0xffdc0007
section, .vectors.sw_exception: 0xffdc0008 - 0xffdc000f
section, .vectors.interrupt: 0xffdc0010 - 0xffdc0017
section, .vectors.hw_exception: 0xffdc0020 - 0xffdc0027
section, .text: 0xffdc0050 - 0xffdd0227
section, .rodata: 0xffdd0228 - 0xffdd236f
section, .data: 0xffdd2370 - 0xffdd63e7
section, .sdata2: 0xffdd63e8 - 0xffdd63e7
section, .sdata: 0xffdd63e8 - 0xffdd63e7
section, .sbss: 0xffdd63e8 - 0xffdd63e7
section, .bss: 0xffdd6400 - 0xffdda48b
section, .srdata: 0xffdda48c - 0xffddad9b
section, .stack: 0xffddad9c - 0xffddbd9f
section, .xpbr_serv_ext_tbl: 0xffddf6e0 - 0xffddfadf
100% 0MB 0.1MB/s 00:01
Setting PC to Program Start Address 0xffdcf77c
Successfully downloaded /home/landmaa/petalinux_hdf3/htg_z922/images/linux/pmufw.elf
INFO: Downloading ELF file: /home/landmaa/petalinux_hdf3/htg_z922/images/linux/zynqmp_fsbl.elf to the target.
Downloading Program -- /home/landmaa/petalinux_hdf3/htg_z922/images/linux/zynqmp_fsbl.elf
section, .text: 0xfffc0000 - 0xfffcde1b
section, .init: 0xfffcde40 - 0xfffcde73
section, .fini: 0xfffcde80 - 0xfffcdeb3
section, .note.gnu.build-id: 0xfffcdeb4 - 0xfffcded7
section, .rodata: 0xfffcdf00 - 0xfffce327
section, .sys_cfg_data: 0xfffce340 - 0xfffceb27
section, .mmu_tbl0: 0xfffcf000 - 0xfffcf00f
section, .mmu_tbl1: 0xfffd0000 - 0xfffd1fff
section, .mmu_tbl2: 0xfffd2000 - 0xfffd5fff
section, .data: 0xfffd6000 - 0xfffd7187
section, .sbss: 0xfffd7188 - 0xfffd71bf
section, .bss: 0xfffd71c0 - 0xfffd937f
section, .heap: 0xfffd9380 - 0xfffd977f
section, .stack: 0xfffd9780 - 0xfffdb77f
section, .dup_data: 0xfffdb780 - 0xfffdc907
section, .handoff_params: 0xfffe9e00 - 0xfffe9e87
section, .bitstream_buffer: 0xffff0040 - 0xfffffc3f
100% 0MB 0.0MB/s 00:03
Setting PC to Program Start Address 0xfffc0000
Successfully downloaded /home/landmaa/petalinux_hdf3/htg_z922/images/linux/zynqmp_fsbl.elf
INFO: Loading image: /home/landmaa/petalinux_hdf3/htg_z922/images/linux/Image at 0x00080000
100% 28MB 0.0MB/s 17:34
Successfully downloaded /home/landmaa/petalinux_hdf3/htg_z922/images/linux/Image
INFO: Loading image: /home/landmaa/petalinux_hdf3/htg_z922/images/linux/system.dtb at 0x1407f000
100% 0MB 0.0MB/s 00:01
Successfully downloaded /home/landmaa/petalinux_hdf3/htg_z922/images/linux/system.dtb
INFO: Downloading ELF file: /home/landmaa/petalinux_hdf3/htg_z922/build/misc/linux-boot/linux-boot.elf to the target.
Downloading Program -- /home/landmaa/petalinux_hdf3/htg_z922/build/misc/linux-boot/linux-boot.elf
section, .text: 0x08000000 - 0x08000027
100% 0MB 0.0MB/s 00:00
Setting PC to Program Start Address 0x08000000
Successfully downloaded /home/landmaa/petalinux_hdf3/htg_z922/build/misc/linux-boot/linux-boot.elf
INFO: Downloading ELF file: /home/landmaa/petalinux_hdf3/htg_z922/images/linux/bl31.elf to the target.
Downloading Program -- /home/landmaa/petalinux_hdf3/htg_z922/images/linux/bl31.elf
section, .text: 0xfffea000 - 0xffff1fff
section, .rodata: 0xffff2000 - 0xffff2fff
section, .data: 0xffff3000 - 0xffff6a1f
section, stacks: 0xffff6a40 - 0xffff7b3f
section, .bss: 0xffff7b40 - 0xffff88d3
section, xlat_table: 0xffff9000 - 0xffffdfff
section, coherent_ram: 0xffffe000 - 0xffffefff
100% 0MB 0.0MB/s 00:03
Setting PC to Program Start Address 0xfffea000
Successfully downloaded /home/landmaa/petalinux_hdf3/htg_z922/images/linux/bl31.elf
$

 

$ sudo cu -l /dev/ttyUSB0 -s 115200
Connected.
Xilinx Zynq MP First Stage Boot Loader
Release 2018.3 Apr 21 2021 - 14:53:23
NOTICE: ATF running on XCZU19EG/silicon v4/RTL5.1 at 0xfffea000
NOTICE: BL31: Secure code at 0x60000000
NOTICE: BL31: Non secure code at 0x8000000
NOTICE: BL31: v1.5(release):xilinx-v2018.2-919-g08560c36
NOTICE: BL31: Built : 14:52:10, Apr 21 2021

 

 

Have also tried using --u-boot instead of --kernel when specifying the bitstream with petalinux-boot (similar to the command above). We get stuck in the ATF when attempting to boot u-boot as well.

Any other ideas?

 

Thanks,

Andrew

0 Kudos
shabbirk
Moderator
Moderator
137 Views
Registered: ‎12-04-2016

Hi Andrew,

Just thinking if are there any issues with the BSP itself? As far as the JTAG steps concerned, it looks fine. If you have any ready images from this BSP provider, you can try this. This BSP is not from Xilinx

 

Regards

Shabbir

 

0 Kudos