aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md9
-rwxr-xr-xscripts/uboot-script-gen51
2 files changed, 59 insertions, 1 deletions
diff --git a/README.md b/README.md
index b705934..6f577b8 100644
--- a/README.md
+++ b/README.md
@@ -36,6 +36,9 @@ DOM0_KERNEL="Image-dom0"
DOM0_CMD="console=hvc0 earlycon=xen earlyprintk=xen clk_ignore_unused"
DOM0_RAMDISK="dom0-ramdisk.cpio"
+NUM_DT_OVERLAY=1
+DT_OVERLAY[0]="host_dt_overlay.dtbo"
+
NUM_DOMUS=2
DOMU_KERNEL[0]="zynqmp-dom1/Image-domU"
DOMU_RAMDISK[0]="zynqmp-dom1/domU-ramdisk.cpio"
@@ -70,6 +73,12 @@ Where:
- DOM0_RAMDISK specifies the Dom0 ramdisk to use. Note that it should be
a regular ramdisk cpio.gz file, not a u-boot binary.
+- NUM_DT_OVERLAY specifies the number of host device tree overlays to be
+ added at boot time in u-boot
+
+- DT_OVERLAY[number] specifies the path to the hosts device tree overlays
+ to be added at boot time in u-boot
+
- NUM_DOMUS specifies how many Dom0-less DomUs to load
- DOMU_KERNEL[number] specifies the DomU kernel to use.
diff --git a/scripts/uboot-script-gen b/scripts/uboot-script-gen
index 2fad339..de7f00f 100755
--- a/scripts/uboot-script-gen
+++ b/scripts/uboot-script-gen
@@ -111,6 +111,16 @@ function device_tree_editing()
then
echo "fdt addr $device_tree_addr" >> $UBOOT_SOURCE
echo "fdt resize 1024" >> $UBOOT_SOURCE
+
+ if test $NUM_DT_OVERLAY && test $NUM_DT_OVERLAY -gt 0
+ then
+ i=0
+ while test $i -lt $NUM_DT_OVERLAY
+ do
+ echo "fdt apply ${dt_overlay_addr[$i]}" >> $UBOOT_SOURCE
+ i=$(( $i + 1 ))
+ done
+ fi
fi
dt_set "/chosen" "\#address-cells" "hex" "0x2"
dt_set "/chosen" "\#size-cells" "hex" "0x2"
@@ -515,6 +525,23 @@ do
i=$(( $i + 1 ))
done
+if test $NUM_DT_OVERLAY && test $NUM_DT_OVERLAY -gt 0
+then
+ i=0
+ while test $i -lt $NUM_DT_OVERLAY
+ do
+ if [ ! -f "${DT_OVERLAY[$i]}" ]
+ then
+ echo "Can not find ${DT_OVERLAY[$i]}, exiting"
+ cleanup_and_return_err
+ fi
+ check_file_type "${DT_OVERLAY[$i]}" "Device Tree Blob"
+ dt_overlay_addr[$i]=$memaddr
+ load_file "${DT_OVERLAY[$i]}" "host_fdto${i}"
+ i=$(( $i + 1 ))
+ done
+fi
+
check_file_type $DEVICE_TREE "Device Tree Blob"
device_tree_addr=$memaddr
load_file $DEVICE_TREE "host_fdt"
@@ -642,6 +669,28 @@ then
fi
i=$(( $i + 1 ))
done
+ fdt_line="fdt = \"host_fdt\""
+ if test $NUM_DT_OVERLAY && test $NUM_DT_OVERLAY -gt 0
+ then
+ i=0
+ while test $i -lt $NUM_DT_OVERLAY
+ do
+ cat >> "$its_file" <<- EOF
+ host_fdto${i} {
+ description = "host fdt overlay ${i}";
+ data = /incbin/("${DT_OVERLAY[$i]}");
+ type = "flat_dt";
+ arch = "arm64";
+ compression = "none";
+ load = <${dt_overlay_addr[$i]}>;
+ $fit_algo
+ };
+ EOF
+ fdt_line+=", \"host_fdto${i}\""
+ i=$(( $i + 1 ))
+ done
+ fi
+ fdt_line+=";"
# script for fit
if test "$LOAD_CMD" = "imxtract"
then
@@ -666,7 +715,7 @@ then
config {
description = "Xen";
kernel = "host_xen";
- fdt = "host_fdt";
+ $fdt_line
loadables = $load_files;
};
};