diff options
| author | Mark Hatle <mark.hatle@amd.com> | 2024-11-11 11:24:08 -0700 |
|---|---|---|
| committer | Mark Hatle <mark.hatle@amd.com> | 2024-11-11 11:24:08 -0700 |
| commit | ee6e2f1f4fc8d438bfde7634e31657b52970fda9 (patch) | |
| tree | 38b5366d82e15538ab3c5e4f9a3dd1dcac26ff20 /meta-xilinx-demos | |
| parent | 03d3b2ce359a1c2959f04588cf2c4a1b0dcb4de8 (diff) | |
| parent | 7c79383570dc4182bb21cdee68598ccf47403150 (diff) | |
| download | meta-xilinx-ee6e2f1f4fc8d438bfde7634e31657b52970fda9.tar.gz | |
Merge remote-tracking branch 'origin/rel-v2024.2' into scarthgap-next
Signed-off-by: Mark Hatle <mark.hatle@amd.com>
Diffstat (limited to 'meta-xilinx-demos')
43 files changed, 1778 insertions, 0 deletions
diff --git a/meta-xilinx-demos/README.md b/meta-xilinx-demos/README.md new file mode 100644 index 00000000..1bbe744a --- /dev/null +++ b/meta-xilinx-demos/README.md | |||
| @@ -0,0 +1,64 @@ | |||
| 1 | # meta-xilinx-demos | ||
| 2 | |||
| 3 | This layer contains demos recipes and packagegroup for PL firmware, openamp, | ||
| 4 | jupyter notebook, ros, qt5, multimedia, sdfec etc for AMD Adaptive SoC's and | ||
| 5 | FPGA's target images. | ||
| 6 | |||
| 7 | > **Note:** Some of the demos recipes and packagegroup are moved from meta-petalinux | ||
| 8 | > layer to meta-xilinx-demos layer and these packagegroup are renamed. | ||
| 9 | |||
| 10 | ## How to enable demos for target image | ||
| 11 | |||
| 12 | 1. Follow [Building Instructions](../README.building.md) upto step 4. | ||
| 13 | |||
| 14 | 2. Add meta-xilinx-demos to bblayers.conf as shown below. | ||
| 15 | ``` | ||
| 16 | $ bitbake-layers add-layer ./<path-to-layer>/meta-xilinx/meta-xilinx-demos | ||
| 17 | ``` | ||
| 18 | |||
| 19 | 3. Add required demos recipes or packagegroup to target image using IMAGE_INSTALL | ||
| 20 | variable to the end of the conf/local.conf file as shown below. For example | ||
| 21 | include gpio-demo application. | ||
| 22 | ``` | ||
| 23 | IMAGE_INSTALL:append = " gpio-demo" | ||
| 24 | ``` | ||
| 25 | |||
| 26 | 4. Continue [Building Instructions](../README.building.md) from step 5. | ||
| 27 | |||
| 28 | ## Dependencies | ||
| 29 | |||
| 30 | This layer depends on: | ||
| 31 | |||
| 32 | URI: https://git.yoctoproject.org/poky | ||
| 33 | layers: meta, meta-poky | ||
| 34 | branch: scarthgap | ||
| 35 | |||
| 36 | URI: https://git.openembedded.org/meta-openembedded | ||
| 37 | layers: meta-oe, meta-perl, meta-python, meta-filesystems, meta-gnome, | ||
| 38 | meta-multimedia, meta-networking, meta-webserver, meta-xfce, | ||
| 39 | meta-initramfs. | ||
| 40 | branch: scarthgap | ||
| 41 | |||
| 42 | URI: | ||
| 43 | https://git.yoctoproject.org/meta-xilinx (official version) | ||
| 44 | https://github.com/Xilinx/meta-xilinx (development and AMD release) | ||
| 45 | layers: meta-xilinx-core, meta-xilinx-microblaze, meta-xilinx-bsp, | ||
| 46 | meta-xilinx-standalone. | ||
| 47 | branch: scarthgap or AMD release version (e.g. rel-v2024.2) | ||
| 48 | |||
| 49 | URI: https://github.com/Xilinx/meta-jupyter | ||
| 50 | branch: scarthgap or AMD release version (e.g. rel-v2024.2) | ||
| 51 | |||
| 52 | URI: https://github.com/OpenAMP/meta-openamp | ||
| 53 | branch: scarthgap | ||
| 54 | |||
| 55 | URI: https://github.com/meta-qt5/meta-qt5 | ||
| 56 | branch: scarthgap | ||
| 57 | |||
| 58 | URI: https://github.com/Xilinx/meta-ros | ||
| 59 | layers: meta-ros-common, meta-ros2, meta-ros2-jazzy | ||
| 60 | branch: AMD release version (e.g. rel-v2024.2) | ||
| 61 | |||
| 62 | URI: https://git.yoctoproject.org/meta-arm | ||
| 63 | layers: meta-arm, meta-arm-toolchain | ||
| 64 | branch: scarthgap | ||
diff --git a/meta-xilinx-demos/classes/jupyter-examples.bbclass b/meta-xilinx-demos/classes/jupyter-examples.bbclass new file mode 100644 index 00000000..962f45b2 --- /dev/null +++ b/meta-xilinx-demos/classes/jupyter-examples.bbclass | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | S = "${WORKDIR}" | ||
| 2 | |||
| 3 | FILES:${PN} += "${JUPYTER_DIR}" | ||
| 4 | |||
| 5 | RDEPENDS:${PN} ?= "packagegroup-xilinx-jupyter" | ||
| 6 | |||
| 7 | JUPYTER_DIR ?= "${datadir}/example-notebooks" | ||
| 8 | |||
| 9 | do_install() { | ||
| 10 | install -d ${D}/${JUPYTER_DIR}/${PN} | ||
| 11 | install -m 0755 ${S}/*.ipynb ${D}/${JUPYTER_DIR}/${PN}/ | ||
| 12 | } | ||
| 13 | |||
| 14 | EXCLUDE_FROM_WORLD = "1" | ||
| 15 | |||
| 16 | PACKAGE_ARCH = "${MACHINE_ARCH}" | ||
| 17 | |||
diff --git a/meta-xilinx-demos/conf/layer.conf b/meta-xilinx-demos/conf/layer.conf new file mode 100644 index 00000000..1f4b6b64 --- /dev/null +++ b/meta-xilinx-demos/conf/layer.conf | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | # We have a conf and classes directory, add to BBPATH | ||
| 2 | BBPATH .= ":${LAYERDIR}" | ||
| 3 | |||
| 4 | # We have a packages directory, add to BBFILES | ||
| 5 | BBFILES += "${LAYERDIR}/recipes-*/*/*.bb" | ||
| 6 | BBFILES += "${LAYERDIR}/recipes-*/*/*.bbappend" | ||
| 7 | |||
| 8 | BBFILE_COLLECTIONS += "xilinx-demos" | ||
| 9 | BBFILE_PATTERN_xilinx-demos = "^${LAYERDIR}/" | ||
| 10 | BBFILE_PRIORITY_xilinx-demos = "5" | ||
| 11 | |||
| 12 | LAYERDEPENDS_xilinx-demos = "core" | ||
| 13 | LAYERRECOMMENDS_xilinx-demos = "openembedded-layer" | ||
| 14 | |||
| 15 | LAYERSERIES_COMPAT_xilinx-demos = "scarthgap" | ||
| 16 | |||
| 17 | # Define dynamic layers | ||
| 18 | BBFILES_DYNAMIC += " \ | ||
| 19 | jupyter-layer:${LAYERDIR}/dynamic-layers/meta-jupyter/recipes-*/*/*.bb \ | ||
| 20 | jupyter-layer:${LAYERDIR}/dynamic-layers/meta-jupyter/recipes-*/*/*.bbappend \ | ||
| 21 | openamp-layer:${LAYERDIR}/dynamic-layers/meta-openamp/recipes-*/*/*.bb \ | ||
| 22 | openamp-layer:${LAYERDIR}/dynamic-layers/meta-openamp/recipes-*/*/*.bbappend \ | ||
| 23 | ros-common-layer:${LAYERDIR}/dynamic-layers/meta-ros/meta-ros-common/recipes-*/*/*.bb \ | ||
| 24 | ros-common-layer:${LAYERDIR}/dynamic-layers/meta-ros/meta-ros-common/recipes-*/*/*.bbappend \ | ||
| 25 | ros-common-layer:${LAYERDIR}/dynamic-layers/meta-ros/meta-ros2-jazzy/recipes-*/*/*.bb \ | ||
| 26 | ros-common-layer:${LAYERDIR}/dynamic-layers/meta-ros/meta-ros2-jazzy/recipes-*/*/*.bbappend \ | ||
| 27 | " | ||
diff --git a/meta-xilinx-demos/dynamic-layers/meta-jupyter/recipes-core/packagegroups/packagegroup-xilinx-jupyter.bb b/meta-xilinx-demos/dynamic-layers/meta-jupyter/recipes-core/packagegroups/packagegroup-xilinx-jupyter.bb new file mode 100644 index 00000000..efc1b543 --- /dev/null +++ b/meta-xilinx-demos/dynamic-layers/meta-jupyter/recipes-core/packagegroups/packagegroup-xilinx-jupyter.bb | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | DESCRIPTION = "Required packges for running jupyter notebook with python3 " | ||
| 2 | |||
| 3 | inherit packagegroup | ||
| 4 | |||
| 5 | JUPYTER_NOTEBOOK_PACKAGES = " \ | ||
| 6 | packagegroup-python3-jupyter \ | ||
| 7 | python3-core \ | ||
| 8 | python3-ipywidgets \ | ||
| 9 | python3-pydot \ | ||
| 10 | liberation-fonts \ | ||
| 11 | ttf-bitstream-vera \ | ||
| 12 | start-jupyter \ | ||
| 13 | " | ||
| 14 | |||
| 15 | RDEPENDS:${PN} = "${JUPYTER_NOTEBOOK_PACKAGES}" | ||
diff --git a/meta-xilinx-demos/dynamic-layers/meta-jupyter/recipes-example/pm-notebooks/files/LICENSE b/meta-xilinx-demos/dynamic-layers/meta-jupyter/recipes-example/pm-notebooks/files/LICENSE new file mode 100644 index 00000000..e09f3af7 --- /dev/null +++ b/meta-xilinx-demos/dynamic-layers/meta-jupyter/recipes-example/pm-notebooks/files/LICENSE | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | Copyright (c) 2019, Xilinx | ||
| 2 | All rights reserved. | ||
| 3 | |||
| 4 | Redistribution and use in source and binary forms, with or without | ||
| 5 | modification, are permitted provided that the following conditions are met: | ||
| 6 | |||
| 7 | * Redistributions of source code must retain the above copyright notice, this | ||
| 8 | list of conditions and the following disclaimer. | ||
| 9 | |||
| 10 | * Redistributions in binary form must reproduce the above copyright notice, | ||
| 11 | this list of conditions and the following disclaimer in the documentation | ||
| 12 | and/or other materials provided with the distribution. | ||
| 13 | |||
| 14 | * Neither the name of the copyright holder nor the names of its | ||
| 15 | contributors may be used to endorse or promote products derived from | ||
| 16 | this software without specific prior written permission. | ||
| 17 | |||
| 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
| 19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
| 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
| 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
| 24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
| 25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
| 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
| 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
diff --git a/meta-xilinx-demos/dynamic-layers/meta-jupyter/recipes-example/pm-notebooks/pm-notebooks_1.0.bb b/meta-xilinx-demos/dynamic-layers/meta-jupyter/recipes-example/pm-notebooks/pm-notebooks_1.0.bb new file mode 100644 index 00000000..2c00c316 --- /dev/null +++ b/meta-xilinx-demos/dynamic-layers/meta-jupyter/recipes-example/pm-notebooks/pm-notebooks_1.0.bb | |||
| @@ -0,0 +1,36 @@ | |||
| 1 | DESCRIPTION = "Jupyter notebook examples for Platform Management (PM) in Versal devices" | ||
| 2 | LICENSE = "BSD-3-Clause" | ||
| 3 | LIC_FILES_CHKSUM = "file://../../LICENSE;md5=268f2517fdae6d70f4ea4c55c4090aa8" | ||
| 4 | |||
| 5 | inherit jupyter-examples | ||
| 6 | |||
| 7 | SRC_URI = "git://github.com/Xilinx/platform-management-notebooks.git;branch=xlnx_rel_v2023.2;protocol=https \ | ||
| 8 | file://LICENSE \ | ||
| 9 | " | ||
| 10 | |||
| 11 | SRCREV = "c502be361b6857e21ab903f31c9ead69e3a0d9ba" | ||
| 12 | |||
| 13 | S = "${WORKDIR}/git/pm-notebooks" | ||
| 14 | |||
| 15 | COMPATIBLE_MACHINE = "^$" | ||
| 16 | COMPATIBLE_MACHINE:versal = "versal" | ||
| 17 | COMPATIBLE_MACHINE:versal-net = "versal-net" | ||
| 18 | |||
| 19 | RDEPENDS:${PN} = " \ | ||
| 20 | packagegroup-xilinx-jupyter \ | ||
| 21 | python3-ipywidgets \ | ||
| 22 | python3-pydot \ | ||
| 23 | graphviz \ | ||
| 24 | " | ||
| 25 | |||
| 26 | do_install() { | ||
| 27 | install -d ${D}/${JUPYTER_DIR}/pm-notebooks | ||
| 28 | install -d ${D}/${JUPYTER_DIR}/pm-notebooks/pmutil | ||
| 29 | install -d ${D}/${JUPYTER_DIR}/pm-notebooks/pmutil/data | ||
| 30 | |||
| 31 | install -m 0644 ${S}/README ${D}/${JUPYTER_DIR}/pm-notebooks | ||
| 32 | install -m 0755 ${S}/*.ipynb ${D}/${JUPYTER_DIR}/pm-notebooks | ||
| 33 | install -m 0755 ${S}/pmutil/*.py ${D}/${JUPYTER_DIR}/pm-notebooks/pmutil | ||
| 34 | install -m 0755 ${S}/pmutil/data/*.png ${D}/${JUPYTER_DIR}/pm-notebooks/pmutil/data | ||
| 35 | } | ||
| 36 | |||
diff --git a/meta-xilinx-demos/dynamic-layers/meta-jupyter/recipes-utils/start-jupyterlab/start-jupyterlab/jupyter-setup.service b/meta-xilinx-demos/dynamic-layers/meta-jupyter/recipes-utils/start-jupyterlab/start-jupyterlab/jupyter-setup.service new file mode 100644 index 00000000..8f5c25e6 --- /dev/null +++ b/meta-xilinx-demos/dynamic-layers/meta-jupyter/recipes-utils/start-jupyterlab/start-jupyterlab/jupyter-setup.service | |||
| @@ -0,0 +1,10 @@ | |||
| 1 | [Unit] | ||
| 2 | Description=jupyter setup scripts | ||
| 3 | Requires=network-online.target | ||
| 4 | After=network-online.target | ||
| 5 | |||
| 6 | [Service] | ||
| 7 | ExecStart=/sbin/start-jupyter.sh | ||
| 8 | |||
| 9 | [Install] | ||
| 10 | WantedBy=default.target | ||
diff --git a/meta-xilinx-demos/dynamic-layers/meta-jupyter/recipes-utils/start-jupyterlab/start-jupyterlab/jupyter-setup.sh b/meta-xilinx-demos/dynamic-layers/meta-jupyter/recipes-utils/start-jupyterlab/start-jupyterlab/jupyter-setup.sh new file mode 100755 index 00000000..f712c8ed --- /dev/null +++ b/meta-xilinx-demos/dynamic-layers/meta-jupyter/recipes-utils/start-jupyterlab/start-jupyterlab/jupyter-setup.sh | |||
| @@ -0,0 +1,119 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | #/etc/init.d/jupyterlab-start: start jupyterlab daemon | ||
| 3 | |||
| 4 | ### BEGIN INIT INFO | ||
| 5 | # Provides: jupyter-lab | ||
| 6 | # Default-Start: 3 5 | ||
| 7 | # Default-Stop: 0 1 2 6 | ||
| 8 | # Short-Description: Start Jupyter Lab server as petalinux user | ||
| 9 | ### END INIT INFO | ||
| 10 | |||
| 11 | OWNER="petalinux" | ||
| 12 | GROUP="petalinux" | ||
| 13 | HOME=`(cd ~petalinux && pwd) || echo 'none'` | ||
| 14 | NBDIR="${HOME}/notebooks" | ||
| 15 | |||
| 16 | DAEMON_PATH="/sbin/start-jupyter.sh" | ||
| 17 | DAEMON_NAME=`basename $DAEMON_PATH` | ||
| 18 | PIDFILE="/var/run/${DAEMON_NAME}.pid" | ||
| 19 | |||
| 20 | PATH=/bin:/usr/bin:/sbin:/usr/sbin | ||
| 21 | |||
| 22 | . /etc/init.d/functions | ||
| 23 | |||
| 24 | wait_for_ip() { | ||
| 25 | echo -n "Waiting for IP address..." | ||
| 26 | |||
| 27 | for i in {1..20} | ||
| 28 | do | ||
| 29 | echo -n "." | ||
| 30 | ip=$(ip -4 addr show eth0 | grep -oE "inet ([0-9]{1,3}[\.]){3}[0-9]{1,3}" | cut -d ' ' -f2) | ||
| 31 | [ -n "$ip" ] && break | ||
| 32 | if [ -d /sys/class/net/eth1 ]; then | ||
| 33 | ip=$(ip -4 addr show eth1 | grep -oE "inet ([0-9]{1,3}[\.]){3}[0-9]{1,3}" | cut -d ' ' -f2) | ||
| 34 | [ -n "$ip" ] && break | ||
| 35 | fi | ||
| 36 | sleep 2 | ||
| 37 | done | ||
| 38 | |||
| 39 | if [ -z $ip ]; then | ||
| 40 | echo " TIMEOUT" | ||
| 41 | else | ||
| 42 | echo " SUCCESS" | ||
| 43 | fi | ||
| 44 | } | ||
| 45 | |||
| 46 | log_begin_msg() { | ||
| 47 | echo -n $* | ||
| 48 | } | ||
| 49 | |||
| 50 | log_end_msg() { | ||
| 51 | if [ "$1" = "0" ]; then | ||
| 52 | echo ' OK' | ||
| 53 | else | ||
| 54 | echo ' ERROR' | ||
| 55 | fi | ||
| 56 | } | ||
| 57 | |||
| 58 | log_daemon_msg() { | ||
| 59 | echo $* | ||
| 60 | } | ||
| 61 | |||
| 62 | log_progress_msg() { | ||
| 63 | echo $* | ||
| 64 | } | ||
| 65 | |||
| 66 | test -x $DAEMON_PATH || exit 0 | ||
| 67 | |||
| 68 | case "$1" in | ||
| 69 | start) | ||
| 70 | log_begin_msg "Starting jupyter-lab server daemon... " | ||
| 71 | |||
| 72 | # Various jupter paths are incorrect if this daemon is run as part of the | ||
| 73 | # init process. Override the directories with these environment variables. | ||
| 74 | export JUPYTER_CONFIG_DIR="${HOME}/.jupyter" | ||
| 75 | export JUPYTER_DATA_DIR="${HOME}/.local/share/jupyter" | ||
| 76 | export JUPYTER_RUNTIME_DIR="${HOME}/.local/share/jupyter/runtime" | ||
| 77 | export HOME="${HOME}" | ||
| 78 | |||
| 79 | # check owner and group are valid | ||
| 80 | id $OWNER > /dev/null 2>&1 | ||
| 81 | if [ "$?" = "1" ]; then echo "'$OWNER': no such owner... ERROR" ; exit 1 ; fi | ||
| 82 | grep $GROUP /etc/group > /dev/null | ||
| 83 | if [ "$?" = "1" ]; then echo "'$GROUP': no such group... ERROR" ; exit 1 ; fi | ||
| 84 | |||
| 85 | # create nb dir if it doesn't exist | ||
| 86 | if [ ! -d "$NBDIR" ] ; then install -o $OWNER -g $GROUP -d $NBDIR ; fi | ||
| 87 | |||
| 88 | # start the daemon | ||
| 89 | wait_for_ip | ||
| 90 | start-stop-daemon -S -c $OWNER:$GROUP -m -p $PIDFILE -x $DAEMON_NAME & | ||
| 91 | log_end_msg $? | ||
| 92 | ;; | ||
| 93 | |||
| 94 | stop) | ||
| 95 | log_begin_msg "Stopping jupyter-lab server daemon..." | ||
| 96 | start-stop-daemon -K -q -p $PIDFILE | ||
| 97 | log_end_msg $? | ||
| 98 | ;; | ||
| 99 | |||
| 100 | restart) | ||
| 101 | $0 force-reload | ||
| 102 | ;; | ||
| 103 | |||
| 104 | force-reload) | ||
| 105 | log_daemon_msg "Restarting jupyter-lab server daemon" | ||
| 106 | $0 stop | ||
| 107 | $0 start | ||
| 108 | ;; | ||
| 109 | |||
| 110 | status) | ||
| 111 | status $DAEMON_PATH | ||
| 112 | ;; | ||
| 113 | |||
| 114 | *) | ||
| 115 | echo "usage: $0 {start|stop|restart|force-reload|status}" | ||
| 116 | exit 1 | ||
| 117 | esac | ||
| 118 | |||
| 119 | exit 0 | ||
diff --git a/meta-xilinx-demos/dynamic-layers/meta-jupyter/recipes-utils/start-jupyterlab/start-jupyterlab/jupyter_server_config.py b/meta-xilinx-demos/dynamic-layers/meta-jupyter/recipes-utils/start-jupyterlab/start-jupyterlab/jupyter_server_config.py new file mode 100644 index 00000000..7cca31e7 --- /dev/null +++ b/meta-xilinx-demos/dynamic-layers/meta-jupyter/recipes-utils/start-jupyterlab/start-jupyterlab/jupyter_server_config.py | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | c.ServerApp.port = 8888 | ||
| 2 | c.ServerApp.iopub_data_rate_limit = 100000000 | ||
| 3 | c.ServerApp.allow_root=True | ||
| 4 | c.ServerApp.open_browser=False | ||
| 5 | |||
diff --git a/meta-xilinx-demos/dynamic-layers/meta-jupyter/recipes-utils/start-jupyterlab/start-jupyterlab/overrides.json b/meta-xilinx-demos/dynamic-layers/meta-jupyter/recipes-utils/start-jupyterlab/start-jupyterlab/overrides.json new file mode 100644 index 00000000..3d39e80e --- /dev/null +++ b/meta-xilinx-demos/dynamic-layers/meta-jupyter/recipes-utils/start-jupyterlab/start-jupyterlab/overrides.json | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | { | ||
| 2 | "@jupyterlab/apputils-extension:themes": { | ||
| 3 | "theme": "JupyterLab Dark" | ||
| 4 | } | ||
| 5 | } | ||
diff --git a/meta-xilinx-demos/dynamic-layers/meta-jupyter/recipes-utils/start-jupyterlab/start-jupyterlab/start-jupyter.sh b/meta-xilinx-demos/dynamic-layers/meta-jupyter/recipes-utils/start-jupyterlab/start-jupyterlab/start-jupyter.sh new file mode 100755 index 00000000..0a8d737a --- /dev/null +++ b/meta-xilinx-demos/dynamic-layers/meta-jupyter/recipes-utils/start-jupyterlab/start-jupyterlab/start-jupyter.sh | |||
| @@ -0,0 +1,37 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | #******************************************************************************* | ||
| 3 | # | ||
| 4 | # Copyright (C) 2019 Xilinx, Inc. All rights reserved. | ||
| 5 | # | ||
| 6 | # Permission is hereby granted, free of charge, to any person obtaining | ||
| 7 | # a copy of this software and associated documentation files (the | ||
| 8 | # "Software"), to deal in the Software without restriction, including | ||
| 9 | # without limitation the rights to use, copy, modify, merge, publish, | ||
| 10 | # distribute, sublicense, and/or sell copies of the Software, and to | ||
| 11 | # permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
| 12 | # | ||
| 13 | # The above copyright notice and this permission notice shall be | ||
| 14 | # included in all copies or substantial portions of the Software. | ||
| 15 | # | ||
| 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
| 17 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
| 18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
| 19 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS | ||
| 20 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN | ||
| 21 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
| 22 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
| 23 | # | ||
| 24 | #********************************************************************** | ||
| 25 | |||
| 26 | ip=$(ip -4 addr show eth0 | grep -oE "inet ([0-9]{1,3}[\.]){3}[0-9]{1,3}" | cut -d ' ' -f2) | ||
| 27 | |||
| 28 | if [ -z "$ip" ] && [ -d /sys/class/net/eth1 ] ; then | ||
| 29 | ip=$(ip -4 addr show eth1 | grep -oE "inet ([0-9]{1,3}[\.]){3}[0-9]{1,3}" | cut -d ' ' -f2) | ||
| 30 | fi | ||
| 31 | |||
| 32 | if [ -z $ip ]; then | ||
| 33 | echo "ERROR: Invalid IP address" | ||
| 34 | exit 1 | ||
| 35 | fi | ||
| 36 | |||
| 37 | jupyter-lab --no-browser --allow-root --ip=$ip | ||
diff --git a/meta-xilinx-demos/dynamic-layers/meta-jupyter/recipes-utils/start-jupyterlab/start-jupyterlab_1.0.bb b/meta-xilinx-demos/dynamic-layers/meta-jupyter/recipes-utils/start-jupyterlab/start-jupyterlab_1.0.bb new file mode 100644 index 00000000..240e8267 --- /dev/null +++ b/meta-xilinx-demos/dynamic-layers/meta-jupyter/recipes-utils/start-jupyterlab/start-jupyterlab_1.0.bb | |||
| @@ -0,0 +1,66 @@ | |||
| 1 | # | ||
| 2 | # This is the jupyter-lab startup daemon | ||
| 3 | # | ||
| 4 | |||
| 5 | SUMMARY = "Start Jupyter-lab server at system boot" | ||
| 6 | |||
| 7 | SRC_URI = " \ | ||
| 8 | file://jupyter_server_config.py \ | ||
| 9 | file://jupyter-setup.sh \ | ||
| 10 | file://jupyter-setup.service \ | ||
| 11 | file://overrides.json \ | ||
| 12 | file://start-jupyter.sh \ | ||
| 13 | " | ||
| 14 | |||
| 15 | LICENSE = "MIT" | ||
| 16 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" | ||
| 17 | |||
| 18 | JUPYTER_STARTUP_PACKAGES += " \ | ||
| 19 | python3-jupyterlab \ | ||
| 20 | bash \ | ||
| 21 | procps \ | ||
| 22 | " | ||
| 23 | |||
| 24 | RDEPENDS:${PN} = " ${JUPYTER_STARTUP_PACKAGES}" | ||
| 25 | |||
| 26 | PROVIDES = "start-jupyter" | ||
| 27 | RPROVIDES:${PN} = "start-jupyter" | ||
| 28 | |||
| 29 | inherit update-rc.d systemd | ||
| 30 | |||
| 31 | INITSCRIPT_NAME = "jupyter-setup.sh" | ||
| 32 | INITSCRIPT_PARAMS = "start 99 3 5 . stop 20 0 1 2 6 ." | ||
| 33 | |||
| 34 | SYSTEMD_PACKAGES="${PN}" | ||
| 35 | SYSTEMD_SERVICE:${PN}="jupyter-setup.service" | ||
| 36 | SYSTEMD_AUTO_ENABLE:${PN}="disable" | ||
| 37 | |||
| 38 | S = "${WORKDIR}" | ||
| 39 | |||
| 40 | do_install() { | ||
| 41 | install -d ${D}${datadir}/jupyter/lab/settings | ||
| 42 | install -m 0644 ${WORKDIR}/overrides.json ${D}${datadir}/jupyter/lab/settings/ | ||
| 43 | |||
| 44 | if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then | ||
| 45 | install -d ${D}${sysconfdir}/init.d/ | ||
| 46 | install -m 0755 ${WORKDIR}/jupyter-setup.sh ${D}${sysconfdir}/init.d/jupyter-setup.sh | ||
| 47 | fi | ||
| 48 | |||
| 49 | install -d ${D}${systemd_system_unitdir} | ||
| 50 | install -m 0644 ${WORKDIR}/jupyter-setup.service ${D}${systemd_system_unitdir} | ||
| 51 | |||
| 52 | install -d ${D}${systemd_user_unitdir} | ||
| 53 | install -m 0644 ${WORKDIR}/jupyter-setup.service ${D}${systemd_user_unitdir} | ||
| 54 | |||
| 55 | install -d ${D}${base_sbindir} | ||
| 56 | install -m 0755 ${WORKDIR}/start-jupyter.sh ${D}${base_sbindir}/start-jupyter.sh | ||
| 57 | |||
| 58 | install -d ${D}${sysconfdir}/jupyter/ | ||
| 59 | install -m 0644 ${WORKDIR}/jupyter_server_config.py ${D}${sysconfdir}/jupyter | ||
| 60 | } | ||
| 61 | |||
| 62 | FILES:${PN} += " \ | ||
| 63 | ${base_sbindir} \ | ||
| 64 | ${datadir}/jupyter/lab/settings \ | ||
| 65 | ${systemd_user_unitdir} \ | ||
| 66 | " | ||
diff --git a/meta-xilinx-demos/dynamic-layers/meta-jupyter/recipes-utils/start-jupyternb/start-jupyternb/jupyter-setup.service b/meta-xilinx-demos/dynamic-layers/meta-jupyter/recipes-utils/start-jupyternb/start-jupyternb/jupyter-setup.service new file mode 100644 index 00000000..8f5c25e6 --- /dev/null +++ b/meta-xilinx-demos/dynamic-layers/meta-jupyter/recipes-utils/start-jupyternb/start-jupyternb/jupyter-setup.service | |||
| @@ -0,0 +1,10 @@ | |||
| 1 | [Unit] | ||
| 2 | Description=jupyter setup scripts | ||
| 3 | Requires=network-online.target | ||
| 4 | After=network-online.target | ||
| 5 | |||
| 6 | [Service] | ||
| 7 | ExecStart=/sbin/start-jupyter.sh | ||
| 8 | |||
| 9 | [Install] | ||
| 10 | WantedBy=default.target | ||
diff --git a/meta-xilinx-demos/dynamic-layers/meta-jupyter/recipes-utils/start-jupyternb/start-jupyternb/jupyter-setup.sh b/meta-xilinx-demos/dynamic-layers/meta-jupyter/recipes-utils/start-jupyternb/start-jupyternb/jupyter-setup.sh new file mode 100755 index 00000000..7084f8a2 --- /dev/null +++ b/meta-xilinx-demos/dynamic-layers/meta-jupyter/recipes-utils/start-jupyternb/start-jupyternb/jupyter-setup.sh | |||
| @@ -0,0 +1,119 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | ### BEGIN INIT INFO | ||
| 3 | # Provides: | ||
| 4 | # Required-Start: $remote_fs $syslog | ||
| 5 | # Required-Stop: $remote_fs $syslog | ||
| 6 | # Default-Start: 2 3 4 5 | ||
| 7 | # Default-Stop: 0 1 6 | ||
| 8 | # Short-Description: Start daemon at boot time | ||
| 9 | # Description: Enable service provided by daemon. | ||
| 10 | ### END INIT INFO | ||
| 11 | |||
| 12 | dir="" | ||
| 13 | cmd="start-jupyter.sh" | ||
| 14 | user="" | ||
| 15 | |||
| 16 | name="jupyter-setup" | ||
| 17 | pid_file="/var/run/$name.pid" | ||
| 18 | stdout_log="/var/log/$name.log" | ||
| 19 | stderr_log="/var/log/$name.err" | ||
| 20 | |||
| 21 | wait_for_ip() { | ||
| 22 | echo -n "Waiting for IP address..." | ||
| 23 | |||
| 24 | for i in {1..20} | ||
| 25 | do | ||
| 26 | echo -n "." | ||
| 27 | ip=$(ip -4 addr show eth0 | grep -oE "inet ([0-9]{1,3}[\.]){3}[0-9]{1,3}" | cut -d ' ' -f2) | ||
| 28 | [ -n "$ip" ] && break | ||
| 29 | if [ -d /sys/class/net/eth1 ]; then | ||
| 30 | ip=$(ip -4 addr show eth1 | grep -oE "inet ([0-9]{1,3}[\.]){3}[0-9]{1,3}" | cut -d ' ' -f2) | ||
| 31 | [ -n "$ip" ] && break | ||
| 32 | fi | ||
| 33 | sleep 2 | ||
| 34 | done | ||
| 35 | |||
| 36 | if [ -z $ip ]; then | ||
| 37 | echo " TIMEOUT" | ||
| 38 | else | ||
| 39 | echo " SUCCESS" | ||
| 40 | fi | ||
| 41 | } | ||
| 42 | |||
| 43 | get_pid() { | ||
| 44 | cat "$pid_file" | ||
| 45 | } | ||
| 46 | |||
| 47 | is_running() { | ||
| 48 | [ -f "$pid_file" ] && (ps -o"pid" | grep '^ '`get_pid`'$') > /dev/null 2>&1 | ||
| 49 | } | ||
| 50 | |||
| 51 | case "$1" in | ||
| 52 | start) | ||
| 53 | if is_running; then | ||
| 54 | echo "Already started" | ||
| 55 | else | ||
| 56 | echo "Starting $name" | ||
| 57 | cd "$dir" | ||
| 58 | wait_for_ip | ||
| 59 | $cmd & | ||
| 60 | echo $! > "$pid_file" | ||
| 61 | if ! is_running; then | ||
| 62 | echo "Unable to start, see $stdout_log and $stderr_log" | ||
| 63 | exit 1 | ||
| 64 | fi | ||
| 65 | fi | ||
| 66 | ;; | ||
| 67 | stop) | ||
| 68 | if is_running; then | ||
| 69 | echo -n "Stopping $name.." | ||
| 70 | kill `get_pid` | ||
| 71 | for i in 1 2 3 4 5 6 7 8 9 10 | ||
| 72 | # for i in `seq 10` | ||
| 73 | do | ||
| 74 | if ! is_running; then | ||
| 75 | break | ||
| 76 | fi | ||
| 77 | |||
| 78 | echo -n "." | ||
| 79 | sleep 1 | ||
| 80 | done | ||
| 81 | echo | ||
| 82 | |||
| 83 | if is_running; then | ||
| 84 | echo "Not stopped; may still be shutting down or shutdown may have failed" | ||
| 85 | exit 1 | ||
| 86 | else | ||
| 87 | echo "Stopped" | ||
| 88 | if [ -f "$pid_file" ]; then | ||
| 89 | rm "$pid_file" | ||
| 90 | fi | ||
| 91 | fi | ||
| 92 | else | ||
| 93 | echo "Not running" | ||
| 94 | fi | ||
| 95 | ;; | ||
| 96 | restart) | ||
| 97 | $0 stop | ||
| 98 | if is_running; then | ||
| 99 | echo "Unable to stop, will not attempt to start" | ||
| 100 | exit 1 | ||
| 101 | fi | ||
| 102 | $0 start | ||
| 103 | ;; | ||
| 104 | status) | ||
| 105 | if is_running; then | ||
| 106 | echo "Running" | ||
| 107 | else | ||
| 108 | echo "Stopped" | ||
| 109 | exit 1 | ||
| 110 | fi | ||
| 111 | ;; | ||
| 112 | *) | ||
| 113 | echo "Usage: $0 {start|stop|restart|status}" | ||
| 114 | exit 1 | ||
| 115 | ;; | ||
| 116 | esac | ||
| 117 | |||
| 118 | exit 0 | ||
| 119 | |||
diff --git a/meta-xilinx-demos/dynamic-layers/meta-jupyter/recipes-utils/start-jupyternb/start-jupyternb/jupyter-variables.sh b/meta-xilinx-demos/dynamic-layers/meta-jupyter/recipes-utils/start-jupyternb/start-jupyternb/jupyter-variables.sh new file mode 100644 index 00000000..0ab9dc6b --- /dev/null +++ b/meta-xilinx-demos/dynamic-layers/meta-jupyter/recipes-utils/start-jupyternb/start-jupyternb/jupyter-variables.sh | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | export BOARD="PLACEHOLDER" | ||
diff --git a/meta-xilinx-demos/dynamic-layers/meta-jupyter/recipes-utils/start-jupyternb/start-jupyternb/jupyter_notebook_config.py b/meta-xilinx-demos/dynamic-layers/meta-jupyter/recipes-utils/start-jupyternb/start-jupyternb/jupyter_notebook_config.py new file mode 100644 index 00000000..1a7a6961 --- /dev/null +++ b/meta-xilinx-demos/dynamic-layers/meta-jupyter/recipes-utils/start-jupyternb/start-jupyternb/jupyter_notebook_config.py | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | c.NotebookApp.notebook_dir = '/usr/share/example-notebooks' | ||
| 2 | c.NotebookApp.allow_root=True | ||
| 3 | c.NotebookApp.open_browser=False | ||
| 4 | |||
| 5 | |||
diff --git a/meta-xilinx-demos/dynamic-layers/meta-jupyter/recipes-utils/start-jupyternb/start-jupyternb/start-jupyter.sh b/meta-xilinx-demos/dynamic-layers/meta-jupyter/recipes-utils/start-jupyternb/start-jupyternb/start-jupyter.sh new file mode 100755 index 00000000..3db0ca13 --- /dev/null +++ b/meta-xilinx-demos/dynamic-layers/meta-jupyter/recipes-utils/start-jupyternb/start-jupyternb/start-jupyter.sh | |||
| @@ -0,0 +1,40 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | #******************************************************************************* | ||
| 3 | # | ||
| 4 | # Copyright (C) 2019 Xilinx, Inc. All rights reserved. | ||
| 5 | # | ||
| 6 | # Permission is hereby granted, free of charge, to any person obtaining | ||
| 7 | # a copy of this software and associated documentation files (the | ||
| 8 | # "Software"), to deal in the Software without restriction, including | ||
| 9 | # without limitation the rights to use, copy, modify, merge, publish, | ||
| 10 | # distribute, sublicense, and/or sell copies of the Software, and to | ||
| 11 | # permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
| 12 | # | ||
| 13 | # The above copyright notice and this permission notice shall be | ||
| 14 | # included in all copies or substantial portions of the Software. | ||
| 15 | # | ||
| 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
| 17 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
| 18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
| 19 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS | ||
| 20 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN | ||
| 21 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
| 22 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
| 23 | # | ||
| 24 | #********************************************************************** | ||
| 25 | |||
| 26 | |||
| 27 | ip=$(ip -4 addr show eth0 | grep -oE "inet ([0-9]{1,3}[\.]){3}[0-9]{1,3}" | cut -d ' ' -f2) | ||
| 28 | |||
| 29 | if [ -z "$ip" ] && [ -d /sys/class/net/eth1 ] ; then | ||
| 30 | ip=$(ip -4 addr show eth1 | grep -oE "inet ([0-9]{1,3}[\.]){3}[0-9]{1,3}" | cut -d ' ' -f2) | ||
| 31 | fi | ||
| 32 | |||
| 33 | if [ -z $ip ]; then | ||
| 34 | echo "ERROR: Invalid IP address" | ||
| 35 | exit 1 | ||
| 36 | fi | ||
| 37 | |||
| 38 | jupyter nbextension enable --py widgetsnbextension | ||
| 39 | jupyter notebook --no-browser --allow-root --ip=$ip | ||
| 40 | |||
diff --git a/meta-xilinx-demos/dynamic-layers/meta-jupyter/recipes-utils/start-jupyternb/start-jupyternb_1.0.bb b/meta-xilinx-demos/dynamic-layers/meta-jupyter/recipes-utils/start-jupyternb/start-jupyternb_1.0.bb new file mode 100644 index 00000000..42cae9c5 --- /dev/null +++ b/meta-xilinx-demos/dynamic-layers/meta-jupyter/recipes-utils/start-jupyternb/start-jupyternb_1.0.bb | |||
| @@ -0,0 +1,54 @@ | |||
| 1 | SUMMARY = "Start Jupyter at system boot" | ||
| 2 | |||
| 3 | SRC_URI = " file://start-jupyter.sh \ | ||
| 4 | file://jupyter-setup.sh \ | ||
| 5 | file://jupyter_notebook_config.py \ | ||
| 6 | file://jupyter-setup.service \ | ||
| 7 | " | ||
| 8 | |||
| 9 | LICENSE = "Proprietary" | ||
| 10 | LIC_FILES_CHKSUM = "file://start-jupyter.sh;beginline=2;endline=24;md5=f29b6e59838b939312f578e77087ada3" | ||
| 11 | |||
| 12 | JUPYTER_STARTUP_PACKAGES += " \ | ||
| 13 | python3-jupyter-core \ | ||
| 14 | bash \ | ||
| 15 | " | ||
| 16 | |||
| 17 | inherit update-rc.d systemd | ||
| 18 | PROVIDES = "start-jupyter" | ||
| 19 | RPROVIDES:${PN} = "start-jupyter" | ||
| 20 | |||
| 21 | RDEPENDS:${PN} = " ${JUPYTER_STARTUP_PACKAGES}" | ||
| 22 | |||
| 23 | INITSCRIPT_NAME = "jupyter-setup.sh" | ||
| 24 | INITSCRIPT_PARAMS = "start 99 S ." | ||
| 25 | |||
| 26 | SYSTEMD_PACKAGES="${PN}" | ||
| 27 | SYSTEMD_SERVICE:${PN}="jupyter-setup.service" | ||
| 28 | SYSTEMD_AUTO_ENABLE:${PN}="disable" | ||
| 29 | |||
| 30 | S = "${WORKDIR}" | ||
| 31 | |||
| 32 | FILES:${PN} += "${base_sbindir} ${systemd_user_unitdir} ${datadir}" | ||
| 33 | |||
| 34 | do_install() { | ||
| 35 | |||
| 36 | if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then | ||
| 37 | install -d ${D}${sysconfdir}/init.d/ | ||
| 38 | install -m 0755 ${WORKDIR}/jupyter-setup.sh ${D}${sysconfdir}/init.d/jupyter-setup.sh | ||
| 39 | fi | ||
| 40 | |||
| 41 | install -d ${D}${systemd_system_unitdir} | ||
| 42 | install -m 0644 ${WORKDIR}/jupyter-setup.service ${D}${systemd_system_unitdir} | ||
| 43 | |||
| 44 | install -d ${D}${systemd_user_unitdir} | ||
| 45 | install -m 0644 ${WORKDIR}/jupyter-setup.service ${D}${systemd_user_unitdir} | ||
| 46 | |||
| 47 | install -d ${D}${base_sbindir} | ||
| 48 | install -m 0755 ${WORKDIR}/start-jupyter.sh ${D}${base_sbindir}/start-jupyter.sh | ||
| 49 | |||
| 50 | install -d ${D}${sysconfdir}/jupyter/ | ||
| 51 | install -m 0644 ${WORKDIR}/jupyter_notebook_config.py ${D}${sysconfdir}/jupyter | ||
| 52 | |||
| 53 | install -d ${D}${datadir}/example-notebooks | ||
| 54 | } | ||
diff --git a/meta-xilinx-demos/dynamic-layers/meta-openamp/recipes-example/openamp/openamp-demo-notebooks_0.1.bb b/meta-xilinx-demos/dynamic-layers/meta-openamp/recipes-example/openamp/openamp-demo-notebooks_0.1.bb new file mode 100644 index 00000000..4c4ff2d8 --- /dev/null +++ b/meta-xilinx-demos/dynamic-layers/meta-openamp/recipes-example/openamp/openamp-demo-notebooks_0.1.bb | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | DESCRIPTION = "Jupyter notebooks for openAMP" | ||
| 2 | LICENSE = "BSD-3-Clause" | ||
| 3 | LIC_FILES_CHKSUM = "file://LICENSE;md5=268f2517fdae6d70f4ea4c55c4090aa8" | ||
| 4 | |||
| 5 | inherit jupyter-examples | ||
| 6 | |||
| 7 | REPO ?= "git://github.com/Xilinx/OpenAMP-notebooks.git;protocol=https" | ||
| 8 | SRCREV ?= "30b76d864261e5dd321fadfaf74b933b7cd88892" | ||
| 9 | BRANCH ?= "main" | ||
| 10 | BRANCHARG = "${@['nobranch=1', 'branch=${BRANCH}'][d.getVar('BRANCH') != '']}" | ||
| 11 | SRC_URI = "${REPO};${BRANCHARG}" | ||
| 12 | PV .= "+git" | ||
| 13 | S = "${WORKDIR}/git/openamp" | ||
| 14 | |||
| 15 | COMPATIBLE_MACHINE = "^$" | ||
| 16 | COMPATIBLE_MACHINE:zynqmp = "zynqmp" | ||
| 17 | COMPATIBLE_MACHINE:versal = "versal" | ||
| 18 | COMPATIBLE_MACHINE:versal-net = "versal-net" | ||
| 19 | |||
| 20 | DEPENDS += " packagegroup-xilinx-jupyter \ | ||
| 21 | packagegroup-openamp" | ||
| 22 | |||
| 23 | RDEPENDS:${PN} = " packagegroup-xilinx-jupyter \ | ||
| 24 | packagegroup-openamp" | ||
| 25 | |||
| 26 | do_install() { | ||
| 27 | install -d ${D}/${JUPYTER_DIR}/openamp-notebooks | ||
| 28 | install -d ${D}/${JUPYTER_DIR}/openamp-notebooks/pics | ||
| 29 | |||
| 30 | install -m 0755 ${S}/*.ipynb ${D}/${JUPYTER_DIR}/openamp-notebooks | ||
| 31 | install -m 0755 ${S}/pics/*.png ${D}/${JUPYTER_DIR}/openamp-notebooks/pics | ||
| 32 | } | ||
diff --git a/meta-xilinx-demos/dynamic-layers/meta-ros/meta-ros-common/recipes-core/packagegroups/packagegroup-xilinx-ros.bb b/meta-xilinx-demos/dynamic-layers/meta-ros/meta-ros-common/recipes-core/packagegroups/packagegroup-xilinx-ros.bb new file mode 100644 index 00000000..30237599 --- /dev/null +++ b/meta-xilinx-demos/dynamic-layers/meta-ros/meta-ros-common/recipes-core/packagegroups/packagegroup-xilinx-ros.bb | |||
| @@ -0,0 +1,167 @@ | |||
| 1 | DESCRIPTION = "Packages for ROS2 Base and Demos including some basic pub/sub examples" | ||
| 2 | |||
| 3 | PACKAGE_ARCH = "${TUNE_PKGARCH}" | ||
| 4 | |||
| 5 | inherit packagegroup | ||
| 6 | inherit ros_distro_${ROS_DISTRO} | ||
| 7 | |||
| 8 | PROVIDES = "${PACKAGES}" | ||
| 9 | |||
| 10 | PACKAGES += "${PN}-base ${PN}-demo ${PN}-control" | ||
| 11 | |||
| 12 | SUMMARY:${PN}-dev = "ROS packages required for on target development" | ||
| 13 | ROS_BUILDESSENTIAL_PACKAGES = "\ | ||
| 14 | ament-lint-auto \ | ||
| 15 | ament-cmake-auto \ | ||
| 16 | ament-cmake-core \ | ||
| 17 | ament-cmake-cppcheck \ | ||
| 18 | ament-cmake-cpplint \ | ||
| 19 | ament-cmake-export-definitions \ | ||
| 20 | ament-cmake-export-dependencies \ | ||
| 21 | ament-cmake-export-include-directories \ | ||
| 22 | ament-cmake-export-interfaces \ | ||
| 23 | ament-cmake-export-libraries \ | ||
| 24 | ament-cmake-export-link-flags \ | ||
| 25 | ament-cmake-export-targets \ | ||
| 26 | ament-cmake-gmock \ | ||
| 27 | ament-cmake-gtest \ | ||
| 28 | ament-cmake-include-directories \ | ||
| 29 | ament-cmake-libraries \ | ||
| 30 | ament-cmake \ | ||
| 31 | ament-cmake-pytest \ | ||
| 32 | ament-cmake-python \ | ||
| 33 | ament-cmake-ros \ | ||
| 34 | ament-cmake-target-dependencies \ | ||
| 35 | ament-cmake-test \ | ||
| 36 | ament-cmake-version \ | ||
| 37 | ament-cmake-uncrustify \ | ||
| 38 | ament-cmake-flake8 \ | ||
| 39 | ament-cmake-pep257 \ | ||
| 40 | ament-copyright \ | ||
| 41 | ament-cpplint \ | ||
| 42 | ament-flake8 \ | ||
| 43 | ament-index-python \ | ||
| 44 | ament-lint-cmake \ | ||
| 45 | ament-mypy \ | ||
| 46 | ament-package \ | ||
| 47 | ament-pclint \ | ||
| 48 | ament-pep257 \ | ||
| 49 | ament-pycodestyle \ | ||
| 50 | ament-pyflakes \ | ||
| 51 | ament-uncrustify \ | ||
| 52 | ament-xmllint \ | ||
| 53 | cmake \ | ||
| 54 | eigen3-cmake-module \ | ||
| 55 | fastcdr \ | ||
| 56 | fastrtps-cmake-module \ | ||
| 57 | fastrtps \ | ||
| 58 | foonathan-memory-vendor \ | ||
| 59 | gmock-vendor \ | ||
| 60 | gtest-vendor \ | ||
| 61 | libyaml \ | ||
| 62 | libyaml-vendor \ | ||
| 63 | packagegroup-core-buildessential \ | ||
| 64 | python-cmake-module \ | ||
| 65 | python3-catkin-pkg \ | ||
| 66 | python3-colcon-common-extensions \ | ||
| 67 | python3-empy \ | ||
| 68 | python3 \ | ||
| 69 | python3-pytest \ | ||
| 70 | rcutils \ | ||
| 71 | rmw-implementation-cmake \ | ||
| 72 | rosidl-cmake \ | ||
| 73 | rosidl-default-generators \ | ||
| 74 | rosidl-generator-c \ | ||
| 75 | rosidl-generator-cpp \ | ||
| 76 | rosidl-generator-dds-idl \ | ||
| 77 | rosidl-generator-py \ | ||
| 78 | rosidl-parser \ | ||
| 79 | rosidl-runtime-c \ | ||
| 80 | rosidl-runtime-cpp \ | ||
| 81 | rosidl-typesupport-c \ | ||
| 82 | rosidl-typesupport-cpp \ | ||
| 83 | rosidl-typesupport-fastrtps-cpp \ | ||
| 84 | rosidl-typesupport-interface \ | ||
| 85 | rosidl-typesupport-introspection-c \ | ||
| 86 | rosidl-typesupport-introspection-cpp \ | ||
| 87 | " | ||
| 88 | |||
| 89 | SUMMARY:${PN}-base = "ROS_BASE_PACKAGES includes ROS base packages" | ||
| 90 | ROS_BASE_PACKAGES = "\ | ||
| 91 | ros-base \ | ||
| 92 | cyclonedds \ | ||
| 93 | rmw-cyclonedds-cpp \ | ||
| 94 | tmux \ | ||
| 95 | python3-argcomplete \ | ||
| 96 | glibc-utils \ | ||
| 97 | localedef \ | ||
| 98 | rt-tests \ | ||
| 99 | stress \ | ||
| 100 | xrt-dev \ | ||
| 101 | xrt \ | ||
| 102 | kernel-module-zocl \ | ||
| 103 | opencl-headers-dev \ | ||
| 104 | opencl-clhpp-dev \ | ||
| 105 | " | ||
| 106 | |||
| 107 | SUMMARY:${PN}-demo = "ROS_DEMO_PACKAGES includes ROS examples demos packages" | ||
| 108 | ROS_DEMO_PACKAGES = "\ | ||
| 109 | examples-rclcpp-minimal-action-client \ | ||
| 110 | examples-rclcpp-minimal-action-server \ | ||
| 111 | examples-rclcpp-minimal-client \ | ||
| 112 | examples-rclcpp-minimal-composition \ | ||
| 113 | examples-rclcpp-minimal-publisher \ | ||
| 114 | examples-rclcpp-minimal-service \ | ||
| 115 | examples-rclcpp-minimal-subscriber \ | ||
| 116 | examples-rclcpp-minimal-timer \ | ||
| 117 | examples-rclcpp-multithreaded-executor \ | ||
| 118 | examples-rclpy-executors \ | ||
| 119 | examples-rclpy-minimal-action-server \ | ||
| 120 | examples-rclpy-minimal-client \ | ||
| 121 | examples-rclpy-minimal-publisher \ | ||
| 122 | examples-rclpy-minimal-service \ | ||
| 123 | examples-rclpy-minimal-subscriber \ | ||
| 124 | demo-nodes-cpp \ | ||
| 125 | demo-nodes-cpp-rosnative \ | ||
| 126 | " | ||
| 127 | |||
| 128 | SUMMARY:${PN}-control = "ROS_CONTROL_PACKAGES includes ROS control packages" | ||
| 129 | ROS_CONTROL_PACKAGES = "\ | ||
| 130 | controller-interface \ | ||
| 131 | controller-manager \ | ||
| 132 | controller-manager-msgs \ | ||
| 133 | hardware-interface \ | ||
| 134 | ros2-control \ | ||
| 135 | ros2controlcli \ | ||
| 136 | ros2-control-test-assets \ | ||
| 137 | transmission-interface \ | ||
| 138 | " | ||
| 139 | |||
| 140 | RDEPENDS:${PN}-base:aarch64 = "\ | ||
| 141 | ${ROS_BASE_PACKAGES} \ | ||
| 142 | " | ||
| 143 | |||
| 144 | RDEPENDS:${PN}-demo:aarch64 = "\ | ||
| 145 | ${ROS_BASE_PACKAGES} \ | ||
| 146 | ${ROS_DEMO_PACKAGES} \ | ||
| 147 | " | ||
| 148 | |||
| 149 | #RDEPENDS:${PN}-control:aarch64 = "\ | ||
| 150 | # ${ROS_BASE_PACKAGES} \ | ||
| 151 | # ${ROS_CONTROL_PACKAGES} \ | ||
| 152 | #" | ||
| 153 | |||
| 154 | RDEPENDS:${PN}-dev:aarch64 = "\ | ||
| 155 | ${ROS_BUILDESSENTIAL_PACKAGES} \ | ||
| 156 | " | ||
| 157 | |||
| 158 | # TODO | ||
| 159 | # 1. Due to failing hardware-interfaces disable ${PN}-control | ||
| 160 | |||
| 161 | RDEPENDS:${PN}:aarch64 = "\ | ||
| 162 | ${PN}-demo \ | ||
| 163 | rqt-runtime-monitor \ | ||
| 164 | " | ||
| 165 | |||
| 166 | IMAGE_LINGUAS = "en-us" | ||
| 167 | GLIBC_GENERATE_LOCALES = "en_US.UTF-8" | ||
diff --git a/meta-xilinx-demos/dynamic-layers/meta-ros/meta-ros2-jazzy/recipes-bbappends/ament-lint/ament-flake8_0.17.0-2.bbappend b/meta-xilinx-demos/dynamic-layers/meta-ros/meta-ros2-jazzy/recipes-bbappends/ament-lint/ament-flake8_0.17.0-2.bbappend new file mode 100644 index 00000000..c22346fa --- /dev/null +++ b/meta-xilinx-demos/dynamic-layers/meta-ros/meta-ros2-jazzy/recipes-bbappends/ament-lint/ament-flake8_0.17.0-2.bbappend | |||
| @@ -0,0 +1,9 @@ | |||
| 1 | # Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved. | ||
| 2 | |||
| 3 | ROS_EXEC_DEPENDS:remove = " \ | ||
| 4 | python3-flake8-builtins \ | ||
| 5 | python3-flake8-comprehensions \ | ||
| 6 | python3-flake8-docstrings \ | ||
| 7 | python3-flake8-import-order \ | ||
| 8 | python3-flake8-quotes \ | ||
| 9 | " \ No newline at end of file | ||
diff --git a/meta-xilinx-demos/dynamic-layers/meta-ros/meta-ros2-jazzy/recipes-bbappends/common-interfaces/sensor-msgs-py_%.bbappend b/meta-xilinx-demos/dynamic-layers/meta-ros/meta-ros2-jazzy/recipes-bbappends/common-interfaces/sensor-msgs-py_%.bbappend new file mode 100644 index 00000000..5c360dbe --- /dev/null +++ b/meta-xilinx-demos/dynamic-layers/meta-ros/meta-ros2-jazzy/recipes-bbappends/common-interfaces/sensor-msgs-py_%.bbappend | |||
| @@ -0,0 +1 @@ | |||
| LICENSE = "BSD-3-Clause" | |||
diff --git a/meta-xilinx-demos/dynamic-layers/meta-ros/meta-ros2-jazzy/recipes-bbappends/orocos-kdl-vendor/orocos-kdl-vendor_%.bbappend b/meta-xilinx-demos/dynamic-layers/meta-ros/meta-ros2-jazzy/recipes-bbappends/orocos-kdl-vendor/orocos-kdl-vendor_%.bbappend new file mode 100644 index 00000000..35f4207f --- /dev/null +++ b/meta-xilinx-demos/dynamic-layers/meta-ros/meta-ros2-jazzy/recipes-bbappends/orocos-kdl-vendor/orocos-kdl-vendor_%.bbappend | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | SRC_URI:remove = "file://0001-CMakeLists.txt-fetch-orocos-kdl-with-bitbake-fetcher.patch" | ||
| 2 | SRCREV_release:forcevariable = "adca6201616af928533d70faea6042fe0239e898" | ||
diff --git a/meta-xilinx-demos/dynamic-layers/meta-ros/meta-ros2-jazzy/recipes-bbappends/rosbag2/liblz4-vendor_%.bbappend b/meta-xilinx-demos/dynamic-layers/meta-ros/meta-ros2-jazzy/recipes-bbappends/rosbag2/liblz4-vendor_%.bbappend new file mode 100644 index 00000000..f5378ca6 --- /dev/null +++ b/meta-xilinx-demos/dynamic-layers/meta-ros/meta-ros2-jazzy/recipes-bbappends/rosbag2/liblz4-vendor_%.bbappend | |||
| @@ -0,0 +1,4 @@ | |||
| 1 | LICENSE = "Apache-2.0 & BSD-3-Clause & GPL-2.0-only" | ||
| 2 | ROS_EXEC_DEPENDS:remove = "${ROS_UNRESOLVED_DEP-liblz4}" | ||
| 3 | DEPENDS:remove = "${ROS_UNRESOLVED_DEP-liblz4-dev}" | ||
| 4 | INSANE_SKIP:${PN} += "dev-so" | ||
diff --git a/meta-xilinx-demos/dynamic-layers/meta-ros/meta-ros2-jazzy/recipes-bbappends/rosbag2/mcap-vendor/0001-fix-include-dir.patch b/meta-xilinx-demos/dynamic-layers/meta-ros/meta-ros2-jazzy/recipes-bbappends/rosbag2/mcap-vendor/0001-fix-include-dir.patch new file mode 100644 index 00000000..35650c23 --- /dev/null +++ b/meta-xilinx-demos/dynamic-layers/meta-ros/meta-ros2-jazzy/recipes-bbappends/rosbag2/mcap-vendor/0001-fix-include-dir.patch | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | From f15236807f0b5ac96979840a12cd0be0c115f055 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Trevor Woerner <trevor.woerner@amd.com> | ||
| 3 | Date: Thu, 12 Sep 2024 15:21:33 -0400 | ||
| 4 | Subject: [PATCH] fix include dir | ||
| 5 | |||
| 6 | Upstream-Status: inappropriate | ||
| 7 | Signed-off-by: Trevor Woerner <trevor.woerner@amd.com> | ||
| 8 | --- | ||
| 9 | CMakeLists.txt | 2 +- | ||
| 10 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 11 | |||
| 12 | diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
| 13 | index d5789b292025..e5e97fa9fa0f 100644 | ||
| 14 | --- a/CMakeLists.txt | ||
| 15 | +++ b/CMakeLists.txt | ||
| 16 | @@ -43,7 +43,7 @@ macro(build_mcap_vendor) | ||
| 17 | src/main.cpp | ||
| 18 | ) | ||
| 19 | |||
| 20 | - set(_mcap_include_dir ${mcap_SOURCE_DIR}/cpp/mcap/include) | ||
| 21 | + set(_mcap_include_dir ${mcap_vendor_SOURCE_DIR}/mcap/cpp/mcap/include) | ||
| 22 | file(GLOB _mcap_installed_headers ${_mcap_include_dir}/mcap/*.hpp) | ||
| 23 | |||
| 24 | target_include_directories(mcap PUBLIC | ||
| 25 | -- | ||
| 26 | 2.44.0.478.g7774cfed6261 | ||
| 27 | |||
diff --git a/meta-xilinx-demos/dynamic-layers/meta-ros/meta-ros2-jazzy/recipes-bbappends/rosbag2/mcap-vendor_%.bbappend b/meta-xilinx-demos/dynamic-layers/meta-ros/meta-ros2-jazzy/recipes-bbappends/rosbag2/mcap-vendor_%.bbappend new file mode 100644 index 00000000..dc63cf76 --- /dev/null +++ b/meta-xilinx-demos/dynamic-layers/meta-ros/meta-ros2-jazzy/recipes-bbappends/rosbag2/mcap-vendor_%.bbappend | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" | ||
| 2 | |||
| 3 | B = "${S}" | ||
| 4 | SRC_URI:remove = "file://0001-CMakeLists.txt-fetch-dependencies-with-bitbake-fetch.patch" | ||
| 5 | SRC_URI:append = " file://0001-fix-include-dir.patch" | ||
| 6 | SRCREV_release:forcevariable = "6884e7ba7d29d8db98ad2bbf09a6875bf5141e19" | ||
diff --git a/meta-xilinx-demos/dynamic-layers/meta-ros/meta-ros2-jazzy/recipes-bbappends/rosbag2/rosbag2-compression-zstd_%.bbappend b/meta-xilinx-demos/dynamic-layers/meta-ros/meta-ros2-jazzy/recipes-bbappends/rosbag2/rosbag2-compression-zstd_%.bbappend new file mode 100644 index 00000000..b99de447 --- /dev/null +++ b/meta-xilinx-demos/dynamic-layers/meta-ros/meta-ros2-jazzy/recipes-bbappends/rosbag2/rosbag2-compression-zstd_%.bbappend | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | SRC_URI:remove = "file://0001-CMakeLists.txt-drop-dependency-on-zstd_vendor.patch" | ||
| 2 | SRCREV = "3f3c01609c3bef74cfc3f3229b0d57964c6bd465" | ||
diff --git a/meta-xilinx-demos/dynamic-layers/meta-ros/meta-ros2-jazzy/recipes-bbappends/rosbag2/shared-queues-vendor_%.bbappend b/meta-xilinx-demos/dynamic-layers/meta-ros/meta-ros2-jazzy/recipes-bbappends/rosbag2/shared-queues-vendor_%.bbappend new file mode 100644 index 00000000..69b50386 --- /dev/null +++ b/meta-xilinx-demos/dynamic-layers/meta-ros/meta-ros2-jazzy/recipes-bbappends/rosbag2/shared-queues-vendor_%.bbappend | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | SRC_URI:remove = "file://0001-CMakeLists.txt-fetch-readerwriterqueue-and-concurren.patch" | ||
| 2 | SRCREV_release:forcevariable = "fea3a738733673c927d77631a735157993ff6395" | ||
diff --git a/meta-xilinx-demos/dynamic-layers/meta-ros/meta-ros2-jazzy/recipes-bbappends/yaml-cpp-vendor/yaml-cpp-vendor_%.bbappend b/meta-xilinx-demos/dynamic-layers/meta-ros/meta-ros2-jazzy/recipes-bbappends/yaml-cpp-vendor/yaml-cpp-vendor_%.bbappend new file mode 100644 index 00000000..33e2a0c7 --- /dev/null +++ b/meta-xilinx-demos/dynamic-layers/meta-ros/meta-ros2-jazzy/recipes-bbappends/yaml-cpp-vendor/yaml-cpp-vendor_%.bbappend | |||
| @@ -0,0 +1 @@ | |||
| INSANE_SKIP:${PN} += "dev-so" | |||
diff --git a/meta-xilinx-demos/recipes-apps/sdfec/sdfec_1.1.bb b/meta-xilinx-demos/recipes-apps/sdfec/sdfec_1.1.bb new file mode 100644 index 00000000..ac8303aa --- /dev/null +++ b/meta-xilinx-demos/recipes-apps/sdfec/sdfec_1.1.bb | |||
| @@ -0,0 +1,36 @@ | |||
| 1 | # | ||
| 2 | # This file is the sdfec recipe. | ||
| 3 | # | ||
| 4 | |||
| 5 | SUMMARY = "sdfec applications" | ||
| 6 | |||
| 7 | LICENSE = "MIT" | ||
| 8 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" | ||
| 9 | |||
| 10 | SRC_URI = "git://github.com/Xilinx/linux-examples.git;protocol=https;branch=xlnx_rel_v2024.1" | ||
| 11 | SRCREV = "84b31cb194325640a631380ed8bfc1db21bab883" | ||
| 12 | |||
| 13 | inherit features_check | ||
| 14 | |||
| 15 | REQUIRED_MACHINE_FEATURES = "rfsoc" | ||
| 16 | |||
| 17 | PACKAGE_ARCH = "${MACHINE_ARCH}" | ||
| 18 | |||
| 19 | S = "${WORKDIR}/git/sd-fec-1.1" | ||
| 20 | |||
| 21 | DEPENDS += "libgpiod" | ||
| 22 | |||
| 23 | TARGETS_APPS ?= "sdfec-demo sdfec-interrupts sdfec-multi-ldpc-codes" | ||
| 24 | |||
| 25 | do_compile() { | ||
| 26 | for app_name in ${TARGETS_APPS}; do | ||
| 27 | oe_runmake -C ${S}/$app_name/files | ||
| 28 | done | ||
| 29 | } | ||
| 30 | |||
| 31 | do_install() { | ||
| 32 | install -d ${D}${bindir} | ||
| 33 | for app_name in ${TARGETS_APPS}; do | ||
| 34 | install -m 0755 ${S}/$app_name/files/$app_name ${D}${bindir} | ||
| 35 | done | ||
| 36 | } | ||
diff --git a/meta-xilinx-demos/recipes-core/packagegroups/packagegroup-xilinx-matchbox.bb b/meta-xilinx-demos/recipes-core/packagegroups/packagegroup-xilinx-matchbox.bb new file mode 100644 index 00000000..334f646e --- /dev/null +++ b/meta-xilinx-demos/recipes-core/packagegroups/packagegroup-xilinx-matchbox.bb | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | DESCRIPTION = "Matchbox related packages" | ||
| 2 | |||
| 3 | inherit packagegroup features_check | ||
| 4 | |||
| 5 | REQUIRED_DISTRO_FEATURES = "x11" | ||
| 6 | |||
| 7 | FILEMANAGER ?= "pcmanfm" | ||
| 8 | |||
| 9 | MATCHBOX_PACKAGES = " \ | ||
| 10 | matchbox-config-gtk \ | ||
| 11 | matchbox-desktop \ | ||
| 12 | matchbox-keyboard \ | ||
| 13 | matchbox-keyboard-applet \ | ||
| 14 | matchbox-panel-2 \ | ||
| 15 | matchbox-session \ | ||
| 16 | matchbox-terminal \ | ||
| 17 | matchbox-theme-sato \ | ||
| 18 | matchbox-session-sato \ | ||
| 19 | matchbox-wm \ | ||
| 20 | settings-daemon \ | ||
| 21 | adwaita-icon-theme \ | ||
| 22 | l3afpad \ | ||
| 23 | ${FILEMANAGER} \ | ||
| 24 | shutdown-desktop \ | ||
| 25 | ${@bb.utils.contains('DISTRO_FEATURES', 'pulseaudio', 'pulseaudio-server pulseaudio-client-conf-sato pulseaudio-misc', '', d)} \ | ||
| 26 | " | ||
| 27 | |||
| 28 | RDEPENDS:${PN} = "packagegroup-core-x11 ${MATCHBOX_PACKAGES}" | ||
diff --git a/meta-xilinx-demos/recipes-core/packagegroups/packagegroup-xilinx-multimedia.bb b/meta-xilinx-demos/recipes-core/packagegroups/packagegroup-xilinx-multimedia.bb new file mode 100644 index 00000000..fcebff04 --- /dev/null +++ b/meta-xilinx-demos/recipes-core/packagegroups/packagegroup-xilinx-multimedia.bb | |||
| @@ -0,0 +1,20 @@ | |||
| 1 | DESCRIPTION = "Packages for out of box multimedia experience" | ||
| 2 | |||
| 3 | # Can not be all arch due to libdrm | ||
| 4 | PACKAGE_ARCH = "${MACHINE_ARCH}" | ||
| 5 | |||
| 6 | inherit packagegroup features_check | ||
| 7 | |||
| 8 | REQUIRED_DISTRO_FEATURES = "x11" | ||
| 9 | |||
| 10 | MULTIMEDIA_PACKAGES = " \ | ||
| 11 | packagegroup-xilinx-gstreamer \ | ||
| 12 | packagegroup-xilinx-matchbox \ | ||
| 13 | packagegroup-core-x11 \ | ||
| 14 | libdrm \ | ||
| 15 | libdrm-tests \ | ||
| 16 | packagegroup-xilinx-qt \ | ||
| 17 | ffmpeg \ | ||
| 18 | " | ||
| 19 | |||
| 20 | RDEPENDS:${PN} = "${MULTIMEDIA_PACKAGES}" | ||
diff --git a/meta-xilinx-demos/recipes-core/packagegroups/packagegroup-xilinx-qt.bb b/meta-xilinx-demos/recipes-core/packagegroups/packagegroup-xilinx-qt.bb new file mode 100644 index 00000000..6b795c08 --- /dev/null +++ b/meta-xilinx-demos/recipes-core/packagegroups/packagegroup-xilinx-qt.bb | |||
| @@ -0,0 +1,55 @@ | |||
| 1 | DESCRIPTION = "Qt packages" | ||
| 2 | |||
| 3 | # Workaround for DISTRO_FEATURES wayland only set on 64-bit ARM machines | ||
| 4 | PACKAGE_ARCH = "${TUNE_PKGARCH}" | ||
| 5 | |||
| 6 | inherit packagegroup features_check | ||
| 7 | |||
| 8 | PACKAGES = "${PN} ${PN}-extended" | ||
| 9 | PROVIDES = "${PACKAGES}" | ||
| 10 | |||
| 11 | ANY_OF_DISTRO_FEATURES = "x11 fbdev wayland" | ||
| 12 | |||
| 13 | QT_PACKAGES = " \ | ||
| 14 | qtbase \ | ||
| 15 | qtbase-plugins \ | ||
| 16 | qtbase-examples \ | ||
| 17 | qtquickcontrols-qmlplugins \ | ||
| 18 | qtcharts \ | ||
| 19 | ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'qtwayland', '', d)} \ | ||
| 20 | " | ||
| 21 | RDEPENDS:${PN} = "${QT_PACKAGES}" | ||
| 22 | |||
| 23 | QT_EXTENDED_PACKAGES = " \ | ||
| 24 | ruby \ | ||
| 25 | qtbase-mkspecs \ | ||
| 26 | qtbase-plugins \ | ||
| 27 | qtsystems-mkspecs \ | ||
| 28 | qttranslations-qtbase \ | ||
| 29 | qttranslations-qthelp \ | ||
| 30 | qtconnectivity-mkspecs \ | ||
| 31 | qttranslations-qtconnectivity \ | ||
| 32 | qtdeclarative-mkspecs \ | ||
| 33 | qttranslations-qtdeclarative \ | ||
| 34 | qtimageformats-plugins \ | ||
| 35 | qtlocation-mkspecs \ | ||
| 36 | qtlocation-plugins \ | ||
| 37 | qttranslations-qtmultimedia \ | ||
| 38 | qtscript-mkspecs \ | ||
| 39 | qttranslations-qtscript \ | ||
| 40 | qtsensors-mkspecs \ | ||
| 41 | qtsensors-plugins \ | ||
| 42 | qtserialport-mkspecs \ | ||
| 43 | qtsvg-mkspecs \ | ||
| 44 | qtsvg-plugins \ | ||
| 45 | qtwebsockets-mkspecs \ | ||
| 46 | qttranslations-qtwebsockets \ | ||
| 47 | qtwebchannel-mkspecs \ | ||
| 48 | qtxmlpatterns-mkspecs \ | ||
| 49 | qttranslations-qtxmlpatterns \ | ||
| 50 | qtwebkit-mkspecs \ | ||
| 51 | ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'qtx11extras', '', d)} \ | ||
| 52 | qtgraphicaleffects-qmlplugins \ | ||
| 53 | " | ||
| 54 | |||
| 55 | RDEPENDS:${PN}-extended = "${QT_PACKAGES} ${QT_EXTENDED_PACKAGES}" | ||
diff --git a/meta-xilinx-demos/recipes-examples/gpio-demo/files/Makefile b/meta-xilinx-demos/recipes-examples/gpio-demo/files/Makefile new file mode 100644 index 00000000..9106be1b --- /dev/null +++ b/meta-xilinx-demos/recipes-examples/gpio-demo/files/Makefile | |||
| @@ -0,0 +1,14 @@ | |||
| 1 | APP = gpio-demo | ||
| 2 | |||
| 3 | # Add any other object files to this list below | ||
| 4 | APP_OBJS = gpio-demo.o | ||
| 5 | |||
| 6 | all: $(APP) | ||
| 7 | |||
| 8 | $(APP): $(APP_OBJS) | ||
| 9 | $(CC) $(LDFLAGS) -o $@ $(APP_OBJS) $(LDLIBS) | ||
| 10 | |||
| 11 | clean: | ||
| 12 | -rm -f $(APP) *.elf *.gdb *.o | ||
| 13 | |||
| 14 | |||
diff --git a/meta-xilinx-demos/recipes-examples/gpio-demo/files/gpio-demo.c b/meta-xilinx-demos/recipes-examples/gpio-demo/files/gpio-demo.c new file mode 100644 index 00000000..4e17779d --- /dev/null +++ b/meta-xilinx-demos/recipes-examples/gpio-demo/files/gpio-demo.c | |||
| @@ -0,0 +1,355 @@ | |||
| 1 | /* | ||
| 2 | * | ||
| 3 | * gpio-demo app | ||
| 4 | * | ||
| 5 | * Copyright (C) 2013 - 2016 Xilinx, Inc. All rights reserved. | ||
| 6 | * | ||
| 7 | * Permission is hereby granted, free of charge, to any person | ||
| 8 | * obtaining a copy of this software and associated documentation | ||
| 9 | * files (the "Software"), to deal in the Software without restriction, | ||
| 10 | * including without limitation the rights to use, copy, modify, merge, | ||
| 11 | * publish, distribute, sublicense, and/or sell copies of the Software, | ||
| 12 | * and to permit persons to whom the Software is furnished to do so, | ||
| 13 | * subject to the following conditions: | ||
| 14 | * | ||
| 15 | * The above copyright notice and this permission notice shall be included | ||
| 16 | * in all copies or substantial portions of the Software. | ||
| 17 | * | ||
| 18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| 19 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| 20 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
| 21 | * IN NO EVENT SHALL XILINX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
| 22 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
| 23 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
| 24 | * | ||
| 25 | * Except as contained in this notice, the name of the Xilinx shall not be used | ||
| 26 | * in advertising or otherwise to promote the sale, use or other dealings in this | ||
| 27 | * Software without prior written authorization from Xilinx. | ||
| 28 | * | ||
| 29 | */ | ||
| 30 | |||
| 31 | #include <stdio.h> | ||
| 32 | #include <stdlib.h> | ||
| 33 | #include <unistd.h> | ||
| 34 | #include <string.h> | ||
| 35 | #include <errno.h> | ||
| 36 | #include <fcntl.h> | ||
| 37 | #include <signal.h> | ||
| 38 | |||
| 39 | #define GPIO_ROOT "/sys/class/gpio" | ||
| 40 | #define ARRAY_SIZE(a) (sizeof(a)/sizeof(a[0])) | ||
| 41 | |||
| 42 | static enum {NONE, IN, OUT, CYLON, KIT} gpio_opt = NONE; | ||
| 43 | |||
| 44 | static const unsigned long cylon[] = { | ||
| 45 | 0x00000080, 0x00000040, 0x00000020, 0x00000010, | ||
| 46 | 0x00000008, 0x00000004, 0x00000002, 0x00000001, | ||
| 47 | 0x00000002, 0x00000004, 0x00000008, | ||
| 48 | 0x00000010, 0x00000020, 0x00000040, 0x00000080, | ||
| 49 | }; | ||
| 50 | |||
| 51 | static const unsigned long kit[] = { | ||
| 52 | 0x000000e0, 0x00000070, 0x00000038, 0x0000001c, | ||
| 53 | 0x0000000e, 0x00000007, 0x00000003, 0x00000001, | ||
| 54 | 0x00000003, 0x00000007, 0x0000000e, | ||
| 55 | 0x0000001c, 0x00000038, 0x00000070, 0x000000e0, | ||
| 56 | }; | ||
| 57 | |||
| 58 | static int gl_gpio_base = 0; | ||
| 59 | |||
| 60 | static void usage (char *argv0) | ||
| 61 | { | ||
| 62 | char *basename = strrchr(argv0, '/'); | ||
| 63 | if (!basename) | ||
| 64 | basename = argv0; | ||
| 65 | |||
| 66 | fprintf(stderr, | ||
| 67 | "Usage: %s [-g GPIO_BASE] COMMAND\n" | ||
| 68 | "\twhere COMMAND is one of:\n" | ||
| 69 | "\t\t-i\t\tInput value from GPIO and print it\n" | ||
| 70 | "\t\t-o\tVALUE\tOutput value to GPIO\n" | ||
| 71 | "\t\t-c\t\tCylon test pattern\n" | ||
| 72 | "\t\t-k\t\t KIT test pattern\n" | ||
| 73 | "\tGPIO_BASE indicates which GPIO chip to talk to (The number can be \n" | ||
| 74 | "\tfound at /sys/class/gpio/gpiochipN).\n" | ||
| 75 | "\tThe highest gpiochipN is the first gpio listed in the dts file, \n" | ||
| 76 | "\tand the lowest gpiochipN is the last gpio listed in the dts file.\n" | ||
| 77 | "\tE.g.If the gpiochip240 is the LED_8bit gpio, and I want to output '1' \n" | ||
| 78 | "\tto the LED_8bit gpio, the command should be:\n" | ||
| 79 | "\t\tgpio-demo -g 240 -o 1\n" | ||
| 80 | "\n" | ||
| 81 | "\tgpio-demo written by Xilinx Inc.\n" | ||
| 82 | "\n" | ||
| 83 | , basename); | ||
| 84 | exit(-2); | ||
| 85 | } | ||
| 86 | |||
| 87 | static int open_gpio_channel(int gpio_base) | ||
| 88 | { | ||
| 89 | char gpio_nchan_file[128]; | ||
| 90 | int gpio_nchan_fd; | ||
| 91 | int gpio_max; | ||
| 92 | int nchannel; | ||
| 93 | char nchannel_str[5]; | ||
| 94 | char *cptr; | ||
| 95 | int c; | ||
| 96 | char channel_str[5]; | ||
| 97 | |||
| 98 | char *gpio_export_file = "/sys/class/gpio/export"; | ||
| 99 | int export_fd=0; | ||
| 100 | |||
| 101 | /* Check how many channels the GPIO chip has */ | ||
| 102 | sprintf(gpio_nchan_file, "%s/gpiochip%d/ngpio", GPIO_ROOT, gpio_base); | ||
| 103 | gpio_nchan_fd = open(gpio_nchan_file, O_RDONLY); | ||
| 104 | if (gpio_nchan_fd < 0) { | ||
| 105 | fprintf(stderr, "Failed to open %s: %s\n", gpio_nchan_file, strerror(errno)); | ||
| 106 | return -1; | ||
| 107 | } | ||
| 108 | read(gpio_nchan_fd, nchannel_str, sizeof(nchannel_str)); | ||
| 109 | close(gpio_nchan_fd); | ||
| 110 | nchannel=(int)strtoul(nchannel_str, &cptr, 0); | ||
| 111 | if (cptr == nchannel_str) { | ||
| 112 | fprintf(stderr, "Failed to change %s into GPIO channel number\n", nchannel_str); | ||
| 113 | exit(1); | ||
| 114 | } | ||
| 115 | |||
| 116 | /* Open files for each GPIO channel */ | ||
| 117 | export_fd=open(gpio_export_file, O_WRONLY); | ||
| 118 | if (export_fd < 0) { | ||
| 119 | fprintf(stderr, "Cannot open GPIO to export %d\n", gpio_base); | ||
| 120 | return -1; | ||
| 121 | } | ||
| 122 | |||
| 123 | gpio_max = gpio_base + nchannel; | ||
| 124 | for(c = gpio_base; c < gpio_max; c++) { | ||
| 125 | sprintf(channel_str, "%d", c); | ||
| 126 | write(export_fd, channel_str, (strlen(channel_str)+1)); | ||
| 127 | } | ||
| 128 | close(export_fd); | ||
| 129 | return nchannel; | ||
| 130 | } | ||
| 131 | |||
| 132 | static int close_gpio_channel(int gpio_base) | ||
| 133 | { | ||
| 134 | char gpio_nchan_file[128]; | ||
| 135 | int gpio_nchan_fd; | ||
| 136 | int gpio_max; | ||
| 137 | int nchannel; | ||
| 138 | char nchannel_str[5]; | ||
| 139 | char *cptr; | ||
| 140 | int c; | ||
| 141 | char channel_str[5]; | ||
| 142 | |||
| 143 | char *gpio_unexport_file = "/sys/class/gpio/unexport"; | ||
| 144 | int unexport_fd=0; | ||
| 145 | |||
| 146 | /* Check how many channels the GPIO chip has */ | ||
| 147 | sprintf(gpio_nchan_file, "%s/gpiochip%d/ngpio", GPIO_ROOT, gpio_base); | ||
| 148 | gpio_nchan_fd = open(gpio_nchan_file, O_RDONLY); | ||
| 149 | if (gpio_nchan_fd < 0) { | ||
| 150 | fprintf(stderr, "Failed to open %s: %s\n", gpio_nchan_file, strerror(errno)); | ||
| 151 | return -1; | ||
| 152 | } | ||
| 153 | read(gpio_nchan_fd, nchannel_str, sizeof(nchannel_str)); | ||
| 154 | close(gpio_nchan_fd); | ||
| 155 | nchannel=(int)strtoul(nchannel_str, &cptr, 0); | ||
| 156 | if (cptr == nchannel_str) { | ||
| 157 | fprintf(stderr, "Failed to change %s into GPIO channel number\n", nchannel_str); | ||
| 158 | exit(1); | ||
| 159 | } | ||
| 160 | |||
| 161 | /* Close opened files for each GPIO channel */ | ||
| 162 | unexport_fd=open(gpio_unexport_file, O_WRONLY); | ||
| 163 | if (unexport_fd < 0) { | ||
| 164 | fprintf(stderr, "Cannot close GPIO by writing unexport %d\n", gpio_base); | ||
| 165 | return -1; | ||
| 166 | } | ||
| 167 | |||
| 168 | gpio_max = gpio_base + nchannel; | ||
| 169 | for(c = gpio_base; c < gpio_max; c++) { | ||
| 170 | sprintf(channel_str, "%d", c); | ||
| 171 | write(unexport_fd, channel_str, (strlen(channel_str)+1)); | ||
| 172 | } | ||
| 173 | close(unexport_fd); | ||
| 174 | return 0; | ||
| 175 | } | ||
| 176 | |||
| 177 | static int set_gpio_direction(int gpio_base, int nchannel, char *direction) | ||
| 178 | { | ||
| 179 | char gpio_dir_file[128]; | ||
| 180 | int direction_fd=0; | ||
| 181 | int gpio_max; | ||
| 182 | int c; | ||
| 183 | |||
| 184 | gpio_max = gpio_base + nchannel; | ||
| 185 | for(c = gpio_base; c < gpio_max; c++) { | ||
| 186 | sprintf(gpio_dir_file, "/sys/class/gpio/gpio%d/direction",c); | ||
| 187 | direction_fd=open(gpio_dir_file, O_RDWR); | ||
| 188 | if (direction_fd < 0) { | ||
| 189 | fprintf(stderr, "Cannot open the direction file for GPIO %d\n", c); | ||
| 190 | return 1; | ||
| 191 | } | ||
| 192 | write(direction_fd, direction, (strlen(direction)+1)); | ||
| 193 | close(direction_fd); | ||
| 194 | } | ||
| 195 | return 0; | ||
| 196 | } | ||
| 197 | |||
| 198 | static int set_gpio_value(int gpio_base, int nchannel, int value) | ||
| 199 | { | ||
| 200 | char gpio_val_file[128]; | ||
| 201 | int val_fd=0; | ||
| 202 | int gpio_max; | ||
| 203 | char val_str[2]; | ||
| 204 | int c; | ||
| 205 | |||
| 206 | gpio_max = gpio_base + nchannel; | ||
| 207 | |||
| 208 | for(c = gpio_base; c < gpio_max; c++) { | ||
| 209 | sprintf(gpio_val_file, "/sys/class/gpio/gpio%d/value",c); | ||
| 210 | val_fd=open(gpio_val_file, O_RDWR); | ||
| 211 | if (val_fd < 0) { | ||
| 212 | fprintf(stderr, "Cannot open the value file of GPIO %d\n", c); | ||
| 213 | return -1; | ||
| 214 | } | ||
| 215 | sprintf(val_str,"%d", (value & 1)); | ||
| 216 | write(val_fd, val_str, sizeof(val_str)); | ||
| 217 | close(val_fd); | ||
| 218 | value >>= 1; | ||
| 219 | } | ||
| 220 | return 0; | ||
| 221 | } | ||
| 222 | |||
| 223 | static int get_gpio_value(int gpio_base, int nchannel) | ||
| 224 | { | ||
| 225 | char gpio_val_file[128]; | ||
| 226 | int val_fd=0; | ||
| 227 | int gpio_max; | ||
| 228 | char val_str[2]; | ||
| 229 | char *cptr; | ||
| 230 | int value = 0; | ||
| 231 | int c; | ||
| 232 | |||
| 233 | gpio_max = gpio_base + nchannel; | ||
| 234 | |||
| 235 | for(c = gpio_max-1; c >= gpio_base; c--) { | ||
| 236 | sprintf(gpio_val_file, "/sys/class/gpio/gpio%d/value",c); | ||
| 237 | val_fd=open(gpio_val_file, O_RDWR); | ||
| 238 | if (val_fd < 0) { | ||
| 239 | fprintf(stderr, "Cannot open GPIO to export %d\n", c); | ||
| 240 | return -1; | ||
| 241 | } | ||
| 242 | read(val_fd, val_str, sizeof(val_str)); | ||
| 243 | value <<= 1; | ||
| 244 | value += (int)strtoul(val_str, &cptr, 0); | ||
| 245 | if (cptr == optarg) { | ||
| 246 | fprintf(stderr, "Failed to change %s into integer", val_str); | ||
| 247 | } | ||
| 248 | close(val_fd); | ||
| 249 | } | ||
| 250 | return value; | ||
| 251 | } | ||
| 252 | |||
| 253 | void signal_handler(int sig) | ||
| 254 | { | ||
| 255 | switch (sig) { | ||
| 256 | case SIGTERM: | ||
| 257 | case SIGHUP: | ||
| 258 | case SIGQUIT: | ||
| 259 | case SIGINT: | ||
| 260 | close_gpio_channel(gl_gpio_base); | ||
| 261 | exit(0) ; | ||
| 262 | default: | ||
| 263 | break; | ||
| 264 | } | ||
| 265 | } | ||
| 266 | |||
| 267 | int main(int argc, char *argv[]) | ||
| 268 | { | ||
| 269 | extern char *optarg; | ||
| 270 | char *cptr; | ||
| 271 | int gpio_value = 0; | ||
| 272 | int nchannel = 0; | ||
| 273 | |||
| 274 | int c; | ||
| 275 | int i; | ||
| 276 | |||
| 277 | opterr = 0; | ||
| 278 | |||
| 279 | while ((c = getopt(argc, argv, "g:io:ck")) != -1) { | ||
| 280 | switch (c) { | ||
| 281 | case 'g': | ||
| 282 | gl_gpio_base = (int)strtoul(optarg, &cptr, 0); | ||
| 283 | if (cptr == optarg) | ||
| 284 | usage(argv[0]); | ||
| 285 | break; | ||
| 286 | case 'i': | ||
| 287 | gpio_opt = IN; | ||
| 288 | break; | ||
| 289 | case 'o': | ||
| 290 | gpio_opt = OUT; | ||
| 291 | gpio_value = (int)strtoul(optarg, &cptr, 0); | ||
| 292 | if (cptr == optarg) | ||
| 293 | usage(argv[0]); | ||
| 294 | break; | ||
| 295 | case 'c': | ||
| 296 | gpio_opt = CYLON; | ||
| 297 | break; | ||
| 298 | case 'k': | ||
| 299 | gpio_opt = KIT; | ||
| 300 | break; | ||
| 301 | case '?': | ||
| 302 | usage(argv[0]); | ||
| 303 | default: | ||
| 304 | usage(argv[0]); | ||
| 305 | |||
| 306 | } | ||
| 307 | } | ||
| 308 | |||
| 309 | if (gl_gpio_base == 0) { | ||
| 310 | usage(argv[0]); | ||
| 311 | } | ||
| 312 | |||
| 313 | nchannel = open_gpio_channel(gl_gpio_base); | ||
| 314 | signal(SIGTERM, signal_handler); /* catch kill signal */ | ||
| 315 | signal(SIGHUP, signal_handler); /* catch hang up signal */ | ||
| 316 | signal(SIGQUIT, signal_handler); /* catch quit signal */ | ||
| 317 | signal(SIGINT, signal_handler); /* catch a CTRL-c signal */ | ||
| 318 | switch (gpio_opt) { | ||
| 319 | case IN: | ||
| 320 | set_gpio_direction(gl_gpio_base, nchannel, "in"); | ||
| 321 | gpio_value=get_gpio_value(gl_gpio_base, nchannel); | ||
| 322 | fprintf(stdout,"0x%08X\n", gpio_value); | ||
| 323 | break; | ||
| 324 | case OUT: | ||
| 325 | set_gpio_direction(gl_gpio_base, nchannel, "out"); | ||
| 326 | set_gpio_value(gl_gpio_base, nchannel, gpio_value); | ||
| 327 | break; | ||
| 328 | case CYLON: | ||
| 329 | #define CYLON_DELAY_USECS (10000) | ||
| 330 | set_gpio_direction(gl_gpio_base, nchannel, "out"); | ||
| 331 | for (;;) { | ||
| 332 | for(i=0; i < ARRAY_SIZE(cylon); i++) { | ||
| 333 | gpio_value=(int)cylon[i]; | ||
| 334 | set_gpio_value(gl_gpio_base, nchannel, gpio_value); | ||
| 335 | } | ||
| 336 | usleep(CYLON_DELAY_USECS); | ||
| 337 | } | ||
| 338 | case KIT: | ||
| 339 | #define KIT_DELAY_USECS (10000) | ||
| 340 | set_gpio_direction(gl_gpio_base, nchannel, "out"); | ||
| 341 | for (;;) { | ||
| 342 | for (i=0; i<ARRAY_SIZE(kit); i++) { | ||
| 343 | gpio_value=(int)kit[i]; | ||
| 344 | set_gpio_value(gl_gpio_base, nchannel, gpio_value); | ||
| 345 | } | ||
| 346 | usleep(KIT_DELAY_USECS); | ||
| 347 | } | ||
| 348 | default: | ||
| 349 | break; | ||
| 350 | } | ||
| 351 | close_gpio_channel(gl_gpio_base); | ||
| 352 | return 0; | ||
| 353 | } | ||
| 354 | |||
| 355 | |||
diff --git a/meta-xilinx-demos/recipes-examples/gpio-demo/gpio-demo.bb b/meta-xilinx-demos/recipes-examples/gpio-demo/gpio-demo.bb new file mode 100644 index 00000000..912e0cd4 --- /dev/null +++ b/meta-xilinx-demos/recipes-examples/gpio-demo/gpio-demo.bb | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | # | ||
| 2 | # This is the GPIO-DEMO apllication recipe | ||
| 3 | # | ||
| 4 | # | ||
| 5 | |||
| 6 | SUMMARY = "gpio-demo application" | ||
| 7 | SECTION = "PETALINUX/apps" | ||
| 8 | LICENSE = "MIT" | ||
| 9 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" | ||
| 10 | SRC_URI = "file://gpio-demo.c \ | ||
| 11 | file://Makefile \ | ||
| 12 | " | ||
| 13 | S = "${WORKDIR}" | ||
| 14 | CFLAGS:prepend = "-I ${S}/include" | ||
| 15 | do_compile() { | ||
| 16 | oe_runmake | ||
| 17 | } | ||
| 18 | do_install() { | ||
| 19 | install -d ${D}${bindir} | ||
| 20 | install -m 0755 ${S}/gpio-demo ${D}${bindir} | ||
| 21 | |||
| 22 | } | ||
| 23 | |||
diff --git a/meta-xilinx-demos/recipes-examples/peekpoke/files/Makefile b/meta-xilinx-demos/recipes-examples/peekpoke/files/Makefile new file mode 100644 index 00000000..29fb5cdf --- /dev/null +++ b/meta-xilinx-demos/recipes-examples/peekpoke/files/Makefile | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | PEEK = peek | ||
| 2 | POKE = poke | ||
| 3 | |||
| 4 | # Add any other object files to this list below | ||
| 5 | PEEK_OBJS = peek.o | ||
| 6 | POKE_OBJS = poke.o | ||
| 7 | |||
| 8 | all: $(PEEK) $(POKE) | ||
| 9 | |||
| 10 | $(POKE): $(POKE_OBJS) | ||
| 11 | $(CC) $(LDFLAGS) -o $@ $(POKE_OBJS) $(LDLIBS) | ||
| 12 | |||
| 13 | $(PEEK): $(PEEK_OBJS) | ||
| 14 | $(CC) $(LDFLAGS) -o $@ $(PEEK_OBJS) $(LDLIBS) | ||
| 15 | |||
| 16 | clean: | ||
| 17 | -rm -f $(POKE) $(PEEK) *.elf *.gdb *.o | ||
| 18 | |||
| 19 | |||
diff --git a/meta-xilinx-demos/recipes-examples/peekpoke/files/peek.c b/meta-xilinx-demos/recipes-examples/peekpoke/files/peek.c new file mode 100644 index 00000000..53bd1d1c --- /dev/null +++ b/meta-xilinx-demos/recipes-examples/peekpoke/files/peek.c | |||
| @@ -0,0 +1,76 @@ | |||
| 1 | /* | ||
| 2 | * peek utility - for those who remember the good old days! | ||
| 3 | * | ||
| 4 | * | ||
| 5 | * Copyright (C) 2013 - 2016 Xilinx, Inc. All rights reserved. | ||
| 6 | * | ||
| 7 | * Permission is hereby granted, free of charge, to any person | ||
| 8 | * obtaining a copy of this software and associated documentation | ||
| 9 | * files (the "Software"), to deal in the Software without restriction, | ||
| 10 | * including without limitation the rights to use, copy, modify, merge, | ||
| 11 | * publish, distribute, sublicense, and/or sell copies of the Software, | ||
| 12 | * and to permit persons to whom the Software is furnished to do so, | ||
| 13 | * subject to the following conditions: | ||
| 14 | * | ||
| 15 | * The above copyright notice and this permission notice shall be included | ||
| 16 | * in all copies or substantial portions of the Software. | ||
| 17 | * | ||
| 18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| 19 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| 20 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
| 21 | * IN NO EVENT SHALL XILINX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
| 22 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
| 23 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
| 24 | * | ||
| 25 | * Except as contained in this notice, the name of the Xilinx shall not be used | ||
| 26 | * in advertising or otherwise to promote the sale, use or other dealings in this | ||
| 27 | * Software without prior written authorization from Xilinx. | ||
| 28 | * | ||
| 29 | */ | ||
| 30 | |||
| 31 | #include <stdio.h> | ||
| 32 | #include <stdlib.h> | ||
| 33 | #include <unistd.h> | ||
| 34 | #include <sys/mman.h> | ||
| 35 | #include <fcntl.h> | ||
| 36 | #include <stdint.h> | ||
| 37 | |||
| 38 | void usage(char *prog) | ||
| 39 | { | ||
| 40 | printf("usage: %s ADDR\n",prog); | ||
| 41 | printf("\n"); | ||
| 42 | printf("ADDR may be specified as hex values\n"); | ||
| 43 | } | ||
| 44 | |||
| 45 | |||
| 46 | int main(int argc, char *argv[]) | ||
| 47 | { | ||
| 48 | int fd; | ||
| 49 | void *ptr; | ||
| 50 | uint64_t addr, page_addr, page_offset; | ||
| 51 | uint64_t page_size=sysconf(_SC_PAGESIZE); | ||
| 52 | |||
| 53 | if(argc!=2) { | ||
| 54 | usage(argv[0]); | ||
| 55 | exit(-1); | ||
| 56 | } | ||
| 57 | |||
| 58 | fd=open("/dev/mem",O_RDONLY); | ||
| 59 | if(fd<1) { | ||
| 60 | perror(argv[0]); | ||
| 61 | exit(-1); | ||
| 62 | } | ||
| 63 | |||
| 64 | addr=strtoul(argv[1],NULL,0); | ||
| 65 | page_addr=(addr & ~(page_size-1)); | ||
| 66 | page_offset=addr-page_addr; | ||
| 67 | |||
| 68 | ptr=mmap(NULL,page_size,PROT_READ,MAP_SHARED,fd,(addr & ~(page_size-1))); | ||
| 69 | if((int64_t)ptr==-1) { | ||
| 70 | perror(argv[0]); | ||
| 71 | exit(-1); | ||
| 72 | } | ||
| 73 | |||
| 74 | printf("0x%08lx\n",*((uint64_t *)(ptr+page_offset))); | ||
| 75 | return 0; | ||
| 76 | } | ||
diff --git a/meta-xilinx-demos/recipes-examples/peekpoke/files/poke.c b/meta-xilinx-demos/recipes-examples/peekpoke/files/poke.c new file mode 100644 index 00000000..6948bca7 --- /dev/null +++ b/meta-xilinx-demos/recipes-examples/peekpoke/files/poke.c | |||
| @@ -0,0 +1,79 @@ | |||
| 1 | /* | ||
| 2 | * poke utility - for those who remember the good old days! | ||
| 3 | * Fixed by Pascal Bos from Nikhef, to be able to use this | ||
| 4 | * in 64 bit registers. | ||
| 5 | * | ||
| 6 | * Copyright (C) 2013 - 2016 Xilinx, Inc. All rights reserved. | ||
| 7 | * | ||
| 8 | * Permission is hereby granted, free of charge, to any person | ||
| 9 | * obtaining a copy of this software and associated documentation | ||
| 10 | * files (the "Software"), to deal in the Software without restriction, | ||
| 11 | * including without limitation the rights to use, copy, modify, merge, | ||
| 12 | * publish, distribute, sublicense, and/or sell copies of the Software, | ||
| 13 | * and to permit persons to whom the Software is furnished to do so, | ||
| 14 | * subject to the following conditions: | ||
| 15 | * | ||
| 16 | * The above copyright notice and this permission notice shall be included | ||
| 17 | * in all copies or substantial portions of the Software. | ||
| 18 | * | ||
| 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| 21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
| 22 | * IN NO EVENT SHALL XILINX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
| 23 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
| 24 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
| 25 | * | ||
| 26 | * Except as contained in this notice, the name of the Xilinx shall not be used | ||
| 27 | * in advertising or otherwise to promote the sale, use or other dealings in this | ||
| 28 | * Software without prior written authorization from Xilinx. | ||
| 29 | * | ||
| 30 | */ | ||
| 31 | |||
| 32 | #include <stdio.h> | ||
| 33 | #include <stdlib.h> | ||
| 34 | #include <unistd.h> | ||
| 35 | #include <stdint.h> | ||
| 36 | #include <sys/mman.h> | ||
| 37 | #include <fcntl.h> | ||
| 38 | |||
| 39 | void usage(char *prog) | ||
| 40 | { | ||
| 41 | printf("usage: %s ADDR VAL\n",prog); | ||
| 42 | printf("\n"); | ||
| 43 | printf("ADDR and VAL may be specified as hex values\n"); | ||
| 44 | } | ||
| 45 | |||
| 46 | int main(int argc, char *argv[]) | ||
| 47 | { | ||
| 48 | int fd; | ||
| 49 | void *ptr; | ||
| 50 | uint64_t val; | ||
| 51 | uint64_t addr, page_addr, page_offset; | ||
| 52 | uint64_t page_size=sysconf(_SC_PAGESIZE); | ||
| 53 | |||
| 54 | fd=open("/dev/mem",O_RDWR); | ||
| 55 | if(fd<1) { | ||
| 56 | perror(argv[0]); | ||
| 57 | exit(-1); | ||
| 58 | } | ||
| 59 | |||
| 60 | if(argc!=3) { | ||
| 61 | usage(argv[0]); | ||
| 62 | exit(-1); | ||
| 63 | } | ||
| 64 | |||
| 65 | addr=strtoul(argv[1],NULL,0); | ||
| 66 | val=strtoul(argv[2],NULL,0); | ||
| 67 | |||
| 68 | page_addr=(addr & ~(page_size-1)); | ||
| 69 | page_offset=addr-page_addr; | ||
| 70 | |||
| 71 | ptr=mmap(NULL,page_size,PROT_READ|PROT_WRITE,MAP_SHARED,fd,(addr & ~(page_size-1))); | ||
| 72 | if((int64_t)ptr==-1) { | ||
| 73 | perror(argv[0]); | ||
| 74 | exit(-1); | ||
| 75 | } | ||
| 76 | |||
| 77 | *((uint64_t *)(ptr+page_offset))=val; | ||
| 78 | return 0; | ||
| 79 | } | ||
diff --git a/meta-xilinx-demos/recipes-examples/peekpoke/peekpoke.bb b/meta-xilinx-demos/recipes-examples/peekpoke/peekpoke.bb new file mode 100644 index 00000000..3949598e --- /dev/null +++ b/meta-xilinx-demos/recipes-examples/peekpoke/peekpoke.bb | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | # | ||
| 2 | # This is the peekpoke apllication recipe | ||
| 3 | # | ||
| 4 | # | ||
| 5 | |||
| 6 | SUMMARY = "peekpoke application" | ||
| 7 | SECTION = "PETALINUX/apps" | ||
| 8 | LICENSE = "MIT" | ||
| 9 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" | ||
| 10 | SRC_URI = "file://peek.c \ | ||
| 11 | file://poke.c \ | ||
| 12 | file://Makefile \ | ||
| 13 | " | ||
| 14 | S = "${WORKDIR}" | ||
| 15 | CFLAGS:prepend = "-I ${S}/include" | ||
| 16 | do_compile() { | ||
| 17 | oe_runmake | ||
| 18 | } | ||
| 19 | do_install() { | ||
| 20 | install -d ${D}${bindir} | ||
| 21 | install -m 0755 ${S}/peek ${D}${bindir} | ||
| 22 | install -m 0755 ${S}/poke ${D}${bindir} | ||
| 23 | |||
| 24 | } | ||
| 25 | |||
diff --git a/meta-xilinx-demos/recipes-firmware/vek280-pl-bram-uart-gpio-fw/vek280-pl-bram-uart-gpio-fw_1.0-2024.2.bb b/meta-xilinx-demos/recipes-firmware/vek280-pl-bram-uart-gpio-fw/vek280-pl-bram-uart-gpio-fw_1.0-2024.2.bb new file mode 100644 index 00000000..045b88d5 --- /dev/null +++ b/meta-xilinx-demos/recipes-firmware/vek280-pl-bram-uart-gpio-fw/vek280-pl-bram-uart-gpio-fw_1.0-2024.2.bb | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | SUMMARY = "VEK280 Segemented Configuration(DFx Full) firmware using dfx_user_dts bbclass" | ||
| 2 | DESCRIPTION = "VEK280 Segemented Configuration(DFx Full) PL AXI BRAM, AXI GPIO and AXI UART firmware application" | ||
| 3 | LICENSE = "MIT" | ||
| 4 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" | ||
| 5 | |||
| 6 | inherit dfx_user_dts | ||
| 7 | |||
| 8 | SRC_URI = "https://petalinux.xilinx.com/sswreleases/rel-v2024.2/sdt/2024.2/2024.2_1106_1_11061206/external/vek280-pl-bram-gpio-fw/vek280-pl-bram-gpio-fw_2024.2_1106_1.tar.gz" | ||
| 9 | |||
| 10 | SRC_URI[sha256sum] = "bf7688694a27a0f81e7d59d16c2b819994aa5fb8adfb0d94656da4040e4bc279" | ||
| 11 | |||
| 12 | COMPATIBLE_MACHINE:versal-vek280-sdt-seg = "${MACHINE}" | ||
| 13 | COMPATIBLE_MACHINE:versal-vek280-sdt-seg-ospi = "${MACHINE}" | ||
| 14 | |||
| 15 | # When do_upack is exectuted it will extract tar file with original directory | ||
| 16 | # name so set the FW_DIR pointing to pdi and dtsi files. | ||
| 17 | FW_DIR = "vek280-pl-bram-gpio-fw" | ||
| 18 | |||
| 19 | # fw files doesn't install on rootfs using dfx_user_dts bbclass using artifactory | ||
| 20 | # method. To workaround this issue we are using copy_fw_files pre-functions. | ||
| 21 | # copy_fw_files prefuncs needs to be called before find_firmware_file to update | ||
| 22 | # the firmware-name to ${PN}. | ||
| 23 | do_configure[prefuncs] =+ "copy_fw_files" | ||
| 24 | python copy_fw_files () { | ||
| 25 | import shutil | ||
| 26 | fw_file_src = d.getVar('WORKDIR') + '/' + d.getVar("FW_DIR") | ||
| 27 | fw_file_dest = d.getVar('S') | ||
| 28 | shutil.copytree(fw_file_src, fw_file_dest, dirs_exist_ok=True) | ||
| 29 | } | ||
diff --git a/meta-xilinx-demos/recipes-firmware/zcu104-pl-vcu-fw/zcu104-pl-vcu-fw_1.0-2024.2.bb b/meta-xilinx-demos/recipes-firmware/zcu104-pl-vcu-fw/zcu104-pl-vcu-fw_1.0-2024.2.bb new file mode 100644 index 00000000..0dcb2be2 --- /dev/null +++ b/meta-xilinx-demos/recipes-firmware/zcu104-pl-vcu-fw/zcu104-pl-vcu-fw_1.0-2024.2.bb | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | SUMMARY = "ZCU104 full pl firmware using dfx_user_dts bbclass" | ||
| 2 | DESCRIPTION = "ZCU104 full PL VCU firmware application" | ||
| 3 | LICENSE = "MIT" | ||
| 4 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" | ||
| 5 | |||
| 6 | inherit dfx_user_dts | ||
| 7 | |||
| 8 | SRC_URI = "https://petalinux.xilinx.com/sswreleases/rel-v2024.2/sdt/2024.2/2024.2_1106_1_11061206/external/zcu104-pl-vcu-fw/zcu104-pl-vcu-fw_2024.2_1106_1.tar.gz" | ||
| 9 | |||
| 10 | SRC_URI[sha256sum] = "1eef872153d2373c944c20752bc374e371159395a42d8353bd1a397fadc59231" | ||
| 11 | |||
| 12 | |||
| 13 | COMPATIBLE_MACHINE:zynqmp-zcu104-sdt-full = "${MACHINE}" | ||
| 14 | |||
| 15 | # When do_upack is exectuted it will extract tar file with original directory | ||
| 16 | # name so set the FW_DIR pointing to pdi and dtsi files. | ||
| 17 | FW_DIR = "zcu104-pl-vcu-fw" | ||
| 18 | |||
| 19 | # fw files doesn't install on rootfs using dfx_user_dts bbclass using artifactory | ||
| 20 | # method. To workaround this issue we are using copy_fw_files pre-functions. | ||
| 21 | # copy_fw_files prefuncs needs to be called before find_firmware_file to update | ||
| 22 | # the firmware-name to ${PN}. | ||
| 23 | do_configure[prefuncs] =+ "copy_fw_files" | ||
| 24 | python copy_fw_files () { | ||
| 25 | import shutil | ||
| 26 | fw_file_src = d.getVar('WORKDIR') + '/' + d.getVar("FW_DIR") | ||
| 27 | fw_file_dest = d.getVar('S') | ||
| 28 | shutil.copytree(fw_file_src, fw_file_dest, dirs_exist_ok=True) | ||
| 29 | } | ||
diff --git a/meta-xilinx-demos/scripts/generate-machines-sdt.sh b/meta-xilinx-demos/scripts/generate-machines-sdt.sh new file mode 100755 index 00000000..aaeef385 --- /dev/null +++ b/meta-xilinx-demos/scripts/generate-machines-sdt.sh | |||
| @@ -0,0 +1,79 @@ | |||
| 1 | #! /bin/bash -e | ||
| 2 | |||
| 3 | ### The following table controls the automatic generated of the firmware demos | ||
| 4 | ### Machine Recipe | ||
| 5 | #M# vek280-pl-bram-gpio-fw recipes-firmware/vek280-pl-bram-uart-gpio-fw/vek280-pl-bram-uart-gpio-fw_1.0-2024.2.bb | ||
| 6 | #M# zcu104-pl-vcu-fw recipes-firmware/zcu104-pl-vcu-fw/zcu104-pl-vcu-fw_1.0-2024.2.bb | ||
| 7 | |||
| 8 | this=$(realpath $0) | ||
| 9 | |||
| 10 | if [ $# -lt 2 ]; then | ||
| 11 | echo "$0: <conf_path> <machine_url_index> [machine]" >&2 | ||
| 12 | exit 1 | ||
| 13 | fi | ||
| 14 | |||
| 15 | conf_path=$(realpath $1) | ||
| 16 | if [ ! -d ${conf_path} ]; then | ||
| 17 | mkdir -p ${conf_path} | ||
| 18 | fi | ||
| 19 | |||
| 20 | |||
| 21 | mach_index=$(realpath $2) | ||
| 22 | count=0 | ||
| 23 | while read mach_id mach_url; do | ||
| 24 | if [ ${mach_id} = '#' ]; then | ||
| 25 | continue | ||
| 26 | fi | ||
| 27 | |||
| 28 | MACHINE_ID[$count]=${mach_id} | ||
| 29 | MACHINE_URL[$count]=${mach_url} | ||
| 30 | |||
| 31 | count=$(expr $count + 1) | ||
| 32 | done < ${mach_index} | ||
| 33 | |||
| 34 | |||
| 35 | # Load in the arrays from this script | ||
| 36 | count=0 | ||
| 37 | while read marker machine recipe ; do | ||
| 38 | if [ "${marker}" != "#M#" ]; then | ||
| 39 | continue | ||
| 40 | fi | ||
| 41 | |||
| 42 | MACHINES[$count]=${machine} | ||
| 43 | RECIPES[$count]=${recipe} | ||
| 44 | for mach in ${!MACHINE_ID[@]}; do | ||
| 45 | if [ ${MACHINE_ID[${mach}]} = ${machine} ]; then | ||
| 46 | URLS[$count]=${MACHINE_URL[${mach}]} | ||
| 47 | break | ||
| 48 | fi | ||
| 49 | done | ||
| 50 | if [ -z "${URLS[$count]}" ]; then | ||
| 51 | echo "ERROR: Unable to find ${machine} in ${mach_index}" >&2 | ||
| 52 | exit 1 | ||
| 53 | fi | ||
| 54 | |||
| 55 | count=$(expr $count + 1) | ||
| 56 | done < ${this} | ||
| 57 | |||
| 58 | |||
| 59 | for mach in ${!MACHINES[@]}; do | ||
| 60 | if [ -n "$3" -a "$3" != "${MACHINES[${mach}]}" ]; then | ||
| 61 | continue | ||
| 62 | fi | ||
| 63 | |||
| 64 | echo "Machine: ${MACHINES[${mach}]}" | ||
| 65 | echo "Recipe: ${RECIPES[${mach}]}" | ||
| 66 | echo "URL: ${URLS[${mach}]}" | ||
| 67 | echo | ||
| 68 | |||
| 69 | url=${URLS[${mach}]} | ||
| 70 | url=$(echo $url | sed 's,https://petalinux.xilinx.com/sswreleases/.*/sdt,https://artifactory.xilinx.com/artifactory/petalinux-hwproj-dev/sdt,') | ||
| 71 | |||
| 72 | wget $url -O ${conf_path}/output.sdt | ||
| 73 | sha=$(sha256sum ${conf_path}/output.sdt | cut -d ' ' -f 1) | ||
| 74 | rm -f ${conf_path}/output.sdt | ||
| 75 | |||
| 76 | sed -e 's,SRC_URI = .*,SRC_URI = "'${URLS[${mach}]}'",' \ | ||
| 77 | -e 's,SRC_URI\[sha256sum\] = .*,SRC_URI\[sha256sum\] = "'${sha}'",' \ | ||
| 78 | -i $(dirname $0)/../${RECIPES[${mach}]} | ||
| 79 | done | ||
