Additional Options for Booting on QEMU - 2021.2 English

PetaLinux Tools Documentation: Reference Guide

Document ID
UG1144
Release Date
2021-10-27
Version
2021.2 English
  • To download the newly built <plnx-proj-root>/images/linux/u-boot.elf with QEMU:
    $ petalinux-boot --qemu --u-boot
    • For Zynq® UltraScale+™ MPSoC and Versal ACAP, it loads <plnx-proj-root>/images/linux/u-boot.elf and boots the TF-A image <plnx-proj-root>/images/linux/bl31.elf with QEMU. The TF-A then boots the loaded U-Boot image.
    • For MicroBlaze™ CPUs and Zynq-7000 devices, it boots <plnx-proj-root>/images/linux/u-boot.elf with QEMU.
  • To download the newly built kernel with QEMU:
    $ petalinux-boot --qemu --kernel
    • For MicroBlaze processors, it boots <plnx-proj-root>/images/linux/image.elf with QEMU.
    • For Zynq-7000 devices, it boots <plnx-proj-root>/images/linux/zImage with QEMU.
    • For Zynq UltraScale+ MPSoC, it loads the kernel image <plnx-proj-root>/images/linux/Image and boots the TF-A image <plnx-proj-root>/images/linux/bl31.elf with QEMU, and the TF-A then boots the loaded kernel image, with PMU firmware running in the background.
      Note: For Zynq UltraScale+ MPSoC kernel boot, create a pre-built/linux/images/ folder and copy pmu_rom_qemu_sha3.elf from any Zynq UltraScale+ MPSoC BSP project. You can also pass pmu_rom_qemu_sha3.elf using --pmu-qemu-args.
      $ cd <plnx-proj-root>
      $ mkdir -p pre-built/linux/images
      $ cp <zynq UltraScale+ bsp project directory>/pre-built/linux/images/pmu_rom_qemu_sha3.elf pre-built/linux/images/
      

      or

      petalinux-boot --qemu --u-boot --kernel --pmu-qemu-args "pmu_rom_qemu_sha3.elf"
    • For Versal® ACAP, it loads the kernel image <plnx-proj-root>/images/linux/Image and boots the TF-A image <plnx-proj-root>/images/linux/bl31.elf with QEMU, and the TF-A then boots the loaded kernel image with PLM and PSM firmware running in the background.
      Note: For Versal ACAP, QEMU boots up to the tiny root file system if switch_root is enabled and gives you the RootFS prompt with ERROR: There's no '/dev' on rootfs.. message. This is because PetaLinux uses the SD boot mode in QEMU and the SD image has only FAT with tiny rootfs by default. To disable switch_root, see Disabling switch_root

After Linux is booted successfully, try commands such as ls, ifconfig, cat/proc/cpuinfo and so on. They behave the same as on real hardware. To exit the emulator when you are finished, press Ctrl + A, release, and then press X

  • To download a customized U-Boot image with --uboot/--u-boot option:
    $ petalinux-boot --qemu --u-boot/--uboot <specify custom u-boot.elf path>
  • To download a customized kernel image with --kernel option:
    • For Zynq UltraScale+ MPSoC and Versal ACAP, use image:
      petalinux-boot --qemu --kernel <specify custom Image path>
    • For Zynq-7000 devices, use zImage:
      $ petalinux-boot --qemu --kernel <specify custom zimage path>
    • For MicroBlaze processors, use Image.elf:
      $ petalinux-boot --qemu --kernel <specify custom Image.elf path>
  • To download a customized root file system image with --rootfs option:
    $ petalinux-boot --qemu --kernel --rootfs <specify custom cpio.gz.u-boot path>
  • To download a customized dtb image with --kernel option:
    $ petalinux-boot --qemu --kernel <specify custom kernel path> --dtb <specify custom dtb path>
  • To download a customized dtb image with --uboot/--u-boot option:
    $ petalinux-boot --qemu --u-boot/--uboot <specify custom u-boot path> --dtb <specify custom dtb path> 

    This is not supported by Versal ACAPs.

  • To download a customized pmufw image with the --kernel option:
    $ petalinux-boot --qemu --kernel <specify custom kernel path> --pmufw <specify custom pmufw.elf path>
  • To download a customized pmufw image with --uboot/--u-boot option:
    $ petalinux-boot --qemu --uboot/--u-boot <specify custom u-boot path> --pmufw <specify custom pmufw.elf path>
Note: QEMU version has been upgraded to 5.1. The old options are deprecated in the new version but remain functionally operational. Warning messages are displayed because PetaLinux tools still use the old options. You can ignore them.