Booting OS images on Versal boards can be done using JTAG, SD, eMMC and QSPI boot modes.
Note: For versal-generic machine configuration file VCK190 evaluation board is used as reference.
- Connect a USB cable between the FTDI FT4232HL U20 USB-to-Quad-UART bridge USB Type-C connector on the target and the USB port on the host machine.
- Connect 12V power to the VCK190 6-Pin Molex connector and turn on the board power with the SW13 switch.
- Default UART terminal (serial port) settings is Speed
115200
, Data8 bit
, ParityNone
, Stop bits1 bit
and Flow controlNone
. - Set the board to JTAG and other boot modes by setting the boot mode switch by referring to board user guide. For VCK190 board Below is the configuration boot mode settings (SW1).
Note: Switch OFF = 1 = High; ON = 0 = Low
Boot Mode | Mode Pins [3:0] | Mode SW1 [4:1] | Comments |
---|---|---|---|
JTAG | 0000 | ON, ON, ON, ON | Supported with or without boot module attached |
QSPI | 0010 | ON, ON, OFF, ON | Supported only with boot module X-EBM-01 attached |
SD | 1110 | OFF, OFF, OFF, ON | Supported with or without boot module attached |
This boot flow requires the use of the AMD Xilinx tools, specifically XSDB and the associated JTAG device drivers. This also requires access to the JTAG interface on the board, a number of AMD Xilinx and third-party boards come with on-board JTAG modules.
Source the Vivado or Vitis tools settings.sh
scripts.
Deploying the images can be done in two methods.
Note: For Xen boot flow boot-jtag script doesn't include loading xen, kernel and root filesystem, This step needs to be done manually as mentioned in XSDB or TFTP method below.
- Run devtool command to generate the boot-jtag.tcl script.
$ devtool boot-jtag --help
$ devtool boot-jtag --image core-image-minimal --hw_server TCP:<hostname/ip-addr>:3121
- Script will be generated under ${DEPLOY_DIR_IMAGE}/boot-jtag.tcl
- Execute this script using xsdb tool as shown below.
$ xsdb <absolute-path-to-deploy-dir-image>/boot-jtag.tcl
- Power on the board, Launch the XSDB shell from command line as shown below.
$ xsdb
- In the XSDB console, connect to the target over JTAG using the connect command.
Optionally user can use
-url
to specify the local/remote hw_server. The connect command returns the channel ID of the connection.
xsdb% connect
- The targets command lists the available targets and allows you to select a target using its ID. The targets are assigned IDs as they are discovered on the JTAG chain, so the IDs can change from session to session.
xsdb% targets
Note: For non-interactive usage such as scripting, you can use the
-filter
option to select a target instead of selecting the target using its ID.
- Download the boot.bin for the target using XSDB with the
device program
command. Versal boot.bin will be located in the${DEPLOY_DIR_IMAGE}
directory. Default boot.bin consists of boot pdi, plm.elf, psm.elf, bl31.elf, u-boot.elf and system.dtb. This boot.bin is generated using bootgen tool by passing a .bif file.
Note: In yocto by default, ${DEPLOY_DIR_IMAGE}/system.dtb is used for both u-boot and kernel.
xsdb% targets -set -nocase -filter {name =~ "*PMC*"}
xsdb% device program ${DEPLOY_DIR_IMAGE}/boot.bin
xsdb% targets -set -nocase -filter {name =~ "*A72*#0"}
xsdb% stop
- After loading boot.bin resume the execution of active target using the
con
command in XSDB shell.
xsdb% con
- In the target Serial Terminal, press any key to stop the U-Boot auto-boot.
...
Hit any key to stop autoboot: 0
U-Boot>
Load the images into the target DDR/PL DRR load address i.e.,
DDR base address + <image_offset>
.
Below example uses base DDR address as 0x0 which matches in vivado address editor.
- Linux
Image Type | Base DDR Address | Image Offset | Load Address in DDR |
---|---|---|---|
Linux Kernel | 0x0 | 0x200000 | 0x200000 |
Device Tree Blob | 0x0 | 0x1000 | 0x1000 |
Rootfs | 0x0 | 0x4000000 | 0x4000000 |
U-boot boot script | 0x0 | 0x20000000 | 0x20000000 |
- Xen
Note: Xen, Rootfs and Device Tree image offset is calculated as shown below.
Xen Rootfs = Base DDR Address + Linux Kernel Image Offset(0xE00000) + Size of Linux Kernel Image
Xen Kernel = Base DDR Address + Xen Rootfs Image Offset (Ex: 0x2600000) + Size of Xen Rootfs
Device Tree Blob = Base DDR Address + Xen Kernel Image Offset (Ex: 0xBA00000) + Size of Device Tree Blob
Image Type | Base DDR Address | Image Offset | Load Address in DDR |
---|---|---|---|
Linux Kernel | 0x0 | 0xE00000 | 0xE00000 |
Xen Rootfs | 0x0 | 0x2600000 | 0x2600000 |
Xen Kernel | 0x0 | 0xBA00000 | 0xBA00000 |
Device Tree Blob | 0x0 | 0xC000000 | 0xC000000 |
U-boot boot script | 0x0 | 0x20000000 | 0x20000000 |
Note:
<target-image>
refers to core-image-minimal or petalinux-image-minimal- For pxeboot boot create a symlink for
<target-image>-${MACHINE}-${DATETIME}.cpio.gz.u-boot
as shown$ ln -sf ${DEPLOY_DIR_IMAGE}/<target-image>-${MACHINE}-${DATETIME}.cpio.gz.u-boot ${DEPLOY_DIR_IMAGE}/rootfs.cpio.gz.u-boot
to ensure the INITRD name in pxeboot.cfg matches with image name.- Whilst it is possible to load the images via JTAG this connection is slow and this process can take a long time to execute (more than 10 minutes). If your system has ethernet it is recommended that you use TFTP to load these images using U-Boot.
- If common ${DEPLOY_DIR_IMAGE}/system.dtb is used by u-boot and kernel, this is already part of boot.bin we can skip loading dtb, else load kernel dtb.
- Suspend the execution of active target using
stop
command in XSDB.
xsdb% stop
-
Using the
dow
command to load the images into the target DDR/PL DDR load address.- Linux XSDB
xsdb% targets -set -nocase -filter {name =~ "*A72*#0"} xsdb% dow -data ${DEPLOY_DIR_IMAGE}/Image 0x200000 xsdb% dow -data ${DEPLOY_DIR_IMAGE}/system.dtb 0x1000 xsdb% dow -data ${DEPLOY_DIR_IMAGE}/core-image-minimal-${MACHINE}.cpio.gz.u-boot 0x4000000 xsdb% dow -data ${DEPLOY_DIR_IMAGE}/boot.scr 0x20000000
- Xen XSDB
xsdb% targets -set -nocase -filter {name =~ "*A72*#0"} xsdb% dow -data ${DEPLOY_DIR_IMAGE}/Image 0xE00000 xsdb% dow -data ${DEPLOY_DIR_IMAGE}/core-image-minimal-${MACHINE}.cpio.gz 0x2600000 xsdb% dow -data ${DEPLOY_DIR_IMAGE}/xen 0xBA00000 xsdb% dow -data ${DEPLOY_DIR_IMAGE}/system.dtb 0xC000000 xsdb% dow -data ${DEPLOY_DIR_IMAGE}/boot.scr 0x20000000
- Setup TFTP directory on host machine and copy the images to your TFTP directory so that you can load them from U-Boot.
- Configure the
ipaddr
andserverip
of the U-Boot environment.
Versal> set serverip <server ip>
Versal> set ipaddr <board ip>
-
Load the images to DDR address.
- Linux TFTP
U-Boot> tftpboot 0x200000 Image U-Boot> tftpboot 0x1000 system.dtb U-Boot> tftpboot 0x4000000 core-image-minimal-${MACHINE}.cpio.gz.u-boot U-Boot> tftpboot 0x20000000 boot.scr
- Xen TFTP
U-Boot> tftpboot 0xE00000 Image U-Boot> setenv kernel_size 0x$filesize U-Boot> tftpboot 0x2600000 core-image-minimal-${MACHINE}.cpio.gz U-Boot> setenv ramdisk_size 0x$filesize U-Boot> tftpboot 0xBA00000 xen U-Boot> tftpboot 0xC000000 system.dtb U-Boot> tftpboot 0x20000000 boot.scr
Once the images are loaded continue the execution.
- After loading images resume the execution of active target using the
con
command in XSDB shell, Skip step 1 for if you have used TFTP to load images.
xsdb% con
- Terminate xsdb shell.
xsdb% exit
- In the target Serial Terminal, from U-Boot prompt run
boot
command.
- Linux boot
U-Boot> boot
-
XEN JTAG boot
- XSDB
Note: You need to calculate the Kernel(kernel_size) and ramdisk(ramdisk_size) image size manually from
${DEPLOY_DIR_IMAGE}
directory. For example if your kernel size is 24269312 bytes you need to convert to hex 0x1725200 and use it.U-Boot> setenv kernel_size <filesize> U-Boot> setenv ramdisk_size <filesize> U-Boot> boot
- TFTP
U-Boot> boot
- Load the SD card into the VCK190 board in the J302 SD slot.
- Configure the VCK190 board to boot in SD-Boot mode (1-ON, 2-OFF, 3-OFF, 4-OFF) by setting the SW1. Refer Setting Up the Target.
- Follow SD boot instructions README for more details.
- To boot VCK190 board in QSPI boot mode, you need to connect a QSPI daughter card (part number: X_EBM-01, REV_A01).
- With the card powered off, install the QSPI daughter card.
- Power on the VCK190 board and boot using JTAG or SD boot mode, to ensure that
U-Boot is running and also have boot.bin copied to DDR location using XSDB
dow
ortftpboot
orfatload
command. - Follow Flash boot instructions README for more details.
- After flashing the images, turn off the power switch on the board, and change the SW1 boot mode pin settings to QSPI boot mode (1-ON, 2-OFF, 3-ON, 4-ON) by setting the SW1. Refer Setting Up the Target.