Xen ARM with Virtualization Extensions/OMAP5432 uEVM: Difference between revisions

From Xen
Jump to navigationJump to search
No edit summary
 
(10 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. Besides, there are
also other modules that are disabled in DT while enabled in hwmod. Here is a hack to bypass the problem.

<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..bf7d988 100644
--- a/arch/arm/mach-omap2/omap_hwmod_54xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_54xx_data.c
@@ -2425,7 +2425,9 @@ static struct omap_hwmod_ocp_if *omap54xx_hwmod_ocp_ifs[] __initdata = {
&omap54xx_mpu__mpu_private,
&omap54xx_l4_wkup__counter_32k,
&omap54xx_l4_cfg__dma_system,
+#if 0
&omap54xx_l4_abe__dmic,
+#endif
&omap54xx_l4_cfg__mmu_dsp,
&omap54xx_mpu__emif1,
&omap54xx_mpu__emif2,
@@ -2445,9 +2447,11 @@ static struct omap_hwmod_ocp_if *omap54xx_hwmod_ocp_ifs[] __initdata = {
&omap54xx_l3_main_2__mmu_ipu,
&omap54xx_l4_wkup__kbd,
&omap54xx_l4_cfg__mailbox,
+#if 0
&omap54xx_l4_abe__mcbsp1,
&omap54xx_l4_abe__mcbsp2,
&omap54xx_l4_abe__mcbsp3,
+#endif
&omap54xx_l4_abe__mcpdm,
&omap54xx_l4_per__mcspi1,
&omap54xx_l4_per__mcspi2,
@@ -2456,8 +2460,10 @@ static struct omap_hwmod_ocp_if *omap54xx_hwmod_ocp_ifs[] __initdata = {
&omap54xx_l4_per__mmc1,
&omap54xx_l4_per__mmc2,
&omap54xx_l4_per__mmc3,
+#if 0
&omap54xx_l4_per__mmc4,
&omap54xx_l4_per__mmc5,
+#endif
&omap54xx_l4_cfg__mpu,
&omap54xx_l4_cfg__spinlock,
&omap54xx_l4_cfg__ocp2scp1,
@@ -2474,7 +2480,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 127: Line 73:


<pre>
<pre>
commit 7d6802fe562710d296881d5d9aeb5cfeff76354f
Author: Chen Baozi <baozich@gmail.com>
Date: Tue Apr 29 09:24:15 2014 +0800

arm: dts: OMAP5: Add Xen support in DTS of OMAP5432 uEVM

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..18caa26 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,27 @@
@@ -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>;
+ };
+ };
+ };
+
+ psci {
+ compatible = "arm,psci";
+ method = "smc";
+ cpu_off = <1>;
+ cpu_on = <2>;
+ };
+
memory {
device_type = "memory";
reg = <0x80000000 0x7F000000>; /* 2032 MB */
@@ -199,7 +220,7 @@
};
};


Line 174: Line 86:
};
};


@@ -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
diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
index f8c9855..dfc229c 100644
index f8c9855..82d91ba 100644
--- a/arch/arm/boot/dts/omap5.dtsi
--- a/arch/arm/boot/dts/omap5.dtsi
+++ b/arch/arm/boot/dts/omap5.dtsi
+++ b/arch/arm/boot/dts/omap5.dtsi
Line 194: Line 132:


/*
/*
@@ -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 {
</pre>
</pre>


== 2.4 All together ==
== 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 =
= 3. Boot Xen and Dom0 =

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

<pre>
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
</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)