Difference between revisions of "Xen ARM with Virtualization Extensions/OMAP5432 uEVM"

From Xen
(Delete PSCI node in DTS)
 
(5 intermediate revisions by 3 users not shown)
Line 60: Line 60:
 
CONFIG_XEN_GRANT_DEV_ALLOC=y
 
CONFIG_XEN_GRANT_DEV_ALLOC=y
 
CONFIG_XEN_PRIVCMD=y
 
CONFIG_XEN_PRIVCMD=y
</pre>
 
 
OMAP kernel still uses hwmod to describe its on-chip hardware blocks. Thus, we need to disable
 
the UART3 used by Xen serial console by directly modifying the kernel source.
 
 
<pre>
 
diff --git a/arch/arm/mach-omap2/omap_hwmod_54xx_data.c b/arch/arm/mach-omap2/omap_hwmod_54xx_data.c
 
index 8923172..29e2b68 100644
 
--- a/arch/arm/mach-omap2/omap_hwmod_54xx_data.c
 
+++ b/arch/arm/mach-omap2/omap_hwmod_54xx_data.c
 
@@ -2474,7 +2474,9 @@ static struct omap_hwmod_ocp_if *omap54xx_hwmod_ocp_ifs[] __initdata = {
 
&omap54xx_l4_per__timer11,
 
&omap54xx_l4_per__uart1,
 
&omap54xx_l4_per__uart2,
 
+#if 0
 
&omap54xx_l4_per__uart3,
 
+#endif
 
&omap54xx_l4_per__uart4,
 
&omap54xx_l4_per__uart5,
 
&omap54xx_l4_per__uart6,
 
 
</pre>
 
</pre>
   
Line 94: Line 74:
 
<pre>
 
<pre>
 
diff --git a/arch/arm/boot/dts/omap5-uevm.dts b/arch/arm/boot/dts/omap5-uevm.dts
 
diff --git a/arch/arm/boot/dts/omap5-uevm.dts b/arch/arm/boot/dts/omap5-uevm.dts
index 3b99ec2..d6758ba 100644
+
index 3b99ec2..db58879 100644
 
--- a/arch/arm/boot/dts/omap5-uevm.dts
 
--- a/arch/arm/boot/dts/omap5-uevm.dts
 
+++ b/arch/arm/boot/dts/omap5-uevm.dts
 
+++ b/arch/arm/boot/dts/omap5-uevm.dts
@@ -15,6 +15,20 @@
+
@@ -199,7 +199,7 @@
model = "TI OMAP5 uEVM board";
 
compatible = "ti,omap5-uevm", "ti,omap5";
 
 
+ chosen {
 
+ bootargs = "dom0_mem=256M console=dtuart dtuart=serial2 earlyprintk=xen";
 
+ xen,dom0-bootargs = "console=hvc0,115200n8 earlyprintk=xen debug ignore_loglevel root=/dev/mmcblk0p2 rw rootwait fixrtc";
 
+ modules {
 
+ #address-cells = <1>;
 
+ #size-cells = <1>;
 
+
 
+ module@0 {
 
+ compatible = "xen,linux-zimage", "xen,multiboot-module";
 
+ reg = <0xa0000000 0xa00000>;
 
+ };
 
+ };
 
+ };
 
+
 
memory {
 
device_type = "memory";
 
reg = <0x80000000 0x7F000000>; /* 2032 MB */
 
@@ -199,7 +213,7 @@
 
 
};
 
};
   
Line 127: Line 86:
 
};
 
};
   
@@ -214,14 +228,6 @@
+
@@ -214,14 +214,6 @@
 
ti,non-removable;
 
ti,non-removable;
 
};
 
};
Line 142: Line 101:
 
pinctrl-names = "default";
 
pinctrl-names = "default";
 
pinctrl-0 = <&i2c1_pins>;
 
pinctrl-0 = <&i2c1_pins>;
@@ -436,10 +442,6 @@
+
@@ -436,10 +428,6 @@
 
clock-frequency = <400000>;
 
clock-frequency = <400000>;
 
};
 
};
Line 152: Line 111:
 
&usbhshost {
 
&usbhshost {
 
port2-mode = "ehci-hsic";
 
port2-mode = "ehci-hsic";
port3-mode = "ehci-hsic";
+
port3-mode = "ehci-hsic”;
 
diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
 
diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
 
index f8c9855..82d91ba 100644
 
index f8c9855..82d91ba 100644
Line 222: Line 181:
   
 
<pre>
 
<pre>
OMAP5430 EVM # fatload mmc 0:1 0x825f0000 omap5-uevm.dtb
+
OMAP5430 EVM # setenv dtb_addr_r 0x825f0000
OMAP5430 EVM # fatload mmc 0:1 0x90000000 xen-uImage
+
OMAP5430 EVM # setenv xen_addr_r 0x90000000
OMAP5430 EVM # fatload mmc 0:1 0xa0000000 zImage
+
OMAP5430 EVM # setenv kernel_addr_r 0xa0000000
OMAP5430 EVM # bootm 0x90000000 - 0x825f0000
+
OMAP5430 EVM # setenv xen_bootargs 'sync_console console=dtuart dtuart=serial2'
  +
OMAP5430 EVM # setenv dom0_bootargs 'console=hvc0,115200n8 earlyprintk=xen debug ignore_loglevel root=/dev/mmcblk0p2 rw rootwait fixrtc'
  +
OMAP5430 EVM # fatload mmc 0:1 $dtb_addr_r omap5-uevm.dtb
  +
OMAP5430 EVM # fatload mmc 0:1 $xen_addr_r xen-uImage
  +
OMAP5430 EVM # fatload mmc 0:1 $kernel_addr_r zImage
  +
OMAP5430 EVM # fdt addr $dtb_addr_r
  +
OMAP5430 EVM # fdt resize
  +
OMAP5430 EVM # fdt set /chosen xen,xen-bootargs \"$xen_bootargs\"
  +
OMAP5430 EVM # fdt resize
  +
OMAP5430 EVM # fdt set /chosen xen,dom0-bootargs \"$dom0_bootargs\"
  +
OMAP5430 EVM # fdt mknode /chosen modules
  +
OMAP5430 EVM # fdt set /chosen/modules '#address-cells' <1>
  +
OMAP5430 EVM # fdt set /chosen/modules '#size-cells' <1>
  +
OMAP5430 EVM # fdt mknode /chosen/modules module@0
  +
OMAP5430 EVM # fdt set /chosen/modules/module@0 compatible xen,linux-zimage xen,multiboot-module
  +
OMAP5430 EVM # fdt set /chosen/modules/module@0 reg <$kernel_addr_r 0xa00000>
  +
OMAP5430 EVM # bootm $xen_addr_r - $dtb_addr_r
 
</pre>
 
</pre>
  +
  +
= 4. Booting DomU =
  +
(TBD)
  +
  +
[[Category:XenARM]]
  +
[[Category:Developers]]
  +
[[Category:Xen 4.4]]
  +
[[Category:Xen 4.5]]

Latest revision as of 14:15, 22 December 2014

The OMAP5432 uEVM board is now supported in Xen upstream.

1. Prepare U-boot

Xen hypervisor requires to be booted in HYP mode by the bootloader. Make sure that the U-boot you use would keep staying in HYP mode when switching the control to Xen.

2. Build Xen and Linux Dom0

2.1 Build Xen hypervisor

Build Xen:

# git clone git://xenbits.xen.org/xen.git
# cd xen
# make dist-xen XEN_TARGET_ARCH=arm32 CROSS_COMPILE=arm-linux-gnueabihf- CONFIG_EARLY_PRINTK=omap5432

Create uImage for Xen:

 # mkimage -A arm -T kernel -a 0x80200000 -e 0x80200000 -C none -d "xen/xen" xen-uImage

2.2 Build Linux Dom0 kernel

Get the linux kernel source from upstream:

 # git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git

Use the default ‘omap2plus' as the base config:

# make omap2plus_defconfig ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-

Before adding the XEN related kernel configs, disable old omap SoCs support by unselecting the TI OMAP2/3/4 in the ‘System Type’ section of kernel configuration menus (by running ‘make menuconfig ARCH=arm’).

Adding the following config entries in .config and run ‘make olddefconfig ARCH=arm’:

CONFIG_XEN_DOM0=y
CONFIG_XEN=y
CONFIG_XEN_BLKDEV_FRONTEND=y
CONFIG_XEN_BLKDEV_BACKEND=y
CONFIG_XEN_NETDEV_FRONTEND=y
CONFIG_XEN_NETDEV_BACKEND=y
CONFIG_INPUT_XEN_KBDDEV_FRONTEND=y
CONFIG_HVC_XEN=y
CONFIG_HVC_XEN_FRONTEND=y
CONFIG_XEN_DEV_EVTCHN=y
CONFIG_XEN_BACKEND=y
CONFIG_XENFS=y
CONFIG_XEN_COMPAT_XENFS=y
CONFIG_XEN_SYS_HYPERVISOR=y
CONFIG_XEN_XENBUS_FRONTEND=y
CONFIG_XEN_GNTDEV=y
CONFIG_XEN_GRANT_DEV_ALLOC=y
CONFIG_XEN_PRIVCMD=y

Build the kernel:

# make zImage ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-

2.3 Build FDT

Apply the patch below to the upstream linux kernel and build the device tree blob.

diff --git a/arch/arm/boot/dts/omap5-uevm.dts b/arch/arm/boot/dts/omap5-uevm.dts
index 3b99ec2..db58879 100644
--- a/arch/arm/boot/dts/omap5-uevm.dts
+++ b/arch/arm/boot/dts/omap5-uevm.dts
@@ -199,7 +199,7 @@
 };

 &mmc1 {
-       vmmc-supply = <&ldo9_reg>;
+       vmmc-supply = <&vmmcsd_fixed>;
        bus-width = <4>;
 };

@@ -214,14 +214,6 @@
        ti,non-removable;
 };

-&mmc4 {
-       status = "disabled";
-};
-
-&mmc5 {
-       status = "disabled";
-};
-
 &i2c1 {
        pinctrl-names = "default";
        pinctrl-0 = <&i2c1_pins>;
@@ -436,10 +428,6 @@
        clock-frequency = <400000>;
 };

-&mcbsp3 {
-       status = "disabled";
-};
-
 &usbhshost {
        port2-mode = "ehci-hsic";
        port3-mode = "ehci-hsic”;
diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
index f8c9855..82d91ba 100644
--- a/arch/arm/boot/dts/omap5.dtsi
+++ b/arch/arm/boot/dts/omap5.dtsi
@@ -80,6 +80,7 @@
                             <GIC_PPI 14 (GIC_CPU_MASK_RAW(3) | IRQ_TYPE_LEVEL_LOW)>,
                             <GIC_PPI 11 (GIC_CPU_MASK_RAW(3) | IRQ_TYPE_LEVEL_LOW)>,
                             <GIC_PPI 10 (GIC_CPU_MASK_RAW(3) | IRQ_TYPE_LEVEL_LOW)>;
+               clock-frequency = <6144000>;
        };

        gic: interrupt-controller@48211000 {
@@ -90,6 +91,7 @@
                      <0x48212000 0x1000>,
                      <0x48214000 0x2000>,
                      <0x48216000 0x2000>;
+               interrupts = <1 9 0xf04>;
        };

        /*
@@ -582,7 +584,6 @@
                        ti,hwmods = "dmic";
                        dmas = <&sdma 67>;
                        dma-names = "up_link";
-                       status = "disabled";
                };

                mcbsp1: mcbsp@40122000 {
@@ -597,7 +598,6 @@
                        dmas = <&sdma 33>,
                               <&sdma 34>;
                        dma-names = "tx", "rx";
-                       status = "disabled";
                };

                mcbsp2: mcbsp@40124000 {
@@ -612,7 +612,6 @@
                        dmas = <&sdma 17>,
                               <&sdma 18>;
                        dma-names = "tx", "rx";
-                       status = "disabled";
                };

                mcbsp3: mcbsp@40126000 {
@@ -627,7 +626,6 @@
                        dmas = <&sdma 19>,
                               <&sdma 20>;
                        dma-names = "tx", "rx";
-                       status = "disabled";
                };

                timer1: timer@4ae18000 {

2.4 All together

Now we should have 3 files as following:

  • xen-uImage
  • zImage
  • omap5-uevm.dtb

Then copy all these 3 files to the /boot partition of your MICRO-SD card.

3. Boot Xen and Dom0

Use the following U-boot command sequence to boot Xen & dom0:

OMAP5430 EVM # setenv dtb_addr_r 0x825f0000
OMAP5430 EVM # setenv xen_addr_r 0x90000000
OMAP5430 EVM # setenv kernel_addr_r 0xa0000000
OMAP5430 EVM # setenv xen_bootargs 'sync_console console=dtuart dtuart=serial2'
OMAP5430 EVM # setenv dom0_bootargs 'console=hvc0,115200n8 earlyprintk=xen debug ignore_loglevel root=/dev/mmcblk0p2 rw rootwait fixrtc'
OMAP5430 EVM # fatload mmc 0:1 $dtb_addr_r omap5-uevm.dtb
OMAP5430 EVM # fatload mmc 0:1 $xen_addr_r xen-uImage
OMAP5430 EVM # fatload mmc 0:1 $kernel_addr_r zImage
OMAP5430 EVM # fdt addr $dtb_addr_r
OMAP5430 EVM # fdt resize
OMAP5430 EVM # fdt set /chosen xen,xen-bootargs \"$xen_bootargs\"
OMAP5430 EVM # fdt resize
OMAP5430 EVM # fdt set /chosen xen,dom0-bootargs \"$dom0_bootargs\"
OMAP5430 EVM # fdt mknode /chosen modules
OMAP5430 EVM # fdt set /chosen/modules '#address-cells' <1>
OMAP5430 EVM # fdt set /chosen/modules '#size-cells' <1>
OMAP5430 EVM # fdt mknode /chosen/modules module@0
OMAP5430 EVM # fdt set /chosen/modules/module@0 compatible xen,linux-zimage xen,multiboot-module
OMAP5430 EVM # fdt set /chosen/modules/module@0 reg <$kernel_addr_r 0xa00000>
OMAP5430 EVM # bootm $xen_addr_r - $dtb_addr_r

4. Booting DomU

(TBD)