[meta-xilinx] How to boot the ZynqMP?

Jean-Francois Dagenais jeff.dagenais at gmail.com
Fri Aug 18 18:20:16 PDT 2017


Hi Mike,

> On Aug 18, 2017, at 08:25, Mike Looijmans <mike.looijmans at topic.nl> wrote:
> 
> I have a zcu102 board. I built "core-image-minimal" for the board. This succeeded. Now I have a bunch of files in the image deploy directory.
> 
> What do I do with these files to boot the board from an SD card?
> 
> For the Zynq, one needed boot.bin, u-boot.img and uImage.
> 
> For the zynqmp, there's also the arm-trusted-firmware and pmu-firmware. I have no idea whatsoever what I'm supposed to do with these. There is no boot.bin at all.
> 
> 
> The wiki pages aren't any help either, they're either outdated or just plain wrong.
> 

Yeah, on zynq7, things were simpler with u-boot providing both the SPL (or first stage boot.bin file), and the proper u-boot loader for the kernel. Things were all nicely tied together. Now, one has to tie a few knots to get "burnable" products ready-made by yocto.

Take a look at https://github.com/Xilinx/meta-xilinx-tools/blob/master/README.md

Basically, I switched to meta-xilinx-tools. This wasn't pretty since I am bound to building everything in docker containers through gitlab-ci. I finally managed to get things working the way we need it to.

It's not a pretty tool stack, the Xilinx SDK is pretty hacky (cmd line tools have dependencies to X11 and run a fake gui to execute commands), but the trail is pretty beaten by now and most of the kinks have been run over a number of times! ;)

Basically, through IMAGE_CLASSES, xilinx-bootbin tasks are added to every images (which is being debated on meta-xilinx now, I submitted a patch where xilinx-bootbin becomes a proper recipe). Anyway, once you have the boot.bin, simply copying it to the first fat partition of SD (or eMMC) is good enough. I use a slightly modified version of http://git.yoctoproject.org/cgit.cgi/poky/tree/scripts/lib/wic/canned-wks/sdimage-bootpart.wks where I add more files to the boot partition:


I made zynq-wic-sdcard.bbclass automatically inherited by all images through IMAGE_CLASSES with this content:

WKS_FILES = "zynq-wic-sdcard.wks"
IMAGE_DEPENDS_wic += "dosfstools-native mtools-native e2fsprogs-native"

do_image_wic[depends] += "\
xilinx-bootbin:do_deploy \
"

python () {
	initRdImage = d.getVar("INITRD_IMAGE", True)
	if initRdImage:
		d.appendVarFlag("do_image_wic", "depends", " " + initRdImage + ":do_image_complete")
}

IMAGE_CMD_wic_append() {
	cd ${DEPLOY_DIR_IMAGE}

	ln -sfv ${IMAGE_LINK_NAME}.wic.lz4 ${IMAGE_LINK_NAME}.sdcard.lz4
}

===============================
And here's zynq-wic-sdcard.wks:

# short-description: Create SD card image with a boot partition
# long-description: Creates a partitioned SD card image. Boot files
# are located in the first vfat partition.

# !! the partition alignment must match that found in test files
# we add 6MB to the boot partition to allow devs to copy a fpga.bin for example
part /boot --source bootimg-partition --ondisk mmcblk --fstype=vfat --label ZBOOT --active --align 4096 --extra-space 6
part / --source rootfs --ondisk mmcblk --fstype=ext4 --label rootfs  --align 4096 --extra-space 5




You can find my patch on meta-xilinx which turns xilinx-bootbin into a recipe (https://www.mail-archive.com/meta-xilinx@yoctoproject.org/msg01664.html). This is for the do_image_wic[depends] += "xilinx-bootbin:do_deploy" to work ;)

Enjoy!




More information about the meta-xilinx mailing list