meta-rcar-gen3: Add Xen specific device tree for m3ulcb 01/22201/9
authorJérémy Fanguède <j.fanguede@virtualopensystems.com>
Thu, 18 Jul 2019 15:17:30 +0000 (17:17 +0200)
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>
Thu, 12 Mar 2020 18:01:05 +0000 (18:01 +0000)
Provide a specific version of the device tree (appended with -xen) to
run with Xen. Only the R-Car m3ulcb board is supported and tested so
far.

Add also the Xen block device backend support in the kernel, to be
able to run block device based DomU.

From U-Boot, Xen and Linux Dom0 can be run as follows (assuming
binaries are in sdcard first partition):
> setenv bootargs
> fatload mmc 0:1 0x48080000 xen-m3ulcb.uImage
> fatload mmc 0:1 0x48000000 r8a7796-m3ulcb-xen.dtb
> fatload mmc 0:1 0x7a000000 Image-m3ulcb.bin
> bootm 0x48080000 - 0x48000000

The Linux Dom0 bootargs are hardcoded in the device tree, the rootfs
is expected to be on /dev/mmcblk1p2

Bug-AGL: SPEC-2912
Change-Id: Ia86e0789650eaf79d13691cf4f53755c8cb8f06c
Signed-off-by: Jérémy Fanguède <j.fanguede@virtualopensystems.com>
meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/r8a7796-m3ulcb-xen.dts [new file with mode: 0644]
meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/xen-be.cfg [new file with mode: 0644]
meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/linux-renesas_%.bbappend

diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/r8a7796-m3ulcb-xen.dts b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/r8a7796-m3ulcb-xen.dts
new file mode 100644 (file)
index 0000000..7940b10
--- /dev/null
@@ -0,0 +1,91 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Device Tree Source for the M3ULCB (R-Car Starter Kit Pro) board
+ *
+ * Copyright (C) 2016-2018 Renesas Electronics Corp.
+ * Copyright (C) 2016 Cogent Embedded, Inc.
+ */
+
+/dts-v1/;
+#include "r8a7796.dtsi"
+#include "ulcb.dtsi"
+
+/ {
+       model = "Renesas M3ULCB board based on r8a7796";
+       compatible = "renesas,m3ulcb", "renesas,r8a7796";
+
+
+       chosen {
+               /delete-property/ bootargs;
+               xen,xen-bootargs = "dom0_mem=752M console=dtuart dtuart=serial0 dom0_max_vcpus=4";
+                xen,dom0-bootargs = "console=hvc0 clk_ignore_unused root=/dev/mmcblk1p2 rw rootwait ignore_loglevel cma=32M earlyprintk";
+
+                #address-cells = <2>;
+                #size-cells = <2>;
+                modules {
+                        module@0 {
+                                compatible = "xen,linux-zimage",
+                               "xen,multiboot-module";
+                                reg = <0x0 0x7a000000 0x0 0x02000000>;
+                        };
+                };
+       };
+
+       cpus {
+               idle-states {
+                       /delete-node/ cpu-sleep-1;
+               };
+       };
+
+       memory@48000000 {
+               device_type = "memory";
+               /* first 128MB is reserved for secure area. */
+               reg = <0x0 0x48000000 0x0 0x38000000>, <0x6 0x00000000 0x0 0x40000000>;
+       };
+
+       vspm_if {
+               compatible = "renesas,vspm_if";
+       };
+
+       versaclock5_out3: versaclk-3 {
+               compatible = "fixed-clock";
+               #clock-cells = <0>;
+               /* Initial value of versaclock out3 */
+               clock-frequency = <33000000>;
+       };
+};
+
+&a53_0 {
+       /delete-property/ cpu-idle-states;
+};
+
+&a53_1 {
+       /delete-property/ cpu-idle-states;
+};
+
+&a53_2 {
+       /delete-property/ cpu-idle-states;
+};
+
+&a53_3 {
+       /delete-property/ cpu-idle-states;
+};
+
+&du {
+       clocks = <&cpg CPG_MOD 724>,
+                <&cpg CPG_MOD 723>,
+                <&cpg CPG_MOD 722>,
+                <&versaclock5 1>,
+                <&versaclock5_out3>,
+                <&versaclock5 2>;
+       clock-names = "du.0", "du.1", "du.2",
+                     "dclkin.0", "dclkin.1", "dclkin.2";
+};
+
+&vspb {
+       status = "okay";
+};
+
+&vspi0 {
+       status = "okay";
+};
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/xen-be.cfg b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/xen-be.cfg
new file mode 100644 (file)
index 0000000..c9fc6d7
--- /dev/null
@@ -0,0 +1 @@
+CONFIG_XEN_BLKDEV_BACKEND=y
index e72dc3d..6db5af3 100644 (file)
@@ -9,3 +9,14 @@ SRC_URI_append  = " file://namespace_fix.cfg \
 SRC_URI_append_ulcb = " \
     file://0004-ADSP-enable-and-add-sound-hardware-abstraction.patch \
 "
+
+# For Xen
+SRC_URI_append = " \
+    ${@bb.utils.contains('AGL_XEN_WANTED','1','file://xen-be.cfg','',d)} \
+"
+SRC_URI_append_m3ulcb = " \
+    ${@bb.utils.contains('AGL_XEN_WANTED','1','file://r8a7796-m3ulcb-xen.dts;subdir=git/arch/${ARCH}/boot/dts/renesas','',d)} \
+"
+KERNEL_DEVICETREE_append_m3ulcb = " \
+    ${@bb.utils.contains('AGL_XEN_WANTED','1','renesas/r8a7796-m3ulcb-xen.dtb','',d)} \
+"
\ No newline at end of file