summaryrefslogtreecommitdiffstats
path: root/meta-xilinx-core
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@amd.com>2023-06-22 09:39:00 -0700
committerMark Hatle <mark.hatle@amd.com>2023-06-23 11:19:10 -0500
commit669660cd808c74d80f6966bd74ca574b45e472d0 (patch)
tree8172a430e5213c85e7221bc86f074ec14286869e /meta-xilinx-core
parent56f70c4f35d57afd56dd1750f219afbba8e6084d (diff)
downloadmeta-xilinx-669660cd808c74d80f6966bd74ca574b45e472d0.tar.gz
meta-xilinx-core: Add virtual/bitstream provider for non XSCT case
This is modeled after the pmufw and provides a non-default virtual/bitstream provider. Other boards and workflows will provider their own providers. Signed-off-by: Mark Hatle <mark.hatle@amd.com>
Diffstat (limited to 'meta-xilinx-core')
-rw-r--r--meta-xilinx-core/recipes-bsp/bitstream/bitstream.bb59
1 files changed, 59 insertions, 0 deletions
diff --git a/meta-xilinx-core/recipes-bsp/bitstream/bitstream.bb b/meta-xilinx-core/recipes-bsp/bitstream/bitstream.bb
new file mode 100644
index 00000000..f61761f4
--- /dev/null
+++ b/meta-xilinx-core/recipes-bsp/bitstream/bitstream.bb
@@ -0,0 +1,59 @@
1DESCRIPTION = "Recipe to provide a bitstream via virtual/bitstream"
2
3LICENSE = "MIT"
4LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
5
6INHIBIT_DEFAULT_DEPS = "1"
7
8# We never want to prefer this over another provider
9DEFAULT_PREFERENCE = "-1"
10
11PROVIDES = "virtual/bitstream"
12
13COMPATIBLE_MACHINE = "$^"
14COMPATIBLE_MACHINE:zynq = ".*"
15COMPATIBLE_MACHINE:zynqmp = ".*"
16
17# Since we're just copying, we can run any config
18COMPATIBLE_HOST = ".*"
19
20PACKAGE_ARCH = "${MACHINE_ARCH}"
21
22# Path where the bitstream can be found
23BITSTREAM_PATH ?= ""
24
25inherit deploy
26
27do_install() {
28 if [ ! -e ${BITSTREAM_PATH} ]; then
29 echo "Unable to find BITSTREAM_PATH (${BITSTREAM_PATH})"
30 exit 1
31 fi
32
33 install -Dm 0644 ${BITSTREAM_PATH} ${D}/boot/.
34}
35
36# If the item is already in OUR deploy_image_dir, nothing to deploy!
37SHOULD_DEPLOY = "${@'false' if (d.getVar('BITSTREAM_PATH')).startswith(d.getVar('DEPLOY_DIR_IMAGE')) else 'true'}"
38do_deploy() {
39 # If the item is already in OUR deploy_image_dir, nothing to deploy!
40 if ${SHOULD_DEPLOY}; then
41 install -Dm 0644 ${BITSTREAM_PATH} ${DEPLOYDIR}/.
42 fi
43}
44
45def check_bitstream_vars(d):
46 # If BITSTREAM_PATH is not defined, we error and instruct the user
47 # Don't cache this, as the items on disk can change!
48 d.setVar('BB_DONT_CACHE', '1')
49 if d.getVar('BITSTREAM_PATH') and not os.path.exists(d.getVar('BITSTREAM_PATH')):
50 raise bb.parse.SkipRecipe("The expected bitstream file %s is not available.\nSee the meta-xilinx-core README.")
51
52 if not d.getVar('BITSTREAM_PATH'):
53 raise bb.parse.SkipRecipe("Something is depending on virtual/bitstream and you have not provided a bitstream using BITSTREAM_PATH variable.\n See the meta-xilinx-core README.")
54
55python() {
56 # Need to allow bbappends to change the check
57 check_bitstream_vars(d)
58}
59