cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Visitor
Visitor
3,714 Views
Registered: ‎02-21-2018

Issues w/ ZynqMP Kernel testing on QEMU

Jump to solution

Hi everyone,

 

I am trying to test a Linux boot image for a ZynqMP device in QEMU. I am following the Petalinux Workflow tutorial (UG1156). I've completed section 5 using the default settings and created the files. I am struggling in section 6, and am unable to verify he files are working correctly. When I try the default command <petalinux-boot --qemu --kernel>, it returns an error that a file can't be found in a directory that doesn't exist.

ERROR: Failed to boot. Image file '/home/dstest/petalinux/proj/FIFO4/pre-built/linux/images/pmu_rom_qemu_sha3.elf' doesn't exist.

If I try to specify the pmu file and the kernel image it hangs : <petalinux-boot --qemu --pmufw ./images/linux/pmufw.elf --image ./images/linux/Image>

INFO: No DTB has been specified, use the default one "./images/linux/system.dtb".
INFO: No DTB has been specified, use the default one "/home/dstest/petalinux/proj/FIFO4/images/linux/system.dtb".
INFO: Set QEMU tftp to /home/dstest/petalinux/proj/FIFO4/images/linux 
INFO: TCP PORT is free 
INFO: Starting aarch64 QEMU
INFO:  qemu-system-aarch64 -M arm-generic-fdt   -serial mon:stdio -serial /dev/null -display none -kernel ./images/linux/Image -gdb tcp::9000 -dtb ./images/linux/system.dtb     -hw-dtb /home/dstest/petalinux/proj/FIFO4/images/linux/zynqmp-qemu-multiarch-arm.dtb -machine-path /tmp/tmp.pUwBuC2PWV -global xlnx,zynqmp-boot.cpu-num=0 -global xlnx,zynqmp-boot.use-pmufw=true  -m 4G
qemu-system-aarch64: Failed to connect socket: No such file or directory
QEMU waiting for connection on: disconnected:unix:/tmp/tmp.pUwBuC2PWV/qemu-rport-_pmu@0,server

If I specify no pmu, then booting starts, but eventually hangs: <petalinux-boot --qemu --pmufw no --image ./images/linux/Image>

INFO: No DTB has been specified, use the default one "/home/dstest/petalinux/proj/FIFO4/images/linux/system.dtb".
INFO: Set QEMU tftp to /home/dstest/petalinux/proj/FIFO4/images/linux 
INFO: TCP PORT is free 
INFO: Starting aarch64 QEMU
INFO:  qemu-system-aarch64 -M arm-generic-fdt   -serial mon:stdio -serial /dev/null -display none -device loader,file=/home/dstest/petalinux/proj/FIFO4/images/linux/bl31.elf,cpu-num=0 -device loader,file=./images/linux/Image,addr=0x00080000 -device loader,file=./images/linux/system.dtb,addr=0x1407f000 -device loader,file=/home/dstest/petalinux/proj/FIFO4/build/misc/linux-boot/linux-boot.elf -gdb tcp::9000 -dtb /home/dstest/petalinux/proj/FIFO4/images/linux/system.dtb     -hw-dtb /home/dstest/petalinux/proj/FIFO4/images/linux/zynqmp-qemu-arm.dtb -device loader,addr=0xfd1a0104,data=0x8000000e,data-len=4  -m 4G
audio: Could not init `oss' audio driver
NOTICE:  ATF running on XCZUUNKN/QEMU v1/RTL0.0 at 0xfffea000
NOTICE:  BL31: Secure code at 0x60000000
NOTICE:  BL31: Non secure code at 0x8000000
NOTICE:  BL31: v1.3(release):47af34b
NOTICE:  BL31: Built : 21:01:18, Feb 21 2018
[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.9.0-xilinx-v2017.4 (Bogdan@esp_station) (gcc version 6.2.1 20161016 (Linaro GCC 6.2-2016.11) ) #2 SMP Wed Feb 21 16:07:25 EST 2018
[    0.000000] Boot CPU: AArch64 Processor [410fd034]
[    0.000000] earlycon: cdns0 at MMIO 0x00000000ff000000 (options '115200n8')
[    0.000000] bootconsole [cdns0] enabled
[    0.000000] efi: Getting EFI parameters from FDT:
[    0.000000] efi: UEFI not found.
[    0.000000] cma: Reserved 256 MiB at 0x0000000070000000
[    0.000000] psci: probing for conduit method from DT.
[    0.000000] psci: PSCIv1.0 detected in firmware.
[    0.000000] psci: Using standard PSCI v0.2 function IDs
[    0.000000] psci: MIGRATE_INFO_TYPE not supported.
[    0.000000] percpu: Embedded 21 pages/cpu @ffffffc06ff78000 s48152 r8192 d29672 u86016
[    0.000000] Detected VIPT I-cache on CPU0
[    0.000000] CPU features: enabling workaround for ARM erratum 845719
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 517120
[    0.000000] Kernel command line: earlycon clk_ignore_unused
[    0.000000] PID hash table entries: 4096 (order: 3, 32768 bytes)
[    0.000000] Dentry cache hash table entries: 262144 (order: 9, 2097152 bytes)
[    0.000000] Inode-cache hash table entries: 131072 (order: 8, 1048576 bytes)
[    0.000000] Memory: 1784188K/2097152K available (9020K kernel code, 582K rwdata, 2828K rodata, 5568K init, 394K bss, 50820K reserved, 262144K cma-reserved)
[    0.000000] Virtual kernel memory layout:
[    0.000000]     modules : 0xffffff8000000000 - 0xffffff8008000000   (   128 MB)
[    0.000000]     vmalloc : 0xffffff8008000000 - 0xffffffbebfff0000   (   250 GB)
[    0.000000]       .text : 0xffffff8008080000 - 0xffffff8008950000   (  9024 KB)
[    0.000000]     .rodata : 0xffffff8008950000 - 0xffffff8008c20000   (  2880 KB)
[    0.000000]       .init : 0xffffff8008c20000 - 0xffffff8009190000   (  5568 KB)
[    0.000000]       .data : 0xffffff8009190000 - 0xffffff8009221a00   (   583 KB)
[    0.000000]        .bss : 0xffffff8009221a00 - 0xffffff80092845b4   (   395 KB)
[    0.000000]     fixed   : 0xffffffbefe7fd000 - 0xffffffbefec00000   (  4108 KB)
[    0.000000]     PCI I/O : 0xffffffbefee00000 - 0xffffffbeffe00000   (    16 MB)
[    0.000000]     vmemmap : 0xffffffbf00000000 - 0xffffffc000000000   (     4 GB maximum)
[    0.000000]               0xffffffbf00000000 - 0xffffffbf01c00000   (    28 MB actual)
[    0.000000]     memory  : 0xffffffc000000000 - 0xffffffc080000000   (  2048 MB)
[    0.000000] Hierarchical RCU implementation.
[    0.000000] 	Build-time adjustment of leaf fanout to 64.
[    0.000000] 	RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=4.
[    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=64, nr_cpu_ids=4
[    0.000000] NR_IRQS:64 nr_irqs:64 0
[    0.000000] GIC: Adjusting CPU interface base to 0x00000000f902f000
[    0.000000] GIC: Using split EOI/Deactivate mode
[    0.000000] arm_arch_timer: Architected cp15 timer(s) running at 50.00MHz (phys).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0xb8812736b, max_idle_ns: 440795202655 ns
[    0.000222] sched_clock: 56 bits at 50MHz, resolution 20ns, wraps every 4398046511100ns
[    0.015629] Console: colour dummy device 80x25
[    0.016171] console [tty0] enabled
[    0.017120] bootconsole [cdns0] disabled

Has anyone successfully simulated Linux boot on ZynqMP using qemu? Does anyone know what is causing issues on my end?

 

Thanks,

bog_dan

 

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Moderator
Moderator
4,302 Views
Registered: ‎05-10-2017

pmu_rom_qemu_sha3.elf is available with the ZCU102 bsp. You will need to download the bsp for ZynqMP from here

https://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/embedded-design-tools.html

Once you extract the files, the pmu rom elf will be present in the pre-built folder.

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------

View solution in original post

0 Kudos
4 Replies
Highlighted
Moderator
Moderator
4,303 Views
Registered: ‎05-10-2017

pmu_rom_qemu_sha3.elf is available with the ZCU102 bsp. You will need to download the bsp for ZynqMP from here

https://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/embedded-design-tools.html

Once you extract the files, the pmu rom elf will be present in the pre-built folder.

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------

View solution in original post

0 Kudos
Highlighted
Explorer
Explorer
2,878 Views
Registered: ‎02-19-2018

Sorry to ressurect an old thread, but I don't quite follow the accepted solution. @jovitac Is your suggestion that we copy the pmu_rom_qemu_sha3.elf file from the downloaded BSP into our own project?

 

Also, why is the pmufw.elf file not copied into the pre-built folder when using petalinux-package --prebuilt? I had to manually include it in the pre-built image using -a images/linux/pmufw.elf:images/pmufw.elf

0 Kudos
Highlighted
Moderator
Moderator
2,874 Views
Registered: ‎05-10-2017

That's right. You will need to copy the pmu_rom_qemu_sha3.elf into your project.

 

pmufw.elf does not get included with the package command

Commmand "petalinux-package --prebuilt" packages prebuilt for project

Options for prebuilt:
  -p, --project <PROJECT>      PetaLinux SDK project.
                               Default is the working project.
  --force                      Force update the pre-built folder
  --clean                      Clean pre-built directory (remove any files).
  --fpga <BITSTREAM>           FPGA bitstream
  -a, --add  src:dest          Add file/folder to prebuilt directory
                               "src" with "dest"

EXAMPLES:

Package prebuilt images:
  $ petalinux-package --prebuilt
  It will create a pre-built/ directory in <PROJECT>/, and copy the following
  files from <PROJECT>/images to <PROJECT>/pre-built/linux/images/ directory:
    * images.ub
    * system.dtb
    * u-boot.elf
    * image.elf
    * System.map.linux
    * u-boot-s.bin (For MicroBlaze only)
    * zImage (For zynq only)
    * zynq_fsbl.elf (If it is there for zynq only)
    * BOOT.BIN (If it is there for zynq only)

Package prebuilt images and specified bitstream:
  $ petalinux-package --prebuilt --fpga <BITSTREAM>
  Besides copying the images, it will copy the bitstream to
  <PROJECT>/pre-built/linux/implentation/

Package prebuilt images and add myfile to prebuilt:
  $ petalinux-package --prebuilt -a myfile:images/myfile
  Besides copying the images, it will copy myfile to
  <PROJECT>/pre-built/linux/images/myfile

 

 

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
Highlighted
Visitor
Visitor
381 Views
Registered: ‎05-04-2018

Thanks for the solution jovitac.

I found I needed to extract the 'pre-built' directory from xilinx-zcu106-v2019.2-final.bsp (its really a tgz file) and place it in my project directory.  Then this command ran qemu properly:

petalinux-boot --qemu --pmufw images/linux/pmufw.elf --image images/linux/Image

To exit from qemu, use ctrl-a followed by 'x'.

0 Kudos