diff options
author | Mark Hatle <mark.hatle@amd.com> | 2023-06-22 09:39:00 -0700 |
---|---|---|
committer | Mark Hatle <mark.hatle@amd.com> | 2023-06-23 11:19:10 -0500 |
commit | 669660cd808c74d80f6966bd74ca574b45e472d0 (patch) | |
tree | 8172a430e5213c85e7221bc86f074ec14286869e /meta-xilinx-core | |
parent | 56f70c4f35d57afd56dd1750f219afbba8e6084d (diff) | |
download | meta-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.bb | 59 |
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 @@ | |||
1 | DESCRIPTION = "Recipe to provide a bitstream via virtual/bitstream" | ||
2 | |||
3 | LICENSE = "MIT" | ||
4 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" | ||
5 | |||
6 | INHIBIT_DEFAULT_DEPS = "1" | ||
7 | |||
8 | # We never want to prefer this over another provider | ||
9 | DEFAULT_PREFERENCE = "-1" | ||
10 | |||
11 | PROVIDES = "virtual/bitstream" | ||
12 | |||
13 | COMPATIBLE_MACHINE = "$^" | ||
14 | COMPATIBLE_MACHINE:zynq = ".*" | ||
15 | COMPATIBLE_MACHINE:zynqmp = ".*" | ||
16 | |||
17 | # Since we're just copying, we can run any config | ||
18 | COMPATIBLE_HOST = ".*" | ||
19 | |||
20 | PACKAGE_ARCH = "${MACHINE_ARCH}" | ||
21 | |||
22 | # Path where the bitstream can be found | ||
23 | BITSTREAM_PATH ?= "" | ||
24 | |||
25 | inherit deploy | ||
26 | |||
27 | do_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! | ||
37 | SHOULD_DEPLOY = "${@'false' if (d.getVar('BITSTREAM_PATH')).startswith(d.getVar('DEPLOY_DIR_IMAGE')) else 'true'}" | ||
38 | do_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 | |||
45 | def 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 | |||
55 | python() { | ||
56 | # Need to allow bbappends to change the check | ||
57 | check_bitstream_vars(d) | ||
58 | } | ||
59 | |||