Commit 84270b16 authored by Brian Woods's avatar Brian Woods Committed by Stefano Stabellini
Browse files

Add support for EFI in U-boot via bootefi

Also add "multiboot,module" compatible string for dom0 kernel and
ramdisk, so that Xen can detect it and skip loading the xen.cfg file.
Signed-off-by: default avatarBrian Woods <>
Reviewed-by: Stefano Stabellini's avatarStefano Stabellini <>
Signed-off-by: default avatarStefano Stabellini <>
parent 4fc03569
......@@ -134,6 +134,8 @@ Where:\
can only be used in combination with the -k option. This adds the
public key into the dtb. Then one can add this dtb back into the
u-boot bin or elf.\
-e specifies if bootefi should be used in the uboot script (instead of \
booti). This is an optional argument.
### Signed FIT images
......@@ -126,13 +126,13 @@ function device_tree_editing()
dt_set "/chosen" "\#size-cells" "hex" "0x2"
dt_set "/chosen" "xen,xen-bootargs" "str" "\"$XEN_CMD\""
dt_mknode "/chosen" "dom0"
dt_set "/chosen/dom0" "compatible" "str" "\"xen,linux-zimage\" \"xen,multiboot-module\""
dt_set "/chosen/dom0" "compatible" "str" "\"xen,linux-zimage\" \"xen,multiboot-module\" \"multiboot,module\""
dt_set "/chosen/dom0" "reg" "hex" "0x0 $dom0_kernel_addr 0x0 $(printf "0x%x" $dom0_kernel_size)"
dt_set "/chosen" "xen,dom0-bootargs" "str" "\"$DOM0_CMD\""
if test "$DOM0_RAMDISK" && test $dom0_ramdisk_addr != "-"
dt_mknode "/chosen" "dom0-ramdisk"
dt_set "/chosen/dom0-ramdisk" "compatible" "str" "\"xen,linux-initrd\" \"xen,multiboot-module\""
dt_set "/chosen/dom0-ramdisk" "compatible" "str" "\"xen,linux-initrd\" \"xen,multiboot-module\" \"multiboot,module\""
dt_set "/chosen/dom0-ramdisk" "reg" "hex" "0x0 $dom0_ramdisk_addr 0x0 $(printf "0x%x" $dom0_ramdisk_size)"
......@@ -259,7 +259,7 @@ function print_help
script=`basename "$0"`
echo "usage:"
echo " $script -c CONFIG_FILE -t UBOOT_TYPE -d DIRECTORY [-o FILE] [-k KEY_DIR/HINT [-u U-BOOT_DTB]]"
echo " $script -c CONFIG_FILE -t UBOOT_TYPE -d DIRECTORY [-o FILE] [-k KEY_DIR/HINT [-u U-BOOT_DTB]] [-e]"
echo " $script -h"
echo "where:"
echo " CONFIG_FILE - configuration file"
......@@ -275,6 +275,7 @@ function print_help
echo " KEY_DIR - key directory used for signing a fit image"
echo " HINT - the file name of the crt and key file minus the suffix (ex, hint.crt and hint.key)"
echo " U-BOOT_DTB - u-boot control dtb so that the public key gets added to it"
echo " -e - uses efiboot rather than booti"
echo " -h - prints out the help message and exits "
echo "Defaults:"
echo " CONFIG_FILE=$cfg_file, UBOOT_TYPE=\"LOAD_CMD\" env var, DIRECTORY=$uboot_dir"
......@@ -282,7 +283,7 @@ function print_help
echo " $script -c ../config -d ./build42 -t \"scsi load 1:1\""
while getopts ":c:t:d:ho:k:u:" opt; do
while getopts ":c:t:d:ho:k:u:e" opt; do
case ${opt} in
t )
case $OPTARG in
......@@ -321,6 +322,9 @@ while getopts ":c:t:d:ho:k:u:" opt; do
u )
e )
h )
exit 0
......@@ -549,7 +553,12 @@ device_tree_editing $device_tree_addr
# disable device tree reloation
echo "setenv fdt_high 0xffffffffffffffff" >> $UBOOT_SOURCE
echo "booti $xen_addr - $device_tree_addr" >> $UBOOT_SOURCE
if test "$efi" && test "$efi" = "y"
echo "bootefi $xen_addr $device_tree_addr" >> $UBOOT_SOURCE
echo "booti $xen_addr - $device_tree_addr" >> $UBOOT_SOURCE
if test "$fit"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment