Steps to Boot a PetaLinux Image on Hardware with QSPI or OSPI - 2022.1 English

PetaLinux Tools Documentation: Reference Guide (UG1144)

Document ID
UG1144
Release Date
2022-04-26
Version
2022.1 English

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

  1. 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).
  2. Build the system image. For more information, see Build System Image.
  3. Boot a PetaLinux Image on hardware with JTAG up to U-boot, see Booting PetaLinux Image on Hardware with JTAG.
  4. Make sure you have configured TFTP server in host.
  5. 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 may fail at the U-Boot prompt.
  6. Set the server IP address to the host IP address using the following command at U-Boot prompt.
    ZynqMP> setenv serverip <HOST IP ADDRESS>
    1. Detect Flash Memory.
      ZynqMP> sf probe 0 0 0
    2. Erase Flash Memory.
      ZynqMP> sf erase 0 <Flash size in hex>
    3. 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

  7. Enable QSPI flash boot mode on board.
  8. Reset the board (booting starts from flash).

Steps to Flash and Boot the PetaLinux Images using Individual images

  1. 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).
  2. Build the system image. For more information, see Build System Image.
  3. Boot a PetaLinux Image on hardware with JTAG up to U-boot, see Booting PetaLinux Image on Hardware with JTAG.
  4. 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 may fail at the U-Boot prompt.
  5. Set the server IP address to the host IP address using the following command at U-Boot prompt.
    ZynqMP> setenv serverip <HOST IP ADDRESS>
    1. Detect Flash Memory.
      ZynqMP> sf probe 0 0 0
    2. Erase Flash Memory.
      ZynqMP> sf erase 0 <Flash size in hex>
    3. 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

  6. Enable QSPI flash boot mode on board.
  7. Reset the board (booting starts from flash).