aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorBrian Woods2021-09-08 18:29:22 -0700
committerStefano Stabellini2021-09-10 15:47:45 -0700
commit18bf234a5b3e5cafed535fd8116557b0396aef25 (patch)
tree799bcd819a6f338a7d7cfcc52881f06c5cf7afe9 /scripts
parent10302c8d6d6daa8f31e9ed9a8cc79fe26b38160e (diff)
Add support for loading bitstreams
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>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/disk_image8
-rwxr-xr-xscripts/uboot-script-gen35
2 files changed, 43 insertions, 0 deletions
diff --git a/scripts/disk_image b/scripts/disk_image
index fc64386..1d71863 100755
--- a/scripts/disk_image
+++ b/scripts/disk_image
@@ -327,6 +327,10 @@ then
i=$(( $i + 1 ))
done
fi
+if test "${BITSTREAM}"
+then
+ _part1_size=$(( $_part1_size + `stat -L --printf="%s" $UBOOT_OUT/$BITSTREAM` ))
+fi
i=0
while test $i -lt $NUM_DOMUS
@@ -462,6 +466,10 @@ then
i=$(( $i + 1 ))
done
fi
+if test "${BITSTREAM}"
+then
+ cp --parents "$BITSTREAM" "${DESTDIR_ABS}/part/disk1/"
+fi
i=0
while test $i -lt $NUM_DOMUS
diff --git a/scripts/uboot-script-gen b/scripts/uboot-script-gen
index abcc0cd..974fc5f 100755
--- a/scripts/uboot-script-gen
+++ b/scripts/uboot-script-gen
@@ -446,6 +446,22 @@ linux_file_loading()
fi
}
+bitstream_load_and_config()
+{
+ if test "$BITSTREAM"
+ then
+ check_file_type "$BITSTREAM" "BIT data"
+ bitstream_addr=$memaddr
+ load_file $BITSTREAM "fpga_bitstream"
+ bitstream_size=$filesize
+ if test "$UBOOT_SOURCE"
+ then
+ # we assume the FPGA device is 0 here
+ echo "fpga load 0 $bitstream_addr $bitstream_size" >> "$UBOOT_SOURCE"
+ fi
+ fi
+}
+
create_its_file_xen()
{
if test "$ramdisk_addr" != "-"
@@ -608,6 +624,23 @@ create_its_file()
fdt_line+=";"
fi
+ if test "$BITSTREAM"
+ then
+ local fpga_line="fpga = \"fpga_bitstream\";"
+ cat >> "$its_file" <<- EOF
+ fpga_bitstream {
+ description = "FPGA bit stream";
+ data = /incbin/("$BITSTREAM");
+ type = "fpga";
+ arch = "arm64";
+ compression = "none";
+ compatible = "u-boot,fpga-legacy";
+ load = <$bitstream_addr>;
+ $fit_algo
+ };
+ EOF
+ fi
+
# script for fit
cat >> "$its_file" <<- EOF
boot_scr {
@@ -640,6 +673,7 @@ create_its_file()
kernel = "host_kernel";
$fdt_line
$ramdisk_line
+ $fpga_line
$loadables_line
};
};
@@ -903,6 +937,7 @@ fi
check_file_type $DEVICE_TREE "Device Tree Blob"
device_tree_addr=$memaddr
load_file $DEVICE_TREE "host_fdt"
+bitstream_load_and_config # bitstream is loaded last but used first
device_tree_editing $device_tree_addr
# disable device tree reloation