Xen ARM with Virtualization Extensions/BootProtocol

From Xen
Revision as of 17:34, 13 February 2014 by Julieng (talk | contribs) (Copy boot script)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
Icon Info.png This page is under construction


# Generic script to load and boot Xen from tftp
#
# For any questions/bug report please send an email to:
#   xen-devel@lists.xen.org
#
# Requirements:
#   U-boot variable environment:
#     - kernel_addr_r: kernel load address
#     - xen_addr_r: xen load address
#     - dtb_addr_r: fdt load address
#     - serverip: IP of the tftp server
#     - xen_bootargs: xen command line
#     - dom0_bootargs: dom0 command line
#     - kernel_path: kernel path
#     - xen_path: xen path
#     - dtb_path: device tree path
#
#   Tftp server file:
#     You need to provide the files that you have specified in
#     $xen_path, $dtb_path and $kernel_path
#
## Load the different components
#
# Load Linux in memory
tftpboot $kernel_addr_r $serverip:$kernel_path
# Load Xen in memory
tftpboot $xen_addr_r $serverip:$xen_path
# Load the device tree in memory
tftpboot $dtb_addr_r $serverip:$dtb_path 
#
## Fixup the device tree
#
# Be sure U-boot is using our FDT
fdt addr $dtb_addr_r
# Resize the FDT just in case
fdt resize
# Set Xen arguments based on $xen_bootargs
fdt set /chosen xen,xen-bootargs \"$xen_bootargs\"
#setenv bootargs $xen_bootargs # On Xen unstable, xen cmdline is in bootargs
# Set Dom0 arguments based on $dom0_bootargs
fdt set /chosen xen,dom0-bootargs \"$dom0_bootargs\"
# Create modules node
fdt mknode /chosen modules
fdt set /chosen/modules '#address-cells' <1>
fdt set /chosen/modules '#size-cells' <1>
# Create node for the linux located at $kernel_addr_r
# It seems U-boot doesn't have command to retrieve the size, so the size is
# set to a big value (10Mb)
fdt mknode /chosen/modules module@0
fdt set /chosen/modules/module@0 compatible xen,linux-zimage xen,multiboot-module
fdt set /chosen/modules/module@0 reg <$kernel_addr_r 0x00a00000>
#
## Boot Xen
bootm $xen_addr_r - $dtb_addr_r