Skip to content

Instantly share code, notes, and snippets.

@Taehun
Created September 25, 2015 04:58
Show Gist options
  • Save Taehun/12bf92c21f88e45b37b8 to your computer and use it in GitHub Desktop.
Save Taehun/12bf92c21f88e45b37b8 to your computer and use it in GitHub Desktop.
U-boot boot.ini to support xen
ODROIDXU-UBOOT-CONFIG
# source by kenken> http://forum.odroid.com/viewtopic.php?f=98&t=6643#p64051
setenv dtb_addr_r 0x42000000
setenv dtb_path /exynos5422-odroidxu3.dtb
setenv kernel_addr_r 0x60000000
setenv kernel_path /zImage
setenv xen_addr_r 0x50000000
setenv xen_path /xen
# use the A7s for dom0 and pin them to it
setenv xen_bootargs sync_console console=dtuart dtuart=/serial@12C20000 dom0_mem=800M dom0_max_vcpus=4 dom0_vcpus_pin
# edid/1280x720.bin
#setenv dom0_bootargs console=hvc0 earlyprintk debug clk_ignore_unused psci=enable root=/dev/mmcblk0p2 rootwait rw drm_kms_helper.edid_firmware=edid/1280x720.bin smsc95xx.macaddr=00:1e:06:61:7a:39
# edid/1920x1080.bin
setenv dom0_bootargs console=hvc0 earlyprintk debug clk_ignore_unused psci=enable root=/dev/mmcblk0p2 rootwait rw smsc95xx.macaddr=00:1e:06:61:7a:39
## Load the different components
setenv dev "mmc 0:1"
# Load Linux in memory
fatload $dev $kernel_addr_r $kernel_path
setenv kernel_size 0x$filesize
# Load Xen in memory
fatload $dev $xen_addr_r $xen_path
# Load the device tree in memory
fatload $dev $dtb_addr_r $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\"
# 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
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 $kernel_size>
fdt print /chosen
## Boot Xen
bootz $xen_addr_r - $dtb_addr_r
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment