Xen ARM with Virtualization Extensions/Stout

From Xen
Revision as of 18:06, 17 May 2019 by Otyshchenko (talk | contribs)

This wiki describes how to run Xen on Renesas Stout board with R-Car H2 SoC.

Main information how to deal with Stout board are located at: https://elinux.org/R-Car/Boards/Yocto https://elinux.org/R-Car/Boards/Stout

Prepare U-boot

Get U-Boot sources

Clone sources from upstream and checkout on commit 425c0a43fbbec36571f6a03b530695b8b16a841d “Prepare v2019.01-rc3”:

git clone git://git.denx.de/u-boot.git
cd u-boot
git checkout 425c0a43fbbec36571f6a03b530695b8b16a841d -b stout_uboot

Apply additional patches

Apply the following patch series (PSCI support for r8a7790 SoC): http://u-boot.10912.n7.nabble.com/PATCH-0-3-PSCI-support-for-r8a7790-SoC-Lager-Stout-boards-td357352.html

Configure U-Boot

export CROSS_COMPILE=<path_to_gcc>
make stout_defconfig
make menuconfig

Set maximum supported CPUs for PSCI to 8:

    ARM architecture  --->
        [*] Enable support for booting in non-secure mode
            (8) Maximum supported CPUs for PSCI

Build U-Boot


Copy resulting images to tftp directory for the future flashing:

sudo cp u-boot.img <path_to_tftp_dir>/
sudo cp spl/u-boot-spl.bin <path_to_tftp_dir>/

Prepare Xen

Get Xen sources

Clone sources from upstream and checkout on commit ca135a4863ffeedca451651835fcd9aef6c872ff: “xen/arm: Add early printk support for SCIFA compatible UARTs”

git clone git://xenbits.xenproject.org/xen.git
cd xen
git checkout ca135a4863ffeedca451651835fcd9aef6c872ff -b stout_xen

Apply additional patches

Apply the following small patch series (Support of handling nodes with “interrupts-extended” property): https://www.mail-archive.com/xen-devel@lists.xenproject.org/msg44364.html

Please note, if you can’t apply that patch series to Xen for some reason, then you should apply the following patch to Linux when preparing it (to not use “interrupts-extended” property for ARCH timer node):


Configure Xen

export CROSS_COMPILE=<path_to_gcc>
XEN_TARGET_ARCH=arm32 ./configure
cd xen
make menuconfig XEN_TARGET_ARCH=arm32 

Enable debugging option:

    Debugging Options  --->
        [*] Developer Checks

Build Xen

With earlyprintk support:

cd ../
make xen XEN_TARGET_ARCH=arm32 debug=y CONFIG_EARLY_PRINTK=scif,0xe6c40000,A

- or -

Without earlyprintk support:

cd ../
make xen XEN_TARGET_ARCH=arm32 debug=y

Make Xen uImage:

mkimage -A arm -C none -T kernel -a 0x48000000 -e 0x48000000 -n "XEN" -d xen/xen xen-uImage

Build xenpolicy:

make -C tools/flask/policy

Copy resulting images to micro SD card (prepared beforehand):

sudo cp xen-uImage <path_to_sd_card_partition>/boot/
sudo cp tools/flask/policy/xenpolicy* <path_to_sd_card_partition>/boot/xenpolicy