Xen ARM with Virtualization Extensions/Vexpress: Difference between revisions

From Xen
Jump to navigationJump to search
(Updated for new hypervisor path)
No edit summary
 
(13 intermediate revisions by 3 users not shown)
Line 1: Line 1:
== Preparing the board ==
* If you are trying to run Xen on a Versatile Express Cortex A15 machine, you might want to copy xen (the Xen binary output, <tt>xen.git/xen/xen</tt>) and the Linux Dom0 zImage to the SOFTWARE directory and add the two following stanzas to your ''images.txt'' file:

* We recommend disabling the A7 cpus by editing the ''board.txt'' file under the SITE directory corresponding to your Cortex A15 daughterboard:

SCC: 0x018 0x00001FFF ;Reset control - (CA7s reset, CA15s running) - uncomment this to hold A7 cluster in

* With recent firmware (newer than boot monitor V5.1.9), the Versatile Express can use multiple ways to bring up secondary cpus. Xen only supports sys_flags bring up. To select this mode, you need to set the '''bit[12]''' of '''SCC: 0x700''' to 0. For instance:
** Before:
SCC: 0x700 0x0032F003
** After:
SCC: 0x700 0x0032E003

== Booting Xen and dom0 ==

=== Booting with U-Boot ===

The current approach requires tftp but it can be easily modify to load the different images from the mmc.

==== Build and flash U-Boot ====

Theses steps will programme U-Boot into NOR flash.

1) Clone [http://www.denx.de/wiki/U-Boot/WebHome U-Boot] from the official repository (tested with v2013.10-rc2 tag)
git clone git://git.denx.de/u-boot.git u-boot
cd u-boot
git checkout v2013.10

2) Build U-Boot for the versatile express
make ARCH=arm CROSS_COMPILE=arm-unknown-linux-gnueabi- vexpress_ca15_tc2

3) Copy <tt>u-boot.bin</tt> from the root of the repository to the <tt>SOFTWARE</tt> directory of the firmware disk, giving it the name <tt>uboot.bin</tt>
cp u-boot.bin /media/VEMSD/SOFTWARE/uboot.bin

The <tt>arm-unknown-linux-gnueabi</tt> compiler can be retrieved from [https://www.kernel.org/pub/tools/crosstool/files/bin/i686/4.6.3/ kernel.org].

4) Add U-Boot image at the end of <tt>/media/VEMSD/SITE1/HBI0249A/images.txt</tt>
NOR4UPDATE: AUTO ;IMAGE UPDATE:NONE/AUTO/FORCE
NOR4ADDRESS: 00000000 ;Image Flash Address
NOR4FILE: \SOFTWARE\uboot.bin ;Image File Name - master initrd
NOR4LOAD: 80800000 ;Image Load Address
NOR4ENTRY: 80800000 ;Image Entry Point

The TOTALIMAGES: line in the file will also need updating to account for this extra image and the 'NOR4' lines added may need to have a different number to '4' if that is not the next in sequence.

5) If you want to let the board to automatically boot into U-Boot (and by extension Xen), then:
* Look for the name of the BOOTSCRIPT image in the file you edited in the previous step; this should be <tt>\SOFTWARE\booscr.txt</tt>.
* Edit this bootscript file to have the line:
flash run uboot

==== Set up U-Boot to boot via PXE ====

The following [http://xenbits.xen.org/people/julieng/load-xen-tftp.scr.txt script] allow U-boot to download everything via tftp and boot xen.

* Copy <tt>xen</tt>, <tt>linux</tt> and the <tt>device tree</tt> in your tftp directory on your server (we assume <tt>/tftpboot</tt> until the end).
* Copy the script in <tt>/tftpboot</tt>
wget http://xenbits.xen.org/people/julieng/load-xen-tftp.scr.txt
mkimage -T script -C none -d load-xen-tftp.scr.txt /tftpboot/load-xen-tftp.img
* At U-Boot prompt, on your board, you need to set the following variable:
setenv ipaddr 10.y.y.y
setenv serverip 10.x.x.x
setenv usbethaddr 00:zz:zz:zz:zz:zz
setenv ethaddr 00:zz:zz:zz:zz:zz
setenv xen_addr_r 0x80400000
setenv kernel_addr_r 0xa0008000
setenv dtb_addr_r 0x81f00000
setenv script_addr_r 0x81000000
setenv xen_bootargs 'sync_console console=dtuart dtuart=serial0'
setenv dom0_bootargs 'console=hvc0,38400 debug ignore_loglevel root=/dev/mmcblk0p2'
setenv bootcmd 'tftpboot $script_addr_r $serverip:/load-xen-tftp.img; source $script_addr_r'
setenv kernel_path /linux-zImage
setenv xen_path /xen-uImage
setenv dtb_path /vexpress-v2p-ca15_a7.dtb

with:
* '''10.y.y.y''' the ip addr of the board
* '''10.x.x.x''' the ip of a tftp server (or PXE server).
* '''00:zz:zz:zz:zz:zz''' the MAC address of the board.
* '''/linux-zImage''' the path to the Linux kernel. It should be placed to <tt>/tftpboot/linux-zImage</tt> on your server
* '''/xen-uImage''' the path to Xen uImage. It should be placed to <tt>/tftpboot/xen-uImage</tt> on your server. You can create the uImage with
mkimage -A arm -T kernel -a 0x80200000 -e 0x80200000 -C none -d $xen_root/xen/xen /tftpboot/xen-uImage
* '''/vexpress-v2p-ca15_a7.dtb''' the path to the device tree. It should be placed <tt>/tftpboot/vexpress-v2p-ca15_a7.dtb</tt>

=== Booting without U-Boot ===

This solution requires to modify the firmware configuration. The support will be removed soon because Xen will require all CPU to boot in hypervisor mode. We advice to the use the U-Boot solution (see above).

If you are trying to run Xen on a Versatile Express Cortex A15 machine, you might want to copy xen (the Xen binary output, <tt>xen.git/xen/xen</tt>) and the Linux Dom0 zImage to the SOFTWARE directory and add the two following stanzas to your ''images.txt'' file:


NOR3UPDATE: AUTO ;IMAGE UPDATE:NONE/AUTO/FORCE
NOR3UPDATE: AUTO ;IMAGE UPDATE:NONE/AUTO/FORCE
Line 13: Line 99:
NOR4ENTRY: 80008000 ;Image Entry Point
NOR4ENTRY: 80008000 ;Image Entry Point


Note that before commit [http://xenbits.xen.org/gitweb/?p=xen.git;a=commit;h=47d1a51480ad0f602d747e460d619436c907deea 47d1a51] (xen: arm: make zImage the default target which we install) it was necessary to use <tt>xen.git/xen/xen.bin</tt> for NOR3FILE instead of <tt>xen.git/xen/xen</tt>.
* Note that before commit [http://xenbits.xen.org/gitweb/?p=xen.git;a=commit;h=47d1a51480ad0f602d747e460d619436c907deea 47d1a51] (xen: arm: make zImage the default target which we install) it was necessary to use <tt>xen.git/xen/xen.bin</tt> for NOR3FILE instead of <tt>xen.git/xen/xen</tt>.

* We recommend disabling the A7 cpus by editing the ''board.txt'' file under the SITE directory corresponding to your Cortex A15 daughterboard:

;SCC: 0x018 0x1FFFFFFF ;Reset control (CA7s running, CA15s running) - uncomment this for normal operation
;SCC: 0x018 0x1FFFF000 ;Reset control - (CA7s running, CA15s reset) - uncomment this to hold A15 cluster in reset
SCC: 0x018 0x00001FFF ;Reset control - (CA7s reset, CA15s running) - uncomment this to hold A7 cluster in


* The address of the Dom0 kernel in Flash at the moment is not configurable, it is defined as [http://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=xen/arch/arm/kernel.c;h=2f7a9ff2a5fbc95eaa276c9d2e09541ff3329535;hb=HEAD KERNEL_FLASH_ADDRESS] in Xen. On a Versatile Express machine this address can be determined by executing ''flash list images'' from the boot manager. You'll have to manually change it.
* The address of the Dom0 kernel in Flash at the moment is not configurable, it is defined as [http://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=xen/arch/arm/kernel.c;h=2f7a9ff2a5fbc95eaa276c9d2e09541ff3329535;hb=HEAD KERNEL_FLASH_ADDRESS] in Xen. On a Versatile Express machine this address can be determined by executing ''flash list images'' from the boot manager. You'll have to manually change it.


[[Category:XenARM]]
* In order to make your Dom0 boot sequence faster, you might want to consider passing init=/bin/bash to your kernel and then manually executing a minimal init script like [[minimal-init|this]].
[[Category:Developers]]

[[Category:Xen 4.3]]
[[Category:Xen 4.3]]
[[Category:Xen 4.4]]
[[Category:Xen 4.5]]

Latest revision as of 14:15, 22 December 2014

Preparing the board

  • We recommend disabling the A7 cpus by editing the board.txt file under the SITE directory corresponding to your Cortex A15 daughterboard:
SCC: 0x018 0x00001FFF            ;Reset control - (CA7s reset, CA15s running) - uncomment this to hold A7 cluster in 
  • With recent firmware (newer than boot monitor V5.1.9), the Versatile Express can use multiple ways to bring up secondary cpus. Xen only supports sys_flags bring up. To select this mode, you need to set the bit[12] of SCC: 0x700 to 0. For instance:
** Before:
  SCC: 0x700 0x0032F003
** After:
  SCC: 0x700 0x0032E003

Booting Xen and dom0

Booting with U-Boot

The current approach requires tftp but it can be easily modify to load the different images from the mmc.

Build and flash U-Boot

Theses steps will programme U-Boot into NOR flash.

1) Clone U-Boot from the official repository (tested with v2013.10-rc2 tag)

git clone git://git.denx.de/u-boot.git u-boot
cd u-boot
git checkout v2013.10

2) Build U-Boot for the versatile express

make ARCH=arm CROSS_COMPILE=arm-unknown-linux-gnueabi- vexpress_ca15_tc2

3) Copy u-boot.bin from the root of the repository to the SOFTWARE directory of the firmware disk, giving it the name uboot.bin

cp u-boot.bin /media/VEMSD/SOFTWARE/uboot.bin

The arm-unknown-linux-gnueabi compiler can be retrieved from kernel.org.

4) Add U-Boot image at the end of /media/VEMSD/SITE1/HBI0249A/images.txt

NOR4UPDATE: AUTO                 ;IMAGE UPDATE:NONE/AUTO/FORCE
NOR4ADDRESS: 00000000            ;Image Flash Address
NOR4FILE: \SOFTWARE\uboot.bin    ;Image File Name - master initrd
NOR4LOAD: 80800000               ;Image Load Address
NOR4ENTRY: 80800000              ;Image Entry Point

The TOTALIMAGES: line in the file will also need updating to account for this extra image and the 'NOR4' lines added may need to have a different number to '4' if that is not the next in sequence.

5) If you want to let the board to automatically boot into U-Boot (and by extension Xen), then:

  • Look for the name of the BOOTSCRIPT image in the file you edited in the previous step; this should be \SOFTWARE\booscr.txt.
  • Edit this bootscript file to have the line:
flash run uboot

Set up U-Boot to boot via PXE

The following script allow U-boot to download everything via tftp and boot xen.

  • Copy xen, linux and the device tree in your tftp directory on your server (we assume /tftpboot until the end).
  • Copy the script in /tftpboot
wget http://xenbits.xen.org/people/julieng/load-xen-tftp.scr.txt
mkimage -T script -C none -d load-xen-tftp.scr.txt /tftpboot/load-xen-tftp.img
  • At U-Boot prompt, on your board, you need to set the following variable:
setenv ipaddr 10.y.y.y
setenv serverip 10.x.x.x
setenv usbethaddr 00:zz:zz:zz:zz:zz
setenv ethaddr 00:zz:zz:zz:zz:zz
setenv xen_addr_r 0x80400000
setenv kernel_addr_r 0xa0008000
setenv dtb_addr_r 0x81f00000
setenv script_addr_r 0x81000000
setenv xen_bootargs 'sync_console console=dtuart dtuart=serial0'
setenv dom0_bootargs 'console=hvc0,38400 debug ignore_loglevel root=/dev/mmcblk0p2'
setenv bootcmd 'tftpboot $script_addr_r $serverip:/load-xen-tftp.img; source $script_addr_r'
setenv kernel_path /linux-zImage
setenv xen_path /xen-uImage
setenv dtb_path /vexpress-v2p-ca15_a7.dtb

with:

  • 10.y.y.y the ip addr of the board
  • 10.x.x.x the ip of a tftp server (or PXE server).
  • 00:zz:zz:zz:zz:zz the MAC address of the board.
  • /linux-zImage the path to the Linux kernel. It should be placed to /tftpboot/linux-zImage on your server
  • /xen-uImage the path to Xen uImage. It should be placed to /tftpboot/xen-uImage on your server. You can create the uImage with
mkimage -A arm -T kernel -a 0x80200000 -e 0x80200000 -C none -d $xen_root/xen/xen /tftpboot/xen-uImage
  • /vexpress-v2p-ca15_a7.dtb the path to the device tree. It should be placed /tftpboot/vexpress-v2p-ca15_a7.dtb

Booting without U-Boot

This solution requires to modify the firmware configuration. The support will be removed soon because Xen will require all CPU to boot in hypervisor mode. We advice to the use the U-Boot solution (see above).

If you are trying to run Xen on a Versatile Express Cortex A15 machine, you might want to copy xen (the Xen binary output, xen.git/xen/xen) and the Linux Dom0 zImage to the SOFTWARE directory and add the two following stanzas to your images.txt file:

NOR3UPDATE: AUTO                    ;IMAGE UPDATE:NONE/AUTO/FORCE
NOR3ADDRESS: 0c000000               ;Image Flash Address
NOR3FILE: \SOFTWARE\Xen\xen         ;Image File Name
NOR3LOAD: 80200000                  ;Image Load Address
NOR3ENTRY: 80200000                 ;Image Entry Point

NOR4UPDATE: AUTO                    ;IMAGE UPDATE:NONE/AUTO/FORCE
NOR4ADDRESS: 000c0000               ;Image Flash Address
NOR4FILE: \SOFTWARE\Xen\zImage      ;Image File Name
NOR4LOAD: 80008000                  ;Image Load Address
NOR4ENTRY: 80008000                 ;Image Entry Point
  • Note that before commit 47d1a51 (xen: arm: make zImage the default target which we install) it was necessary to use xen.git/xen/xen.bin for NOR3FILE instead of xen.git/xen/xen.
  • The address of the Dom0 kernel in Flash at the moment is not configurable, it is defined as KERNEL_FLASH_ADDRESS in Xen. On a Versatile Express machine this address can be determined by executing flash list images from the boot manager. You'll have to manually change it.