From 84270b16668c419d7673e5771e76eecdc685ce33 Mon Sep 17 00:00:00 2001 From: Brian Woods Date: Mon, 19 Jul 2021 15:28:29 -0700 Subject: 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: Brian Woods Reviewed-by: Stefano Stabellini Signed-off-by: Stefano Stabellini --- scripts/uboot-script-gen | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/uboot-script-gen b/scripts/uboot-script-gen index de7f00f..51451da 100755 --- a/scripts/uboot-script-gen +++ b/scripts/uboot-script-gen @@ -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 != "-" then 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)" fi @@ -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 ) FIT_ENC_UB_DTB=$OPTARG ;; + e ) + efi=y + ;; h ) print_help 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" +then + echo "bootefi $xen_addr $device_tree_addr" >> $UBOOT_SOURCE +else + echo "booti $xen_addr - $device_tree_addr" >> $UBOOT_SOURCE +fi if test "$fit" then -- cgit v1.2.3