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 boot device and 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 TFTP server in host.
- To check or update the offsets for kernel, boot.scr, and root file system, see Configuring U-Boot Boot Script (boot.scr). If they do not match, the process can fail at the U-Boot prompt.
- 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 $filesizeExample:
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> $filesizeExample:
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> $filesizeExample: 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 TFTP server in host. Note: To check or update the offsets for kernel, boot.scr, and root file system see Configuring U-Boot Boot Script (boot.scr). If they do not match, the process can fail at the U-Boot prompt.
- 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 $filesizeExample:
sf write 0x80000 0x0 0x121e7d0 - Read Image.
ZynqMP> tftpboot 0x80000 Image - Write Image.
ZynqMP> sf write 0x80000 <Kernel Image Flash Offset Address> $filesizeExample:
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> $filesizeExample:
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> $filesizeExample: 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).