diff options
author | Brian Woods | 2021-07-19 15:28:29 -0700 |
---|---|---|
committer | Stefano Stabellini | 2021-07-19 17:08:00 -0700 |
commit | 84270b16668c419d7673e5771e76eecdc685ce33 (patch) | |
tree | ba45f9e3e6ded2e399e2cf21e3e997627ec4ba3a | |
parent | 4fc035694cdd5b57e73c148654d3cb991ecf9014 (diff) |
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 <brian.woods@xilinx.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
-rw-r--r-- | README.md | 2 | ||||
-rwxr-xr-x | scripts/uboot-script-gen | 19 |
2 files changed, 16 insertions, 5 deletions
@@ -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 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 |