Xen Zynq Distribution Support Forums
XZD Yocto Layer - Printable Version

+- Xen Zynq Distribution Support Forums (http://xzdforums.dornerworks.com)
+-- Forum: General Xilinx Support (http://xzdforums.dornerworks.com/forumdisplay.php?fid=1)
+--- Forum: Knowledge Base (http://xzdforums.dornerworks.com/forumdisplay.php?fid=11)
+--- Thread: XZD Yocto Layer (/showthread.php?tid=666)



XZD Yocto Layer - Nathan.Studer - 04-12-2017

In preparation for the 2017.1 XZD release, the XZD Yocto Layer has been made publicly available.  This Yocto Layer can currently be used to generate XZD kernel images and root filesystems with the 2016.4 version of XSDK.

The layer and instructions for using it can be found in github at https://github.com/dornerworks/meta-xzd .  A repo manifest which simplifies the process can also be found in github at https://github.com/dornerworks/xzd-yocto-manifests .

     Nate


RE: XZD Yocto Layer - ariefgrand - 07-12-2017

Hello,

I am a newbie in using Xen Hypervisor. I just bought Zynq MPSoC UltraScale+ (ZCU102 Rev 1.0) and I want to run Xen hypervisor on it.
However, I found some difficulties in following the tutorial to generate a working bootloader.
I tried to clone some repositories from the link you gave above, but there are several dependencies which do not work anymore, e.g. git://git.openembedded.org/meta-qt5 or git://git.openembedded.org/meta-xilinx. And from the tutorial that Donnerworks provide (http://dornerworks.com/wp-content/uploads/2016/09/Xen%20Zynq%20Distribution%20(XZD)%20User%27s%20Manual.pdf), i could not boot the Xen either. I think it's because i use a board with different revision?

Do you have any other source that I can use to learn how to boot Xen hypervisor on my board?
Thank you.

Cheers,


RE: XZD Yocto Layer - Nathan.Studer - 07-12-2017

Quote:ariefgrand

I am a newbie in using Xen Hypervisor. I just bought Zynq MPSoC UltraScale+ (ZCU102 Rev 1.0) and I want to run Xen hypervisor on it.

However, I found some difficulties in following the tutorial to generate a working bootloader.


See this thread, which I think also addresses what you are trying to do.


Quote:ariefgrand

I tried to clone some repositories from the link you gave above, but there are several dependencies which do not work anymore, e.g. git://git.openembedded.org/meta-qt5 or git://git.openembedded.org/meta-xilinx

There are some mistakes in the URLs listed in the ReadMe.  However you should use the repo tool and manifest link provided to simplify getting all the repositories and setting up the project, and the manifest does use the correct URLs.

If you are using PetaLinx 2017.1, I should warn you that the released Yocto layer currently only supports the 2016.4 version of the Xilinx tools.

Quote:ariefgrand

Do you have any other source that I can use to learn how to boot Xen hypervisor on my board?

Xilinx has a wiki page for Using Xen with PetaLinux, which may be helpful.


     Nate


RE: XZD Yocto Layer - ariefgrand - 08-10-2017

Hi Nate,

Thank you for your suggestions .
Finally I'm using Xen Petalinux now. The link that you gave is very useful.
I am now able to boot Xen on my ZCU102 board with Dom0 and use the same kernel for DomU.
Here are my next questions:
1. In Dornerworks tutorial, I saw the procedures to build Dom0. I saw that you need to build it from buildroot git and insert components/apps/xen/ from the BSP given. If I use the petalinux 2017.1 BSP, can I just copy the entire folder to my Petalinux project? Will the buildroot git compatible with the next Petalinux versions?
2. How can I configure the U-boot so that it can automatically boot the Xen, without typing commands like this everytime
Code:
mmc dev $sdbootdev && mmcinfo; load mmc $sdbootdev:$partid 4000000 system.dtb && load mmc $sdbootdev:$partid 0x80000 Image; fdt addr 4000000; load mmc $sdbootdev:$partid 6000000 xen.ub; load mmc $sdbootdev:$partid 9000000 rootfs.cpio.gz.u-boot; bootm 6000000 9000000 4000000
3. If I use two partitions on my SD card, BOOT for the first partition and ROOTFS for the second. I should put the Dom0.img in the second partition, right? But then, how can I configure the U-boot to boot the rootfs from the second partition. Not from ramdisk. Especially with the Xen inside.

Thank you so much for your insights.

PS: I was wondering if I should make a new thread for these questions.

Arief


RE: XZD Yocto Layer - ariefgrand - 08-10-2017

Nate,

I found the solution for number 2. It was pretty easy actually.
I just changed the bootcmd environment variable in u-boot with the code and it works.
However, I couldn't find anywhere about the booting using Xen. I can boot normal petalinux with rootfs in the second partition (/dev/mmcblk0p2 in my case),
but not with Xen hypervisor. For now, what I did is modifying the menu in petalinux-config so that it uses SD card as the rootfs.

Arief


RE: XZD Yocto Layer - Nathan.Studer - 08-14-2017

(08-10-2017, 08:48 AM)ariefgrand Wrote: 1. In Dornerworks tutorial, I saw the procedures to build Dom0. I saw that you need to build it from buildroot git and insert components/apps/xen/ from the BSP given. If I use the petalinux 2017.1 BSP, can I just copy the entire folder to my Petalinux project? Will the buildroot git compatible with the next Petalinux versions? 

If you followed the instructions on the Xilinx wiki page, you should be able to use your Yocto FS as Dom0 instead of a buildroot based one.  This is probably the best route anyway, since a buildroot based rootFS is not planned on being supported in the future.

You could try to follow the User Manual to perform the buildroot build with PetaLinux 2017.1, but I'm not sure how well the User Manual will match that version of the Xilinx tools and you may run into other issues.

(08-10-2017, 08:48 AM)ariefgrand Wrote: 3. If I use two partitions on my SD card, BOOT for the first partition and ROOTFS for the second. I should put the Dom0.img in the second partition, right? But then, how can I configure the U-boot to boot the rootfs from the second partition. Not from ramdisk. Especially with the Xen inside.

Yes, put the Dom0.img or Dom0 Yocto rootfs on the second partition.  Assuming you're not using a initramfs kernel, you just need to update the kernel boot arguments in the device tree to point to the partition that contains the rootfs.

Code:
     xen,dom0-bootargs = "console=hvc0 earlycon=xenboot root=/dev/mmcblk1p2 rw";

If you're using an initramfs kernel, then the initramfs kernel needs to mount the true root partition and switch_root to it.

     Nate


RE: XZD Yocto Layer - ariefgrand - 08-14-2017

(08-14-2017, 01:15 PM)Nathan.Studer Wrote:
(08-10-2017, 08:48 AM)ariefgrand Wrote: 1. In Dornerworks tutorial, I saw the procedures to build Dom0. I saw that you need to build it from buildroot git and insert components/apps/xen/ from the BSP given. If I use the petalinux 2017.1 BSP, can I just copy the entire folder to my Petalinux project? Will the buildroot git compatible with the next Petalinux versions? 

If you followed the instructions on the Xilinx wiki page, you should be able to use your Yocto FS as Dom0 instead of a buildroot based one.  This is probably the best route anyway, since a buildroot based rootFS is not planned on being supported in the future.

You could try to follow the User Manual to perform the buildroot build with PetaLinux 2017.1, but I'm not sure how well the User Manual will match that version of the Xilinx tools and you may run into other issues.

(08-10-2017, 08:48 AM)ariefgrand Wrote: 3. If I use two partitions on my SD card, BOOT for the first partition and ROOTFS for the second. I should put the Dom0.img in the second partition, right? But then, how can I configure the U-boot to boot the rootfs from the second partition. Not from ramdisk. Especially with the Xen inside.

Yes, put the Dom0.img or Dom0 Yocto rootfs on the second partition.  Assuming you're not using a initramfs kernel, you just need to update the kernel boot arguments in the device tree to point to the partition that contains the rootfs.

Code:
     xen,dom0-bootargs = "console=hvc0 earlycon=xenboot root=/dev/mmcblk1p2 rw";

If you're using an initramfs kernel, then the initramfs kernel needs to mount the true root partition and switch_root to it.

     Nate

Hi Nate,

Thank you so much for your suggestions. It works!

Arief