You can boot a PetaLinux image on hardware using QSPI/OSPI by flashing/copying the Fit image (image.ub) or Individual images(Kernel image + Rootfs) to Flash memory.
Steps to Flash and Boot the PetaLinux Images using Fit image
- Set Primary Flash as a boot device and set the Boot script configuration to load the images into QSPI/OSPI flash, see Configuring Primary Flash Partitionfor more information. To check or update the offsets for kernel, boot.scr, and root file system, seeConfiguring U-Boot Boot Script (boot.scr). The process can fail at the U-Boot prompt if they do not match.
- Build the system image. For more information, see Building a System Image.
- Boot a PetaLinux Image on hardware with JTAG up to U-Boot, see Booting PetaLinux Image on Hardware with JTAG.
- Make sure you have configured the TFTP server in the host.
- Set the server IP address to the host IP address using the following
command at U-Boot
prompt.
ZynqMP> setenv serverip <HOST IP ADDRESS>
- Detect Flash Memory.
ZynqMP> sf probe 0 0 0
- Erase Flash Memory.
ZynqMP> sf erase 0 <Flash size in hex>
- Read images onto memory and write into Flash.
- Read BOOT.BIN.
ZynqMP> tftpboot 0x80000 BOOT.BIN
- Write BOOT.BIN.
ZynqMP> sf write 0x80000 0x0 $filesize
Example:
sf write 0x80000 0x0 0x121e7d0
- Read image.ub.
ZynqMP> tftpboot 0x80000 image.ub
- Write image.ub.
ZynqMP>sf write 0x80000 <Fit Image Flash Offset Address> $filesize
Example:
sf write 0x80000 0xF40000 0xF00000
- Read boot.scr
ZynqMP> tftpboot 0x80000 boot.scr
- Write boot.scr
ZynqMP> sf write 0x80000 <boot.scr Flash Offset Address> $filesize
Example: sf write 0x80000 0x03e80000 0x80000
- Read BOOT.BIN.
- Detect Flash Memory.
- Enable QSPI flash boot mode on board.
- Reset the board (booting starts from flash).
Steps to Flash and Boot the PetaLinux Images using Individual Images
- Set Primary Flash as boot device and Adjust/set the Boot script configuration to load the images into QSPI/OSPI flash. For more information, see Configuring Primary Flash Partition and Configuring U-Boot Boot Script (boot.scr).
- Build the system image. For more information, see Building a System Image.
- Boot a PetaLinux Image on hardware with JTAG up to U-Boot, see Booting PetaLinux Image on Hardware with JTAG.
- Make sure you have configured the TFTP server in the host. Note: To check or update the offsets for kernel, boot.scr, and root file system see Configuring U-Boot Boot Script (boot.scr). The process can fail at the U-Boot prompt if they do not match.
- Set the server IP address to the host IP address using the following
command at U-Boot
prompt.
ZynqMP> setenv serverip <HOST IP ADDRESS>
- Detect Flash Memory.
ZynqMP> sf probe 0 0 0
- Erase Flash Memory.
ZynqMP> sf erase 0 <Flash size in hex>
- Read images onto Memory and write into Flash.
- Read BOOT.BIN.
ZynqMP> tftpboot 0x80000 BOOT.BIN
- Write BOOT.BIN.
ZynqMP> sf write 0x80000 0x0 $filesize
Example:
sf write 0x80000 0x0 0x121e7d0
- Read Image.
ZynqMP> tftpboot 0x80000 Image
- Write Image.
ZynqMP> sf write 0x80000 <Kernel Image Flash Offset Address> $filesize
Example:
sf write 0x80000 0xF00000 0x1474200
- Read rootfs.cpio.gz.u-boot.
ZynqMP> tftpboot 0x80000 rootfs.cpio.gz.u-boot
- Write rootfs.cpio.gz.u-boot.
ZynqMP>sf write 0x80000 <Rootfs Flash Offset Address> $filesize
Example:
sf write 0x80000 0x4000000 0x4e1933
- Read boot.scr
ZynqMP> tftpboot 0x80000 boot.scr
- Write boot.scr
ZynqMP> sf write 0x80000 <boot.scr Flash Offset Address> $filesize
Example: sf write 0x80000 0x03e80000 0x80000
- Read BOOT.BIN.
- Detect Flash Memory.
- Enable QSPI flash boot mode on board.
- Reset the board (booting starts from flash).