QEMU a Zynq 7000

Configure and run a qemu zynq.

Blink a led on zynq 7000 emulation

For that we add a new layer to the yocto project:
sources/meta-zynq-qemu-led/
├── conf
│ └── layer.conf
└── recipes-kernel
├── linux
│ ├── linux-xlnx
│ │ ├── 0001-ARM-dts-xilinx-Add-zynq-qemu-pl-led.dtb.patch
│ │ └── zynq-qemu-pl-led.dts
│ └── linux-xlnx_%.bbappend
└── qemu-zynq-pl-led
├── files
│ ├── Makefile
│ └── qemu-zynq-pl-led.c
└── qemu-zynq-pl-led_0.1.bb

The layer.conf is as following:

WE need a device tree source to emulate a minimal PL in QEMU. The file zynq-qemu-pl-led.dts describes a mininal board layout. For that we create a new layer and save the file to it: ~/yocto/latest/sources/meta-zynq-qemu-led/recipes-kernel/linux/linux-xlnx/zynq-qemu-pl-led.dts. The file content is:

A patch is required to inform the kernel about our device tree extension. in the patch stage of bitbake the patch will be integrated. The patch is in 0001-ARM-dts-xilinx-Add-zynq-qemu-pl-led.dtb.patch:

Now we add a kernel module to write the pl register. Path is ~/yocto/latest/sources/meta-zynq-qemu-led/recipes-kernel/qemu-zynq-pl-led/files/qemu-zynq-pl-led.c. Below is the content:

A make file to build and install the kernel module, ~/yocto/latest/sources/meta-zynq-qemu-led/recipes-kernel/qemu-zynq-pl-led/files/Makefile

To build and package the module, a bitbake file is added ~/yocto/latest/sources/meta-zynq-qemu-led/recipes-kernel/qemu-zynq-pl-led/qemu-zynq-pl-led_0.1.bb

a bb append file ~/yocto/latest/sources/meta-zynq-qemu-led/recipes-kernel/linux/linux-xlnx_%.bbappend to customize the xilinx kernel with our device tree.

Build and test

Subscribe to get last updates.

×