[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [ImageBuilder] Add config option to use separate load commands for Xen, DOM0 and DOMU binaries
Introduce the following options :- 1. XEN_LOAD - This specifies command to load xen hypervisor binary and device tree. 2. DOM0_LOAD - This specifies command to load Dom0 binaries. 3. DOMU_LOAD[] - This specifies command to load DomU binaries. There can be situations where Xen, Dom0 and DomU binaries are stored in different partitions. Thus, imagebuilder should provide a way the binaries using different commands. If any of the above options are not specified, LOAD_CMD is used by default. Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx> --- README.md | 14 ++++++++++++++ scripts/uboot-script-gen | 32 +++++++++++++++++++++++--------- 2 files changed, 37 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index b7be268..4be6efb 100644 --- a/README.md +++ b/README.md @@ -33,10 +33,12 @@ BOOT_CMD="booti" DEVICE_TREE="mpsoc.dtb" XEN="xen" +XEN_LOAD="ext4load mmc 0:1" XEN_CMD="console=dtuart dtuart=serial0 dom0_mem=1G dom0_max_vcpus=1 bootscrub=0 vwfi=native sched=null" PASSTHROUGH_DTS_REPO="git@xxxxxxxxxx:Xilinx/xen-passthrough-device-trees.git device-trees-2021.2/zcu102" DOM0_KERNEL="Image-dom0" DOM0_CMD="console=hvc0 earlycon=xen earlyprintk=xen clk_ignore_unused" +DOM0_LOAD="ext4load mmc 2:1" DOM0_RAMDISK="dom0-ramdisk.cpio" DOM0_MEM=1024 DOM0_VCPUS=1 @@ -46,11 +48,13 @@ DT_OVERLAY[0]="host_dt_overlay.dtbo" NUM_DOMUS=2 DOMU_KERNEL[0]="zynqmp-dom1/Image-domU" +DOMU_LOAD[0]="ext4load mmc 4:1" DOMU_PASSTHROUGH_PATHS[0]="/axi/ethernet@ff0e0000 /axi/serial@ff000000" DOMU_CMD[0]="console=ttyPS0 earlycon console=ttyPS0,115200 clk_ignore_unused rdinit=/sbin/init root=/dev/ram0 init=/bin/sh" DOMU_RAMDISK[0]="zynqmp-dom1/domU-ramdisk.cpio" DOMU_COLORS[0]="6-14" DOMU_KERNEL[1]="zynqmp-dom2/Image-domU" +DOMU_LOAD[1]="ext4load mmc 5:1" DOMU_CMD[1]="console=ttyAMA0 clk_ignore_unused rdinit=/sbin/init root=/dev/ram0 init=/bin/sh" DOMU_RAMDISK[1]="zynqmp-dom2/domU-ramdisk.cpio" DOMU_MEM[1]=512 @@ -99,6 +103,9 @@ Where: - XEN_CMD specifies the command line arguments used for Xen. If not set, the default one will be used. +- XEN_LOAD specifies the command to load XEN and DEVICE_TREE. If not set, + LOAD_CMD will be used. + - XEN_STATIC_HEAP="baseaddr1 size1 ... baseaddrN sizeN" if specified, indicates the host physical address regions [baseaddr, baseaddr + size) to be reserved as Xen static heap. @@ -109,6 +116,9 @@ Where: uboot-script-gen will compile the partial device trees which have been specified in DOMU_PASSTHROUGH_PATHS[number]. +- DOM0_LOAD specifies the command to load DOM0_KERNEL and DOM0_RAMDISK. If not + set, LOAD_CMD will be used. + - DOM0_KERNEL specifies the Dom0 kernel file to load. For dom0less configurations, the parameter is optional. @@ -159,6 +169,10 @@ Where: kernel. If not set and DOMU_VPL011[number] is not set to 0, then "console=ttyAMA0" is used. +- DOMU_LOAD[number] specifies the command to load DOMU_KERNEL[number], + DOMU_RAMDISK[number] and DOMU_PASSTHROUGH_DTB[number]. If not set, then + LOAD_CMD is used. + - DOMU_RAMDISK[number] specifies the DomU ramdisk to use. - DOMU_PASSTHROUGH_PATHS[number] specifies the passthrough devices ( diff --git a/scripts/uboot-script-gen b/scripts/uboot-script-gen index b81e614..fed53aa 100755 --- a/scripts/uboot-script-gen +++ b/scripts/uboot-script-gen @@ -737,6 +737,7 @@ function load_file() { local filename=$1 local fit_scr_name=$2 + local load_cmd=$3 local absolute_path="$(realpath --no-symlinks $filename)" local base="$(realpath $PWD)"/ @@ -748,10 +749,10 @@ function load_file() add_size_from_file $filename else if test "$CALC"; then - echo "$LOAD_CMD \${memaddr} ${prepend_path:+$prepend_path/}$relative_path" >> $UBOOT_SOURCE + echo "$load_cmd \${memaddr} ${prepend_path:+$prepend_path/}$relative_path" >> $UBOOT_SOURCE add_size_calculate $fit_scr_name else - echo "$LOAD_CMD $memaddr ${prepend_path:+$prepend_path/}$relative_path" >> $UBOOT_SOURCE + echo "$load_cmd $memaddr ${prepend_path:+$prepend_path/}$relative_path" >> $UBOOT_SOURCE add_size_from_file $filename fi fi @@ -1003,11 +1004,15 @@ generate_uboot_images() xen_file_loading() { + if test -z "$DOM0_LOAD" + then + DOM0_LOAD="$LOAD_CMD" + fi if test "$DOM0_KERNEL" then check_compressed_file_type $DOM0_KERNEL "executable\|uImage" dom0_kernel_addr=$memaddr - load_file $DOM0_KERNEL "dom0_linux" + load_file $DOM0_KERNEL "dom0_linux" "$DOM0_LOAD" dom0_kernel_size=$filesize fi if test "$DOM0_RAMDISK" @@ -1015,7 +1020,7 @@ xen_file_loading() check_compressed_file_type $DOM0_RAMDISK "cpio archive" ramdisk_addr=$memaddr ramdisk_path=$DOM0_RAMDISK - load_file "$DOM0_RAMDISK" "dom0_ramdisk" + load_file "$DOM0_RAMDISK" "dom0_ramdisk" "$DOM0_LOAD" ramdisk_size=$filesize else ramdisk_addr="-" @@ -1024,6 +1029,10 @@ xen_file_loading() i=0 while test $i -lt $NUM_DOMUS do + if test -z "${DOMU_LOAD[$i]}" + then + DOMU_LOAD[$i]="$LOAD_CMD" + fi if test "${DOMU_ROOTFS[$i]}" || test "${DOMU_NOBOOT[$i]}" then if test -z "${DOMU_NOBOOT[$i]}" @@ -1042,20 +1051,20 @@ xen_file_loading() check_compressed_file_type ${DOMU_KERNEL[$i]} "executable\|uImage" domU_kernel_addr[$i]=$memaddr - load_file ${DOMU_KERNEL[$i]} "domU${i}_kernel" + load_file ${DOMU_KERNEL[$i]} "domU${i}_kernel" "${DOMU_LOAD[$i]}" domU_kernel_size[$i]=$filesize if test "${DOMU_RAMDISK[$i]}" then check_compressed_file_type ${DOMU_RAMDISK[$i]} "cpio archive" domU_ramdisk_addr[$i]=$memaddr - load_file ${DOMU_RAMDISK[$i]} "domU${i}_ramdisk" + load_file ${DOMU_RAMDISK[$i]} "domU${i}_ramdisk" "${DOMU_LOAD[$i]}" domU_ramdisk_size[$i]=$filesize fi if test "${DOMU_PASSTHROUGH_DTB[$i]}" then check_compressed_file_type ${DOMU_PASSTHROUGH_DTB[$i]} "Device Tree Blob" domU_passthrough_dtb_addr[$i]=$memaddr - load_file ${DOMU_PASSTHROUGH_DTB[$i]} "domU${i}_fdt" + load_file ${DOMU_PASSTHROUGH_DTB[$i]} "domU${i}_fdt" "${DOMU_LOAD[$i]}" domU_passthrough_dtb_size[$i]=$filesize fi i=$(( $i + 1 )) @@ -1070,9 +1079,14 @@ xen_file_loading() generate_uboot_images fi + if test -z "${XEN_LOAD}" + then + XEN_LOAD="$LOAD_CMD" + fi + kernel_addr=$memaddr kernel_path=$XEN - load_file "$XEN" "host_kernel" + load_file "$XEN" "host_kernel" "$XEN_LOAD" xen_policy_addr="-" if test -n "$XEN_POLICY" @@ -1691,7 +1705,7 @@ fi check_file_type $DEVICE_TREE "Device Tree Blob" device_tree_addr=$memaddr -load_file $DEVICE_TREE "host_fdt" +load_file $DEVICE_TREE "host_fdt" "$XEN_LOAD" bitstream_load_and_config # bitstream is loaded last but used first device_tree_editing $device_tree_addr -- 2.25.1
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |