From abf9dc46bd790ddea7ff38fce6a3956cc18b2038 Mon Sep 17 00:00:00 2001 From: Arturo Buzarra Date: Mon, 13 Mar 2023 11:43:55 +0100 Subject: [PATCH 001/100] dey-image-installer: remove path from README file for USB driver installation script Signed-off-by: Arturo Buzarra (cherry picked from commit 7ea467dba7ba2bb6f510ca2fd7cd2f5218929853) Signed-off-by: Javier Viguera --- meta-digi-dey/classes/dey-image-installer.bbclass | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta-digi-dey/classes/dey-image-installer.bbclass b/meta-digi-dey/classes/dey-image-installer.bbclass index 6231356ce..ac1717729 100644 --- a/meta-digi-dey/classes/dey-image-installer.bbclass +++ b/meta-digi-dey/classes/dey-image-installer.bbclass @@ -1,7 +1,7 @@ # # Generate DEY installer ZIP package # -# Copyright 2017-2022, Digi International Inc. +# Copyright 2017-2023, Digi International Inc. # DEPENDS += "zip-native" @@ -61,7 +61,7 @@ ${DISTRO_NAME} ${DISTRO_VERSION} kit installer ---------------------------------------- _EOF_ - md5sum ${INSTALLER_FILELIST} | sed -e "s,${DEPLOY_DIR_IMAGE}/,,g;s,${IMGDEPLOYDIR}/,,g" >> ${IMGDEPLOYDIR}/README.txt + md5sum ${INSTALLER_FILELIST} | sed -e "s,${DEPLOY_DIR_IMAGE}/,,g;s,${IMGDEPLOYDIR}/,,g;s,${META_DIGI_SCRIPTS}/,,g" >> ${IMGDEPLOYDIR}/README.txt # Pack the files and remove the temporary readme file zip -j ${IMGDEPLOYDIR}/${IMAGE_NAME}.installer.zip ${INSTALLER_FILELIST} ${IMGDEPLOYDIR}/README.txt From a53eaa5b49a4550a8c5f5c49ca1f6c8f3f1fa09d Mon Sep 17 00:00:00 2001 From: Arturo Buzarra Date: Mon, 13 Mar 2023 16:36:06 +0100 Subject: [PATCH 002/100] systemd-conf: use custom journald conf file The Poky layer defines a default journald conf file that allows log files on the file system to grow to a maximum of 64 MiB. However, this size on some platforms is impossible to address, so this commit reduces the maximum size for runtime logs to 4 MiB. https://onedigi.atlassian.net/browse/DEL-8419 Signed-off-by: Arturo Buzarra (cherry picked from commit bdece7102ba6a2183ab8155507a9abe246eef2cf) Signed-off-by: Javier Viguera --- meta-digi-dey/recipes-core/systemd/systemd-conf/journald.conf | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 meta-digi-dey/recipes-core/systemd/systemd-conf/journald.conf diff --git a/meta-digi-dey/recipes-core/systemd/systemd-conf/journald.conf b/meta-digi-dey/recipes-core/systemd/systemd-conf/journald.conf new file mode 100644 index 000000000..4860db626 --- /dev/null +++ b/meta-digi-dey/recipes-core/systemd/systemd-conf/journald.conf @@ -0,0 +1,3 @@ +[Journal] +ForwardToSyslog=yes +RuntimeMaxUse=4M From 0a80edeb28003bcd8205fb6bf6d5056451c56fac Mon Sep 17 00:00:00 2001 From: Arturo Buzarra Date: Tue, 14 Mar 2023 09:37:00 +0100 Subject: [PATCH 003/100] dey-image-installer: remove path from binaries stored inside a folder in the deploy dir Signed-off-by: Arturo Buzarra (cherry picked from commit 88251adc0debadfe648d9c1bd18d296f2a919632) Signed-off-by: Javier Viguera --- meta-digi-dey/classes/dey-image-installer.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta-digi-dey/classes/dey-image-installer.bbclass b/meta-digi-dey/classes/dey-image-installer.bbclass index ac1717729..66243e878 100644 --- a/meta-digi-dey/classes/dey-image-installer.bbclass +++ b/meta-digi-dey/classes/dey-image-installer.bbclass @@ -61,7 +61,7 @@ ${DISTRO_NAME} ${DISTRO_VERSION} kit installer ---------------------------------------- _EOF_ - md5sum ${INSTALLER_FILELIST} | sed -e "s,${DEPLOY_DIR_IMAGE}/,,g;s,${IMGDEPLOYDIR}/,,g;s,${META_DIGI_SCRIPTS}/,,g" >> ${IMGDEPLOYDIR}/README.txt + md5sum ${INSTALLER_FILELIST} | sed -e "s,${DEPLOY_DIR_IMAGE}.*/,,g;s,${IMGDEPLOYDIR}/,,g;s,${META_DIGI_SCRIPTS}/,,g" >> ${IMGDEPLOYDIR}/README.txt # Pack the files and remove the temporary readme file zip -j ${IMGDEPLOYDIR}/${IMAGE_NAME}.installer.zip ${INSTALLER_FILELIST} ${IMGDEPLOYDIR}/README.txt From 358dd2a815ecfc2ce8bd4814926b1ee127034675 Mon Sep 17 00:00:00 2001 From: Arturo Buzarra Date: Fri, 17 Mar 2023 12:26:56 +0100 Subject: [PATCH 004/100] build.sh: add dey-image-qt for ccmp15-dvk ConnectCore MP15 has support to QT applications, so add it to the daily build. Signed-off-by: Arturo Buzarra (cherry picked from commit b92028b407caa10caf8239d7ab3bf5f8e611f6c5) Signed-off-by: Javier Viguera --- sdk/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/build.sh b/sdk/build.sh index a02bdd009..49abd244c 100755 --- a/sdk/build.sh +++ b/sdk/build.sh @@ -184,7 +184,7 @@ done<<-_EOF_ ccimx6ulstarter core-image-base ccimx6ulsom dey-image-mft-module-min ccimx6ulrftest dey-image-mft-module-rf - ccmp15-dvk dey-image-webkit,dey-image-crank + ccmp15-dvk dey-image-qt,dey-image-crank,dey-image-webkit ccmp13-dvk core-image-base ccimx93-dvk dey-image-qt _EOF_ From 661f59967c73572659d48cd609b458f4b1ef85ba Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Wed, 15 Mar 2023 17:17:11 +0100 Subject: [PATCH 005/100] trustfence: add function to generate a PKI tree if it doesn't exist The stand-alone signing script 'trustfence-sign-artifact.sh' checks if a valid PKI tree exists (by checking the existance of four SRK files) and if they don't, it calls trustfence-gen-pki.sh (which is a wrapper over different generators (for HAB or AHAB) to create one. Recipes such as 'dualboot' or 'recovery-initramfs' may need to call openssl functions over the PKI tree. These recipes do not currently generate the PKI tree; they expect it to be already in place. This might not be the case if the trustfence-sign-artifact.sh script has not been called yet. Originally, a fake dependency on virtual/kernel recipe was made to force it, but it doesn't quite work since the calling only happens on deploy() while regular DEPENDS doesn't wait for this task. If the PKI does not exist, a recipe that requires the PKI tree will fail. The solution is to create a function on the trustfence.bbclass that allows any recipe to check for the existance of a PKI tree and generate it if it doesn't exist. This is repeated inside the trustfence-sign-artifact.sh, but it needs to be in both places because this script must work stand-alone. The generation of the PKI tree takes some seconds so this commit adds a lock dir to prevent race conditions when called from different recipes. It also removes the fake dependency on virtual/kernel and adds a dependency on trustfence-cst-native (which is the recipe that provides the PKI generation tool). Signed-off-by: Hector Palacios https://onedigi.atlassian.net/browse/DEL-8430 (cherry picked from commit 6a8bf7affffc4cb38b55070f4b6aa8adfeda297a) --- .../trustfence-sign-artifact.sh | 16 ++++++++++++-- meta-digi-dey/classes/trustfence.bbclass | 22 +++++++++++++++++++ .../recovery/recovery-initramfs.bb | 8 +++---- .../recipes-digi/dualboot/dualboot.bb | 9 +++----- 4 files changed, 42 insertions(+), 13 deletions(-) diff --git a/meta-digi-arm/recipes-digi/trustfence/trustfence-sign-tools/trustfence-sign-artifact.sh b/meta-digi-arm/recipes-digi/trustfence/trustfence-sign-tools/trustfence-sign-artifact.sh index 8c57ff03a..ba916eafa 100755 --- a/meta-digi-arm/recipes-digi/trustfence/trustfence-sign-tools/trustfence-sign-artifact.sh +++ b/meta-digi-arm/recipes-digi/trustfence/trustfence-sign-tools/trustfence-sign-artifact.sh @@ -152,6 +152,18 @@ if [ "${CONFIG_SIGN_MODE}" = "HAB" ]; then DEK_BLOB_OFFSET="0x100" fi +# Function to generate a PKI tree (with lock dir protection) +GENPKI_LOCK_DIR="${CONFIG_SIGN_KEYS_PATH}/.genpki.lock" +gen_pki_tree() { + if mkdir -p ${GENPKI_LOCK_DIR}; then + trustfence-gen-pki.sh ${CONFIG_SIGN_KEYS_PATH} + rm -rf ${GENPKI_LOCK_DIR} + else + echo "Could not get lock to generate PKI tree" + exit 1 + fi +} + # Default values [ -z "${CONFIG_KEY_INDEX}" ] && CONFIG_KEY_INDEX="0" CONFIG_KEY_INDEX_1="$((CONFIG_KEY_INDEX + 1))" @@ -170,7 +182,7 @@ if [ "${CONFIG_SIGN_MODE}" = "HAB" ]; then echo "Using existing PKI tree" elif [ "${n_commas}" -eq 0 ] || [ ! -f "${CERT_CSF}" ] || [ ! -f "${CERT_IMG}" ]; then # Generate PKI - trustfence-gen-pki.sh "${CONFIG_SIGN_KEYS_PATH}" + gen_pki_tree SRK_KEYS="$(echo ${CONFIG_SIGN_KEYS_PATH}/crts/SRK*crt.pem | sed s/\ /\,/g)" CERT_CSF="$(echo ${CONFIG_SIGN_KEYS_PATH}/crts/CSF${CONFIG_KEY_INDEX_1}*crt.pem)" @@ -185,7 +197,7 @@ elif [ "${CONFIG_SIGN_MODE}" = "AHAB" ]; then echo "Using existing PKI tree" elif [ "${n_commas}" -eq 0 ] && [ "${CONFIG_SIGN_MODE}" = "AHAB" ]; then # Generate PKI - trustfence-gen-pki.sh "${CONFIG_SIGN_KEYS_PATH}" + gen_pki_tree SRK_KEYS="$(echo ${CONFIG_SIGN_KEYS_PATH}/crts/SRK*crt.pem | sed s/\ /\,/g)" else diff --git a/meta-digi-dey/classes/trustfence.bbclass b/meta-digi-dey/classes/trustfence.bbclass index 663204290..0e430cf94 100644 --- a/meta-digi-dey/classes/trustfence.bbclass +++ b/meta-digi-dey/classes/trustfence.bbclass @@ -110,3 +110,25 @@ python () { else: d.setVar("TRUSTFENCE_INITRAMFS_IMAGE", ""); } + +# Function to generate a PKI tree (with lock dir protection) +GENPKI_LOCK_DIR = "${TRUSTFENCE_SIGN_KEYS_PATH}/.genpki.lock" +gen_pki_tree() { + if mkdir -p ${GENPKI_LOCK_DIR}; then + trustfence-gen-pki.sh ${TRUSTFENCE_SIGN_KEYS_PATH} + rm -rf ${GENPKI_LOCK_DIR} + else + bbfatal "Could not get lock to generate PKI tree" + fi +} + +# Function that generates a PKI tree if there isn't one +check_gen_pki_tree() { + SRK_KEYS="$(echo ${TRUSTFENCE_SIGN_KEYS_PATH}/crts/SRK*crt.pem | sed s/\ /\,/g)" + n_commas="$(echo ${SRK_KEYS} | grep -o "," | wc -l)" + if [ "${n_commas}" -eq 0 ]; then + gen_pki_tree + elif [ "${n_commas}" -ne 3 ]; then + bbfatal "Inconsistent PKI tree" + fi +} diff --git a/meta-digi-dey/recipes-core/recovery/recovery-initramfs.bb b/meta-digi-dey/recipes-core/recovery/recovery-initramfs.bb index b10bc069e..03e121515 100644 --- a/meta-digi-dey/recipes-core/recovery/recovery-initramfs.bb +++ b/meta-digi-dey/recipes-core/recovery/recovery-initramfs.bb @@ -4,11 +4,7 @@ SUMMARY = "Recovery initramfs files" LICENSE = "GPL-2.0-only" LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6" -# When building a TrustFence enabled recovery initramfs, we need the TrustFence PKI tree to -# be already generated in order to copy the public key. Forcing a dependence against -# 'virtual/kernel' ensures that the keys are already generated as they are needed to sign the -# kernel artifacts. -DEPENDS += "${@oe.utils.conditional('TRUSTFENCE_SIGN', '1', 'virtual/kernel openssl-native', '', d)}" +DEPENDS += "${@oe.utils.conditional('TRUSTFENCE_SIGN', '1', 'openssl-native trustfence-cst-native', '', d)}" SRC_URI = " \ file://recovery-initramfs-init \ @@ -38,6 +34,8 @@ do_install() { # If Trustfence is enabled, copy the public key that is going to be used into the # initramfs '/etc/ssl/certs' folder in order to verify swupdate packages. if [ "${TRUSTFENCE_SIGN}" = "1" ]; then + # Check and generate a PKI tree if there isn't one + check_gen_pki_tree # Retrieve the key index to use. KEY_INDEX="0" if [ -n "${TRUSTFENCE_KEY_INDEX}" ]; then diff --git a/meta-digi-dey/recipes-digi/dualboot/dualboot.bb b/meta-digi-dey/recipes-digi/dualboot/dualboot.bb index 1876504a6..374a532c7 100644 --- a/meta-digi-dey/recipes-digi/dualboot/dualboot.bb +++ b/meta-digi-dey/recipes-digi/dualboot/dualboot.bb @@ -5,12 +5,7 @@ SECTION = "base" LICENSE = "GPL-2.0-only" LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6" - -# When building a TrustFence enabled rootfs, we need the TrustFence PKI tree to -# be already generated in order to copy the public key. Forcing a dependency with -# 'virtual/kernel' ensures that the keys are already generated as they are needed to sign the -# kernel artifacts. -DEPENDS += "${@oe.utils.conditional('TRUSTFENCE_SIGN', '1', 'virtual/kernel openssl-native', '', d)}" +DEPENDS += "${@oe.utils.conditional('TRUSTFENCE_SIGN', '1', 'openssl-native trustfence-cst-native', '', d)}" SRC_URI = " \ file://dualboot-init \ @@ -41,6 +36,8 @@ do_install() { # If Trustfence is enabled, copy the public key that is going to be used into the # initramfs '/etc/ssl/certs' folder in order to verify swupdate packages. if [ "${TRUSTFENCE_SIGN}" = "1" ]; then + # Check and generate a PKI tree if there isn't one + check_gen_pki_tree # Retrieve the key index to use. KEY_INDEX="0" if [ -n "${TRUSTFENCE_KEY_INDEX}" ]; then From d76bb3ac2c364fafe4664b2e325ea3bb77e06d61 Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Tue, 21 Mar 2023 17:05:15 +0100 Subject: [PATCH 006/100] machine: restrict udev extra rules to systemd or udevd device managers There are other device managers (e.g. mdev) that do not understand those udev rules, so do not install them unconditionally. Signed-off-by: Javier Viguera --- meta-digi-arm/conf/machine/include/ccmp1.inc | 3 --- meta-digi-arm/conf/machine/include/digi-defaults.inc | 4 ++++ meta-digi-arm/conf/machine/include/imx-digi-base.inc | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/meta-digi-arm/conf/machine/include/ccmp1.inc b/meta-digi-arm/conf/machine/include/ccmp1.inc index 49c5f4c1b..aad915529 100644 --- a/meta-digi-arm/conf/machine/include/ccmp1.inc +++ b/meta-digi-arm/conf/machine/include/ccmp1.inc @@ -42,9 +42,6 @@ MACHINE_EXTRA_RDEPENDS += " \ mtd-utils-ubifs \ " -# Extra udev rules -MACHINE_EXTRA_RRECOMMENDS += "udev-extraconf" - # Image FS types IMAGE_FSTYPES:remove = "ext4 tar.xz" diff --git a/meta-digi-arm/conf/machine/include/digi-defaults.inc b/meta-digi-arm/conf/machine/include/digi-defaults.inc index d27c3dcfb..cb28faf61 100644 --- a/meta-digi-arm/conf/machine/include/digi-defaults.inc +++ b/meta-digi-arm/conf/machine/include/digi-defaults.inc @@ -72,6 +72,10 @@ MACHINE_EXTRA_RRECOMMENDS += " \ ${@bb.utils.contains("MACHINE_FEATURES", "cryptochip", "cryptoauthlib", "", d)} \ " +# Extra rules when device manager is systemd or udev +UDEV_EXTRA_RULES = "udev-extraconf" +MACHINE_EXTRA_RRECOMMENDS += "${@bb.utils.contains_any('VIRTUAL-RUNTIME_dev_manager', 'systemd udev', '${UDEV_EXTRA_RULES}', '', d)}" + # Default image name (for install scripts) DEFAULT_IMAGE_NAME ??= "dey-image-qt" diff --git a/meta-digi-arm/conf/machine/include/imx-digi-base.inc b/meta-digi-arm/conf/machine/include/imx-digi-base.inc index 19deabe9d..e0492d86a 100644 --- a/meta-digi-arm/conf/machine/include/imx-digi-base.inc +++ b/meta-digi-arm/conf/machine/include/imx-digi-base.inc @@ -208,9 +208,6 @@ IMX_ALSA_EXTRA:imx-nxp-bsp = "imx-alsa-plugins" MACHINE_EXTRA_RRECOMMENDS:append:mx6-nxp-bsp = " ${@bb.utils.contains('DISTRO_FEATURES', 'alsa', '${IMX_ALSA_EXTRA}', '', d)}" MACHINE_EXTRA_RRECOMMENDS:append:mx8-nxp-bsp = " ${@bb.utils.contains('DISTRO_FEATURES', 'alsa', '${IMX_ALSA_EXTRA}', '', d)}" -# Extra udev rules -MACHINE_EXTRA_RRECOMMENDS += "udev-extraconf udev-rules-imx" - # GStreamer 1.0 plugins MACHINE_GSTREAMER_1_0_PLUGIN ?= "" MACHINE_GSTREAMER_1_0_PLUGIN:mx6dl-nxp-bsp ?= "imx-gst1.0-plugin" @@ -292,6 +289,9 @@ KERNEL_IMAGETYPE:aarch64 = "Image.gz" MACHINE_FEATURES = "usbgadget usbhost vfat alsa touchscreen" +# IMX specific udev extra rules added when device manager is systemd/udev +UDEV_EXTRA_RULES:append = " udev-rules-imx" + # Add a generic gstreamer distro feature for all IMX platforms DISTRO_FEATURES:append = " gstreamer" From c30b9474088da05d99c4b7b33347facf84f97596 Mon Sep 17 00:00:00 2001 From: Isaac Hermida Date: Tue, 14 Mar 2023 09:24:17 +0100 Subject: [PATCH 007/100] kernel-module-qualcomm: add script to load the wlan module In rare cases, the wlan module may fail to load. In this scenario, forcing the MMC driver to rebind the interface resolves the issue, making the WLAN module load more reliably. This only affects to modules where the qca chip is connected through the MMC interface. https://onedigi.atlassian.net/browse/DEL-8361 Signed-off-by: Isaac Hermida --- .../kernel-module-qualcomm.bb | 10 +++- .../kernel-module-qualcomm/81-qcom-wifi.rules | 2 +- .../kernel-module-qualcomm/qualcomm.sh | 55 +++++++++++++++++++ 3 files changed, 65 insertions(+), 2 deletions(-) create mode 100644 meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/qualcomm.sh diff --git a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm.bb b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm.bb index 4d8d6d7a1..2f778854d 100644 --- a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm.bb +++ b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm.bb @@ -1,4 +1,4 @@ -# Copyright (C) 2016-2022 Digi International. +# Copyright (C) 2016-2023 Digi International. SUMMARY = "Qualcomm's wireless driver for qca65xx" DESCRIPTION = "qcacld-2.0 module" @@ -32,6 +32,7 @@ FILES_SDIO_CCX = " \ FILES_SDIO = " \ file://modprobe-qualcomm.conf \ + file://qualcomm.sh \ ${@oe.utils.vartrue('QUALCOMM_FW_CCX_TAGS', '${FILES_SDIO_CCX}', '', d)} \ " @@ -63,10 +64,17 @@ do_compile:prepend() { export BUILD_VER=${PV} } + +MMC_NODE ?= "30b40000.mmc" +MMC_NODE:ccimx6ul = "2190000.mmc" + do_install:append() { if [ "${QUALCOMM_WIFI_INTERFACE}" = "sdio" ]; then install -d ${D}${sysconfdir}/modprobe.d install -m 0644 ${WORKDIR}/modprobe-qualcomm.conf ${D}${sysconfdir}/modprobe.d/qualcomm.conf + install -d ${D}${sysconfdir}/udev/scripts + install -m 0755 ${WORKDIR}/qualcomm.sh ${D}${sysconfdir}/udev/scripts/ + sed -i -e "s/##NODE##/${MMC_NODE}/g" ${D}${sysconfdir}/udev/scripts/qualcomm.sh fi install -d ${D}${base_libdir}/firmware/wlan/ diff --git a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/81-qcom-wifi.rules b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/81-qcom-wifi.rules index 92706c426..6d505c56a 100644 --- a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/81-qcom-wifi.rules +++ b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/81-qcom-wifi.rules @@ -1,4 +1,4 @@ # Load Qualcomm wireless module (sdio) -SUBSYSTEM=="sdio", ACTION=="add", ENV{MODALIAS}=="sdio:c00v0271d050A", RUN="/sbin/modprobe wlan" +SUBSYSTEM=="sdio", ACTION=="add", ENV{MODALIAS}=="sdio:c00v0271d050A", RUN="/etc/udev/scripts/qualcomm.sh" # Load Qualcomm wireless module (pci) SUBSYSTEM=="pci", ACTION=="add", ENV{MODALIAS}=="pci:v0000168Cd0000003Esv*sd*bc*sc*i*", RUN="/sbin/modprobe wlan" diff --git a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/qualcomm.sh b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/qualcomm.sh new file mode 100644 index 000000000..e53c799fb --- /dev/null +++ b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/qualcomm.sh @@ -0,0 +1,55 @@ +#!/bin/sh +# +# Copyright (c) 2023 Digi International Inc. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at http://mozilla.org/MPL/2.0/. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +# + +MMC_NODE="##NODE##" + +# At this point of the boot (udev script), the system log (syslog) is not +# available yet, so use the kernel log buffer from userspace. +log() { + printf "<$1>qca65x4: $2\n" >/dev/kmsg +} + +# Force re-detection of the mmc node +rebind_mmc_node() { + DRIVER_NODE=$(find /sys/bus/platform/drivers -name ${MMC_NODE} | xargs dirname 2> /dev/null) || return 1 + echo ${MMC_NODE} > ${DRIVER_NODE}/unbind + # Give some time to the mmc driver to re-detect the MMC node in order to re-initialize it. + sleep 2 + echo ${MMC_NODE} > ${DRIVER_NODE}/bind +} + +load_and_check() { + modprobe wlan + [ -d "/sys/class/net/wlan0" ] && return 0 || return 1 +} + +# Do nothing if the wireless node does not exist on the device tree +[ -d "/proc/device-tree/wireless" ] || exit 0 + +# Do nothing if the module is already loaded +grep -qws 'wlan' /proc/modules && exit 0 + +load_and_check && log "3" "[INFO] wlan module loaded" && exit 0 + +# If we are here, the load has failed. Retry. +log "3" "[WARN] Loading wlan module failed, retrying..." + +# Try by re-binding the mmc node. +rebind_mmc_node && load_and_check && log "3" "[INFO] wlan module loaded" && exit 0 + +log "3" "[ERROR] Loading wlan module" +exit 1 From c01c3948066ef73e3c46d3ff8554640916d6404e Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Wed, 22 Mar 2023 11:46:53 +0100 Subject: [PATCH 008/100] meta-digi: rework distro features configuration Instead of changing POKY_DEFAULT_DISTRO_FEATURES, do the distro features configuration directly in the DISTRO_FEATURES variable. Also, add a couple of variables (MACHINE_DISTRO_FEATURES_ADD/REMOVE) that allow machines for extra tweaking the distro features. While on it, clean up some distro features: - pulseaudio: already added by DISTRO_FEATURES_BACKFILL - bluez5, splashscreen, initrd, gplv3: not used (dead code) Signed-off-by: Javier Viguera --- meta-digi-arm/conf/machine/ccmp13-dvk.conf | 26 ++------------- meta-digi-arm/conf/machine/ccmp15-dvk.conf | 33 ++----------------- meta-digi-arm/conf/machine/include/ccimx6.inc | 5 ++- .../conf/machine/include/ccimx6ul.inc | 3 ++ .../conf/machine/include/ccimx8m.inc | 4 --- .../conf/machine/include/ccimx8x.inc | 4 --- .../conf/machine/include/ccimx93.inc | 4 +-- .../conf/machine/include/imx-digi-base.inc | 3 -- meta-digi-dey/conf/distro/dey.conf | 13 ++++---- 9 files changed, 20 insertions(+), 75 deletions(-) diff --git a/meta-digi-arm/conf/machine/ccmp13-dvk.conf b/meta-digi-arm/conf/machine/ccmp13-dvk.conf index 957c25b07..312cade48 100644 --- a/meta-digi-arm/conf/machine/ccmp13-dvk.conf +++ b/meta-digi-arm/conf/machine/ccmp13-dvk.conf @@ -144,29 +144,9 @@ XBEE_TTY ?= "ttySTM2" # ========================================================================= ALSA_LIST = "" -# ========================================================================= -# DISTRO features -# ========================================================================= -DISTRO_FEATURES:remove = " opengl " -DISTRO_FEATURES:remove = " x11 " - -# add support of optee -DISTRO_FEATURES:append = " optee " - -# add support of splashscreen -#DISTRO_FEATURES:append = " splashscreen " - -# add support of systemd -DISTRO_FEATURES:append = " systemd " - -# add support of efi -DISTRO_FEATURES:append = " efi " - -# add support of InitRD installation package -DISTRO_FEATURES:append = " initrd " - -# add support to pulseaudio -DISTRO_FEATURES:append = "pulseaudio" +# Per-machine DISTRO_FEATURES customization +MACHINE_DISTRO_FEATURES_ADD = "efi optee" +MACHINE_DISTRO_FEATURES_REMOVE = "gstreamer opengl vulkan wayland x11" # Disable use of vendorfs partition ST_VENDORFS = "0" diff --git a/meta-digi-arm/conf/machine/ccmp15-dvk.conf b/meta-digi-arm/conf/machine/ccmp15-dvk.conf index 6b41a8368..4167d6ef5 100644 --- a/meta-digi-arm/conf/machine/ccmp15-dvk.conf +++ b/meta-digi-arm/conf/machine/ccmp15-dvk.conf @@ -148,36 +148,9 @@ XBEE_TTY ?= "ttySTM2" # ========================================================================= ALSA_LIST = "" -# ========================================================================= -# DISTRO features -# ========================================================================= -DISTRO_FEATURES:append = " opengl" -DISTRO_FEATURES:remove = " x11 " -DISTRO_FEATURES:append = " gplv3 " - -# add support of gstreamer -DISTRO_FEATURES:append = " gstreamer " - -# add support of optee -DISTRO_FEATURES:append = " optee " - -# add support of splashscreen -DISTRO_FEATURES:append = " splashscreen " - -# add support of wayland -DISTRO_FEATURES:append = " wayland pam " - -# add support of systemd -DISTRO_FEATURES:append = " systemd " - -# add support of efi -DISTRO_FEATURES:append = " efi " - -# add support of InitRD installation package -DISTRO_FEATURES:append = " initrd " - -# add support to pulseaudio -DISTRO_FEATURES:append = "pulseaudio" +# Per-machine DISTRO_FEATURES customization +MACHINE_DISTRO_FEATURES_ADD = "efi optee" +MACHINE_DISTRO_FEATURES_REMOVE = "vulkan x11" # Disable use of vendorfs partition ST_VENDORFS = "0" diff --git a/meta-digi-arm/conf/machine/include/ccimx6.inc b/meta-digi-arm/conf/machine/include/ccimx6.inc index 23f07ccb0..38882221d 100644 --- a/meta-digi-arm/conf/machine/include/ccimx6.inc +++ b/meta-digi-arm/conf/machine/include/ccimx6.inc @@ -33,9 +33,8 @@ MACHINE_FEATURES += "accel-graphics wifi bluetooth pci" # TrustFence TRUSTFENCE_SIGN_MODE = "HAB" -# Adding 'wayland' along with 'x11' enables the xwayland backend -# Adding pam is required for SELinux functionality -DISTRO_FEATURES:append = " wayland pam" +# Per-machine DISTRO_FEATURES customization +MACHINE_DISTRO_FEATURES_REMOVE = "vulkan" # SWUpdate sw-description configuration BOOTFS_EXT ?= ".boot.vfat" diff --git a/meta-digi-arm/conf/machine/include/ccimx6ul.inc b/meta-digi-arm/conf/machine/include/ccimx6ul.inc index d3d18ed42..91c661949 100644 --- a/meta-digi-arm/conf/machine/include/ccimx6ul.inc +++ b/meta-digi-arm/conf/machine/include/ccimx6ul.inc @@ -47,6 +47,9 @@ MKUBIFS_ARGS ?= "-m 2048 -e 126976 -c 8191" # TrustFence TRUSTFENCE_SIGN_MODE = "HAB" +# Per-machine DISTRO_FEATURES customization +MACHINE_DISTRO_FEATURES_REMOVE = "vulkan wayland" + # SWUpdate sw-description configuration BOOTFS_EXT ?= ".boot.ubifs" ROOTFS_EXT ?= '${@bb.utils.contains("IMAGE_FEATURES", "read-only-rootfs", ".squashfs", ".ubifs", d)}' diff --git a/meta-digi-arm/conf/machine/include/ccimx8m.inc b/meta-digi-arm/conf/machine/include/ccimx8m.inc index 5d7b62240..b16546ddf 100644 --- a/meta-digi-arm/conf/machine/include/ccimx8m.inc +++ b/meta-digi-arm/conf/machine/include/ccimx8m.inc @@ -52,10 +52,6 @@ MACHINE_FEATURES += "accel-graphics wifi bluetooth cryptochip mca optee" # TrustFence TRUSTFENCE_SIGN_MODE = "HAB" -# Adding 'wayland' along with 'x11' enables the xwayland backend -# Vulkan is necessary for wayland to build -DISTRO_FEATURES:append = " wayland vulkan systemd pam" - # SWUpdate sw-description configuration BOOTFS_EXT ?= ".boot.vfat" ROOTFS_EXT ?= ".ext4.gz" diff --git a/meta-digi-arm/conf/machine/include/ccimx8x.inc b/meta-digi-arm/conf/machine/include/ccimx8x.inc index 4a18f5d11..de3e67177 100644 --- a/meta-digi-arm/conf/machine/include/ccimx8x.inc +++ b/meta-digi-arm/conf/machine/include/ccimx8x.inc @@ -69,10 +69,6 @@ MACHINE_FEATURES += "accel-graphics wifi bluetooth cryptochip pci mca" # TrustFence TRUSTFENCE_SIGN_MODE = "AHAB" -# Adding 'wayland' along with 'x11' enables the xwayland backend -# Vulkan is necessary for wayland to build -DISTRO_FEATURES:append = " wayland vulkan systemd pam" - # SWUpdate sw-description configuration BOOTFS_EXT ?= ".boot.vfat" ROOTFS_EXT ?= ".ext4.gz" diff --git a/meta-digi-arm/conf/machine/include/ccimx93.inc b/meta-digi-arm/conf/machine/include/ccimx93.inc index 55243d83a..92559f51a 100644 --- a/meta-digi-arm/conf/machine/include/ccimx93.inc +++ b/meta-digi-arm/conf/machine/include/ccimx93.inc @@ -62,8 +62,8 @@ BT_TTY ?= "ttyLP0" # Add additional firmware MACHINE_FIRMWARE:append = " ethos-u-firmware" -# Adding 'wayland' along with 'x11' enables the xwayland backend -DISTRO_FEATURES:append = " wayland pam" +# Per-machine DISTRO_FEATURES customization +MACHINE_DISTRO_FEATURES_REMOVE = "vulkan" # SWUpdate sw-description configuration BOOTFS_EXT ?= ".boot.vfat" diff --git a/meta-digi-arm/conf/machine/include/imx-digi-base.inc b/meta-digi-arm/conf/machine/include/imx-digi-base.inc index e0492d86a..71f58f7bc 100644 --- a/meta-digi-arm/conf/machine/include/imx-digi-base.inc +++ b/meta-digi-arm/conf/machine/include/imx-digi-base.inc @@ -292,9 +292,6 @@ MACHINE_FEATURES = "usbgadget usbhost vfat alsa touchscreen" # IMX specific udev extra rules added when device manager is systemd/udev UDEV_EXTRA_RULES:append = " udev-rules-imx" -# Add a generic gstreamer distro feature for all IMX platforms -DISTRO_FEATURES:append = " gstreamer" - # U-Boot 2017.X requires a specific dtc version. PREFERRED_VERSION_dtc-native:ccimx6 ?= "1.4.5" PREFERRED_VERSION_nativesdk-dtc:ccimx6 ?= "1.4.5" diff --git a/meta-digi-dey/conf/distro/dey.conf b/meta-digi-dey/conf/distro/dey.conf index 227a01230..eab3cf9bf 100644 --- a/meta-digi-dey/conf/distro/dey.conf +++ b/meta-digi-dey/conf/distro/dey.conf @@ -10,15 +10,16 @@ MAINTAINER = "Digi Support " TARGET_VENDOR = "-dey" -POKY_DEFAULT_DISTRO_FEATURES = "largefile opengl ptest multiarch wayland bluez5 cellular" POKY_DEFAULT_EXTRA_RDEPENDS = "packagegroup-dey-core" POKY_DEFAULT_EXTRA_RRECOMMENDS = "" -# Removed DISTRO_FEATURES -# 'wayland' -> only supported on the i.MX8 QXP -# 'ptest' -> fails to build QT5 toolchain -DISTRO_FEATURES_DEFAULT:remove = "3g nfc nfs zeroconf" -POKY_DEFAULT_DISTRO_FEATURES:remove = "ptest wayland" +# +# Rework distro features for DEY distribution +# +MACHINE_DISTRO_FEATURES_ADD ?= "" +MACHINE_DISTRO_FEATURES_REMOVE ?= "" +DISTRO_FEATURES:append = " cellular gstreamer pam ${MACHINE_DISTRO_FEATURES_ADD}" +DISTRO_FEATURES:remove = "3g nfc nfs ptest zeroconf ${MACHINE_DISTRO_FEATURES_REMOVE}" GRAPHICAL_BACKEND = "${@bb.utils.contains('DISTRO_FEATURES', 'x11 wayland', 'xwayland', \ bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', \ From 800e875397961ade4e5bcbf91e9022252742bbec Mon Sep 17 00:00:00 2001 From: Francisco Gil Date: Tue, 21 Mar 2023 15:14:53 +0100 Subject: [PATCH 009/100] pulseaudio: keep the PID file in headless system Without the PIDfile pulseaudio is not reliable. https://onedigi.atlassian.net/browse/DEL-8429 https://onedigi.atlassian.net/browse/DEL-6795 Signed-off-by: Francisco Gil --- .../recipes-multimedia/pulseaudio/pulseaudio_%.bbappend | 5 ----- 1 file changed, 5 deletions(-) diff --git a/meta-digi-dey/recipes-multimedia/pulseaudio/pulseaudio_%.bbappend b/meta-digi-dey/recipes-multimedia/pulseaudio/pulseaudio_%.bbappend index aa748cf1a..615de1021 100644 --- a/meta-digi-dey/recipes-multimedia/pulseaudio/pulseaudio_%.bbappend +++ b/meta-digi-dey/recipes-multimedia/pulseaudio/pulseaudio_%.bbappend @@ -91,11 +91,6 @@ do_install:append() { install -d ${D}${systemd_unitdir}/system install -m 0644 ${WORKDIR}/pulseaudio-system.service ${D}/${systemd_unitdir}/system - # Remove pid file entry for non-graphical backend - if [ "${IS_HEADLESS}" = "true" ]; then - sed -i -e "/PIDFile/d" ${D}/${systemd_unitdir}/system/pulseaudio-system.service - fi - # Configuration files for HDMI sound card if [ "${AUDIO_HDMI}" = "yes" ]; then install -d ${D}${sysconfdir}/udev/scripts From a7833a380cfe230e72796e2013f8b4ee7e0d3a8d Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Wed, 22 Mar 2023 17:09:51 +0100 Subject: [PATCH 010/100] README: fix cc6ul supported platforms - Add missing PNs and order list as per Digi website. - Remove SBC Express, which is not available for purchase. Reported-by: Leonid Makhnovskiy Signed-off-by: Hector Palacios (cherry picked from commit 4f1bbf4d2d587ae68943a357620b56680438ea6d) --- README.md | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index b2f4b66f8..ae998192d 100644 --- a/README.md +++ b/README.md @@ -55,19 +55,18 @@ Software for the following hardware platforms is in production support: ## ConnectCore 6UL * ConnectCore 6UL System-on-Module (SOM) - * [CC-WMX-JN58-NE](https://www.digi.com/products/models/cc-wmx-jn58-ne) - * [CC-MX-JN58-Z1](https://www.digi.com/products/models/cc-mx-jn58-z1) - * CC-WMX-JN7A-NE - * [CC-WMX-JN7A-CBX](https://www.digi.com/products/models/cc-wmx-jn7a-cbx) - * [CC-WMX-JN68-NN](https://www.digi.com/products/models/cc-wmx-jn68-nn) + * [CC-WMX-JN7A-NE](https://www.digi.com/products/models/cc-wmx-jn7a-ne) * [CC-WMX-JN69-NN](https://www.digi.com/products/models/cc-wmx-jn69-nn) - * [CC-MX-JN69-ZN](hhtps://www.digi.com/products/models/cc-mx-jn69-zn) -* ConnectCore 6UL SBC Express - * [CC-WMX6UL-START](https://www.digi.com/products/models/cc-wmx6ul-start) ([Get Started](https://www.digi.com/resources/documentation/digidocs/embedded/dey/4.0/cc6ul/yocto-gs_index)) - * [CC-SBE-WMX-JN58](https://www.digi.com/products/models/cc-sbe-wmx-jn58) + * [CC-WMX-JN59-NN](https://www.digi.com/products/models/cc-wmx-jn59-nn) + * [CC-WMX-JN58-NE](https://www.digi.com/products/models/cc-wmx-jn58-ne) + * [CC-MX-JN7A-Z1](https://www.digi.com/products/models/cc-mx-jn7a-z1) + * [CC-MX-JN69-ZN](https://www.digi.com/products/models/cc-mx-jn69-zn) + * [CC-MX-JN58-Z1](https://www.digi.com/products/models/cc-mx-jn58-z1) + * ConnectCore 6UL SBC Pro * [CC-WMX6UL-KIT](https://www.digi.com/products/models/cc-wmx6ul-kit) ([Get Started](https://www.digi.com/resources/documentation/digidocs/embedded/dey/4.0/cc6ul/yocto-gs_index)) * [CC-SBP-WMX-JN58](https://www.digi.com/products/models/cc-sbp-wmx-jn58) + * [CC-SBP-WMX-JN7A](https://www.digi.com/products/models/cc-sbp-wmx-jn7a) # Installation From 4200b2f06ae677608ff3c5c6eb460cde3803f831 Mon Sep 17 00:00:00 2001 From: Isaac Hermida Date: Fri, 24 Mar 2023 13:29:11 +0100 Subject: [PATCH 011/100] add nxp-wlan-sdk and kernel-module-nxp-wlan NXP verbatim copies add a verbatim copy of those recipes as they are provided by nxp in langdale-6.1.1-1.0.0 https://onedigi.atlassian.net/browse/DEL-8346 Signed-off-by: Isaac Hermida --- .../nxp-wlan-sdk/nxp-wlan-sdk_git.inc | 15 +++++++++++++++ .../kernel-modules/kernel-module-nxp-wlan.bb | 7 +++++++ 2 files changed, 22 insertions(+) create mode 100644 meta-digi-arm/recipes-connectivity/nxp-wlan-sdk/nxp-wlan-sdk_git.inc create mode 100644 meta-digi-arm/recipes-kernel/kernel-modules/kernel-module-nxp-wlan.bb diff --git a/meta-digi-arm/recipes-connectivity/nxp-wlan-sdk/nxp-wlan-sdk_git.inc b/meta-digi-arm/recipes-connectivity/nxp-wlan-sdk/nxp-wlan-sdk_git.inc new file mode 100644 index 000000000..0e92104db --- /dev/null +++ b/meta-digi-arm/recipes-connectivity/nxp-wlan-sdk/nxp-wlan-sdk_git.inc @@ -0,0 +1,15 @@ +SUMMARY = "NXP Wi-Fi SDK for module 88w8801/8987/8997/9098 and IW416/612" +LICENSE = "GPL-2.0-only" +LIC_FILES_CHKSUM = "file://${WORKDIR}/git/LICENSE;md5=ab04ac0f249af12befccb94447c08b77" + +# For Kernel 5.4 and later +SRCBRANCH = "lf-6.1.1_1.0.0" +MRVL_SRC ?= "git://github.com/nxp-imx/mwifiex.git;protocol=https" +SRC_URI = "${MRVL_SRC};branch=${SRCBRANCH}" +SRCREV = "98e5b28b1a7afea9dbded4067e93bfd584531a79" + +S = "${WORKDIR}/git/mxm_wifiex/wlan_src" + +EXTRA_OEMAKE = "KERNELDIR=${STAGING_KERNEL_BUILDDIR}" + +RDEPENDS:${PN} = "wireless-tools" diff --git a/meta-digi-arm/recipes-kernel/kernel-modules/kernel-module-nxp-wlan.bb b/meta-digi-arm/recipes-kernel/kernel-modules/kernel-module-nxp-wlan.bb new file mode 100644 index 000000000..8cdab4e7b --- /dev/null +++ b/meta-digi-arm/recipes-kernel/kernel-modules/kernel-module-nxp-wlan.bb @@ -0,0 +1,7 @@ +require recipes-connectivity/nxp-wlan-sdk/nxp-wlan-sdk_git.inc + +SUMMARY = "Kernel loadable module for NXP Wi-Fi module 88w8801/8987/8997/9098 IW416/612" + +inherit module + +EXTRA_OEMAKE += "-C ${STAGING_KERNEL_BUILDDIR} M=${S}" From 38831535fbab2364d1e7148c8c76cf3360d28806 Mon Sep 17 00:00:00 2001 From: Isaac Hermida Date: Tue, 29 Nov 2022 18:38:18 +0100 Subject: [PATCH 012/100] ccimx93: iw612: add WiFi support https://onedigi.atlassian.net/browse/DEL-8346 Signed-off-by: Isaac Hermida --- .../firmware-imx/firmware-nxp-wifi_%.bbappend | 16 ++++++++ .../kernel-module-nxp-wlan.bbappend | 22 ++++++++++ .../81-iw612-wifi.rules | 2 + .../kernel-module-nxp-wlan/load_iw612.sh | 40 +++++++++++++++++++ 4 files changed, 80 insertions(+) create mode 100644 meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/firmware-imx/firmware-nxp-wifi_%.bbappend create mode 100644 meta-digi-arm/recipes-kernel/kernel-modules/kernel-module-nxp-wlan.bbappend create mode 100644 meta-digi-arm/recipes-kernel/kernel-modules/kernel-module-nxp-wlan/81-iw612-wifi.rules create mode 100644 meta-digi-arm/recipes-kernel/kernel-modules/kernel-module-nxp-wlan/load_iw612.sh diff --git a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/firmware-imx/firmware-nxp-wifi_%.bbappend b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/firmware-imx/firmware-nxp-wifi_%.bbappend new file mode 100644 index 000000000..90c602bf2 --- /dev/null +++ b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/firmware-imx/firmware-nxp-wifi_%.bbappend @@ -0,0 +1,16 @@ +# Copyright (C) 2023 Digi International. + +LIC_FILES_CHKSUM:ccimx93 = "file://EULA.txt;md5=add2d392714d3096ed7e0f7e2190724b" + +SRCBRANCH:ccimx93 = "lf-6.1.1_1.0.0" +SRCREV:ccimx93 = "bacbeb4789c1b13d13aab12ada29217ce8c3e905" + +do_install:append:ccimx93() { + install -m 444 ${S}/nxp/FwImage_IW612_SD/sduart_nw61x_v1.bin.se ${D}${base_libdir}/firmware/nxp +} + +PACKAGES:prepend:ccimx93 = "${PN}-nxpiw612 " + +FILES:${PN}-nxpiw612 = " \ + ${base_libdir}/firmware/nxp/sduart_nw61x_v1.bin.se \ +" diff --git a/meta-digi-arm/recipes-kernel/kernel-modules/kernel-module-nxp-wlan.bbappend b/meta-digi-arm/recipes-kernel/kernel-modules/kernel-module-nxp-wlan.bbappend new file mode 100644 index 000000000..e1a0c245a --- /dev/null +++ b/meta-digi-arm/recipes-kernel/kernel-modules/kernel-module-nxp-wlan.bbappend @@ -0,0 +1,22 @@ +# Copyright (C) 2023 Digi International. + +FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}:" + +SRC_URI:append = " \ + file://81-iw612-wifi.rules \ + file://load_iw612.sh \ +" + +do_install:append () { + install -d ${D}${sysconfdir}/udev/rules.d + install -m 0644 ${WORKDIR}/81-iw612-wifi.rules ${D}${sysconfdir}/udev/rules.d/ + install -d ${D}${sysconfdir}/udev/scripts + install -m 0777 ${WORKDIR}/load_iw612.sh ${D}${sysconfdir}/udev/scripts/ +} + +FILES:${PN}:append = " \ + ${sysconfdir}/udev/rules.d \ + ${sysconfdir}/udev/scripts \ +" + +RDEPENDS:${PN}:remove = "wireless-tools" diff --git a/meta-digi-arm/recipes-kernel/kernel-modules/kernel-module-nxp-wlan/81-iw612-wifi.rules b/meta-digi-arm/recipes-kernel/kernel-modules/kernel-module-nxp-wlan/81-iw612-wifi.rules new file mode 100644 index 000000000..bf7b0e977 --- /dev/null +++ b/meta-digi-arm/recipes-kernel/kernel-modules/kernel-module-nxp-wlan/81-iw612-wifi.rules @@ -0,0 +1,2 @@ +# Load IW612 wireless module (sdio) +SUBSYSTEM=="sdio", ACTION=="add", ENV{MODALIAS}=="sdio:c00v0471d0205", RUN="/etc/udev/scripts/load_iw612.sh" diff --git a/meta-digi-arm/recipes-kernel/kernel-modules/kernel-module-nxp-wlan/load_iw612.sh b/meta-digi-arm/recipes-kernel/kernel-modules/kernel-module-nxp-wlan/load_iw612.sh new file mode 100644 index 000000000..e34e4804b --- /dev/null +++ b/meta-digi-arm/recipes-kernel/kernel-modules/kernel-module-nxp-wlan/load_iw612.sh @@ -0,0 +1,40 @@ +#!/bin/sh + +# The bit settings of drv_mode are: +# Bit 0 : STA +# Bit 1 : uAP +# Bit 2 : WIFIDIRECT +# eg, for STA + uAP + WIFIDIRECT, set 7 (b'111) +DRIVER_MODE=1 # Only STA + +# MREG_D(00000200), MERROR(00000004),MFATAL(00000002) +DRIVER_DEBUG="0x206" + +MOAL_PARAMS=" \ +cfg80211_wext=0xf \ +max_vir_bss=1 \ +cal_data_cfg=none \ +ps_mode=1 \ +auto_ds=1 \ +host_mlme=1 \ +drv_mode=${DRIVER_MODE} \ +drvdbg=${DRIVER_DEBUG} \ +fw_name=nxp/sduart_nw61x_v1.bin.se\ +" + +log() { + printf "<3>iw612-wifi: $1\n" >/dev/kmsg +} + +if ! [ -e "/proc/device-tree/wireless/mac-address" ]; then + log "[ERROR] wireless mac-address not found" + exit 1 +fi + +WLANADDR=$(hexdump -ve '1/1 "%02X" ":"' /proc/device-tree/wireless/mac-address 2>/dev/null | sed 's/:$//g') +modprobe mlan && \ +modprobe moal ${MOAL_PARAMS} mac_addr=${WLANADDR} && \ +log "Wi-Fi activated" && exit 0 + +log "[ERROR] cannot load Wi-Fi driver" +exit 1 From 66fb6e55c181fc0ae9a2c450f6bd45f8bb0c74f0 Mon Sep 17 00:00:00 2001 From: Isaac Hermida Date: Fri, 17 Feb 2023 12:48:18 +0100 Subject: [PATCH 013/100] ccimx93: iw612: add bluetooth support The bluetooth FW for the IW612 is loaded together with WiFi FW, so there is not BT FW file as in our other products. In order to use the BT, it is a requirement to load the WiFi FW, so ensure that the service is started after the load of the system modules. https://onedigi.atlassian.net/browse/DEL-8346 Signed-off-by: Isaac Hermida --- .../recipes-connectivity/bluez/bluez5-init.bb | 7 +- .../bluez/bluez5-init/ccimx93/bluetooth-init | 70 +++++++++++++++++++ .../ccimx93/bluetooth-init.service | 13 ++++ 3 files changed, 88 insertions(+), 2 deletions(-) create mode 100644 meta-digi-dey/recipes-connectivity/bluez/bluez5-init/ccimx93/bluetooth-init create mode 100644 meta-digi-dey/recipes-connectivity/bluez/bluez5-init/ccimx93/bluetooth-init.service diff --git a/meta-digi-dey/recipes-connectivity/bluez/bluez5-init.bb b/meta-digi-dey/recipes-connectivity/bluez/bluez5-init.bb index a6cd7ee41..f5df5aa02 100644 --- a/meta-digi-dey/recipes-connectivity/bluez/bluez5-init.bb +++ b/meta-digi-dey/recipes-connectivity/bluez/bluez5-init.bb @@ -1,4 +1,4 @@ -# Copyright (C) 2022, Digi International Inc. +# Copyright (C) 2022-2023, Digi International Inc. SUMMARY = "Bluetooth init scripts" LICENSE = "GPL-2.0-only" @@ -58,5 +58,8 @@ SYSTEMD_SERVICE:${PN} = "bluetooth-init.service" # 'bluetooth-init' script uses '/etc/init.d/functions' RDEPENDS:${PN} = "initscripts-functions" +# IW61x Bluetooth support requires the WiFi FW support +RDEPENDS:${PN}:append:ccimx93 = " firmware-nxp-wifi-nxpiw612" + PACKAGE_ARCH = "${MACHINE_ARCH}" -COMPATIBLE_MACHINE = "(ccimx6$|ccimx6ul|ccimx8x|ccimx8mn|ccimx8mm)" +COMPATIBLE_MACHINE = "(ccimx6$|ccimx6ul|ccimx8x|ccimx8mn|ccimx8mm|ccimx93)" diff --git a/meta-digi-dey/recipes-connectivity/bluez/bluez5-init/ccimx93/bluetooth-init b/meta-digi-dey/recipes-connectivity/bluez/bluez5-init/ccimx93/bluetooth-init new file mode 100644 index 000000000..6ceda69b4 --- /dev/null +++ b/meta-digi-dey/recipes-connectivity/bluez/bluez5-init/ccimx93/bluetooth-init @@ -0,0 +1,70 @@ +#!/bin/sh +#=============================================================================== +# +# Copyright (C) 2023 by Digi International Inc. +# All rights reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 as published by +# the Free Software Foundation. +# +# +# !Description: Initialize bluetooth hardware +# +#=============================================================================== + +HCI_IFACE="hci0" + +log() { + printf "<3>iw612-bluetooth: %s\n" "${1}" >/dev/kmsg +} + +bluetooth_start() { + if ! [ -e "/proc/device-tree/bluetooth/mac-address" ]; then + log "[ERROR] Bluetooth mac-address not found" + return + fi + + BTADDR=$(hexdump -ve '1/1 "%02X" ":"' /proc/device-tree/bluetooth/mac-address 2>/dev/null | sed 's/:$//g') + hciattach -t5 /dev/ttyBt any 115200 flow nosleep "${BTADDR}" && \ + hciconfig ${HCI_IFACE} up && \ + sleep 0.2 && \ + hcitool -i ${HCI_IFACE} cmd 0x3f 0x0009 0xc0 0xc6 0x2d 0x00 && \ + sleep 0.2 && \ + killall hciattach && \ + sleep 0.2 && \ + hciattach -t5 /dev/ttyBt any -s 3000000 3000000 flow && \ + log "Bluetooth activated" && return + + log "[ERROR] Cannot initialize Bluetooth" + return 1 +} + +bluetooth_stop() { + if [ -e "/sys/class/bluetooth/${HCI_IFACE}" ]; then + # hci reset command + hcitool -i ${HCI_IFACE} cmd 0x03 0x0003 + sleep 0.2 + # set baudrate to 115200 + hcitool -i ${HCI_IFACE} cmd 0x3f 0x0009 0x00 0xc2 0x01 0x00 + killall hciattach + fi +} + +case "$1" in + start) + bluetooth_start + ;; + stop) + bluetooth_stop + ;; + restart) + $0 stop + sleep 1 + $0 start + ;; + *) + echo "Usage: $0 {start|stop|restart}" + exit 1 + ;; +esac diff --git a/meta-digi-dey/recipes-connectivity/bluez/bluez5-init/ccimx93/bluetooth-init.service b/meta-digi-dey/recipes-connectivity/bluez/bluez5-init/ccimx93/bluetooth-init.service new file mode 100644 index 000000000..9fbfc8b1e --- /dev/null +++ b/meta-digi-dey/recipes-connectivity/bluez/bluez5-init/ccimx93/bluetooth-init.service @@ -0,0 +1,13 @@ +[Unit] +Description=Initialization of the IW612 bluetooth chip +ConditionPathIsDirectory=/proc/device-tree/bluetooth +Before=bluetooth.service +After=systemd-modules-load.service + +[Service] +Type=forking +ExecStart=/etc/bluetooth-init start +ExecStop=/etc/bluetooth-init stop + +[Install] +WantedBy=bluetooth.service From 060e2f4fe10369b78ff50e66cdb783d0600f91dd Mon Sep 17 00:00:00 2001 From: Isaac Hermida Date: Fri, 17 Feb 2023 13:01:56 +0100 Subject: [PATCH 014/100] ccimx93-dvk.conf: include WiFi and BT features support https://onedigi.atlassian.net/browse/DEL-8346 --- meta-digi-arm/conf/machine/ccimx93-dvk.conf | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/meta-digi-arm/conf/machine/ccimx93-dvk.conf b/meta-digi-arm/conf/machine/ccimx93-dvk.conf index d446b5082..208979841 100644 --- a/meta-digi-arm/conf/machine/ccimx93-dvk.conf +++ b/meta-digi-arm/conf/machine/ccimx93-dvk.conf @@ -17,8 +17,15 @@ KERNEL_DEVICETREE ?= " \ digi/_ov_som_wifi_ccimx93.dtbo \ " -# Remove additional bluetooth packages -MACHINE_BLUETOOTH_EXTRA_INSTALL = "" +# Wireless external module +WIRELESS_MODULE ?= "" +WIRELESS_MODULE:append = " ${@oe.utils.conditional('HAVE_WIFI', '1', 'kernel-module-nxp-wlan', '', d)}" +HAS_WIFI_VIRTWLANS = "false" + +# Machine firmware +MACHINE_FIRMWARE:append = " ${@oe.utils.conditional('HAVE_WIFI', '1', 'firmware-nxp-wifi-nxpiw612', '', d)}" + +MACHINE_EXTRA_RRECOMMENDS += "${WIRELESS_MODULE}" IMAGE_BOOT_FILES:append:use-nxp-bsp = " \ imx93_m33_TCM_rpmsg_lite_pingpong_rtos_linux_remote.bin \ From bf88deb602304364d4e93329e2808b526c9774e0 Mon Sep 17 00:00:00 2001 From: David Escalona Date: Fri, 24 Mar 2023 12:29:05 +0100 Subject: [PATCH 015/100] mount_digiparts.sh: add unit running check for systemd devices For devices running 'systemd', the mount process is done through 'systemd-mount', which spawns a system unit. Trying to mount the partition again throws an error stating that a unit with the same name is already running. To avoid it, check if the unit is already spawned before mounting the partition and, if so, just restart the unit. Signed-off-by: David Escalona --- .../udev/udev-extraconf/mount_digiparts.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/meta-digi-arm/recipes-core/udev/udev-extraconf/mount_digiparts.sh b/meta-digi-arm/recipes-core/udev/udev-extraconf/mount_digiparts.sh index bf07cce48..6ee14c63a 100644 --- a/meta-digi-arm/recipes-core/udev/udev-extraconf/mount_digiparts.sh +++ b/meta-digi-arm/recipes-core/udev/udev-extraconf/mount_digiparts.sh @@ -53,6 +53,16 @@ fi if [ "x$BASE_INIT" = "x$INIT_SYSTEMD" ];then # systemd as init uses systemd-mount to mount block devices + + # Verify if unit is already launched, if so just restart it. + if systemctl | grep -q "mnt-${PARTNAME}.mount"; then + if ! systemctl restart "mnt-${PARTNAME}.mount"; then + logger -t udev "ERROR: Could not mount '${DEVNAME}'" + exit 1 + fi + exit 0 + fi + MOUNT="/usr/bin/systemd-mount" MOUNT_PARAMS="${MOUNT_PARAMS} --no-block" From 62d937df42a82ee5f7a1f1521dbf730d46fc286f Mon Sep 17 00:00:00 2001 From: David Escalona Date: Thu, 23 Mar 2023 14:09:07 +0100 Subject: [PATCH 016/100] e2fsprogs: extend recipe to format data partition on first boot for block based devices Signed-off-by: David Escalona --- .../e2fsprogs/e2fsprogs_%.bbappend | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 meta-digi-dey/recipes-devtools/e2fsprogs/e2fsprogs_%.bbappend diff --git a/meta-digi-dey/recipes-devtools/e2fsprogs/e2fsprogs_%.bbappend b/meta-digi-dey/recipes-devtools/e2fsprogs/e2fsprogs_%.bbappend new file mode 100644 index 000000000..4ef05d017 --- /dev/null +++ b/meta-digi-dey/recipes-devtools/e2fsprogs/e2fsprogs_%.bbappend @@ -0,0 +1,36 @@ +# Copyright (C) 2023 Digi International. + +pkg_postinst_ontarget:${PN}-mke2fs() { + get_emmc_block_device() { + for emmc_number in $(seq 0 9); do + if [ -b "/dev/mmcblk${emmc_number}" ] && + [ -b "/dev/mmcblk${emmc_number}boot0" ] && + [ -b "/dev/mmcblk${emmc_number}boot1" ] && + [ -c "/dev/mmcblk${emmc_number}rpmb" ]; then + echo "/dev/mmcblk${emmc_number}" + break + fi + done + } + + get_emmc_data_device() { + local EMMC_BLOCK_DEVICE="$(get_emmc_block_device)" + if [ -n "${EMMC_BLOCK_DEVICE}" ]; then + local DATA_DEVICE="$(blkid ${EMMC_BLOCK_DEVICE}p* | sed -ne "{s,\(^${EMMC_BLOCK_DEVICE}[^:]\+\):.*PARTLABEL=\"data\".*,\1,g;T;p}" | sort -u)" + [ -n "${DATA_DEVICE}" ] && echo "${DATA_DEVICE}" + fi + } + + # Format and mount 'data' partition in block system based devices only if it has no format. + EMMC_DATA_DEVICE="$(get_emmc_data_device)" + if [ -n "${EMMC_DATA_DEVICE}" ] && ! blkid ${EMMC_DATA_DEVICE} | grep -q "TYPE="; then + # Format the partition. + echo "WARNING: 'data' partition has no format or it is invalid. Formatting..." + if ! mkfs.ext4 "${EMMC_DATA_DEVICE}"; then + echo "ERROR: Could not format 'data' partition" + else + # Trigger 'add' event for the partition. + echo -n add > "/sys/class/block/${EMMC_DATA_DEVICE##*/}/uevent" + fi + fi +} From b00bddb73fbb8b74c104c24e349511b67c705102 Mon Sep 17 00:00:00 2001 From: Arturo Buzarra Date: Fri, 31 Mar 2023 11:15:31 +0200 Subject: [PATCH 017/100] meta-digi-dey: bump distro version to 4.0-r3 Signed-off-by: Arturo Buzarra --- README.md | 2 +- meta-digi-dey/conf/distro/dey.conf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ae998192d..dda0ee0c6 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Digi Embedded Yocto (DEY) 4.0 -## Release 4.0-r2 +## Release 4.0-r3 This document provides information about Digi Embedded Yocto, Digi International's professional embedded Yocto development environment. diff --git a/meta-digi-dey/conf/distro/dey.conf b/meta-digi-dey/conf/distro/dey.conf index eab3cf9bf..e6e8793e8 100644 --- a/meta-digi-dey/conf/distro/dey.conf +++ b/meta-digi-dey/conf/distro/dey.conf @@ -2,7 +2,7 @@ require conf/distro/poky.conf DISTRO = "dey" DISTRO_NAME = "Digi Embedded Yocto" -DISTRO_VERSION = "4.0-r2" +DISTRO_VERSION = "4.0-r3" SDK_VENDOR = "-deysdk" From d7f9cfb7181f8396d58dd65d8191486810155417 Mon Sep 17 00:00:00 2001 From: Tatiana Leon Date: Tue, 21 Mar 2023 13:50:07 +0100 Subject: [PATCH 018/100] dualboot: update-firmware: add long options to the tool usage Signed-off-by: Tatiana Leon --- .../recipes-digi/dualboot/dualboot/update-firmware | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/meta-digi-dey/recipes-digi/dualboot/dualboot/update-firmware b/meta-digi-dey/recipes-digi/dualboot/dualboot/update-firmware index f5019e468..80ab1dea9 100755 --- a/meta-digi-dey/recipes-digi/dualboot/dualboot/update-firmware +++ b/meta-digi-dey/recipes-digi/dualboot/dualboot/update-firmware @@ -3,7 +3,7 @@ # # update-firmware # -# Copyright (C) 2021-2022 by Digi International Inc. +# Copyright (C) 2021-2023 by Digi International Inc. # All rights reserved. # # This program is free software; you can redistribute it and/or modify it @@ -11,7 +11,7 @@ # the Free Software Foundation. # # -# !Description: Dual boot firmware update script +# !Description: Firmware update script # #=============================================================================== @@ -31,9 +31,9 @@ usage() { Usage: ${SCRIPTNAME} [OPTIONS] .swu - -a Show currently active system - -v Enable verbosity - -h Show this help + -a --active Show currently active system + -v --verbose Enable verbosity + -h --help Print help and exit EOF } From e37d52ebd7091dee5f4428eb85dc98f1a4ce3f07 Mon Sep 17 00:00:00 2001 From: Tatiana Leon Date: Tue, 21 Mar 2023 13:52:27 +0100 Subject: [PATCH 019/100] dualboot: update-firmware: add '--no-reboot' option to avoid the reboot of the system This is required for the firmware update using Digi Remote Manager. The reboot is commanded by the server, it that does not happen the update process is not ended for DRM. https://onedigi.atlassian.net/browse/DEL-8399 Signed-off-by: Tatiana Leon --- .../dualboot/dualboot/update-firmware | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/meta-digi-dey/recipes-digi/dualboot/dualboot/update-firmware b/meta-digi-dey/recipes-digi/dualboot/dualboot/update-firmware index 80ab1dea9..4d06821ff 100755 --- a/meta-digi-dey/recipes-digi/dualboot/dualboot/update-firmware +++ b/meta-digi-dey/recipes-digi/dualboot/dualboot/update-firmware @@ -24,6 +24,7 @@ SCRIPTNAME="$(basename "$(readlink -f "${0}")")" VERBOSE="" PUBLIC_KEY="/etc/ssl/certs/key.pub" ACTIVE_SYSTEM="$(fw_printenv -n active_system 2>/dev/null)" +REBOOT=1 ## Local functions usage() { @@ -32,6 +33,7 @@ usage() { Usage: ${SCRIPTNAME} [OPTIONS] .swu -a --active Show currently active system + --no-reboot Do not reboot after update -v --verbose Enable verbosity -h --help Print help and exit @@ -46,10 +48,21 @@ show_active_system() { fi } +reboot_system() { + if [ ${REBOOT} -eq 1 ]; then + echo "Firmware update finished. Rebooting the system." + reboot -f + else + echo "Firmware update finished. Reboot the system to use the new version." + fi +} + while :; do case $1 in -a|--active) show_active_system;exit ;; + --no-reboot) REBOOT=0 + ;; -v|--verbose) VERBOSE="-v" ;; -h|--help) usage;exit @@ -98,7 +111,7 @@ if [ -z "${NANDROOTFS}" ]; then done if [ -z "${MMC_PART}" ] || [ -z "${PART_UUID}" ]; then - echo "[ERROR] detecting partitions to update." + echo "[ERROR] Detecting partitions to update." exit fi @@ -113,8 +126,7 @@ if [ -z "${NANDROOTFS}" ]; then fw_setenv mmcpart "${MMC_PART}" fw_setenv active_system ${KERNELBOOT} fw_setenv bootcount 0 - echo "Firmware update finished; Rebooting system." - reboot -f + reboot_system else echo "[ERROR] $? There was an error performing the update" fi @@ -149,8 +161,7 @@ else fw_setenv rootfsvol ${ROOTFS} fw_setenv active_system ${KERNELBOOT} fw_setenv bootcount 0 - echo "Firmware update finished; Rebooting system." - reboot -f + reboot_system else echo "[ERROR] $? There was an error performing the update" fi From 006138e13403e7c391a5c0de85daf7a024e22738 Mon Sep 17 00:00:00 2001 From: Tatiana Leon Date: Tue, 21 Mar 2023 17:31:45 +0100 Subject: [PATCH 020/100] dualboot: update-firmware: rework the script to use functions and avoid repetitions Signed-off-by: Tatiana Leon --- .../dualboot/dualboot/update-firmware | 210 ++++++++++-------- 1 file changed, 118 insertions(+), 92 deletions(-) diff --git a/meta-digi-dey/recipes-digi/dualboot/dualboot/update-firmware b/meta-digi-dey/recipes-digi/dualboot/dualboot/update-firmware index 4d06821ff..ea9e30526 100755 --- a/meta-digi-dey/recipes-digi/dualboot/dualboot/update-firmware +++ b/meta-digi-dey/recipes-digi/dualboot/dualboot/update-firmware @@ -24,7 +24,14 @@ SCRIPTNAME="$(basename "$(readlink -f "${0}")")" VERBOSE="" PUBLIC_KEY="/etc/ssl/certs/key.pub" ACTIVE_SYSTEM="$(fw_printenv -n active_system 2>/dev/null)" +SHOW_ACTIVE_SYSTEM=0 REBOOT=1 +UPDATE_FILE="" +ALT_BOOT="" +ALT_ROOTFS="" + +# Check if the rootfs is ubifs to determine if it is a nand or emmc device +NANDROOTFS="$(sed -ne "s/\(rootfs\).*\.*/\1/g;T;p" /proc/mounts 2>/dev/null)" ## Local functions usage() { @@ -41,11 +48,7 @@ EOF } show_active_system() { - if [ "${ACTIVE_SYSTEM}" = "linux_a" ]; then - echo "Active system is A" - else - echo "Active system is B" - fi + echo "Active system is $(echo ${ACTIVE_SYSTEM} | cut -d'_' -f2 | tr [:lower:] [:upper:])" } reboot_system() { @@ -57,9 +60,100 @@ reboot_system() { fi } +swap_active_system() { + if [ -z "${NANDROOTFS}" ]; then + local PART_UUID="" + + # Get boot and rootfs partition index + local MMC_PART="$(realpath /dev/disk/by-partlabel/${ALT_BOOT} | grep -o '[[:digit:]]\+$')" + + # Search rootfs UUID + local MMCROOT_DEV="$(realpath /dev/disk/by-partlabel/${ALT_ROOTFS})" + for uuid in /dev/disk/by-partuuid/*; do + if [ "$(realpath "${uuid}")" = "${MMCROOT_DEV}" ]; then + PART_UUID="$(basename "${uuid}")" + break + fi + done + + if [ -z "${MMC_PART}" ] || [ -z "${PART_UUID}" ]; then + echo "[ERROR] Unable to detect partitions." + return 1 + fi + + fw_setenv mmcroot "PARTUUID=${PART_UUID}" + fw_setenv mmcpart "${MMC_PART}" + else + fw_setenv mtdbootpart ${ALT_BOOT} + fw_setenv mtdrootfspart ${ALT_ROOTFS} + fw_setenv rootfsvol ${ALT_ROOTFS} + fi + + fw_setenv active_system ${ALT_BOOT} + fw_setenv bootcount 0 + + return 0 +} + +update_emmc() { + local IMAGE_SET="mmc,primary" + + # Get current partition information so we can + # determine where to flash the images. + [ "${ACTIVE_SYSTEM}" = "linux_a" ] && IMAGE_SET="mmc,secondary" + + echo "" + echo "Updating '${IMAGE_SET}' image set from '${UPDATE_FILE}'..." + echo "" + + # Execute the update. + swupdate ${VERBOSE} -i "${UPDATE_FILE}" -e "${IMAGE_SET}" +} + +update_nand() { + local IMAGE_SET="mtd,primary" + + # Get current partition information so we can + # determine where to flash the images. + [ "${ACTIVE_SYSTEM}" = "linux_a" ] && IMAGE_SET="mtd,secondary" + + echo "" + echo "Updating '${IMAGE_SET}' image set from '${UPDATE_FILE}'..." + echo "" + + # Execute the update. + if [ -f "${PUBLIC_KEY}" ]; then + swupdate ${VERBOSE} -i "${UPDATE_FILE}" -e "${IMAGE_SET}" -k "${PUBLIC_KEY}" + else + swupdate ${VERBOSE} -i "${UPDATE_FILE}" -e "${IMAGE_SET}" + fi +} + +update_device() { + local ret + + show_active_system + echo "Updating system on $(echo ${ALT_BOOT} | cut -d'_' -f2 | tr [:lower:] [:upper:])" + + if [ -z "${NANDROOTFS}" ]; then + update_emmc + else + update_nand + fi + + if [ "$?" = "0" ]; then + if ! swap_active_system; then + exit 1 + fi + reboot_system + else + echo "[ERROR] $? There was an error performing the update" + fi +} + while :; do case $1 in - -a|--active) show_active_system;exit + -a|--active) SHOW_ACTIVE_SYSTEM=1 ;; --no-reboot) REBOOT=0 ;; @@ -74,95 +168,27 @@ while :; do shift done +# Show active system. +if [ ${SHOW_ACTIVE_SYSTEM} -eq 1 ]; then + show_active_system + exit +fi + +if [ "${ACTIVE_SYSTEM}" = "linux_a" ]; then + ALT_BOOT="linux_b" + ALT_ROOTFS="rootfs_b" +else + ALT_BOOT="linux_a" + ALT_ROOTFS="rootfs_a" +fi + # Check update file parameter. if [ -z "${UPDATE_FILE}" ]; then echo "[ERROR] Update file not specified" exit +elif [ ! -f "${UPDATE_FILE}" ]; then + echo "[ERROR] Update file '${UPDATE_FILE}' does not exist" + exit fi -# Check if the rootfs is ubifs to determine if it is a nand or emmc device -NANDROOTFS="$(sed -ne "s/\(rootfs\).*\.*/\1/g;T;p" /proc/mounts 2>/dev/null)" - -if [ -z "${NANDROOTFS}" ]; then - # Get current partition information so we can - # determine where to flash the images. - if [ "${ACTIVE_SYSTEM}" = "linux_a" ]; then - echo "Current system is A; Updating system on B" - KERNELBOOT="linux_b" - ROOTFS="rootfs_b" - IMAGE_SET="mmc,secondary" - else - echo "Current system is B; Updating system on A" - KERNELBOOT="linux_a" - ROOTFS="rootfs_a" - IMAGE_SET="mmc,primary" - fi - - # get boot and rootfs partition index - MMC_PART="$(realpath /dev/disk/by-partlabel/${KERNELBOOT} | grep -o '[[:digit:]]\+$')" - - # search rootfs UUID - MMCROOT_DEV="$(realpath /dev/disk/by-partlabel/${ROOTFS})" - for uuid in /dev/disk/by-partuuid/*; do - if [ "$(realpath "${uuid}")" = "${MMCROOT_DEV}" ]; then - PART_UUID="$(basename "${uuid}")" - break - fi - done - - if [ -z "${MMC_PART}" ] || [ -z "${PART_UUID}" ]; then - echo "[ERROR] Detecting partitions to update." - exit - fi - - echo "" - echo "Updating '${IMAGE_SET}' image set from '${UPDATE_FILE}'..." - echo "" - - # Execute the update. - swupdate ${VERBOSE} -i "${UPDATE_FILE}" -e "${IMAGE_SET}" - if [ "$?" = "0" ]; then - fw_setenv mmcroot "PARTUUID=${PART_UUID}" - fw_setenv mmcpart "${MMC_PART}" - fw_setenv active_system ${KERNELBOOT} - fw_setenv bootcount 0 - reboot_system - else - echo "[ERROR] $? There was an error performing the update" - fi -else - # Get current partition information so we can - # determine where to flash the images. - if [ "${ACTIVE_SYSTEM}" = "linux_a" ]; then - echo "Current system is A; Updating system on B" - KERNELBOOT="linux_b" - ROOTFS="rootfs_b" - IMAGE_SET="mtd,secondary" - else - echo "Current system is B; Updating system on A" - KERNELBOOT="linux_a" - ROOTFS="rootfs_a" - IMAGE_SET="mtd,primary" - fi - - echo "" - echo "Updating '${IMAGE_SET}' image set from '${UPDATE_FILE}'..." - echo "" - - # Execute the update. - if [ -f "${PUBLIC_KEY}" ]; then - swupdate ${VERBOSE} -i "${UPDATE_FILE}" -e "${IMAGE_SET}" -k "${PUBLIC_KEY}" - else - swupdate ${VERBOSE} -i "${UPDATE_FILE}" -e "${IMAGE_SET}" - fi - if [ "$?" = "0" ]; then - fw_setenv mtdbootpart ${KERNELBOOT} - fw_setenv mtdrootfspart ${ROOTFS} - fw_setenv rootfsvol ${ROOTFS} - fw_setenv active_system ${KERNELBOOT} - fw_setenv bootcount 0 - reboot_system - else - echo "[ERROR] $? There was an error performing the update" - fi -fi +update_device From 556bda6d578bc8545975630e803b2d7c14941650 Mon Sep 17 00:00:00 2001 From: Tatiana Leon Date: Tue, 28 Mar 2023 10:23:42 +0200 Subject: [PATCH 021/100] dualboot: update-firmware: update the check of nand or emmc system Check the second ('/') and third ('ubifs') field of 'rootfs' entry in '/proc/mounts' as the first one ('rootfs_a' or 'rootfs_b') may be changed by custormers: root@ccmp15-dvk:~# cat /proc/mounts ubi0:rootfs_b / ubifs rw,relatime,assert=read-only,ubi=0,vol=5 0 0 [...] https://onedigi.atlassian.net/browse/DEL-8399 Signed-off-by: Tatiana Leon --- meta-digi-dey/recipes-digi/dualboot/dualboot/update-firmware | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta-digi-dey/recipes-digi/dualboot/dualboot/update-firmware b/meta-digi-dey/recipes-digi/dualboot/dualboot/update-firmware index ea9e30526..063283242 100755 --- a/meta-digi-dey/recipes-digi/dualboot/dualboot/update-firmware +++ b/meta-digi-dey/recipes-digi/dualboot/dualboot/update-firmware @@ -31,7 +31,7 @@ ALT_BOOT="" ALT_ROOTFS="" # Check if the rootfs is ubifs to determine if it is a nand or emmc device -NANDROOTFS="$(sed -ne "s/\(rootfs\).*\.*/\1/g;T;p" /proc/mounts 2>/dev/null)" +NANDROOTFS="$(grep -qs '[[:blank:]]\+/[[:blank:]]\+ubifs.*' /proc/mounts 2>/dev/null && echo 1)" ## Local functions usage() { From 1b17e8f6573679b77a0a89a456b03ea00639a848 Mon Sep 17 00:00:00 2001 From: Tatiana Leon Date: Tue, 28 Mar 2023 11:03:27 +0200 Subject: [PATCH 022/100] dualboot: update-firmware: new script option ('-s') This option combined with '-a' ('--active') only prints the active block: a or b The purpose an output to be consumed by other scripts or programs. https://onedigi.atlassian.net/browse/DEL-8399 Signed-off-by: Tatiana Leon --- .../recipes-digi/dualboot/dualboot/update-firmware | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/meta-digi-dey/recipes-digi/dualboot/dualboot/update-firmware b/meta-digi-dey/recipes-digi/dualboot/dualboot/update-firmware index 063283242..eec6aad3e 100755 --- a/meta-digi-dey/recipes-digi/dualboot/dualboot/update-firmware +++ b/meta-digi-dey/recipes-digi/dualboot/dualboot/update-firmware @@ -25,6 +25,7 @@ VERBOSE="" PUBLIC_KEY="/etc/ssl/certs/key.pub" ACTIVE_SYSTEM="$(fw_printenv -n active_system 2>/dev/null)" SHOW_ACTIVE_SYSTEM=0 +SCRIPT_MODE=0 REBOOT=1 UPDATE_FILE="" ALT_BOOT="" @@ -48,7 +49,14 @@ EOF } show_active_system() { - echo "Active system is $(echo ${ACTIVE_SYSTEM} | cut -d'_' -f2 | tr [:lower:] [:upper:])" + local act_sys="$(echo ${ACTIVE_SYSTEM} | cut -d'_' -f2)" + + if [ ${SCRIPT_MODE} -eq 0 ]; then + act_sys="$(echo ${act_sys} | tr [:lower:] [:upper:])" + echo "Active system is ${act_sys}" + else + echo "${act_sys}" + fi } reboot_system() { @@ -157,6 +165,8 @@ while :; do ;; --no-reboot) REBOOT=0 ;; + -s) SCRIPT_MODE=1 + ;; -v|--verbose) VERBOSE="-v" ;; -h|--help) usage;exit From ccc4680924236187f6469984337977650fd8dd2e Mon Sep 17 00:00:00 2001 From: Tatiana Leon Date: Tue, 21 Mar 2023 17:54:09 +0100 Subject: [PATCH 023/100] dualboot: update-firmware: new option to swap active system ('--swap-active-system') This allows to remove the script 'on-the-fly-swap-partition.sh'. https://onedigi.atlassian.net/browse/DEL-8399 Signed-off-by: Tatiana Leon --- .../recipes-digi/dualboot/dualboot.bb | 3 -- .../dualboot/on-the-fly-swap-partition.sh | 48 ------------------- .../dualboot/dualboot/update-firmware | 21 ++++++-- 3 files changed, 18 insertions(+), 54 deletions(-) delete mode 100644 meta-digi-dey/recipes-digi/dualboot/dualboot/on-the-fly-swap-partition.sh diff --git a/meta-digi-dey/recipes-digi/dualboot/dualboot.bb b/meta-digi-dey/recipes-digi/dualboot/dualboot.bb index 374a532c7..5437eadd1 100644 --- a/meta-digi-dey/recipes-digi/dualboot/dualboot.bb +++ b/meta-digi-dey/recipes-digi/dualboot/dualboot.bb @@ -11,7 +11,6 @@ SRC_URI = " \ file://dualboot-init \ file://update-firmware \ file://firmware-update-check.service \ - file://on-the-fly-swap-partition.sh \ " S = "${WORKDIR}" @@ -28,7 +27,6 @@ do_install() { install -d ${D}${bindir} install -m 0755 ${WORKDIR}/update-firmware ${D}${bindir} - install -m 0755 ${WORKDIR}/on-the-fly-swap-partition.sh ${D}${bindir} install -d ${D}${systemd_unitdir}/system/ install -m 0644 ${WORKDIR}/firmware-update-check.service ${D}${systemd_unitdir}/system/ @@ -65,7 +63,6 @@ FILES:${PN} += " \ ${sysconfdir}/dualboot-init \ ${sysconfdir}/init.d/dualboot-init \ ${bindir}/update-firmware \ - ${bindir}/on-the-fly-swap-partition.sh \ ${systemd_unitdir}/system/firmware-update-check.service \ ${@oe.utils.conditional('TRUSTFENCE_SIGN', '1', '${sysconfdir}/ssl/certs/key.pub', '', d)} \ " diff --git a/meta-digi-dey/recipes-digi/dualboot/dualboot/on-the-fly-swap-partition.sh b/meta-digi-dey/recipes-digi/dualboot/dualboot/on-the-fly-swap-partition.sh deleted file mode 100644 index 83d1f586a..000000000 --- a/meta-digi-dey/recipes-digi/dualboot/dualboot/on-the-fly-swap-partition.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/sh -#=============================================================================== -# -# on-the-fly-swap-partition.sh -# -# Copyright (C) 2021-2022 by Digi International Inc. -# All rights reserved. -# -# This program is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 as published by -# the Free Software Foundation. -# -# -# !Description: On the fly script to swap active partition -# -#=============================================================================== - -ACTIVE_SYSTEM="$(fw_printenv -n active_system 2>/dev/null)" - -# Get current partition information so we can -# determine where to flash the images. -if [ "${ACTIVE_SYSTEM}" = "linux_a" ]; then - KERNELBOOT="linux_b" - ROOTFS="rootfs_b" -else - KERNELBOOT="linux_a" - ROOTFS="rootfs_a" -fi -if grep -qs environment /proc/mtd; then - fw_setenv mtdbootpart ${KERNELBOOT} - fw_setenv mtdrootfspart ${ROOTFS} - fw_setenv rootfsvol ${ROOTFS} - fw_setenv active_system ${KERNELBOOT} -else - # Get Boot partition device and index. - BOOT_DEV="$(fw_printenv -n mmcbootdev 2>/dev/null)" - - # get boot partition index - MMC_PART="$(ls -l /dev/disk/by-partlabel/ | grep -i ${KERNELBOOT} | awk '{print $11}' | sed -e 's/[../mmcblkp]//g' -e 's/^.//')" - - # search rootfs UUID - MMCROOT_PART="$(ls -l /dev/disk/by-partlabel/ | grep -i ${ROOTFS} | awk '{print $11}' | sed -e 's/[../mmcblkp]//g' -e 's/^.//')" - PART_UUID="$(ls -l /dev/disk/by-partuuid/ | grep -i mmcblk${BOOT_DEV}p${MMCROOT_PART} | awk '{print $9}')" - - fw_setenv mmcroot PARTUUID=${PART_UUID} - fw_setenv mmcpart ${MMC_PART} - fw_setenv active_system ${KERNELBOOT} -fi diff --git a/meta-digi-dey/recipes-digi/dualboot/dualboot/update-firmware b/meta-digi-dey/recipes-digi/dualboot/dualboot/update-firmware index eec6aad3e..1434d99dd 100755 --- a/meta-digi-dey/recipes-digi/dualboot/dualboot/update-firmware +++ b/meta-digi-dey/recipes-digi/dualboot/dualboot/update-firmware @@ -26,6 +26,7 @@ PUBLIC_KEY="/etc/ssl/certs/key.pub" ACTIVE_SYSTEM="$(fw_printenv -n active_system 2>/dev/null)" SHOW_ACTIVE_SYSTEM=0 SCRIPT_MODE=0 +SWAP_ACTIVE_SYSTEM=0 REBOOT=1 UPDATE_FILE="" ALT_BOOT="" @@ -42,6 +43,8 @@ Usage: ${SCRIPTNAME} [OPTIONS] .swu -a --active Show currently active system --no-reboot Do not reboot after update + --swap-active-system Swap active system block. + This option reboots the system, unless '--no-reboot' is specified. -v --verbose Enable verbosity -h --help Print help and exit @@ -59,12 +62,13 @@ show_active_system() { fi } +# $1: message to show reboot_system() { if [ ${REBOOT} -eq 1 ]; then - echo "Firmware update finished. Rebooting the system." + echo "${1}. Rebooting the system." reboot -f else - echo "Firmware update finished. Reboot the system to use the new version." + echo "${1}. Reboot the system to use the new version." fi } @@ -153,7 +157,7 @@ update_device() { if ! swap_active_system; then exit 1 fi - reboot_system + reboot_system "Firmware update finished" else echo "[ERROR] $? There was an error performing the update" fi @@ -165,6 +169,8 @@ while :; do ;; --no-reboot) REBOOT=0 ;; + --swap-active-system) SWAP_ACTIVE_SYSTEM=1 + ;; -s) SCRIPT_MODE=1 ;; -v|--verbose) VERBOSE="-v" @@ -192,6 +198,15 @@ else ALT_ROOTFS="rootfs_a" fi +# Swap active system. +if [ ${SWAP_ACTIVE_SYSTEM} -eq 1 ]; then + if ! swap_active_system; then + exit 1 + fi + reboot_system "Swapped active system to $(echo ${ALT_BOOT} | cut -d'_' -f2 | tr [:lower:] [:upper:])" + exit +fi + # Check update file parameter. if [ -z "${UPDATE_FILE}" ]; then echo "[ERROR] Update file not specified" From eca521f505a000792fef22bbedfd890223e80f56 Mon Sep 17 00:00:00 2001 From: Tatiana Leon Date: Wed, 22 Mar 2023 10:20:10 +0100 Subject: [PATCH 024/100] dualboot: update-firmware: get current active system not using U-Boot variable This commit adds a new function to get the active system in a dualboot device without using 'active_system' U-Boot variable. This way the script always knows the real active system even when the variable 'active_system' has the value of the next boot active system, for example, after performing a 'update-firmware --swap-active-system'. https://onedigi.atlassian.net/browse/DEL-8399 Signed-off-by: Tatiana Leon --- .../dualboot/dualboot/update-firmware | 44 +++++++++++++++---- 1 file changed, 36 insertions(+), 8 deletions(-) diff --git a/meta-digi-dey/recipes-digi/dualboot/dualboot/update-firmware b/meta-digi-dey/recipes-digi/dualboot/dualboot/update-firmware index 1434d99dd..3735c26d4 100755 --- a/meta-digi-dey/recipes-digi/dualboot/dualboot/update-firmware +++ b/meta-digi-dey/recipes-digi/dualboot/dualboot/update-firmware @@ -23,7 +23,7 @@ fi SCRIPTNAME="$(basename "$(readlink -f "${0}")")" VERBOSE="" PUBLIC_KEY="/etc/ssl/certs/key.pub" -ACTIVE_SYSTEM="$(fw_printenv -n active_system 2>/dev/null)" +ACTIVE_SYSTEM="" SHOW_ACTIVE_SYSTEM=0 SCRIPT_MODE=0 SWAP_ACTIVE_SYSTEM=0 @@ -51,14 +51,40 @@ Usage: ${SCRIPTNAME} [OPTIONS] .swu EOF } -show_active_system() { - local act_sys="$(echo ${ACTIVE_SYSTEM} | cut -d'_' -f2)" +get_active_system() { + if [ -z "${NANDROOTFS}" ]; then + local MMCROOT_DEV + MMCROOT_DEV="$(stat -c%D /)" + + for label in /dev/disk/by-partlabel/*; do + if [ "$(stat -c"%02t%02T" $(realpath ${label}))" = "${MMCROOT_DEV}" ]; then + ACTIVE_SYSTEM="$(basename ${label})" + break + fi + done + else + ACTIVE_SYSTEM="$(sed -ne 's,^\([^[:blank:]]\+\)[[:blank:]]\+/[[:blank:]]\+ubifs.*,\1,g;T;p' /proc/mounts 2>/dev/null)" + fi + + if [ -z "${ACTIVE_SYSTEM}" ]; then + echo "[ERROR] Unable to get active system." + return 1 + fi + + ACTIVE_SYSTEM="$(echo ${ACTIVE_SYSTEM} | cut -d_ -f2)" + + return 0 +} + +show_active_system() { if [ ${SCRIPT_MODE} -eq 0 ]; then - act_sys="$(echo ${act_sys} | tr [:lower:] [:upper:])" + local act_sys + + act_sys="$(echo ${ACTIVE_SYSTEM} | tr [:lower:] [:upper:])" echo "Active system is ${act_sys}" else - echo "${act_sys}" + echo "${ACTIVE_SYSTEM}" fi } @@ -112,7 +138,7 @@ update_emmc() { # Get current partition information so we can # determine where to flash the images. - [ "${ACTIVE_SYSTEM}" = "linux_a" ] && IMAGE_SET="mmc,secondary" + [ "${ACTIVE_SYSTEM}" = "a" ] && IMAGE_SET="mmc,secondary" echo "" echo "Updating '${IMAGE_SET}' image set from '${UPDATE_FILE}'..." @@ -127,7 +153,7 @@ update_nand() { # Get current partition information so we can # determine where to flash the images. - [ "${ACTIVE_SYSTEM}" = "linux_a" ] && IMAGE_SET="mtd,secondary" + [ "${ACTIVE_SYSTEM}" = "a" ] && IMAGE_SET="mtd,secondary" echo "" echo "Updating '${IMAGE_SET}' image set from '${UPDATE_FILE}'..." @@ -184,13 +210,15 @@ while :; do shift done +get_active_system || exit + # Show active system. if [ ${SHOW_ACTIVE_SYSTEM} -eq 1 ]; then show_active_system exit fi -if [ "${ACTIVE_SYSTEM}" = "linux_a" ]; then +if [ "${ACTIVE_SYSTEM}" = "a" ]; then ALT_BOOT="linux_b" ALT_ROOTFS="rootfs_b" else From dba8dbdab46ffaf136a87ad7590d3c0984f96e03 Mon Sep 17 00:00:00 2001 From: Tatiana Leon Date: Tue, 21 Mar 2023 17:55:59 +0100 Subject: [PATCH 025/100] dualboot: change the way to determine if device is using nand or emmc 'environment' partition is not available in the ccmp15. The solution suggested is read the "/proc/mounts" and check if the 'rootfs' is 'ubifs' mounted. Related to commits 7c07b15370715cdfe76bc68133a00d543eb3b122 and 678eaaf0fc4ce74e67682387e3465eb29659bd47 Signed-off-by: Tatiana Leon --- .../recipes-digi/dualboot/dualboot/dualboot-init | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/meta-digi-dey/recipes-digi/dualboot/dualboot/dualboot-init b/meta-digi-dey/recipes-digi/dualboot/dualboot/dualboot-init index 1e4337891..63dc75ba0 100644 --- a/meta-digi-dey/recipes-digi/dualboot/dualboot/dualboot-init +++ b/meta-digi-dey/recipes-digi/dualboot/dualboot/dualboot-init @@ -1,7 +1,7 @@ #!/bin/sh #=============================================================================== # -# Copyright (C) 2021 by Digi International Inc. +# Copyright (C) 2021-2023 by Digi International Inc. # All rights reserved. # # This program is free software; you can redistribute it and/or modify it @@ -16,14 +16,16 @@ dualboot_init () { ACTIVE_SYSTEM="$(fw_printenv -n active_system 2>/dev/null)" if [ -z "${ACTIVE_SYSTEM}" ]; then - if grep -qs environment /proc/mtd; then - MTD_BOOT_PART="$(fw_printenv -n mtdbootpart 2>/dev/null)" - fw_setenv active_system "${MTD_BOOT_PART}" - else + # Check if the rootfs is ubifs to determine if it is a nand or emmc device + NANDROOTFS="$(grep -qs '[[:blank:]]\+/[[:blank:]]\+ubifs.*' /proc/mounts 2>/dev/null && echo 1)" + if [ -z "${NANDROOTFS}" ]; then BOOT_PART="$(fw_printenv -n mmcpart 2>/dev/null)" BOOT_DEV="$(fw_printenv -n mmcbootdev 2>/dev/null)" CURRENT_PART="$(sed -ne 's,PARTNAME=,,g;T;p' /sys/class/block/mmcblk"${BOOT_DEV}"p"${BOOT_PART}"/uevent)" fw_setenv active_system "${CURRENT_PART}" + else + MTD_BOOT_PART="$(fw_printenv -n mtdbootpart 2>/dev/null)" + fw_setenv active_system "${MTD_BOOT_PART}" fi fi From 3912f76f59f11afd53df61aab40bd81f8190d3c7 Mon Sep 17 00:00:00 2001 From: Tatiana Leon Date: Tue, 28 Mar 2023 18:18:25 +0200 Subject: [PATCH 026/100] ccimx8m: ccmp1: cc6ul: cloudconnector: update store certificates in '/etc/ssl/certs' Cloud Connector configuration file sets: * 'edp12.devicecloud.com' as the URL to connect to (this end point uses client certificates) * '/mnt/data' as the directory to store downloaded certificates, now that this is also available in emmc platforms (see 62d937df42a82ee5f7a1f1521dbf730d46fc286f) This commit: * reverts a0842cbcfd7b92c47e292f8c33102a7266bde823 to keep 'edp12.devicecloud.com' URL that uses certificates for ccimx8m platforms. * reverts fd94f10c0b7cb61472e0958910b84ed176d40052 since now the cloud connector configuration file sets '/mnt/data' as the place to store downloaded certificates, so no need to modify it for ccmp1 platforms. * It also configures '/etc/ssl/certs' as the certificates directory for cc6ul devices. Although by default, these devices are connecting to 'remotemanager.digi.com' that not uses certificates, we prefer to use an existing directory in that setting. See commit 063a946e7c3a955ace6acd20e1ff3a6ecc5c73ff. Signed-off-by: Tatiana Leon --- .../recipes-digi/cloudconnector/cloudconnector_git.bb | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/meta-digi-dey/recipes-digi/cloudconnector/cloudconnector_git.bb b/meta-digi-dey/recipes-digi/cloudconnector/cloudconnector_git.bb index 985db3b3b..13094edbc 100644 --- a/meta-digi-dey/recipes-digi/cloudconnector/cloudconnector_git.bb +++ b/meta-digi-dey/recipes-digi/cloudconnector/cloudconnector_git.bb @@ -41,14 +41,7 @@ do_install() { do_install:append:ccimx6ul() { sed -i "/url = \"edp12.devicecloud.com\"/c\url = \"remotemanager.digi.com\"" ${D}${sysconfdir}/cc.conf -} - -do_install:append:ccimx8m() { - sed -i "/url = \"edp12.devicecloud.com\"/c\url = \"remotemanager.digi.com\"" ${D}${sysconfdir}/cc.conf -} - -do_install:append:ccmp1() { - sed -i "/client_cert_path = \"\/etc\/ssl\/certs\/drm_cert.pem\"/c\client_cert_path = \"\/mnt\/data\/drm_cert.pem\"" ${D}${sysconfdir}/cc.conf + sed -i "/client_cert_path = \"\/mnt\/data\/drm_cert.pem\"/c\client_cert_path = \"\/etc\/ssl\/certs\/drm_cert.pem\"" ${D}${sysconfdir}/cc.conf } pkg_postinst_ontarget:${PN}() { From 0f2f513f8b67259ed55a645c598a37c2ac71541c Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Fri, 31 Mar 2023 16:48:27 +0200 Subject: [PATCH 027/100] ccimx93: add more device tree overlays Second ethernet and MikroE click board overlays. Signed-off-by: Javier Viguera --- meta-digi-arm/conf/machine/ccimx93-dvk.conf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/meta-digi-arm/conf/machine/ccimx93-dvk.conf b/meta-digi-arm/conf/machine/ccimx93-dvk.conf index 208979841..be23066fa 100644 --- a/meta-digi-arm/conf/machine/ccimx93-dvk.conf +++ b/meta-digi-arm/conf/machine/ccimx93-dvk.conf @@ -11,7 +11,10 @@ UBOOT_DTB_NAME = "ccimx93-dvk.dtb" KERNEL_DEVICETREE ?= " \ digi/ccimx93-dvk.dtb \ + digi/_ov_board_enet2_ccimx93-dvk.dtbo \ digi/_ov_board_lvds_ccimx93-dvk.dtbo \ + digi/_ov_board_mikroe-accel2-click_ccimx93-dvk.dtbo \ + digi/_ov_board_mikroe-gyro-click_ccimx93-dvk.dtbo \ digi/_ov_som_bt_ccimx93.dtbo \ digi/_ov_som_mca_ccimx93.dtbo \ digi/_ov_som_wifi_ccimx93.dtbo \ From 1d793ac4aa6a4f4bf27cc347352fae443de04060 Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Fri, 31 Mar 2023 16:56:28 +0200 Subject: [PATCH 028/100] dey-image-installer: add USB driver installation script for ccimx93 Signed-off-by: Javier Viguera --- meta-digi-dey/classes/dey-image-installer.bbclass | 1 + 1 file changed, 1 insertion(+) diff --git a/meta-digi-dey/classes/dey-image-installer.bbclass b/meta-digi-dey/classes/dey-image-installer.bbclass index 66243e878..c0d6ad7ba 100644 --- a/meta-digi-dey/classes/dey-image-installer.bbclass +++ b/meta-digi-dey/classes/dey-image-installer.bbclass @@ -25,6 +25,7 @@ FSTYPES_WHITELIST:ccmp1 = " \ HAS_USB_DRIVER = "false" HAS_USB_DRIVER:ccimx8m = "true" +HAS_USB_DRIVER:ccimx93 = "true" HAS_USB_DRIVER:ccmp1 = "true" generate_installer_zip () { From 951789093fac44d8a9221b5a0ba2e05fb9994fbf Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Fri, 31 Mar 2023 17:05:42 +0200 Subject: [PATCH 029/100] meta-digi-dey: remove dead code (udev-cache) This was removed from Poky long ago: https://git.yoctoproject.org/poky/commit/?id=44f550f392e231b7fbd1e29da3f59d6c9dd7f472 Signed-off-by: Javier Viguera --- meta-digi-dey/recipes-core/images/core-image-base.bbappend | 3 --- meta-digi-dey/recipes-core/images/dey-image-aws.bb | 3 --- meta-digi-dey/recipes-core/images/dey-image-graphical.inc | 2 -- 3 files changed, 8 deletions(-) diff --git a/meta-digi-dey/recipes-core/images/core-image-base.bbappend b/meta-digi-dey/recipes-core/images/core-image-base.bbappend index 6c80f4633..35bb8daf0 100644 --- a/meta-digi-dey/recipes-core/images/core-image-base.bbappend +++ b/meta-digi-dey/recipes-core/images/core-image-base.bbappend @@ -27,6 +27,3 @@ SDKIMAGE_FEATURES ?= "dev-pkgs dbg-pkgs staticdev-pkgs" # Add our dey-image tweaks to the final image (like /etc/build info) inherit dey-image - -# Do not install udev-cache -BAD_RECOMMENDATIONS += "udev-cache" diff --git a/meta-digi-dey/recipes-core/images/dey-image-aws.bb b/meta-digi-dey/recipes-core/images/dey-image-aws.bb index e8dd13c65..6d53eb9f0 100644 --- a/meta-digi-dey/recipes-core/images/dey-image-aws.bb +++ b/meta-digi-dey/recipes-core/images/dey-image-aws.bb @@ -27,6 +27,3 @@ inherit core-image inherit dey-image IMAGE_ROOTFS_SIZE = "8192" - -# Do not install udev-cache -BAD_RECOMMENDATIONS += "udev-cache" diff --git a/meta-digi-dey/recipes-core/images/dey-image-graphical.inc b/meta-digi-dey/recipes-core/images/dey-image-graphical.inc index de593a3ea..2856563ec 100644 --- a/meta-digi-dey/recipes-core/images/dey-image-graphical.inc +++ b/meta-digi-dey/recipes-core/images/dey-image-graphical.inc @@ -42,8 +42,6 @@ CONFLICT_DISTRO_FEATURES = "directfb" IMAGE_ROOTFS_SIZE = "8192" -# Do not install udev-cache -BAD_RECOMMENDATIONS += "udev-cache" BAD_RECOMMENDATIONS += "eudev-hwdb" export IMAGE_BASENAME = "dey-image-${GRAPHICAL_CORE}-${GRAPHICAL_BACKEND}" From 7a7713055052016abffa5d7c58e1cd5879b16cb7 Mon Sep 17 00:00:00 2001 From: Gabriel Valcazar Date: Tue, 11 Apr 2023 13:52:29 +0200 Subject: [PATCH 030/100] imx-digi-base: add dummy MULTIUBI_BUILD value to fix Vigiles builds Commit 32dd3d59c250f916115b339c29aa4dbfe50a3235 in poky breaks i.MX platform builds when "vigiles" is inherited. While we wait for a fix in the community, work around this issue by setting a dummy default value in the MULTIUBI_BUILD variable. Signed-off-by: Gabriel Valcazar --- meta-digi-arm/conf/machine/include/imx-digi-base.inc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/meta-digi-arm/conf/machine/include/imx-digi-base.inc b/meta-digi-arm/conf/machine/include/imx-digi-base.inc index 71f58f7bc..f4fe899ca 100644 --- a/meta-digi-arm/conf/machine/include/imx-digi-base.inc +++ b/meta-digi-arm/conf/machine/include/imx-digi-base.inc @@ -296,4 +296,7 @@ UDEV_EXTRA_RULES:append = " udev-rules-imx" PREFERRED_VERSION_dtc-native:ccimx6 ?= "1.4.5" PREFERRED_VERSION_nativesdk-dtc:ccimx6 ?= "1.4.5" +# Dummy value to prevent errors when Vigiles is enabled +MULTIUBI_BUILD ?= "dummy" + DEY_BUILD_PLATFORM = "NXP" From 167678edac28e61a35eada29d678824797620f9c Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Mon, 17 Apr 2023 12:30:26 +0200 Subject: [PATCH 031/100] python3-pyelftools: allow to build for nativesdk This is a requirement to build optee-os with a Yocto generated SDK. Signed-off-by: Javier Viguera --- .../recipes-devtools/python/python3-pyelftools_%.bbappend | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 meta-digi-dey/recipes-devtools/python/python3-pyelftools_%.bbappend diff --git a/meta-digi-dey/recipes-devtools/python/python3-pyelftools_%.bbappend b/meta-digi-dey/recipes-devtools/python/python3-pyelftools_%.bbappend new file mode 100644 index 000000000..fff2b192d --- /dev/null +++ b/meta-digi-dey/recipes-devtools/python/python3-pyelftools_%.bbappend @@ -0,0 +1,3 @@ +# Copyright (c) 2023, Digi International Inc. + +BBCLASSEXTEND += "nativesdk" From 7581e76560288ec359527584619afd5cca226088 Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Mon, 17 Apr 2023 12:37:32 +0200 Subject: [PATCH 032/100] nativesdk-packagegroup-sdk-host: add requirementes to build optee-os Building optee-os with a Yocto generated SDK, fails due to those missing packages. Signed-off-by: Javier Viguera --- .../nativesdk-packagegroup-sdk-host.bbappend | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/meta-digi-arm/recipes-core/packagegroup/nativesdk-packagegroup-sdk-host.bbappend b/meta-digi-arm/recipes-core/packagegroup/nativesdk-packagegroup-sdk-host.bbappend index 137e373f5..354872ac1 100644 --- a/meta-digi-arm/recipes-core/packagegroup/nativesdk-packagegroup-sdk-host.bbappend +++ b/meta-digi-arm/recipes-core/packagegroup/nativesdk-packagegroup-sdk-host.bbappend @@ -1,4 +1,9 @@ -# Copyright (C) 2016-2022 Digi International. +# Copyright (C) 2016-2023 Digi International. + +IMX_OPTEE_SDK_RDEPENDS ?= " \ + nativesdk-python3-cryptography \ + nativesdk-python3-pyelftools \ +" IMX_TRUSTFENCE_SDK_TOOLS ?= " \ nativesdk-trustfence-sign-tools \ @@ -7,5 +12,5 @@ IMX_TRUSTFENCE_SDK_TOOLS ?= " \ " RDEPENDS:${PN} += " \ - ${@oe.utils.conditional('DEY_BUILD_PLATFORM', 'NXP', '${IMX_TRUSTFENCE_SDK_TOOLS}', '', d)} \ + ${@oe.utils.conditional('DEY_BUILD_PLATFORM', 'NXP', '${IMX_OPTEE_SDK_RDEPENDS} ${IMX_TRUSTFENCE_SDK_TOOLS}', '', d)} \ " From c9fb56629a7108d2d97581cdd17e1a4ec7027c75 Mon Sep 17 00:00:00 2001 From: Gabriel Valcazar Date: Mon, 17 Apr 2023 13:05:37 +0200 Subject: [PATCH 033/100] cryptoauthlib: use digi-embedded github mirror The commit we use to build the cryotpauthlib package is currently not part of any branches or tags in the original MicrochipTech repo. To make sure the package can always be built, use our mirror of the repo, which includes an additional branch for the specific commit. While at it, move the "nobranch=1" parameter to the GIT_URI variable, since we're putting all other git parameters there, anyway. Also, remove the "branch" parameter because it isn't needed in this case. https://onedigi.atlassian.net/browse/DEL-8015 Signed-off-by: Gabriel Valcazar --- meta-digi-arm/recipes-digi/cryptoauthlib/cryptoauthlib_git.bb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta-digi-arm/recipes-digi/cryptoauthlib/cryptoauthlib_git.bb b/meta-digi-arm/recipes-digi/cryptoauthlib/cryptoauthlib_git.bb index 0567b41f6..ba76662dd 100644 --- a/meta-digi-arm/recipes-digi/cryptoauthlib/cryptoauthlib_git.bb +++ b/meta-digi-arm/recipes-digi/cryptoauthlib/cryptoauthlib_git.bb @@ -7,10 +7,10 @@ LIC_FILES_CHKSUM = "file://license.txt;md5=84f2905dc39d2f8cdffb00af6f9e6d4e" SRCREV = "a0007d2f6c42fddab5dca1575e0f404788829ddc" -GIT_URI ?= "git://github.com/MicrochipTech/cryptoauthlib.git;protocol=https;branch=master" +GIT_URI ?= "git://github.com/digi-embedded/cryptoauthlib.git;protocol=https;nobranch=1" SRC_URI = " \ - ${GIT_URI};nobranch=1 \ + ${GIT_URI} \ file://0001-lib-add-parameters-to-be-able-to-modify-default-I2C-.patch \ file://0002-lib-apply-library-version-number-to-CMake-VERSION-pr.patch \ file://0003-pkcs11-rename-template-configuration-file-to-its-int.patch \ From 8718734b46f8091fb059d7b05440d458b702a89c Mon Sep 17 00:00:00 2001 From: Tatiana Leon Date: Tue, 18 Apr 2023 10:23:08 +0200 Subject: [PATCH 034/100] ccimx6: ccimx6ul: ccimx8m: ccimx8x: ccimx93: install: only install system A by default, add an option to install B https://onedigi.atlassian.net/browse/DEL-8232 Signed-off-by: Tatiana Leon --- .../ccimx6qpsbc/install_linux_fw_sd.txt | 53 +++++++++++-------- .../ccimx6qpsbc/install_linux_fw_usb.txt | 53 +++++++++++-------- .../ccimx6qpsbc/install_linux_fw_uuu.sh | 22 +++++--- .../ccimx6sbc/install_linux_fw_sd.txt | 53 +++++++++++-------- .../ccimx6sbc/install_linux_fw_usb.txt | 53 +++++++++++-------- .../ccimx6sbc/install_linux_fw_uuu.sh | 22 +++++--- .../ccimx6ul/install_linux_fw_sd.txt | 53 +++++++++++-------- .../ccimx6ul/install_linux_fw_usb.txt | 53 +++++++++++-------- .../ccimx6ul/install_linux_fw_uuu.sh | 22 +++++--- .../ccimx8m/install_linux_fw_sd.txt | 53 +++++++++++-------- .../ccimx8m/install_linux_fw_usb.txt | 53 +++++++++++-------- .../ccimx8m/install_linux_fw_uuu.sh | 22 +++++--- .../ccimx8x/install_linux_fw_sd.txt | 53 +++++++++++-------- .../ccimx8x/install_linux_fw_usb.txt | 53 +++++++++++-------- .../ccimx8x/install_linux_fw_uuu.sh | 22 +++++--- .../ccimx93/install_linux_fw_sd.txt | 53 +++++++++++-------- .../ccimx93/install_linux_fw_usb.txt | 53 +++++++++++-------- .../ccimx93/install_linux_fw_uuu.sh | 22 +++++--- 18 files changed, 468 insertions(+), 300 deletions(-) diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6qpsbc/install_linux_fw_sd.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6qpsbc/install_linux_fw_sd.txt index 18383bde5..3f953a5a7 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6qpsbc/install_linux_fw_sd.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6qpsbc/install_linux_fw_sd.txt @@ -79,9 +79,13 @@ echo " --------- --------" echo " bootloader ${INSTALL_UBOOT_FILENAME}" if test "${dualboot}" = "yes"; then echo " linux_a ${INSTALL_LINUX_FILENAME}" - echo " linux_b ${INSTALL_LINUX_FILENAME}" + if test "${install_dualboot}" = "yes"; then + echo " linux_b ${INSTALL_LINUX_FILENAME}" + fi echo " rootfs_a ${INSTALL_ROOTFS_FILENAME}" - echo " rootfs_b ${INSTALL_ROOTFS_FILENAME}" + if test "${install_dualboot}" = "yes"; then + echo " rootfs_b ${INSTALL_ROOTFS_FILENAME}" + fi else echo " linux ${INSTALL_LINUX_FILENAME}" echo " recovery ${INSTALL_RECOVERY_FILENAME}" @@ -136,6 +140,7 @@ fi setenv bootcmd " env default -a; setenv dualboot ${dualboot}; + setenv install_dualboot ${install_dualboot}; saveenv; echo \"\"; echo \"\"; @@ -162,17 +167,19 @@ setenv bootcmd " echo \"Aborted.\"; exit; fi; - echo \"\"; - echo \"\"; - echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux_b\"; - echo \"\"; - echo \"\"; - update linux_b mmc ${INSTALL_MMCDEV} ${INSTALL_LINUX_FILENAME}; - if test \$? -eq 1; then - echo \"[ERROR] Failed to update linux_b!\"; + if test \"\$\{install_dualboot\}\" = yes; then echo \"\"; - echo \"Aborted.\"; - exit; + echo \"\"; + echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux_b\"; + echo \"\"; + echo \"\"; + update linux_b mmc ${INSTALL_MMCDEV} ${INSTALL_LINUX_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update linux_b!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; fi; echo \"\"; echo \"\"; @@ -186,17 +193,19 @@ setenv bootcmd " echo \"Aborted.\"; exit; fi; - echo \"\"; - echo \"\"; - echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs_b\"; - echo \"\"; - echo \"\"; - update rootfs_b mmc ${INSTALL_MMCDEV} ${INSTALL_ROOTFS_FILENAME}; - if test \$? -eq 1; then - echo \"[ERROR] Failed to update rootfs_b partition!\"; + if test \"\$\{install_dualboot\}\" = yes; then echo \"\"; - echo \"Aborted.\"; - exit; + echo \"\"; + echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs_b\"; + echo \"\"; + echo \"\"; + update rootfs_b mmc ${INSTALL_MMCDEV} ${INSTALL_ROOTFS_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update rootfs_b partition!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; fi; else echo \"\"; diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6qpsbc/install_linux_fw_usb.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6qpsbc/install_linux_fw_usb.txt index f826b27c5..1810e52f5 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6qpsbc/install_linux_fw_usb.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6qpsbc/install_linux_fw_usb.txt @@ -79,9 +79,13 @@ echo " --------- --------" echo " bootloader ${INSTALL_UBOOT_FILENAME}" if test "${dualboot}" = "yes"; then echo " linux_a ${INSTALL_LINUX_FILENAME}" - echo " linux_b ${INSTALL_LINUX_FILENAME}" + if test "${install_dualboot}" = "yes"; then + echo " linux_b ${INSTALL_LINUX_FILENAME}" + fi echo " rootfs_a ${INSTALL_ROOTFS_FILENAME}" - echo " rootfs_b ${INSTALL_ROOTFS_FILENAME}" + if test "${install_dualboot}" = "yes"; then + echo " rootfs_b ${INSTALL_ROOTFS_FILENAME}" + fi else echo " linux ${INSTALL_LINUX_FILENAME}" echo " recovery ${INSTALL_RECOVERY_FILENAME}" @@ -137,6 +141,7 @@ fi setenv bootcmd " env default -a; setenv dualboot ${dualboot}; + setenv install_dualboot ${install_dualboot}; saveenv; echo \"\"; echo \"\"; @@ -164,17 +169,19 @@ setenv bootcmd " echo \"Aborted.\"; exit; fi; - echo \"\"; - echo \"\"; - echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux_b\"; - echo \"\"; - echo \"\"; - update linux_b usb ${INSTALL_USBDEV} ${INSTALL_LINUX_FILENAME}; - if test \$? -eq 1; then - echo \"[ERROR] Failed to update linux_b!\"; + if test \"\$\{install_dualboot\}\" = yes; then echo \"\"; - echo \"Aborted.\"; - exit; + echo \"\"; + echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux_b\"; + echo \"\"; + echo \"\"; + update linux_b usb ${INSTALL_USBDEV} ${INSTALL_LINUX_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update linux_b!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; fi; usb reset; echo \"\"; @@ -189,17 +196,19 @@ setenv bootcmd " echo \"Aborted.\"; exit; fi; - echo \"\"; - echo \"\"; - echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs_b\"; - echo \"\"; - echo \"\"; - update rootfs_b usb ${INSTALL_USBDEV} ${INSTALL_ROOTFS_FILENAME}; - if test \$? -eq 1; then - echo \"[ERROR] Failed to update rootfs_b partition!\"; + if test \"\$\{install_dualboot\}\" = yes; then echo \"\"; - echo \"Aborted.\"; - exit; + echo \"\"; + echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs_b\"; + echo \"\"; + echo \"\"; + update rootfs_b usb ${INSTALL_USBDEV} ${INSTALL_ROOTFS_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update rootfs_b partition!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; fi; else echo \"\"; diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6qpsbc/install_linux_fw_uuu.sh b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6qpsbc/install_linux_fw_uuu.sh index f743bfbf1..851d48f49 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6qpsbc/install_linux_fw_uuu.sh +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6qpsbc/install_linux_fw_uuu.sh @@ -1,7 +1,7 @@ #!/bin/sh #=============================================================================== # -# Copyright (C) 2021 by Digi International Inc. +# Copyright (C) 2021-2023 by Digi International Inc. # All rights reserved. # # This program is free software; you can redistribute it and/or modify it @@ -39,6 +39,7 @@ show_usage() echo " -n No wait. Skips 10 seconds delay to stop script." echo " -u U-Boot filename." echo " Auto-determined by variant if not provided." + echo " -d Install firmware on dualboot partitions (system A and system B)." exit 2 } @@ -69,9 +70,10 @@ echo "############################################################" # Command line admits the following parameters: # -u # -i -while getopts 'hi:nu:' c +while getopts 'dhi:nu:' c do case $c in + d) INSTALL_DUALBOOT=true ;; h) show_usage ;; i) IMAGE_NAME=${OPTARG} ;; n) NOWAIT=true ;; @@ -192,9 +194,13 @@ if [ "${NOWAIT}" != true ]; then printf " bootloader\t${INSTALL_UBOOT_FILENAME}\n" if [ "${DUALBOOT}" = true ]; then printf " ${LINUX_NAME}_a\t${INSTALL_LINUX_FILENAME}\n" - printf " ${LINUX_NAME}_b\t${INSTALL_LINUX_FILENAME}\n" + if [ "${INSTALL_DUALBOOT}" = true ]; then + printf " ${LINUX_NAME}_b\t${INSTALL_LINUX_FILENAME}\n" + fi printf " ${ROOTFS_NAME}_a\t${INSTALL_ROOTFS_FILENAME}\n" - printf " ${ROOTFS_NAME}_b\t${INSTALL_ROOTFS_FILENAME}\n" + if [ "${INSTALL_DUALBOOT}" = true ]; then + printf " ${ROOTFS_NAME}_b\t${INSTALL_ROOTFS_FILENAME}\n" + fi else printf " ${LINUX_NAME}\t${INSTALL_LINUX_FILENAME}\n" printf " ${RECOVERY_NAME}\t${INSTALL_RECOVERY_FILENAME}\n" @@ -270,11 +276,15 @@ if [ "${DUALBOOT}" = true ]; then # Update Linux A part_update "${LINUX_NAME}_a" "${INSTALL_LINUX_FILENAME}" # Update Linux B - part_update "${LINUX_NAME}_b" "${INSTALL_LINUX_FILENAME}" + if [ "${INSTALL_DUALBOOT}" = true ]; then + part_update "${LINUX_NAME}_b" "${INSTALL_LINUX_FILENAME}" + fi # Update Rootfs A part_update "${ROOTFS_NAME}_a" "${INSTALL_ROOTFS_FILENAME}" # Update Rootfs B - part_update "${ROOTFS_NAME}_b" "${INSTALL_ROOTFS_FILENAME}" + if [ "${INSTALL_DUALBOOT}" = true ]; then + part_update "${ROOTFS_NAME}_b" "${INSTALL_ROOTFS_FILENAME}" + fi else # Update Linux part_update "${LINUX_NAME}" "${INSTALL_LINUX_FILENAME}" diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6sbc/install_linux_fw_sd.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6sbc/install_linux_fw_sd.txt index 16ca00ab1..c0d368393 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6sbc/install_linux_fw_sd.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6sbc/install_linux_fw_sd.txt @@ -90,9 +90,13 @@ echo " --------- --------" echo " bootloader ${INSTALL_UBOOT_FILENAME}" if test "${dualboot}" = "yes"; then echo " linux_a ${INSTALL_LINUX_FILENAME}" - echo " linux_b ${INSTALL_LINUX_FILENAME}" + if test "${install_dualboot}" = "yes"; then + echo " linux_b ${INSTALL_LINUX_FILENAME}" + fi echo " rootfs_a ${INSTALL_ROOTFS_FILENAME}" - echo " rootfs_b ${INSTALL_ROOTFS_FILENAME}" + if test "${install_dualboot}" = "yes"; then + echo " rootfs_b ${INSTALL_ROOTFS_FILENAME}" + fi else echo " linux ${INSTALL_LINUX_FILENAME}" echo " recovery ${INSTALL_RECOVERY_FILENAME}" @@ -147,6 +151,7 @@ fi setenv bootcmd " env default -a; setenv dualboot ${dualboot}; + setenv install_dualboot ${install_dualboot}; saveenv; echo \"\"; echo \"\"; @@ -173,17 +178,19 @@ setenv bootcmd " echo \"Aborted.\"; exit; fi; - echo \"\"; - echo \"\"; - echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux_b\"; - echo \"\"; - echo \"\"; - update linux_b mmc ${INSTALL_MMCDEV} ${INSTALL_LINUX_FILENAME}; - if test \$? -eq 1; then - echo \"[ERROR] Failed to update linux_b!\"; + if test \"\$\{install_dualboot\}\" = yes; then echo \"\"; - echo \"Aborted.\"; - exit; + echo \"\"; + echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux_b\"; + echo \"\"; + echo \"\"; + update linux_b mmc ${INSTALL_MMCDEV} ${INSTALL_LINUX_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update linux_b!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; fi; echo \"\"; echo \"\"; @@ -197,17 +204,19 @@ setenv bootcmd " echo \"Aborted.\"; exit; fi; - echo \"\"; - echo \"\"; - echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs_b\"; - echo \"\"; - echo \"\"; - update rootfs_b mmc ${INSTALL_MMCDEV} ${INSTALL_ROOTFS_FILENAME}; - if test \$? -eq 1; then - echo \"[ERROR] Failed to update rootfs_b partition!\"; + if test \"\$\{install_dualboot\}\" = yes; then echo \"\"; - echo \"Aborted.\"; - exit; + echo \"\"; + echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs_b\"; + echo \"\"; + echo \"\"; + update rootfs_b mmc ${INSTALL_MMCDEV} ${INSTALL_ROOTFS_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update rootfs_b partition!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; fi; else echo \"\"; diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6sbc/install_linux_fw_usb.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6sbc/install_linux_fw_usb.txt index b2e0d13ca..cf7de617b 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6sbc/install_linux_fw_usb.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6sbc/install_linux_fw_usb.txt @@ -90,9 +90,13 @@ echo " --------- --------" echo " bootloader ${INSTALL_UBOOT_FILENAME}" if test "${dualboot}" = "yes"; then echo " linux_a ${INSTALL_LINUX_FILENAME}" - echo " linux_b ${INSTALL_LINUX_FILENAME}" + if test "${install_dualboot}" = "yes"; then + echo " linux_b ${INSTALL_LINUX_FILENAME}" + fi echo " rootfs_a ${INSTALL_ROOTFS_FILENAME}" - echo " rootfs_b ${INSTALL_ROOTFS_FILENAME}" + if test "${install_dualboot}" = "yes"; then + echo " rootfs_b ${INSTALL_ROOTFS_FILENAME}" + fi else echo " linux ${INSTALL_LINUX_FILENAME}" echo " recovery ${INSTALL_RECOVERY_FILENAME}" @@ -148,6 +152,7 @@ fi setenv bootcmd " env default -a; setenv dualboot ${dualboot}; + setenv install_dualboot ${install_dualboot}; saveenv; echo \"\"; echo \"\"; @@ -175,17 +180,19 @@ setenv bootcmd " echo \"Aborted.\"; exit; fi; - echo \"\"; - echo \"\"; - echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux_b\"; - echo \"\"; - echo \"\"; - update linux_b usb ${INSTALL_USBDEV} ${INSTALL_LINUX_FILENAME}; - if test \$? -eq 1; then - echo \"[ERROR] Failed to update linux_b!\"; + if test \"\$\{install_dualboot\}\" = yes; then echo \"\"; - echo \"Aborted.\"; - exit; + echo \"\"; + echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux_b\"; + echo \"\"; + echo \"\"; + update linux_b usb ${INSTALL_USBDEV} ${INSTALL_LINUX_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update linux_b!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; fi; usb reset; echo \"\"; @@ -200,17 +207,19 @@ setenv bootcmd " echo \"Aborted.\"; exit; fi; - echo \"\"; - echo \"\"; - echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs_b\"; - echo \"\"; - echo \"\"; - update rootfs_b usb ${INSTALL_USBDEV} ${INSTALL_ROOTFS_FILENAME}; - if test \$? -eq 1; then - echo \"[ERROR] Failed to update rootfs_b partition!\"; + if test \"\$\{install_dualboot\}\" = yes; then echo \"\"; - echo \"Aborted.\"; - exit; + echo \"\"; + echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs_b\"; + echo \"\"; + echo \"\"; + update rootfs_b usb ${INSTALL_USBDEV} ${INSTALL_ROOTFS_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update rootfs_b partition!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; fi; else echo \"\"; diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6sbc/install_linux_fw_uuu.sh b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6sbc/install_linux_fw_uuu.sh index 0ca7a02ef..104ae53c1 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6sbc/install_linux_fw_uuu.sh +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6sbc/install_linux_fw_uuu.sh @@ -1,7 +1,7 @@ #!/bin/sh #=============================================================================== # -# Copyright (C) 2021 by Digi International Inc. +# Copyright (C) 2021-2023 by Digi International Inc. # All rights reserved. # # This program is free software; you can redistribute it and/or modify it @@ -39,6 +39,7 @@ show_usage() echo " -n No wait. Skips 10 seconds delay to stop script." echo " -u U-Boot filename." echo " Auto-determined by variant if not provided." + echo " -d Install firmware on dualboot partitions (system A and system B)." exit 2 } @@ -69,9 +70,10 @@ echo "############################################################" # Command line admits the following parameters: # -u # -i -while getopts 'hi:nu:' c +while getopts 'dhi:nu:' c do case $c in + d) INSTALL_DUALBOOT=true ;; h) show_usage ;; i) IMAGE_NAME=${OPTARG} ;; n) NOWAIT=true ;; @@ -210,9 +212,13 @@ if [ "${NOWAIT}" != true ]; then printf " bootloader\t${INSTALL_UBOOT_FILENAME}\n" if [ "${DUALBOOT}" = true ]; then printf " ${LINUX_NAME}_a\t${INSTALL_LINUX_FILENAME}\n" - printf " ${LINUX_NAME}_b\t${INSTALL_LINUX_FILENAME}\n" + if [ "${INSTALL_DUALBOOT}" = true ]; then + printf " ${LINUX_NAME}_b\t${INSTALL_LINUX_FILENAME}\n" + fi printf " ${ROOTFS_NAME}_a\t${INSTALL_ROOTFS_FILENAME}\n" - printf " ${ROOTFS_NAME}_b\t${INSTALL_ROOTFS_FILENAME}\n" + if [ "${INSTALL_DUALBOOT}" = true ]; then + printf " ${ROOTFS_NAME}_b\t${INSTALL_ROOTFS_FILENAME}\n" + fi else printf " ${LINUX_NAME}\t${INSTALL_LINUX_FILENAME}\n" printf " ${RECOVERY_NAME}\t${INSTALL_RECOVERY_FILENAME}\n" @@ -288,11 +294,15 @@ if [ "${DUALBOOT}" = true ]; then # Update Linux A part_update "${LINUX_NAME}_a" "${INSTALL_LINUX_FILENAME}" # Update Linux B - part_update "${LINUX_NAME}_b" "${INSTALL_LINUX_FILENAME}" + if [ "${INSTALL_DUALBOOT}" = true ]; then + part_update "${LINUX_NAME}_b" "${INSTALL_LINUX_FILENAME}" + fi # Update Rootfs A part_update "${ROOTFS_NAME}_a" "${INSTALL_ROOTFS_FILENAME}" # Update Rootfs B - part_update "${ROOTFS_NAME}_b" "${INSTALL_ROOTFS_FILENAME}" + if [ "${INSTALL_DUALBOOT}" = true ]; then + part_update "${ROOTFS_NAME}_b" "${INSTALL_ROOTFS_FILENAME}" + fi else # Update Linux part_update "${LINUX_NAME}" "${INSTALL_LINUX_FILENAME}" diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ul/install_linux_fw_sd.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ul/install_linux_fw_sd.txt index 673d3af4d..785a67e96 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ul/install_linux_fw_sd.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ul/install_linux_fw_sd.txt @@ -83,9 +83,13 @@ echo " --------- --------" echo " bootloader ${INSTALL_UBOOT_FILENAME}" if test "${dualboot}" = "yes"; then echo " linux_a ${INSTALL_LINUX_FILENAME}" - echo " linux_b ${INSTALL_LINUX_FILENAME}" + if test "${install_dualboot}" = "yes"; then + echo " linux_b ${INSTALL_LINUX_FILENAME}" + fi echo " rootfs_a ${INSTALL_ROOTFS_FILENAME}" - echo " rootfs_b ${INSTALL_ROOTFS_FILENAME}" + if test "${install_dualboot}" = "yes"; then + echo " rootfs_b ${INSTALL_ROOTFS_FILENAME}" + fi else echo " linux ${INSTALL_LINUX_FILENAME}" echo " recovery ${INSTALL_RECOVERY_FILENAME}" @@ -142,6 +146,7 @@ setenv bootcmd " env default -a; setenv singlemtdsys ${singlemtdsys}; setenv dualboot ${dualboot}; + setenv install_dualboot ${install_dualboot}; run partition_nand_linux; saveenv; if test \"\$\{singlemtdsys\}\" = yes; then @@ -162,17 +167,19 @@ setenv bootcmd " echo \"Aborted.\"; exit; fi; - echo \"\"; - echo \"\"; - echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux_b\"; - echo \"\"; - echo \"\"; - update linux_b mmc ${INSTALL_MMCDEV} ${INSTALL_LINUX_FILENAME} ${force_erase}; - if test \$? -eq 1; then - echo \"[ERROR] Failed to update linux_b!\"; + if test \"\$\{install_dualboot\}\" = yes; then echo \"\"; - echo \"Aborted.\"; - exit; + echo \"\"; + echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux_b\"; + echo \"\"; + echo \"\"; + update linux_b mmc ${INSTALL_MMCDEV} ${INSTALL_LINUX_FILENAME} ${force_erase}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update linux_b!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; fi; echo \"\"; echo \"\"; @@ -186,17 +193,19 @@ setenv bootcmd " echo \"Aborted.\"; exit; fi; - echo \"\"; - echo \"\"; - echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs_b\"; - echo \"\"; - echo \"\"; - update rootfs_b mmc ${INSTALL_MMCDEV} ${INSTALL_ROOTFS_FILENAME} ${force_erase}; - if test \$? -eq 1; then - echo \"[ERROR] Failed to update rootfs_b partition!\"; + if test \"\$\{install_dualboot\}\" = yes; then echo \"\"; - echo \"Aborted.\"; - exit; + echo \"\"; + echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs_b\"; + echo \"\"; + echo \"\"; + update rootfs_b mmc ${INSTALL_MMCDEV} ${INSTALL_ROOTFS_FILENAME} ${force_erase}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update rootfs_b partition!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; fi; else echo \"\"; diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ul/install_linux_fw_usb.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ul/install_linux_fw_usb.txt index b751ed48a..71195f38d 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ul/install_linux_fw_usb.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ul/install_linux_fw_usb.txt @@ -83,9 +83,13 @@ echo " --------- --------" echo " bootloader ${INSTALL_UBOOT_FILENAME}" if test "${dualboot}" = "yes"; then echo " linux_a ${INSTALL_LINUX_FILENAME}" - echo " linux_b ${INSTALL_LINUX_FILENAME}" + if test "${install_dualboot}" = "yes"; then + echo " linux_b ${INSTALL_LINUX_FILENAME}" + fi echo " rootfs_a ${INSTALL_ROOTFS_FILENAME}" - echo " rootfs_b ${INSTALL_ROOTFS_FILENAME}" + if test "${install_dualboot}" = "yes"; then + echo " rootfs_b ${INSTALL_ROOTFS_FILENAME}" + fi else echo " linux ${INSTALL_LINUX_FILENAME}" echo " recovery ${INSTALL_RECOVERY_FILENAME}" @@ -142,6 +146,7 @@ setenv bootcmd " env default -a; setenv singlemtdsys ${singlemtdsys}; setenv dualboot ${dualboot}; + setenv install_dualboot ${install_dualboot}; run partition_nand_linux; saveenv; if test \"\$\{singlemtdsys\}\" = yes; then @@ -163,17 +168,19 @@ setenv bootcmd " echo \"Aborted.\"; exit; fi; - echo \"\"; - echo \"\"; - echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux_b\"; - echo \"\"; - echo \"\"; - update linux_b usb ${INSTALL_USBDEV} ${INSTALL_LINUX_FILENAME} ${force_erase}; - if test \$? -eq 1; then - echo \"[ERROR] Failed to update linux_b!\"; + if test \"\$\{install_dualboot\}\" = yes; then echo \"\"; - echo \"Aborted.\"; - exit; + echo \"\"; + echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux_b\"; + echo \"\"; + echo \"\"; + update linux_b usb ${INSTALL_USBDEV} ${INSTALL_LINUX_FILENAME} ${force_erase}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update linux_b!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; fi; echo \"\"; echo \"\"; @@ -187,17 +194,19 @@ setenv bootcmd " echo \"Aborted.\"; exit; fi; - echo \"\"; - echo \"\"; - echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs_b\"; - echo \"\"; - echo \"\"; - update rootfs_b usb ${INSTALL_USBDEV} ${INSTALL_ROOTFS_FILENAME} ${force_erase}; - if test \$? -eq 1; then - echo \"[ERROR] Failed to update rootfs_b partition!\"; + if test \"\$\{install_dualboot\}\" = yes; then echo \"\"; - echo \"Aborted.\"; - exit; + echo \"\"; + echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs_b\"; + echo \"\"; + echo \"\"; + update rootfs_b usb ${INSTALL_USBDEV} ${INSTALL_ROOTFS_FILENAME} ${force_erase}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update rootfs_b partition!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; fi; else echo \"\"; diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ul/install_linux_fw_uuu.sh b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ul/install_linux_fw_uuu.sh index 3ef6f114d..598dbf7f8 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ul/install_linux_fw_uuu.sh +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ul/install_linux_fw_uuu.sh @@ -1,7 +1,7 @@ #!/bin/sh #=============================================================================== # -# Copyright (C) 2020-2021 by Digi International Inc. +# Copyright (C) 2020-2023 by Digi International Inc. # All rights reserved. # # This program is free software; you can redistribute it and/or modify it @@ -39,6 +39,7 @@ show_usage() echo " -n No wait. Skips 10 seconds delay to stop script." echo " -u U-Boot filename." echo " Auto-determined by variant if not provided." + echo " -d Install firmware on dualboot partitions (system A and system B)." exit 2 } @@ -78,9 +79,10 @@ echo "############################################################" # Command line admits the following parameters: # -u # -i -while getopts 'hi:nu:' c +while getopts 'dhi:nu:' c do case $c in + d) INSTALL_DUALBOOT=true ;; h) show_usage ;; i) IMAGE_NAME=${OPTARG} ;; n) NOWAIT=true ;; @@ -199,9 +201,13 @@ if [ "${NOWAIT}" != true ]; then printf " bootloader\t${INSTALL_UBOOT_FILENAME}\n" if [ "${DUALBOOT}" = true ]; then printf " ${LINUX_NAME}_a\t${INSTALL_LINUX_FILENAME}\n" - printf " ${LINUX_NAME}_b\t${INSTALL_LINUX_FILENAME}\n" + if [ "${INSTALL_DUALBOOT}" = true ]; then + printf " ${LINUX_NAME}_b\t${INSTALL_LINUX_FILENAME}\n" + fi printf " ${ROOTFS_NAME}_a\t${INSTALL_ROOTFS_FILENAME}\n" - printf " ${ROOTFS_NAME}_b\t${INSTALL_ROOTFS_FILENAME}\n" + if [ "${INSTALL_DUALBOOT}" = true ]; then + printf " ${ROOTFS_NAME}_b\t${INSTALL_ROOTFS_FILENAME}\n" + fi else printf " ${LINUX_NAME}\t${INSTALL_LINUX_FILENAME}\n" printf " ${RECOVERY_NAME}\t${INSTALL_RECOVERY_FILENAME}\n" @@ -269,11 +275,15 @@ if [ "${DUALBOOT}" = true ]; then # Update Linux A part_update "${LINUX_NAME}_a" "${INSTALL_LINUX_FILENAME}" 15000 # Update Linux B - part_update "${LINUX_NAME}_b" "${INSTALL_LINUX_FILENAME}" 15000 + if [ "${INSTALL_DUALBOOT}" = true ]; then + part_update "${LINUX_NAME}_b" "${INSTALL_LINUX_FILENAME}" 15000 + fi # Update Rootfs A part_update "${ROOTFS_NAME}_a" "${INSTALL_ROOTFS_FILENAME}" 90000 # Update Rootfs B - part_update "${ROOTFS_NAME}_b" "${INSTALL_ROOTFS_FILENAME}" 90000 + if [ "${INSTALL_DUALBOOT}" = true ]; then + part_update "${ROOTFS_NAME}_b" "${INSTALL_ROOTFS_FILENAME}" 90000 + fi else # Update Linux part_update "${LINUX_NAME}" "${INSTALL_LINUX_FILENAME}" 15000 diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8m/install_linux_fw_sd.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8m/install_linux_fw_sd.txt index e7deac14b..3a50597f0 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8m/install_linux_fw_sd.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8m/install_linux_fw_sd.txt @@ -50,9 +50,13 @@ echo " --------- --------" echo " bootloader ${INSTALL_UBOOT_FILENAME}" if test "${dualboot}" = "yes"; then echo " linux_a ${INSTALL_LINUX_FILENAME}" - echo " linux_b ${INSTALL_LINUX_FILENAME}" + if test "${install_dualboot}" = "yes"; then + echo " linux_b ${INSTALL_LINUX_FILENAME}" + fi echo " rootfs_a ${INSTALL_ROOTFS_FILENAME}" - echo " rootfs_b ${INSTALL_ROOTFS_FILENAME}" + if test "${install_dualboot}" = "yes"; then + echo " rootfs_b ${INSTALL_ROOTFS_FILENAME}" + fi else echo " linux ${INSTALL_LINUX_FILENAME}" echo " recovery ${INSTALL_RECOVERY_FILENAME}" @@ -112,6 +116,7 @@ fi setenv bootcmd " env default -a; setenv dualboot ${dualboot}; + setenv install_dualboot ${install_dualboot}; saveenv; setenv otf-update yes; echo \"\"; @@ -139,17 +144,19 @@ setenv bootcmd " echo \"Aborted.\"; exit; fi; - echo \"\"; - echo \"\"; - echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux_b\"; - echo \"\"; - echo \"\"; - update linux_b mmc ${INSTALL_MMCDEV} ${INSTALL_LINUX_FILENAME}; - if test \$? -eq 1; then - echo \"[ERROR] Failed to update linux_b!\"; + if test \"\$\{install_dualboot\}\" = yes; then echo \"\"; - echo \"Aborted.\"; - exit; + echo \"\"; + echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux_b\"; + echo \"\"; + echo \"\"; + update linux_b mmc ${INSTALL_MMCDEV} ${INSTALL_LINUX_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update linux_b!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; fi; echo \"\"; echo \"\"; @@ -163,17 +170,19 @@ setenv bootcmd " echo \"Aborted.\"; exit; fi; - echo \"\"; - echo \"\"; - echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs_b\"; - echo \"\"; - echo \"\"; - update rootfs_b mmc ${INSTALL_MMCDEV} ${INSTALL_ROOTFS_FILENAME}; - if test \$? -eq 1; then - echo \"[ERROR] Failed to update rootfs_b partition!\"; + if test \"\$\{install_dualboot\}\" = yes; then echo \"\"; - echo \"Aborted.\"; - exit; + echo \"\"; + echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs_b\"; + echo \"\"; + echo \"\"; + update rootfs_b mmc ${INSTALL_MMCDEV} ${INSTALL_ROOTFS_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update rootfs_b partition!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; fi; else echo \"\"; diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8m/install_linux_fw_usb.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8m/install_linux_fw_usb.txt index 1eb95d3bf..e916de50e 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8m/install_linux_fw_usb.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8m/install_linux_fw_usb.txt @@ -50,9 +50,13 @@ echo " --------- --------" echo " bootloader ${INSTALL_UBOOT_FILENAME}" if test "${dualboot}" = "yes"; then echo " linux_a ${INSTALL_LINUX_FILENAME}" - echo " linux_b ${INSTALL_LINUX_FILENAME}" + if test "${install_dualboot}" = "yes"; then + echo " linux_b ${INSTALL_LINUX_FILENAME}" + fi echo " rootfs_a ${INSTALL_ROOTFS_FILENAME}" - echo " rootfs_b ${INSTALL_ROOTFS_FILENAME}" + if test "${install_dualboot}" = "yes"; then + echo " rootfs_b ${INSTALL_ROOTFS_FILENAME}" + fi else echo " linux ${INSTALL_LINUX_FILENAME}" echo " recovery ${INSTALL_RECOVERY_FILENAME}" @@ -112,6 +116,7 @@ fi setenv bootcmd " env default -a; setenv dualboot ${dualboot}; + setenv install_dualboot ${install_dualboot}; saveenv; setenv otf-update yes; echo \"\"; @@ -140,17 +145,19 @@ setenv bootcmd " echo \"Aborted.\"; exit; fi; - echo \"\"; - echo \"\"; - echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux_b\"; - echo \"\"; - echo \"\"; - update linux_b usb ${INSTALL_USBDEV} ${INSTALL_LINUX_FILENAME}; - if test \$? -eq 1; then - echo \"[ERROR] Failed to update linux_b!\"; + if test \"\$\{install_dualboot\}\" = yes; then echo \"\"; - echo \"Aborted.\"; - exit; + echo \"\"; + echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux_b\"; + echo \"\"; + echo \"\"; + update linux_b usb ${INSTALL_USBDEV} ${INSTALL_LINUX_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update linux_b!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; fi; echo \"\"; echo \"\"; @@ -164,17 +171,19 @@ setenv bootcmd " echo \"Aborted.\"; exit; fi; - echo \"\"; - echo \"\"; - echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs_b\"; - echo \"\"; - echo \"\"; - update rootfs_b usb ${INSTALL_USBDEV} ${INSTALL_ROOTFS_FILENAME}; - if test \$? -eq 1; then - echo \"[ERROR] Failed to update rootfs_b partition!\"; + if test \"\$\{install_dualboot\}\" = yes; then echo \"\"; - echo \"Aborted.\"; - exit; + echo \"\"; + echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs_b\"; + echo \"\"; + echo \"\"; + update rootfs_b usb ${INSTALL_USBDEV} ${INSTALL_ROOTFS_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update rootfs_b partition!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; fi; else echo \"\"; diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8m/install_linux_fw_uuu.sh b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8m/install_linux_fw_uuu.sh index d580e5c02..f819e6aec 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8m/install_linux_fw_uuu.sh +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8m/install_linux_fw_uuu.sh @@ -1,7 +1,7 @@ #!/bin/sh #=============================================================================== # -# Copyright (C) 2020-2021 by Digi International Inc. +# Copyright (C) 2020-2023 by Digi International Inc. # All rights reserved. # # This program is free software; you can redistribute it and/or modify it @@ -39,6 +39,7 @@ show_usage() echo " -n No wait. Skips 10 seconds delay to stop script." echo " -u U-Boot filename." echo " Auto-determined by variant if not provided." + echo " -d Install firmware on dualboot partitions (system A and system B)." exit 2 } @@ -69,9 +70,10 @@ echo "############################################################" # Command line admits the following parameters: # -u # -i -while getopts 'hi:nu:' c +while getopts 'dhi:nu:' c do case $c in + d) INSTALL_DUALBOOT=true ;; h) show_usage ;; i) IMAGE_NAME=${OPTARG} ;; n) NOWAIT=true ;; @@ -158,9 +160,13 @@ if [ "${NOWAIT}" != true ]; then printf " bootloader\t${INSTALL_UBOOT_FILENAME}\n" if [ "${DUALBOOT}" = true ]; then printf " ${LINUX_NAME}_a\t${INSTALL_LINUX_FILENAME}\n" - printf " ${LINUX_NAME}_b\t${INSTALL_LINUX_FILENAME}\n" + if [ "${INSTALL_DUALBOOT}" = true ]; then + printf " ${LINUX_NAME}_b\t${INSTALL_LINUX_FILENAME}\n" + fi printf " ${ROOTFS_NAME}_a\t${INSTALL_ROOTFS_FILENAME}\n" - printf " ${ROOTFS_NAME}_b\t${INSTALL_ROOTFS_FILENAME}\n" + if [ "${INSTALL_DUALBOOT}" = true ]; then + printf " ${ROOTFS_NAME}_b\t${INSTALL_ROOTFS_FILENAME}\n" + fi else printf " ${LINUX_NAME}\t${INSTALL_LINUX_FILENAME}\n" printf " ${RECOVERY_NAME}\t${INSTALL_RECOVERY_FILENAME}\n" @@ -239,11 +245,15 @@ if [ "${DUALBOOT}" = true ]; then # Update Linux A part_update "${LINUX_NAME}_a" "${INSTALL_LINUX_FILENAME}" # Update Linux B - part_update "${LINUX_NAME}_b" "${INSTALL_LINUX_FILENAME}" + if [ "${INSTALL_DUALBOOT}" = true ]; then + part_update "${LINUX_NAME}_b" "${INSTALL_LINUX_FILENAME}" + fi # Update Rootfs A part_update "${ROOTFS_NAME}_a" "${INSTALL_ROOTFS_FILENAME}" # Update Rootfs B - part_update "${ROOTFS_NAME}_b" "${INSTALL_ROOTFS_FILENAME}" + if [ "${INSTALL_DUALBOOT}" = true ]; then + part_update "${ROOTFS_NAME}_b" "${INSTALL_ROOTFS_FILENAME}" + fi else # Update Linux part_update "${LINUX_NAME}" "${INSTALL_LINUX_FILENAME}" diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x/install_linux_fw_sd.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x/install_linux_fw_sd.txt index 350449e06..d405e4ebb 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x/install_linux_fw_sd.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x/install_linux_fw_sd.txt @@ -121,9 +121,13 @@ echo " --------- --------" echo " bootloader ${INSTALL_UBOOT_FILENAME}" if test "${dualboot}" = "yes"; then echo " linux_a ${INSTALL_LINUX_FILENAME}" - echo " linux_b ${INSTALL_LINUX_FILENAME}" + if test "${install_dualboot}" = "yes"; then + echo " linux_b ${INSTALL_LINUX_FILENAME}" + fi echo " rootfs_a ${INSTALL_ROOTFS_FILENAME}" - echo " rootfs_b ${INSTALL_ROOTFS_FILENAME}" + if test "${install_dualboot}" = "yes"; then + echo " rootfs_b ${INSTALL_ROOTFS_FILENAME}" + fi else echo " linux ${INSTALL_LINUX_FILENAME}" echo " recovery ${INSTALL_RECOVERY_FILENAME}" @@ -183,6 +187,7 @@ fi setenv bootcmd " env default -a; setenv dualboot ${dualboot}; + setenv install_dualboot ${install_dualboot}; saveenv; setenv otf-update yes; echo \"\"; @@ -210,17 +215,19 @@ setenv bootcmd " echo \"Aborted.\"; exit; fi; - echo \"\"; - echo \"\"; - echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux_b\"; - echo \"\"; - echo \"\"; - update linux_b mmc ${INSTALL_MMCDEV} ${INSTALL_LINUX_FILENAME}; - if test \$? -eq 1; then - echo \"[ERROR] Failed to update linux_b!\"; + if test \"\$\{install_dualboot\}\" = yes; then echo \"\"; - echo \"Aborted.\"; - exit; + echo \"\"; + echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux_b\"; + echo \"\"; + echo \"\"; + update linux_b mmc ${INSTALL_MMCDEV} ${INSTALL_LINUX_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update linux_b!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; fi; echo \"\"; echo \"\"; @@ -234,17 +241,19 @@ setenv bootcmd " echo \"Aborted.\"; exit; fi; - echo \"\"; - echo \"\"; - echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs_b\"; - echo \"\"; - echo \"\"; - update rootfs_b mmc ${INSTALL_MMCDEV} ${INSTALL_ROOTFS_FILENAME}; - if test \$? -eq 1; then - echo \"[ERROR] Failed to update rootfs_b partition!\"; + if test \"\$\{install_dualboot\}\" = yes; then echo \"\"; - echo \"Aborted.\"; - exit; + echo \"\"; + echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs_b\"; + echo \"\"; + echo \"\"; + update rootfs_b mmc ${INSTALL_MMCDEV} ${INSTALL_ROOTFS_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update rootfs_b partition!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; fi; else echo \"\"; diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x/install_linux_fw_usb.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x/install_linux_fw_usb.txt index 6021d15d2..f3688b958 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x/install_linux_fw_usb.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x/install_linux_fw_usb.txt @@ -121,9 +121,13 @@ echo " --------- --------" echo " bootloader ${INSTALL_UBOOT_FILENAME}" if test "${dualboot}" = "yes"; then echo " linux_a ${INSTALL_LINUX_FILENAME}" - echo " linux_b ${INSTALL_LINUX_FILENAME}" + if test "${install_dualboot}" = "yes"; then + echo " linux_b ${INSTALL_LINUX_FILENAME}" + fi echo " rootfs_a ${INSTALL_ROOTFS_FILENAME}" - echo " rootfs_b ${INSTALL_ROOTFS_FILENAME}" + if test "${install_dualboot}" = "yes"; then + echo " rootfs_b ${INSTALL_ROOTFS_FILENAME}" + fi else echo " linux ${INSTALL_LINUX_FILENAME}" echo " recovery ${INSTALL_RECOVERY_FILENAME}" @@ -184,6 +188,7 @@ fi setenv bootcmd " env default -a; setenv dualboot ${dualboot}; + setenv install_dualboot ${install_dualboot}; saveenv; setenv otf-update yes; echo \"\"; @@ -212,17 +217,19 @@ setenv bootcmd " echo \"Aborted.\"; exit; fi; - echo \"\"; - echo \"\"; - echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux_b\"; - echo \"\"; - echo \"\"; - update linux_b usb ${INSTALL_USBDEV} ${INSTALL_LINUX_FILENAME}; - if test \$? -eq 1; then - echo \"[ERROR] Failed to update linux_b!\"; + if test \"\$\{install_dualboot\}\" = yes; then echo \"\"; - echo \"Aborted.\"; - exit; + echo \"\"; + echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux_b\"; + echo \"\"; + echo \"\"; + update linux_b usb ${INSTALL_USBDEV} ${INSTALL_LINUX_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update linux_b!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; fi; usb reset; echo \"\"; @@ -237,17 +244,19 @@ setenv bootcmd " echo \"Aborted.\"; exit; fi; - echo \"\"; - echo \"\"; - echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs_b\"; - echo \"\"; - echo \"\"; - update rootfs_b usb ${INSTALL_USBDEV} ${INSTALL_ROOTFS_FILENAME}; - if test \$? -eq 1; then - echo \"[ERROR] Failed to update rootfs_b partition!\"; + if test \"\$\{install_dualboot\}\" = yes; then echo \"\"; - echo \"Aborted.\"; - exit; + echo \"\"; + echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs_b\"; + echo \"\"; + echo \"\"; + update rootfs_b usb ${INSTALL_USBDEV} ${INSTALL_ROOTFS_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update rootfs_b partition!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; fi; else echo \"\"; diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x/install_linux_fw_uuu.sh b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x/install_linux_fw_uuu.sh index 3f019fa4e..ddfb41624 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x/install_linux_fw_uuu.sh +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x/install_linux_fw_uuu.sh @@ -1,7 +1,7 @@ #!/bin/sh #=============================================================================== # -# Copyright (C) 2020-2021 by Digi International Inc. +# Copyright (C) 2020-2023 by Digi International Inc. # All rights reserved. # # This program is free software; you can redistribute it and/or modify it @@ -39,6 +39,7 @@ show_usage() echo " -n No wait. Skips 10 seconds delay to stop script." echo " -u U-Boot filename." echo " Auto-determined by variant if not provided." + echo " -d Install firmware on dualboot partitions (system A and system B)." exit 2 } @@ -69,9 +70,10 @@ echo "############################################################" # Command line admits the following parameters: # -u # -i -while getopts 'hi:nu:' c +while getopts 'dhi:nu:' c do case $c in + d) INSTALL_DUALBOOT=true ;; h) show_usage ;; i) IMAGE_NAME=${OPTARG} ;; n) NOWAIT=true ;; @@ -217,9 +219,13 @@ if [ "${NOWAIT}" != true ]; then printf " bootloader\t${INSTALL_UBOOT_FILENAME}\n" if [ "${DUALBOOT}" = true ]; then printf " ${LINUX_NAME}_a\t${INSTALL_LINUX_FILENAME}\n" - printf " ${LINUX_NAME}_b\t${INSTALL_LINUX_FILENAME}\n" + if [ "${INSTALL_DUALBOOT}" = true ]; then + printf " ${LINUX_NAME}_b\t${INSTALL_LINUX_FILENAME}\n" + fi printf " ${ROOTFS_NAME}_a\t${INSTALL_ROOTFS_FILENAME}\n" - printf " ${ROOTFS_NAME}_b\t${INSTALL_ROOTFS_FILENAME}\n" + if [ "${INSTALL_DUALBOOT}" = true ]; then + printf " ${ROOTFS_NAME}_b\t${INSTALL_ROOTFS_FILENAME}\n" + fi else printf " ${LINUX_NAME}\t${INSTALL_LINUX_FILENAME}\n" printf " ${RECOVERY_NAME}\t${INSTALL_RECOVERY_FILENAME}\n" @@ -295,11 +301,15 @@ if [ "${DUALBOOT}" = true ]; then # Update Linux A part_update "${LINUX_NAME}_a" "${INSTALL_LINUX_FILENAME}" # Update Linux B - part_update "${LINUX_NAME}_b" "${INSTALL_LINUX_FILENAME}" + if [ "${INSTALL_DUALBOOT}" = true ]; then + part_update "${LINUX_NAME}_b" "${INSTALL_LINUX_FILENAME}" + fi # Update Rootfs A part_update "${ROOTFS_NAME}_a" "${INSTALL_ROOTFS_FILENAME}" # Update Rootfs B - part_update "${ROOTFS_NAME}_b" "${INSTALL_ROOTFS_FILENAME}" + if [ "${INSTALL_DUALBOOT}" = true ]; then + part_update "${ROOTFS_NAME}_b" "${INSTALL_ROOTFS_FILENAME}" + fi else # Update Linux part_update "${LINUX_NAME}" "${INSTALL_LINUX_FILENAME}" diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx93/install_linux_fw_sd.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx93/install_linux_fw_sd.txt index e7deac14b..3a50597f0 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx93/install_linux_fw_sd.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx93/install_linux_fw_sd.txt @@ -50,9 +50,13 @@ echo " --------- --------" echo " bootloader ${INSTALL_UBOOT_FILENAME}" if test "${dualboot}" = "yes"; then echo " linux_a ${INSTALL_LINUX_FILENAME}" - echo " linux_b ${INSTALL_LINUX_FILENAME}" + if test "${install_dualboot}" = "yes"; then + echo " linux_b ${INSTALL_LINUX_FILENAME}" + fi echo " rootfs_a ${INSTALL_ROOTFS_FILENAME}" - echo " rootfs_b ${INSTALL_ROOTFS_FILENAME}" + if test "${install_dualboot}" = "yes"; then + echo " rootfs_b ${INSTALL_ROOTFS_FILENAME}" + fi else echo " linux ${INSTALL_LINUX_FILENAME}" echo " recovery ${INSTALL_RECOVERY_FILENAME}" @@ -112,6 +116,7 @@ fi setenv bootcmd " env default -a; setenv dualboot ${dualboot}; + setenv install_dualboot ${install_dualboot}; saveenv; setenv otf-update yes; echo \"\"; @@ -139,17 +144,19 @@ setenv bootcmd " echo \"Aborted.\"; exit; fi; - echo \"\"; - echo \"\"; - echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux_b\"; - echo \"\"; - echo \"\"; - update linux_b mmc ${INSTALL_MMCDEV} ${INSTALL_LINUX_FILENAME}; - if test \$? -eq 1; then - echo \"[ERROR] Failed to update linux_b!\"; + if test \"\$\{install_dualboot\}\" = yes; then echo \"\"; - echo \"Aborted.\"; - exit; + echo \"\"; + echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux_b\"; + echo \"\"; + echo \"\"; + update linux_b mmc ${INSTALL_MMCDEV} ${INSTALL_LINUX_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update linux_b!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; fi; echo \"\"; echo \"\"; @@ -163,17 +170,19 @@ setenv bootcmd " echo \"Aborted.\"; exit; fi; - echo \"\"; - echo \"\"; - echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs_b\"; - echo \"\"; - echo \"\"; - update rootfs_b mmc ${INSTALL_MMCDEV} ${INSTALL_ROOTFS_FILENAME}; - if test \$? -eq 1; then - echo \"[ERROR] Failed to update rootfs_b partition!\"; + if test \"\$\{install_dualboot\}\" = yes; then echo \"\"; - echo \"Aborted.\"; - exit; + echo \"\"; + echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs_b\"; + echo \"\"; + echo \"\"; + update rootfs_b mmc ${INSTALL_MMCDEV} ${INSTALL_ROOTFS_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update rootfs_b partition!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; fi; else echo \"\"; diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx93/install_linux_fw_usb.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx93/install_linux_fw_usb.txt index 1eb95d3bf..e916de50e 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx93/install_linux_fw_usb.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx93/install_linux_fw_usb.txt @@ -50,9 +50,13 @@ echo " --------- --------" echo " bootloader ${INSTALL_UBOOT_FILENAME}" if test "${dualboot}" = "yes"; then echo " linux_a ${INSTALL_LINUX_FILENAME}" - echo " linux_b ${INSTALL_LINUX_FILENAME}" + if test "${install_dualboot}" = "yes"; then + echo " linux_b ${INSTALL_LINUX_FILENAME}" + fi echo " rootfs_a ${INSTALL_ROOTFS_FILENAME}" - echo " rootfs_b ${INSTALL_ROOTFS_FILENAME}" + if test "${install_dualboot}" = "yes"; then + echo " rootfs_b ${INSTALL_ROOTFS_FILENAME}" + fi else echo " linux ${INSTALL_LINUX_FILENAME}" echo " recovery ${INSTALL_RECOVERY_FILENAME}" @@ -112,6 +116,7 @@ fi setenv bootcmd " env default -a; setenv dualboot ${dualboot}; + setenv install_dualboot ${install_dualboot}; saveenv; setenv otf-update yes; echo \"\"; @@ -140,17 +145,19 @@ setenv bootcmd " echo \"Aborted.\"; exit; fi; - echo \"\"; - echo \"\"; - echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux_b\"; - echo \"\"; - echo \"\"; - update linux_b usb ${INSTALL_USBDEV} ${INSTALL_LINUX_FILENAME}; - if test \$? -eq 1; then - echo \"[ERROR] Failed to update linux_b!\"; + if test \"\$\{install_dualboot\}\" = yes; then echo \"\"; - echo \"Aborted.\"; - exit; + echo \"\"; + echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux_b\"; + echo \"\"; + echo \"\"; + update linux_b usb ${INSTALL_USBDEV} ${INSTALL_LINUX_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update linux_b!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; fi; echo \"\"; echo \"\"; @@ -164,17 +171,19 @@ setenv bootcmd " echo \"Aborted.\"; exit; fi; - echo \"\"; - echo \"\"; - echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs_b\"; - echo \"\"; - echo \"\"; - update rootfs_b usb ${INSTALL_USBDEV} ${INSTALL_ROOTFS_FILENAME}; - if test \$? -eq 1; then - echo \"[ERROR] Failed to update rootfs_b partition!\"; + if test \"\$\{install_dualboot\}\" = yes; then echo \"\"; - echo \"Aborted.\"; - exit; + echo \"\"; + echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs_b\"; + echo \"\"; + echo \"\"; + update rootfs_b usb ${INSTALL_USBDEV} ${INSTALL_ROOTFS_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update rootfs_b partition!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; fi; else echo \"\"; diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx93/install_linux_fw_uuu.sh b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx93/install_linux_fw_uuu.sh index d580e5c02..f819e6aec 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx93/install_linux_fw_uuu.sh +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx93/install_linux_fw_uuu.sh @@ -1,7 +1,7 @@ #!/bin/sh #=============================================================================== # -# Copyright (C) 2020-2021 by Digi International Inc. +# Copyright (C) 2020-2023 by Digi International Inc. # All rights reserved. # # This program is free software; you can redistribute it and/or modify it @@ -39,6 +39,7 @@ show_usage() echo " -n No wait. Skips 10 seconds delay to stop script." echo " -u U-Boot filename." echo " Auto-determined by variant if not provided." + echo " -d Install firmware on dualboot partitions (system A and system B)." exit 2 } @@ -69,9 +70,10 @@ echo "############################################################" # Command line admits the following parameters: # -u # -i -while getopts 'hi:nu:' c +while getopts 'dhi:nu:' c do case $c in + d) INSTALL_DUALBOOT=true ;; h) show_usage ;; i) IMAGE_NAME=${OPTARG} ;; n) NOWAIT=true ;; @@ -158,9 +160,13 @@ if [ "${NOWAIT}" != true ]; then printf " bootloader\t${INSTALL_UBOOT_FILENAME}\n" if [ "${DUALBOOT}" = true ]; then printf " ${LINUX_NAME}_a\t${INSTALL_LINUX_FILENAME}\n" - printf " ${LINUX_NAME}_b\t${INSTALL_LINUX_FILENAME}\n" + if [ "${INSTALL_DUALBOOT}" = true ]; then + printf " ${LINUX_NAME}_b\t${INSTALL_LINUX_FILENAME}\n" + fi printf " ${ROOTFS_NAME}_a\t${INSTALL_ROOTFS_FILENAME}\n" - printf " ${ROOTFS_NAME}_b\t${INSTALL_ROOTFS_FILENAME}\n" + if [ "${INSTALL_DUALBOOT}" = true ]; then + printf " ${ROOTFS_NAME}_b\t${INSTALL_ROOTFS_FILENAME}\n" + fi else printf " ${LINUX_NAME}\t${INSTALL_LINUX_FILENAME}\n" printf " ${RECOVERY_NAME}\t${INSTALL_RECOVERY_FILENAME}\n" @@ -239,11 +245,15 @@ if [ "${DUALBOOT}" = true ]; then # Update Linux A part_update "${LINUX_NAME}_a" "${INSTALL_LINUX_FILENAME}" # Update Linux B - part_update "${LINUX_NAME}_b" "${INSTALL_LINUX_FILENAME}" + if [ "${INSTALL_DUALBOOT}" = true ]; then + part_update "${LINUX_NAME}_b" "${INSTALL_LINUX_FILENAME}" + fi # Update Rootfs A part_update "${ROOTFS_NAME}_a" "${INSTALL_ROOTFS_FILENAME}" # Update Rootfs B - part_update "${ROOTFS_NAME}_b" "${INSTALL_ROOTFS_FILENAME}" + if [ "${INSTALL_DUALBOOT}" = true ]; then + part_update "${ROOTFS_NAME}_b" "${INSTALL_ROOTFS_FILENAME}" + fi else # Update Linux part_update "${LINUX_NAME}" "${INSTALL_LINUX_FILENAME}" From 0e61017da84feac79856a44f7dcac9ce862c22ba Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Thu, 23 Mar 2023 14:12:34 +0100 Subject: [PATCH 035/100] libubootenv: add fall-back function to read HWID from nvmem The HWID is populated on the device tree by the boot loader. This can be used as a key modifier when encrypting the U-Boot environment. Some old U-Boot versions however, did not populate the HWID on the device tree. When updating firmware from an old version to a new one, the library may not be able to read the HWID from the DT and then be unable to unencrypt the environment. This patch implements a fall-back function to read the HWID directly from the nvmem node (sysfs). Implementation has been done for ccimx6 family only, where this case of old U-Boot can happen. Signed-off-by: Hector Palacios https://onedigi.atlassian.net/browse/DEL-8444 (cherry picked from commit 222a91f213e7d7e201f389fe3773f5f3f3a10c0a) --- ...d-HWID-from-nvmem-device-if-not-avai.patch | 105 ++++++++++++++++++ .../libubootenv/libubootenv_%.bbappend | 3 +- 2 files changed, 107 insertions(+), 1 deletion(-) create mode 100644 meta-digi-arm/recipes-bsp/libubootenv/libubootenv/0004-fall-back-to-read-HWID-from-nvmem-device-if-not-avai.patch diff --git a/meta-digi-arm/recipes-bsp/libubootenv/libubootenv/0004-fall-back-to-read-HWID-from-nvmem-device-if-not-avai.patch b/meta-digi-arm/recipes-bsp/libubootenv/libubootenv/0004-fall-back-to-read-HWID-from-nvmem-device-if-not-avai.patch new file mode 100644 index 000000000..08cb1ab43 --- /dev/null +++ b/meta-digi-arm/recipes-bsp/libubootenv/libubootenv/0004-fall-back-to-read-HWID-from-nvmem-device-if-not-avai.patch @@ -0,0 +1,105 @@ +From: Hector Palacios +Date: Mon, 3 Apr 2023 18:21:07 +0200 +Subject: [PATCH] fall back to read HWID from nvmem device if not available on + DT + +Old U-Boot versions don't populate the HWID on the device tree. This may +be used as a key modifier for TrustFence encryption and, if not available +on the DT, newer firmware may be unable to unencrypt the U-Boot +environment. + +This patch implements a fall-back function to query the HWID directly from +the nvmem device node if it cannot locate it at the DT. +This is only implemented for ccimx6 family, which may be in the case of +having an old U-Boot. + +Signed-off-by: Hector Palacios + +https://onedigi.atlassian.net/browse/DEL-8444 +--- + src/uboot_env.c | 54 +++++++++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 52 insertions(+), 2 deletions(-) + +diff --git a/src/uboot_env.c b/src/uboot_env.c +index 539e22f9a8ac..86f9b9ebfec2 100644 +--- a/src/uboot_env.c ++++ b/src/uboot_env.c +@@ -945,6 +945,32 @@ static int is_env_encrypted(void) + return access(dt_prop, F_OK) != -1; + } + ++/* Function that checks if machine is compatible (on the DT) */ ++static bool machine_is_compatible(char *machine) ++{ ++ int fd, nchars, len = 0; ++ int ret = false; ++ char str[256]; ++ char *p = str; ++ ++ fd = open("/proc/device-tree/compatible", O_RDONLY); ++ if (fd < 0) ++ return false; ++ ++ nchars = read(fd, str, 255); ++ while (len < nchars) { ++ if (!strcmp(p, machine)) { ++ ret = true; ++ break; ++ } ++ len += strlen(p) + 1; ++ p += strlen(p) + 1; ++ } ++ ++ close(fd); ++ return ret; ++} ++ + #define MAX_HWID_WORDS 4 + static int env_caam_get_keymod(unsigned char output[16]) + { +@@ -953,12 +979,11 @@ static int env_caam_get_keymod(unsigned char output[16]) + int fd; + uint32_t ocotp_hwid[MAX_HWID_WORDS]; + char dt_prop[32]; ++ char buf[sizeof(uint32_t)]; + + for (i = 0; i < MAX_HWID_WORDS; i++) { + sprintf(dt_prop, "/proc/device-tree/digi,hwid_%d", i); + if (access(dt_prop, F_OK) != -1) { +- char buf[sizeof(uint32_t)]; +- + fd = open(dt_prop, O_RDONLY); + if (fd < 0) + return fd; +@@ -969,6 +994,31 @@ static int env_caam_get_keymod(unsigned char output[16]) + } + ocotp_hwid[i] = ntohl(*(uint32_t *)buf); + close(fd); ++ } else if (machine_is_compatible("digi,ccimx6ul") || ++ machine_is_compatible("digi,ccimx6")) { ++ /* ++ * If HWID not available on the DT (old U-Boot version), ++ * fall back to read it directly from the nvmem device. ++ */ ++ int hwid_offset = 136; /* (Bank * 8 + Word) * 4 */ ++ ++ /* HWID for CC6 family only has two words */ ++ if (i == 2) ++ break; ++ ++ fd = open("/sys/bus/nvmem/devices/imx-ocotp0/nvmem", ++ O_RDONLY); ++ if (fd < 0) ++ return fd; ++ len = lseek(fd, hwid_offset + i * 4, SEEK_SET); ++ ++ len = read(fd, buf, sizeof(unsigned int)); ++ if (len < 0) { ++ close(fd); ++ return -1; ++ } ++ ocotp_hwid[i] = *(unsigned int *)buf; ++ close(fd); + } else { + break; + } diff --git a/meta-digi-arm/recipes-bsp/libubootenv/libubootenv_%.bbappend b/meta-digi-arm/recipes-bsp/libubootenv/libubootenv_%.bbappend index 8076b29bd..5ee54cb84 100644 --- a/meta-digi-arm/recipes-bsp/libubootenv/libubootenv_%.bbappend +++ b/meta-digi-arm/recipes-bsp/libubootenv/libubootenv_%.bbappend @@ -1,4 +1,4 @@ -# Copyright (C) 2021, Digi International Inc. +# Copyright (C) 2021-2023 Digi International Inc. FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}:" @@ -18,6 +18,7 @@ SRC_URI += " \ file://0001-Implement-support-for-environment-encryption-by-CAAM.patch \ file://0002-Implement-U-Boot-environment-access-functions.patch \ file://0003-tools-env-add-support-to-set-dynamic-location-of-env.patch \ + file://0004-fall-back-to-read-HWID-from-nvmem-device-if-not-avai.patch \ " do_install:append() { From 0fcd8906d4ca9278654f94612a82c8178632a51e Mon Sep 17 00:00:00 2001 From: Gabriel Valcazar Date: Wed, 19 Apr 2023 11:19:08 +0200 Subject: [PATCH 036/100] Revert "imx-digi-base: add dummy MULTIUBI_BUILD value to fix Vigiles builds" An official fix was added to meta-timesys in commit ae4f6e9854361d4a6d71b6f8b87130268d990b32, so our workaround is no longer needed This reverts commit 7a7713055052016abffa5d7c58e1cd5879b16cb7. Signed-off-by: Gabriel Valcazar --- meta-digi-arm/conf/machine/include/imx-digi-base.inc | 3 --- 1 file changed, 3 deletions(-) diff --git a/meta-digi-arm/conf/machine/include/imx-digi-base.inc b/meta-digi-arm/conf/machine/include/imx-digi-base.inc index f4fe899ca..71f58f7bc 100644 --- a/meta-digi-arm/conf/machine/include/imx-digi-base.inc +++ b/meta-digi-arm/conf/machine/include/imx-digi-base.inc @@ -296,7 +296,4 @@ UDEV_EXTRA_RULES:append = " udev-rules-imx" PREFERRED_VERSION_dtc-native:ccimx6 ?= "1.4.5" PREFERRED_VERSION_nativesdk-dtc:ccimx6 ?= "1.4.5" -# Dummy value to prevent errors when Vigiles is enabled -MULTIUBI_BUILD ?= "dummy" - DEY_BUILD_PLATFORM = "NXP" From 16117d3cf6168d676375f768def6c3f072078d0e Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Mon, 3 Apr 2023 11:53:49 +0200 Subject: [PATCH 037/100] update URL of NXP recipes from codeaurora to Github Codeaurora was retired on April 2023. Fix bbappends to point to their new location on Github. Signed-off-by: Hector Palacios --- .../recipes-graphics/libgpuperfcnt/gputop_6.4.3.p2.4.bb | 2 +- .../freescale-layer/recipes-multimedia/nxp-afe/nxp-afe_git.bb | 2 +- .../recipes-qt/qt5/gstreamer1.0-plugins-good-qt_1.18.5.imx.bb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/libgpuperfcnt/gputop_6.4.3.p2.4.bb b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/libgpuperfcnt/gputop_6.4.3.p2.4.bb index 5ce64c801..88b6b1e59 100644 --- a/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/libgpuperfcnt/gputop_6.4.3.p2.4.bb +++ b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/libgpuperfcnt/gputop_6.4.3.p2.4.bb @@ -6,7 +6,7 @@ LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=bcacc6777a7173f8b95b5d1e0ac341ae" DEPENDS = "libgpuperfcnt" -GPUTOP_SRC ?= "git://source.codeaurora.org/external/imx/imx-gputop.git;protocol=https" +GPUTOP_SRC ?= "git://github.com/nxp-imx/imx-gputop.git;protocol=https" SRCBRANCH = "release" SRC_URI = "${GPUTOP_SRC};branch=${SRCBRANCH} " SRCREV = "ecd0b278c9ed4ab6ecde83d3c6deeae9367fa828" diff --git a/meta-digi-dey/dynamic-layers/freescale-layer/recipes-multimedia/nxp-afe/nxp-afe_git.bb b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-multimedia/nxp-afe/nxp-afe_git.bb index bafdb7fb3..5125f8465 100644 --- a/meta-digi-dey/dynamic-layers/freescale-layer/recipes-multimedia/nxp-afe/nxp-afe_git.bb +++ b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-multimedia/nxp-afe/nxp-afe_git.bb @@ -7,7 +7,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=7bdef19938f3503cfc4c586461f99012" PV = "1.0+git${SRCPV}" SRCBRANCH = "MM_04.06.03_2110_L5.10.y" -NXPAFE_SRC ?= "git://source.codeaurora.org/external/imx/nxp-afe.git;protocol=https" +NXPAFE_SRC ?= "git://github.com/nxp-imx/nxp-afe.git;protocol=https" SRC_URI = " \ ${NXPAFE_SRC};branch=${SRCBRANCH} \ " diff --git a/meta-digi-dey/dynamic-layers/qt5-layer/NXP/recipes-qt/qt5/gstreamer1.0-plugins-good-qt_1.18.5.imx.bb b/meta-digi-dey/dynamic-layers/qt5-layer/NXP/recipes-qt/qt5/gstreamer1.0-plugins-good-qt_1.18.5.imx.bb index c8000d070..25995a00b 100644 --- a/meta-digi-dey/dynamic-layers/qt5-layer/NXP/recipes-qt/qt5/gstreamer1.0-plugins-good-qt_1.18.5.imx.bb +++ b/meta-digi-dey/dynamic-layers/qt5-layer/NXP/recipes-qt/qt5/gstreamer1.0-plugins-good-qt_1.18.5.imx.bb @@ -1,6 +1,6 @@ require recipes-multimedia/gstreamer/gstreamer1.0-plugins-common.inc -GST1.0-PLUGINS-GOOD_SRC ?= "gitsm://source.codeaurora.org/external/imx/gst-plugins-good.git;protocol=https" +GST1.0-PLUGINS-GOOD_SRC ?= "gitsm://github.com/nxp-imx/gst-plugins-good.git;protocol=https" SRCBRANCH = "MM_04.06.03_2110_L5.10.y" SRC_URI = " \ From c981548c19ef80eccab92f960860c1912d7ab066 Mon Sep 17 00:00:00 2001 From: Hector Bujanda Date: Tue, 4 Apr 2023 23:00:28 +0200 Subject: [PATCH 038/100] =?UTF-8?q?ccx:=20fix=20some=20outdated=20files=20?= =?UTF-8?q?so=20implementation=20matches=20'cctags=20api=E2=80=99=20reposi?= =?UTF-8?q?tory?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1) CcxTagControlData struct in CORE/HDD/inc/CcxTagDefs.h had some fields missing compared with 'cctags api’ which was producing CCX_TAG_DRVR_RSP_ERR_CTRL_SIZE. 2) Then CCX_TAG_DRVR_RSP_ERR_PACKET_SIZE aroused because following paddings: CCX_TAG_MPDU_HEADER_PAD_SIZE = 2 CCX_TAG_CONTENT_HEADER_PAD_SIZE = 3 where producing wrong alignements and sizes between the 'cctags api’ and the driver. With changes in this commit, master branch of ‘CCxTagTest’ repository compiled out of source code gets on well with 'cctags api’ repository and with qca driver in both dey-2.4 and dey4.0. Packets in the air match 100% in content in both dey-2.4 and dey4.0. https://onedigi.atlassian.net/browse/DEL-8446 Signed-off-by: Hector Bujanda --- ...dd-CCX-tags-support-for-kernel-v5.15.patch | 285 +++++++++++------- 1 file changed, 183 insertions(+), 102 deletions(-) diff --git a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0001-add-CCX-tags-support-for-kernel-v5.15.patch b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0001-add-CCX-tags-support-for-kernel-v5.15.patch index 9e64e87c1..8cf44c578 100644 --- a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0001-add-CCX-tags-support-for-kernel-v5.15.patch +++ b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0001-add-CCX-tags-support-for-kernel-v5.15.patch @@ -1,34 +1,36 @@ -From: Isaac Hermida -Date: Thu, 25 Aug 2022 10:15:31 +0200 +From: Hector Bujanda +Date: Tue, 11 Apr 2023 12:47:24 +0200 Subject: [PATCH] add CCX tags support for kernel v5.15 https://onedigi.atlassian.net/browse/DEL-8038 Signed-off-by: Isaac Hermida +Signed-off-by: Arturo Buzarra +Signed-off-by: Hector Bujanda --- - CORE/HDD/inc/CcxTagDefs.h | 396 +++++++++++++ + CORE/HDD/inc/CcxTagDefs.h | 424 ++++++++++++++ CORE/HDD/inc/wlan_hdd_ccx_tag.h | 19 + - CORE/HDD/src/wlan_hdd_ccx_tag.c | 833 ++++++++++++++++++++++++++++ + CORE/HDD/src/wlan_hdd_ccx_tag.c | 880 ++++++++++++++++++++++++++++ CORE/HDD/src/wlan_hdd_main.c | 20 + CORE/MAC/inc/aniGlobal.h | 4 + CORE/MAC/inc/qwlan_version.h | 3 +- CORE/MAC/src/include/sirParams.h | 6 + CORE/SERVICES/COMMON/wmi_tlv_defs.h | 19 +- CORE/SERVICES/COMMON/wmi_unified.h | 75 ++- - CORE/SERVICES/WMA/wma.c | 80 +++ + CORE/SERVICES/WMA/wma.c | 82 +++ CORE/SERVICES/WMI/wmi_unified.c | 3 + Kbuild | 2 + - 12 files changed, 1456 insertions(+), 4 deletions(-) + 12 files changed, 1533 insertions(+), 4 deletions(-) create mode 100644 CORE/HDD/inc/CcxTagDefs.h create mode 100644 CORE/HDD/inc/wlan_hdd_ccx_tag.h create mode 100644 CORE/HDD/src/wlan_hdd_ccx_tag.c diff --git a/CORE/HDD/inc/CcxTagDefs.h b/CORE/HDD/inc/CcxTagDefs.h new file mode 100644 -index 000000000000..b0b337c4ec47 +index 000000000..5d70261e1 --- /dev/null +++ b/CORE/HDD/inc/CcxTagDefs.h -@@ -0,0 +1,396 @@ +@@ -0,0 +1,424 @@ +/****************************************************************/ +/* */ +/* Copyright 2018 Digi International, Inc. All Rights Reserved. */ @@ -43,6 +45,11 @@ index 000000000000..b0b337c4ec47 +/* Fixed Netlink Communication Fields */ +#define CCX_TAG_FAMILY_NAME ("CCX_TAG") + ++typedef enum CcxTagVersionTag ++{ ++ CCX_TAG_VERSION = 1 ++}CcxTagVersion; ++ +/* Netlink Attributes */ +typedef enum CcxTagAttrTypeTag +{ @@ -270,8 +277,6 @@ index 000000000000..b0b337c4ec47 + * Unspecified + * - MPDU footer, added by firmware + */ -+ -+ +typedef struct CcxTagControlDataTag +{ + /* The size of the packed control data header in the IPC message. */ @@ -290,24 +295,31 @@ index 000000000000..b0b337c4ec47 + /* RawByteBuffer[Offset] |= Channel */ + uint16_t ChannelOffsetOctets; + ++ /* The size of the MPDU header section in the IPC message. */ ++ uint16_t MpduHeaderBlockSize; ++ + /* The size of the packed MPDU header in the IPC message. */ + uint16_t MpduHeaderSize; + ++ /* The size of the CCX Tag content header section in the IPC message. */ ++ uint16_t ContentHeaderBlockSize; ++ + /* The size of the packed CCX Tag content header in the IPC message. */ + uint16_t ContentHeaderSize; + ++ /* The size of the CCX Tag content payload block in the IPC message. */ ++ uint16_t ContentPayloadBlockSize; ++ + /* The size of the packed CCX Tag content payload in the IPC message. */ + uint16_t ContentPayloadSize; ++ ++ /* This field is unused. */ ++ uint16_t Pad; +}CcxTagControlData; + -+#define CCX_TAG_CHANNEL_OFFSET (35) ++#define CCX_TAG_CHANNEL_OFFSET (32) +#define CCX_TAG_FRAGMENT_OFFSET (22) + -+typedef enum CcxTagVersionTag -+{ -+ CCX_TAG_VERSION = 1 -+}CcxTagVersion; -+ +typedef enum CcxTagMacLengthTag +{ + CCX_TAG_MAC_LENGTH = 6 @@ -382,21 +394,39 @@ index 000000000000..b0b337c4ec47 +{ + CCX_TAG_MPDU_HEADER_SIZE = 30, + -+ CCX_TAG_CONTENT_MAX_SIZE = 2312, ++ CCX_TAG_MPDU_HEADER_PAD_SIZE = 2, ++ ++ CCX_TAG_MPDU_HEADER_BLOCK_SIZE = (CCX_TAG_MPDU_HEADER_SIZE + CCX_TAG_MPDU_HEADER_PAD_SIZE), ++ ++ // The CCX specification calls for a content section (header and payload) ++ // of up to 2312 bytes. This is unachievable due to memory constraints ++ // in the driver at the bus/transport layer. ++ CCX_TAG_CONTENT_THEORETICAL_MAX_SIZE = 2312, ++ ++ // This implementation uses a max content length of 460 bytes. ++ CCX_TAG_CONTENT_MAX_SIZE = 460, + + CCX_TAG_CONTENT_HEADER_SIZE = 5, + ++ CCX_TAG_CONTENT_HEADER_PAD_SIZE = 3, ++ ++ CCX_TAG_CONTENT_HEADER_BLOCK_SIZE = (CCX_TAG_CONTENT_HEADER_SIZE + CCX_TAG_CONTENT_HEADER_PAD_SIZE), ++ + CCX_TAG_CONTENT_PAYLOAD_MAX_SIZE = (CCX_TAG_CONTENT_MAX_SIZE - CCX_TAG_CONTENT_HEADER_SIZE), + ++ CCX_TAG_CONTENT_PAYLOAD_MAX_PAD_SIZE = 1, ++ ++ CCX_TAG_CONTENT_PAYLOAD_MAX_BLOCK_SIZE = (CCX_TAG_CONTENT_PAYLOAD_MAX_SIZE + CCX_TAG_CONTENT_PAYLOAD_MAX_PAD_SIZE), ++ + CCX_TAG_PACKET_MIN_SIZE = (CCX_TAG_MPDU_HEADER_SIZE + CCX_TAG_CONTENT_HEADER_SIZE), + + CCX_TAG_PACKET_MAX_SIZE = (CCX_TAG_MPDU_HEADER_SIZE + CCX_TAG_CONTENT_HEADER_SIZE + CCX_TAG_CONTENT_PAYLOAD_MAX_SIZE), + + CCX_TAG_CONTROL_DATA_SIZE = sizeof(CcxTagControlData), + -+ CCX_TAG_IPC_MSG_MIN_SIZE = (CCX_TAG_PACKET_MIN_SIZE + CCX_TAG_CONTROL_DATA_SIZE), ++ CCX_TAG_IPC_MSG_MIN_SIZE = (CCX_TAG_CONTROL_DATA_SIZE + CCX_TAG_MPDU_HEADER_BLOCK_SIZE + CCX_TAG_CONTENT_HEADER_BLOCK_SIZE), + -+ CCX_TAG_IPC_MSG_MAX_SIZE = (CCX_TAG_PACKET_MAX_SIZE + CCX_TAG_CONTROL_DATA_SIZE) ++ CCX_TAG_IPC_MSG_MAX_SIZE = (CCX_TAG_IPC_MSG_MIN_SIZE + CCX_TAG_CONTENT_PAYLOAD_MAX_BLOCK_SIZE) +}CcxTagDimension; + +typedef struct CcxTagStatusDataTag @@ -427,7 +457,7 @@ index 000000000000..b0b337c4ec47 +#endif /* CCX_TAG_DEFS_H_ */ diff --git a/CORE/HDD/inc/wlan_hdd_ccx_tag.h b/CORE/HDD/inc/wlan_hdd_ccx_tag.h new file mode 100644 -index 000000000000..edc29332a2c0 +index 000000000..edc29332a --- /dev/null +++ b/CORE/HDD/inc/wlan_hdd_ccx_tag.h @@ -0,0 +1,19 @@ @@ -452,10 +482,10 @@ index 000000000000..edc29332a2c0 + diff --git a/CORE/HDD/src/wlan_hdd_ccx_tag.c b/CORE/HDD/src/wlan_hdd_ccx_tag.c new file mode 100644 -index 000000000000..03697601bcb0 +index 000000000..cbcb7294b --- /dev/null +++ b/CORE/HDD/src/wlan_hdd_ccx_tag.c -@@ -0,0 +1,833 @@ +@@ -0,0 +1,880 @@ +/****************************************************************/ +/* */ +/* Copyright 2018 Digi International, Inc. All Rights Reserved. */ @@ -481,6 +511,8 @@ index 000000000000..03697601bcb0 + +#include "CcxTagDefs.h" + ++#define CCX_TAG_DEBUG 1 ++ +static struct hdd_context_s *pHddCtx; + +static uint32_t HDD_CCX_TAG_DRVR_VERSION = 1; @@ -499,7 +531,7 @@ index 000000000000..03697601bcb0 +static int ccx_tag_status_cmd_handler(struct sk_buff *skb, struct genl_info *info); + +/* attribute policy */ -+static struct nla_policy ccx_tag_genl_policy[CCX_TAG_ATTR_COUNT] = ++static struct nla_policy const ccx_tag_genl_policy[CCX_TAG_ATTR_COUNT] = +{ + /* Reserved position of 0. */ + [CCX_TAG_ATTR_UNUSED] = { .type = NLA_STRING }, @@ -524,29 +556,33 @@ index 000000000000..03697601bcb0 +}; + +/* operation definition */ -+static struct genl_ops ccx_tag_gnl_ops_table[CCX_TAG_CMD_COUNT] = ++static struct genl_ops const ccx_tag_gnl_ops_table[CCX_TAG_CMD_COUNT] = +{ + { + .cmd = CCX_TAG_CMD_CHECK_VERSION, + .flags = 0, ++ .policy = ccx_tag_genl_policy, + .doit = ccx_tag_check_version_cmd_handler, + .dumpit = NULL, + }, + { + .cmd = CCX_TAG_CMD_RESET, + .flags = 0, ++ .policy = ccx_tag_genl_policy, + .doit = ccx_tag_reset_cmd_handler, + .dumpit = NULL, + }, + { + .cmd = CCX_TAG_CMD_TRANSMIT, + .flags = 0, ++ .policy = ccx_tag_genl_policy, + .doit = ccx_tag_transmit_cmd_handler, + .dumpit = NULL, + }, + { + .cmd = CCX_TAG_CMD_STATUS, + .flags = 0, ++ .policy = ccx_tag_genl_policy, + .doit = ccx_tag_status_cmd_handler, + .dumpit = NULL, + } @@ -564,8 +600,9 @@ index 000000000000..03697601bcb0 + .n_ops = ARRAY_SIZE(ccx_tag_gnl_ops_table), +}; + ++#if CCX_TAG_DEBUG + -+void RawBlockDisplay(uint8_t const * data, uint16_t length) ++void static RawBlockDisplay(uint8_t const * data, uint16_t length) +{ + uint16_t byte = 0; + @@ -594,6 +631,28 @@ index 000000000000..03697601bcb0 + } +} + ++void static TagConfigDisplay(CcxTagMpduHeader const * MpduHeaderBuffer, ++ uint16_t MpduHeaderBufferLength, ++ CcxTagContentHeader const * ContentHeaderBuffer, ++ uint16_t ContentHeaderBufferLength, ++ uint8_t const * ContentPayloadBlock, ++ uint16_t ContentPayloadBlockLength) ++{ ++ printk(KERN_DEBUG "CCX Tag Header: \n"); ++ RawBlockDisplay((uint8_t const *)MpduHeaderBuffer, MpduHeaderBufferLength); ++ ++ printk(KERN_DEBUG "CCX Tag Content: \n"); ++ RawBlockDisplay((uint8_t const *)ContentHeaderBuffer, ContentHeaderBufferLength); ++ ++ if (ContentPayloadBlockLength > 0) ++ { ++ printk(KERN_DEBUG "CCX Tag Data: \n"); ++ RawBlockDisplay(ContentPayloadBlock, ContentPayloadBlockLength); ++ } ++} ++ ++#endif ++ +static void SendAttrData(uint16_t cmd_type, uint16_t seq_num, + uint16_t rsp_type, CcxTagAttrType attr_type, + uint8_t const * msg_buf, uint16_t msg_len, @@ -601,7 +660,6 @@ index 000000000000..03697601bcb0 +{ + int flags = 0; + int ret = 0; -+ int status = 0; + int has_attr = 0; + + /* Allocate a message buffer. */ @@ -627,7 +685,7 @@ index 000000000000..03697601bcb0 + if (!skb) + { + /* Error - Socket buffer allocation failed. Abandon Send. */ -+ goto nla_put_failure; ++ goto nla_send_end; + } + + /* Set up the message header first. Use the same */ @@ -682,8 +740,6 @@ index 000000000000..03697601bcb0 + /* Send the message. */ + ret = genlmsg_unicast(genl_info_net(info), skb, info->snd_portid); + -+ status = (ret == 0); -+ + goto nla_send_end; + +nla_put_failure: @@ -692,7 +748,6 @@ index 000000000000..03697601bcb0 + { + nlmsg_free(skb); + } -+ status = 0; + +nla_send_end: + @@ -721,7 +776,7 @@ index 000000000000..03697601bcb0 + else + { + /* Unexpected callback from firmware. Report error. */ -+ hdd_ccx_tag_drvr_op_state = CCX_TAG_DRVR_OP_IDLE; ++ hdd_ccx_tag_drvr_op_state = CCX_TAG_DRVR_OP_STATE_UNDEFINED; + hdd_ccx_tag_fw_status = CCX_TAG_FW_STATUS_ERROR; + hdd_ccx_tag_fw_attempts = 0; + hdd_ccx_tag_fw_failures = 0; @@ -739,8 +794,6 @@ index 000000000000..03697601bcb0 + CcxTagWmiHeader * pCcxTagReqHeader = NULL; + tANI_U32 reqLen = 0; + -+ mutex_lock(&hdd_ccx_tag_mutex); -+ + if ((NULL == pHeader) || ((pHeader->ContentPayloadLength > 0) && (NULL == pData))) + { + status = VOS_STATUS_E_INVAL; @@ -762,6 +815,8 @@ index 000000000000..03697601bcb0 + u8 * pCcxTagReqPayload = (u8 *)&pCcxTagReqHeader[1]; + vos_msg_t msg; + ++ mutex_lock(&hdd_ccx_tag_mutex); ++ + vos_mem_set((u8*)(pCcxTagReqHeader), reqLen, 0); + + /* Now copy over the information to the CCX Tag REQ to WMI message. */ @@ -781,9 +836,9 @@ index 000000000000..03697601bcb0 + { + vos_mem_free(pCcxTagReqHeader); + } -+ } + -+ mutex_unlock(&hdd_ccx_tag_mutex); ++ mutex_unlock(&hdd_ccx_tag_mutex); ++ } + + return status; +} @@ -828,9 +883,9 @@ index 000000000000..03697601bcb0 + if (wma_handle != NULL) + { + status = wmi_unified_register_event_handler( -+ wma_handle->wmi_handle, -+ WMI_STA_TAG_PKT_INJ_COMP_EVENTID, -+ RecvCcxTagWmaRsp); ++ wma_handle->wmi_handle, ++ WMI_STA_TAG_PKT_INJ_COMP_EVENTID, ++ RecvCcxTagWmaRsp); + if (status == 0) + { + ResetDriver(); @@ -878,24 +933,6 @@ index 000000000000..03697601bcb0 + return rc; +} + -+void TagConfigDisplay(CcxTagMpduHeader const * MpduHeaderBuffer, uint16_t MpduHeaderBufferLength, -+ CcxTagContentHeader const * ContentHeaderBuffer, uint16_t ContentHeaderBufferLength, -+ uint8_t const * ContentPayloadBlock, -+ uint16_t ContentPayloadBlockLength) -+{ -+ printk(KERN_DEBUG "CCX Tag Header: \n"); -+ RawBlockDisplay((uint8_t const *)MpduHeaderBuffer, MpduHeaderBufferLength); -+ -+ printk(KERN_DEBUG "CCX Tag Content: \n"); -+ RawBlockDisplay((uint8_t const *)ContentHeaderBuffer, ContentHeaderBufferLength); -+ -+ if (ContentPayloadBlockLength > 0) -+ { -+ printk(KERN_DEBUG "CCX Tag Data: \n"); -+ RawBlockDisplay(ContentPayloadBlock, ContentPayloadBlockLength); -+ } -+} -+ +/* Parse an attribute from the command. */ +/* The expected length is for each attribute is known, */ +/* so simply fail if it doesn't match the actual. */ @@ -934,7 +971,7 @@ index 000000000000..03697601bcb0 + uint16_t * cont_len) +{ + int parse_status = 0; -+ uint8_t const * payload_data = NULL; ++ uint8_t const * payload_data = NULL; /* Payload for whole IPC Message. */ + uint32_t payload_len = 0; + + if (attrs && (type == CCX_TAG_ATTR_TAG_COMMAND)) @@ -954,44 +991,84 @@ index 000000000000..03697601bcb0 + } + } + -+ if ((payload_data != NULL) -+ && (payload_len >= (CCX_TAG_CONTROL_DATA_SIZE + CCX_TAG_PACKET_MIN_SIZE))) ++ if ((payload_data != NULL) && (ctrl_data != NULL) ++ && (mpdu_hdr != NULL) && (cont_hdr != NULL) ++ && (cont_data != NULL) && (cont_len != NULL)) + { -+ if ((ctrl_data != NULL) && (mpdu_hdr != NULL) && (cont_hdr != NULL) -+ && (cont_data != NULL) && (cont_len != NULL)) ++ size_t tmp_len = 0; ++ ++ parse_status = 1; ++ ++ /* Length is always the first byte. */ ++ tmp_len = *payload_data; ++ if ((tmp_len == sizeof(*ctrl_data)) ++ && (payload_len >= sizeof(*ctrl_data))) + { -+ size_t tmp_len = sizeof(CcxTagControlData); + memcpy(ctrl_data, payload_data, tmp_len); + payload_data = &payload_data[tmp_len]; + payload_len -= tmp_len; ++ } ++ else ++ { ++ parse_status = 0; ++ } + -+ tmp_len = sizeof(CcxTagMpduHeader); -+ memcpy(mpdu_hdr, payload_data, tmp_len); -+ payload_data = &payload_data[tmp_len]; -+ payload_len -= tmp_len; ++ if ((parse_status) ++ && (ctrl_data->MpduHeaderSize <= ctrl_data->MpduHeaderBlockSize) ++ && (ctrl_data->MpduHeaderSize >= sizeof(*mpdu_hdr)) ++ && (ctrl_data->MpduHeaderBlockSize <= payload_len)) ++ { + -+ tmp_len = sizeof(CcxTagContentHeader); -+ memcpy(cont_hdr, payload_data, tmp_len); -+ payload_data = &payload_data[tmp_len]; -+ payload_len -= tmp_len; ++ memcpy(mpdu_hdr, payload_data, sizeof(*mpdu_hdr)); ++ payload_data = &payload_data[ctrl_data->MpduHeaderBlockSize]; ++ payload_len -= ctrl_data->MpduHeaderBlockSize; ++ } ++ else ++ { ++ parse_status = 0; ++ } + -+ *cont_len = payload_len; -+ if (payload_len > 0) ++ if ((parse_status) ++ && (ctrl_data->ContentHeaderSize <= ctrl_data->ContentHeaderBlockSize) ++ && (ctrl_data->ContentHeaderSize >= sizeof(*cont_hdr)) ++ && (ctrl_data->ContentHeaderBlockSize <= payload_len)) ++ { ++ ++ memcpy(cont_hdr, payload_data, sizeof(*cont_hdr)); ++ payload_data = &payload_data[ctrl_data->ContentHeaderBlockSize]; ++ payload_len -= ctrl_data->ContentHeaderBlockSize; ++ } ++ else ++ { ++ parse_status = 0; ++ } ++ ++ if ((parse_status) ++ && (ctrl_data->ContentPayloadSize <= ctrl_data->ContentPayloadBlockSize) ++ && (ctrl_data->ContentPayloadBlockSize <= payload_len)) ++ { ++ *cont_len = ctrl_data->ContentPayloadSize; ++ if (ctrl_data->ContentPayloadSize > 0) + { + *cont_data = payload_data; + } -+ -+ if (1) ++ else + { -+ printk(KERN_DEBUG "Kernel Cfg - Frag: %u Chan: %u \n", -+ ctrl_data->FragmentOffsetOctets, ctrl_data->ChannelOffsetOctets); -+ -+ TagConfigDisplay(mpdu_hdr, ctrl_data->MpduHeaderSize, -+ cont_hdr, ctrl_data->ContentHeaderSize, -+ *cont_data, ctrl_data->ContentPayloadSize); ++ *cont_data = NULL; + } + -+ parse_status = 1; ++#if CCX_TAG_DEBUG ++ printk(KERN_DEBUG "Kernel Cfg - Frag: %u Chan: %u \n", ++ ctrl_data->FragmentOffsetOctets, ctrl_data->ChannelOffsetOctets); ++ ++ TagConfigDisplay(mpdu_hdr, ctrl_data->MpduHeaderSize, ++ cont_hdr, ctrl_data->ContentHeaderSize, ++ *cont_data, ctrl_data->ContentPayloadSize); ++#endif ++ } ++ else ++ { ++ parse_status = 0; + } + } + @@ -1169,7 +1246,6 @@ index 000000000000..03697601bcb0 + { + rsp_err = CCX_TAG_DRVR_RSP_ERR_OFFSET_OVERRUN; + } -+ + } + } + @@ -1262,12 +1338,13 @@ index 000000000000..03697601bcb0 + if (rsp_err == CCX_TAG_DRVR_RSP_OK) + { + mutex_lock(&hdd_ccx_tag_mutex); -+ status.DriverOpState = hdd_ccx_tag_drvr_op_state; -+ mutex_unlock(&hdd_ccx_tag_mutex); + ++ status.DriverOpState = hdd_ccx_tag_drvr_op_state; + status.FirmwareStatus = hdd_ccx_tag_fw_status; + status.AttemptCount = hdd_ccx_tag_fw_attempts; + status.FailureCount = hdd_ccx_tag_fw_failures; ++ ++ mutex_unlock(&hdd_ccx_tag_mutex); + } + else + { @@ -1290,7 +1367,7 @@ index 000000000000..03697601bcb0 + +#endif diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c -index 05600538cda5..4d21d850a22e 100644 +index 05600538c..4d21d850a 100644 --- a/CORE/HDD/src/wlan_hdd_main.c +++ b/CORE/HDD/src/wlan_hdd_main.c @@ -71,6 +71,9 @@ @@ -1335,7 +1412,7 @@ index 05600538cda5..4d21d850a22e 100644 if (cnss_diag_activate_service() < 0) { diff --git a/CORE/MAC/inc/aniGlobal.h b/CORE/MAC/inc/aniGlobal.h -index cf78093490f5..2f1677fa5168 100644 +index cf7809349..2f1677fa5 100644 --- a/CORE/MAC/inc/aniGlobal.h +++ b/CORE/MAC/inc/aniGlobal.h @@ -74,6 +74,10 @@ @@ -1350,7 +1427,7 @@ index cf78093490f5..2f1677fa5168 100644 #include "smeRrmInternal.h" #include "rrmGlobal.h" diff --git a/CORE/MAC/inc/qwlan_version.h b/CORE/MAC/inc/qwlan_version.h -index 5d5ee0c2124f..ec245797b79b 100644 +index 5d5ee0c21..ec245797b 100644 --- a/CORE/MAC/inc/qwlan_version.h +++ b/CORE/MAC/inc/qwlan_version.h @@ -44,8 +44,7 @@ BRIEF DESCRIPTION: @@ -1364,7 +1441,7 @@ index 5d5ee0c2124f..ec245797b79b 100644 #define AR6320_REV1_VERSION 0x5000000 #define AR6320_REV1_1_VERSION 0x5000001 diff --git a/CORE/MAC/src/include/sirParams.h b/CORE/MAC/src/include/sirParams.h -index 67eb0eab64c4..97d2194d31c4 100644 +index 67eb0eab6..97d2194d3 100644 --- a/CORE/MAC/src/include/sirParams.h +++ b/CORE/MAC/src/include/sirParams.h @@ -823,6 +823,12 @@ struct sir_mgmt_msg { @@ -1381,7 +1458,7 @@ index 67eb0eab64c4..97d2194d31c4 100644 // CFG message types diff --git a/CORE/SERVICES/COMMON/wmi_tlv_defs.h b/CORE/SERVICES/COMMON/wmi_tlv_defs.h -index 3215790ac023..fb4ee7298086 100644 +index 3215790ac..fb4ee7298 100644 --- a/CORE/SERVICES/COMMON/wmi_tlv_defs.h +++ b/CORE/SERVICES/COMMON/wmi_tlv_defs.h @@ -958,6 +958,11 @@ typedef enum { @@ -1435,7 +1512,7 @@ index 3215790ac023..fb4ee7298086 100644 } #endif diff --git a/CORE/SERVICES/COMMON/wmi_unified.h b/CORE/SERVICES/COMMON/wmi_unified.h -index 2332e8711a9d..a8070b2d7cc9 100644 +index 2332e8711..a8070b2d7 100644 --- a/CORE/SERVICES/COMMON/wmi_unified.h +++ b/CORE/SERVICES/COMMON/wmi_unified.h @@ -250,13 +250,14 @@ typedef enum { @@ -1548,10 +1625,10 @@ index 2332e8711a9d..a8070b2d7cc9 100644 A_UINT32 tlv_header; /* TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_vdev_get_mws_coex_tdm_state_fixed_param */ A_UINT32 vdev_id; diff --git a/CORE/SERVICES/WMA/wma.c b/CORE/SERVICES/WMA/wma.c -index be13660667c7..337ae97be0a1 100644 +index be1366066..052673f63 100644 --- a/CORE/SERVICES/WMA/wma.c +++ b/CORE/SERVICES/WMA/wma.c -@@ -30227,6 +30227,77 @@ VOS_STATUS wma_ProcessAddPeriodicTxPtrnInd(WMA_HANDLE handle, +@@ -30227,6 +30227,79 @@ VOS_STATUS wma_ProcessAddPeriodicTxPtrnInd(WMA_HANDLE handle, return VOS_STATUS_SUCCESS; } @@ -1565,14 +1642,16 @@ index be13660667c7..337ae97be0a1 100644 + { + + uint8_t * ccxTagReqPayload = (uint8_t *)&ccxTagReqHeader[1]; -+ uint32_t packet_size = sizeof(ccxTagReqHeader->MpduHeader) -+ + sizeof(ccxTagReqHeader->ContentHeader) ++ uint32_t packet_size = CCX_TAG_MPDU_HEADER_SIZE ++ + CCX_TAG_CONTENT_HEADER_SIZE + + ccxTagReqHeader->ContentPayloadLength; + uint32_t packet_size_aligned = roundup(packet_size, sizeof(A_UINT32)); + uint32_t len = sizeof(wmi_sta_tag_pkt_injection_cmd_fixed_param) + + WMI_TLV_HDR_SIZE + packet_size_aligned; ++ wmi_buf_t wmi_buf = NULL; ++ ++ wmi_buf = wmi_buf_alloc(wma_handle->wmi_handle, len); + -+ wmi_buf_t wmi_buf = wmi_buf_alloc(wma_handle->wmi_handle, len); + if (wmi_buf != NULL) + { + int ret = 0; @@ -1602,12 +1681,12 @@ index be13660667c7..337ae97be0a1 100644 + + /*Copy the data packet segments after TLV Header*/ + vos_mem_copy(buf_ptr, &ccxTagReqHeader->MpduHeader, -+ sizeof(ccxTagReqHeader->MpduHeader)); -+ buf_ptr += sizeof(ccxTagReqHeader->MpduHeader); ++ CCX_TAG_MPDU_HEADER_SIZE); ++ buf_ptr += CCX_TAG_MPDU_HEADER_SIZE; + + vos_mem_copy(buf_ptr, &ccxTagReqHeader->ContentHeader, -+ sizeof(ccxTagReqHeader->ContentHeader)); -+ buf_ptr += sizeof(ccxTagReqHeader->ContentHeader); ++ CCX_TAG_CONTENT_HEADER_SIZE); ++ buf_ptr += CCX_TAG_CONTENT_HEADER_SIZE; + + vos_mem_copy(buf_ptr, ccxTagReqPayload, ccxTagReqHeader->ContentPayloadLength); + buf_ptr += ccxTagReqHeader->ContentPayloadLength; @@ -1629,7 +1708,7 @@ index be13660667c7..337ae97be0a1 100644 /* * FUNCTION: wma_ProcessDelPeriodicTxPtrnInd * WMI command sent to firmware to del patterns -@@ -35469,6 +35540,15 @@ VOS_STATUS wma_mc_process_msg(v_VOID_t *vos_context, vos_msg_t *msg) +@@ -35469,6 +35542,15 @@ VOS_STATUS wma_mc_process_msg(v_VOID_t *vos_context, vos_msg_t *msg) (u_int32_t *)msg->bodyptr); vos_mem_free(msg->bodyptr); break; @@ -1646,7 +1725,7 @@ index be13660667c7..337ae97be0a1 100644 wma_send_echo_request(wma_handle); break; diff --git a/CORE/SERVICES/WMI/wmi_unified.c b/CORE/SERVICES/WMI/wmi_unified.c -index f25b7966e22e..40c2ceb4234b 100644 +index f25b7966e..40c2ceb42 100644 --- a/CORE/SERVICES/WMI/wmi_unified.c +++ b/CORE/SERVICES/WMI/wmi_unified.c @@ -811,6 +811,9 @@ static u_int8_t* get_wmi_cmd_string(WMI_CMD_ID wmi_command) @@ -1660,7 +1739,7 @@ index f25b7966e22e..40c2ceb4234b 100644 return "Invalid WMI cmd"; } diff --git a/Kbuild b/Kbuild -index fdad10c753a3..1ff42e6dedd4 100644 +index fdad10c75..1ff42e6de 100644 --- a/Kbuild +++ b/Kbuild @@ -447,6 +447,7 @@ HDD_INC := -I$(WLAN_ROOT)/$(HDD_INC_DIR) \ @@ -1679,3 +1758,5 @@ index fdad10c753a3..1ff42e6dedd4 100644 -DSOFTAP_CHANNEL_RANGE \ -DWLAN_AP_STA_CONCURRENCY \ -DFEATURE_WLAN_SCAN_PNO \ + + From 7b2339869a63df76c9be74eb2e77cf56d1750c5d Mon Sep 17 00:00:00 2001 From: Gonzalo Ruiz Date: Wed, 19 Apr 2023 12:11:30 +0200 Subject: [PATCH 039/100] ccmp1: add BT Test overlay to the default images Add the overlay required to perform the BLE HCI Raw test to the linux default images. That way, default images can be used to certify the product. Signed-off-by: Gonzalo Ruiz --- meta-digi-arm/conf/machine/ccmp13-dvk.conf | 1 + meta-digi-arm/conf/machine/ccmp15-dvk.conf | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/meta-digi-arm/conf/machine/ccmp13-dvk.conf b/meta-digi-arm/conf/machine/ccmp13-dvk.conf index 312cade48..f46326f39 100644 --- a/meta-digi-arm/conf/machine/ccmp13-dvk.conf +++ b/meta-digi-arm/conf/machine/ccmp13-dvk.conf @@ -41,6 +41,7 @@ STM32MP_KERNEL_DEVICETREE:ccmp13-dvk += " \ _ov_board_mikroe-i2c-to-spi-click_ccmp13-dvk.dtbo \ _ov_board_pwm8_ccmp13-dvk.dtbo \ _ov_som_bt_ccmp13.dtbo \ + _ov_som_bt_test_ccmp13.dtbo \ _ov_som_wifi_ccmp13.dtbo \ " diff --git a/meta-digi-arm/conf/machine/ccmp15-dvk.conf b/meta-digi-arm/conf/machine/ccmp15-dvk.conf index 4167d6ef5..11e378e24 100644 --- a/meta-digi-arm/conf/machine/ccmp15-dvk.conf +++ b/meta-digi-arm/conf/machine/ccmp15-dvk.conf @@ -47,6 +47,7 @@ STM32MP_KERNEL_DEVICETREE:ccmp15-dvk += " \ _ov_board_mikroe-i2c-to-spi-click_ccmp15-dvk.dtbo \ _ov_board_v1_ccmp15-dvk.dtbo \ _ov_som_bt_ccmp15.dtbo \ + _ov_som_bt_test_ccmp15.dtbo \ _ov_som_wifi_ccmp15.dtbo \ " @@ -169,4 +170,3 @@ BOOT_DEV_NAME ?= "linux" ROOTFS_DEV_NAME ?= "rootfs" ROOTFS_ENC_DEV = "${ROOTFS_DEV_NAME}" ROOTFS_DEV_NAME_FINAL = "${@oe.utils.ifelse(d.getVar('TRUSTFENCE_ENCRYPT_ROOTFS') == '1', '${ROOTFS_ENC_DEV}', '${ROOTFS_DEV_NAME}')}" - From fb9a3c9814cf259364b7afe1ade76c3cf8510173 Mon Sep 17 00:00:00 2001 From: Isaac Hermida Date: Mon, 5 Dec 2022 10:48:34 +0100 Subject: [PATCH 040/100] nxp-wlan-sdk: iw612-sdk: add nxp tools Add nxp-wlan-sdk repice as a verbatim copy and add our bbappend for fixing the build. This recipe include some tools, mainly for RF porpouses. https://onedigi.atlassian.net/browse/DEL-8346 Signed-off-by: Isaac Hermida --- .../nxp-wlan-sdk/iw612-sdk_git.bb | 21 +++++++++++++++++++ .../nxp-wlan-sdk/iw612-sdk_git.bbappend | 3 +++ .../nxp-wlan-sdk/iw612-sdk_git.inc | 14 +++++++++++++ 3 files changed, 38 insertions(+) create mode 100644 meta-digi-arm/recipes-connectivity/nxp-wlan-sdk/iw612-sdk_git.bb create mode 100644 meta-digi-arm/recipes-connectivity/nxp-wlan-sdk/iw612-sdk_git.bbappend create mode 100644 meta-digi-arm/recipes-connectivity/nxp-wlan-sdk/iw612-sdk_git.inc diff --git a/meta-digi-arm/recipes-connectivity/nxp-wlan-sdk/iw612-sdk_git.bb b/meta-digi-arm/recipes-connectivity/nxp-wlan-sdk/iw612-sdk_git.bb new file mode 100644 index 000000000..b4c02b7e7 --- /dev/null +++ b/meta-digi-arm/recipes-connectivity/nxp-wlan-sdk/iw612-sdk_git.bb @@ -0,0 +1,21 @@ +require iw612-sdk_git.inc + +SUMMARY = "NXP Wi-Fi SDK for IW612" + +inherit module-base + +TARGET_CC_ARCH += "${LDFLAGS}" + +do_compile () { + oe_runmake appsbuild +} + +do_install () { + install -d ${D}${datadir}/nxp_wireless + + cp -r bin_sdw61x/* ${D}${datadir}/nxp_wireless +} + +FILES:${PN} = "${datadir}/nxp_wireless" + +COMPATIBLE_MACHINE = "(mx93-nxp-bsp)" diff --git a/meta-digi-arm/recipes-connectivity/nxp-wlan-sdk/iw612-sdk_git.bbappend b/meta-digi-arm/recipes-connectivity/nxp-wlan-sdk/iw612-sdk_git.bbappend new file mode 100644 index 000000000..3e5085c3b --- /dev/null +++ b/meta-digi-arm/recipes-connectivity/nxp-wlan-sdk/iw612-sdk_git.bbappend @@ -0,0 +1,3 @@ +# Copyright (C) 2023 Digi International. + +RRECOMMENDS:${PN}:remove = "wireless-tools" diff --git a/meta-digi-arm/recipes-connectivity/nxp-wlan-sdk/iw612-sdk_git.inc b/meta-digi-arm/recipes-connectivity/nxp-wlan-sdk/iw612-sdk_git.inc new file mode 100644 index 000000000..36341f051 --- /dev/null +++ b/meta-digi-arm/recipes-connectivity/nxp-wlan-sdk/iw612-sdk_git.inc @@ -0,0 +1,14 @@ +SUMMARY = "NXP Wi-Fi SDK for IW612" +LICENSE = "GPL-2.0-only" +LIC_FILES_CHKSUM = "file://gpl-2.0.txt;md5=ab04ac0f249af12befccb94447c08b77" + +SRCBRANCH = "lf-5.15.71_2.2.0" +IW612_SRC ?= "git://github.com/nxp-imx/mwifiex-iw612.git;protocol=https" +SRC_URI = "${IW612_SRC};branch=${SRCBRANCH}" +SRCREV = "4cc2c8831f27c8eceece6b66fc2de8b73360f520" + +S = "${WORKDIR}/git" + +EXTRA_OEMAKE = "KERNELDIR=${STAGING_KERNEL_BUILDDIR}" + +RRECOMMENDS:${PN} = "wireless-tools" From 1540f58075be63b96fcd65945da473ad557fa1c3 Mon Sep 17 00:00:00 2001 From: Isaac Hermida Date: Wed, 22 Mar 2023 17:45:18 +0100 Subject: [PATCH 041/100] networkmanager: customize unmanaged interfaces https://onedigi.atlassian.net/browse/DEL-8346 Signed-off-by: Isaac Hermida --- .../networkmanager/networkmanager/NetworkManager.conf | 2 +- .../networkmanager/networkmanager_%.bbappend | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/NetworkManager.conf b/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/NetworkManager.conf index 82107e5e8..e79beed5b 100644 --- a/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/NetworkManager.conf +++ b/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/NetworkManager.conf @@ -8,7 +8,7 @@ rc-manager=file managed=false [keyfile] -unmanaged-devices=interface-name:p2p*;interface-name:wlan1 +unmanaged-devices=##UNMANAGED_DEVICES## [device] wifi.scan-rand-mac-address=no diff --git a/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager_%.bbappend b/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager_%.bbappend index 8c594c368..8614945d7 100644 --- a/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager_%.bbappend +++ b/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager_%.bbappend @@ -1,4 +1,4 @@ -# Copyright (C) 2017-2019, Digi International Inc. +# Copyright (C) 2017-2023, Digi International Inc. FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}:" @@ -41,6 +41,9 @@ ETH0_STATIC_CIDR = "${@ipaddr_to_cidr('eth0', d)}" ETH1_STATIC_CIDR = "${@ipaddr_to_cidr('eth1', d)}" WLAN0_STATIC_CIDR = "${@ipaddr_to_cidr('wlan0', d)}" +UNMANAGED_DEVICES = "interface-name:p2p*;interface-name:wlan1" +UNMANAGED_DEVICES:ccimx93 = "interface-name:p2p-wfd0-0;interface-name:wfd0;interface-name:uap0" + inherit update-rc.d do_install:append() { @@ -48,6 +51,11 @@ do_install:append() { install -m 0644 ${WORKDIR}/NetworkManager.conf ${D}${sysconfdir}/NetworkManager/ install -m 0755 ${WORKDIR}/networkmanager-init ${D}${sysconfdir}/init.d/networkmanager + # + # Customize NetworkManager + # + sed -i -e "s,##UNMANAGED_DEVICES##,${UNMANAGED_DEVICES},g" ${D}${sysconfdir}/NetworkManager/NetworkManager.conf + # # Connections config files # From 5f5855744d5c1c7f684bcf6426e029dd4ee1b89f Mon Sep 17 00:00:00 2001 From: Isaac Hermida Date: Thu, 23 Mar 2023 09:35:34 +0100 Subject: [PATCH 042/100] init-ifupdown: ccimx93: add p2p and AP support https://onedigi.atlassian.net/browse/DEL-8346 Signed-off-by: Isaac Hermida --- meta-digi-arm/conf/machine/ccimx93-dvk.conf | 2 +- .../conf/machine/include/ccimx93.inc | 1 + .../ccimx93/interfaces.br0.example | 8 ++++++++ .../ccimx93/interfaces.wlan1.dhcp | 8 ++++++++ .../ccimx93/interfaces.wlan1.static | 11 ++++++++++ .../init-ifupdown/init-ifupdown_1.0.bbappend | 20 ++++++++++++------- 6 files changed, 42 insertions(+), 8 deletions(-) create mode 100644 meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/ccimx93/interfaces.br0.example create mode 100644 meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/ccimx93/interfaces.wlan1.dhcp create mode 100644 meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/ccimx93/interfaces.wlan1.static diff --git a/meta-digi-arm/conf/machine/ccimx93-dvk.conf b/meta-digi-arm/conf/machine/ccimx93-dvk.conf index be23066fa..2a940245e 100644 --- a/meta-digi-arm/conf/machine/ccimx93-dvk.conf +++ b/meta-digi-arm/conf/machine/ccimx93-dvk.conf @@ -23,7 +23,7 @@ KERNEL_DEVICETREE ?= " \ # Wireless external module WIRELESS_MODULE ?= "" WIRELESS_MODULE:append = " ${@oe.utils.conditional('HAVE_WIFI', '1', 'kernel-module-nxp-wlan', '', d)}" -HAS_WIFI_VIRTWLANS = "false" +HAS_WIFI_VIRTWLANS = "true" # Machine firmware MACHINE_FIRMWARE:append = " ${@oe.utils.conditional('HAVE_WIFI', '1', 'firmware-nxp-wifi-nxpiw612', '', d)}" diff --git a/meta-digi-arm/conf/machine/include/ccimx93.inc b/meta-digi-arm/conf/machine/include/ccimx93.inc index 92559f51a..9fd452fa8 100644 --- a/meta-digi-arm/conf/machine/include/ccimx93.inc +++ b/meta-digi-arm/conf/machine/include/ccimx93.inc @@ -30,6 +30,7 @@ MACHINE_FEATURES += "pci wifi bluetooth" MACHINE_FEATURES:append:use-nxp-bsp = " optee jailhouse" STORAGE_MEDIA = "mmc" +WLAN_P2P_INTERFACE = "wfd0" # Linux kernel configuration KERNEL_DEFCONFIG ?= "arch/arm64/configs/ccimx93_defconfig" diff --git a/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/ccimx93/interfaces.br0.example b/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/ccimx93/interfaces.br0.example new file mode 100644 index 000000000..6cfe96a72 --- /dev/null +++ b/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/ccimx93/interfaces.br0.example @@ -0,0 +1,8 @@ + +## Example bridge between eth0 and uap0 (NXP IW612) +#auto br0 +#iface br0 inet static +# bridge_ports eth0 uap0 +# address 192.168.42.50 +# netmask 255.255.255.0 +# pre-up [ -d /proc/device-tree/wireless ] diff --git a/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/ccimx93/interfaces.wlan1.dhcp b/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/ccimx93/interfaces.wlan1.dhcp new file mode 100644 index 000000000..d4aa85741 --- /dev/null +++ b/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/ccimx93/interfaces.wlan1.dhcp @@ -0,0 +1,8 @@ + +# Wi-Fi AP interface (NXP IW612) +#auto uap0 +iface uap0 inet dhcp + udhcpc_opts -S -b >/dev/null & + pre-up [ -d /proc/device-tree/wireless ] + post-up ##WLAN1_POST_UP_ACTION## + pre-down ##WLAN1_PRE_DOWN_ACTION## diff --git a/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/ccimx93/interfaces.wlan1.static b/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/ccimx93/interfaces.wlan1.static new file mode 100644 index 000000000..881f8a47b --- /dev/null +++ b/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/ccimx93/interfaces.wlan1.static @@ -0,0 +1,11 @@ + +# Wi-Fi AP interface (NXP IW612) +#auto uap0 +iface uap0 inet static + address ##WLAN1_STATIC_IP## + netmask ##WLAN1_STATIC_NETMASK## + gateway ##WLAN1_STATIC_GATEWAY## + dns-nameservers ##WLAN1_STATIC_DNS## + pre-up [ -d /proc/device-tree/wireless ] + post-up ##WLAN1_POST_UP_ACTION## + pre-down ##WLAN1_PRE_DOWN_ACTION## diff --git a/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown_1.0.bbappend b/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown_1.0.bbappend index c32ce9f4a..c5d6ca29d 100644 --- a/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown_1.0.bbappend +++ b/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown_1.0.bbappend @@ -1,4 +1,4 @@ -# Copyright (C) 2013-2021 Digi International Inc. +# Copyright (C) 2013-2023 Digi International Inc. FILESEXTRAPATHS:prepend := "${THISDIR}/${BP}:" @@ -83,17 +83,23 @@ install_virtwlans() { ln -s ../if-pre-up.d/virtwlans ${D}${sysconfdir}/network/if-post-down.d/virtwlans } +install_virtwlans:ccimx93() { + # Skip + : +} + WLAN1_POST_UP_ACTION = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemctl start hostapd@wlan1.service', '/etc/init.d/hostapd start', d)}" WLAN1_PRE_DOWN_ACTION = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemctl stop hostapd@wlan1.service', '/etc/init.d/hostapd stop', d)}" +WLAN1_POST_UP_ACTION:ccimx93 = "systemctl start hostapd@uap0.service" +WLAN1_PRE_DOWN_ACTION:ccimx93 = "systemctl stop hostapd@uap0.service" + install_wlan1() { - if [ -n "${HAVE_WIFI}" ]; then - cat ${WORKDIR}/interfaces.wlan1.${WLAN1_MODE} >> ${D}${sysconfdir}/network/interfaces - if [ "${MACHINE}" = "ccimx6sbc" ]; then - cat ${WORKDIR}/interfaces.wlan1.atheros.${WLAN1_MODE} >> ${D}${sysconfdir}/network/interfaces - fi - [ -n "${WLAN1_AUTO}" ] && sed -i -e 's/^#auto wlan1/auto wlan1/g' ${D}${sysconfdir}/network/interfaces + cat ${WORKDIR}/interfaces.wlan1.${WLAN1_MODE} >> ${D}${sysconfdir}/network/interfaces + if [ "${MACHINE}" = "ccimx6sbc" ]; then + cat ${WORKDIR}/interfaces.wlan1.atheros.${WLAN1_MODE} >> ${D}${sysconfdir}/network/interfaces fi + [ -n "${WLAN1_AUTO}" ] && sed -i -e 's/^#auto wlan1/auto wlan1/g' ${D}${sysconfdir}/network/interfaces # Remove config entries if corresponding variable is not defined [ -z "${WLAN1_STATIC_DNS}" ] && sed -i -e "/##WLAN1_STATIC_DNS##/d" ${D}${sysconfdir}/network/interfaces From af1dea46442603b2df393d32d64d55a92915073e Mon Sep 17 00:00:00 2001 From: Isaac Hermida Date: Tue, 21 Mar 2023 12:51:06 +0100 Subject: [PATCH 043/100] hostapd: sync defconfig to 2.10 version and enable options Sync the defconfig to version 2.10. Additionally, add support for new features, such as: * ACS (auto channel selection) * 802.11AX (Wi-Fi 6) * SAE (WPA3 Personal) * SUITEB192 (WPA3 Enterprise 192 bits) https://onedigi.atlassian.net/browse/DEL-8346 Signed-off-by: Isaac Hermida --- .../hostapd/hostapd/defconfig | 137 +++++++++++++++--- 1 file changed, 120 insertions(+), 17 deletions(-) diff --git a/meta-digi-dey/recipes-connectivity/hostapd/hostapd/defconfig b/meta-digi-dey/recipes-connectivity/hostapd/hostapd/defconfig index 5da684480..2847e34f1 100644 --- a/meta-digi-dey/recipes-connectivity/hostapd/hostapd/defconfig +++ b/meta-digi-dey/recipes-connectivity/hostapd/hostapd/defconfig @@ -18,6 +18,9 @@ CONFIG_DRIVER_HOSTAP=y # Driver interface for drivers using the nl80211 kernel interface CONFIG_DRIVER_NL80211=y +# QCA vendor extensions to nl80211 +#CONFIG_DRIVER_NL80211_QCA=y + # driver_nl80211.c requires libnl. If you are compiling it yourself # you may need to point hostapd to your version of libnl. # @@ -41,17 +44,11 @@ CONFIG_LIBNL32=y # Driver interface for no driver (e.g., RADIUS server only) #CONFIG_DRIVER_NONE=y -# IEEE 802.11F/IAPP -CONFIG_IAPP=y - # WPA2/IEEE 802.11i RSN pre-authentication CONFIG_RSN_PREAUTH=y -# PeerKey handshake for Station to Station Link (IEEE 802.11e DLS) -CONFIG_PEERKEY=y - -# IEEE 802.11w (management frame protection) -CONFIG_IEEE80211W=y +# Support Operating Channel Validation +#CONFIG_OCV=y # Integrated EAP server CONFIG_EAP=y @@ -105,11 +102,18 @@ CONFIG_EAP_PWD=y #CONFIG_EAP_GPSK_SHA256=y # EAP-FAST for the integrated EAP server -# Note: If OpenSSL is used as the TLS library, OpenSSL 1.0 or newer is needed -# for EAP-FAST support. Older OpenSSL releases would need to be patched, e.g., -# with openssl-0.9.8x-tls-extensions.patch, to add the needed functions. #CONFIG_EAP_FAST=y +# EAP-TEAP for the integrated EAP server +# Note: The current EAP-TEAP implementation is experimental and should not be +# enabled for production use. The IETF RFC 7170 that defines EAP-TEAP has number +# of conflicting statements and missing details and the implementation has +# vendor specific workarounds for those and as such, may not interoperate with +# any other implementation. This should not be used for anything else than +# experimentation and interoperability testing until those issues has been +# resolved. +#CONFIG_EAP_TEAP=y + # Wi-Fi Protected Setup (WPS) CONFIG_WPS=y # Enable UPnP support for external WPS Registrars @@ -138,15 +142,12 @@ CONFIG_RADIUS_SERVER=y CONFIG_IPV6=y # IEEE Std 802.11r-2008 (Fast BSS Transition) -#CONFIG_IEEE80211R=y +CONFIG_IEEE80211R=y # Use the hostapd's IEEE 802.11 authentication (ACL), but without # the IEEE 802.11 Management capability (e.g., FreeBSD/net80211) #CONFIG_DRIVER_RADIUS_ACL=y -# IEEE 802.11n (High Throughput) support -CONFIG_IEEE80211N=y - # Wireless Network Management (IEEE Std 802.11v-2011) # Note: This is experimental and not complete implementation. #CONFIG_WNM=y @@ -154,6 +155,12 @@ CONFIG_IEEE80211N=y # IEEE 802.11ac (Very High Throughput) support CONFIG_IEEE80211AC=y +# IEEE 802.11ax HE support +# Note: This is experimental and work in progress. The definitions are still +# subject to change and this should not be expected to interoperate with the +# final IEEE 802.11ax version. +CONFIG_IEEE80211AX=y + # Remove debugging code that is printing out debug messages to stdout. # This can be used to reduce the size of the hostapd considerably if debugging # code is not needed. @@ -163,6 +170,9 @@ CONFIG_IEEE80211AC=y # Disabled by default. CONFIG_DEBUG_FILE=y +# Send debug messages to syslog instead of stdout +#CONFIG_DEBUG_SYSLOG=y + # Add support for sending all debug messages (regardless of debug verbosity) # to the Linux kernel tracing facility. This helps debug the entire stack by # making it easy to record everything happening from the driver up into the @@ -240,10 +250,25 @@ CONFIG_DEBUG_FILE=y # requirements described above. #CONFIG_NO_RANDOM_POOL=y +# Should we attempt to use the getrandom(2) call that provides more reliable +# yet secure randomness source than /dev/random on Linux 3.17 and newer. +# Requires glibc 2.25 to build, falls back to /dev/random if unavailable. +#CONFIG_GETRANDOM=y + +# Should we use poll instead of select? Select is used by default. +#CONFIG_ELOOP_POLL=y + +# Should we use epoll instead of select? Select is used by default. +#CONFIG_ELOOP_EPOLL=y + +# Should we use kqueue instead of select? Select is used by default. +#CONFIG_ELOOP_KQUEUE=y + # Select TLS implementation # openssl = OpenSSL (default) # gnutls = GnuTLS # internal = Internal TLSv1 implementation (experimental) +# linux = Linux kernel AF_ALG and internal TLSv1 implementation (experimental) # none = Empty template #CONFIG_TLS=openssl @@ -256,6 +281,10 @@ CONFIG_DEBUG_FILE=y # can be enabled to enable use of stronger crypto algorithms. #CONFIG_TLSV12=y +# Select which ciphers to use by default with OpenSSL if the user does not +# specify them. +#CONFIG_TLS_DEFAULT_CIPHERS="DEFAULT:!EXP:!LOW" + # If CONFIG_TLS=internal is used, additional library and include paths are # needed for LibTomMath. Alternatively, an integrated, minimal version of # LibTomMath can be used. See beginning of libtommath.c for details on benefits @@ -283,6 +312,12 @@ CONFIG_DEBUG_FILE=y # Enable SQLite database support in hlr_auc_gw, EAP-SIM DB, and eap_user_file #CONFIG_SQLITE=y +# Enable Fast Session Transfer (FST) +#CONFIG_FST=y + +# Enable CLI commands for FST testing +#CONFIG_FST_TEST=y + # Testing options # This can be used to enable some testing options (see also the example # configuration file) that are really useful only for testing clients that @@ -311,6 +346,74 @@ CONFIG_DEBUG_FILE=y # * ath10k # # For more details refer to: -# http://wireless.kernel.org/en/users/Documentation/acs +# https://wireless.wiki.kernel.org/en/users/documentation/acs # -#CONFIG_ACS=y +CONFIG_ACS=y + +# Multiband Operation support +# These extensions facilitate efficient use of multiple frequency bands +# available to the AP and the devices that may associate with it. +#CONFIG_MBO=y + +# Client Taxonomy +# Has the AP retain the Probe Request and (Re)Association Request frames from +# a client, from which a signature can be produced which can identify the model +# of client device like "Nexus 6P" or "iPhone 5s". +#CONFIG_TAXONOMY=y + +# Fast Initial Link Setup (FILS) (IEEE 802.11ai) +#CONFIG_FILS=y +# FILS shared key authentication with PFS +#CONFIG_FILS_SK_PFS=y + +# Include internal line edit mode in hostapd_cli. This can be used to provide +# limited command line editing and history support. +#CONFIG_WPA_CLI_EDIT=y + +# Opportunistic Wireless Encryption (OWE) +# Experimental implementation of draft-harkins-owe-07.txt +#CONFIG_OWE=y + +# Airtime policy support +#CONFIG_AIRTIME_POLICY=y + +# Override default value for the wpa_disable_eapol_key_retries configuration +# parameter. See that parameter in hostapd.conf for more details. +#CFLAGS += -DDEFAULT_WPA_DISABLE_EAPOL_KEY_RETRIES=1 + +# Wired equivalent privacy (WEP) +# WEP is an obsolete cryptographic data confidentiality algorithm that is not +# considered secure. It should not be used for anything anymore. The +# functionality needed to use WEP is available in the current hostapd +# release under this optional build parameter. This functionality is subject to +# be completely removed in a future release. +#CONFIG_WEP=y + +# Remove all TKIP functionality +# TKIP is an old cryptographic data confidentiality algorithm that is not +# considered secure. It should not be used anymore. For now, the default hostapd +# build includes this to allow mixed mode WPA+WPA2 networks to be enabled, but +# that functionality is subject to be removed in the future. +#CONFIG_NO_TKIP=y + +# Pre-Association Security Negotiation (PASN) +# Experimental implementation based on IEEE P802.11z/D2.6 and the protocol +# design is still subject to change. As such, this should not yet be enabled in +# production use. +# This requires CONFIG_IEEE80211W=y to be enabled, too. +#CONFIG_PASN=y + +# Device Provisioning Protocol (DPP) (also known as Wi-Fi Easy Connect) +CONFIG_DPP=y +# DPP version 2 support +CONFIG_DPP2=y +# DPP version 3 support (experimental and still changing; do not enable for +# production use) +#CONFIG_DPP3=y + + +# CUSTOM CONFIG +CONFIG_SAE=y +CONFIG_SAE_PK=y +CONFIG_SUITEB=y +CONFIG_SUITEB192=y From 03c3593050dd8e7ad24b14458c1a678c0b702c61 Mon Sep 17 00:00:00 2001 From: Isaac Hermida Date: Thu, 23 Mar 2023 10:09:26 +0100 Subject: [PATCH 044/100] hostapd: ccimx93: configure AP mode https://onedigi.atlassian.net/browse/DEL-8346 Signed-off-by: Isaac Hermida --- .../hostapd/hostapd/hostapd_uap0.conf | 42 +++++++++++++++++++ .../hostapd/hostapd_%.bbappend | 32 ++++++++++---- 2 files changed, 65 insertions(+), 9 deletions(-) create mode 100644 meta-digi-dey/recipes-connectivity/hostapd/hostapd/hostapd_uap0.conf diff --git a/meta-digi-dey/recipes-connectivity/hostapd/hostapd/hostapd_uap0.conf b/meta-digi-dey/recipes-connectivity/hostapd/hostapd/hostapd_uap0.conf new file mode 100644 index 000000000..860aa6dc5 --- /dev/null +++ b/meta-digi-dey/recipes-connectivity/hostapd/hostapd/hostapd_uap0.conf @@ -0,0 +1,42 @@ +ctrl_interface=/var/run/hostapd +ctrl_interface_group=0 +interface=uap0 +driver=nl80211 + +# SSID to identify the network +ssid=ap-uap0-##MAC## + +# 802.11a (5 GHz) mode +hw_mode=a + +# Set the channel to use. If 0 (ACS), channel will be automatically selected +channel=44 + +# IEEE 802.11i, WPA2 encryption with PSK authentication +auth_algs=1 +wpa=2 +wpa_key_mgmt=WPA-PSK +wpa_pairwise=CCMP +wpa_passphrase=password-wpa2aes + +# Uncomment to enable WPA3-SAE authentication +# wpa_key_mgmt=WPA-PSK SAE +# sae_password=password-wpa3sae + +# IEEE 802.11n (Wi-Fi 4) features +ieee80211n=1 +ht_capab=[HT20][HT40+][HT40-][SHORT-GI-20][SHORT-GI-40] + +# IEEE 802.11ac (Wi-Fi 5) features +ieee80211ac=1 +vht_oper_chwidth=0 +vht_capab=[SHORT-GI-80] + +# IEEE 802.11ax (Wi-Fi 6) features +ieee80211ax=1 +he_su_beamformer=1 +he_su_beamformee=1 + +# IEEE 802.11d (country information) +ieee80211d=1 +country_code=US diff --git a/meta-digi-dey/recipes-connectivity/hostapd/hostapd_%.bbappend b/meta-digi-dey/recipes-connectivity/hostapd/hostapd_%.bbappend index 67e1fb75a..157e18fdd 100644 --- a/meta-digi-dey/recipes-connectivity/hostapd/hostapd_%.bbappend +++ b/meta-digi-dey/recipes-connectivity/hostapd/hostapd_%.bbappend @@ -8,6 +8,10 @@ SRC_URI:append = " \ ${@oe.utils.conditional('HAS_WIFI_VIRTWLANS', 'true', 'file://hostapd_wlan1.conf', '', d)} \ " +SRC_URI:append:ccimx93 = " \ + file://hostapd_uap0.conf \ +" + # Patch series from Murata release MURATA_COMMON_PATCHES = " \ file://murata/0003-nl80211-Report-connection-authorized-in-EVENT_ASSOC.patch \ @@ -53,23 +57,33 @@ SYSTEMD_SERVICE:${PN}:append = " hostapd@.service" do_install:append() { # Remove the default hostapd.conf - rm -f ${WORKDIR}/hostapd.conf - # Install custom hostapd_IFACE.conf file - install -m 0644 ${WORKDIR}/hostapd_wlan0.conf ${D}${sysconfdir} + rm -f ${D}${sysconfdir}/hostapd.conf + + # Install custom hostapd_IFACE.conf files + add_hostapd_files + # Install interface-specific systemd service install -m 0644 ${WORKDIR}/hostapd@.service ${D}${systemd_unitdir}/system/ sed -i -e 's,@SBINDIR@,${sbindir},g' -e 's,@SYSCONFDIR@,${sysconfdir},g' ${D}${systemd_unitdir}/system/hostapd@.service + # Read-only rootfs: actions that substitute postinst script + # - append the ${DIGI_FAMILY} string to SSID + if [ -n "${@bb.utils.contains('IMAGE_FEATURES', 'read-only-rootfs', '1', '', d)}" ]; then + sed -i -e "s,##MAC##,${DIGI_FAMILY},g" ${D}${sysconfdir}/hostapd_*.conf + fi +} + +add_hostapd_files() { + install -m 0644 ${WORKDIR}/hostapd_wlan0.conf ${D}${sysconfdir} + if ${HAS_WIFI_VIRTWLANS}; then # Install custom hostapd_IFACE.conf file install -m 0644 ${WORKDIR}/hostapd_wlan1.conf ${D}${sysconfdir} fi +} - # Read-only rootfs: actions that substitute postinst script - # - append the ${DIGI_FAMILY} string to SSID - if [ -n "${@bb.utils.contains('IMAGE_FEATURES', 'read-only-rootfs', '1', '', d)}" ]; then - sed -i -e "s,##MAC##,${DIGI_FAMILY},g" ${D}${sysconfdir}/hostapd_wlan?.conf - fi +add_hostapd_files:ccimx93() { + install -m 0644 ${WORKDIR}/hostapd_uap0.conf ${D}${sysconfdir} } pkg_postinst_ontarget:${PN}() { @@ -84,7 +98,7 @@ pkg_postinst_ontarget:${PN}() { # Get the last two bytes of the wlan0 MAC address MAC="$(dd conv=swab if=/proc/device-tree/wireless/mac-address 2>/dev/null | hexdump | head -n 1 | cut -d ' ' -f 4)" - find "${sysconfdir}" -type f -name 'hostapd_wlan?.conf' -exec \ + find "${sysconfdir}" -type f -name 'hostapd_*.conf' -exec \ sed -i -e "s,##MAC##,${MAC},g" {} \; # Do not autostart hostapd daemon, it will conflict with wpa-supplicant. From 6e812a569bbefcf28e23435d7493fd319c2ec74c Mon Sep 17 00:00:00 2001 From: Isaac Hermida Date: Mon, 3 Apr 2023 16:38:45 +0200 Subject: [PATCH 045/100] ccimx93: bluetooth-init: fix how to set btaddr Use the specific hcitool vendor command to set the BT mac address. It is a custom vendor command (0x3f), and the field is 0x0022. The BT address is passed from last octet to first octet. https://onedigi.atlassian.net/browse/DEL-8346 Signed-off-by: Isaac Hermida --- .../bluez/bluez5-init/ccimx93/bluetooth-init | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/meta-digi-dey/recipes-connectivity/bluez/bluez5-init/ccimx93/bluetooth-init b/meta-digi-dey/recipes-connectivity/bluez/bluez5-init/ccimx93/bluetooth-init index 6ceda69b4..a13439151 100644 --- a/meta-digi-dey/recipes-connectivity/bluez/bluez5-init/ccimx93/bluetooth-init +++ b/meta-digi-dey/recipes-connectivity/bluez/bluez5-init/ccimx93/bluetooth-init @@ -19,16 +19,21 @@ log() { printf "<3>iw612-bluetooth: %s\n" "${1}" >/dev/kmsg } +set_btaddr() { + bt_addr=$(echo $(fw_printenv -n btaddr) | awk -F ":" '{ for(i=NF;i>=1;i--) printf "0x%s ", $i }') + hcitool -i ${HCI_IFACE} cmd 0x3f 0x0022 0xfe 0x06 ${bt_addr} +} + bluetooth_start() { if ! [ -e "/proc/device-tree/bluetooth/mac-address" ]; then log "[ERROR] Bluetooth mac-address not found" return fi - BTADDR=$(hexdump -ve '1/1 "%02X" ":"' /proc/device-tree/bluetooth/mac-address 2>/dev/null | sed 's/:$//g') - hciattach -t5 /dev/ttyBt any 115200 flow nosleep "${BTADDR}" && \ + hciattach -t5 /dev/ttyBt any 115200 flow nosleep && \ hciconfig ${HCI_IFACE} up && \ sleep 0.2 && \ + set_btaddr && \ hcitool -i ${HCI_IFACE} cmd 0x3f 0x0009 0xc0 0xc6 0x2d 0x00 && \ sleep 0.2 && \ killall hciattach && \ From f7943a9fd5743f92eed5e49a948c2c2032981dc3 Mon Sep 17 00:00:00 2001 From: Isaac Hermida Date: Tue, 4 Apr 2023 11:18:39 +0200 Subject: [PATCH 046/100] wpa-supplicant: optimize p2p support for ccimx93 The enabled options are mainly for AP mode, which improve the P2P performance when the P2P node behaves as an AP, it is, as P2P GO. https://onedigi.atlassian.net/browse/DEL-8346 Signed-off-by: Isaac Hermida --- .../wpa-supplicant/ccimx93/wpa_supplicant_p2p.conf | 4 ++++ .../wpa-supplicant/wpa-supplicant/defconfig | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant/ccimx93/wpa_supplicant_p2p.conf diff --git a/meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant/ccimx93/wpa_supplicant_p2p.conf b/meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant/ccimx93/wpa_supplicant_p2p.conf new file mode 100644 index 000000000..2d5c60e12 --- /dev/null +++ b/meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant/ccimx93/wpa_supplicant_p2p.conf @@ -0,0 +1,4 @@ +ctrl_interface=/var/run/wpa_supplicant +device_name=##WLAN_P2P_DEVICE_NAME## +config_methods=display keypad push_button +persistent_reconnect=1 diff --git a/meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant/defconfig b/meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant/defconfig index ea38c2dbb..3c6cc532a 100644 --- a/meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant/defconfig +++ b/meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant/defconfig @@ -476,7 +476,7 @@ CONFIG_IEEE80211R=y #CONFIG_GETRANDOM=y # IEEE 802.11ac (Very High Throughput) support (mainly for AP mode) -#CONFIG_IEEE80211AC=y +CONFIG_IEEE80211AC=y # Wireless Network Management (IEEE Std 802.11v-2011) # Note: This is experimental and not complete implementation. @@ -489,7 +489,7 @@ CONFIG_IEEE80211R=y #CONFIG_INTERWORKING=y # Hotspot 2.0 -#CONFIG_HS20=y +CONFIG_HS20=y # Enable interface matching in wpa_supplicant #CONFIG_MATCH_IFACE=y From ac1e4633fbc40f3cab62d3f71e3d959a62be0401 Mon Sep 17 00:00:00 2001 From: Isaac Hermida Date: Tue, 4 Apr 2023 17:01:24 +0200 Subject: [PATCH 047/100] bluez5-init: ccimx93: add fix to enable LE This fix is needed for bluez-5.65 version. We can drop it when using a newer version. https://onedigi.atlassian.net/browse/DEL-8346 Signed-off-by: Isaac Hermida --- .../bluez/bluez5-init/ccimx93/bluetooth-init | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/meta-digi-dey/recipes-connectivity/bluez/bluez5-init/ccimx93/bluetooth-init b/meta-digi-dey/recipes-connectivity/bluez/bluez5-init/ccimx93/bluetooth-init index a13439151..e02de3d63 100644 --- a/meta-digi-dey/recipes-connectivity/bluez/bluez5-init/ccimx93/bluetooth-init +++ b/meta-digi-dey/recipes-connectivity/bluez/bluez5-init/ccimx93/bluetooth-init @@ -24,6 +24,21 @@ set_btaddr() { hcitool -i ${HCI_IFACE} cmd 0x3f 0x0022 0xfe 0x06 ${bt_addr} } +le_fix() { + hcitool -i ${HCI_IFACE} cmd 0x03 0x0003 + sleep 0.2 + hcitool -i ${HCI_IFACE} cmd 0x03 0x0001 ff ff ff ff ff ff 3f ff + sleep 0.2 + hcitool -i ${HCI_IFACE} cmd 0x08 0x0001 ff ff 7f 00 00 00 00 00 + sleep 0.2 + hcitool -i ${HCI_IFACE} cmd 0x08 0x000B 01 10 00 10 00 00 00 + sleep 0.2 + hcitool -i ${HCI_IFACE} cmd 0x08 0x000C 01 01 + sleep 0.2 + hcitool -i ${HCI_IFACE} cmd 0x08 0x000C 00 00 + sleep 0.2 +} + bluetooth_start() { if ! [ -e "/proc/device-tree/bluetooth/mac-address" ]; then log "[ERROR] Bluetooth mac-address not found" @@ -39,6 +54,9 @@ bluetooth_start() { killall hciattach && \ sleep 0.2 && \ hciattach -t5 /dev/ttyBt any -s 3000000 3000000 flow && \ + hciconfig ${HCI_IFACE} up && \ + sleep 0.2 && \ + le_fix && \ log "Bluetooth activated" && return log "[ERROR] Cannot initialize Bluetooth" From 06e84d1b7b22d0b3d1b6ccddfce53389c43dbf8d Mon Sep 17 00:00:00 2001 From: Isaac Hermida Date: Fri, 14 Apr 2023 14:32:57 +0200 Subject: [PATCH 048/100] bluez5-init: ccimx93: modify script to support suspend/resume The BT chip for the ccimx93 cannot be turned off, nor can it be re-uploaded. Therefore, we need to set some conditions to assume that it is going to be attached correctly. The changes in this script take care of that. Upon the first attachment, the rate is set to 3M, and future uses will always be done at this rate. If, for any reason, it was not stopped and the chip is already attached, do nothing. https://onedigi.atlassian.net/browse/DEL-8464 Signed-off-by: Isaac Hermida --- .../bluez/bluez5-init/ccimx93/bluetooth-init | 34 +++++++++++-------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/meta-digi-dey/recipes-connectivity/bluez/bluez5-init/ccimx93/bluetooth-init b/meta-digi-dey/recipes-connectivity/bluez/bluez5-init/ccimx93/bluetooth-init index e02de3d63..497f53fea 100644 --- a/meta-digi-dey/recipes-connectivity/bluez/bluez5-init/ccimx93/bluetooth-init +++ b/meta-digi-dey/recipes-connectivity/bluez/bluez5-init/ccimx93/bluetooth-init @@ -45,14 +45,22 @@ bluetooth_start() { return fi - hciattach -t5 /dev/ttyBt any 115200 flow nosleep && \ - hciconfig ${HCI_IFACE} up && \ - sleep 0.2 && \ - set_btaddr && \ - hcitool -i ${HCI_IFACE} cmd 0x3f 0x0009 0xc0 0xc6 0x2d 0x00 && \ - sleep 0.2 && \ - killall hciattach && \ - sleep 0.2 && \ + # If there is a hciattach process running, just do nothing + pidof hciattach > /dev/null && log "Bluetooth already activated" && return + + # If port speed is 3M, assume that FW has been modified to run at that speed + if [ "$(stty -F /dev/ttyBt speed)" != "3000000" ]; then + hciattach -t5 /dev/ttyBt any 115200 flow nosleep && \ + hciconfig ${HCI_IFACE} up && \ + sleep 0.2 && \ + set_btaddr && \ + # Change rate to 3M using a custom vendor command + hcitool -i ${HCI_IFACE} cmd 0x3f 0x0009 0xc0 0xc6 0x2d 0x00 && \ + sleep 0.2 && \ + killall hciattach && \ + sleep 0.2 + fi + hciattach -t5 /dev/ttyBt any -s 3000000 3000000 flow && \ hciconfig ${HCI_IFACE} up && \ sleep 0.2 && \ @@ -65,12 +73,10 @@ bluetooth_start() { bluetooth_stop() { if [ -e "/sys/class/bluetooth/${HCI_IFACE}" ]; then - # hci reset command - hcitool -i ${HCI_IFACE} cmd 0x03 0x0003 - sleep 0.2 - # set baudrate to 115200 - hcitool -i ${HCI_IFACE} cmd 0x3f 0x0009 0x00 0xc2 0x01 0x00 - killall hciattach + killall hciattach > /dev/null + sleep 1 + # send a raw hci reset to set the chip in a good state + echo -e -n \\x01\\x03\\x0c\\x00 > /dev/ttyBt fi } From b980c2f1fffabeb44c2818c90daadeef6d5d72b8 Mon Sep 17 00:00:00 2001 From: David Escalona Date: Fri, 21 Apr 2023 13:38:43 +0200 Subject: [PATCH 049/100] ccimx93: libdigiapix: update apix configuration file for examples https://onedigi.atlassian.net/browse/DEL-8473 Signed-off-by: David Escalona --- .../ccimx93-dvk/libdigiapix.conf | 23 ++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/meta-digi-dey/recipes-digi/libdigiapix/libdigiapix-git/ccimx93-dvk/libdigiapix.conf b/meta-digi-dey/recipes-digi/libdigiapix/libdigiapix-git/ccimx93-dvk/libdigiapix.conf index 2b1044637..b28bd2bb6 100644 --- a/meta-digi-dey/recipes-digi/libdigiapix/libdigiapix-git/ccimx93-dvk/libdigiapix.conf +++ b/meta-digi-dey/recipes-digi/libdigiapix/libdigiapix-git/ccimx93-dvk/libdigiapix.conf @@ -1,24 +1,21 @@ [board] -model = Digi International ConnectCore 8M Mini DVK. +model = Digi International ConnectCore 93 DVK. [GPIO] # USER LED1 -USER_LED = mca-gpio,12 -USER_LED1 = mca-gpio,12 +USER_LED1 = gpiochip2,7 # USER_LED2 -USER_LED2 = mca-gpio,18 - -# USER_LED3 -USER_LED3 = gpio2,19 +USER_LED = gpiochip3,23 +USER_LED2 = gpiochip3,23 # USER BUTTON1 -USER_BUTTON = mca-gpio,10 -USER_BUTTON1 = mca-gpio,10 +USER_BUTTON = gpiochip2,7 +USER_BUTTON1 = gpiochip2,7 # USER BUTTON2 -USER_BUTTON2 = gpio2,20 +USER_BUTTON2 = gpiochip3,23 [I2C] @@ -27,10 +24,10 @@ DEFAULT_I2C_BUS = 4 [PWM] -# PWM0 channel 1 USER_LED1. +# PWM0 channel 1 - LVDS backlight. DEFAULT_PWM = 0,1 [ADC] -# MCA_IO1 (channel 1) at XBEE1_UART_TX. Not enabled by default. -DEFAULT_ADC = 0,1 +# ADC channel 0 - Pin J48-1. +DEFAULT_ADC = 0,0 From fd5ee3a5e35e3eb2ac35393e5e29f20942b5e248 Mon Sep 17 00:00:00 2001 From: Isaac Hermida Date: Mon, 24 Apr 2023 09:07:53 +0200 Subject: [PATCH 050/100] ccimx93: standby: customize script support for systemd We need to take in account if the IW612 chip (WiFi/Bt) is going to be powered off on suspend state. In such a case, we need to unload the driver modules and restore the expected tty speed for Bluetooth, so that functionality is restored back on resume. https://onedigi.atlassian.net/browse/DEL-8489 Signed-off-by: Isaac Hermida --- .../busybox/busybox/ccimx93/standby-actions | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 meta-digi-dey/recipes-core/busybox/busybox/ccimx93/standby-actions diff --git a/meta-digi-dey/recipes-core/busybox/busybox/ccimx93/standby-actions b/meta-digi-dey/recipes-core/busybox/busybox/ccimx93/standby-actions new file mode 100644 index 000000000..00c80a8b2 --- /dev/null +++ b/meta-digi-dey/recipes-core/busybox/busybox/ccimx93/standby-actions @@ -0,0 +1,60 @@ +#!/bin/sh +#=============================================================================== +# +# standby-actions +# +# Copyright (C) 2023 by Digi International Inc. +# All rights reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 as published by +# the Free Software Foundation. +# +# +# !Description: manage interfaces before suspending and after resuming from +# suspend +# +#=============================================================================== + +SUSPEND_WLAN_IFACES="/tmp/suspend_wlan_ifaces" + +actions_needed() { + [ -d "/proc/device-tree/wireless" ] && [ ! -e "/sys/firmware/devicetree/base/soc@0/bus@42800000/mmc@428b0000/keep-power-in-suspend" ] +} + +if [ "${1}" = "pre" ]; then + # Stop NetworkManager before suspend + systemctl stop NetworkManager + + if actions_needed; then + rm -f "${SUSPEND_WLAN_IFACES}" + for iface in mlan0 uap0 wfd0; do + if grep -qs ${iface} /var/run/ifstate; then + ifdown ${iface} && echo ${iface} >> "${SUSPEND_WLAN_IFACES}" + fi + done + + rmmod moal + rmmod mlan + + systemctl stop bluetooth + systemctl stop bluetooth-init + stty -F /dev/ttyBt 115200 + fi +elif [ "${1}" = "post" ]; then + if actions_needed; then + /etc/udev/scripts/load_iw612.sh + sleep 0.5 + + while read -r iface; do + ifup "${iface}" + done < "${SUSPEND_WLAN_IFACES}" + rm -f "${SUSPEND_WLAN_IFACES}" + + systemctl start bluetooth-init + systemctl start bluetooth + fi + + # Resume NetworkManager after suspend + systemctl start NetworkManager +fi From 803945c0801d59d8577e34d08e4715f725b7d563 Mon Sep 17 00:00:00 2001 From: Isaac Hermida Date: Tue, 2 May 2023 12:51:59 +0200 Subject: [PATCH 051/100] Revert "bluez5-init: ccimx93: add fix to enable LE" Masking the extended advertising flag makes the hcitool lescan work, but triggers functionality problem such as bluetoothctl scanning or extended advertisement not working. Do not mask it, so use bluetoothctl scan instead of hcitool lescan to discover LE devices. This reverts commit ac1e4633fbc40f3cab62d3f71e3d959a62be0401. Signed-off-by: Isaac Hermida --- .../bluez/bluez5-init/ccimx93/bluetooth-init | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/meta-digi-dey/recipes-connectivity/bluez/bluez5-init/ccimx93/bluetooth-init b/meta-digi-dey/recipes-connectivity/bluez/bluez5-init/ccimx93/bluetooth-init index 497f53fea..54f288b76 100644 --- a/meta-digi-dey/recipes-connectivity/bluez/bluez5-init/ccimx93/bluetooth-init +++ b/meta-digi-dey/recipes-connectivity/bluez/bluez5-init/ccimx93/bluetooth-init @@ -24,21 +24,6 @@ set_btaddr() { hcitool -i ${HCI_IFACE} cmd 0x3f 0x0022 0xfe 0x06 ${bt_addr} } -le_fix() { - hcitool -i ${HCI_IFACE} cmd 0x03 0x0003 - sleep 0.2 - hcitool -i ${HCI_IFACE} cmd 0x03 0x0001 ff ff ff ff ff ff 3f ff - sleep 0.2 - hcitool -i ${HCI_IFACE} cmd 0x08 0x0001 ff ff 7f 00 00 00 00 00 - sleep 0.2 - hcitool -i ${HCI_IFACE} cmd 0x08 0x000B 01 10 00 10 00 00 00 - sleep 0.2 - hcitool -i ${HCI_IFACE} cmd 0x08 0x000C 01 01 - sleep 0.2 - hcitool -i ${HCI_IFACE} cmd 0x08 0x000C 00 00 - sleep 0.2 -} - bluetooth_start() { if ! [ -e "/proc/device-tree/bluetooth/mac-address" ]; then log "[ERROR] Bluetooth mac-address not found" @@ -62,9 +47,6 @@ bluetooth_start() { fi hciattach -t5 /dev/ttyBt any -s 3000000 3000000 flow && \ - hciconfig ${HCI_IFACE} up && \ - sleep 0.2 && \ - le_fix && \ log "Bluetooth activated" && return log "[ERROR] Cannot initialize Bluetooth" From beb9fd02e6759fc68556d52b971e115900cf6a91 Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Tue, 2 May 2023 17:28:32 +0200 Subject: [PATCH 052/100] meta-digi-arm: add optee userspace for IMX platforms that support it NXP platforms that have 'optee' in the MACHINE_FEATURES, will install optee userspace packages (ccimx8m and ccimx93 at the moment). Signed-off-by: Javier Viguera --- meta-digi-arm/conf/machine/include/digi-defaults.inc | 1 + meta-digi-arm/conf/machine/include/imx-digi-base.inc | 3 +++ 2 files changed, 4 insertions(+) diff --git a/meta-digi-arm/conf/machine/include/digi-defaults.inc b/meta-digi-arm/conf/machine/include/digi-defaults.inc index cb28faf61..b8a9eb21f 100644 --- a/meta-digi-arm/conf/machine/include/digi-defaults.inc +++ b/meta-digi-arm/conf/machine/include/digi-defaults.inc @@ -66,6 +66,7 @@ MACHINEOVERRIDES .= "${@['', ':${MACHINE_VARIANT}']['${MACHINE_VARIANT}' != '']} # Extra RDEPENDS MACHINE_EXTRA_RDEPENDS += " \ ${@bb.utils.contains("MACHINE_FEATURES", "mca", "mca-tool", "", d)} \ + ${@bb.utils.contains('MACHINE_FEATURES', 'optee', '${OPTEE_PKGS}', '', d)} \ " # Extra RRECOMMENDS MACHINE_EXTRA_RRECOMMENDS += " \ diff --git a/meta-digi-arm/conf/machine/include/imx-digi-base.inc b/meta-digi-arm/conf/machine/include/imx-digi-base.inc index 71f58f7bc..856ed6d0f 100644 --- a/meta-digi-arm/conf/machine/include/imx-digi-base.inc +++ b/meta-digi-arm/conf/machine/include/imx-digi-base.inc @@ -278,6 +278,9 @@ PREFERRED_VERSION_optee-client:mx9-nxp-bsp ??= "3.19.0.imx" PREFERRED_VERSION_optee-test:mx8-nxp-bsp ??= "3.19.0.imx" PREFERRED_VERSION_optee-test:mx9-nxp-bsp ??= "3.19.0.imx" +# Optee runtime packages to install +OPTEE_PKGS:use-nxp-bsp ??= "optee-client optee-os" + # Use i.MX opencv Version PREFERRED_VERSION_opencv:mx8-nxp-bsp ??= "4.6.0.imx" PREFERRED_VERSION_opencv:mx9-nxp-bsp ??= "4.6.0.imx" From 28f57c5fcd7ef6f651ab83b8c9aeb7d670f51e37 Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Thu, 4 May 2023 10:22:06 +0200 Subject: [PATCH 053/100] remove-pkg-postinst-ontarget: support other runtime packages A recipe may generate different runtime packages, with names other than PN. This commit allows removing the ontarget postinst script for those other runtime package names. To do so, just define REMOVE_POSTINST_RPN before including this class in the recipe. The first user is in the following commit. Signed-off-by: Javier Viguera --- meta-digi-arm/classes/remove-pkg-postinst-ontarget.bbclass | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/meta-digi-arm/classes/remove-pkg-postinst-ontarget.bbclass b/meta-digi-arm/classes/remove-pkg-postinst-ontarget.bbclass index dacb75498..c889790ff 100644 --- a/meta-digi-arm/classes/remove-pkg-postinst-ontarget.bbclass +++ b/meta-digi-arm/classes/remove-pkg-postinst-ontarget.bbclass @@ -1,2 +1,7 @@ -pkg_postinst_ontarget:${PN}() { +python __anonymous() { + RPN = d.getVar("REMOVE_POSTINST_RPN") + if RPN is None: + RPN = d.getVar("PN") + if RPN: + d.setVar('pkg_postinst_ontarget:%s' % RPN, "") } From 7bd3ebc76e585e45e7da693a36bb043497a55476 Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Thu, 4 May 2023 10:51:06 +0200 Subject: [PATCH 054/100] e2fsprogs: delete on target postinst script for read-only rootfs Otherwise the build fails, with: ERROR: dey-image-qt-1.0-r0 do_rootfs: The following packages could not be configured offline and rootfs is read-only: ['100-e2fsprogs-mke2fs'] https://onedigi.atlassian.net/browse/DEL-8495 Signed-off-by: Javier Viguera --- meta-digi-dey/recipes-devtools/e2fsprogs/e2fsprogs_%.bbappend | 3 +++ 1 file changed, 3 insertions(+) diff --git a/meta-digi-dey/recipes-devtools/e2fsprogs/e2fsprogs_%.bbappend b/meta-digi-dey/recipes-devtools/e2fsprogs/e2fsprogs_%.bbappend index 4ef05d017..da082ff86 100644 --- a/meta-digi-dey/recipes-devtools/e2fsprogs/e2fsprogs_%.bbappend +++ b/meta-digi-dey/recipes-devtools/e2fsprogs/e2fsprogs_%.bbappend @@ -34,3 +34,6 @@ pkg_postinst_ontarget:${PN}-mke2fs() { fi fi } + +REMOVE_POSTINST_RPN = "${PN}-mke2fs" +inherit ${@bb.utils.contains("IMAGE_FEATURES", "read-only-rootfs", "remove-pkg-postinst-ontarget", "", d)} From eb1bc0eeb3f19bf060ef2c2d386792a94ffc5764 Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Thu, 4 May 2023 11:58:37 +0200 Subject: [PATCH 055/100] meta-digi-arm: fix regression in optee userspace support OPTEE_PKGS variable must have a default (empty) value to prevent bitbake parsing errors. This fixes a build failure for MP1 platforms where the variable was undefined in the commit that added the support. Signed-off-by: Javier Viguera --- meta-digi-arm/conf/machine/include/digi-defaults.inc | 1 + meta-digi-arm/conf/machine/include/imx-digi-base.inc | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/meta-digi-arm/conf/machine/include/digi-defaults.inc b/meta-digi-arm/conf/machine/include/digi-defaults.inc index b8a9eb21f..9410a4ab4 100644 --- a/meta-digi-arm/conf/machine/include/digi-defaults.inc +++ b/meta-digi-arm/conf/machine/include/digi-defaults.inc @@ -64,6 +64,7 @@ MACHINE_VARIANT ?= "" MACHINEOVERRIDES .= "${@['', ':${MACHINE_VARIANT}']['${MACHINE_VARIANT}' != '']}" # Extra RDEPENDS +OPTEE_PKGS ??= "" MACHINE_EXTRA_RDEPENDS += " \ ${@bb.utils.contains("MACHINE_FEATURES", "mca", "mca-tool", "", d)} \ ${@bb.utils.contains('MACHINE_FEATURES', 'optee', '${OPTEE_PKGS}', '', d)} \ diff --git a/meta-digi-arm/conf/machine/include/imx-digi-base.inc b/meta-digi-arm/conf/machine/include/imx-digi-base.inc index 856ed6d0f..aed5d59e9 100644 --- a/meta-digi-arm/conf/machine/include/imx-digi-base.inc +++ b/meta-digi-arm/conf/machine/include/imx-digi-base.inc @@ -279,7 +279,7 @@ PREFERRED_VERSION_optee-test:mx8-nxp-bsp ??= "3.19.0.imx" PREFERRED_VERSION_optee-test:mx9-nxp-bsp ??= "3.19.0.imx" # Optee runtime packages to install -OPTEE_PKGS:use-nxp-bsp ??= "optee-client optee-os" +OPTEE_PKGS ??= "optee-client optee-os" # Use i.MX opencv Version PREFERRED_VERSION_opencv:mx8-nxp-bsp ??= "4.6.0.imx" From d193b5e3a775049e025dceb397d905fb5f329e72 Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Thu, 4 May 2023 13:22:30 +0200 Subject: [PATCH 056/100] ccimx93: add NPU overlay Support for Ethos NPU has been enabled in the kernel. Signed-off-by: Javier Viguera --- meta-digi-arm/conf/machine/ccimx93-dvk.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/meta-digi-arm/conf/machine/ccimx93-dvk.conf b/meta-digi-arm/conf/machine/ccimx93-dvk.conf index 2a940245e..9f193904e 100644 --- a/meta-digi-arm/conf/machine/ccimx93-dvk.conf +++ b/meta-digi-arm/conf/machine/ccimx93-dvk.conf @@ -17,6 +17,7 @@ KERNEL_DEVICETREE ?= " \ digi/_ov_board_mikroe-gyro-click_ccimx93-dvk.dtbo \ digi/_ov_som_bt_ccimx93.dtbo \ digi/_ov_som_mca_ccimx93.dtbo \ + digi/_ov_som_npu_ccimx93.dtbo \ digi/_ov_som_wifi_ccimx93.dtbo \ " From 7302fbc0dfb98d7692be54c1e54cfb83001db434 Mon Sep 17 00:00:00 2001 From: David Escalona Date: Thu, 4 May 2023 14:04:50 +0200 Subject: [PATCH 057/100] ccimx93: libdigiapix: fix default I2C bus Signed-off-by: David Escalona --- .../libdigiapix/libdigiapix-git/ccimx93-dvk/libdigiapix.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta-digi-dey/recipes-digi/libdigiapix/libdigiapix-git/ccimx93-dvk/libdigiapix.conf b/meta-digi-dey/recipes-digi/libdigiapix/libdigiapix-git/ccimx93-dvk/libdigiapix.conf index b28bd2bb6..311a02c7f 100644 --- a/meta-digi-dey/recipes-digi/libdigiapix/libdigiapix-git/ccimx93-dvk/libdigiapix.conf +++ b/meta-digi-dey/recipes-digi/libdigiapix/libdigiapix-git/ccimx93-dvk/libdigiapix.conf @@ -19,8 +19,8 @@ USER_BUTTON2 = gpiochip3,23 [I2C] -# I2C-4 on Expansion connector. -DEFAULT_I2C_BUS = 4 +# I2C-3 on MikroBus connector. +DEFAULT_I2C_BUS = 2 [PWM] From ea81fda3bf2bcfd7f5af97cab9b49d0bf5ef1a4c Mon Sep 17 00:00:00 2001 From: Isaac Hermida Date: Tue, 2 May 2023 16:26:05 +0200 Subject: [PATCH 058/100] ccimx93: standby: check bluetooth-init service status Check if the bluetooth-init service is running before going to suspend, just in case has stopped or disabled it on purpose. https://onedigi.atlassian.net/browse/DEL-8497 Signed-off-by: Isaac Hermida --- .../busybox/busybox/ccimx93/standby-actions | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/meta-digi-dey/recipes-core/busybox/busybox/ccimx93/standby-actions b/meta-digi-dey/recipes-core/busybox/busybox/ccimx93/standby-actions index 00c80a8b2..b651777bc 100644 --- a/meta-digi-dey/recipes-core/busybox/busybox/ccimx93/standby-actions +++ b/meta-digi-dey/recipes-core/busybox/busybox/ccimx93/standby-actions @@ -16,7 +16,7 @@ # #=============================================================================== -SUSPEND_WLAN_IFACES="/tmp/suspend_wlan_ifaces" +RESUME_ACTIONS="/tmp/resume_actions" actions_needed() { [ -d "/proc/device-tree/wireless" ] && [ ! -e "/sys/firmware/devicetree/base/soc@0/bus@42800000/mmc@428b0000/keep-power-in-suspend" ] @@ -27,32 +27,32 @@ if [ "${1}" = "pre" ]; then systemctl stop NetworkManager if actions_needed; then - rm -f "${SUSPEND_WLAN_IFACES}" + rm -f "${RESUME_ACTIONS}" for iface in mlan0 uap0 wfd0; do if grep -qs ${iface} /var/run/ifstate; then - ifdown ${iface} && echo ${iface} >> "${SUSPEND_WLAN_IFACES}" + ifdown ${iface} && echo "ifup ${iface}" >> "${RESUME_ACTIONS}" fi done rmmod moal rmmod mlan - systemctl stop bluetooth - systemctl stop bluetooth-init - stty -F /dev/ttyBt 115200 + if systemctl is-active bluetooth-init; then + # + # bluetooth service relies on bluetooth-init service, so stop/start it unconditionally + echo "systemctl start bluetooth-init" >> "${RESUME_ACTIONS}" + echo "systemctl start bluetooth" >> "${RESUME_ACTIONS}" + systemctl stop bluetooth-init + systemctl stop bluetooth + stty -F /dev/ttyBt 115200 + fi fi elif [ "${1}" = "post" ]; then if actions_needed; then /etc/udev/scripts/load_iw612.sh sleep 0.5 - - while read -r iface; do - ifup "${iface}" - done < "${SUSPEND_WLAN_IFACES}" - rm -f "${SUSPEND_WLAN_IFACES}" - - systemctl start bluetooth-init - systemctl start bluetooth + sh "${RESUME_ACTIONS}" + rm -f "${RESUME_ACTIONS}" fi # Resume NetworkManager after suspend From 181ce4761a9d1a9f4adba70499ac563560b777e5 Mon Sep 17 00:00:00 2001 From: Isaac Hermida Date: Wed, 3 May 2023 11:54:39 +0200 Subject: [PATCH 059/100] cc93: iw612: rename name of main wlan interface rename interface sta_name to be "wlan0" instead of "mlan0", so it keeps compatibility with other platforms. Signed-off-by: Isaac Hermida --- .../kernel-modules/kernel-module-nxp-wlan/load_iw612.sh | 1 + .../recipes-core/busybox/busybox/ccimx93/standby-actions | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/meta-digi-arm/recipes-kernel/kernel-modules/kernel-module-nxp-wlan/load_iw612.sh b/meta-digi-arm/recipes-kernel/kernel-modules/kernel-module-nxp-wlan/load_iw612.sh index e34e4804b..8a8539688 100644 --- a/meta-digi-arm/recipes-kernel/kernel-modules/kernel-module-nxp-wlan/load_iw612.sh +++ b/meta-digi-arm/recipes-kernel/kernel-modules/kernel-module-nxp-wlan/load_iw612.sh @@ -19,6 +19,7 @@ auto_ds=1 \ host_mlme=1 \ drv_mode=${DRIVER_MODE} \ drvdbg=${DRIVER_DEBUG} \ +sta_name=wlan \ fw_name=nxp/sduart_nw61x_v1.bin.se\ " diff --git a/meta-digi-dey/recipes-core/busybox/busybox/ccimx93/standby-actions b/meta-digi-dey/recipes-core/busybox/busybox/ccimx93/standby-actions index b651777bc..154b40520 100644 --- a/meta-digi-dey/recipes-core/busybox/busybox/ccimx93/standby-actions +++ b/meta-digi-dey/recipes-core/busybox/busybox/ccimx93/standby-actions @@ -28,7 +28,7 @@ if [ "${1}" = "pre" ]; then if actions_needed; then rm -f "${RESUME_ACTIONS}" - for iface in mlan0 uap0 wfd0; do + for iface in wlan0 uap0 wfd0; do if grep -qs ${iface} /var/run/ifstate; then ifdown ${iface} && echo "ifup ${iface}" >> "${RESUME_ACTIONS}" fi From 9141451583ea0085845ab76b1f9c66ee645ad997 Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Fri, 5 May 2023 10:51:14 +0200 Subject: [PATCH 060/100] meta-digi: cosmetic, delete machine variants dead code We removed machine variants support years ago. Signed-off-by: Javier Viguera --- meta-digi-arm/conf/machine/include/digi-defaults.inc | 4 ---- sdk/mkproject.sh | 10 ++-------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/meta-digi-arm/conf/machine/include/digi-defaults.inc b/meta-digi-arm/conf/machine/include/digi-defaults.inc index 9410a4ab4..48750f190 100644 --- a/meta-digi-arm/conf/machine/include/digi-defaults.inc +++ b/meta-digi-arm/conf/machine/include/digi-defaults.inc @@ -59,10 +59,6 @@ IMAGE_CLASSES = "image_types_digi" # Do not enable console on VT (see sysvinit-inittab recipe) USE_VT ?= "0" -# Add the machine variant to the valid machine override -MACHINE_VARIANT ?= "" -MACHINEOVERRIDES .= "${@['', ':${MACHINE_VARIANT}']['${MACHINE_VARIANT}' != '']}" - # Extra RDEPENDS OPTEE_PKGS ??= "" MACHINE_EXTRA_RDEPENDS += " \ diff --git a/sdk/mkproject.sh b/sdk/mkproject.sh index a9768a192..c201767de 100755 --- a/sdk/mkproject.sh +++ b/sdk/mkproject.sh @@ -151,10 +151,6 @@ do_mkproject() { # Customize project chmod 644 ${MKP_PROJECTPATH}/conf/bblayers.conf ${MKP_PROJECTPATH}/conf/local.conf sed -i -e "s,##DIGIBASE##,${MKP_SCRIPTPATH}/sources,g" ${MKP_PROJECTPATH}/conf/bblayers.conf - if [ -n "${MKP_VARIANT+x}" ]; then - sed -i -e "/^MACHINE_VARIANT =/cMACHINE_VARIANT = \"${MKP_VARIANT}\"" \ - ${MKP_PROJECTPATH}/conf/local.conf - fi # At this point the user has accepted all the licenses, so enable the vendor EULA sed -i -e "s,^#\(ACCEPT.*EULA\),\1,g" ${MKP_PROJECTPATH}/conf/local.conf # Create dey-setup-environment script @@ -178,11 +174,10 @@ fi # The script needs to be sourced (not executed) so make sure to # initialize OPTIND variable for getopts. OPTIND=1 -while getopts "lp:v:m:" c; do +while getopts "lp:m:" c; do case "${c}" in l) MKP_LIST_PLATFORMS="y";; p) MKP_PLATFORM="${OPTARG}";; - v) MKP_VARIANT="${OPTARG}";; m) MKP_CONFIGPATH="${MKP_SCRIPTPATH}/sources/${OPTARG}/sdk/config";; esac done @@ -219,5 +214,4 @@ unset MKP_AVAILABLE_PLATFORMS \ MKP_RED \ MKP_SCRIPTNAME \ MKP_SCRIPTPATH \ - MKP_SETUP_ENVIRONMENT \ - MKP_VARIANT + MKP_SETUP_ENVIRONMENT From faa2ce67d4cc29d335f3d08b2ad5209c285e618e Mon Sep 17 00:00:00 2001 From: Gabriel Valcazar Date: Fri, 21 Apr 2023 14:24:04 +0200 Subject: [PATCH 061/100] Remove meta-st-stm32mpu-ai dependency with st-openstlinux layer This dependency is only required if you wish to build ST's reference images, which isn't our case. Add said reference images' recipes to the BBMASK to avoid build errors. https://onedigi.atlassian.net/browse/DEL-8308 Signed-off-by: Gabriel Valcazar --- meta-digi-arm/conf/layer.conf | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/meta-digi-arm/conf/layer.conf b/meta-digi-arm/conf/layer.conf index 9b363fb63..d34c478ae 100644 --- a/meta-digi-arm/conf/layer.conf +++ b/meta-digi-arm/conf/layer.conf @@ -36,6 +36,13 @@ BBMASK += " \ meta-st-stm32mp/recipes-core/systemd/systemd-conf_%.bbappend \ " +# Tweak stm32mpu-ai dependencies to use ST's machine learning packages +LAYERDEPENDS_stm32mpu-ai:remove = "st-openstlinux" +BBMASK += " \ + meta-st-stm32mpu-ai/recipes-st/images/st-image-ai-userfs.bb \ + meta-st-stm32mpu-ai/recipes-st/images/st-image-ai.bb \ +" + # Digi's General and Open Source license agreements DIGI_EULA_FILE = "${LAYERDIR}/DIGI_EULA" DIGI_OPEN_EULA_FILE = "${LAYERDIR}/DIGI_OPEN_EULA" From 163b229bebcf21476336d95a3ec0d70270216411 Mon Sep 17 00:00:00 2001 From: Gabriel Valcazar Date: Fri, 21 Apr 2023 16:48:43 +0200 Subject: [PATCH 062/100] Move Coral-related recipes to dynamic Freescale layer These are recipes we created to support Google Coral on i.MX platforms. ST's machine learning layer provides similar recipes, so to avoid conflicts, move the recipes meant for i.MX platforms to a dynamic layer. https://onedigi.atlassian.net/browse/DEL-8308 Signed-off-by: Gabriel Valcazar --- .../freescale-layer}/recipes-bsp/libedgetpu/libedgetpu_13.0.bb | 0 .../recipes-devtools/python3-pycoral/python3-pycoral_1.0.1.bb | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename meta-digi-arm/{ => dynamic-layers/freescale-layer}/recipes-bsp/libedgetpu/libedgetpu_13.0.bb (100%) rename meta-digi-dey/{ => dynamic-layers/freescale-layer}/recipes-devtools/python3-pycoral/python3-pycoral_1.0.1.bb (100%) diff --git a/meta-digi-arm/recipes-bsp/libedgetpu/libedgetpu_13.0.bb b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/libedgetpu/libedgetpu_13.0.bb similarity index 100% rename from meta-digi-arm/recipes-bsp/libedgetpu/libedgetpu_13.0.bb rename to meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/libedgetpu/libedgetpu_13.0.bb diff --git a/meta-digi-dey/recipes-devtools/python3-pycoral/python3-pycoral_1.0.1.bb b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-devtools/python3-pycoral/python3-pycoral_1.0.1.bb similarity index 100% rename from meta-digi-dey/recipes-devtools/python3-pycoral/python3-pycoral_1.0.1.bb rename to meta-digi-dey/dynamic-layers/freescale-layer/recipes-devtools/python3-pycoral/python3-pycoral_1.0.1.bb From 502cdecd9d5ef5e062d6952d2be650c90087214f Mon Sep 17 00:00:00 2001 From: Gabriel Valcazar Date: Fri, 21 Apr 2023 17:02:15 +0200 Subject: [PATCH 063/100] onnxruntime: modify installation process to avoid QA error ST's onnxruntime recipe moves a file in a way that triggers a QA error due to file ownership issues. Copy the do_install() function as-is and modify the offending line to copy the file instead. Create a dynamic layer for stm32mpu-ai to include the bbappend. https://onedigi.atlassian.net/browse/DEL-8308 Signed-off-by: Gabriel Valcazar --- meta-digi-dey/conf/layer.conf | 2 + .../onnxruntime/onnxruntime_git.bbappend | 45 +++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 meta-digi-dey/dynamic-layers/stm32mpu-ai/recipes-frameworks/onnxruntime/onnxruntime_git.bbappend diff --git a/meta-digi-dey/conf/layer.conf b/meta-digi-dey/conf/layer.conf index c456ba13c..be7d3638e 100644 --- a/meta-digi-dey/conf/layer.conf +++ b/meta-digi-dey/conf/layer.conf @@ -14,6 +14,8 @@ BBFILES_DYNAMIC += " \ freescale-layer:${LAYERDIR}/dynamic-layers/freescale-layer/*/*/*.bbappend \ stm-st-stm32mp:${LAYERDIR}/dynamic-layers/stm-st-stm32mp/*/*/*.bb \ stm-st-stm32mp:${LAYERDIR}/dynamic-layers/stm-st-stm32mp/*/*/*.bbappend \ + stm32mpu-ai:${LAYERDIR}/dynamic-layers/stm32mpu-ai/*/*/*.bb \ + stm32mpu-ai:${LAYERDIR}/dynamic-layers/stm32mpu-ai/*/*/*.bbappend \ qt5-layer:${LAYERDIR}/dynamic-layers/qt5-layer/*/*/*.bb \ qt5-layer:${LAYERDIR}/dynamic-layers/qt5-layer/*/*/*.bbappend \ qt5-layer:${LAYERDIR}/dynamic-layers/qt5-layer/${DEY_BUILD_PLATFORM}/*/*/*.bb \ diff --git a/meta-digi-dey/dynamic-layers/stm32mpu-ai/recipes-frameworks/onnxruntime/onnxruntime_git.bbappend b/meta-digi-dey/dynamic-layers/stm32mpu-ai/recipes-frameworks/onnxruntime/onnxruntime_git.bbappend new file mode 100644 index 000000000..7c7a3079e --- /dev/null +++ b/meta-digi-dey/dynamic-layers/stm32mpu-ai/recipes-frameworks/onnxruntime/onnxruntime_git.bbappend @@ -0,0 +1,45 @@ +# Copyright 2023 Digi International Inc. + +do_install() { + + # Install onnxruntime dynamic library + install -d ${D}${libdir} + install -d ${D}${prefix}/local/bin/${PN}-${PVB}/tools + install -m 0644 ${B}/libonnxruntime.so ${D}${libdir}/libonnxruntime.so.${PVB} + + # This shared lib is used by onnxruntime_shared_lib_test and onnxruntime_test_python.py + install -m 644 ${B}/libcustom_op_library.so ${D}${libdir} + # And this one only by onnxruntime_test_python.py + install -m 644 ${B}/libtest_execution_provider.so ${D}${libdir} + install -m 644 ${B}/libonnxruntime_providers_shared.so ${D}${libdir}/libonnxruntime_providers_shared.so + install -m 644 ${B}/onnxruntime_pybind11_state.so ${D}${libdir}/onnxruntime_pybind11_state.so + + # Install the symlinks. + ln -sf libonnxruntime.so.${PVB} ${D}${libdir}/libonnxruntime.so.${MAJOR} + ln -sf libonnxruntime.so.${PVB} ${D}${libdir}/libonnxruntime.so + + # Digi: copy instead of moving to avoid QA errors + # Copy the onnx_test_runner executable that was installed in /usr instead of /usr/local. + cp ${B}/onnx_test_runner ${D}${prefix}/local/bin/${PN}-${PVB}/tools + + # These are not included in the base installation, so we install them manually. + install -m 755 ${B}/onnxruntime_perf_test ${D}${prefix}/local/bin/${PN}-${PVB}/tools + install -m 755 ${B}/onnxruntime_test_all ${D}${prefix}/local/bin/${PN}-${PVB}/tools + install -m 755 ${B}/onnxruntime_shared_lib_test ${D}${prefix}/local/bin/${PN}-${PVB}/tools + install -m 755 ${B}/onnxruntime_api_tests_without_env ${D}${prefix}/local/bin/${PN}-${PVB}/tools + install -m 755 ${B}/onnxruntime_global_thread_pools_test ${D}${prefix}/local/bin/${PN}-${PVB}/tools + install -m 755 ${B}/onnxruntime_test_python.py ${D}${prefix}/local/bin/${PN}-${PVB}/tools + install -m 755 ${B}/helper.py ${D}${prefix}/local/bin/${PN}-${PVB}/tools + cp -r ${B}/testdata ${D}${prefix}/local/bin/${PN}-${PVB}/tools + + # We have to change some of the RPATH as well. + chrpath -r '$ORIGIN' ${D}${prefix}/local/bin/${PN}-${PVB}/tools/onnxruntime_perf_test + chrpath -r '$ORIGIN' ${D}${prefix}/local/bin/${PN}-${PVB}/tools/onnxruntime_shared_lib_test + chrpath -r '$ORIGIN' ${D}${prefix}/local/bin/${PN}-${PVB}/tools/onnxruntime_api_tests_without_env + chrpath -r '$ORIGIN' ${D}${prefix}/local/bin/${PN}-${PVB}/tools/onnxruntime_global_thread_pools_test + chrpath -r '$ORIGIN' ${D}${libdir}/libtest_execution_provider.so + + # Install the Python package. + mkdir -p ${D}${PYTHON_SITEPACKAGES_DIR}/onnxruntime + cp -r ${B}/onnxruntime ${D}${PYTHON_SITEPACKAGES_DIR} +} From 8cb72edb656cb7add64249bbb2790cbd7972e67c Mon Sep 17 00:00:00 2001 From: Gabriel Valcazar Date: Fri, 28 Apr 2023 17:30:03 +0200 Subject: [PATCH 064/100] packagegroup-x-linux-ai: remove c++ examples on the ccmp13 These examples have a gtk+3 dependency that can't be met on the ccmp13 due to it being a headless device. Remove these examples from the packagegroups so we can at least build the rest of the ML packages. Note that all of ST's ML examples are GUI-based and will not be usable on the ccmp13, but since the remaining examples don't have an explicit gtk+3 dependency, at least they won't trigger build errors when included in the image. https://onedigi.atlassian.net/browse/DEL-8308 Signed-off-by: Gabriel Valcazar --- .../packagegroups/packagegroup-x-linux-ai.bbappend | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 meta-digi-dey/dynamic-layers/stm32mpu-ai/recipes-st/packagegroups/packagegroup-x-linux-ai.bbappend diff --git a/meta-digi-dey/dynamic-layers/stm32mpu-ai/recipes-st/packagegroups/packagegroup-x-linux-ai.bbappend b/meta-digi-dey/dynamic-layers/stm32mpu-ai/recipes-st/packagegroups/packagegroup-x-linux-ai.bbappend new file mode 100644 index 000000000..14c89c828 --- /dev/null +++ b/meta-digi-dey/dynamic-layers/stm32mpu-ai/recipes-st/packagegroups/packagegroup-x-linux-ai.bbappend @@ -0,0 +1,11 @@ +# Copyright 2023 Digi International Inc. + +RDEPENDS:packagegroup-x-linux-ai-tflite:remove:ccmp13 = " \ + tflite-cv-apps-image-classification-c++ \ + tflite-cv-apps-object-detection-c++ \ +" + +RDEPENDS:packagegroup-x-linux-ai-tflite-edgetpu:remove:ccmp13 = " \ + tflite-cv-apps-edgetpu-image-classification-c++ \ + tflite-cv-apps-edgetpu-object-detection-c++ \ +" From 59365b0ff73a10bc050134246717eba878a81302 Mon Sep 17 00:00:00 2001 From: Isaac Hermida Date: Fri, 5 May 2023 17:03:12 +0200 Subject: [PATCH 065/100] connectcore-demo-server: start service after bluetooth bluetooth daemon is a requisite for the demo app. Signed-off-by: Isaac Hermida --- .../connectcore-demo-example/connectcore-demo-server.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta-digi-dey/recipes-digi/dey-examples/connectcore-demo-example/connectcore-demo-server.service b/meta-digi-dey/recipes-digi/dey-examples/connectcore-demo-example/connectcore-demo-server.service index 9d38970ec..251e9bf1d 100644 --- a/meta-digi-dey/recipes-digi/dey-examples/connectcore-demo-example/connectcore-demo-server.service +++ b/meta-digi-dey/recipes-digi/dey-examples/connectcore-demo-example/connectcore-demo-server.service @@ -1,6 +1,6 @@ [Unit] Description=Initialization of ConnectCore demo server -After=busybox-httpd.service +After=busybox-httpd.service bluetooth.service [Service] Type=forking From 70b0a17b0e293b532608141ef5e4ce758c0aca63 Mon Sep 17 00:00:00 2001 From: Tatiana Leon Date: Thu, 4 May 2023 13:38:01 +0200 Subject: [PATCH 066/100] cloudconnector: new variable to allow custom cloudconnector package definition By default, our 'cloudconnector' package is installed. This can be overriden by defining 'CLOUDCONNECTOR_PKG' in the 'local.conf' with the custom package that includes this application. Signed-off-by: Tatiana Leon --- meta-digi-arm/conf/machine/include/digi-defaults.inc | 3 +++ .../recipes-core/packagegroups/packagegroup-dey-core.bb | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/meta-digi-arm/conf/machine/include/digi-defaults.inc b/meta-digi-arm/conf/machine/include/digi-defaults.inc index 48750f190..6a1a7bbe4 100644 --- a/meta-digi-arm/conf/machine/include/digi-defaults.inc +++ b/meta-digi-arm/conf/machine/include/digi-defaults.inc @@ -89,3 +89,6 @@ BOOT_SCRIPTS += "boot.scr:boot.scr altboot.scr:altboot.scr" # This can be used to enable U-Boot update through swupdate SWUPDATE_UBOOTIMG ?= "false" + +# Cloud Connector package to install +CLOUDCONNECTOR_PKG ?= "cloudconnector" diff --git a/meta-digi-dey/recipes-core/packagegroups/packagegroup-dey-core.bb b/meta-digi-dey/recipes-core/packagegroups/packagegroup-dey-core.bb index 20a1a6e4c..4692b509c 100644 --- a/meta-digi-dey/recipes-core/packagegroups/packagegroup-dey-core.bb +++ b/meta-digi-dey/recipes-core/packagegroups/packagegroup-dey-core.bb @@ -37,7 +37,7 @@ RDEPENDS:${PN} = "\ base-files \ base-passwd \ connectcore-demo-example \ - cloudconnector \ + ${CLOUDCONNECTOR_PKG} \ dualboot \ ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'firmwared', '',d)} \ ${@bb.utils.contains("MACHINE_FEATURES", "keyboard", "${VIRTUAL-RUNTIME_keymaps}", "", d)} \ From 589b41eb0163d2da3fc6bf1a094d7ed44435ba11 Mon Sep 17 00:00:00 2001 From: Tatiana Leon Date: Fri, 5 May 2023 11:23:18 +0200 Subject: [PATCH 067/100] dey-examples: cloudconnector: update copyright Signed-off-by: Tatiana Leon --- .../device_request_listener/Makefile | 25 +++++++++++-------- .../device_request_listener/device_request.c | 6 ++--- .../device_request_listener/device_request.h | 6 ++--- .../device_request_listener/main.c | 7 +++--- .../upload_data_points/Makefile | 25 +++++++++++-------- .../upload_data_points/data_point.c | 8 +++--- .../upload_data_points/data_point.h | 6 ++--- .../upload_data_points/main.c | 7 +++--- .../cloudconnector_test/upload_file/Makefile | 25 +++++++++++-------- .../cloudconnector_test/upload_file/main.c | 7 +++--- 10 files changed, 67 insertions(+), 55 deletions(-) diff --git a/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/device_request_listener/Makefile b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/device_request_listener/Makefile index ac22dafcb..068457973 100644 --- a/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/device_request_listener/Makefile +++ b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/device_request_listener/Makefile @@ -1,18 +1,21 @@ -# -# Copyright (c) 2017, Digi International Inc. +# *************************************************************************** +# Copyright (c) 2017-2023 Digi International Inc. # # This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, you can obtain one at http://mozilla.org/MPL/2.0/. +# License, v. 2.0. If a copy of the MPL was not distributed with this file, +# You can obtain one at http://mozilla.org/MPL/2.0/. # -# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +# AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +# OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +# PERFORMANCE OF THIS SOFTWARE. # +# Digi International Inc., 9350 Excelsior Blvd., Suite 700, Hopkins, MN 55343 +# +# *************************************************************************** PROGRAM := device_request_listener diff --git a/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/device_request_listener/device_request.c b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/device_request_listener/device_request.c index cf74e209e..e243da27b 100644 --- a/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/device_request_listener/device_request.c +++ b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/device_request_listener/device_request.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Digi International Inc. + * Copyright (c) 2017-2023 Digi International Inc. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file, @@ -13,8 +13,8 @@ * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. * - * Digi International Inc. 11001 Bren Road East, Minnetonka, MN 55343 - * ======================================================================= + * Digi International Inc., 9350 Excelsior Blvd., Suite 700, Hopkins, MN 55343 + * =========================================================================== */ #include diff --git a/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/device_request_listener/device_request.h b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/device_request_listener/device_request.h index 26951204f..e5701cfd5 100644 --- a/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/device_request_listener/device_request.h +++ b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/device_request_listener/device_request.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Digi International Inc. + * Copyright (c) 2017-2023 Digi International Inc. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file, @@ -13,8 +13,8 @@ * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. * - * Digi International Inc. 11001 Bren Road East, Minnetonka, MN 55343 - * ======================================================================= + * Digi International Inc., 9350 Excelsior Blvd., Suite 700, Hopkins, MN 55343 + * =========================================================================== */ #ifndef DEVICE_REQUEST_H_ diff --git a/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/device_request_listener/main.c b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/device_request_listener/main.c index de584b094..07fc023a8 100644 --- a/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/device_request_listener/main.c +++ b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/device_request_listener/main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Digi International Inc. + * Copyright (c) 2017-2023 Digi International Inc. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file, @@ -13,9 +13,10 @@ * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. * - * Digi International Inc. 11001 Bren Road East, Minnetonka, MN 55343 - * ======================================================================= + * Digi International Inc., 9350 Excelsior Blvd., Suite 700, Hopkins, MN 55343 + * =========================================================================== */ + #include #include #include diff --git a/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_data_points/Makefile b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_data_points/Makefile index f30697238..80b011a0e 100644 --- a/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_data_points/Makefile +++ b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_data_points/Makefile @@ -1,18 +1,21 @@ -# -# Copyright (c) 2017, Digi International Inc. +# *************************************************************************** +# Copyright (c) 2017-2023 Digi International Inc. # # This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, you can obtain one at http://mozilla.org/MPL/2.0/. +# License, v. 2.0. If a copy of the MPL was not distributed with this file, +# You can obtain one at http://mozilla.org/MPL/2.0/. # -# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +# AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +# OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +# PERFORMANCE OF THIS SOFTWARE. # +# Digi International Inc., 9350 Excelsior Blvd., Suite 700, Hopkins, MN 55343 +# +# *************************************************************************** PROGRAM := upload_data_points diff --git a/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_data_points/data_point.c b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_data_points/data_point.c index b5f9428c9..d73d44a3c 100644 --- a/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_data_points/data_point.c +++ b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_data_points/data_point.c @@ -1,5 +1,5 @@ - /* - * Copyright (c) 2017 Digi International Inc. +/* + * Copyright (c) 2017-2023 Digi International Inc. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file, @@ -13,8 +13,8 @@ * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. * - * Digi International Inc. 11001 Bren Road East, Minnetonka, MN 55343 - * ======================================================================= + * Digi International Inc., 9350 Excelsior Blvd., Suite 700, Hopkins, MN 55343 + * =========================================================================== */ #include diff --git a/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_data_points/data_point.h b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_data_points/data_point.h index 5b66bb181..8be777c93 100644 --- a/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_data_points/data_point.h +++ b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_data_points/data_point.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Digi International Inc. + * Copyright (c) 2017-2023 Digi International Inc. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file, @@ -13,8 +13,8 @@ * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. * - * Digi International Inc. 11001 Bren Road East, Minnetonka, MN 55343 - * ======================================================================= + * Digi International Inc., 9350 Excelsior Blvd., Suite 700, Hopkins, MN 55343 + * =========================================================================== */ #ifndef DATA_POINT_H_ diff --git a/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_data_points/main.c b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_data_points/main.c index 857b07b49..6aeb4d2a6 100644 --- a/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_data_points/main.c +++ b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_data_points/main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Digi International Inc. + * Copyright (c) 2017-2023 Digi International Inc. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file, @@ -13,9 +13,10 @@ * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. * - * Digi International Inc. 11001 Bren Road East, Minnetonka, MN 55343 - * ======================================================================= + * Digi International Inc., 9350 Excelsior Blvd., Suite 700, Hopkins, MN 55343 + * =========================================================================== */ + #include #include #include diff --git a/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_file/Makefile b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_file/Makefile index eed50f3e1..ff67e421a 100644 --- a/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_file/Makefile +++ b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_file/Makefile @@ -1,18 +1,21 @@ -# -# Copyright (c) 2017, Digi International Inc. +# *************************************************************************** +# Copyright (c) 2017-2023 Digi International Inc. # # This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, you can obtain one at http://mozilla.org/MPL/2.0/. +# License, v. 2.0. If a copy of the MPL was not distributed with this file, +# You can obtain one at http://mozilla.org/MPL/2.0/. # -# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +# AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +# OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +# PERFORMANCE OF THIS SOFTWARE. # +# Digi International Inc., 9350 Excelsior Blvd., Suite 700, Hopkins, MN 55343 +# +# *************************************************************************** PROGRAM := upload_file diff --git a/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_file/main.c b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_file/main.c index 0f49d2c02..2349d9ccd 100644 --- a/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_file/main.c +++ b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_file/main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Digi International Inc. + * Copyright (c) 2017-2023 Digi International Inc. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file, @@ -13,9 +13,10 @@ * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. * - * Digi International Inc. 11001 Bren Road East, Minnetonka, MN 55343 - * ======================================================================= + * Digi International Inc., 9350 Excelsior Blvd., Suite 700, Hopkins, MN 55343 + * =========================================================================== */ + #include #include #include From 5f466b2af11eca4a25742b2576584135e96e13b8 Mon Sep 17 00:00:00 2001 From: Tatiana Leon Date: Fri, 5 May 2023 11:31:26 +0200 Subject: [PATCH 068/100] dey-examples: cloudconnector: fix some minor issues * Remove 'MAX_RESPONSE_SIZE' define and allocate required memory in 'device_request_listener' example. * Create 'free_timestamp()' function in 'upload_data_points' example. * Use some sorter variable names. * Use '__func__' to log function names. * Remove line feed from log messages. * Remove not required curly braces for single line loops. Signed-off-by: Tatiana Leon --- .../device_request_listener/device_request.c | 53 +++++++++-------- .../device_request_listener/device_request.h | 6 +- .../device_request_listener/main.c | 9 +-- .../upload_data_points/data_point.c | 59 +++++++++++-------- .../upload_data_points/main.c | 16 ++--- .../cloudconnector_test/upload_file/main.c | 9 +-- 6 files changed, 81 insertions(+), 71 deletions(-) diff --git a/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/device_request_listener/device_request.c b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/device_request_listener/device_request.c index e243da27b..7bfdaad5e 100644 --- a/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/device_request_listener/device_request.c +++ b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/device_request_listener/device_request.c @@ -24,8 +24,6 @@ #include "device_request.h" -#define MAX_RESPONSE_SIZE 256 - #if !(defined UNUSED_ARGUMENT) #define UNUSED_ARGUMENT(a) (void)(a) #endif @@ -33,40 +31,44 @@ /* * get_time_cb() - Data callback for 'get_time' device requests * - * @target: Target ID of the device request (get_time). - * @transport: Communication transport used by the device request. - * @request_buffer_info: Buffer containing the device request. - * @response_buffer_info: Buffer to store the answer of the request. + * @target: Target ID of the device request (get_time). + * @transport: Communication transport used by the device request. + * @req_buf_info: Buffer containing the device request. + * @resp_buf_info: Buffer to store the answer of the request. * * Logs information about the received request and executes the corresponding * command. */ void get_time_cb(char const *const target, ccapi_transport_t const transport, - ccapi_buffer_info_t const *const request_buffer_info, - ccapi_buffer_info_t *const response_buffer_info) + ccapi_buffer_info_t const *const req_buf_info, + ccapi_buffer_info_t *const resp_buf_info) { - UNUSED_ARGUMENT(request_buffer_info); - log_debug("get_time_cb(): target='%s' - transport='%d'", target, transport); + time_t t = time(NULL); + char *time_str = ctime(&t); - response_buffer_info->buffer = malloc(sizeof(char) * MAX_RESPONSE_SIZE + 1); - if (response_buffer_info->buffer == NULL) { - log_error("%s\n", "get_time_cb(): response_buffer_info malloc error"); + UNUSED_ARGUMENT(req_buf_info); + log_debug("%s: target='%s' - transport='%d'", __func__, target, transport); + + resp_buf_info->length = snprintf(NULL, 0, "Time: %s", time_str); + resp_buf_info->buffer = calloc(resp_buf_info->length + 1, sizeof(char)); + if (resp_buf_info->buffer == NULL) { + log_error("%s: resp_buf_info calloc error", __func__); return; } - time_t t = time(NULL); - response_buffer_info->length = snprintf(response_buffer_info->buffer, - MAX_RESPONSE_SIZE, "Time: %s", ctime(&t)); + resp_buf_info->length = sprintf(resp_buf_info->buffer, "Time: %s", time_str); + + return; } /* * get_time_status_cb() - Status callback for 'get_time' device requests * - * @target: Target ID of the device request (get_time) - * @transport: Communication transport used by the device request. - * @response_buffer_info: Buffer containing the response data. - * @receive_error: The error status of the receive process. + * @target: Target ID of the device request (get_time) + * @transport: Communication transport used by the device request. + * @resp_buf_info: Buffer containing the response data. + * @receive_error: The error status of the receive process. * * This callback is executed when the response process has finished. It doesn't * matter if everything worked or there was an error during the process. @@ -75,14 +77,13 @@ void get_time_cb(char const *const target, */ void get_time_status_cb(char const *const target, ccapi_transport_t const transport, - ccapi_buffer_info_t *const response_buffer_info, + ccapi_buffer_info_t *const resp_buf_info, ccapi_receive_error_t receive_error) { - log_debug( - "get_time_status_cb(): target='%s' - transport='%d' - error='%d'", - target, transport, receive_error); + log_debug("%s: target='%s' - transport='%d' - error='%d'", + __func__, target, transport, receive_error); /* Free the response buffer */ - if (response_buffer_info != NULL) - free(response_buffer_info->buffer); + if (resp_buf_info != NULL) + free(resp_buf_info->buffer); } diff --git a/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/device_request_listener/device_request.h b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/device_request_listener/device_request.h index e5701cfd5..6b341673d 100644 --- a/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/device_request_listener/device_request.h +++ b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/device_request_listener/device_request.h @@ -25,11 +25,11 @@ #define TARGET_GET_TIME "get_time" void get_time_cb(char const *const target, ccapi_transport_t const transport, - ccapi_buffer_info_t const *const request_buffer_info, - ccapi_buffer_info_t *const response_buffer_info); + ccapi_buffer_info_t const *const req_buf_info, + ccapi_buffer_info_t *const resp_buf_info); void get_time_status_cb(char const *const target, ccapi_transport_t const transport, - ccapi_buffer_info_t *const response_buffer_info, + ccapi_buffer_info_t *const resp_buf_info, ccapi_receive_error_t receive_error); #endif /* DEVICE_REQUEST_H_ */ diff --git a/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/device_request_listener/main.c b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/device_request_listener/main.c index 07fc023a8..afc7c3f08 100644 --- a/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/device_request_listener/main.c +++ b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/device_request_listener/main.c @@ -27,7 +27,8 @@ static void sigint_handler(int signum) { - log_debug("sigint_handler(): received signal %d to close Cloud connection.\n", signum); + log_debug("%s: received signal %d to close Cloud connection.", + __func__, signum); exit(0); } @@ -81,20 +82,20 @@ int main(void) init_error = init_cloud_connection(NULL); if (init_error != CC_INIT_ERROR_NONE) { - log_error("Cannot initialize cloud connection, error %d\n", init_error); + log_error("Cannot initialize cloud connection, error %d", init_error); return EXIT_FAILURE; } start_error = start_cloud_connection(); if (start_error != CC_START_ERROR_NONE) { - log_error("Cannot start cloud connection, error %d\n", start_error); + log_error("Cannot start cloud connection, error %d", start_error); return EXIT_FAILURE; } receive_error = ccapi_receive_add_target(TARGET_GET_TIME, get_time_cb, get_time_status_cb, 0); if (receive_error != CCAPI_RECEIVE_ERROR_NONE) { - log_error("Cannot register target '%s', error %d\n", TARGET_GET_TIME, + log_error("Cannot register target '%s', error %d", TARGET_GET_TIME, receive_error); return EXIT_FAILURE; } diff --git a/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_data_points/data_point.c b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_data_points/data_point.c index d73d44a3c..b469fe26b 100644 --- a/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_data_points/data_point.c +++ b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_data_points/data_point.c @@ -37,7 +37,7 @@ static int get_incremental(void) else incremental++; - log_debug("Incremental = %d\n", incremental); + log_debug("Incremental = %d", incremental); return incremental; } @@ -75,14 +75,31 @@ static ccapi_timestamp_t *get_timestamp(void) return timestamp; } +/* + * free_timestamp() - Free given timestamp structure + * + * @timestamp: The timestamp structure to release. + */ +static void free_timestamp(ccapi_timestamp_t *timestamp) +{ + if (timestamp == NULL) + return; + + if (timestamp->iso8601 != NULL) { + free((char *) timestamp->iso8601); + timestamp->iso8601 = NULL; + } + free(timestamp); + timestamp = NULL; +} + ccapi_dp_error_t init_data_stream(ccapi_dp_collection_handle_t *dp_collection) { ccapi_dp_collection_handle_t collection; - ccapi_dp_error_t dp_error; + ccapi_dp_error_t dp_error = ccapi_dp_create_collection(&collection); - dp_error = ccapi_dp_create_collection(&collection); if (dp_error != CCAPI_DP_ERROR_NONE) { - log_error("ccapi_dp_create_collection() error %d\n", dp_error); + log_error("%s: error %d", __func__, dp_error); return dp_error; } else { *dp_collection = collection; @@ -91,9 +108,9 @@ ccapi_dp_error_t init_data_stream(ccapi_dp_collection_handle_t *dp_collection) dp_error = ccapi_dp_add_data_stream_to_collection_extra(collection, STREAM_NAME, "int32 ts_iso", "counts", NULL); if (dp_error != CCAPI_DP_ERROR_NONE) { - log_error("ccapi_dp_add_data_stream_to_collection_extra() error %d\n", - dp_error); - free(collection); + log_error("%s: error %d", __func__, dp_error); + ccapi_dp_destroy_collection(collection); + *dp_collection = NULL; } return dp_error; @@ -101,23 +118,14 @@ ccapi_dp_error_t init_data_stream(ccapi_dp_collection_handle_t *dp_collection) ccapi_dp_error_t add_data_point(ccapi_dp_collection_handle_t dp_collection) { - ccapi_dp_error_t dp_error; - ccapi_timestamp_t *timestamp = get_timestamp(); + ccapi_dp_error_t dp_error = ccapi_dp_add(dp_collection, STREAM_NAME, + get_incremental(), timestamp); - dp_error = ccapi_dp_add(dp_collection, STREAM_NAME, get_incremental(), timestamp); - if (dp_error != CCAPI_DP_ERROR_NONE) { - log_error("ccapi_dp_add() failed with error: %d\n", dp_error); - } + if (dp_error != CCAPI_DP_ERROR_NONE) + log_error("%s: failed with error: %d", __func__, dp_error); - if (timestamp != NULL) { - if (timestamp->iso8601 != NULL) { - free((char *) timestamp->iso8601); - timestamp->iso8601 = NULL; - } - free(timestamp); - timestamp = NULL; - } + free_timestamp(timestamp); return dp_error; } @@ -126,18 +134,17 @@ ccapi_dp_error_t send_data_stream(ccapi_dp_collection_handle_t dp_collection) { ccapi_dp_error_t dp_error; - log_debug("%s", "Sending Data Stream with new incremental value\n"); + log_debug("%s", "Sending Data Stream with new incremental value"); dp_error = ccapi_dp_send_collection(CCAPI_TRANSPORT_TCP, dp_collection); - if (dp_error != CCAPI_DP_ERROR_NONE) { - log_error("ccapi_dp_send_collection() error %d\n", dp_error); - } + if (dp_error != CCAPI_DP_ERROR_NONE) + log_error("%s: error %d", __func__, dp_error); return dp_error; } ccapi_dp_error_t destroy_data_stream(ccapi_dp_collection_handle_t dp_collection) { - log_debug("%s", "Destroying Data Stream\n"); + log_debug("%s", "Destroying Data Stream"); return ccapi_dp_destroy_collection(dp_collection); } diff --git a/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_data_points/main.c b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_data_points/main.c index 6aeb4d2a6..76ab83de3 100644 --- a/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_data_points/main.c +++ b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_data_points/main.c @@ -32,16 +32,16 @@ static ccapi_dp_collection_handle_t dp_collection; static void sigint_handler(int signum) { - log_debug("sigint_handler(): received signal %d to close Cloud connection.\n", signum); + log_debug("%s: received signal %d to close Cloud connection.", + __func__, signum); exit(0); } static void graceful_shutdown(void) { - if (running == 1) { + if (running == 1) destroy_data_stream(dp_collection); - } running = 0; stop_cloud_connection(); @@ -76,19 +76,19 @@ int main(void) init_error = init_cloud_connection(NULL); if (init_error != CC_INIT_ERROR_NONE) { - log_error("Cannot initialize cloud connection, error %d\n", init_error); + log_error("Cannot initialize cloud connection, error %d", init_error); return EXIT_FAILURE; } start_error = start_cloud_connection(); if (start_error != CC_START_ERROR_NONE) { - log_error("Cannot start cloud connection, error %d\n", start_error); + log_error("Cannot start cloud connection, error %d", start_error); return EXIT_FAILURE; } dp_error = init_data_stream(&dp_collection); if (dp_error != CCAPI_DP_ERROR_NONE) { - log_error("Cannot initialize data stream, error %d\n", start_error); + log_error("Cannot initialize data stream, error %d", start_error); return EXIT_FAILURE; } @@ -100,7 +100,7 @@ int main(void) dp_error = add_data_point(dp_collection); if (dp_error != CCAPI_DP_ERROR_NONE) { - log_error("Cannot add data point, error %d\n", start_error); + log_error("Cannot add data point, error %d", start_error); i--; } @@ -110,7 +110,7 @@ int main(void) /* Send the block of collected data points */ dp_error = send_data_stream(dp_collection); if (dp_error != CCAPI_DP_ERROR_NONE) - log_error("Cannot send data stream, error %d\n", start_error); + log_error("Cannot send data stream, error %d", start_error); } return EXIT_SUCCESS; diff --git a/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_file/main.c b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_file/main.c index 2349d9ccd..10dc8afab 100644 --- a/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_file/main.c +++ b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_file/main.c @@ -29,7 +29,8 @@ static void sigint_handler(int signum) { - log_debug("sigint_handler(): received signal %d to close Cloud connection.\n", signum); + log_debug("%s: received signal %d to close Cloud connection.", + __func__, signum); exit(0); } @@ -68,19 +69,19 @@ int main(int argc, char *argv[]) init_error = init_cloud_connection(NULL); if (init_error != CC_INIT_ERROR_NONE) { - log_error("Cannot initialize cloud connection, error %d\n", init_error); + log_error("Cannot initialize cloud connection, error %d", init_error); return EXIT_FAILURE; } start_error = start_cloud_connection(); if (start_error != CC_START_ERROR_NONE) { - log_error("Cannot start cloud connection, error %d\n", start_error); + log_error("Cannot start cloud connection, error %d", start_error); return EXIT_FAILURE; } send_error = ccapi_dp_binary_send_file(CCAPI_TRANSPORT_TCP, UPLOAD_FILE, STREAM_NAME); if (send_error != CCAPI_DP_B_ERROR_NONE) { - log_error("ccapi_dp_binary_send_file() failed, error %d\n", send_error); + log_error("%s failed, error %d", __func__, send_error); return EXIT_FAILURE; } From bd684cec15e145ce8f8a603bd1155152d7c625a9 Mon Sep 17 00:00:00 2001 From: Tatiana Leon Date: Fri, 5 May 2023 11:37:16 +0200 Subject: [PATCH 069/100] dey-examples: cloudconnector: remove not need 'wait_for_ccimp_threads()' Connector creates detached threads and calling to 'wait_for_ccimp_threads()' is not required. See commit d34ddfb719932ae59774b388579b7d6a77472c4f in 'cc_dey' repository. Signed-off-by: Tatiana Leon --- .../files/cloudconnector_test/device_request_listener/main.c | 1 - .../files/cloudconnector_test/upload_data_points/main.c | 1 - .../dey-examples/files/cloudconnector_test/upload_file/main.c | 1 - 3 files changed, 3 deletions(-) diff --git a/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/device_request_listener/main.c b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/device_request_listener/main.c index afc7c3f08..4e29aca32 100644 --- a/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/device_request_listener/main.c +++ b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/device_request_listener/main.c @@ -36,7 +36,6 @@ static void sigint_handler(int signum) static void graceful_shutdown(void) { stop_cloud_connection(); - wait_for_ccimp_threads(); } static void add_sigkill_signal(void) diff --git a/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_data_points/main.c b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_data_points/main.c index 76ab83de3..9cf6ddce0 100644 --- a/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_data_points/main.c +++ b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_data_points/main.c @@ -45,7 +45,6 @@ static void graceful_shutdown(void) running = 0; stop_cloud_connection(); - wait_for_ccimp_threads(); } static void add_sigkill_signal(void) diff --git a/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_file/main.c b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_file/main.c index 10dc8afab..69f9ad552 100644 --- a/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_file/main.c +++ b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_file/main.c @@ -38,7 +38,6 @@ static void sigint_handler(int signum) static void graceful_shutdown(void) { stop_cloud_connection(); - wait_for_ccimp_threads(); } static void add_sigkill_signal(void) From c533e12a4d3afbac61e6d9bff1fc640264fd879e Mon Sep 17 00:00:00 2001 From: Tatiana Leon Date: Fri, 5 May 2023 11:41:13 +0200 Subject: [PATCH 070/100] dey-examples: cloudconnector:return status code in device request data callbacks This commit syncs the device request code to match with the latest 'cc_api' layer implementation. See commit 99a2ff39b771f0e36af8d15d40f970462352e0b6 in 'cc_api' repository and commit d8c848fc2f516a6c2197181f7540c9c23feaf44f in 'cc_dey' repository. Signed-off-by: Tatiana Leon --- .../device_request_listener/device_request.c | 12 ++++++------ .../device_request_listener/device_request.h | 7 ++++--- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/device_request_listener/device_request.c b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/device_request_listener/device_request.c index 7bfdaad5e..992a73f30 100644 --- a/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/device_request_listener/device_request.c +++ b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/device_request_listener/device_request.c @@ -39,10 +39,10 @@ * Logs information about the received request and executes the corresponding * command. */ -void get_time_cb(char const *const target, - ccapi_transport_t const transport, - ccapi_buffer_info_t const *const req_buf_info, - ccapi_buffer_info_t *const resp_buf_info) +ccapi_receive_error_t get_time_cb(char const *const target, + ccapi_transport_t const transport, + ccapi_buffer_info_t const *const req_buf_info, + ccapi_buffer_info_t *const resp_buf_info) { time_t t = time(NULL); char *time_str = ctime(&t); @@ -54,12 +54,12 @@ void get_time_cb(char const *const target, resp_buf_info->buffer = calloc(resp_buf_info->length + 1, sizeof(char)); if (resp_buf_info->buffer == NULL) { log_error("%s: resp_buf_info calloc error", __func__); - return; + return CCAPI_RECEIVE_ERROR_INSUFFICIENT_MEMORY; } resp_buf_info->length = sprintf(resp_buf_info->buffer, "Time: %s", time_str); - return; + return CCAPI_RECEIVE_ERROR_NONE; } /* diff --git a/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/device_request_listener/device_request.h b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/device_request_listener/device_request.h index 6b341673d..bdd9530c3 100644 --- a/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/device_request_listener/device_request.h +++ b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/device_request_listener/device_request.h @@ -24,9 +24,10 @@ #define TARGET_GET_TIME "get_time" -void get_time_cb(char const *const target, ccapi_transport_t const transport, - ccapi_buffer_info_t const *const req_buf_info, - ccapi_buffer_info_t *const resp_buf_info); +ccapi_receive_error_t get_time_cb(char const *const target, + ccapi_transport_t const transport, + ccapi_buffer_info_t const *const req_buf_info, + ccapi_buffer_info_t *const resp_buf_info); void get_time_status_cb(char const *const target, ccapi_transport_t const transport, ccapi_buffer_info_t *const resp_buf_info, From 8979331ef8a2a47e2368d33ae58c36f73f937d33 Mon Sep 17 00:00:00 2001 From: Gabriel Valcazar Date: Tue, 9 May 2023 15:44:37 +0200 Subject: [PATCH 071/100] packagegroup-qt6-dey: remove qtquick3d-dev This package was inadvertantly pulling in a lot of dependencies into our images that make use of Qt6. Most of these packages consisted of *-dev packages, which are only useful for development with the SDK. Remove this package along with its dependencies to significantly reduce the dey-image-qt rootfs image size. Signed-off-by: Gabriel Valcazar --- .../NXP/recipes-fsl/packagegroup/packagegroup-qt6-dey.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta-digi-dey/dynamic-layers/qt6-layer/NXP/recipes-fsl/packagegroup/packagegroup-qt6-dey.bb b/meta-digi-dey/dynamic-layers/qt6-layer/NXP/recipes-fsl/packagegroup/packagegroup-qt6-dey.bb index 9f98544a4..d839fab74 100644 --- a/meta-digi-dey/dynamic-layers/qt6-layer/NXP/recipes-fsl/packagegroup/packagegroup-qt6-dey.bb +++ b/meta-digi-dey/dynamic-layers/qt6-layer/NXP/recipes-fsl/packagegroup/packagegroup-qt6-dey.bb @@ -16,7 +16,7 @@ QT6_IMAGE_INSTALL_APPS = "" QT6_FONTS = "ttf-dejavu-common ttf-dejavu-sans ttf-dejavu-sans-mono ttf-dejavu-serif " # Install qtquick3d -QT6_QTQUICK3D = "qtquick3d qtquick3d-dev qtquick3d-examples" +QT6_QTQUICK3D = "qtquick3d qtquick3d-examples" QT6_IMAGE_INSTALL = "" QT6_IMAGE_INSTALL_common = " \ From c4a328dfd3b942e75371ccd42f2a193e0b543105 Mon Sep 17 00:00:00 2001 From: Arturo Buzarra Date: Mon, 8 May 2023 13:41:56 +0200 Subject: [PATCH 072/100] init-ifupdown: remove references to QCA wireless chipsets Signed-off-by: Arturo Buzarra --- .../init-ifupdown/init-ifupdown-1.0/interfaces.br0.example | 2 +- .../init-ifupdown/init-ifupdown-1.0/interfaces.wlan1.dhcp | 2 +- .../init-ifupdown/init-ifupdown-1.0/interfaces.wlan1.static | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces.br0.example b/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces.br0.example index 1a0ffdf42..b04f821dc 100644 --- a/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces.br0.example +++ b/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces.br0.example @@ -1,5 +1,5 @@ -## Example bridge between eth0 and wlan1 (Qualcomm QCA65x4) +## Example bridge between eth0 and wlan1 #auto br0 #iface br0 inet static # bridge_ports eth0 wlan1 diff --git a/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces.wlan1.dhcp b/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces.wlan1.dhcp index cc42c3377..1e62cc561 100644 --- a/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces.wlan1.dhcp +++ b/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces.wlan1.dhcp @@ -1,5 +1,5 @@ -# Wi-Fi AP interface (Qualcomm QCA65x4) +# Wi-Fi AP interface #auto wlan1 iface wlan1 inet dhcp udhcpc_opts -S -b >/dev/null & diff --git a/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces.wlan1.static b/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces.wlan1.static index 35f5b29c6..cbdf15510 100644 --- a/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces.wlan1.static +++ b/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces.wlan1.static @@ -1,5 +1,5 @@ -# Wi-Fi AP interface (Qualcomm QCA65x4) +# Wi-Fi AP interface #auto wlan1 iface wlan1 inet static address ##WLAN1_STATIC_IP## From 9a713e56c8633dc44e4c558e3d45564f91528655 Mon Sep 17 00:00:00 2001 From: Arturo Buzarra Date: Mon, 8 May 2023 13:43:39 +0200 Subject: [PATCH 073/100] init-ifupdown: virtwlans: generalize function to check virtual wireless MACs Also this commit removes the virtual wireless MACs verification on ccmp1 platforms Signed-off-by: Arturo Buzarra --- .../init-ifupdown/init-ifupdown-1.0/virtwlans | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/virtwlans b/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/virtwlans index c508c50c8..622d105f8 100644 --- a/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/virtwlans +++ b/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/virtwlans @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (c) 2017-2019, Digi International Inc. +# Copyright (c) 2017-2023, Digi International Inc. # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this @@ -17,7 +17,7 @@ [ "$IFACE" = "wlan1" ] || exit 0 -if [ "$MODE" = "start" ]; then +check_virtual_wlan_macs() { # Check for default MAC addresses if [ -s "/proc/device-tree/wireless/mac-address1" ] && [ -s "/proc/device-tree/wireless/mac-address2" ] && @@ -26,6 +26,13 @@ if [ "$MODE" = "start" ]; then else echo "[WARN] Using default MAC addresses for virtual interfaces, please program them referring to the Digi U-Boot Documentation" fi +} + +if [ "$MODE" = "start" ]; then + # On ccmp1, there are not virtual wireless MACs, so skip the verification. + if ! grep -qs '\' /proc/device-tree/compatible; then + check_virtual_wlan_macs + fi if [ ! -d "/sys/class/net/wlan1" ]; then # This will create a second wireless network device From 30ce41ad5b622cc2e2da3873f8b75ea779638b11 Mon Sep 17 00:00:00 2001 From: Arturo Buzarra Date: Mon, 8 May 2023 13:57:47 +0200 Subject: [PATCH 074/100] meta-digi: fix binary names in Google Coral recipes Commit 065cf3e9 ("kirkstone migration: general update to the new override syntax") incorrectly renamed binaries in a massive change. This commit restores the binary names to the original. https://onedigi.atlassian.net/browse/DEL-8478 Signed-off-by: Arturo Buzarra --- .../recipes-bsp/tensorflow-lite/tensorflow-lite-coral_2.5.0.bb | 2 +- .../recipes-devtools/python3-pycoral/python3-pycoral_1.0.1.bb | 2 +- .../recipes-devtools/python3-scipy/python3-scipy_1.7.0.bb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/meta-digi-arm/recipes-bsp/tensorflow-lite/tensorflow-lite-coral_2.5.0.bb b/meta-digi-arm/recipes-bsp/tensorflow-lite/tensorflow-lite-coral_2.5.0.bb index a5ac81dfc..0b3cfcc80 100644 --- a/meta-digi-arm/recipes-bsp/tensorflow-lite/tensorflow-lite-coral_2.5.0.bb +++ b/meta-digi-arm/recipes-bsp/tensorflow-lite/tensorflow-lite-coral_2.5.0.bb @@ -5,7 +5,7 @@ HOMEPAGE = "https://www.tensorflow.org/lite/" LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://${S}/tflite_runtime-2.5.0.dist-info/METADATA;md5=8c4b9e107a64b0121980a8705094014b" -PYTHON_PACKAGE = "tflite_runtime-2.5.0-cp38-cp38-linux:aarch64.whl" +PYTHON_PACKAGE = "tflite_runtime-2.5.0-cp38-cp38-linux_aarch64.whl" SRC_URI = "https://github.com/google-coral/pycoral/releases/download/v1.0.1/${PYTHON_PACKAGE};downloadfilename=${PYTHON_PACKAGE};subdir=${BP}" SRC_URI[md5sum] = "9c47617e1fa0bdca673a78b8b6688d64" diff --git a/meta-digi-dey/dynamic-layers/freescale-layer/recipes-devtools/python3-pycoral/python3-pycoral_1.0.1.bb b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-devtools/python3-pycoral/python3-pycoral_1.0.1.bb index fd3ea2cd3..8f540fad3 100644 --- a/meta-digi-dey/dynamic-layers/freescale-layer/recipes-devtools/python3-pycoral/python3-pycoral_1.0.1.bb +++ b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-devtools/python3-pycoral/python3-pycoral_1.0.1.bb @@ -5,7 +5,7 @@ HOMEPAGE = "https://coral.ai/software/#pycoral-api" LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://${S}/pycoral-1.0.1.dist-info/LICENSE;md5=d8927f3331d2b3e321b7dd1925166d25" -PYTHON_PACKAGE = "pycoral-1.0.1-cp38-cp38-linux:aarch64.whl" +PYTHON_PACKAGE = "pycoral-1.0.1-cp38-cp38-linux_aarch64.whl" SRC_URI = "git://github.com/google-coral/pycoral.git;protocol=https;branch=master" SRCREV = "d4b9f572fa3baef9d854483a171e02a6b3f9dbd0" diff --git a/meta-digi-dey/recipes-devtools/python3-scipy/python3-scipy_1.7.0.bb b/meta-digi-dey/recipes-devtools/python3-scipy/python3-scipy_1.7.0.bb index 7253ab6ff..baa69a763 100644 --- a/meta-digi-dey/recipes-devtools/python3-scipy/python3-scipy_1.7.0.bb +++ b/meta-digi-dey/recipes-devtools/python3-scipy/python3-scipy_1.7.0.bb @@ -4,7 +4,7 @@ HOMEPAGE = "https://www.scipy.org" LICENSE = "BSD-3-Clause" LIC_FILES_CHKSUM = "file://${S}/scipy-1.7.0.dist-info/LICENSE.txt;md5=caecddab96f03de0092b62333ea77f91" -PYTHON_PACKAGE = "scipy-1.7.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014:aarch64.whl" +PYTHON_PACKAGE = "scipy-1.7.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl" SRC_URI = "https://files.pythonhosted.org/packages/d0/8d/3dbb59d78218b6a76f1ddb55db60ea5459fa7968655acb21252a59a10bc3/${PYTHON_PACKAGE};subdir=${BP}" SRC_URI[md5sum] = "e2e369078c6b7ca29c952cb9971bc154" From 9da24ef9e414d0accf0e80f0fa8fa6f2af3c0262 Mon Sep 17 00:00:00 2001 From: Gabriel Valcazar Date: Tue, 9 May 2023 18:32:46 +0200 Subject: [PATCH 075/100] arm-compute-library: remove MAXLINELENGTH variable to avoid build errors Commit d2c1494bbf36b6392e47ffd4a75307d29681d190 in poky adds this variable to EXTRA_OESCONS, which breaks the do_compile() task of this recipe. Remove the variable to be able to build the package. Signed-off-by: Gabriel Valcazar --- meta-digi-dey/conf/layer.conf | 2 ++ .../arm-compute-library/arm-compute-library_22.05.bbappend | 5 +++++ 2 files changed, 7 insertions(+) create mode 100644 meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/arm-compute-library/arm-compute-library_22.05.bbappend diff --git a/meta-digi-dey/conf/layer.conf b/meta-digi-dey/conf/layer.conf index be7d3638e..3d9296e6a 100644 --- a/meta-digi-dey/conf/layer.conf +++ b/meta-digi-dey/conf/layer.conf @@ -12,6 +12,8 @@ BBFILES_DYNAMIC += " \ selinux:${LAYERDIR}/dynamic-layers/selinux/*/*/*.bbappend \ freescale-layer:${LAYERDIR}/dynamic-layers/freescale-layer/*/*/*.bb \ freescale-layer:${LAYERDIR}/dynamic-layers/freescale-layer/*/*/*.bbappend \ + meta-ml:${LAYERDIR}/dynamic-layers/meta-ml/*/*/*.bb \ + meta-ml:${LAYERDIR}/dynamic-layers/meta-ml/*/*/*.bbappend \ stm-st-stm32mp:${LAYERDIR}/dynamic-layers/stm-st-stm32mp/*/*/*.bb \ stm-st-stm32mp:${LAYERDIR}/dynamic-layers/stm-st-stm32mp/*/*/*.bbappend \ stm32mpu-ai:${LAYERDIR}/dynamic-layers/stm32mpu-ai/*/*/*.bb \ diff --git a/meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/arm-compute-library/arm-compute-library_22.05.bbappend b/meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/arm-compute-library/arm-compute-library_22.05.bbappend new file mode 100644 index 000000000..c7e0fe2b6 --- /dev/null +++ b/meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/arm-compute-library/arm-compute-library_22.05.bbappend @@ -0,0 +1,5 @@ +# Copyright 2023 Digi International Inc. + +# The package's SConscript doesn't recognize the MAXLINELENGTH variable +# injected by scons.bbclass, so remove it +EXTRA_OESCONS:remove = "${SCONS_MAXLINELENGTH}" From 56f323044c15971913aebf36bb3212d75445cd00 Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Thu, 13 Apr 2023 09:08:35 +0200 Subject: [PATCH 076/100] global: rename DEY_BUILD_PLATFORM to DEY_SOC_VENDOR The name of the variable was not very intuitive of what it contains. This variable expands to the SoC vendor (NXP or STM). Signed-off-by: Hector Palacios --- meta-digi-arm/conf/layer.conf | 4 ++-- meta-digi-arm/conf/machine/include/ccmp1.inc | 2 +- meta-digi-arm/conf/machine/include/imx-digi-base.inc | 2 +- meta-digi-arm/recipes-bsp/u-boot/u-boot-dey.inc | 4 ++-- .../packagegroup/nativesdk-packagegroup-sdk-host.bbappend | 2 +- meta-digi-arm/recipes-kernel/linux/linux-dey_5.15.bb | 8 ++++---- meta-digi-dey/conf/layer.conf | 8 ++++---- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/meta-digi-arm/conf/layer.conf b/meta-digi-arm/conf/layer.conf index d34c478ae..8868577f6 100644 --- a/meta-digi-arm/conf/layer.conf +++ b/meta-digi-arm/conf/layer.conf @@ -19,8 +19,8 @@ BBFILES_DYNAMIC += " \ " LAYERDEPENDS_digi-arm = "core" -LAYERDEPENDS_digi-arm += "${@oe.utils.conditional('DEY_BUILD_PLATFORM', 'NXP', 'freescale-layer', '', d)}" -LAYERDEPENDS_digi-arm += "${@oe.utils.conditional('DEY_BUILD_PLATFORM', 'STM', 'stm-st-stm32mp', '', d)}" +LAYERDEPENDS_digi-arm += "${@oe.utils.conditional('DEY_SOC_VENDOR', 'NXP', 'freescale-layer', '', d)}" +LAYERDEPENDS_digi-arm += "${@oe.utils.conditional('DEY_SOC_VENDOR', 'STM', 'stm-st-stm32mp', '', d)}" LAYERSERIES_COMPAT_digi-arm = "kirkstone" diff --git a/meta-digi-arm/conf/machine/include/ccmp1.inc b/meta-digi-arm/conf/machine/include/ccmp1.inc index aad915529..38d8d4b09 100644 --- a/meta-digi-arm/conf/machine/include/ccmp1.inc +++ b/meta-digi-arm/conf/machine/include/ccmp1.inc @@ -17,7 +17,7 @@ FIP_UBOOT_DTB = "u-boot" STORAGE_MEDIA = "mtd" # Enable STM specific features -DEY_BUILD_PLATFORM = "STM" +DEY_SOC_VENDOR = "STM" # SWUpdate sw-description configuration BOOTFS_EXT ?= ".boot.ubifs" diff --git a/meta-digi-arm/conf/machine/include/imx-digi-base.inc b/meta-digi-arm/conf/machine/include/imx-digi-base.inc index aed5d59e9..6c7ef4461 100644 --- a/meta-digi-arm/conf/machine/include/imx-digi-base.inc +++ b/meta-digi-arm/conf/machine/include/imx-digi-base.inc @@ -299,4 +299,4 @@ UDEV_EXTRA_RULES:append = " udev-rules-imx" PREFERRED_VERSION_dtc-native:ccimx6 ?= "1.4.5" PREFERRED_VERSION_nativesdk-dtc:ccimx6 ?= "1.4.5" -DEY_BUILD_PLATFORM = "NXP" +DEY_SOC_VENDOR = "NXP" diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey.inc b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey.inc index 45763922b..01b67f094 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey.inc +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey.inc @@ -1,4 +1,4 @@ -# Copyright (C) 2018-2022 Digi International +# Copyright (C) 2018-2023 Digi International require recipes-bsp/u-boot/u-boot.inc @@ -38,7 +38,7 @@ BUILD_UBOOT_SCRIPTS ?= "true" BOOTLOADER_IMAGE_RECIPE ?= "u-boot" LOCALVERSION ?= "" -inherit ${@oe.utils.conditional('DEY_BUILD_PLATFORM', 'NXP', 'fsl-u-boot-localversion', '', d)} +inherit ${@oe.utils.conditional('DEY_SOC_VENDOR', 'NXP', 'fsl-u-boot-localversion', '', d)} # Disable u-boot environment artifacts UBOOT_INITIAL_ENV = "" diff --git a/meta-digi-arm/recipes-core/packagegroup/nativesdk-packagegroup-sdk-host.bbappend b/meta-digi-arm/recipes-core/packagegroup/nativesdk-packagegroup-sdk-host.bbappend index 354872ac1..14d933030 100644 --- a/meta-digi-arm/recipes-core/packagegroup/nativesdk-packagegroup-sdk-host.bbappend +++ b/meta-digi-arm/recipes-core/packagegroup/nativesdk-packagegroup-sdk-host.bbappend @@ -12,5 +12,5 @@ IMX_TRUSTFENCE_SDK_TOOLS ?= " \ " RDEPENDS:${PN} += " \ - ${@oe.utils.conditional('DEY_BUILD_PLATFORM', 'NXP', '${IMX_OPTEE_SDK_RDEPENDS} ${IMX_TRUSTFENCE_SDK_TOOLS}', '', d)} \ + ${@oe.utils.conditional('DEY_SOC_VENDOR', 'NXP', '${IMX_OPTEE_SDK_RDEPENDS} ${IMX_TRUSTFENCE_SDK_TOOLS}', '', d)} \ " diff --git a/meta-digi-arm/recipes-kernel/linux/linux-dey_5.15.bb b/meta-digi-arm/recipes-kernel/linux/linux-dey_5.15.bb index e539bd18a..c632650e2 100644 --- a/meta-digi-arm/recipes-kernel/linux/linux-dey_5.15.bb +++ b/meta-digi-arm/recipes-kernel/linux/linux-dey_5.15.bb @@ -1,21 +1,21 @@ -# Copyright (C) 2022 Digi International +# Copyright (C) 2022,2023 Digi International SUMMARY = "Linux kernel for Digi boards" LICENSE = "GPL-2.0-only" LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46" # CONFIG_KERNEL_LZO in defconfig -DEPENDS += "${@oe.utils.conditional('DEY_BUILD_PLATFORM', 'NXP', 'lzop-native', '', d)}" +DEPENDS += "${@oe.utils.conditional('DEY_SOC_VENDOR', 'NXP', 'lzop-native', '', d)}" inherit kernel -inherit ${@oe.utils.conditional('DEY_BUILD_PLATFORM', 'NXP', 'fsl-kernel-localversion', '', d)} +inherit ${@oe.utils.conditional('DEY_SOC_VENDOR', 'NXP', 'fsl-kernel-localversion', '', d)} SRCBRANCH = "v5.15.71/nxp/master" SRCBRANCH:stm32mpcommon = "v5.15.67/stm/master" SRCREV = "${AUTOREV}" SRCREV:stm32mpcommon = "${AUTOREV}" -require ${@oe.utils.conditional('DEY_BUILD_PLATFORM', 'STM', 'recipes-kernel/linux/linux-stm32mp.inc', '', d)} +require ${@oe.utils.conditional('DEY_SOC_VENDOR', 'STM', 'recipes-kernel/linux/linux-stm32mp.inc', '', d)} # Don't create custom folder for kernel artifacts do_deploy[sstate-outputdirs] = "${DEPLOY_DIR_IMAGE}" diff --git a/meta-digi-dey/conf/layer.conf b/meta-digi-dey/conf/layer.conf index 3d9296e6a..b247a724c 100644 --- a/meta-digi-dey/conf/layer.conf +++ b/meta-digi-dey/conf/layer.conf @@ -20,12 +20,12 @@ BBFILES_DYNAMIC += " \ stm32mpu-ai:${LAYERDIR}/dynamic-layers/stm32mpu-ai/*/*/*.bbappend \ qt5-layer:${LAYERDIR}/dynamic-layers/qt5-layer/*/*/*.bb \ qt5-layer:${LAYERDIR}/dynamic-layers/qt5-layer/*/*/*.bbappend \ - qt5-layer:${LAYERDIR}/dynamic-layers/qt5-layer/${DEY_BUILD_PLATFORM}/*/*/*.bb \ - qt5-layer:${LAYERDIR}/dynamic-layers/qt5-layer/${DEY_BUILD_PLATFORM}/*/*/*.bbappend \ + qt5-layer:${LAYERDIR}/dynamic-layers/qt5-layer/${DEY_SOC_VENDOR}/*/*/*.bb \ + qt5-layer:${LAYERDIR}/dynamic-layers/qt5-layer/${DEY_SOC_VENDOR}/*/*/*.bbappend \ qt6-layer:${LAYERDIR}/dynamic-layers/qt6-layer/*/*/*.bb \ qt6-layer:${LAYERDIR}/dynamic-layers/qt6-layer/*/*/*.bbappend \ - qt6-layer:${LAYERDIR}/dynamic-layers/qt6-layer/${DEY_BUILD_PLATFORM}/*/*/*.bb \ - qt6-layer:${LAYERDIR}/dynamic-layers/qt6-layer/${DEY_BUILD_PLATFORM}/*/*/*.bbappend \ + qt6-layer:${LAYERDIR}/dynamic-layers/qt6-layer/${DEY_SOC_VENDOR}/*/*/*.bb \ + qt6-layer:${LAYERDIR}/dynamic-layers/qt6-layer/${DEY_SOC_VENDOR}/*/*/*.bbappend \ " BBFILE_COLLECTIONS += "digi-dey" From dda629e9685caad58585451e5d0ab215c5ea80d5 Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Mon, 6 Feb 2023 09:19:27 +0100 Subject: [PATCH 077/100] trustfence-sign-tools: split recipe into native and nativesdk This recipe builds the script (that depends on cst-tool) that is used to sign the images. It's only run natively. Signed-off-by: Hector Palacios --- .../trustfence/nativesdk-trustfence-sign-tools_git.bb | 4 ++++ .../trustfence/trustfence-sign-tools-native_git.bb | 4 ++++ ...stfence-sign-tools_git.bb => trustfence-sign-tools.inc} | 7 +++---- 3 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 meta-digi-arm/recipes-digi/trustfence/nativesdk-trustfence-sign-tools_git.bb create mode 100644 meta-digi-arm/recipes-digi/trustfence/trustfence-sign-tools-native_git.bb rename meta-digi-arm/recipes-digi/trustfence/{trustfence-sign-tools_git.bb => trustfence-sign-tools.inc} (92%) diff --git a/meta-digi-arm/recipes-digi/trustfence/nativesdk-trustfence-sign-tools_git.bb b/meta-digi-arm/recipes-digi/trustfence/nativesdk-trustfence-sign-tools_git.bb new file mode 100644 index 000000000..3d55e7a65 --- /dev/null +++ b/meta-digi-arm/recipes-digi/trustfence/nativesdk-trustfence-sign-tools_git.bb @@ -0,0 +1,4 @@ +# Copyright (C) 2023, Digi International Inc. + +require trustfence-sign-tools.inc +inherit nativesdk diff --git a/meta-digi-arm/recipes-digi/trustfence/trustfence-sign-tools-native_git.bb b/meta-digi-arm/recipes-digi/trustfence/trustfence-sign-tools-native_git.bb new file mode 100644 index 000000000..9054dfcbc --- /dev/null +++ b/meta-digi-arm/recipes-digi/trustfence/trustfence-sign-tools-native_git.bb @@ -0,0 +1,4 @@ +# Copyright (C) 2023, Digi International Inc. + +require trustfence-sign-tools.inc +inherit native diff --git a/meta-digi-arm/recipes-digi/trustfence/trustfence-sign-tools_git.bb b/meta-digi-arm/recipes-digi/trustfence/trustfence-sign-tools.inc similarity index 92% rename from meta-digi-arm/recipes-digi/trustfence/trustfence-sign-tools_git.bb rename to meta-digi-arm/recipes-digi/trustfence/trustfence-sign-tools.inc index 12af04c6d..9ed893f03 100644 --- a/meta-digi-arm/recipes-digi/trustfence/trustfence-sign-tools_git.bb +++ b/meta-digi-arm/recipes-digi/trustfence/trustfence-sign-tools.inc @@ -1,11 +1,11 @@ -# Copyright (C) 2017-2022, Digi International Inc. +# Copyright (C) 2017-2023, Digi International Inc. SUMMARY = "TrustFence signing and encryption scripts" LICENSE = "GPL-2.0-only" LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6" -DEPENDS = "trustfence-cst coreutils util-linux" -DEPENDS += "${@oe.utils.conditional('TRUSTFENCE_SIGN_MODE', 'AHAB', 'imx-mkimage', '', d)}" +DEPENDS = "trustfence-cst-native coreutils-native util-linux-native" +DEPENDS += "${@oe.utils.conditional('TRUSTFENCE_SIGN_MODE', 'AHAB', 'imx-mkimage-native', '', d)}" SRCBRANCH = "v2020.04/master" SRCREV = "${AUTOREV}" @@ -53,4 +53,3 @@ do_install() { } FILES:${PN} = "${bindir}" -BBCLASSEXTEND = "native nativesdk" From 090c4f6616a8f44016097c3422d8986df2600f7b Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Fri, 10 Feb 2023 10:44:59 +0100 Subject: [PATCH 078/100] trustfence-sign-tools: convert DEPENDS to RDEPENDS Dependencies of this recipe are run-time dependencies, not build-time. While on it, move them to specific native/nativesdk recipe. Signed-off-by: Hector Palacios --- .../trustfence/nativesdk-trustfence-sign-tools_git.bb | 2 ++ .../trustfence/trustfence-sign-tools-native_git.bb | 3 +++ .../recipes-digi/trustfence/trustfence-sign-tools.inc | 3 --- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/meta-digi-arm/recipes-digi/trustfence/nativesdk-trustfence-sign-tools_git.bb b/meta-digi-arm/recipes-digi/trustfence/nativesdk-trustfence-sign-tools_git.bb index 3d55e7a65..e388cac96 100644 --- a/meta-digi-arm/recipes-digi/trustfence/nativesdk-trustfence-sign-tools_git.bb +++ b/meta-digi-arm/recipes-digi/trustfence/nativesdk-trustfence-sign-tools_git.bb @@ -2,3 +2,5 @@ require trustfence-sign-tools.inc inherit nativesdk + +RDEPENDS:${PN} = "nativesdk-trustfence-cst" diff --git a/meta-digi-arm/recipes-digi/trustfence/trustfence-sign-tools-native_git.bb b/meta-digi-arm/recipes-digi/trustfence/trustfence-sign-tools-native_git.bb index 9054dfcbc..b83b56258 100644 --- a/meta-digi-arm/recipes-digi/trustfence/trustfence-sign-tools-native_git.bb +++ b/meta-digi-arm/recipes-digi/trustfence/trustfence-sign-tools-native_git.bb @@ -2,3 +2,6 @@ require trustfence-sign-tools.inc inherit native + +RDEPENDS:${PN} = "trustfence-cst-native coreutils-native util-linux-native" +RDEPENDS:${PN} += "${@oe.utils.conditional('TRUSTFENCE_SIGN_MODE', 'AHAB', 'imx-mkimage-native', '', d)}" diff --git a/meta-digi-arm/recipes-digi/trustfence/trustfence-sign-tools.inc b/meta-digi-arm/recipes-digi/trustfence/trustfence-sign-tools.inc index 9ed893f03..be2dbda46 100644 --- a/meta-digi-arm/recipes-digi/trustfence/trustfence-sign-tools.inc +++ b/meta-digi-arm/recipes-digi/trustfence/trustfence-sign-tools.inc @@ -4,9 +4,6 @@ SUMMARY = "TrustFence signing and encryption scripts" LICENSE = "GPL-2.0-only" LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6" -DEPENDS = "trustfence-cst-native coreutils-native util-linux-native" -DEPENDS += "${@oe.utils.conditional('TRUSTFENCE_SIGN_MODE', 'AHAB', 'imx-mkimage-native', '', d)}" - SRCBRANCH = "v2020.04/master" SRCREV = "${AUTOREV}" From 3229e37e8894182607eb30b79b7f25c3e70378d7 Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Mon, 8 May 2023 16:50:52 +0200 Subject: [PATCH 079/100] trustfence-sign-tools: make dependency of cst-tool NXP-specific While on it, merge the two RDEPENDS assignments in one. Signed-off-by: Hector Palacios --- .../packagegroup/nativesdk-packagegroup-sdk-host.bbappend | 2 +- .../trustfence/nativesdk-trustfence-sign-tools_git.bb | 4 +++- .../trustfence/trustfence-sign-tools-native_git.bb | 8 ++++++-- meta-digi-dey/recipes-core/recovery/recovery-initramfs.bb | 7 +++++-- meta-digi-dey/recipes-digi/dualboot/dualboot.bb | 5 ++++- 5 files changed, 19 insertions(+), 7 deletions(-) diff --git a/meta-digi-arm/recipes-core/packagegroup/nativesdk-packagegroup-sdk-host.bbappend b/meta-digi-arm/recipes-core/packagegroup/nativesdk-packagegroup-sdk-host.bbappend index 14d933030..94b076552 100644 --- a/meta-digi-arm/recipes-core/packagegroup/nativesdk-packagegroup-sdk-host.bbappend +++ b/meta-digi-arm/recipes-core/packagegroup/nativesdk-packagegroup-sdk-host.bbappend @@ -6,11 +6,11 @@ IMX_OPTEE_SDK_RDEPENDS ?= " \ " IMX_TRUSTFENCE_SDK_TOOLS ?= " \ - nativesdk-trustfence-sign-tools \ nativesdk-trustfence-cst \ ${@oe.utils.conditional('TRUSTFENCE_SIGN_MODE', 'AHAB', 'nativesdk-imx-mkimage', '', d)} \ " RDEPENDS:${PN} += " \ + nativesdk-trustfence-sign-tools \ ${@oe.utils.conditional('DEY_SOC_VENDOR', 'NXP', '${IMX_OPTEE_SDK_RDEPENDS} ${IMX_TRUSTFENCE_SDK_TOOLS}', '', d)} \ " diff --git a/meta-digi-arm/recipes-digi/trustfence/nativesdk-trustfence-sign-tools_git.bb b/meta-digi-arm/recipes-digi/trustfence/nativesdk-trustfence-sign-tools_git.bb index e388cac96..43e98b90b 100644 --- a/meta-digi-arm/recipes-digi/trustfence/nativesdk-trustfence-sign-tools_git.bb +++ b/meta-digi-arm/recipes-digi/trustfence/nativesdk-trustfence-sign-tools_git.bb @@ -3,4 +3,6 @@ require trustfence-sign-tools.inc inherit nativesdk -RDEPENDS:${PN} = "nativesdk-trustfence-cst" +RDEPENDS:${PN} = " \ + ${@oe.utils.conditional('DEY_SOC_VENDOR', 'NXP', 'nativesdk-trustfence-cst', '', d)} \ +" diff --git a/meta-digi-arm/recipes-digi/trustfence/trustfence-sign-tools-native_git.bb b/meta-digi-arm/recipes-digi/trustfence/trustfence-sign-tools-native_git.bb index b83b56258..e17249f7b 100644 --- a/meta-digi-arm/recipes-digi/trustfence/trustfence-sign-tools-native_git.bb +++ b/meta-digi-arm/recipes-digi/trustfence/trustfence-sign-tools-native_git.bb @@ -3,5 +3,9 @@ require trustfence-sign-tools.inc inherit native -RDEPENDS:${PN} = "trustfence-cst-native coreutils-native util-linux-native" -RDEPENDS:${PN} += "${@oe.utils.conditional('TRUSTFENCE_SIGN_MODE', 'AHAB', 'imx-mkimage-native', '', d)}" +RDEPENDS:${PN} = " \ + ${@oe.utils.conditional('DEY_SOC_VENDOR', 'NXP', 'trustfence-cst-native', '', d)} \ + coreutils-native \ + util-linux-native \ + ${@oe.utils.conditional('TRUSTFENCE_SIGN_MODE', 'AHAB', 'imx-mkimage-native', '', d)} \ +" diff --git a/meta-digi-dey/recipes-core/recovery/recovery-initramfs.bb b/meta-digi-dey/recipes-core/recovery/recovery-initramfs.bb index 03e121515..7c1a27bcd 100644 --- a/meta-digi-dey/recipes-core/recovery/recovery-initramfs.bb +++ b/meta-digi-dey/recipes-core/recovery/recovery-initramfs.bb @@ -1,10 +1,13 @@ -# Copyright (C) 2016, 2017 Digi International Inc. +# Copyright (C) 2016-2023 Digi International Inc. SUMMARY = "Recovery initramfs files" LICENSE = "GPL-2.0-only" LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6" -DEPENDS += "${@oe.utils.conditional('TRUSTFENCE_SIGN', '1', 'openssl-native trustfence-cst-native', '', d)}" +SOC_SIGN_DEPENDS = " \ + ${@oe.utils.conditional('DEY_SOC_VENDOR', 'NXP', 'trustfence-cst-native', '', d)} \ +" +DEPENDS += "${@oe.utils.conditional('TRUSTFENCE_SIGN', '1', 'openssl-native ${SOC_SIGN_DEPENDS}', '', d)}" SRC_URI = " \ file://recovery-initramfs-init \ diff --git a/meta-digi-dey/recipes-digi/dualboot/dualboot.bb b/meta-digi-dey/recipes-digi/dualboot/dualboot.bb index 5437eadd1..3d197fb2e 100644 --- a/meta-digi-dey/recipes-digi/dualboot/dualboot.bb +++ b/meta-digi-dey/recipes-digi/dualboot/dualboot.bb @@ -5,7 +5,10 @@ SECTION = "base" LICENSE = "GPL-2.0-only" LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6" -DEPENDS += "${@oe.utils.conditional('TRUSTFENCE_SIGN', '1', 'openssl-native trustfence-cst-native', '', d)}" +SOC_SIGN_DEPENDS = " \ + ${@oe.utils.conditional('DEY_SOC_VENDOR', 'NXP', 'trustfence-cst-native', '', d)} \ +" +DEPENDS += "${@oe.utils.conditional('TRUSTFENCE_SIGN', '1', 'openssl-native ${SOC_SIGN_DEPENDS}', '', d)}" SRC_URI = " \ file://dualboot-init \ From 74ed606339800b421556e78340db8a6d41751935 Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Mon, 6 Feb 2023 12:17:40 +0100 Subject: [PATCH 080/100] trustfence: use conditionals for NXP-specific stuff Set TRUSTFENCE_DEK_PATH to "0" for CCMP1 (not using dek.bin), as if this was disabled. Set temporarily TRUSTFENCE_ENCRYPT_ENVIRONMENT to "0" for CCMP1 until environment encryption is fully supported. Signed-off-by: Hector Palacios --- .../trustfence/trustfence-sign-tools.inc | 39 ++++++++++--------- meta-digi-dey/classes/trustfence.bbclass | 32 ++++++++------- .../recovery/recovery-initramfs.bb | 16 ++++---- 3 files changed, 49 insertions(+), 38 deletions(-) diff --git a/meta-digi-arm/recipes-digi/trustfence/trustfence-sign-tools.inc b/meta-digi-arm/recipes-digi/trustfence/trustfence-sign-tools.inc index be2dbda46..4870c03fa 100644 --- a/meta-digi-arm/recipes-digi/trustfence/trustfence-sign-tools.inc +++ b/meta-digi-arm/recipes-digi/trustfence/trustfence-sign-tools.inc @@ -27,25 +27,28 @@ do_configure[noexec] = "1" do_compile[noexec] = "1" do_install() { - install -d ${D}${bindir}/csf_templates - if [ "${TRUSTFENCE_SIGN_MODE}" = "AHAB" ]; then - install -m 0755 sign_ahab ${D}${bindir}/csf_templates/ - install -m 0755 encrypt_ahab ${D}${bindir}/csf_templates/ - elif [ "${TRUSTFENCE_SIGN_MODE}" = "HAB" ]; then - install -m 0755 sign_hab ${D}${bindir}/csf_templates/ - install -m 0755 encrypt_hab ${D}${bindir}/csf_templates/ - else - bberror "Unkown TRUSTFENCE_SIGN_MODE value" - exit 1 - fi - install -m 0755 trustfence-sign-artifact.sh ${D}${bindir}/ - install -m 0755 git/scripts/csf_templates/* ${D}${bindir}/csf_templates + if [ "${DEY_SOC_VENDOR}" = "NXP" ]; then + install -d ${D}${bindir}/csf_templates + if [ "${TRUSTFENCE_SIGN_MODE}" = "AHAB" ]; then + install -m 0755 sign_ahab ${D}${bindir}/csf_templates/ + install -m 0755 encrypt_ahab ${D}${bindir}/csf_templates/ + elif [ "${TRUSTFENCE_SIGN_MODE}" = "HAB" ]; then + install -m 0755 sign_hab ${D}${bindir}/csf_templates/ + install -m 0755 encrypt_hab ${D}${bindir}/csf_templates/ + else + bberror "Unkown TRUSTFENCE_SIGN_MODE value" + exit 1 + fi - # Select U-Boot sign script depending on U-Boot including an SPL image - if [ -n "${SPL_BINARY}" ]; then - install -m 0755 git/scripts/sign_spl_fit.sh ${D}${bindir}/trustfence-sign-uboot.sh - else - install -m 0755 git/scripts/sign.sh ${D}${bindir}/trustfence-sign-uboot.sh + install -m 0755 git/scripts/csf_templates/* ${D}${bindir}/csf_templates + install -m 0755 trustfence-sign-artifact.sh ${D}${bindir}/ + + # Select U-Boot sign script depending on U-Boot including an SPL image + if [ -n "${SPL_BINARY}" ]; then + install -m 0755 git/scripts/sign_spl_fit.sh ${D}${bindir}/trustfence-sign-uboot.sh + else + install -m 0755 git/scripts/sign.sh ${D}${bindir}/trustfence-sign-uboot.sh + fi fi } diff --git a/meta-digi-dey/classes/trustfence.bbclass b/meta-digi-dey/classes/trustfence.bbclass index 0e430cf94..df8f0d68b 100644 --- a/meta-digi-dey/classes/trustfence.bbclass +++ b/meta-digi-dey/classes/trustfence.bbclass @@ -22,7 +22,9 @@ TRUSTFENCE_CONSOLE_DISABLE ?= "0" TRUSTFENCE_SIGN ?= "1" TRUSTFENCE_SIGN_KEYS_PATH ?= "default" TRUSTFENCE_DEK_PATH ?= "default" +TRUSTFENCE_DEK_PATH:ccmp1 ?= "0" TRUSTFENCE_ENCRYPT_ENVIRONMENT ?= "1" +TRUSTFENCE_ENCRYPT_ENVIRONMENT:ccmp1 ?= "0" TRUSTFENCE_SRK_REVOKE_MASK ?= "0x0" # Partition encryption configuration @@ -52,8 +54,9 @@ python () { if (d.getVar("TRUSTFENCE_SIGN_KEYS_PATH") == "default"): d.setVar("TRUSTFENCE_SIGN_KEYS_PATH", d.getVar("TOPDIR") + "/trustfence"); - if (d.getVar("TRUSTFENCE_DEK_PATH") == "default"): - d.setVar("TRUSTFENCE_DEK_PATH", d.getVar("TRUSTFENCE_SIGN_KEYS_PATH") + "/dek.bin"); + if (d.getVar("DEY_SOC_VENDOR") == "NXP"): + if (d.getVar("TRUSTFENCE_DEK_PATH") == "default"): + d.setVar("TRUSTFENCE_DEK_PATH", d.getVar("TRUSTFENCE_SIGN_KEYS_PATH") + "/dek.bin"); if (d.getVar("TRUSTFENCE_SIGN") == "1"): d.appendVar("UBOOT_TF_CONF", "CONFIG_SIGN_IMAGE=y CONFIG_AUTH_ARTIFACTS=y ") @@ -65,12 +68,14 @@ python () { d.appendVar("UBOOT_TF_CONF", "CONFIG_UNLOCK_SRK_REVOKE=y ") if d.getVar("TRUSTFENCE_KEY_INDEX"): d.appendVar("UBOOT_TF_CONF", "CONFIG_KEY_INDEX=%s " % d.getVar("TRUSTFENCE_KEY_INDEX")) - if (d.getVar("TRUSTFENCE_DEK_PATH") not in [None, "0"]): - d.appendVar("UBOOT_TF_CONF", 'CONFIG_DEK_PATH="%s" ' % d.getVar("TRUSTFENCE_DEK_PATH")) - if d.getVar("TRUSTFENCE_SIGN_MODE"): - d.appendVar("UBOOT_TF_CONF", 'CONFIG_SIGN_MODE="%s" ' % d.getVar("TRUSTFENCE_SIGN_MODE")) + if (d.getVar("DEY_SOC_VENDOR") == "NXP"): + if (d.getVar("TRUSTFENCE_DEK_PATH") not in [None, "0"]): + d.appendVar("UBOOT_TF_CONF", 'CONFIG_DEK_PATH="%s" ' % d.getVar("TRUSTFENCE_DEK_PATH")) + if d.getVar("TRUSTFENCE_SIGN_MODE"): + d.appendVar("UBOOT_TF_CONF", 'CONFIG_SIGN_MODE="%s" ' % d.getVar("TRUSTFENCE_SIGN_MODE")) if (d.getVar("TRUSTFENCE_ENCRYPT_ENVIRONMENT") == "1"): - d.appendVar("UBOOT_TF_CONF", "CONFIG_ENV_AES=y CONFIG_ENV_AES_CAAM_KEY=y ") + if (d.getVar("DEY_SOC_VENDOR") == "NXP"): + d.appendVar("UBOOT_TF_CONF", "CONFIG_ENV_AES=y CONFIG_ENV_AES_CAAM_KEY=y ") # Provide sane default values for SWUPDATE class in case Trustfence is enabled if (d.getVar("TRUSTFENCE_SIGN") == "1"): @@ -87,12 +92,13 @@ python () { key_index_1 = key_index + 1 # Set the private key template, it will be expanded later in 'swu' recipes once keys are generated. - if (d.getVar("TRUSTFENCE_SIGN_MODE", "") == "AHAB"): - d.setVar("SWUPDATE_PRIVATE_KEY_TEMPLATE", keys_path + "/keys/SRK" + str(key_index_1) + "*key.pem") - d.setVar("CONFIG_SIGN_MODE", "AHAB") - else: - d.setVar("SWUPDATE_PRIVATE_KEY_TEMPLATE", keys_path + "/keys/IMG" + str(key_index_1) + "*key.pem") - d.setVar("CONFIG_SIGN_MODE", "HAB") + if (d.getVar("DEY_SOC_VENDOR") == "NXP"): + if (d.getVar("TRUSTFENCE_SIGN_MODE", "") == "AHAB"): + d.setVar("SWUPDATE_PRIVATE_KEY_TEMPLATE", keys_path + "/keys/SRK" + str(key_index_1) + "*key.pem") + d.setVar("CONFIG_SIGN_MODE", "AHAB") + else: + d.setVar("SWUPDATE_PRIVATE_KEY_TEMPLATE", keys_path + "/keys/IMG" + str(key_index_1) + "*key.pem") + d.setVar("CONFIG_SIGN_MODE", "HAB") # Set the key password. d.setVar("SWUPDATE_PASSWORD_FILE", keys_path + "/keys/key_pass.txt") diff --git a/meta-digi-dey/recipes-core/recovery/recovery-initramfs.bb b/meta-digi-dey/recipes-core/recovery/recovery-initramfs.bb index 7c1a27bcd..e06f09f8c 100644 --- a/meta-digi-dey/recipes-core/recovery/recovery-initramfs.bb +++ b/meta-digi-dey/recipes-core/recovery/recovery-initramfs.bb @@ -47,13 +47,15 @@ do_install() { KEY_INDEX_1=$(expr ${KEY_INDEX} + 1) # Find the certificate to use. - if [ "${TRUSTFENCE_SIGN_MODE}" = "HAB" ]; then - CERT_IMG="$(echo ${TRUSTFENCE_SIGN_KEYS_PATH}/crts/IMG${KEY_INDEX_1}*crt.pem)" - elif [ "${TRUSTFENCE_SIGN_MODE}" = "AHAB" ]; then - CERT_IMG="$(echo ${TRUSTFENCE_SIGN_KEYS_PATH}/crts/SRK${KEY_INDEX_1}*_ca_crt.pem)" - else - bberror "Unkown TRUSTFENCE_SIGN_MODE value" - exit 1 + if [ "${DEY_SOC_VENDOR}" = "NXP" ]; then + if [ "${TRUSTFENCE_SIGN_MODE}" = "HAB" ]; then + CERT_IMG="$(echo ${TRUSTFENCE_SIGN_KEYS_PATH}/crts/IMG${KEY_INDEX_1}*crt.pem)" + elif [ "${TRUSTFENCE_SIGN_MODE}" = "AHAB" ]; then + CERT_IMG="$(echo ${TRUSTFENCE_SIGN_KEYS_PATH}/crts/SRK${KEY_INDEX_1}*_ca_crt.pem)" + else + bberror "Unkown TRUSTFENCE_SIGN_MODE value" + exit 1 + fi fi # Extract the public key from the certificate. From 9c34c0e1eb269d7325ce61bcd56f385c0c1037e3 Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Thu, 13 Apr 2023 09:17:10 +0200 Subject: [PATCH 081/100] trustfence: set STM-specific variables for signing These variables build TF-A with authentication support and build a signed FIP image. Signed-off-by: Hector Palacios --- meta-digi-dey/classes/trustfence.bbclass | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/meta-digi-dey/classes/trustfence.bbclass b/meta-digi-dey/classes/trustfence.bbclass index df8f0d68b..7d3f14c92 100644 --- a/meta-digi-dey/classes/trustfence.bbclass +++ b/meta-digi-dey/classes/trustfence.bbclass @@ -59,6 +59,17 @@ python () { d.setVar("TRUSTFENCE_DEK_PATH", d.getVar("TRUSTFENCE_SIGN_KEYS_PATH") + "/dek.bin"); if (d.getVar("TRUSTFENCE_SIGN") == "1"): + # Set STM-specific variables for signing images + if (d.getVar("DEY_SOC_VENDOR") == "STM"): + d.setVar("TF_A_SIGN_ENABLE", "1") + d.setVar("FIP_SIGN_ENABLE", "1") + d.setVar("FIP_SIGN_KEY_EXTERNAL", "1") + if (d.getVar("DIGI_SOM") == "ccmp15" ): + d.setVar("FIP_SIGN_KEY", d.getVar("TRUSTFENCE_SIGN_KEYS_PATH") + "/keys/privateKey00.pem"); + elif (d.getVar("DIGI_SOM") == "ccmp13" ): + d.setVar("FIP_SIGN_KEY", d.getVar("TRUSTFENCE_SIGN_KEYS_PATH") + "/keys/privateKey0%s.pem" % d.getVar("TRUSTFENCE_KEY_INDEX")); + d.setVar("TRUSTFENCE_PASSWORD_FILE", d.getVar("TRUSTFENCE_SIGN_KEYS_PATH") + "/keys/key_pass.txt") + d.appendVar("UBOOT_TF_CONF", "CONFIG_SIGN_IMAGE=y CONFIG_AUTH_ARTIFACTS=y ") if (d.getVar("TRUSTFENCE_READ_ONLY_ROOTFS") == "1"): d.appendVar("UBOOT_TF_CONF", "CONFIG_AUTHENTICATE_SQUASHFS_ROOTFS=y ") From 1a81de2c2f613c6045dd685d16e38f7499040aac Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Tue, 7 Feb 2023 17:53:03 +0100 Subject: [PATCH 082/100] trustfence-sign-tools: rename sign script with SOC vendor suffix This is in preparation of using the same script name for different SOC vendors (NXP and STM). Signed-off-by: Hector Palacios --- .../recipes-digi/trustfence/trustfence-sign-tools.inc | 4 ++-- ...fence-sign-artifact.sh => trustfence-sign-artifact-nxp.sh} | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename meta-digi-arm/recipes-digi/trustfence/trustfence-sign-tools/{trustfence-sign-artifact.sh => trustfence-sign-artifact-nxp.sh} (100%) diff --git a/meta-digi-arm/recipes-digi/trustfence/trustfence-sign-tools.inc b/meta-digi-arm/recipes-digi/trustfence/trustfence-sign-tools.inc index 4870c03fa..ae7d1c4af 100644 --- a/meta-digi-arm/recipes-digi/trustfence/trustfence-sign-tools.inc +++ b/meta-digi-arm/recipes-digi/trustfence/trustfence-sign-tools.inc @@ -16,7 +16,7 @@ UBOOT_GIT_URI ?= "${@oe.utils.conditional('DIGI_INTERNAL_GIT', '1' , '${UBOOT_UR SRC_URI = " \ ${UBOOT_GIT_URI};branch=${SRCBRANCH} \ - file://trustfence-sign-artifact.sh;name=artifact-sign-script \ + file://trustfence-sign-artifact-nxp.sh \ file://sign_hab;name=artifact-hab-sign \ file://encrypt_hab;name=artifact-hab-encrypt \ file://sign_ahab;name=artifact-ahab-sign \ @@ -41,7 +41,7 @@ do_install() { fi install -m 0755 git/scripts/csf_templates/* ${D}${bindir}/csf_templates - install -m 0755 trustfence-sign-artifact.sh ${D}${bindir}/ + install -m 0755 trustfence-sign-artifact-nxp.sh ${D}${bindir}/trustfence-sign-artifact.sh # Select U-Boot sign script depending on U-Boot including an SPL image if [ -n "${SPL_BINARY}" ]; then diff --git a/meta-digi-arm/recipes-digi/trustfence/trustfence-sign-tools/trustfence-sign-artifact.sh b/meta-digi-arm/recipes-digi/trustfence/trustfence-sign-tools/trustfence-sign-artifact-nxp.sh similarity index 100% rename from meta-digi-arm/recipes-digi/trustfence/trustfence-sign-tools/trustfence-sign-artifact.sh rename to meta-digi-arm/recipes-digi/trustfence/trustfence-sign-tools/trustfence-sign-artifact-nxp.sh From 39dd22c471e88609994cc557503289a77122c030 Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Fri, 10 Feb 2023 12:18:12 +0100 Subject: [PATCH 083/100] trustfence: add recipe to install STM sign tools This recipe downloads a tarball that contains the binaries: - STM32MP_KeyGen_CLI - STM32MP_SigningTool_CLI from ST Microelectronics STM32CubeProgrammer v2.12.0. Signed-off-by: Hector Palacios --- .../nativesdk-trustfence-stm-signtools_1.0.bb | 4 +++ .../trustfence-stm-signtools-native_1.0.bb | 4 +++ .../trustfence-stm-signtools.inc | 27 +++++++++++++++++++ 3 files changed, 35 insertions(+) create mode 100644 meta-digi-arm/recipes-bsp/trustfence-stm-signtools/nativesdk-trustfence-stm-signtools_1.0.bb create mode 100644 meta-digi-arm/recipes-bsp/trustfence-stm-signtools/trustfence-stm-signtools-native_1.0.bb create mode 100644 meta-digi-arm/recipes-bsp/trustfence-stm-signtools/trustfence-stm-signtools.inc diff --git a/meta-digi-arm/recipes-bsp/trustfence-stm-signtools/nativesdk-trustfence-stm-signtools_1.0.bb b/meta-digi-arm/recipes-bsp/trustfence-stm-signtools/nativesdk-trustfence-stm-signtools_1.0.bb new file mode 100644 index 000000000..48d23a547 --- /dev/null +++ b/meta-digi-arm/recipes-bsp/trustfence-stm-signtools/nativesdk-trustfence-stm-signtools_1.0.bb @@ -0,0 +1,4 @@ +# Copyright (C) 2023 Digi International. + +require trustfence-stm-signtools.inc +inherit nativesdk diff --git a/meta-digi-arm/recipes-bsp/trustfence-stm-signtools/trustfence-stm-signtools-native_1.0.bb b/meta-digi-arm/recipes-bsp/trustfence-stm-signtools/trustfence-stm-signtools-native_1.0.bb new file mode 100644 index 000000000..dace38ef7 --- /dev/null +++ b/meta-digi-arm/recipes-bsp/trustfence-stm-signtools/trustfence-stm-signtools-native_1.0.bb @@ -0,0 +1,4 @@ +# Copyright (C) 2023 Digi International. + +require trustfence-stm-signtools.inc +inherit native diff --git a/meta-digi-arm/recipes-bsp/trustfence-stm-signtools/trustfence-stm-signtools.inc b/meta-digi-arm/recipes-bsp/trustfence-stm-signtools/trustfence-stm-signtools.inc new file mode 100644 index 000000000..2c8e9d882 --- /dev/null +++ b/meta-digi-arm/recipes-bsp/trustfence-stm-signtools/trustfence-stm-signtools.inc @@ -0,0 +1,27 @@ +# Copyright (C) 2023 Digi International. + +SUMMARY = "STM key generation and signing tools" +SECTION = "console/tools" +LICENSE = "Proprietary" + +LIC_FILES_CHKSUM = "file://en.SLA0048.txt;md5=108361d167deef887d204830aba9cf94" + +PKGNAME = "trustfence-stm-signtools" + +# tarball +SRC_URI = "${DIGI_PKG_SRC}/${PKGNAME}-${PV}.tar.gz" +SRC_URI[md5sum] = "5621d99156b75e69eecbae721475463b" +SRC_URI[sha256sum] = "5c04b16934aa316d2586980f93680e90af1968bcb9b76c18b9cecddbcf5d6a1b" + +S = "${WORKDIR}/${PKGNAME}-${PV}" + +inherit bin_package + +INSANE_SKIP:${PN} = "already-stripped" + +do_install() { + install -d ${D}${bindir} + install -m 0755 bin/* ${D}${bindir} + install -d ${D}${base_libdir} + install -m 0644 lib/* ${D}${base_libdir} +} From 9b165196bb21644e5c053fbc3c20cc13f3b171cf Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Mon, 13 Feb 2023 11:37:37 +0100 Subject: [PATCH 084/100] global: create DIGI_SOM variable and reformulate DIGI_FAMILY variable Certain platforms share a processor family but need to be differentiated between them. DEY was using the variable DIGI_FAMILY as the SOM name rather than the family. It becomes useful to have both (DIGI_SOM as the more specific, and DIGI_FAMILY as the more generic). This is the case, for example, of: - ccmp1 (family) - ccmp15 (SOM) - ccmp13 (SOM) - ccimx8m (family) - ccimx8mm (SOM) - ccimx8mn (SOM) Both variables are used on the machine overrides. Where DIGI_FAMILY was used, use now DIGI_SOM. Signed-off-by: Hector Palacios --- meta-digi-arm/classes/image_types_digi.bbclass | 4 ++-- meta-digi-arm/conf/machine/ccimx6qpsbc.conf | 2 ++ meta-digi-arm/conf/machine/ccimx6sbc.conf | 2 ++ meta-digi-arm/conf/machine/ccimx8mm-dvk.conf | 4 ++-- meta-digi-arm/conf/machine/ccimx8mn-dvk.conf | 4 ++-- meta-digi-arm/conf/machine/ccimx93-dvk.conf | 5 +++++ meta-digi-arm/conf/machine/ccmp13-dvk.conf | 4 +++- meta-digi-arm/conf/machine/ccmp15-dvk.conf | 4 +++- meta-digi-arm/conf/machine/include/ccimx6.inc | 2 +- meta-digi-arm/conf/machine/include/ccimx6ul.inc | 3 ++- meta-digi-arm/conf/machine/include/ccimx8m.inc | 2 ++ meta-digi-arm/conf/machine/include/ccimx8x.inc | 3 ++- meta-digi-arm/conf/machine/include/ccimx93.inc | 2 -- meta-digi-arm/conf/machine/include/digi-defaults.inc | 4 ++-- .../recipes-bsp/digi-sc-firmware/digi-sc-firmware_1.11.0.bb | 2 +- meta-digi-arm/recipes-bsp/u-boot/u-boot-dey.inc | 4 ++-- meta-digi-arm/recipes-kernel/linux/linux-trustfence.inc | 6 +++--- .../recipes-connectivity/hostapd/hostapd_%.bbappend | 4 ++-- 18 files changed, 38 insertions(+), 23 deletions(-) diff --git a/meta-digi-arm/classes/image_types_digi.bbclass b/meta-digi-arm/classes/image_types_digi.bbclass index 9691b0921..6989cbe2a 100644 --- a/meta-digi-arm/classes/image_types_digi.bbclass +++ b/meta-digi-arm/classes/image_types_digi.bbclass @@ -207,7 +207,7 @@ trustence_sign_cpio() { [ -n "${TRUSTFENCE_DEK_PATH}" ] && [ "${TRUSTFENCE_DEK_PATH}" != "0" ] && export CONFIG_DEK_PATH="${TRUSTFENCE_DEK_PATH}" # Sign/encrypt the ramdisk - trustfence-sign-artifact.sh -p "${DIGI_FAMILY}" -i "${1}" "${1}.tf" + trustfence-sign-artifact.sh -p "${DIGI_SOM}" -i "${1}" "${1}.tf" else # Copy the image with no changes cp "${1}" "${1}.tf" @@ -231,7 +231,7 @@ rootfs_sign() { ROOTFS_IMAGE="${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.squashfs" TMP_ROOTFS_IMAGE_SIGNED="$(mktemp ${ROOTFS_IMAGE}-signed.XXXXXX)" # Sign rootfs read-only image - trustfence-sign-artifact.sh -p "${DIGI_FAMILY}" -r "${ROOTFS_IMAGE}" "${TMP_ROOTFS_IMAGE_SIGNED}" + trustfence-sign-artifact.sh -p "${DIGI_SOM}" -r "${ROOTFS_IMAGE}" "${TMP_ROOTFS_IMAGE_SIGNED}" mv "${TMP_ROOTFS_IMAGE_SIGNED}" "${ROOTFS_IMAGE}" } diff --git a/meta-digi-arm/conf/machine/ccimx6qpsbc.conf b/meta-digi-arm/conf/machine/ccimx6qpsbc.conf index c43460a8e..c468d2cd9 100644 --- a/meta-digi-arm/conf/machine/ccimx6qpsbc.conf +++ b/meta-digi-arm/conf/machine/ccimx6qpsbc.conf @@ -2,6 +2,8 @@ #@NAME: ConnectCore 6 QuadPlus Single Board Computer. #@DESCRIPTION: Machine configuration for Digi's ConnectCore 6 QuadPlus SBC. +DIGI_SOM = "ccimx6qp" + # Include the machine configuration for Digi's ConnectCore 6 module. include conf/machine/include/ccimx6.inc diff --git a/meta-digi-arm/conf/machine/ccimx6sbc.conf b/meta-digi-arm/conf/machine/ccimx6sbc.conf index b3d6f539b..4cea9442c 100644 --- a/meta-digi-arm/conf/machine/ccimx6sbc.conf +++ b/meta-digi-arm/conf/machine/ccimx6sbc.conf @@ -2,6 +2,8 @@ #@NAME: ConnectCore 6 Single Board Computer. #@DESCRIPTION: Machine configuration for Digi's ConnectCore 6 SBC. +DIGI_SOM = "ccimx6" + # Contains the ConnectCore 6 module. include conf/machine/include/ccimx6.inc diff --git a/meta-digi-arm/conf/machine/ccimx8mm-dvk.conf b/meta-digi-arm/conf/machine/ccimx8mm-dvk.conf index a6863c8eb..cbe10eec6 100644 --- a/meta-digi-arm/conf/machine/ccimx8mm-dvk.conf +++ b/meta-digi-arm/conf/machine/ccimx8mm-dvk.conf @@ -2,8 +2,8 @@ #@NAME: ConnectCore 8M Mini Development Kit. #@DESCRIPTION: Machine configuration for Digi's ConnectCore 8M Mini DVK. -DIGI_FAMILY = "ccimx8mm" -MACHINEOVERRIDES =. "mx8:mx8m:mx8mm:ccimx8m:${DIGI_FAMILY}:" +DIGI_SOM = "ccimx8mm" +MACHINEOVERRIDES =. "mx8:mx8m:mx8mm:${DIGI_FAMILY}:${DIGI_SOM}:" # Include the machine configuration for Digi's ConnectCore 8M module. include conf/machine/include/ccimx8m.inc diff --git a/meta-digi-arm/conf/machine/ccimx8mn-dvk.conf b/meta-digi-arm/conf/machine/ccimx8mn-dvk.conf index da1583982..dc3a97a43 100644 --- a/meta-digi-arm/conf/machine/ccimx8mn-dvk.conf +++ b/meta-digi-arm/conf/machine/ccimx8mn-dvk.conf @@ -2,8 +2,8 @@ #@NAME: ConnectCore 8M Nano Development Kit. #@DESCRIPTION: Machine configuration for Digi's ConnectCore 8M Nano DVK. -DIGI_FAMILY = "ccimx8mn" -MACHINEOVERRIDES =. "mx8:mx8m:mx8mn:ccimx8m:${DIGI_FAMILY}:" +DIGI_SOM = "ccimx8mn" +MACHINEOVERRIDES =. "mx8:mx8m:mx8mm:${DIGI_FAMILY}:${DIGI_SOM}:" # Include the machine configuration for Digi's ConnectCore 8M module. include conf/machine/include/ccimx8m.inc diff --git a/meta-digi-arm/conf/machine/ccimx93-dvk.conf b/meta-digi-arm/conf/machine/ccimx93-dvk.conf index 9f193904e..c4738bb13 100644 --- a/meta-digi-arm/conf/machine/ccimx93-dvk.conf +++ b/meta-digi-arm/conf/machine/ccimx93-dvk.conf @@ -2,8 +2,13 @@ #@NAME: ConnectCore 93 Development Kit #@DESCRIPTION: Machine configuration for Digi's ConnectCore 93 DVK +DIGI_SOM = "ccimx93" + require include/ccimx93.inc +MACHINEOVERRIDES =. "${DIGI_FAMILY}:${DIGI_SOM}:" +MACHINEOVERRIDES =. "mx93:" + # U-Boot configurations UBOOT_CONFIG ??= "ccimx93-dvk" UBOOT_CONFIG[ccimx93-dvk] = "ccimx93-dvk_defconfig" diff --git a/meta-digi-arm/conf/machine/ccmp13-dvk.conf b/meta-digi-arm/conf/machine/ccmp13-dvk.conf index f46326f39..88370bb26 100644 --- a/meta-digi-arm/conf/machine/ccmp13-dvk.conf +++ b/meta-digi-arm/conf/machine/ccmp13-dvk.conf @@ -6,11 +6,13 @@ # Include the machine configuration for Digi's ConnectCore MP1. include conf/machine/include/ccmp1.inc +DIGI_SOM = "ccmp13" + # ========================================================================= # Chip architecture # ========================================================================= DEFAULTTUNE = "cortexa7thf-neon-vfpv4" -MACHINEOVERRIDES = "arm:armv7ve:stcommon:stm32mpcommon:stm32mp1common:${DIGI_FAMILY}:ccmp13:ccmp13-dvk" +MACHINEOVERRIDES = "arm:armv7ve:stcommon:stm32mpcommon:stm32mp1common:${DIGI_FAMILY}:${DIGI_SOM}:ccmp13-dvk" # ========================================================================= # boot device diff --git a/meta-digi-arm/conf/machine/ccmp15-dvk.conf b/meta-digi-arm/conf/machine/ccmp15-dvk.conf index 11e378e24..86b8ad1c7 100644 --- a/meta-digi-arm/conf/machine/ccmp15-dvk.conf +++ b/meta-digi-arm/conf/machine/ccmp15-dvk.conf @@ -6,11 +6,13 @@ # Include the machine configuration for Digi's ConnectCore MP1. include conf/machine/include/ccmp1.inc +DIGI_SOM = "ccmp15" + # ========================================================================= # Chip architecture # ========================================================================= DEFAULTTUNE = "cortexa7thf-neon-vfpv4" -MACHINEOVERRIDES = "arm:armv7ve:stcommon:stm32mpcommon:stm32mp1common:${DIGI_FAMILY}:ccmp15:ccmp15-dvk" +MACHINEOVERRIDES = "arm:armv7ve:stcommon:stm32mpcommon:stm32mp1common:${DIGI_FAMILY}:${DIGI_SOM}:ccmp15-dvk" # ========================================================================= # boot device diff --git a/meta-digi-arm/conf/machine/include/ccimx6.inc b/meta-digi-arm/conf/machine/include/ccimx6.inc index 38882221d..403b38dd0 100644 --- a/meta-digi-arm/conf/machine/include/ccimx6.inc +++ b/meta-digi-arm/conf/machine/include/ccimx6.inc @@ -3,7 +3,7 @@ #@DESCRIPTION: Machine configuration for Digi's ConnectCore 6 module. DIGI_FAMILY = "ccimx6" -MACHINEOVERRIDES =. "mx6:mx6dl:mx6q:${DIGI_FAMILY}:" +MACHINEOVERRIDES =. "mx6:mx6dl:mx6q:${DIGI_FAMILY}:${DIGI_SOM}:" include conf/machine/include/imx-digi-base.inc include conf/machine/include/arm/armv7a/tune-cortexa9.inc diff --git a/meta-digi-arm/conf/machine/include/ccimx6ul.inc b/meta-digi-arm/conf/machine/include/ccimx6ul.inc index 91c661949..1065b5fb7 100644 --- a/meta-digi-arm/conf/machine/include/ccimx6ul.inc +++ b/meta-digi-arm/conf/machine/include/ccimx6ul.inc @@ -2,8 +2,9 @@ #@NAME: ConnectCore for i.MX6UL. #@DESCRIPTION: Machine configuration for Digi's ConnectCore 6UL. +DIGI_SOM = "ccimx6ul" DIGI_FAMILY = "ccimx6ul" -MACHINEOVERRIDES =. "mx6:mx6ul:${DIGI_FAMILY}:" +MACHINEOVERRIDES =. "mx6:mx6ul:${DIGI_FAMILY}:${DIGI_SOM}:" include conf/machine/include/imx-digi-base.inc include conf/machine/include/arm/armv7a/tune-cortexa7.inc diff --git a/meta-digi-arm/conf/machine/include/ccimx8m.inc b/meta-digi-arm/conf/machine/include/ccimx8m.inc index b16546ddf..99bc0fd59 100644 --- a/meta-digi-arm/conf/machine/include/ccimx8m.inc +++ b/meta-digi-arm/conf/machine/include/ccimx8m.inc @@ -5,6 +5,8 @@ include conf/machine/include/imx-digi-base.inc require conf/machine/include/arm/armv8a/tune-cortexa53.inc +DIGI_FAMILY = "ccimx8m" + # Platform u-boot settings UBOOT_PREFIX = "imx-boot" UBOOT_SUFFIX = "bin" diff --git a/meta-digi-arm/conf/machine/include/ccimx8x.inc b/meta-digi-arm/conf/machine/include/ccimx8x.inc index de3e67177..58f80e01d 100644 --- a/meta-digi-arm/conf/machine/include/ccimx8x.inc +++ b/meta-digi-arm/conf/machine/include/ccimx8x.inc @@ -2,8 +2,9 @@ #@NAME: ConnectCore 8X module. #@DESCRIPTION: Machine configuration for Digi's ConnectCore 8X module. +DIGI_SOM = "ccimx8x" DIGI_FAMILY = "ccimx8x" -MACHINEOVERRIDES =. "mx8:mx8x:mx8qxp:${DIGI_FAMILY}:" +MACHINEOVERRIDES =. "mx8:mx8x:mx8qxp:${DIGI_FAMILY}:${DIGI_SOM}:" include conf/machine/include/imx-digi-base.inc include conf/machine/include/arm/armv8a/tune-cortexa35.inc diff --git a/meta-digi-arm/conf/machine/include/ccimx93.inc b/meta-digi-arm/conf/machine/include/ccimx93.inc index 9fd452fa8..25e8a2568 100644 --- a/meta-digi-arm/conf/machine/include/ccimx93.inc +++ b/meta-digi-arm/conf/machine/include/ccimx93.inc @@ -3,8 +3,6 @@ #@DESCRIPTION: Machine configuration for Digi's ConnectCore 93 family of SOMs DIGI_FAMILY = "ccimx93" -MACHINEOVERRIDES =. "${DIGI_FAMILY}:" -MACHINEOVERRIDES =. "mx93:" require conf/machine/include/imx-digi-base.inc require conf/machine/include/arm/armv8-2a/tune-cortexa55.inc diff --git a/meta-digi-arm/conf/machine/include/digi-defaults.inc b/meta-digi-arm/conf/machine/include/digi-defaults.inc index 6a1a7bbe4..af46097ae 100644 --- a/meta-digi-arm/conf/machine/include/digi-defaults.inc +++ b/meta-digi-arm/conf/machine/include/digi-defaults.inc @@ -50,8 +50,8 @@ WLAN1_STATIC_NETMASK ?= "255.255.255.0" P2P0_STATIC_IP ?= "192.168.45.30" P2P0_STATIC_NETMASK ?= "255.255.255.0" WLAN_P2P_INTERFACE ?= "p2p0" -WLAN_P2P_DEVICE_NAME ??= "${DIGI_FAMILY}-p2p" -BT_DEVICE_NAME ??= "${DIGI_FAMILY}" +WLAN_P2P_DEVICE_NAME ??= "${DIGI_SOM}-p2p" +BT_DEVICE_NAME ??= "${DIGI_SOM}" # Digi BSP default settings IMAGE_CLASSES = "image_types_digi" diff --git a/meta-digi-arm/recipes-bsp/digi-sc-firmware/digi-sc-firmware_1.11.0.bb b/meta-digi-arm/recipes-bsp/digi-sc-firmware/digi-sc-firmware_1.11.0.bb index 64875ed1d..ed6649a55 100644 --- a/meta-digi-arm/recipes-bsp/digi-sc-firmware/digi-sc-firmware_1.11.0.bb +++ b/meta-digi-arm/recipes-bsp/digi-sc-firmware/digi-sc-firmware_1.11.0.bb @@ -16,7 +16,7 @@ SRC_URI[sha256sum] = "36a02b956c288dad6ce6ecb2b13a4e6fb2983fd5c39cab5028ae9a7daf S = "${WORKDIR}/${PN}-${PV}" -SC_FIRMWARE_NAME ?= "mx8x-${DIGI_FAMILY}-scfw-tcm.bin" +SC_FIRMWARE_NAME ?= "mx8x-${DIGI_SOM}-scfw-tcm.bin" symlink_name = "scfw_tcm.bin" SYSROOT_DIRS += "/boot" diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey.inc b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey.inc index 01b67f094..be252ce5f 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey.inc +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey.inc @@ -97,12 +97,12 @@ build_uboot_scripts() { # Sign boot script TMP_SIGNED_BOOTSCR="$(mktemp ${WORKDIR}/bootscr-signed.XXXXXX)" - trustfence-sign-artifact.sh -p "${DIGI_FAMILY}" -b "${DEPLOYDIR}/boot.scr" "${TMP_SIGNED_BOOTSCR}" + trustfence-sign-artifact.sh -p "${DIGI_SOM}" -b "${DEPLOYDIR}/boot.scr" "${TMP_SIGNED_BOOTSCR}" mv "${TMP_SIGNED_BOOTSCR}" "${DEPLOYDIR}/boot.scr" # Sign altboot script TMP_SIGNED_BOOTSCR="$(mktemp ${WORKDIR}/altboot-signed.XXXXXX)" - trustfence-sign-artifact.sh -p "${DIGI_FAMILY}" -b "${DEPLOYDIR}/altboot.scr" "${TMP_SIGNED_BOOTSCR}" + trustfence-sign-artifact.sh -p "${DIGI_SOM}" -b "${DEPLOYDIR}/altboot.scr" "${TMP_SIGNED_BOOTSCR}" mv "${TMP_SIGNED_BOOTSCR}" "${DEPLOYDIR}/altboot.scr" fi } diff --git a/meta-digi-arm/recipes-kernel/linux/linux-trustfence.inc b/meta-digi-arm/recipes-kernel/linux/linux-trustfence.inc index 99bdc27c4..0d4551eef 100644 --- a/meta-digi-arm/recipes-kernel/linux/linux-trustfence.inc +++ b/meta-digi-arm/recipes-kernel/linux/linux-trustfence.inc @@ -20,7 +20,7 @@ trustfence_sign() { fi TMP_KERNEL_IMAGE_SIGNED="$(mktemp ${KERNEL_IMAGE}-signed.XXXXXX)" - trustfence-sign-artifact.sh -p "${DIGI_FAMILY}" -l "${KERNEL_IMAGE}" "${TMP_KERNEL_IMAGE_SIGNED}" + trustfence-sign-artifact.sh -p "${DIGI_SOM}" -l "${KERNEL_IMAGE}" "${TMP_KERNEL_IMAGE_SIGNED}" if [ "${type}" = "Image.gz" ]; then # Compress the signed Image and restore the original filename @@ -41,9 +41,9 @@ trustfence_sign() { TMP_DTB_IMAGE_SIGNED="$(mktemp ${DTB_IMAGE}-signed.XXXXXX)" if [ "${DTB_EXT}" = "dtbo" ]; then - trustfence-sign-artifact.sh -p "${DIGI_FAMILY}" -o "${DTB_IMAGE}" "${TMP_DTB_IMAGE_SIGNED}" + trustfence-sign-artifact.sh -p "${DIGI_SOM}" -o "${DTB_IMAGE}" "${TMP_DTB_IMAGE_SIGNED}" else - trustfence-sign-artifact.sh -p "${DIGI_FAMILY}" -d "${DTB_IMAGE}" "${TMP_DTB_IMAGE_SIGNED}" + trustfence-sign-artifact.sh -p "${DIGI_SOM}" -d "${DTB_IMAGE}" "${TMP_DTB_IMAGE_SIGNED}" fi mv "${TMP_DTB_IMAGE_SIGNED}" "${DTB_IMAGE}" done diff --git a/meta-digi-dey/recipes-connectivity/hostapd/hostapd_%.bbappend b/meta-digi-dey/recipes-connectivity/hostapd/hostapd_%.bbappend index 157e18fdd..f3609e60c 100644 --- a/meta-digi-dey/recipes-connectivity/hostapd/hostapd_%.bbappend +++ b/meta-digi-dey/recipes-connectivity/hostapd/hostapd_%.bbappend @@ -67,9 +67,9 @@ do_install:append() { sed -i -e 's,@SBINDIR@,${sbindir},g' -e 's,@SYSCONFDIR@,${sysconfdir},g' ${D}${systemd_unitdir}/system/hostapd@.service # Read-only rootfs: actions that substitute postinst script - # - append the ${DIGI_FAMILY} string to SSID + # - append the ${DIGI_SOM} string to SSID if [ -n "${@bb.utils.contains('IMAGE_FEATURES', 'read-only-rootfs', '1', '', d)}" ]; then - sed -i -e "s,##MAC##,${DIGI_FAMILY},g" ${D}${sysconfdir}/hostapd_*.conf + sed -i -e "s,##MAC##,${DIGI_SOM},g" ${D}${sysconfdir}/hostapd_*.conf fi } From 762a4a83151dcfd5ba35ef80cd97baf3bc502137 Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Tue, 14 Feb 2023 17:10:21 +0100 Subject: [PATCH 085/100] u-boot-dey: split do_deploy:append to postfuncs The do_deploy:append did three things: - adapt the U-Boot filenames to 'u-boot--.' - sign/encrypt the U-Boot files (only for iMX6 family) - sign the boot scripts Convert the first two actions into functions (the third already was) and call them conditionally as postfuncs. Also skip the signing of U-Boot files if the platform is not based on iMX6 family. Signed-off-by: Hector Palacios --- .../recipes-bsp/u-boot/u-boot-dey.inc | 37 ++++++++++++++++--- 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey.inc b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey.inc index be252ce5f..e5b9d36f2 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey.inc +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey.inc @@ -63,6 +63,16 @@ def tf_bootscript_sedfilter(d): tf_initramfs = d.getVar('TRUSTFENCE_INITRAMFS_IMAGE') or "" return "s,\(^[[:blank:]]*\)true.*,\\1setenv boot_initrd true\\n\\1setenv initrd_file %s-${MACHINE}.cpio.gz.u-boot.tf,g" % tf_initramfs if tf_initramfs else "" +SIGN_UBOOT ?= "" +SIGN_UBOOT:ccimx6 = "sign_uboot" +SIGN_UBOOT:ccimx6ul = "sign_uboot" + +do_deploy[postfuncs] += " \ + adapt_uboot_filenames \ + ${@oe.utils.ifelse('BUILD_UBOOT_SCRIPTS', 'build_uboot_scripts', '')} \ + ${@oe.utils.conditional('TRUSTFENCE_SIGN', '1', '${SIGN_UBOOT}', '', d)} \ +" + build_uboot_scripts() { for f in $(echo ${INSTALL_FW_UBOOT_SCRIPTS} | sed -e 's,file\:\/\/,,g'); do f_ext="${f##*.}" @@ -107,7 +117,7 @@ build_uboot_scripts() { fi } -do_deploy:append() { +adapt_uboot_filenames() { # Remove canonical U-Boot symlinks for ${UBOOT_CONFIG} currently in the form: # u-boot-.- # u-boot- @@ -124,7 +134,26 @@ do_deploy:append() { cd ${DEPLOYDIR} rm -r ${UBOOT_BINARY}-${type} ln -sf ${UBOOT_BINARYNAME}-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_BINARYNAME}-${type}.${UBOOT_SUFFIX} - if [ "${TRUSTFENCE_SIGN}" = "1" ] && [ "${BOOTLOADER_IMAGE_RECIPE}" = "u-boot" ]; then + fi + done + unset j + done + unset i + fi +} + +sign_uboot() { + # This function only applies to CC6, CC6Plus and CC6UL + if [ -n "${UBOOT_CONFIG}" ] + then + for config in ${UBOOT_MACHINE}; do + i=$(expr $i + 1); + for type in ${UBOOT_CONFIG}; do + j=$(expr $j + 1); + if [ $j -eq $i ] + then + cd ${DEPLOYDIR} + if [ "${BOOTLOADER_IMAGE_RECIPE}" = "u-boot" ]; then install ${B}/${config}/SRK_efuses.bin SRK_efuses-${PV}-${PR}.bin ln -sf SRK_efuses-${PV}-${PR}.bin SRK_efuses.bin @@ -146,10 +175,6 @@ do_deploy:append() { done unset i fi - - if [ "${BUILD_UBOOT_SCRIPTS}" = "true" ]; then - build_uboot_scripts - fi } BOOT_TOOLS = "imx-boot-tools" From f6738c3cb25c594fa948f81e1945fca3796fd8be Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Mon, 8 May 2023 17:09:43 +0200 Subject: [PATCH 086/100] trustfence: add artifacts signing script for STM platforms This script can be called stand-alone or from DEY. Syntax is : trustfence-sign-artifact.sh -p [-t input-unsigned-image> ] If files are omitted, it at least generates random keys if they do not exist. Signed-off-by: Hector Palacios --- .../nativesdk-trustfence-sign-tools_git.bb | 1 + .../trustfence-sign-tools-native_git.bb | 1 + .../trustfence/trustfence-sign-tools.inc | 4 + .../trustfence-sign-artifact-stm.sh | 134 ++++++++++++++++++ 4 files changed, 140 insertions(+) create mode 100755 meta-digi-arm/recipes-digi/trustfence/trustfence-sign-tools/trustfence-sign-artifact-stm.sh diff --git a/meta-digi-arm/recipes-digi/trustfence/nativesdk-trustfence-sign-tools_git.bb b/meta-digi-arm/recipes-digi/trustfence/nativesdk-trustfence-sign-tools_git.bb index 43e98b90b..e1f5f9ade 100644 --- a/meta-digi-arm/recipes-digi/trustfence/nativesdk-trustfence-sign-tools_git.bb +++ b/meta-digi-arm/recipes-digi/trustfence/nativesdk-trustfence-sign-tools_git.bb @@ -5,4 +5,5 @@ inherit nativesdk RDEPENDS:${PN} = " \ ${@oe.utils.conditional('DEY_SOC_VENDOR', 'NXP', 'nativesdk-trustfence-cst', '', d)} \ + ${@oe.utils.conditional('DEY_SOC_VENDOR', 'STM', 'nativesdk-trustfence-stm-signtools', '', d)} \ " diff --git a/meta-digi-arm/recipes-digi/trustfence/trustfence-sign-tools-native_git.bb b/meta-digi-arm/recipes-digi/trustfence/trustfence-sign-tools-native_git.bb index e17249f7b..c879f9288 100644 --- a/meta-digi-arm/recipes-digi/trustfence/trustfence-sign-tools-native_git.bb +++ b/meta-digi-arm/recipes-digi/trustfence/trustfence-sign-tools-native_git.bb @@ -5,6 +5,7 @@ inherit native RDEPENDS:${PN} = " \ ${@oe.utils.conditional('DEY_SOC_VENDOR', 'NXP', 'trustfence-cst-native', '', d)} \ + ${@oe.utils.conditional('DEY_SOC_VENDOR', 'STM', 'trustfence-stm-signtools-native', '', d)} \ coreutils-native \ util-linux-native \ ${@oe.utils.conditional('TRUSTFENCE_SIGN_MODE', 'AHAB', 'imx-mkimage-native', '', d)} \ diff --git a/meta-digi-arm/recipes-digi/trustfence/trustfence-sign-tools.inc b/meta-digi-arm/recipes-digi/trustfence/trustfence-sign-tools.inc index ae7d1c4af..de09db48a 100644 --- a/meta-digi-arm/recipes-digi/trustfence/trustfence-sign-tools.inc +++ b/meta-digi-arm/recipes-digi/trustfence/trustfence-sign-tools.inc @@ -17,6 +17,7 @@ UBOOT_GIT_URI ?= "${@oe.utils.conditional('DIGI_INTERNAL_GIT', '1' , '${UBOOT_UR SRC_URI = " \ ${UBOOT_GIT_URI};branch=${SRCBRANCH} \ file://trustfence-sign-artifact-nxp.sh \ + file://trustfence-sign-artifact-stm.sh \ file://sign_hab;name=artifact-hab-sign \ file://encrypt_hab;name=artifact-hab-encrypt \ file://sign_ahab;name=artifact-ahab-sign \ @@ -49,6 +50,9 @@ do_install() { else install -m 0755 git/scripts/sign.sh ${D}${bindir}/trustfence-sign-uboot.sh fi + elif [ "${DEY_SOC_VENDOR}" = "STM" ]; then + install -d ${D}${bindir} + install -m 0755 trustfence-sign-artifact-stm.sh ${D}${bindir}/trustfence-sign-artifact.sh fi } diff --git a/meta-digi-arm/recipes-digi/trustfence/trustfence-sign-tools/trustfence-sign-artifact-stm.sh b/meta-digi-arm/recipes-digi/trustfence/trustfence-sign-tools/trustfence-sign-artifact-stm.sh new file mode 100755 index 000000000..ddf2d1c86 --- /dev/null +++ b/meta-digi-arm/recipes-digi/trustfence/trustfence-sign-tools/trustfence-sign-artifact-stm.sh @@ -0,0 +1,134 @@ +#!/bin/sh +#=============================================================================== +# +# trustfence-sign-artifact.sh +# +# Copyright (C) 2023 by Digi International Inc. +# All rights reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 as published by +# the Free Software Foundation. +# +# +# Description: +# Script for building signed and encrypted artifacts using STM sign tools. +# +# The following environment variables define the script behaviour: +# +#=============================================================================== + +# Avoid parallel execution of this script +SINGLE_PROCESS_LOCK="/tmp/sign_script.lock.d" +trap 'rm -rf "${SINGLE_PROCESS_LOCK}"' INT TERM EXIT +while ! mkdir "${SINGLE_PROCESS_LOCK}" > /dev/null 2>&1; do + sleep 1 +done + +SCRIPT_NAME="$(basename "${0}")" +SUPPORTED_PLATFORMS="ccmp15, ccmp13" + +while getopts "p:t" c; do + case "${c}" in + p) PLATFORM="${OPTARG}";; + t) ARTIFACT_TFA="y";; + esac +done +shift "$((OPTIND - 1))" + +usage() { + cat < [ ] + + Options: + -p platform + -t sign/encrypt TF-A artifact + +Supported platforms: ${SUPPORTED_PLATFORMS} + +When called without filename parameters, it generates random keys if they +do not exist. + +EOF +} + +if [ -z "${CONFIG_SIGN_KEYS_PATH}" ]; then + echo "Undefined CONFIG_SIGN_KEYS_PATH"; + exit 1 +fi +[ -d "${CONFIG_SIGN_KEYS_PATH}" ] || mkdir "${CONFIG_SIGN_KEYS_PATH}" + +# Default values +[ -z "${CONFIG_KEY_INDEX}" ] && CONFIG_KEY_INDEX="0" +KEY_PASS_FILE="${CONFIG_SIGN_KEYS_PATH}/keys/key_pass.txt" + +# Generate random keys if they don't exist +if [ "${PLATFORM}" = "ccmp15" ]; then + PUBLIC_KEY="${CONFIG_SIGN_KEYS_PATH}/keys/publicKey00.pem" + PRIVATE_KEY="${CONFIG_SIGN_KEYS_PATH}/keys/privateKey00.pem" + if [ ! -f "${PRIVATE_KEY}" ] && [ ! -f "${PUBLIC_KEY}" ] && [ ! -f "${KEY_PASS_FILE}" ]; then + install -d "${CONFIG_SIGN_KEYS_PATH}/keys/" + # Random password + password="$(openssl rand -base64 32)" + echo "Generating random key" + STM32MP_KeyGen_CLI -abs "${CONFIG_SIGN_KEYS_PATH}/keys/" -pwd ${password} -n 1 + echo "${password}" > "${KEY_PASS_FILE}" + fi +elif [ "${PLATFORM}" = "ccmp13" ]; then + N_PUBK="$(ls -l ${CONFIG_SIGN_KEYS_PATH}/keys/publicKey0* 2>/dev/null | wc -l)" + N_PRVK="$(ls -l ${CONFIG_SIGN_KEYS_PATH}/keys/privateKey0* 2>/dev/null | wc -l)" + PUBLIC_KEY="${CONFIG_SIGN_KEYS_PATH}/keys/publicKey0*.pem" + PRIVATE_KEY="${CONFIG_SIGN_KEYS_PATH}/keys/privateKey0${CONFIG_KEY_INDEX}.pem" + if [ "${N_PUBK}" != "8" ] && [ "${N_PRVK}" != 8 ] && [ ! -f "${KEY_PASS_FILE}" ]; then + install -d "${CONFIG_SIGN_KEYS_PATH}/keys/" + # 8 random passwords (separated by whitespaces) + passwords="$(openssl rand -base64 32)" + for i in $(seq 1 7); do + passwords="${passwords} $(openssl rand -base64 32)" + done + echo "Generating random keys" + STM32MP_KeyGen_CLI -abs "${CONFIG_SIGN_KEYS_PATH}/keys/" -pwd ${passwords} -n 8 + echo "${passwords}" > "${KEY_PASS_FILE}" + fi +else + echo "Undefined platform" + exit 1 +fi + +if [ "${#}" = "0" ]; then + exit 0 +elif [ "${#}" != "2" ]; then + usage + exit 1 +fi + +if [ "${ARTIFACT_TFA}" != "y" ]; then + echo "Specify the type of image to process (-t)" + usage + exit 1 +fi + +INPUT_FILE="$(readlink -e "${1}")" +OUTPUT_FILE="$(readlink -m "${2}")" + +# Obtain password from key pass file +INDEX=$((CONFIG_KEY_INDEX + 1)) +PASS=$(cat "${KEY_PASS_FILE}" | cut -f "${INDEX}" -d " ") + +# Sign TF-A artifact +if [ "${ARTIFACT_TFA}" = "y" ]; then + if [ "${PLATFORM}" = "ccmp15" ]; then + SOC_OPTIONS="-hv 1" + elif [ "${PLATFORM}" = "ccmp13" ]; then + SOC_OPTIONS="-hv 2 -of 0x00000001" + fi + STM32MP_SigningTool_CLI -bin ${INPUT_FILE} \ + --public-key ${PUBLIC_KEY} \ + --private-key ${PRIVATE_KEY} \ + -t fsbl \ + -s \ + ${SOC_OPTIONS} \ + --password ${PASS} \ + -o ${OUTPUT_FILE} +fi From a7ce03f66c734a79cb736e2535159903f1491b8e Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Tue, 9 May 2023 08:49:01 +0200 Subject: [PATCH 087/100] trustfence: add dependency of sign tools for recipes requiring keys dualboot and recovery recipes may require to use the keys so they must depend on the recipe that installs the script that generates them. Signed-off-by: Hector Palacios --- meta-digi-dey/recipes-core/recovery/recovery-initramfs.bb | 5 ++++- meta-digi-dey/recipes-digi/dualboot/dualboot.bb | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/meta-digi-dey/recipes-core/recovery/recovery-initramfs.bb b/meta-digi-dey/recipes-core/recovery/recovery-initramfs.bb index e06f09f8c..e716bf6a7 100644 --- a/meta-digi-dey/recipes-core/recovery/recovery-initramfs.bb +++ b/meta-digi-dey/recipes-core/recovery/recovery-initramfs.bb @@ -7,7 +7,10 @@ LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0-only;md5=801f80980d171d SOC_SIGN_DEPENDS = " \ ${@oe.utils.conditional('DEY_SOC_VENDOR', 'NXP', 'trustfence-cst-native', '', d)} \ " -DEPENDS += "${@oe.utils.conditional('TRUSTFENCE_SIGN', '1', 'openssl-native ${SOC_SIGN_DEPENDS}', '', d)}" +DEPENDS += "${@oe.utils.conditional('TRUSTFENCE_SIGN', '1', \ + 'openssl-native ' \ + 'trustfence-sign-tools-native ' \ + '${SOC_SIGN_DEPENDS}', '', d)}" SRC_URI = " \ file://recovery-initramfs-init \ diff --git a/meta-digi-dey/recipes-digi/dualboot/dualboot.bb b/meta-digi-dey/recipes-digi/dualboot/dualboot.bb index 3d197fb2e..f8e7b901c 100644 --- a/meta-digi-dey/recipes-digi/dualboot/dualboot.bb +++ b/meta-digi-dey/recipes-digi/dualboot/dualboot.bb @@ -8,7 +8,10 @@ LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0-only;md5=801f80980d171d SOC_SIGN_DEPENDS = " \ ${@oe.utils.conditional('DEY_SOC_VENDOR', 'NXP', 'trustfence-cst-native', '', d)} \ " -DEPENDS += "${@oe.utils.conditional('TRUSTFENCE_SIGN', '1', 'openssl-native ${SOC_SIGN_DEPENDS}', '', d)}" +DEPENDS += "${@oe.utils.conditional('TRUSTFENCE_SIGN', '1', \ + 'openssl-native ' \ + 'trustfence-sign-tools-native ' \ + '${SOC_SIGN_DEPENDS}', '', d)}" SRC_URI = " \ file://dualboot-init \ From 13c136dbc5eeb957ba6f3a6282481fe9e59185a4 Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Wed, 3 May 2023 11:26:12 +0200 Subject: [PATCH 088/100] trustfence: add recipe to generate the PKI tree Several recipes depend on the PKI creation. Create a small recipe to just run this function which is moved from the trustfence.bbclass. Signed-off-by: Hector Palacios --- .../trustfence/trustfence-genpki-native.bb | 62 +++++++++++++++++++ meta-digi-dey/classes/trustfence.bbclass | 22 ------- .../recovery/recovery-initramfs.bb | 2 - .../recipes-digi/dualboot/dualboot.bb | 2 - 4 files changed, 62 insertions(+), 26 deletions(-) create mode 100644 meta-digi-arm/recipes-digi/trustfence/trustfence-genpki-native.bb diff --git a/meta-digi-arm/recipes-digi/trustfence/trustfence-genpki-native.bb b/meta-digi-arm/recipes-digi/trustfence/trustfence-genpki-native.bb new file mode 100644 index 000000000..b1167f55c --- /dev/null +++ b/meta-digi-arm/recipes-digi/trustfence/trustfence-genpki-native.bb @@ -0,0 +1,62 @@ +# Copyright (C) 2023, Digi International Inc. + +SUMMARY = "TrustFence generation of Public Key Infrastructure (PKI)" +LICENSE = "GPL-2.0-only" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6" + +inherit native + +RDEPENDS:${PN} = " \ + trustfence-sign-tools-native \ + openssl-native \ +" + +S = "${WORKDIR}" + +do_fetch[noexec] = "1" +do_configure[noexec] = "1" +do_compile[noexec] = "1" + +# Function to generate a PKI tree (with lock dir protection) +GENPKI_LOCK_DIR = "${TRUSTFENCE_SIGN_KEYS_PATH}/.genpki.lock" +gen_pki_tree() { + if mkdir -p ${GENPKI_LOCK_DIR}; then + if [ "${DEY_SOC_VENDOR}" = "NXP" ]; then + trustfence-gen-pki.sh ${TRUSTFENCE_SIGN_KEYS_PATH} + elif [ "${DEY_SOC_VENDOR}" = "STM" ]; then + # Call sign script with no artifact arguments to just + # generate the keys + export CONFIG_SIGN_KEYS_PATH="${TRUSTFENCE_SIGN_KEYS_PATH}" + export CONFIG_KEY_INDEX="${TRUSTFENCE_KEY_INDEX}" + trustfence-sign-artifact.sh -p ${DIGI_SOM} + fi + rm -rf ${GENPKI_LOCK_DIR} + else + bbfatal "Could not get lock to generate PKI tree" + fi +} + +# Function that generates a PKI tree if there isn't one +check_gen_pki_tree() { + if [ "${DEY_SOC_VENDOR}" = "NXP" ]; then + SRK_KEYS="$(echo ${TRUSTFENCE_SIGN_KEYS_PATH}/crts/SRK*crt.pem | sed s/\ /\,/g)" + n_commas="$(echo ${SRK_KEYS} | grep -o "," | wc -l)" + if [ "${n_commas}" -eq 0 ]; then + gen_pki_tree + elif [ "${n_commas}" -ne 3 ]; then + bbfatal "Inconsistent PKI tree" + fi + elif [ "${DEY_SOC_VENDOR}" = "STM" ]; then + # The script that generates the PKI tree already checks if + # there isn't one, so there's nothing to do here but calling it. + gen_pki_tree + fi +} + +do_install[depends] = "trustfence-sign-tools-native:do_populate_sysroot \ + openssl-native:do_populate_sysroot" +do_install() { + check_gen_pki_tree +} + +FILES:${PN} = "${bindir}" diff --git a/meta-digi-dey/classes/trustfence.bbclass b/meta-digi-dey/classes/trustfence.bbclass index 7d3f14c92..b7b7c6a9d 100644 --- a/meta-digi-dey/classes/trustfence.bbclass +++ b/meta-digi-dey/classes/trustfence.bbclass @@ -127,25 +127,3 @@ python () { else: d.setVar("TRUSTFENCE_INITRAMFS_IMAGE", ""); } - -# Function to generate a PKI tree (with lock dir protection) -GENPKI_LOCK_DIR = "${TRUSTFENCE_SIGN_KEYS_PATH}/.genpki.lock" -gen_pki_tree() { - if mkdir -p ${GENPKI_LOCK_DIR}; then - trustfence-gen-pki.sh ${TRUSTFENCE_SIGN_KEYS_PATH} - rm -rf ${GENPKI_LOCK_DIR} - else - bbfatal "Could not get lock to generate PKI tree" - fi -} - -# Function that generates a PKI tree if there isn't one -check_gen_pki_tree() { - SRK_KEYS="$(echo ${TRUSTFENCE_SIGN_KEYS_PATH}/crts/SRK*crt.pem | sed s/\ /\,/g)" - n_commas="$(echo ${SRK_KEYS} | grep -o "," | wc -l)" - if [ "${n_commas}" -eq 0 ]; then - gen_pki_tree - elif [ "${n_commas}" -ne 3 ]; then - bbfatal "Inconsistent PKI tree" - fi -} diff --git a/meta-digi-dey/recipes-core/recovery/recovery-initramfs.bb b/meta-digi-dey/recipes-core/recovery/recovery-initramfs.bb index e716bf6a7..04c007a71 100644 --- a/meta-digi-dey/recipes-core/recovery/recovery-initramfs.bb +++ b/meta-digi-dey/recipes-core/recovery/recovery-initramfs.bb @@ -40,8 +40,6 @@ do_install() { # If Trustfence is enabled, copy the public key that is going to be used into the # initramfs '/etc/ssl/certs' folder in order to verify swupdate packages. if [ "${TRUSTFENCE_SIGN}" = "1" ]; then - # Check and generate a PKI tree if there isn't one - check_gen_pki_tree # Retrieve the key index to use. KEY_INDEX="0" if [ -n "${TRUSTFENCE_KEY_INDEX}" ]; then diff --git a/meta-digi-dey/recipes-digi/dualboot/dualboot.bb b/meta-digi-dey/recipes-digi/dualboot/dualboot.bb index f8e7b901c..9036a3c81 100644 --- a/meta-digi-dey/recipes-digi/dualboot/dualboot.bb +++ b/meta-digi-dey/recipes-digi/dualboot/dualboot.bb @@ -40,8 +40,6 @@ do_install() { # If Trustfence is enabled, copy the public key that is going to be used into the # initramfs '/etc/ssl/certs' folder in order to verify swupdate packages. if [ "${TRUSTFENCE_SIGN}" = "1" ]; then - # Check and generate a PKI tree if there isn't one - check_gen_pki_tree # Retrieve the key index to use. KEY_INDEX="0" if [ -n "${TRUSTFENCE_KEY_INDEX}" ]; then From fa1c8777584c1f93a6df291a9b0825a7fd388786 Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Tue, 25 Apr 2023 12:43:30 +0200 Subject: [PATCH 089/100] trustfence: image_types: do not sign artifacts for STM platforms For the moment, do not sign aditional artifacts, such as the ramdisk, the kernel or the boot scripts for STM platforms. In the specific case of the ramdisk, simply copy it over with the expected filename extension. Signed-off-by: Hector Palacios --- meta-digi-arm/classes/image_types_digi.bbclass | 9 ++++++++- meta-digi-arm/recipes-bsp/u-boot/u-boot-dey.inc | 4 ++-- meta-digi-arm/recipes-kernel/linux/linux-trustfence.inc | 3 +++ meta-digi-dey/classes/trustfence.bbclass | 3 ++- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/meta-digi-arm/classes/image_types_digi.bbclass b/meta-digi-arm/classes/image_types_digi.bbclass index 6989cbe2a..e5d4bc81a 100644 --- a/meta-digi-arm/classes/image_types_digi.bbclass +++ b/meta-digi-arm/classes/image_types_digi.bbclass @@ -207,7 +207,14 @@ trustence_sign_cpio() { [ -n "${TRUSTFENCE_DEK_PATH}" ] && [ "${TRUSTFENCE_DEK_PATH}" != "0" ] && export CONFIG_DEK_PATH="${TRUSTFENCE_DEK_PATH}" # Sign/encrypt the ramdisk - trustfence-sign-artifact.sh -p "${DIGI_SOM}" -i "${1}" "${1}.tf" + if [ "${DEY_SOC_VENDOR}" = "NXP" ]; then + trustfence-sign-artifact.sh -p "${DIGI_SOM}" -i "${1}" "${1}.tf" + elif [ "${DEY_SOC_VENDOR}" = "STM" ]; then + # TODO: sign the ramdisk for ST platforms + + # (fall-back) Copy the image with no changes + cp "${1}" "${1}.tf" + fi else # Copy the image with no changes cp "${1}" "${1}.tf" diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey.inc b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey.inc index e5b9d36f2..6970a6a3a 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey.inc +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey.inc @@ -99,8 +99,8 @@ build_uboot_scripts() { # Alternate boot script for dualboot mkimage -T script -n "Alternate bootscript" -C none -d ${WORKDIR}/altboot.txt ${DEPLOYDIR}/altboot.scr - # Sign the scripts - if [ "${TRUSTFENCE_SIGN}" = "1" ]; then + # Sign the scripts (TODO signing of artifacts for STM-based platforms) + if [ [ "${TRUSTFENCE_SIGN}" = "1" ] && [ "${DEY_SOC_VENDOR}" != "STM" ] ]; then export CONFIG_SIGN_KEYS_PATH="${TRUSTFENCE_SIGN_KEYS_PATH}" [ -n "${TRUSTFENCE_KEY_INDEX}" ] && export CONFIG_KEY_INDEX="${TRUSTFENCE_KEY_INDEX}" [ -n "${TRUSTFENCE_DEK_PATH}" ] && [ "${TRUSTFENCE_DEK_PATH}" != "0" ] && export CONFIG_DEK_PATH="${TRUSTFENCE_DEK_PATH}" diff --git a/meta-digi-arm/recipes-kernel/linux/linux-trustfence.inc b/meta-digi-arm/recipes-kernel/linux/linux-trustfence.inc index 0d4551eef..690e2cdf2 100644 --- a/meta-digi-arm/recipes-kernel/linux/linux-trustfence.inc +++ b/meta-digi-arm/recipes-kernel/linux/linux-trustfence.inc @@ -5,6 +5,9 @@ DEPENDS += "${@oe.utils.conditional('TRUSTFENCE_SIGN', '1', 'trustfence-sign-too do_deploy[postfuncs] += "${@oe.utils.conditional('TRUSTFENCE_SIGN', '1', 'trustfence_sign', '', d)}" trustfence_sign() { + # TODO: signing of artifacts for STM-based platforms + [ "${DEY_SOC_VENDOR}" = "STM" ] && return + # Set environment variables for trustfence configuration export CONFIG_SIGN_KEYS_PATH="${TRUSTFENCE_SIGN_KEYS_PATH}" [ -n "${TRUSTFENCE_KEY_INDEX}" ] && export CONFIG_KEY_INDEX="${TRUSTFENCE_KEY_INDEX}" diff --git a/meta-digi-dey/classes/trustfence.bbclass b/meta-digi-dey/classes/trustfence.bbclass index b7b7c6a9d..b1a06c9ec 100644 --- a/meta-digi-dey/classes/trustfence.bbclass +++ b/meta-digi-dey/classes/trustfence.bbclass @@ -70,7 +70,7 @@ python () { d.setVar("FIP_SIGN_KEY", d.getVar("TRUSTFENCE_SIGN_KEYS_PATH") + "/keys/privateKey0%s.pem" % d.getVar("TRUSTFENCE_KEY_INDEX")); d.setVar("TRUSTFENCE_PASSWORD_FILE", d.getVar("TRUSTFENCE_SIGN_KEYS_PATH") + "/keys/key_pass.txt") - d.appendVar("UBOOT_TF_CONF", "CONFIG_SIGN_IMAGE=y CONFIG_AUTH_ARTIFACTS=y ") + d.appendVar("UBOOT_TF_CONF", "CONFIG_SIGN_IMAGE=y ") if (d.getVar("TRUSTFENCE_READ_ONLY_ROOTFS") == "1"): d.appendVar("UBOOT_TF_CONF", "CONFIG_AUTHENTICATE_SQUASHFS_ROOTFS=y ") if d.getVar("TRUSTFENCE_SIGN_KEYS_PATH"): @@ -80,6 +80,7 @@ python () { if d.getVar("TRUSTFENCE_KEY_INDEX"): d.appendVar("UBOOT_TF_CONF", "CONFIG_KEY_INDEX=%s " % d.getVar("TRUSTFENCE_KEY_INDEX")) if (d.getVar("DEY_SOC_VENDOR") == "NXP"): + d.appendVar("UBOOT_TF_CONF", "CONFIG_AUTH_ARTIFACTS=y ") if (d.getVar("TRUSTFENCE_DEK_PATH") not in [None, "0"]): d.appendVar("UBOOT_TF_CONF", 'CONFIG_DEK_PATH="%s" ' % d.getVar("TRUSTFENCE_DEK_PATH")) if d.getVar("TRUSTFENCE_SIGN_MODE"): From 6298a50b2e159d599e351c8dff8d60ea4d2c81e5 Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Tue, 25 Apr 2023 12:46:48 +0200 Subject: [PATCH 090/100] trustfence: copy the public key to the rootfs The root file system requires the public key to authenticate SWU files. For NXP platforms, the public key is extracted from the certificate. For STM platforms, simply copy the public key over to the rootfs. Signed-off-by: Hector Palacios --- .../recovery/recovery-initramfs.bb | 19 +++++++--- .../recipes-digi/dualboot/dualboot.bb | 35 +++++++++++++------ 2 files changed, 39 insertions(+), 15 deletions(-) diff --git a/meta-digi-dey/recipes-core/recovery/recovery-initramfs.bb b/meta-digi-dey/recipes-core/recovery/recovery-initramfs.bb index 04c007a71..7b2a395fe 100644 --- a/meta-digi-dey/recipes-core/recovery/recovery-initramfs.bb +++ b/meta-digi-dey/recipes-core/recovery/recovery-initramfs.bb @@ -57,11 +57,22 @@ do_install() { bberror "Unkown TRUSTFENCE_SIGN_MODE value" exit 1 fi + # Extract the public key from the certificate. + install -d ${D}${sysconfdir}/ssl/certs + openssl x509 -pubkey -noout -in "${CERT_IMG}" > ${D}${sysconfdir}/ssl/certs/key.pub + elif [ "${DEY_SOC_VENDOR}" = "STM" ]; then + # Copy the public key to the rootfs + if [ "${DIGI_SOM}" = "ccmp15" ]; then + PUBLIC_KEY="${TRUSTFENCE_SIGN_KEYS_PATH}/keys/publicKey00.pem" + elif [ "${DIGI_SOM}" = "ccmp13" ]; then + PUBLIC_KEY="${TRUSTFENCE_SIGN_KEYS_PATH}/keys/publicKey0${KEY_INDEX}.pem" + else + bberror "Unknown DIGI_SOM" + exit 1 + fi + install -d ${D}${sysconfdir}/ssl/certs + cp ${PUBLIC_KEY} ${D}${sysconfdir}/ssl/certs/key.pub fi - - # Extract the public key from the certificate. - install -d ${D}${sysconfdir}/ssl/certs - openssl x509 -pubkey -noout -in "${CERT_IMG}" > ${D}${sysconfdir}/ssl/certs/key.pub fi } diff --git a/meta-digi-dey/recipes-digi/dualboot/dualboot.bb b/meta-digi-dey/recipes-digi/dualboot/dualboot.bb index 9036a3c81..188ef3839 100644 --- a/meta-digi-dey/recipes-digi/dualboot/dualboot.bb +++ b/meta-digi-dey/recipes-digi/dualboot/dualboot.bb @@ -48,18 +48,31 @@ do_install() { KEY_INDEX_1=$(expr ${KEY_INDEX} + 1) # Find the certificate to use. - if [ "${TRUSTFENCE_SIGN_MODE}" = "HAB" ]; then - CERT_IMG="$(echo ${TRUSTFENCE_SIGN_KEYS_PATH}/crts/IMG${KEY_INDEX_1}*crt.pem)" - elif [ "${TRUSTFENCE_SIGN_MODE}" = "AHAB" ]; then - CERT_IMG="$(echo ${TRUSTFENCE_SIGN_KEYS_PATH}/crts/SRK${KEY_INDEX_1}*_ca_crt.pem)" - else - bberror "Unkown TRUSTFENCE_SIGN_MODE value" - exit 1 + if [ "${DEY_SOC_VENDOR}" = "NXP" ]; then + if [ "${TRUSTFENCE_SIGN_MODE}" = "HAB" ]; then + CERT_IMG="$(echo ${TRUSTFENCE_SIGN_KEYS_PATH}/crts/IMG${KEY_INDEX_1}*crt.pem)" + elif [ "${TRUSTFENCE_SIGN_MODE}" = "AHAB" ]; then + CERT_IMG="$(echo ${TRUSTFENCE_SIGN_KEYS_PATH}/crts/SRK${KEY_INDEX_1}*_ca_crt.pem)" + else + bberror "Unknown TRUSTFENCE_SIGN_MODE value" + exit 1 + fi + # Extract the public key from the certificate. + install -d ${D}${sysconfdir}/ssl/certs + openssl x509 -pubkey -noout -in "${CERT_IMG}" > ${D}${sysconfdir}/ssl/certs/key.pub + elif [ "${DEY_SOC_VENDOR}" = "STM" ]; then + # Copy the public key to the rootfs + if [ "${DIGI_SOM}" = "ccmp15" ]; then + PUBLIC_KEY="${TRUSTFENCE_SIGN_KEYS_PATH}/keys/publicKey00.pem" + elif [ "${DIGI_SOM}" = "ccmp13" ]; then + PUBLIC_KEY="${TRUSTFENCE_SIGN_KEYS_PATH}/keys/publicKey0${KEY_INDEX}.pem" + else + bberror "Unknown DIGI_SOM" + exit 1 + fi + install -d ${D}${sysconfdir}/ssl/certs + cp ${PUBLIC_KEY} ${D}${sysconfdir}/ssl/certs/key.pub fi - - # Extract the public key from the certificate. - install -d ${D}${sysconfdir}/ssl/certs - openssl x509 -pubkey -noout -in "${CERT_IMG}" > ${D}${sysconfdir}/ssl/certs/key.pub fi } From d6af2d336cad11e5dab2586d9dcae2663fa42735 Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Tue, 25 Apr 2023 12:51:04 +0200 Subject: [PATCH 091/100] tf-a-stm32mp: automate the signing of TF-A image Add as deploy postfunc, the signing of TF-A image by calling Digi signing script. Signed-off-by: Hector Palacios --- .../tf-a-stm32mp_%.bbappend | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/meta-digi-arm/dynamic-layers/stm-st-stm32mp/recipes-bsp/trusted-firmware-a/tf-a-stm32mp_%.bbappend b/meta-digi-arm/dynamic-layers/stm-st-stm32mp/recipes-bsp/trusted-firmware-a/tf-a-stm32mp_%.bbappend index ba9b87759..3e41ce4eb 100644 --- a/meta-digi-arm/dynamic-layers/stm-st-stm32mp/recipes-bsp/trusted-firmware-a/tf-a-stm32mp_%.bbappend +++ b/meta-digi-arm/dynamic-layers/stm-st-stm32mp/recipes-bsp/trusted-firmware-a/tf-a-stm32mp_%.bbappend @@ -15,3 +15,30 @@ SRC_URI = " \ " TF_A_CONFIG[nand] = "${DEVICE_BOARD_ENABLE:NAND},STM32MP_RAW_NAND=1 ${@'STM32MP_FORCE_MTD_START_OFFSET=${TF_A_MTD_START_OFFSET_NAND}' if ${TF_A_MTD_START_OFFSET_NAND} else ''} STM32MP_USB_PROGRAMMER=1" + +# Sign TF-A image +do_deploy[postfuncs] += "${@oe.utils.conditional('TRUSTFENCE_SIGN', '1', 'tfa_sign', '', d)}" +tfa_sign() { + export CONFIG_SIGN_KEYS_PATH="${TRUSTFENCE_SIGN_KEYS_PATH}" + export CONFIG_KEY_INDEX="${TRUSTFENCE_KEY_INDEX}" + + unset i + for config in ${TF_A_CONFIG}; do + i=$(expr $i + 1) + # Initialize devicetree list and tf-a basename + dt_config=$(echo ${TF_A_DEVICETREE} | cut -d',' -f${i}) + tfa_basename=$(echo ${TF_A_BINARIES} | cut -d',' -f${i}) + tfa_file_type=$(echo ${TF_A_FILES} | cut -d',' -f${i}) + for dt in ${dt_config}; do + for file_type in ${tfa_file_type}; do + case "${file_type}" in + bl2) + TF_A_FILENAME="${tfa_basename}-${dt}-${config}.${TF_A_SUFFIX}" + if [ -f "${DEPLOYDIR}/arm-trusted-firmware/${TF_A_FILENAME}" ]; then + trustfence-sign-artifact.sh -p "${DIGI_SOM}" -t "${DEPLOYDIR}/arm-trusted-firmware/${TF_A_FILENAME}" "${DEPLOYDIR}/arm-trusted-firmware/${TF_A_FILENAME}_signed" + fi + esac + done # for file_type in ${tfa_file_type} + done # for dt in ${dt_config} + done # for config in ${TF_A_CONFIG} +} From 32f4ba9b6d273fc193ce79fc591d4e9646966a25 Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Tue, 25 Apr 2023 13:00:23 +0200 Subject: [PATCH 092/100] tf-a-stm32mp: obtain password to use during FIP image signing process The FIP image is signed internally by this recipe. The password must be set in FIP_SIGN_KEY_PASS. With the signing script, the password is randomly generated and saved in key_pass.txt. This prefunc obtains the password(s) from the file to set FIP_SIGN_KEY_PASS so that the FIP can be properly signed. Signed-off-by: Hector Palacios --- .../tf-a-stm32mp_%.bbappend | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/meta-digi-arm/dynamic-layers/stm-st-stm32mp/recipes-bsp/trusted-firmware-a/tf-a-stm32mp_%.bbappend b/meta-digi-arm/dynamic-layers/stm-st-stm32mp/recipes-bsp/trusted-firmware-a/tf-a-stm32mp_%.bbappend index 3e41ce4eb..0f74e3de7 100644 --- a/meta-digi-arm/dynamic-layers/stm-st-stm32mp/recipes-bsp/trusted-firmware-a/tf-a-stm32mp_%.bbappend +++ b/meta-digi-arm/dynamic-layers/stm-st-stm32mp/recipes-bsp/trusted-firmware-a/tf-a-stm32mp_%.bbappend @@ -16,6 +16,33 @@ SRC_URI = " \ TF_A_CONFIG[nand] = "${DEVICE_BOARD_ENABLE:NAND},STM32MP_RAW_NAND=1 ${@'STM32MP_FORCE_MTD_START_OFFSET=${TF_A_MTD_START_OFFSET_NAND}' if ${TF_A_MTD_START_OFFSET_NAND} else ''} STM32MP_USB_PROGRAMMER=1" +DEPENDS += " \ + ${@oe.utils.conditional('TRUSTFENCE_SIGN', '1', 'trustfence-sign-tools-native trustfence-genpki-native', '', d)} \ +" + +# This dependency is required so that the PKI generation completes before +# proceeding with set_fip_sign_key() where we extract the password that +# is later used on the do_deploy of the fip-utils-stm32mp.bbclass. +do_install[depends] = " \ + trustfence-sign-tools-native:do_populate_sysroot \ + openssl-native:do_populate_sysroot \ +" + +# Obtain password to use in FIP generation +# Get password from file using the given key index +do_deploy[prefuncs] += "${@oe.utils.conditional('TRUSTFENCE_SIGN', '1', 'set_fip_sign_key', '', d)}" +python set_fip_sign_key() { + passfile = d.getVar('TRUSTFENCE_PASSWORD_FILE') + if (os.path.isfile(passfile)): + with open(passfile, "r") as file: + p = file.read().split() + i = int(d.getVar('TRUSTFENCE_KEY_INDEX')) + if (i > 7): + i = 0 + if (p): + d.setVar('FIP_SIGN_KEY_PASS', p[i]) +} + # Sign TF-A image do_deploy[postfuncs] += "${@oe.utils.conditional('TRUSTFENCE_SIGN', '1', 'tfa_sign', '', d)}" tfa_sign() { From ea70fa6b0c02970aa8d7a5630f86e9ab25fde6dc Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Wed, 26 Apr 2023 17:43:50 +0200 Subject: [PATCH 093/100] trustfence: weak assign TRUSTFENCE_KEY_INDEX to 0 (default) Signed-off-by: Hector Palacios --- meta-digi-dey/classes/trustfence.bbclass | 1 + 1 file changed, 1 insertion(+) diff --git a/meta-digi-dey/classes/trustfence.bbclass b/meta-digi-dey/classes/trustfence.bbclass index b1a06c9ec..6eda06492 100644 --- a/meta-digi-dey/classes/trustfence.bbclass +++ b/meta-digi-dey/classes/trustfence.bbclass @@ -26,6 +26,7 @@ TRUSTFENCE_DEK_PATH:ccmp1 ?= "0" TRUSTFENCE_ENCRYPT_ENVIRONMENT ?= "1" TRUSTFENCE_ENCRYPT_ENVIRONMENT:ccmp1 ?= "0" TRUSTFENCE_SRK_REVOKE_MASK ?= "0x0" +TRUSTFENCE_KEY_INDEX ?= "0" # Partition encryption configuration TRUSTFENCE_ENCRYPT_PARTITIONS ?= "1" From eb49d927a54c31c3e2340524fc4841f03e2bbebf Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Wed, 10 May 2023 17:33:00 +0200 Subject: [PATCH 094/100] trustfence: enable auth capabilities on TF-A independently of TRUSTFENCE_SIGN Sometimes, it may be desired that the DEY project does not sign the artifacts, for example, if they are going to be externally signed on a secure server. In this case, the user sets TRUSTFENCE_SIGN="0". On STM platforms, all the variables were being set if TRUSTFENCE_SIGN="1" and authentication support is not enabled on TF_A otherwise. Set TF_A_SIGN_ENABLE (which adds authentication support to TF_A) always for STM platforms (as long as the project inherits the trustfence class) and set FIP_SIGN_ENABLE="0" if its sibling TRUSTFENCE_SIGN="0", so that DEY doesn't sign the FIP image either. Signed-off-by: Hector Palacios --- meta-digi-dey/classes/trustfence.bbclass | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/meta-digi-dey/classes/trustfence.bbclass b/meta-digi-dey/classes/trustfence.bbclass index 6eda06492..7cce60c06 100644 --- a/meta-digi-dey/classes/trustfence.bbclass +++ b/meta-digi-dey/classes/trustfence.bbclass @@ -58,11 +58,16 @@ python () { if (d.getVar("DEY_SOC_VENDOR") == "NXP"): if (d.getVar("TRUSTFENCE_DEK_PATH") == "default"): d.setVar("TRUSTFENCE_DEK_PATH", d.getVar("TRUSTFENCE_SIGN_KEYS_PATH") + "/dek.bin"); + elif (d.getVar("DEY_SOC_VENDOR") == "STM"): + # Enable authentication capabilities on TF-A independently + # of whether the images are going to be signed by DEY or externally + d.setVar("TF_A_SIGN_ENABLE", "1") + if (d.getVar("TRUSTFENCE_SIGN") == "0"): + d.setVar("FIP_SIGN_ENABLE", "0") if (d.getVar("TRUSTFENCE_SIGN") == "1"): # Set STM-specific variables for signing images if (d.getVar("DEY_SOC_VENDOR") == "STM"): - d.setVar("TF_A_SIGN_ENABLE", "1") d.setVar("FIP_SIGN_ENABLE", "1") d.setVar("FIP_SIGN_KEY_EXTERNAL", "1") if (d.getVar("DIGI_SOM") == "ccmp15" ): From a3af0c85971505e85755cb45fd31bc8731b04663 Mon Sep 17 00:00:00 2001 From: Mike Engel Date: Fri, 5 May 2023 10:19:07 +0200 Subject: [PATCH 095/100] udev: disable uSD card mounting for the CCMP1 This commit disables the uSD mounting, due to issues detected during the boot process when UBIFS starts with the wear-leveling process to erase NAND blocks. https://onedigi.atlassian.net/browse/DEL-8415 Signed-off-by: Mike Engel --- .../recipes-core/udev/udev-extraconf/00-disable-sd.rules | 2 ++ meta-digi-arm/recipes-core/udev/udev-extraconf_1.1.bbappend | 4 ++++ 2 files changed, 6 insertions(+) create mode 100644 meta-digi-arm/recipes-core/udev/udev-extraconf/00-disable-sd.rules diff --git a/meta-digi-arm/recipes-core/udev/udev-extraconf/00-disable-sd.rules b/meta-digi-arm/recipes-core/udev/udev-extraconf/00-disable-sd.rules new file mode 100644 index 000000000..4096f815a --- /dev/null +++ b/meta-digi-arm/recipes-core/udev/udev-extraconf/00-disable-sd.rules @@ -0,0 +1,2 @@ +# Disable all SD devices +SUBSYSTEMS=="mmc", ATTRS{type}=="SD", RUN:="/bin/true" diff --git a/meta-digi-arm/recipes-core/udev/udev-extraconf_1.1.bbappend b/meta-digi-arm/recipes-core/udev/udev-extraconf_1.1.bbappend index 48063b477..134bfd839 100644 --- a/meta-digi-arm/recipes-core/udev/udev-extraconf_1.1.bbappend +++ b/meta-digi-arm/recipes-core/udev/udev-extraconf_1.1.bbappend @@ -9,6 +9,7 @@ SRC_URI += " \ " SRC_URI:append:ccmp1 = " \ file://99-ext-rtc-wakeup.rules \ + file://00-disable-sd.rules \ " do_install:append() { @@ -59,6 +60,9 @@ do_install:append() { do_install:append:ccmp1() { install -m 0644 ${WORKDIR}/99-ext-rtc-wakeup.rules ${D}${sysconfdir}/udev/rules.d/ + # Disables all SD device but keeps on mounting other external memory devices like USB. + # This is currently needed for the CCMP1 platform as a workaround to fix a boot issue. + install -m 0644 ${WORKDIR}/00-disable-sd.rules ${D}${sysconfdir}/udev/rules.d/ } FILES:${PN}:append = " \ From f2da72b2eb86cbc3fea24f47b27bdb234ec70e01 Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Thu, 11 May 2023 11:26:07 +0200 Subject: [PATCH 096/100] trustfence-stm-signtools: add rdepends on nativesdk-qtbase The tools STM32MP_KeyGen_CLI and STM32MP_SigningTool_CLI have a dependency of libQt5Core.so.5 which is provided by qtbase. Add this dependency to avoid errors during SDK generation. Signed-off-by: Hector Palacios --- .../nativesdk-trustfence-stm-signtools_1.0.bb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/meta-digi-arm/recipes-bsp/trustfence-stm-signtools/nativesdk-trustfence-stm-signtools_1.0.bb b/meta-digi-arm/recipes-bsp/trustfence-stm-signtools/nativesdk-trustfence-stm-signtools_1.0.bb index 48d23a547..f4614cc4e 100644 --- a/meta-digi-arm/recipes-bsp/trustfence-stm-signtools/nativesdk-trustfence-stm-signtools_1.0.bb +++ b/meta-digi-arm/recipes-bsp/trustfence-stm-signtools/nativesdk-trustfence-stm-signtools_1.0.bb @@ -2,3 +2,8 @@ require trustfence-stm-signtools.inc inherit nativesdk + +# STM signing tools binaries depend on libQt5Core.so.5 +RDEPENDS:${PN} += " \ + nativesdk-qtbase \ +" From e7004dcaa8b9a284ecc498698e6f4e80c8e6861a Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Thu, 11 May 2023 10:29:22 +0200 Subject: [PATCH 097/100] ccimx93: add MIPI display overlay Support for DLC0200CC904DF-2 panel has been added in the kernel. Signed-off-by: Javier Viguera --- meta-digi-arm/conf/machine/ccimx93-dvk.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/meta-digi-arm/conf/machine/ccimx93-dvk.conf b/meta-digi-arm/conf/machine/ccimx93-dvk.conf index c4738bb13..88c8f3641 100644 --- a/meta-digi-arm/conf/machine/ccimx93-dvk.conf +++ b/meta-digi-arm/conf/machine/ccimx93-dvk.conf @@ -16,6 +16,7 @@ UBOOT_DTB_NAME = "ccimx93-dvk.dtb" KERNEL_DEVICETREE ?= " \ digi/ccimx93-dvk.dtb \ + digi/_ov_board_dsi_display_ccimx93-dvk.dtbo \ digi/_ov_board_enet2_ccimx93-dvk.dtbo \ digi/_ov_board_lvds_ccimx93-dvk.dtbo \ digi/_ov_board_mikroe-accel2-click_ccimx93-dvk.dtbo \ From dc66ea2735dded688307ba463c6806dd4721f5ae Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Thu, 11 May 2023 11:24:34 +0200 Subject: [PATCH 098/100] Revert "run-postinsts: Set dependency for ldconfig to avoid boot issues" Same fix has been included upstream (poky). This reverts commit 30022f556bd706b3a5e5dfa876a5a8113302bbe6. Signed-off-by: Javier Viguera --- .../run-postinsts/run-postinsts_%.bbappend | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 meta-digi-dey/recipes-devtools/run-postinsts/run-postinsts_%.bbappend diff --git a/meta-digi-dey/recipes-devtools/run-postinsts/run-postinsts_%.bbappend b/meta-digi-dey/recipes-devtools/run-postinsts/run-postinsts_%.bbappend deleted file mode 100644 index 5c0ba6ecc..000000000 --- a/meta-digi-dey/recipes-devtools/run-postinsts/run-postinsts_%.bbappend +++ /dev/null @@ -1,7 +0,0 @@ -# Copyright (C) 2022 Digi International - -do_install:append() { - # Add ordering dependency between postinsts and ldconfig service - sed -i -e '/After=/ s/$/ ldconfig.service/' \ - ${D}${systemd_system_unitdir}/run-postinsts.service -} From c515187ed4cedcb26f6dd7239594896da4115abe Mon Sep 17 00:00:00 2001 From: Mike Engel Date: Wed, 8 Mar 2023 11:49:34 +0100 Subject: [PATCH 099/100] ccmp1: add secure console support Signed-off-by: Mike Engel --- meta-digi-arm/conf/machine/ccmp13-dvk.conf | 4 ++++ meta-digi-arm/conf/machine/ccmp15-dvk.conf | 4 ++++ meta-digi-arm/conf/machine/include/ccmp1.inc | 6 ++++++ meta-digi-dey/classes/trustfence.bbclass | 10 ++++++++-- 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/meta-digi-arm/conf/machine/ccmp13-dvk.conf b/meta-digi-arm/conf/machine/ccmp13-dvk.conf index 88370bb26..a968f92dc 100644 --- a/meta-digi-arm/conf/machine/ccmp13-dvk.conf +++ b/meta-digi-arm/conf/machine/ccmp13-dvk.conf @@ -159,3 +159,7 @@ BOOTABLE_ARTIFACTS = " \ arm-trusted-firmware/tf-a-ccmp13-dvk-nand.stm32 \ fip/fip-ccmp13-dvk-optee.bin \ " + +# TRUSTFENCE basic support +# Alternatively, uncommment to enable the console with the specified GPIO +# TRUSTFENCE_CONSOLE_GPIO_ENABLE_NAME ?= "GPIOB6" diff --git a/meta-digi-arm/conf/machine/ccmp15-dvk.conf b/meta-digi-arm/conf/machine/ccmp15-dvk.conf index 86b8ad1c7..c7cb3ffa6 100644 --- a/meta-digi-arm/conf/machine/ccmp15-dvk.conf +++ b/meta-digi-arm/conf/machine/ccmp15-dvk.conf @@ -172,3 +172,7 @@ BOOT_DEV_NAME ?= "linux" ROOTFS_DEV_NAME ?= "rootfs" ROOTFS_ENC_DEV = "${ROOTFS_DEV_NAME}" ROOTFS_DEV_NAME_FINAL = "${@oe.utils.ifelse(d.getVar('TRUSTFENCE_ENCRYPT_ROOTFS') == '1', '${ROOTFS_ENC_DEV}', '${ROOTFS_DEV_NAME}')}" + +# TRUSTFENCE basic support +# Alternatively, uncommment to enable the console with the specified GPIO +# TRUSTFENCE_CONSOLE_GPIO_ENABLE_NAME ?= "GPIOA5" diff --git a/meta-digi-arm/conf/machine/include/ccmp1.inc b/meta-digi-arm/conf/machine/include/ccmp1.inc index 38d8d4b09..7a96ef851 100644 --- a/meta-digi-arm/conf/machine/include/ccmp1.inc +++ b/meta-digi-arm/conf/machine/include/ccmp1.inc @@ -47,3 +47,9 @@ IMAGE_FSTYPES:remove = "ext4 tar.xz" # List of supported boot devices BOOTDEVICE_LABELS ?= "sdcard" + +# Default secure console configuration +TRUSTFENCE_CONSOLE_DISABLE ?= "0" + +# Alternatively, uncommment to enable the console autoboot stop passphrase +# TRUSTFENCE_CONSOLE_PASSPHRASE_ENABLE = "" diff --git a/meta-digi-dey/classes/trustfence.bbclass b/meta-digi-dey/classes/trustfence.bbclass index 7cce60c06..e67f2274e 100644 --- a/meta-digi-dey/classes/trustfence.bbclass +++ b/meta-digi-dey/classes/trustfence.bbclass @@ -47,9 +47,15 @@ python () { d.appendVar("UBOOT_TF_CONF", "CONFIG_CONSOLE_DISABLE=y ") if d.getVar("TRUSTFENCE_CONSOLE_PASSPHRASE_ENABLE"): passphrase_hash = hashlib.sha256(d.getVar("TRUSTFENCE_CONSOLE_PASSPHRASE_ENABLE").encode()).hexdigest() - d.appendVar("UBOOT_TF_CONF", 'CONFIG_CONSOLE_ENABLE_PASSPHRASE=y CONFIG_CONSOLE_ENABLE_PASSPHRASE_KEY="%s" ' % passphrase_hash) + if (d.getVar("DEY_SOC_VENDOR") == "NXP"): + d.appendVar("UBOOT_TF_CONF", 'CONFIG_CONSOLE_ENABLE_PASSPHRASE=y CONFIG_CONSOLE_ENABLE_PASSPHRASE_KEY="%s" ' % passphrase_hash) + elif (d.getVar("DEY_SOC_VENDOR") == "STM"): + d.appendVar("UBOOT_TF_CONF", 'CONFIG_AUTOBOOT_KEYED=y CONFIG_AUTOBOOT_ENCRYPTION=y CONFIG_AUTOBOOT_STOP_STR_ENABLE=y CONFIG_AUTOBOOT_STOP_STR_SHA256="%s" ' % passphrase_hash) elif d.getVar("TRUSTFENCE_CONSOLE_GPIO_ENABLE"): - d.appendVar("UBOOT_TF_CONF", "CONFIG_CONSOLE_ENABLE_GPIO=y CONFIG_CONSOLE_ENABLE_GPIO_NR=%s " % d.getVar("TRUSTFENCE_CONSOLE_GPIO_ENABLE")) + if (d.getVar("DEY_SOC_VENDOR") == "NXP"): + d.appendVar("UBOOT_TF_CONF", "CONFIG_CONSOLE_ENABLE_GPIO=y CONFIG_CONSOLE_ENABLE_GPIO_NR=%s " % d.getVar("TRUSTFENCE_CONSOLE_GPIO_ENABLE")) + elif (d.getVar("DEY_SOC_VENDOR") == "STM"): + d.appendVar("UBOOT_TF_CONF", "CONFIG_CONSOLE_ENABLE_GPIO=y CONFIG_CONSOLE_ENABLE_GPIO_NAME=%s " % d.getVar("TRUSTFENCE_CONSOLE_GPIO_ENABLE_NAME")) # Secure boot configuration if (d.getVar("TRUSTFENCE_SIGN_KEYS_PATH") == "default"): From 4265b804021f05c1e18d6baa727586fb8fd64b4d Mon Sep 17 00:00:00 2001 From: Mike Engel Date: Thu, 11 May 2023 10:12:54 +0200 Subject: [PATCH 100/100] swupdate: move sw-description configuration into common include file Signed-off-by: Mike Engel --- meta-digi-arm/conf/machine/ccmp15-dvk.conf | 9 --------- 1 file changed, 9 deletions(-) diff --git a/meta-digi-arm/conf/machine/ccmp15-dvk.conf b/meta-digi-arm/conf/machine/ccmp15-dvk.conf index c7cb3ffa6..145c857a3 100644 --- a/meta-digi-arm/conf/machine/ccmp15-dvk.conf +++ b/meta-digi-arm/conf/machine/ccmp15-dvk.conf @@ -164,15 +164,6 @@ BOOTABLE_ARTIFACTS = " \ fip/fip-ccmp15-dvk-optee.bin \ " -# SWUpdate sw-description configuration -BOOTFS_EXT ?= ".boot.ubifs" -ROOTFS_EXT ?= ".ubifs" - -BOOT_DEV_NAME ?= "linux" -ROOTFS_DEV_NAME ?= "rootfs" -ROOTFS_ENC_DEV = "${ROOTFS_DEV_NAME}" -ROOTFS_DEV_NAME_FINAL = "${@oe.utils.ifelse(d.getVar('TRUSTFENCE_ENCRYPT_ROOTFS') == '1', '${ROOTFS_ENC_DEV}', '${ROOTFS_DEV_NAME}')}" - # TRUSTFENCE basic support # Alternatively, uncommment to enable the console with the specified GPIO # TRUSTFENCE_CONSOLE_GPIO_ENABLE_NAME ?= "GPIOA5"