diff --git a/README.md b/README.md index beb1eeefa..bb471b700 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Digi Embedded Yocto (DEY) 4.0 -## Release 4.0-r4 +## Release 4.0-r5 This document provides information about Digi Embedded Yocto, Digi International's professional embedded Yocto development environment. diff --git a/meta-digi-arm/classes/image_types_digi.bbclass b/meta-digi-arm/classes/image_types_digi.bbclass index ca0c6f60a..db641ac69 100644 --- a/meta-digi-arm/classes/image_types_digi.bbclass +++ b/meta-digi-arm/classes/image_types_digi.bbclass @@ -21,15 +21,18 @@ do_image_boot_vfat[depends] += " \ IMAGE_CMD:boot.vfat() { BOOTIMG_FILES="$(readlink -e ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}.bin)" BOOTIMG_FILES_SYMLINK="${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}.bin" - if [ -n "${KERNEL_DEVICETREE}" ]; then - for DTB in ${KERNEL_DEVICETREE}; do - # Remove potential sub-folders - DTB="$(basename ${DTB})" - if [ -e "${DEPLOY_DIR_IMAGE}/${DTB}" ]; then - BOOTIMG_FILES="${BOOTIMG_FILES} $(readlink -e ${DEPLOY_DIR_IMAGE}/${DTB})" - BOOTIMG_FILES_SYMLINK="${BOOTIMG_FILES_SYMLINK} ${DEPLOY_DIR_IMAGE}/${DTB}" - fi - done + # Exclude DTB and DTBO from VFAT image when creating a FIT image + if [ "${TRUSTFENCE_FIT_IMG}" != "1" ]; then + if [ -n "${KERNEL_DEVICETREE}" ]; then + for DTB in ${KERNEL_DEVICETREE}; do + # Remove potential sub-folders + DTB="$(basename ${DTB})" + if [ -e "${DEPLOY_DIR_IMAGE}/${DTB}" ]; then + BOOTIMG_FILES="${BOOTIMG_FILES} $(readlink -e ${DEPLOY_DIR_IMAGE}/${DTB})" + BOOTIMG_FILES_SYMLINK="${BOOTIMG_FILES_SYMLINK} ${DEPLOY_DIR_IMAGE}/${DTB}" + fi + done + fi fi # Add Trustfence initramfs if enabled @@ -57,12 +60,15 @@ IMAGE_CMD:boot.vfat() { mkfs.vfat -n "Boot DEY" -S 512 -C ${IMGDEPLOYDIR}/${IMAGE_NAME}.boot.vfat ${BOOTIMG_BLOCKS} mcopy -i ${IMGDEPLOYDIR}/${IMAGE_NAME}.boot.vfat ${BOOTIMG_FILES_SYMLINK} ::/ - # Copy boot scripts into the VFAT image - for item in ${BOOT_SCRIPTS}; do - src=`echo $item | awk -F':' '{ print $1 }'` - dst=`echo $item | awk -F':' '{ print $2 }'` - mcopy -i ${IMGDEPLOYDIR}/${IMAGE_NAME}.boot.vfat -s ${DEPLOY_DIR_IMAGE}/$src ::/$dst - done + # Exclude boot scripts from VFAT image when creating a FIT image + if [ "${TRUSTFENCE_FIT_IMG}" != "1" ]; then + # Copy boot scripts into the VFAT image + for item in ${BOOT_SCRIPTS}; do + src=`echo $item | awk -F':' '{ print $1 }'` + dst=`echo $item | awk -F':' '{ print $2 }'` + mcopy -i ${IMGDEPLOYDIR}/${IMAGE_NAME}.boot.vfat -s ${DEPLOY_DIR_IMAGE}/$src ::/$dst + done + fi # Truncate the image to speed up the downloading/writing to the EMMC if [ -n "${BOARD_BOOTIMAGE_PARTITION_SIZE}" ]; then @@ -83,14 +89,17 @@ do_image_boot_ubifs[depends] += " \ IMAGE_CMD:boot.ubifs() { BOOTIMG_FILES_SYMLINK="${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}.bin" - if [ -n "${KERNEL_DEVICETREE}" ]; then - for DTB in ${KERNEL_DEVICETREE}; do - # Remove potential sub-folders - DTB="$(basename ${DTB})" - if [ -e "${DEPLOY_DIR_IMAGE}/${DTB}" ]; then - BOOTIMG_FILES_SYMLINK="${BOOTIMG_FILES_SYMLINK} ${DEPLOY_DIR_IMAGE}/${DTB}" - fi - done + # Exclude DTB and DTBO from UBIFS image when creating a FIT image + if [ "${TRUSTFENCE_FIT_IMG}" != "1" ]; then + if [ -n "${KERNEL_DEVICETREE}" ]; then + for DTB in ${KERNEL_DEVICETREE}; do + # Remove potential sub-folders + DTB="$(basename ${DTB})" + if [ -e "${DEPLOY_DIR_IMAGE}/${DTB}" ]; then + BOOTIMG_FILES_SYMLINK="${BOOTIMG_FILES_SYMLINK} ${DEPLOY_DIR_IMAGE}/${DTB}" + fi + done + fi fi # Add Trustfence initramfs if enabled @@ -107,12 +116,15 @@ IMAGE_CMD:boot.ubifs() { ln ${orig} ${TMP_BOOTDIR}/$(basename ${item}) done - # Hard-link boot scripts into the temporary folder - for item in ${BOOT_SCRIPTS}; do - src="$(echo ${item} | awk -F':' '{ print $1 }')" - dst="$(echo ${item} | awk -F':' '{ print $2 }')" - ln ${DEPLOY_DIR_IMAGE}/${src} ${TMP_BOOTDIR}/${dst} - done + # Exclude boot scripts from UBIFS image when creating a FIT image + if [ "${TRUSTFENCE_FIT_IMG}" != "1" ]; then + # Hard-link boot scripts into the temporary folder + for item in ${BOOT_SCRIPTS}; do + src="$(echo ${item} | awk -F':' '{ print $1 }')" + dst="$(echo ${item} | awk -F':' '{ print $2 }')" + ln ${DEPLOY_DIR_IMAGE}/${src} ${TMP_BOOTDIR}/${dst} + done + fi # Build UBIFS boot image out of temp folder mkfs.ubifs -r ${TMP_BOOTDIR} -o ${IMGDEPLOYDIR}/${IMAGE_NAME}.boot.ubifs ${MKUBIFS_BOOT_ARGS} @@ -135,8 +147,11 @@ IMAGE_CMD:recovery.vfat() { # Use 'boot.vfat' image as base cp --remove-destination ${IMGDEPLOYDIR}/${IMAGE_NAME}.boot.vfat ${IMGDEPLOYDIR}/${IMAGE_NAME}.recovery.vfat - # Copy the recovery initramfs into the VFAT image - mcopy -i ${IMGDEPLOYDIR}/${IMAGE_NAME}.recovery.vfat -s ${DEPLOY_DIR_IMAGE}/${RECOVERY_INITRAMFS_IMAGE}-${MACHINE}.cpio.gz.u-boot.tf ::/uramdisk-recovery.img + # Exclude initRAMFS from VFAT image when creating a FIT image + if [ "${TRUSTFENCE_FIT_IMG}" != "1" ]; then + # Copy the recovery initramfs into the VFAT image + mcopy -i ${IMGDEPLOYDIR}/${IMAGE_NAME}.recovery.vfat -s ${DEPLOY_DIR_IMAGE}/${RECOVERY_INITRAMFS_IMAGE}-${MACHINE}.cpio.gz.u-boot.tf ::/uramdisk-recovery.img + fi } # Remove the default ".rootfs." suffix for 'recovery.vfat' images @@ -153,14 +168,17 @@ do_image_recovery_ubifs[depends] += " \ IMAGE_CMD:recovery.ubifs() { RECOVERYIMG_FILES_SYMLINK="${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}.bin" - if [ -n "${KERNEL_DEVICETREE}" ]; then - for DTB in ${KERNEL_DEVICETREE}; do - # Remove potential sub-folders - DTB="$(basename ${DTB})" - if [ -e "${DEPLOY_DIR_IMAGE}/${DTB}" ]; then - RECOVERYIMG_FILES_SYMLINK="${RECOVERYIMG_FILES_SYMLINK} ${DEPLOY_DIR_IMAGE}/${DTB}" - fi - done + # Exclude DTB and DTBO from VFAT image when creating a FIT image + if [ "${TRUSTFENCE_FIT_IMG}" != "1" ]; then + if [ -n "${KERNEL_DEVICETREE}" ]; then + for DTB in ${KERNEL_DEVICETREE}; do + # Remove potential sub-folders + DTB="$(basename ${DTB})" + if [ -e "${DEPLOY_DIR_IMAGE}/${DTB}" ]; then + RECOVERYIMG_FILES_SYMLINK="${RECOVERYIMG_FILES_SYMLINK} ${DEPLOY_DIR_IMAGE}/${DTB}" + fi + done + fi fi # Create temporary folder @@ -172,18 +190,21 @@ IMAGE_CMD:recovery.ubifs() { ln ${orig} ${TMP_RECOVERYDIR}/$(basename ${item}) done - # Hard-link boot scripts into the temporary folder - for item in ${BOOT_SCRIPTS}; do - src="$(echo ${item} | awk -F':' '{ print $1 }')" - dst="$(echo ${item} | awk -F':' '{ print $2 }')" - ln ${DEPLOY_DIR_IMAGE}/${src} ${TMP_RECOVERYDIR}/${dst} - done + # Exclude bootscript from VFAT image when creating a FIT image + if [ "${TRUSTFENCE_FIT_IMG}" != "1" ]; then + # Hard-link boot scripts into the temporary folder + for item in ${BOOT_SCRIPTS}; do + src="$(echo ${item} | awk -F':' '{ print $1 }')" + dst="$(echo ${item} | awk -F':' '{ print $2 }')" + ln ${DEPLOY_DIR_IMAGE}/${src} ${TMP_RECOVERYDIR}/${dst} + done - # Copy the recovery initramfs into the temporary folder - cp ${DEPLOY_DIR_IMAGE}/${RECOVERY_INITRAMFS_IMAGE}-${MACHINE}.cpio.gz.u-boot.tf ${TMP_RECOVERYDIR}/uramdisk-recovery.img + # Copy the recovery initramfs into the temporary folder + cp ${DEPLOY_DIR_IMAGE}/${RECOVERY_INITRAMFS_IMAGE}-${MACHINE}.cpio.gz.u-boot.tf ${TMP_RECOVERYDIR}/uramdisk-recovery.img + fi # Build UBIFS recovery image out of temp folder - mkfs.ubifs -r ${TMP_RECOVERYDIR} -o ${IMGDEPLOYDIR}/${IMAGE_NAME}.recovery.ubifs ${MKUBIFS_BOOT_ARGS} + mkfs.ubifs -r ${TMP_RECOVERYDIR} -o ${IMGDEPLOYDIR}/${IMAGE_NAME}.recovery.ubifs ${MKUBIFS_RECOVERY_ARGS} # Remove the temporary folder rm -rf ${TMP_RECOVERYDIR} @@ -200,21 +221,13 @@ trustence_sign_cpio() { # Image generation code for image type 'cpio.gz.u-boot.tf' # (signed/encrypted ramdisk) # - if [ "${TRUSTFENCE_SIGN}" = "1" ]; then + if [ "${TRUSTFENCE_SIGN_ARTIFACTS}" = "1" ]; then # 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}" [ -n "${TRUSTFENCE_DEK_PATH}" ] && [ "${TRUSTFENCE_DEK_PATH}" != "0" ] && export CONFIG_DEK_PATH="${TRUSTFENCE_DEK_PATH}" - # Sign/encrypt the ramdisk - 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 + trustfence-sign-artifact.sh -p "${DIGI_SOM}" -i "${1}" "${1}.tf" else # Copy the image with no changes cp "${1}" "${1}.tf" @@ -228,22 +241,18 @@ IMAGE_TYPES += "cpio.gz.u-boot.tf" # # Sign read-only rootfs # -do_image_squashfs[postfuncs] += "${@oe.utils.conditional('TRUSTFENCE_SIGN', '1', 'rootfs_sign', '', d)}" - +do_image_squashfs[postfuncs] += "${@oe.utils.vartrue('TRUSTFENCE_SIGN_ARTIFACTS', 'rootfs_sign', '', d)}" rootfs_sign() { # Set environment variables for trustfence configuration export CONFIG_SIGN_KEYS_PATH="${TRUSTFENCE_SIGN_KEYS_PATH}" [ -n "${CONFIG_KEY_INDEX}" ] && export CONFIG_KEY_INDEX="${TRUSTFENCE_KEY_INDEX}" - if [ "${DEY_SOC_VENDOR}" = "NXP" ]; then - 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_SOM}" -r "${ROOTFS_IMAGE}" "${TMP_ROOTFS_IMAGE_SIGNED}" - mv "${TMP_ROOTFS_IMAGE_SIGNED}" "${ROOTFS_IMAGE}" - fi + 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_SOM}" -r "${ROOTFS_IMAGE}" "${TMP_ROOTFS_IMAGE_SIGNED}" + mv "${TMP_ROOTFS_IMAGE_SIGNED}" "${ROOTFS_IMAGE}" } - rootfs_sign[dirs] = "${DEPLOY_DIR_IMAGE}" do_image_squashfs[vardeps] += "TRUSTFENCE_SIGN_KEYS_PATH TRUSTFENCE_KEY_INDEX" diff --git a/meta-digi-arm/conf/layer.conf b/meta-digi-arm/conf/layer.conf index 78f9e516b..415dc41df 100644 --- a/meta-digi-arm/conf/layer.conf +++ b/meta-digi-arm/conf/layer.conf @@ -28,9 +28,13 @@ LAYERSERIES_COMPAT_digi-arm = "kirkstone" # See fsl-eula-unpack.bbclass. FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V42 = "ea25d099982d035af85d193c88a1b479" FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V45 = "63a38e9f392d8813d6f1f4d0d6fbe657" +FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V48 = "db4762b09b6bda63da103963e6e081de" +FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V49 = "2827219e81f28aba7c6a569f7c437fa7" FSL_EULA_FILE_MD5SUMS:append = " \ ${FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V42} \ ${FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V45} \ + ${FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V48} \ + ${FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V49} \ " # STM EULA @@ -43,6 +47,7 @@ BBMASK += " \ meta-st-stm32mp/recipes-core/base-files/base-files_%.bbappend \ meta-st-stm32mp/recipes-core/busybox/busybox_%.bbappend \ meta-st-stm32mp/recipes-core/systemd/systemd-conf_%.bbappend \ + meta-st-stm32mp/recipes-kernel/linux/linux-stm32mp_5.15.bb \ " # Tweak stm32mpu-ai dependencies to use ST's machine learning packages diff --git a/meta-digi-arm/conf/machine/ccimx6qpsbc.conf b/meta-digi-arm/conf/machine/ccimx6qpsbc.conf index 6e47aa6a3..d60abb183 100644 --- a/meta-digi-arm/conf/machine/ccimx6qpsbc.conf +++ b/meta-digi-arm/conf/machine/ccimx6qpsbc.conf @@ -26,8 +26,6 @@ UBOOT_CONFIG ??= "ccimx6qpsbc1GB ccimx6qpsbc2GB" UBOOT_CONFIG[ccimx6qpsbc1GB] = "ccimx6qpsbc1GB_defconfig,,u-boot-dtb.${UBOOT_SUFFIX}" UBOOT_CONFIG[ccimx6qpsbc2GB] = "ccimx6qpsbc2GB_defconfig,,u-boot-dtb.${UBOOT_SUFFIX}" -BOOTLOADER_SEEK_BOOT = "1" - KERNEL_DEVICETREE ?= " \ imx6qp-ccimx6qpsbc.dtb \ imx6qp-ccimx6qpsbc-id160.dtb \ @@ -59,4 +57,4 @@ BOOTABLE_ARTIFACTS = " \ # Default overlayfs_etc mount point and type OVERLAYFS_ETC_MOUNT_POINT ?= "/mnt/data" OVERLAYFS_ETC_DEVICE ?= "/dev/mmcblk0p7" -OVERLAYFS_ETC_FSTYPE ?= "ext4" \ No newline at end of file +OVERLAYFS_ETC_FSTYPE ?= "ext4" diff --git a/meta-digi-arm/conf/machine/ccimx6sbc.conf b/meta-digi-arm/conf/machine/ccimx6sbc.conf index b4cde1a4b..047e49770 100644 --- a/meta-digi-arm/conf/machine/ccimx6sbc.conf +++ b/meta-digi-arm/conf/machine/ccimx6sbc.conf @@ -24,8 +24,6 @@ UBOOT_CONFIG[ccimx6qsbc2GB] = "ccimx6qsbc2GB_defconfig,,u-boot-dtb.${UBOOT_SUFFI UBOOT_CONFIG[ccimx6qsbc512MB] = "ccimx6qsbc512MB_defconfig,,u-boot-dtb.${UBOOT_SUFFIX}" UBOOT_CONFIG[ccimx6qsbc] = "ccimx6qsbc_defconfig,,u-boot-dtb.${UBOOT_SUFFIX}" -BOOTLOADER_SEEK_BOOT = "1" - KERNEL_DEVICETREE ?= " \ imx6dl-ccimx6sbc.dtb \ imx6dl-ccimx6sbc-w.dtb \ @@ -64,4 +62,4 @@ BOOTABLE_ARTIFACTS = " \ # Default overlayfs_etc mount point and type OVERLAYFS_ETC_MOUNT_POINT ?= "/mnt/data" OVERLAYFS_ETC_DEVICE ?= "/dev/mmcblk0p7" -OVERLAYFS_ETC_FSTYPE ?= "ext4" \ No newline at end of file +OVERLAYFS_ETC_FSTYPE ?= "ext4" diff --git a/meta-digi-arm/conf/machine/ccimx8mm-dvk.conf b/meta-digi-arm/conf/machine/ccimx8mm-dvk.conf index 05af26d26..33d6cbff0 100644 --- a/meta-digi-arm/conf/machine/ccimx8mm-dvk.conf +++ b/meta-digi-arm/conf/machine/ccimx8mm-dvk.conf @@ -9,7 +9,7 @@ MACHINEOVERRIDES =. "mx8:mx8m:mx8mm:${DIGI_FAMILY}:${DIGI_SOM}:" include conf/machine/include/ccimx8m.inc BOOTLOADER_SEEK_USERDATA = "33" -BOOTLOADER_SEEK_BOOT = "0" +BOOTLOADER_SEEK_BOOTPART = "33" # U-Boot configurations # @@ -33,6 +33,7 @@ KERNEL_DEVICETREE ?= " \ digi/_ov_board_lvds_ccimx8m-dvk.dtbo \ digi/_ov_board_user-leds_ccimx8m-dvk.dtbo \ digi/_ov_som_bt_ccimx8m.dtbo \ + digi/_ov_som_cm4_ccimx8mm.dtbo \ digi/_ov_som_mca-keypad_ccimx8m.dtbo \ digi/_ov_som_wifi_ccimx8m.dtbo \ " @@ -58,4 +59,4 @@ BOOTABLE_ARTIFACTS = "imx-boot-ccimx8mm-dvk.bin" # Default overlayfs_etc mount point and type OVERLAYFS_ETC_MOUNT_POINT ?= "/mnt/data" OVERLAYFS_ETC_DEVICE ?= "/dev/mmcblk0p7" -OVERLAYFS_ETC_FSTYPE ?= "ext4" \ No newline at end of file +OVERLAYFS_ETC_FSTYPE ?= "ext4" diff --git a/meta-digi-arm/conf/machine/ccimx8mn-dvk.conf b/meta-digi-arm/conf/machine/ccimx8mn-dvk.conf index d6b0fbf53..8cadc00e3 100644 --- a/meta-digi-arm/conf/machine/ccimx8mn-dvk.conf +++ b/meta-digi-arm/conf/machine/ccimx8mn-dvk.conf @@ -9,7 +9,6 @@ MACHINEOVERRIDES =. "mx8:mx8m:mx8mn:${DIGI_FAMILY}:${DIGI_SOM}:" include conf/machine/include/ccimx8m.inc BOOTLOADER_SEEK_USERDATA = "32" -BOOTLOADER_SEEK_BOOT = "0" # U-Boot configurations # @@ -34,6 +33,7 @@ KERNEL_DEVICETREE ?= " \ digi/_ov_board_user-leds_ccimx8m-dvk.dtbo \ digi/_ov_board_v1-v2_ccimx8mn-dvk.dtbo \ digi/_ov_som_bt_ccimx8m.dtbo \ + digi/_ov_som_cm7_ccimx8mn.dtbo \ digi/_ov_som_mca-keypad_ccimx8m.dtbo \ digi/_ov_som_v1_ccimx8mn.dtbo \ digi/_ov_som_wifi_ccimx8m.dtbo \ @@ -60,4 +60,4 @@ BOOTABLE_ARTIFACTS = "imx-boot-ccimx8mn-dvk.bin" # Default overlayfs_etc mount point and type OVERLAYFS_ETC_MOUNT_POINT ?= "/mnt/data" OVERLAYFS_ETC_DEVICE ?= "/dev/mmcblk0p7" -OVERLAYFS_ETC_FSTYPE ?= "ext4" \ No newline at end of file +OVERLAYFS_ETC_FSTYPE ?= "ext4" diff --git a/meta-digi-arm/conf/machine/ccimx8x-sbc-pro.conf b/meta-digi-arm/conf/machine/ccimx8x-sbc-pro.conf index bb3db876b..62e1001b6 100644 --- a/meta-digi-arm/conf/machine/ccimx8x-sbc-pro.conf +++ b/meta-digi-arm/conf/machine/ccimx8x-sbc-pro.conf @@ -26,6 +26,7 @@ KERNEL_DEVICETREE ?= " \ digi/_ov_board_user-leds_ccimx8x-sbc-pro.dtbo \ digi/_ov_board_v1-v3_ccimx8x-sbc-pro.dtbo \ digi/_ov_som_bt_ccimx8x.dtbo \ + digi/_ov_som_cm4_ccimx8x.dtbo \ digi/_ov_som_mca-keypad_ccimx8x.dtbo \ digi/_ov_som_quad_ccimx8x.dtbo \ digi/_ov_som_wifi_ccimx8x.dtbo \ diff --git a/meta-digi-arm/conf/machine/ccimx93-dvk.conf b/meta-digi-arm/conf/machine/ccimx93-dvk.conf index 30f5ba12c..96f2160a2 100644 --- a/meta-digi-arm/conf/machine/ccimx93-dvk.conf +++ b/meta-digi-arm/conf/machine/ccimx93-dvk.conf @@ -13,7 +13,6 @@ UBOOT_CONFIG[ccimx93-dvk] = "ccimx93-dvk_defconfig" UBOOT_DTB_NAME = "ccimx93-dvk.dtb" BOOTLOADER_SEEK_USERDATA = "32" -BOOTLOADER_SEEK_BOOT = "0" KERNEL_DEVICETREE ?= " \ digi/ccimx93-dvk.dtb \ @@ -23,7 +22,6 @@ KERNEL_DEVICETREE ?= " \ 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_npu_ccimx93.dtbo \ digi/_ov_som_wifi_ccimx93.dtbo \ " @@ -55,7 +53,10 @@ IMAGE_FSTYPES ?= '${@bb.utils.contains("IMAGE_FEATURES", "read-only-rootfs", \ "boot.vfat recovery.vfat ext4.gz tar.bz2 sdcard.gz", d)}' # Boot artifacts to be copied from the deploy dir to the installer ZIP -BOOTABLE_ARTIFACTS = "imx-boot-ccimx93-dvk.bin" +BOOTABLE_ARTIFACTS = " \ + imx-boot-ccimx93-dvk.bin \ + imx-boot-ccimx93-dvk-A0.bin \ +" # Default overlayfs_etc mount point and type OVERLAYFS_ETC_MOUNT_POINT ?= "/mnt/data" diff --git a/meta-digi-arm/conf/machine/ccmp13-dvk.conf b/meta-digi-arm/conf/machine/ccmp13-dvk.conf index ffe3de0fa..a9ae07f8d 100644 --- a/meta-digi-arm/conf/machine/ccmp13-dvk.conf +++ b/meta-digi-arm/conf/machine/ccmp13-dvk.conf @@ -43,10 +43,13 @@ STM32MP_KERNEL_DEVICETREE:ccmp13-dvk += " \ _ov_board_mikroe-gyro-click_ccmp13-dvk.dtbo \ _ov_board_mikroe-i2c-to-spi-click_ccmp13-dvk.dtbo \ _ov_board_pwm8_ccmp13-dvk.dtbo \ + _ov_board_v2_ccmp13-dvk.dtbo \ _ov_som_bt_ccmp13.dtbo \ _ov_som_bt_test_ccmp13.dtbo \ _ov_som_wifi_ccmp13.dtbo \ " +# Set DTB load address to U-Boot fdt_addr_r +UBOOT_DTB_LOADADDRESS = "${@bb.utils.contains('TRUSTFENCE_FIT_IMG', '1', '0xc4000000', '', d)}" # ========================================================================= # Machine features @@ -106,11 +109,10 @@ OPTEE_CONF = "ccmp13-dvk" # ========================================================================= # Kernel # ========================================================================= -KERNEL_IMAGETYPE = "zImage" -KERNEL_ALT_IMAGETYPE = "Image uImage vmlinux" -KERNEL_DEFCONFIG ?= "ccmp1_defconfig" -KERNEL_EXTERNAL_DEFCONFIG ?= "defconfig" -ST_KERNEL_LOADADDR ?= "0xC0008000" +KERNEL_IMAGETYPE = "${@bb.utils.contains('TRUSTFENCE_FIT_IMG', '1', 'fitImage', 'zImage', d)}" +KERNEL_CLASSES = "${@bb.utils.contains('TRUSTFENCE_FIT_IMG', '1', 'kernel-fitimage', 'kernel-uimage', d)}" +KERNEL_ALT_IMAGETYPE = "Image vmlinux" +KERNEL_DEFCONFIG ?= "arch/arm/configs/ccmp1_defconfig" # ========================================================================= # DEY settings @@ -121,6 +123,10 @@ IMAGE_CLASSES = "image_types_digi image_types-stubi" # Max LEB count (-c 255) calculated for a partition of up to 32 MiB considering 128 KiB erase-block size. MKUBIFS_BOOT_ARGS ?= "-m 2048 -e 126976 -c 255" +# mkfs.ubifs parameters for recovery partition +# Same parameters as the boot partition, but using zlib compression to reduce image size. +MKUBIFS_RECOVERY_ARGS ?= "${MKUBIFS_BOOT_ARGS} -x zlib" + # mkfs.ubifs parameters for rootfs partition # Max LEB count (-c 8191) calculated for a partition of up to 1 GiB considering 128 KiB erase-block size. MKUBIFS_ARGS ?= "-m 2048 -e 126976 -c 8191" diff --git a/meta-digi-arm/conf/machine/ccmp15-dvk.conf b/meta-digi-arm/conf/machine/ccmp15-dvk.conf index bf45951ff..a4bf1d40b 100644 --- a/meta-digi-arm/conf/machine/ccmp15-dvk.conf +++ b/meta-digi-arm/conf/machine/ccmp15-dvk.conf @@ -49,11 +49,14 @@ STM32MP_KERNEL_DEVICETREE:ccmp15-dvk += " \ _ov_board_mikroe-gyro-click_ccmp15-dvk.dtbo \ _ov_board_mikroe-i2c-to-spi-click_ccmp15-dvk.dtbo \ _ov_board_v1_ccmp15-dvk.dtbo \ + _ov_board_v2_ccmp15-dvk.dtbo \ _ov_som_bt_ccmp15.dtbo \ _ov_som_bt_test_ccmp15.dtbo \ - _ov_som_mca_ccmp15.dtbo \ + _ov_som_m4_ccmp15.dtbo \ _ov_som_wifi_ccmp15.dtbo \ " +# Set DTB load address to U-Boot fdt_addr_r +UBOOT_DTB_LOADADDRESS = "${@bb.utils.contains('TRUSTFENCE_FIT_IMG', '1', '0xc4000000', '', d)}" # ========================================================================= # Machine features @@ -114,11 +117,10 @@ OPTEE_CONF = "ccmp15-dvk" # ========================================================================= # Kernel # ========================================================================= -KERNEL_IMAGETYPE = "zImage" -KERNEL_ALT_IMAGETYPE = "Image uImage vmlinux" -KERNEL_DEFCONFIG ?= "ccmp1_defconfig" -KERNEL_EXTERNAL_DEFCONFIG ?= "defconfig" -ST_KERNEL_LOADADDR ?= "0xC0008000" +KERNEL_IMAGETYPE = "${@bb.utils.contains('TRUSTFENCE_FIT_IMG', '1', 'fitImage', 'zImage', d)}" +KERNEL_CLASSES = "${@bb.utils.contains('TRUSTFENCE_FIT_IMG', '1', 'kernel-fitimage', 'kernel-uimage', d)}" +KERNEL_ALT_IMAGETYPE = "Image vmlinux" +KERNEL_DEFCONFIG ?= "arch/arm/configs/ccmp1_defconfig" # ========================================================================= # DEY settings @@ -129,6 +131,10 @@ IMAGE_CLASSES = "image_types_digi image_types-stubi" # Max LEB count (-c 255) calculated for a partition of up to 32 MiB considering 128 KiB erase-block size. MKUBIFS_BOOT_ARGS ?= "-m 2048 -e 126976 -c 255" +# mkfs.ubifs parameters for recovery partition +# Same parameters as the boot partition, but using zlib compression to reduce image size. +MKUBIFS_RECOVERY_ARGS ?= "${MKUBIFS_BOOT_ARGS} -x zlib" + # mkfs.ubifs parameters for rootfs partition # Max LEB count (-c 8191) calculated for a partition of up to 1 GiB considering 128 KiB erase-block size. MKUBIFS_ARGS ?= "-m 2048 -e 126976 -c 8191" diff --git a/meta-digi-arm/conf/machine/include/ccimx6.inc b/meta-digi-arm/conf/machine/include/ccimx6.inc index f90064980..4f5161631 100644 --- a/meta-digi-arm/conf/machine/include/ccimx6.inc +++ b/meta-digi-arm/conf/machine/include/ccimx6.inc @@ -8,6 +8,8 @@ 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 +BOOTLOADER_SEEK_BOOTPART = "1" + # Platform u-boot settings UBOOT_PREFIX = "u-boot" UBOOT_SUFFIX = "imx" diff --git a/meta-digi-arm/conf/machine/include/ccimx6ul.inc b/meta-digi-arm/conf/machine/include/ccimx6ul.inc index 1065b5fb7..f0e66256b 100644 --- a/meta-digi-arm/conf/machine/include/ccimx6ul.inc +++ b/meta-digi-arm/conf/machine/include/ccimx6ul.inc @@ -41,6 +41,10 @@ MACHINE_FEATURES:remove:use-mainline-bsp = "wifi" # Max LEB count (-c 255) calculated for a partition of up to 32 MiB considering 128 KiB erase-block size. MKUBIFS_BOOT_ARGS ?= "-m 2048 -e 126976 -c 255" +# mkfs.ubifs parameters for recovery partition +# Same parameters as the boot partition, but using zlib compression to reduce image size. +MKUBIFS_RECOVERY_ARGS ?= "${MKUBIFS_BOOT_ARGS} -x zlib" + # mkfs.ubifs parameters for rootfs partition # Max LEB count (-c 8191) calculated for a partition of up to 1 GiB considering 128 KiB erase-block size. MKUBIFS_ARGS ?= "-m 2048 -e 126976 -c 8191" @@ -69,3 +73,7 @@ UBOOT_ENV_SIZE ?= "0x20000" # the U-Boot environment can take up (if undefined, it will take up all the # available space in the environment partition) UBOOT_ENV_RANGE ?= "" + +# Partitions to blacklist for swupdate: +# bootloader, environment, safe +SWUPDATE_MTD_BLACKLIST = "0 1 2" diff --git a/meta-digi-arm/conf/machine/include/ccimx8x.inc b/meta-digi-arm/conf/machine/include/ccimx8x.inc index 000cc3834..36f9c1bfb 100644 --- a/meta-digi-arm/conf/machine/include/ccimx8x.inc +++ b/meta-digi-arm/conf/machine/include/ccimx8x.inc @@ -18,8 +18,6 @@ EXTRA_IMAGEDEPENDS += "imx-boot" BOOTLOADER_IMAGE_RECIPE = "imx-boot" # BOOTLOADER_SEEK_USERDATA is 33 for step A of the silicon and 32 for step B BOOTLOADER_SEEK_USERDATA = "32" -# BOOTLOADER_SEEK_BOOT is 32 for step B of silicon and 0 for step C -BOOTLOADER_SEEK_BOOT ?= "0" BOOTABLE_FILENAME = "${UBOOT_PREFIX}-${MACHINE}.bin" SDIMG_BOOTLOADER = "${DEPLOY_DIR_IMAGE}/${BOOTABLE_FILENAME}" diff --git a/meta-digi-arm/conf/machine/include/ccimx93.inc b/meta-digi-arm/conf/machine/include/ccimx93.inc index 743645367..60193819f 100644 --- a/meta-digi-arm/conf/machine/include/ccimx93.inc +++ b/meta-digi-arm/conf/machine/include/ccimx93.inc @@ -17,6 +17,10 @@ BOOTLOADER_IMAGE_RECIPE = "imx-boot" BOOTABLE_FILENAME = "${UBOOT_PREFIX}-${MACHINE}.bin" SDIMG_BOOTLOADER = "${DEPLOY_DIR_IMAGE}/${BOOTABLE_FILENAME}" +# Generate images for all SOC revisions (keep the override as otherwise the +# one in "use-imx-security-controller-firmware.bbclass" takes precedence) +SECO_FIRMWARE_NAME:ccimx93 = "mx93??-ahab-container.img" + DDR_FIRMWARE_NAME = " \ lpddr4_dmem_1d_v202201.bin \ lpddr4_dmem_2d_v202201.bin \ @@ -48,7 +52,7 @@ MACHINE_EXTRA_RDEPENDS += " \ # TrustFence TRUSTFENCE_SIGN_MODE = "AHAB" -IMXBOOT_TARGETS = "flash_singleboot" +IMXBOOT_TARGETS = "flash_singleboot flash_singleboot_a0" IMX_BOOT_SOC_TARGET = "iMX9" IMX_BOOT_SEEK = "32" @@ -72,3 +76,17 @@ BOOT_DEV_NAME ?= "/dev/mmcblk0p1" ROOTFS_DEV_NAME ?= "/dev/mmcblk0p3" ROOTFS_ENC_DEV = "/dev/mapper/cryptrootfs" ROOTFS_DEV_NAME_FINAL = "${@oe.utils.ifelse(d.getVar('TRUSTFENCE_ENCRYPT_ROOTFS') == '1', '${ROOTFS_ENC_DEV}', '${ROOTFS_DEV_NAME}')}" + +PREFERRED_VERSION_gstreamer1.0:ccimx93 ?= "1.22.5.imx" +PREFERRED_VERSION_gstreamer1.0-plugins-bad:ccimx93 ?= "1.22.5.imx" +PREFERRED_VERSION_gstreamer1.0-plugins-base:ccimx93 ?= "1.22.5.imx" +PREFERRED_VERSION_gstreamer1.0-plugins-good:ccimx93 ?= "1.22.5.imx" +PREFERRED_VERSION_gstreamer1.0-plugins-ugly:ccimx93 ?= "1.22.6" + +PREFERRED_VERSION_libdrm:ccimx93 ?= "2.4.115.imx" +PREFERRED_VERSION_nativesdk-wayland:ccimx93 ?= "1.22.0.imx" +PREFERRED_VERSION_wayland:ccimx93 ?= "1.22.0.imx" +PREFERRED_VERSION_wayland-native:ccimx93 ?= "1.22.0.imx" +PREFERRED_VERSION_wayland-protocols:ccimx93 ?= "1.32.imx" +PREFERRED_VERSION_weston:ccimx93 ?= "11.0.3.imx" +PREFERRED_VERSION_xwayland:ccimx93 ?= "23.1.1.imx" diff --git a/meta-digi-arm/conf/machine/include/ccmp1.inc b/meta-digi-arm/conf/machine/include/ccmp1.inc index fd74a2ad8..89a433978 100644 --- a/meta-digi-arm/conf/machine/include/ccmp1.inc +++ b/meta-digi-arm/conf/machine/include/ccmp1.inc @@ -8,11 +8,15 @@ include conf/machine/include/digi-defaults.inc DIGI_FAMILY = "ccmp1" +# Platform T-FA settings +TFA_SIGN_SUFFIX ?= "${@bb.utils.contains('TRUSTFENCE_SIGN', '1', '_signed', '', d)}" + # Platform u-boot settings -UBOOT_PREFIX = "u-boot" +UBOOT_PREFIX = "fip" UBOOT_SUFFIX = "bin" # Set U-Boot FIP settings FIP_UBOOT_DTB = "u-boot" +FIP_SIGN_SUFFIX ?= "${@bb.utils.contains('TRUSTFENCE_SIGN', '1', '_Signed', '', d)}" STORAGE_MEDIA = "mtd" @@ -41,6 +45,7 @@ UBOOT_ENV_RANGE ?= "" MACHINE_EXTRA_RDEPENDS += " \ mtd-utils-ubifs \ " +MACHINE_EXTRA_RRECOMMENDS:remove = "kernel-imagebootfs" # Image FS types IMAGE_FSTYPES:remove = "ext4 tar.xz" @@ -72,3 +77,10 @@ TRUSTFENCE_CONSOLE_DISABLE ?= "0" # Disable the generation of flashlayout files do_create_flashlayout_config[noexec] = "1" + +# Include boot script into the FIT image +UBOOT_ENV = "${@bb.utils.contains('TRUSTFENCE_FIT_IMG', '1', 'boot', '', d)}" + +# Partitions to blacklist for swupdate: +# fsbl1, fsbl2, metadata1, metadata2, fip-a, fip-b +SWUPDATE_MTD_BLACKLIST = "0 1 2 3 4 5" diff --git a/meta-digi-arm/conf/machine/include/digi-defaults.inc b/meta-digi-arm/conf/machine/include/digi-defaults.inc index 8abd7f5c5..1aa4cc4e8 100644 --- a/meta-digi-arm/conf/machine/include/digi-defaults.inc +++ b/meta-digi-arm/conf/machine/include/digi-defaults.inc @@ -78,7 +78,7 @@ MACHINE_EXTRA_RRECOMMENDS += "${@bb.utils.contains_any('VIRTUAL-RUNTIME_dev_mana DEFAULT_IMAGE_NAME ??= "dey-image-qt" # List of graphical images names (for install scripts) -GRAPHICAL_IMAGES ?= "dey-image-crank dey-image-qt dey-image-webkit" +GRAPHICAL_IMAGES ?= "dey-image-crank dey-image-qt dey-image-webkit dey-image-lvgl" # Include DEY SELinux policy modifications by default DEY_SELINUX_POLICY ?= "1" @@ -89,6 +89,10 @@ BOOT_SCRIPTS += "boot.scr:boot.scr" # This can be used to enable U-Boot update through swupdate SWUPDATE_UBOOTIMG ?= "false" +SWUPDATE_UBOOTIMG_REDUNDANT ?= "false" # ConnectCore Cloud Services packages to install CCCS_PKGS ?= "cccs-gs-demo dey-examples-cccs" + +# Default 1k-bloks seek in boot partition. +BOOTLOADER_SEEK_BOOTPART ?= "0" 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 55eb59536..d04222f3c 100644 --- a/meta-digi-arm/conf/machine/include/imx-digi-base.inc +++ b/meta-digi-arm/conf/machine/include/imx-digi-base.inc @@ -188,7 +188,7 @@ IMX_EXTRA_FIRMWARE ?= "" IMX_EXTRA_FIRMWARE:mx8-generic-bsp = "firmware-imx-8 imx-sc-firmware imx-seco" IMX_EXTRA_FIRMWARE:mx8m-generic-bsp = "firmware-imx-8m" IMX_EXTRA_FIRMWARE:mx8x-generic-bsp = "imx-sc-firmware imx-seco" -IMX_EXTRA_FIRMWARE:mx93-generic-bsp = "firmware-imx-9 firmware-sentinel" +IMX_EXTRA_FIRMWARE:mx93-generic-bsp = "imx-boot-firmware-files firmware-ele-imx" # Firmware MACHINE_FIRMWARE ?= "" @@ -272,27 +272,29 @@ PREFERRED_VERSION_vulkan-tools:imxvulkan ??= "1.2.182.0" # Use i.MX optee Version PREFERRED_VERSION_optee-os:mx8-nxp-bsp ??= "3.19.0.imx" -PREFERRED_VERSION_optee-os:mx9-nxp-bsp ??= "3.21.0.imx" +PREFERRED_VERSION_optee-os:mx9-nxp-bsp ??= "4.0.0.imx" PREFERRED_VERSION_optee-client:mx8-nxp-bsp ??= "3.19.0.imx" -PREFERRED_VERSION_optee-client:mx9-nxp-bsp ??= "3.21.0.imx" +PREFERRED_VERSION_optee-client:mx9-nxp-bsp ??= "4.0.0.imx" PREFERRED_VERSION_optee-test:mx8-nxp-bsp ??= "3.19.0.imx" -PREFERRED_VERSION_optee-test:mx9-nxp-bsp ??= "3.21.0.imx" +PREFERRED_VERSION_optee-test:mx9-nxp-bsp ??= "4.0.0.imx" -# Machine learning backports from NXP's lf-6.1.1_1.0.0 release -PREFERRED_VERSION_deepview-rt:ccimx93 = "2.4.46.1-aarch64" -PREFERRED_VERSION_ethos-u-vela:ccimx93 = "3.6.0" +# Machine learning backports from NXP's lf-6.1.55-2.2.0 release +PREFERRED_VERSION_ethos-u-driver-stack:ccimx93 = "23.08" +PREFERRED_VERSION_ethos-u-firmware:ccimx93 = "23.08" +PREFERRED_VERSION_ethos-u-vela:ccimx93 = "3.9.0" PREFERRED_VERSION_flatbuffers:ccimx93 = "2.0.7" PREFERRED_VERSION_flatbuffers-native:ccimx93 = "2.0.7" -PREFERRED_VERSION_tensorflow-lite:ccimx93 = "2.10.0" -PREFERRED_VERSION_tensorflow-lite-host-tools:ccimx93 = "2.10.0" -PREFERRED_VERSION_tensorflow-lite-host-tools-native:ccimx93 = "2.10.0" +PREFERRED_VERSION_onnxruntime:ccimx93 = "1.16.1" +PREFERRED_VERSION_tensorflow-lite:ccimx93 = "2.12.1" +PREFERRED_VERSION_tensorflow-lite-host-tools:ccimx93 = "2.12.1" +PREFERRED_VERSION_tensorflow-lite-host-tools-native:ccimx93 = "2.12.1" # Optee runtime packages to install OPTEE_PKGS ??= "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" +PREFERRED_VERSION_opencv:mx9-nxp-bsp ??= "4.7.0.imx" EXTRA_IMAGEDEPENDS += "u-boot" diff --git a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/firmware-sentinel/firmware-sentinel_0.10.bb b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/firmware-imx/firmware-ele-imx_0.1.0.bb similarity index 68% rename from meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/firmware-sentinel/firmware-sentinel_0.10.bb rename to meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/firmware-imx/firmware-ele-imx_0.1.0.bb index 7a71ee87b..52beb9e36 100644 --- a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/firmware-sentinel/firmware-sentinel_0.10.bb +++ b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/firmware-imx/firmware-ele-imx_0.1.0.bb @@ -1,15 +1,15 @@ # Copyright 2021-2023 NXP -SUMMARY = "NXP i.MX Sentinel firmware" -DESCRIPTION = "Firmware for i.MX Sentinel Security Controller" +SUMMARY = "NXP i.MX ELE firmware" +DESCRIPTION = "EdgeLock Enclave firmware for i.MX series SoCs" SECTION = "base" LICENSE = "Proprietary" -LIC_FILES_CHKSUM = "file://COPYING;md5=63a38e9f392d8813d6f1f4d0d6fbe657" +LIC_FILES_CHKSUM = "file://COPYING;md5=2827219e81f28aba7c6a569f7c437fa7" inherit fsl-eula-unpack use-imx-security-controller-firmware deploy SRC_URI = "${FSL_MIRROR}/${BP}.bin;fsl-eula=true" -SRC_URI[md5sum] = "a92e272d665a3b3bb9281253d5eca69f" -SRC_URI[sha256sum] = "be862b62c849510cce08ec24c1ddf53d826458e326e5a7f09c4b35092d6f9950" +SRC_URI[md5sum] = "7532c2e356574c1c9255c01169d38427" +SRC_URI[sha256sum] = "4a0440168d8dfb95989a17be8fafb149589e110e7d4518e5e8a33463dfb5e5ca" do_compile[noexec] = "1" diff --git a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/firmware-imx/firmware-nxp-wifi/ccimx93/sd_w61x_v1.bin.se b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/firmware-imx/firmware-nxp-wifi/ccimx93/sd_w61x_v1.bin.se deleted file mode 100644 index 4416129c8..000000000 Binary files a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/firmware-imx/firmware-nxp-wifi/ccimx93/sd_w61x_v1.bin.se and /dev/null differ diff --git a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/firmware-imx/firmware-nxp-wifi/ccimx93/uartspi_n61x_v1.bin.se b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/firmware-imx/firmware-nxp-wifi/ccimx93/uartspi_n61x_v1.bin.se deleted file mode 100644 index 89d030f6b..000000000 Binary files a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/firmware-imx/firmware-nxp-wifi/ccimx93/uartspi_n61x_v1.bin.se and /dev/null differ 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 index 38b5cd8f5..ec08272f9 100644 --- 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 @@ -1,26 +1,19 @@ # Copyright (C) 2023 Digi International. -FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}:" +LIC_FILES_CHKSUM:ccimx93 = "file://LICENSE.txt;md5=2827219e81f28aba7c6a569f7c437fa7" -LIC_FILES_CHKSUM:ccimx93 = "file://EULA.txt;md5=add2d392714d3096ed7e0f7e2190724b" - -SRCBRANCH:ccimx93 = "lf-6.1.1_1.0.0" -SRCREV:ccimx93 = "bacbeb4789c1b13d13aab12ada29217ce8c3e905" - -# Use this temporal binary till it is released -SRC_URI:append:ccimx93 = " \ - file://sd_w61x_v1.bin.se \ - file://uartspi_n61x_v1.bin.se \ -" +SRCBRANCH:ccimx93 = "lf-6.1.55_2.2.0" +SRCREV:ccimx93 = "7be5a936ce8677962dd7b41c6c9f41dd14350bec" do_install:append:ccimx93() { - install -m 444 ${WORKDIR}/sd_w61x_v1.bin.se ${D}${base_libdir}/firmware/nxp - install -m 444 ${WORKDIR}/uartspi_n61x_v1.bin.se ${D}${base_libdir}/firmware/nxp + # Install NXP Connectivity IW612 firmware + install -m 0644 nxp/FwImage_IW612_SD/sd_w61x_v1.bin.se ${D}${nonarch_base_libdir}/firmware/nxp + install -m 0644 nxp/FwImage_IW612_SD/uartspi_n61x_v1.bin.se ${D}${nonarch_base_libdir}/firmware/nxp } PACKAGES:prepend:ccimx93 = "${PN}-nxpiw612 " FILES:${PN}-nxpiw612 = " \ - ${base_libdir}/firmware/nxp/sd_w61x_v1.bin.se \ - ${base_libdir}/firmware/nxp/uartspi_n61x_v1.bin.se \ + ${nonarch_base_libdir}/firmware/nxp/sd_w61x_v1.bin.se \ + ${nonarch_base_libdir}/firmware/nxp/uartspi_n61x_v1.bin.se \ " diff --git a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/firmware-imx/firmware-imx-9_8.20.bb b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/firmware-imx/imx-boot-firmware-files_8.22.bb similarity index 73% rename from meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/firmware-imx/firmware-imx-9_8.20.bb rename to meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/firmware-imx/imx-boot-firmware-files_8.22.bb index 5a96865d9..177bbe245 100644 --- a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/firmware-imx/firmware-imx-9_8.20.bb +++ b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/firmware-imx/imx-boot-firmware-files_8.22.bb @@ -9,11 +9,11 @@ DESCRIPTION = "Freescale i.MX firmware for i.MX 9 family" # require recipes-bsp/firmware-imx/firmware-imx-${PV}.inc require recipes-bsp/firmware-imx/firmware-imx-8.18.inc -LIC_FILES_CHKSUM = "file://COPYING;md5=63a38e9f392d8813d6f1f4d0d6fbe657" -SRC_URI[md5sum] = "25c50f3371450b2324401ee06ff1bf6a" -SRC_URI[sha256sum] = "f6dc6a5c8fd9b913a15360d3ccd53d188db05a08a8594c518e57622478c72383" +LIC_FILES_CHKSUM = "file://COPYING;md5=2827219e81f28aba7c6a569f7c437fa7" +SRC_URI[md5sum] = "c5cf3842569f0a7fd990fbc64979e84f" +SRC_URI[sha256sum] = "94c8bceac56ec503c232e614f77d6bbd8e17c7daa71d4e651ea8fd5034c30350" -inherit deploy +inherit deploy nopackages do_install[noexec] = "1" diff --git a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/imx-atf/imx-atf/0005-ccimx93-use-UART6-for-the-default-console.patch b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/imx-atf/imx-atf/0001-ccimx93-use-UART6-for-the-default-console.patch similarity index 88% rename from meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/imx-atf/imx-atf/0005-ccimx93-use-UART6-for-the-default-console.patch rename to meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/imx-atf/imx-atf/0001-ccimx93-use-UART6-for-the-default-console.patch index 49e60da78..fbbeb82ae 100644 --- a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/imx-atf/imx-atf/0005-ccimx93-use-UART6-for-the-default-console.patch +++ b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/imx-atf/imx-atf/0001-ccimx93-use-UART6-for-the-default-console.patch @@ -8,11 +8,11 @@ Signed-off-by: Javier Viguera 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plat/imx/imx93/include/platform_def.h b/plat/imx/imx93/include/platform_def.h -index 59ce1c267568..c4855d7f5e82 100644 +index 9bbee908fe80..8eba2f6d917a 100644 --- a/plat/imx/imx93/include/platform_def.h +++ b/plat/imx/imx93/include/platform_def.h -@@ -53,7 +53,7 @@ - #define MAX_MMAP_REGIONS 16 +@@ -61,7 +61,7 @@ + #define MAX_MMAP_REGIONS 17 #endif -#define IMX_LPUART_BASE 0x44380000 diff --git a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/imx-atf/imx-atf/0002-imx93-bring-back-ELE-clock-workaround-for-soc-revisi.patch b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/imx-atf/imx-atf/0002-imx93-bring-back-ELE-clock-workaround-for-soc-revisi.patch new file mode 100644 index 000000000..31d1aa891 --- /dev/null +++ b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/imx-atf/imx-atf/0002-imx93-bring-back-ELE-clock-workaround-for-soc-revisi.patch @@ -0,0 +1,53 @@ +From: Javier Viguera +Date: Tue, 31 Oct 2023 11:25:46 +0100 +Subject: [PATCH] imx93: bring back ELE clock workaround for soc revision A0 + +Revert commit 7411561db535a20f61ff6621fec5b374130d34f9 to allow building +for soc revision A0 using a compilation flag. + +Signed-off-by: Javier Viguera +--- + plat/imx/imx93/imx93_psci.c | 10 ++++++++++ + plat/imx/imx93/platform.mk | 4 ++++ + 2 files changed, 14 insertions(+) + +diff --git a/plat/imx/imx93/imx93_psci.c b/plat/imx/imx93/imx93_psci.c +index 6a21ee970079..b9c4e0a1752b 100644 +--- a/plat/imx/imx93/imx93_psci.c ++++ b/plat/imx/imx93/imx93_psci.c +@@ -794,6 +794,11 @@ void imx_pwr_domain_suspend(const psci_power_state_t *target_state) + } else { + write_clusterpwrdn(DSU_CLUSTER_PWR_OFF); + } ++ ++#ifdef SOC_REV_A0 ++ /* FIXME: slow down S401 clock: 24M OSC */ ++ mmio_clrbits_32(0x44450200, GENMASK_32(9, 8)); ++#endif + } + + if (is_local_state_retn(SYSTEM_PWR_STATE(target_state))) { +@@ -924,6 +929,11 @@ void imx_pwr_domain_suspend_finish(const psci_power_state_t *target_state) + mmio_write_32(IMX_GPC_BASE + A55C0_CMC_OFFSET + 0x800 * 2 + CM_MODE_CTRL, CM_MODE_RUN); + /* clear L3 retention */ + mmio_clrbits_32(IMX_SRC_BASE + A55C0_MEM + 0x400 * 3 + 0x4, MEM_LP_RETENTION); ++ ++#ifdef SOC_REV_A0 ++ /* FIXME: set S401 clock back */ ++ mmio_setbits_32(0x44450200, BIT(9)); ++#endif + } + /* do core level */ + if (is_local_state_off(CORE_PWR_STATE(target_state))) { +diff --git a/plat/imx/imx93/platform.mk b/plat/imx/imx93/platform.mk +index be09b9f0be7a..440c13c1dbe1 100644 +--- a/plat/imx/imx93/platform.mk ++++ b/plat/imx/imx93/platform.mk +@@ -57,3 +57,7 @@ BL32_BASE ?= 0x96000000 + BL32_SIZE ?= 0x02000000 + $(eval $(call add_define,BL32_BASE)) + $(eval $(call add_define,BL32_SIZE)) ++ ++ifeq (${SOC_REV_A0},1) ++$(eval $(call add_define,SOC_REV_A0)) ++endif diff --git a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/imx-atf/imx-atf_%.bbappend b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/imx-atf/imx-atf_%.bbappend index 9d804184b..91dd55397 100644 --- a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/imx-atf/imx-atf_%.bbappend +++ b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/imx-atf/imx-atf_%.bbappend @@ -9,14 +9,35 @@ SRC_URI:append:ccimx8m = " \ file://0004-imx8mn-Disable-M7-debug-console.patch \ " SRC_URI:append:ccimx93 = " \ - file://0005-ccimx93-use-UART6-for-the-default-console.patch \ + file://0001-ccimx93-use-UART6-for-the-default-console.patch \ + file://0002-imx93-bring-back-ELE-clock-workaround-for-soc-revisi.patch \ " BOOT_TOOLS = "imx-boot-tools" +# Build ATF for imx93 SOC revision A0 +do_compile:append:ccimx93() { + oe_runmake SOC_REV_A0=1 BUILD_BASE=build-A0 clean + oe_runmake SOC_REV_A0=1 BUILD_BASE=build-A0 bl31 + if ${BUILD_OPTEE}; then + oe_runmake SOC_REV_A0=1 BUILD_BASE=build-A0-optee clean + oe_runmake SOC_REV_A0=1 BUILD_BASE=build-A0-optee SPD=opteed bl31 + fi +} + do_deploy:append() { install -Dm 0644 ${S}/build/${ATF_PLATFORM}/release/bl31.bin ${DEPLOYDIR}/${BOOT_TOOLS}/bl31-${ATF_PLATFORM}.bin if ${BUILD_OPTEE}; then install -m 0644 ${S}/build-optee/${ATF_PLATFORM}/release/bl31.bin ${DEPLOYDIR}/${BOOT_TOOLS}/bl31-${ATF_PLATFORM}.bin-optee fi } + +# Deploy ATF for imx93 SOC revision A0 +do_deploy:append:ccimx93() { + install -Dm 0644 ${S}/build-A0/${ATF_PLATFORM}/release/bl31.bin ${DEPLOYDIR}/bl31-${ATF_PLATFORM}-A0.bin + install -Dm 0644 ${S}/build-A0/${ATF_PLATFORM}/release/bl31.bin ${DEPLOYDIR}/${BOOT_TOOLS}/bl31-${ATF_PLATFORM}-A0.bin + if ${BUILD_OPTEE}; then + install -m 0644 ${S}/build-A0-optee/${ATF_PLATFORM}/release/bl31.bin ${DEPLOYDIR}/bl31-${ATF_PLATFORM}-A0.bin-optee + install -m 0644 ${S}/build-A0-optee/${ATF_PLATFORM}/release/bl31.bin ${DEPLOYDIR}/${BOOT_TOOLS}/bl31-${ATF_PLATFORM}-A0.bin-optee + fi +} diff --git a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/imx-atf/imx-atf_2.8.bb b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/imx-atf/imx-atf_2.8.bb index ef98ab91a..96ea44870 100644 --- a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/imx-atf/imx-atf_2.8.bb +++ b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/imx-atf/imx-atf_2.8.bb @@ -7,6 +7,7 @@ require recipes-bsp/imx-atf/imx-atf_2.6.bb SRC_URI = "git://github.com/nxp-imx/imx-atf.git;protocol=https;branch=${SRCBRANCH}" SRCBRANCH = "lf_v2.8" -SRCREV = "99195a23d3aef485fb8f10939583b1bdef18881c" +# Tag: lf-6.1.55-2.2.0 +SRCREV = "08e9d4eef2262c0dd072b4325e8919e06d349e02" COMPATIBLE_MACHINE = "(ccimx93)" diff --git a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/imx-mkimage/files/0001-imx9-soc.mak-capture-commands-output-into-a-log-file.patch b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/imx-mkimage/files/0001-imx9-soc.mak-capture-commands-output-into-a-log-file.patch new file mode 100644 index 000000000..f8606fb4b --- /dev/null +++ b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/imx-mkimage/files/0001-imx9-soc.mak-capture-commands-output-into-a-log-file.patch @@ -0,0 +1,49 @@ +From: Javier Viguera +Date: Thu, 31 Aug 2023 16:33:13 +0200 +Subject: [PATCH] imx9: soc.mak: capture commands output into a log file + +This is later used to get the needed information for the signing of the +boot artifacts. + +Signed-off-by: Javier Viguera +--- + iMX9/soc.mak | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/iMX9/soc.mak b/iMX9/soc.mak +index b17db6b7ca8c..c4bcac4e42cd 100644 +--- a/iMX9/soc.mak ++++ b/iMX9/soc.mak +@@ -1,4 +1,5 @@ + MKIMG = ../mkimage_imx8 ++MKIMAGE_LOG = "mkimage-$(firstword $(MAKECMDGOALS)).log" + + CC ?= gcc + REV ?= A0 +@@ -110,7 +111,7 @@ define append_container + @flashbin_size=`wc -c flash.bin | awk '{print $$1}'`; \ + psize=$$((0x400 * $(2))); \ + pad_cnt=$$(((flashbin_size + psize - 1) / psize)); \ +- echo "append $(1) at $$((pad_cnt * $(2))) KB, psize=$$psize"; \ ++ echo "append $(1) at $$((pad_cnt * $(2))) KB, psize=$$psize" | tee -a $(MKIMAGE_LOG); \ + dd if=$(1) of=flash.bin bs=1K seek=$$((pad_cnt * $(2))); + endef + +@@ -209,7 +210,7 @@ u-boot-atf-container.img: bl31.bin u-boot-hash.bin + -ap bl31.bin a55 $(ATF_LOAD_ADDR) \ + -ap u-boot-hash.bin a55 $(UBOOT_LOAD_ADDR) \ + -out u-boot-atf-container.img; \ +- fi ++ fi | tee $(MKIMAGE_LOG) + + u-boot-atf-container-spinand.img: bl31.bin u-boot-hash.bin + if [ -f $(TEE) ]; then \ +@@ -286,7 +287,7 @@ endif + + flash_singleboot: $(MKIMG) $(AHAB_IMG) $(SPL_A55_IMG) u-boot-atf-container.img $(OEI_A55_DDR) + ./$(MKIMG) -soc IMX9 -append $(AHAB_IMG) -c $(OEI_OPT_A55) \ +- -ap $(SPL_A55_IMG) a55 $(SPL_LOAD_ADDR) -out flash.bin ++ -ap $(SPL_A55_IMG) a55 $(SPL_LOAD_ADDR) -out flash.bin | tee -a $(MKIMAGE_LOG) + $(call append_container,u-boot-atf-container.img,1) + + flash_singleboot_no_ahabfw: $(MKIMG) $(SPL_A55_IMG) u-boot-atf-container.img $(OEI_A55_DDR) diff --git a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/imx-mkimage/files/0002-imx9-soc.mak-add-makefile-target-to-build-A0-revisio.patch b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/imx-mkimage/files/0002-imx9-soc.mak-add-makefile-target-to-build-A0-revisio.patch new file mode 100644 index 000000000..3c835ca13 --- /dev/null +++ b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/imx-mkimage/files/0002-imx9-soc.mak-add-makefile-target-to-build-A0-revisio.patch @@ -0,0 +1,25 @@ +From: Javier Viguera +Date: Thu, 2 Nov 2023 15:03:13 +0100 +Subject: [PATCH] imx9: soc.mak: add makefile target to build A0 revision + +Signed-off-by: Javier Viguera +--- + iMX9/soc.mak | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/iMX9/soc.mak b/iMX9/soc.mak +index c4bcac4e42cd..4f741451d1d0 100644 +--- a/iMX9/soc.mak ++++ b/iMX9/soc.mak +@@ -290,6 +290,11 @@ flash_singleboot: $(MKIMG) $(AHAB_IMG) $(SPL_A55_IMG) u-boot-atf-container.img $ + -ap $(SPL_A55_IMG) a55 $(SPL_LOAD_ADDR) -out flash.bin | tee -a $(MKIMAGE_LOG) + $(call append_container,u-boot-atf-container.img,1) + ++flash_singleboot_a0: $(MKIMG) mx93a0-ahab-container.img $(SPL_A55_IMG) u-boot-atf-container.img $(OEI_A55_DDR) ++ ./$(MKIMG) -soc IMX9 -append mx93a0-ahab-container.img -c $(OEI_OPT_A55) \ ++ -ap $(SPL_A55_IMG) a55 $(SPL_LOAD_ADDR) -out flash.bin | tee -a $(MKIMAGE_LOG) ++ $(call append_container,u-boot-atf-container.img,1) ++ + flash_singleboot_no_ahabfw: $(MKIMG) $(SPL_A55_IMG) u-boot-atf-container.img $(OEI_A55_DDR) + ./$(MKIMG) -soc IMX9 -c $(OEI_OPT_A55) \ + -ap $(SPL_A55_IMG) a55 $(SPL_LOAD_ADDR) -out flash.bin diff --git a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/imx-mkimage/imx-boot_1.0.bbappend b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/imx-mkimage/imx-boot_1.0.bbappend index f01c68bcb..dc26c104f 100644 --- a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/imx-mkimage/imx-boot_1.0.bbappend +++ b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/imx-mkimage/imx-boot_1.0.bbappend @@ -1,4 +1,4 @@ -# Copyright (C) 2022-2023 Digi International Inc. +# Copyright (C) 2022-2024 Digi International Inc. FILESEXTRAPATHS:prepend := "${THISDIR}/files:" @@ -7,10 +7,15 @@ SRC_URI:append:ccimx8m = " \ file://0002-imx8m-soc.mak-capture-commands-output-into-a-log-fil.patch \ " -# Use NXP's lf-6.1.22-2.0.0 release for ccimx93 +SRC_URI:append:ccimx93 = " \ + file://0001-imx9-soc.mak-capture-commands-output-into-a-log-file.patch \ + file://0002-imx9-soc.mak-add-makefile-target-to-build-A0-revisio.patch \ +" + +# Use NXP's lf-6.1.55-2.2.0 release for ccimx93 SRC_URI:ccimx93 = "git://github.com/nxp-imx/imx-mkimage.git;protocol=https;branch=${SRCBRANCH}" -SRCBRANCH:ccimx93 = "lf-6.1.22_2.0.0" -SRCREV:ccimx93 = "5cfd218012e080fb907d9cc301fbb4ece9bc17a9" +SRCBRANCH:ccimx93 = "lf-6.1.55_2.2.0" +SRCREV:ccimx93 = "c4365450fb115d87f245df2864fee1604d97c06a" DEPENDS += "${@oe.utils.conditional('TRUSTFENCE_SIGN', '1', 'trustfence-sign-tools-native', '', d)}" @@ -18,6 +23,8 @@ DEPENDS += "${@oe.utils.conditional('TRUSTFENCE_SIGN', '1', 'trustfence-sign-too UUU_BOOTLOADER = "" UUU_BOOTLOADER_TAGGED = "" +REV_OPTION:ccimx93 = "REV=A1" + compile_mx8m:append:ccimx8m() { # Create dummy DEK blob to support building with encrypted u-boot if [ -n "${TRUSTFENCE_DEK_PATH}" ] && [ "${TRUSTFENCE_DEK_PATH}" != "0" ]; then @@ -25,6 +32,18 @@ compile_mx8m:append:ccimx8m() { fi } +# For SOC revision A0 we need a different ATF binary +compile_mx93:append:ccimx93() { + if [ "$target" = "flash_singleboot_a0" ]; then + ATF_MACHINE_NAME_A0="$(echo ${ATF_MACHINE_NAME} | sed -e 's,.bin,-A0.bin,g')" + bbnote "Copy ATF binary for SOC revision A0: ${ATF_MACHINE_NAME_A0}" + \cp --remove-destination ${DEPLOY_DIR_IMAGE}/${ATF_MACHINE_NAME_A0} ${BOOT_STAGING}/bl31.bin + # Filename must match the deployed one in "optee-os" recipe for A0 SOC revision + \cp --remove-destination ${DEPLOY_DIR_IMAGE}/tee.ccimx93dvk_a0.bin ${BOOT_STAGING}/tee.bin + unset ATF_MACHINE_NAME_A0 + fi +} + do_compile:append:ccimx8m() { bbnote "building ${IMX_BOOT_SOC_TARGET} - print_fit_hab" make SOC=${IMX_BOOT_SOC_TARGET} dtbs=${UBOOT_DTB_NAME} print_fit_hab @@ -83,6 +102,18 @@ do_deploy:append:ccimx8m() { do_deploy:append:ccimx93() { generate_symlinks + for target in ${IMXBOOT_TARGETS}; do + install -m 0644 ${BOOT_STAGING}/mkimage-${target}.log ${DEPLOYDIR}/${BOOT_TOOLS} + # Generate symlink for SOC revision A0 + if [ "$target" = "flash_singleboot_a0" ]; then + ln -sf ${BOOT_NAME}-${MACHINE}.bin-${target} ${DEPLOYDIR}/${BOOT_NAME}-${MACHINE}-A0.bin + fi + done + # Deploy A0 optee binary + if ${DEPLOY_OPTEE}; then + # Filename must match the deployed one in "optee-os" recipe for A0 SOC revision + install -m 0644 ${DEPLOY_DIR_IMAGE}/tee.ccimx93dvk_a0.bin ${DEPLOYDIR}/${BOOT_TOOLS} + fi } do_deploy:ccimx8x () { @@ -126,6 +157,11 @@ trustfence_sign_imxboot() { # Sign/encrypt boot image for target in ${IMXBOOT_TARGETS}; do + # Use first "target" as IMAGE_IMXBOOT_TARGET + if [ "$IMAGE_IMXBOOT_TARGET" = "" ]; then + IMAGE_IMXBOOT_TARGET="$target" + echo "Set boot target as $IMAGE_IMXBOOT_TARGET" + fi TF_SIGN_ENV="$TF_SIGN_ENV CONFIG_MKIMAGE_LOG_PATH=${DEPLOYDIR}/${BOOT_TOOLS}/mkimage-${target}.log" env $TF_SIGN_ENV trustfence-sign-uboot.sh ${BOOT_NAME}-${MACHINE}.bin-${target} ${BOOT_NAME}-signed-${MACHINE}.bin-${target} if [ -n "${TRUSTFENCE_DEK_PATH}" ] && [ "${TRUSTFENCE_DEK_PATH}" != "0" ]; then @@ -133,6 +169,12 @@ trustfence_sign_imxboot() { env $TF_SIGN_ENV $TF_ENC_ENV trustfence-sign-uboot.sh ${BOOT_NAME}-${MACHINE}.bin-${target} ${BOOT_NAME}-encrypted-${MACHINE}.bin-${target} fi done + + # Generate symlinks for trustfence artifacts. + ln -sf ${BOOT_NAME}-signed-${MACHINE}.bin-${IMAGE_IMXBOOT_TARGET} ${DEPLOYDIR}/${BOOT_NAME}-signed-${MACHINE}.bin + if [ -n "${TRUSTFENCE_DEK_PATH}" ] && [ "${TRUSTFENCE_DEK_PATH}" != "0" ]; then + ln -sf ${BOOT_NAME}-encrypted-${MACHINE}.bin-${IMAGE_IMXBOOT_TARGET} ${DEPLOYDIR}/${BOOT_NAME}-encrypted-${MACHINE}.bin + fi } trustfence_sign_imxboot:ccimx8x() { @@ -143,6 +185,11 @@ trustfence_sign_imxboot:ccimx8x() { # Sign/encrypt boot image for target in ${IMXBOOT_TARGETS}; do + # Use first "target" as IMAGE_IMXBOOT_TARGET + if [ "$IMAGE_IMXBOOT_TARGET" = "" ]; then + IMAGE_IMXBOOT_TARGET="$target" + echo "Set boot target as $IMAGE_IMXBOOT_TARGET" + fi for rev in ${SOC_REVISIONS}; do TF_SIGN_ENV="$TF_SIGN_ENV CONFIG_MKIMAGE_LOG_PATH=${DEPLOYDIR}/${BOOT_TOOLS}/mkimage-${rev}-${target}.log" env $TF_SIGN_ENV trustfence-sign-uboot.sh ${BOOT_NAME}-${MACHINE}-${rev}.bin-${target} ${BOOT_NAME}-signed-${MACHINE}-${rev}.bin-${target} @@ -152,6 +199,12 @@ trustfence_sign_imxboot:ccimx8x() { fi done done + + # Generate symlinks for trustfence artifacts. + ln -sf ${UBOOT_PREFIX}-signed-${MACHINE}-${rev}.bin-${IMAGE_IMXBOOT_TARGET} ${DEPLOYDIR}/${UBOOT_PREFIX}-signed-${MACHINE}.bin + if [ -n "${TRUSTFENCE_DEK_PATH}" ] && [ "${TRUSTFENCE_DEK_PATH}" != "0" ]; then + ln -sf ${UBOOT_PREFIX}-encrypted-${MACHINE}-${rev}.bin-${IMAGE_IMXBOOT_TARGET} ${DEPLOYDIR}/${UBOOT_PREFIX}-encrypted-${MACHINE}.bin + fi } trustfence_sign_imxboot[dirs] = "${DEPLOYDIR}" diff --git a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/imx-mkimage/imx-mkimage_git.bbappend b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/imx-mkimage/imx-mkimage_git.bbappend index 18a4a08c3..321037dc0 100644 --- a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/imx-mkimage/imx-mkimage_git.bbappend +++ b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/imx-mkimage/imx-mkimage_git.bbappend @@ -1,4 +1,4 @@ -# Copyright (C) 2022 Digi International +# Copyright (C) 2022-2024 Digi International Inc. FILESEXTRAPATHS:prepend := "${THISDIR}/files:" @@ -6,10 +6,10 @@ SRC_URI:append:ccimx8m = " \ file://0001-imx8m-soc.mak-preserve-dtbs-after-build.patch \ " -# Use NXP's lf-6.1.22-2.0.0 release for ccimx93 +# Use NXP's lf-6.1.55-2.2.0 release for ccimx93 SRC_URI:ccimx93 = "git://github.com/nxp-imx/imx-mkimage.git;protocol=https;branch=${SRCBRANCH}" -SRCBRANCH:ccimx93 = "lf-6.1.22_2.0.0" -SRCREV:ccimx93 = "5cfd218012e080fb907d9cc301fbb4ece9bc17a9" +SRCBRANCH:ccimx93 = "lf-6.1.55_2.2.0" +SRCREV:ccimx93 = "c4365450fb115d87f245df2864fee1604d97c06a" # "fmacro-prefix-map" is not supported on old versions of GCC DEBUG_PREFIX_MAP:remove:class-nativesdk = "-fmacro-prefix-map=${WORKDIR}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}" diff --git a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-graphics/drm/libdrm_2.4.115.imx.bb b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-graphics/drm/libdrm_2.4.115.imx.bb new file mode 100644 index 000000000..19e42613d --- /dev/null +++ b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-graphics/drm/libdrm_2.4.115.imx.bb @@ -0,0 +1,74 @@ +SUMMARY = "Userspace interface to the kernel DRM services" +DESCRIPTION = "The runtime library for accessing the kernel DRM services. DRM \ +stands for \"Direct Rendering Manager\", which is the kernel portion of the \ +\"Direct Rendering Infrastructure\" (DRI). DRI is required for many hardware \ +accelerated OpenGL drivers." +HOMEPAGE = "http://dri.freedesktop.org" +SECTION = "x11/base" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://LICENSE;md5=9eb1f4831351ab42d762c40b3ebb7add \ + file://xf86drm.c;beginline=9;endline=32;md5=c8a3b961af7667c530816761e949dc71" +PROVIDES = "drm" +DEPENDS = "libpthread-stubs" + +SRC_URI = "${IMX_LIBDRM_SRC};branch=${SRCBRANCH}" +IMX_LIBDRM_SRC ?= "git://github.com/nxp-imx/libdrm-imx.git;protocol=https;nobranch=1" +SRCBRANCH ?= "libdrm-imx-2.4.115" +SRCREV = "0f889a1f9640f6210132dd565141eb19005245fb" + +S = "${WORKDIR}/git" + +DEFAULT_PREFERENCE = "-1" +COMPATIBLE_MACHINE = "(ccimx93)" + +inherit meson pkgconfig manpages + +PACKAGECONFIG ??= "intel radeon amdgpu nouveau vmwgfx omap freedreno vc4 etnaviv tests install-test-programs" +PACKAGECONFIG[intel] = "-Dintel=enabled,-Dintel=disabled,libpciaccess" +PACKAGECONFIG[radeon] = "-Dradeon=enabled,-Dradeon=disabled" +PACKAGECONFIG[amdgpu] = "-Damdgpu=enabled,-Damdgpu=disabled" +PACKAGECONFIG[nouveau] = "-Dnouveau=enabled,-Dnouveau=disabled" +PACKAGECONFIG[vmwgfx] = "-Dvmwgfx=enabled,-Dvmwgfx=disabled" +PACKAGECONFIG[omap] = "-Domap=enabled,-Domap=disabled" +PACKAGECONFIG[exynos] = "-Dexynos=enabled,-Dexynos=disabled" +PACKAGECONFIG[freedreno] = "-Dfreedreno=enabled,-Dfreedreno=disabled" +PACKAGECONFIG[tegra] = "-Dtegra=enabled,-Dtegra=disabled" +PACKAGECONFIG[vc4] = "-Dvc4=enabled,-Dvc4=disabled" +PACKAGECONFIG[etnaviv] = "-Detnaviv=enabled,-Detnaviv=disabled" +PACKAGECONFIG[freedreno-kgsl] = "-Dfreedreno-kgsl=true,-Dfreedreno-kgsl=false" +PACKAGECONFIG[valgrind] = "-Dvalgrind=enabled,-Dvalgrind=disabled,valgrind" +PACKAGECONFIG[install-test-programs] = "-Dinstall-test-programs=true,-Dinstall-test-programs=false" +PACKAGECONFIG[cairo-tests] = "-Dcairo-tests=enabled,-Dcairo-tests=disabled" +PACKAGECONFIG[tests] = "-Dtests=true,-Dtests=false" +PACKAGECONFIG[udev] = "-Dudev=true,-Dudev=false,udev" +PACKAGECONFIG[manpages] = "-Dman-pages=enabled,-Dman-pages=disabled,libxslt-native xmlto-native python3-docutils-native" + +ALLOW_EMPTY:${PN}-drivers = "1" +PACKAGES =+ "${PN}-tests ${PN}-drivers ${PN}-radeon ${PN}-nouveau ${PN}-omap \ + ${PN}-intel ${PN}-exynos ${PN}-kms ${PN}-freedreno ${PN}-amdgpu \ + ${PN}-etnaviv" + +RRECOMMENDS:${PN}-drivers = "${PN}-radeon ${PN}-nouveau ${PN}-omap ${PN}-intel \ + ${PN}-exynos ${PN}-freedreno ${PN}-amdgpu \ + ${PN}-etnaviv" + +FILES:${PN}-tests = "${bindir}/*" +FILES:${PN}-radeon = "${libdir}/libdrm_radeon.so.*" +FILES:${PN}-nouveau = "${libdir}/libdrm_nouveau.so.*" +FILES:${PN}-omap = "${libdir}/libdrm_omap.so.*" +FILES:${PN}-intel = "${libdir}/libdrm_intel.so.*" +FILES:${PN}-exynos = "${libdir}/libdrm_exynos.so.*" +FILES:${PN}-kms = "${libdir}/libkms*.so.*" +FILES:${PN}-freedreno = "${libdir}/libdrm_freedreno.so.*" +FILES:${PN}-amdgpu = "${libdir}/libdrm_amdgpu.so.* ${datadir}/${PN}/amdgpu.ids" +FILES:${PN}-etnaviv = "${libdir}/libdrm_etnaviv.so.*" + +BBCLASSEXTEND = "native nativesdk" + +PACKAGES:prepend:imxgpu = "${PN}-vivante " +RRECOMMENDS:${PN}-drivers:append:imxgpu = " ${PN}-vivante" +FILES:${PN}-vivante = "${libdir}/libdrm_vivante.so.*" +PACKAGECONFIG:append:imxgpu = " vivante" +PACKAGECONFIG[vivante] = "-Dvivante=true,-Dvivante=false" + +PACKAGE_ARCH = "${MACHINE_SOCARCH}" diff --git a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-graphics/imx-g2d/imx-g2d-samples_git.bbappend b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-graphics/imx-g2d/imx-g2d-samples_git.bbappend index 980a6a4cf..9d9ee37f4 100644 --- a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-graphics/imx-g2d/imx-g2d-samples_git.bbappend +++ b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-graphics/imx-g2d/imx-g2d-samples_git.bbappend @@ -1,4 +1,6 @@ -# Copyright (c) 2023, Digi International Inc. +# Copyright 2023, 2024 Digi International Inc. + +SRCREV:mx93-nxp-bsp = "4391dcda499870418bb38fe395c3cba0664c5bab" PACKAGECONFIG_IMPLEMENTATION:mx93-nxp-bsp = "pxp" diff --git a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-graphics/imx-g2d/imx-pxp-g2d_git.bbappend b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-graphics/imx-g2d/imx-pxp-g2d_git.bbappend new file mode 100644 index 000000000..55a5c18fb --- /dev/null +++ b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-graphics/imx-g2d/imx-pxp-g2d_git.bbappend @@ -0,0 +1,5 @@ +# Copyright 2023, 2024 Digi International Inc. + +LIC_FILES_CHKSUM:ccimx93 = "file://LICENSE.txt;md5=2827219e81f28aba7c6a569f7c437fa7" + +SRCREV:ccimx93 = "f3adab05bd0cbb7c38578110d772e8ddf52b4e8e" diff --git a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-graphics/wayland/wayland/0001-build-Fix-strndup-detection-on-MinGW.patch b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-graphics/wayland/wayland/0001-build-Fix-strndup-detection-on-MinGW.patch new file mode 100644 index 000000000..bc753de11 --- /dev/null +++ b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-graphics/wayland/wayland/0001-build-Fix-strndup-detection-on-MinGW.patch @@ -0,0 +1,41 @@ +From b4c64b6f07743e3fb63ce52359bc664ab7d60df0 Mon Sep 17 00:00:00 2001 +From: Joshua Watt +Date: Thu, 20 Feb 2020 15:20:45 -0600 +Subject: [PATCH] build: Fix strndup detection on MinGW + +GCC and meson conspire together to incorrectly detect that strndup() +exists on MinGW as __builtin_strndup, when no such function exists. As a +work around, meson will skip looking for __builtin functions if an +'#include' is in the prefix, so add '#include ' when looking +for strndup(). + +See: https://github.com/mesonbuild/meson/issues/3672 + +Upstream-Status: Submitted [https://gitlab.freedesktop.org/wayland/wayland/merge_requests/63] + +Signed-off-by: Joshua Watt +Signed-off-by: Denys Dmytriyenko +--- + meson.build | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/meson.build b/meson.build +index 3bc25c9..adde7b9 100644 +--- a/meson.build ++++ b/meson.build +@@ -38,11 +38,11 @@ have_funcs = [ + 'prctl', + 'memfd_create', + 'mremap', +- 'strndup', + ] + foreach f: have_funcs + config_h.set('HAVE_' + f.underscorify().to_upper(), cc.has_function(f)) + endforeach ++config_h.set('HAVE_STRNDUP', cc.has_function('strndup') and cc.has_header_symbol('string.h', 'strndup')) + config_h.set10('HAVE_XUCRED_CR_PID', cc.has_member('struct xucred', 'cr_pid', prefix : '#include ')) + have_broken_msg_cmsg_cloexec = false + if host_machine.system() == 'freebsd' +-- +2.7.4 + diff --git a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-graphics/wayland/wayland/run-ptest b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-graphics/wayland/wayland/run-ptest new file mode 100644 index 000000000..7e8d9de04 --- /dev/null +++ b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-graphics/wayland/wayland/run-ptest @@ -0,0 +1,17 @@ +#!/bin/sh + +export WAYLAND_SCANNER=wayland-scanner +export TEST_DATA_DIR=tests/data +export TEST_OUTPUT_DIR=tests/output +export SED=sed +export WAYLAND_EGL_LIB=/usr/lib/libwayland-egl.so.1 +export NM=nm + +for i in `ls tests/*-test tests/wayland-egl-symbols-check tests/scanner-test.sh`; do + $i + if [ $? -eq 0 ]; then + echo "PASS: $i" + else + echo "FAIL: $i" + fi +done diff --git a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-graphics/wayland/wayland_1.22.0.imx.bb b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-graphics/wayland/wayland_1.22.0.imx.bb new file mode 100644 index 000000000..eb1066c82 --- /dev/null +++ b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-graphics/wayland/wayland_1.22.0.imx.bb @@ -0,0 +1,67 @@ +SUMMARY = "Wayland, a protocol between a compositor and clients" +DESCRIPTION = "Wayland is a protocol for a compositor to talk to its clients \ +as well as a C library implementation of that protocol. The compositor can be \ +a standalone display server running on Linux kernel modesetting and evdev \ +input devices, an X application, or a wayland client itself. The clients can \ +be traditional applications, X servers (rootless or fullscreen) or other \ +display servers." +HOMEPAGE = "http://wayland.freedesktop.org" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://COPYING;md5=b31d8f53b6aaf2b4985d7dd7810a70d1 \ + file://src/wayland-server.c;endline=24;md5=b8e046164a766bb1ede8ba38e9dcd7ce" + +DEPENDS = "expat libffi wayland-native" + +SRC_URI = "https://gitlab.freedesktop.org/wayland/wayland/-/releases/1.22.0/downloads/${BP_ORIGINAL}.tar.xz \ + file://run-ptest \ + file://0001-build-Fix-strndup-detection-on-MinGW.patch \ + " +SRC_URI[sha256sum] = "1540af1ea698a471c2d8e9d288332c7e0fd360c8f1d12936ebb7e7cbc2425842" +BP_ORIGINAL = "${BPN}-1.22.0" +S = "${WORKDIR}/${BP_ORIGINAL}" + +UPSTREAM_CHECK_URI = "https://wayland.freedesktop.org/releases.html" +UPSTREAM_CHECK_REGEX = "wayland-(?P\d+\.\d+\.(?!9\d+)\d+)" + +inherit meson pkgconfig ptest + +PACKAGECONFIG ??= "dtd-validation" +PACKAGECONFIG[dtd-validation] = "-Ddtd_validation=true,-Ddtd_validation=false,libxml2,," + +EXTRA_OEMESON = "-Ddocumentation=false" +EXTRA_OEMESON:class-native = "-Ddocumentation=false" + +# Wayland installs a M4 macro for other projects to use, which uses the target +# pkg-config to find files. Replace pkg-config with pkg-config-native. +do_install:append:class-native() { + sed -e 's,PKG_CHECK_MODULES(.*),,g' \ + -e 's,$PKG_CONFIG,pkg-config-native,g' \ + -i ${D}/${datadir}/aclocal/wayland-scanner.m4 +} + +do_install_ptest() { + mkdir -p ${D}${PTEST_PATH}/tests/data + cp -rf ${B}/tests/*-test ${B}/tests/*-checker ${D}${PTEST_PATH}/tests + cp -rf ${B}/tests/*-checker ${D}${PTEST_PATH} + cp -rf ${S}/tests/scanner-test.sh ${D}${PTEST_PATH}/tests + cp -rf ${S}/tests/data/* ${D}${PTEST_PATH}/tests/data/ + cp -rf ${S}/egl/wayland-egl-symbols-check ${D}${PTEST_PATH}/tests/ +} + +sysroot_stage_all:append:class-target () { + rm ${SYSROOT_DESTDIR}/${datadir}/aclocal/wayland-scanner.m4 + cp ${STAGING_DATADIR_NATIVE}/aclocal/wayland-scanner.m4 ${SYSROOT_DESTDIR}/${datadir}/aclocal/ +} + +PACKAGES =+ "${PN}-tools" + +FILES:${PN}-tools = "${bindir}/wayland-scanner" +FILES:${PN}-dev += "${datadir}/${BPN}/wayland-scanner.mk" + +BBCLASSEXTEND = "native nativesdk" + +RDEPENDS:${PN}-ptest += "binutils sed ${PN}-tools" + +PACKAGE_ARCH = "${MACHINE_SOCARCH}" + +DEFAULT_PREFERENCE = "-1" diff --git a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-graphics/xwayland/xwayland_23.1.1.imx.bb b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-graphics/xwayland/xwayland_23.1.1.imx.bb new file mode 100644 index 000000000..a9705a233 --- /dev/null +++ b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-graphics/xwayland/xwayland_23.1.1.imx.bb @@ -0,0 +1,53 @@ +# This recipe copy helps keep meta-freescale master branch compatible +# with Yocto langdale. +# (From OE-Core rev: 35fdbd0ea81650a0421d50fb53989d96c5956331) + +SUMMARY = "XWayland is an X Server that runs under Wayland." +DESCRIPTION = "XWayland is an X Server running as a Wayland client, \ +and thus is capable of displaying native X11 client applications in a \ +Wayland compositor environment. The goal of XWayland is to facilitate \ +the transition from X Window System to Wayland environments, providing \ +a way to run unported applications in the meantime." +HOMEPAGE = "https://fedoraproject.org/wiki/Changes/XwaylandStandalone" + +DEFAULT_PREFERENCE = "-1" + +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://COPYING;md5=5df87950af51ac2c5822094553ea1880" + +SRC_URI = "https://www.x.org/archive/individual/xserver/${BP_ORIGINAL}.tar.xz" +BP_ORIGINAL = "${BPN}-23.1.1" +SRC_URI[sha256sum] = "fb9461f5cb9fea5e07e91882311b0c88b43e8843b017ebac05eb5af69aa34c15" +S = "${WORKDIR}/${BP_ORIGINAL}" + +UPSTREAM_CHECK_REGEX = "xwayland-(?P\d+(\.(?!90\d)\d+)+)\.tar" + +inherit meson features_check pkgconfig +REQUIRED_DISTRO_FEATURES = "x11 opengl" + +DEPENDS += "xorgproto xtrans pixman libxkbfile libxfont2 wayland wayland-native wayland-protocols libdrm libepoxy libxcvt" + +OPENGL_PKGCONFIGS = "glx glamor dri3" +PACKAGECONFIG ??= "${XORG_CRYPTO} \ + ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', '${OPENGL_PKGCONFIGS}', '', d)} \ +" +PACKAGECONFIG[dri3] = "-Ddri3=true,-Ddri3=false,libxshmfence" +PACKAGECONFIG[glx] = "-Dglx=true,-Dglx=false,virtual/libgl virtual/libx11" +PACKAGECONFIG[glamor] = "-Dglamor=true,-Dglamor=false,libepoxy virtual/libgbm,libegl" +PACKAGECONFIG[unwind] = "-Dlibunwind=true,-Dlibunwind=false,libunwind" +PACKAGECONFIG[xinerama] = "-Dxinerama=true,-Dxinerama=false" + +# Xorg requires a SHA1 implementation, pick one +XORG_CRYPTO ??= "openssl" +PACKAGECONFIG[openssl] = "-Dsha1=libcrypto,,openssl" +PACKAGECONFIG[nettle] = "-Dsha1=libnettle,,nettle" +PACKAGECONFIG[gcrypt] = "-Dsha1=libgcrypt,,libgcrypt" + +do_install:append() { + # remove files not needed and clashing with xserver-xorg + rm -rf ${D}/${libdir}/xorg/ +} + +FILES:${PN} += "${libdir}/xorg/protocol.txt" + +RDEPENDS:${PN} += "xkbcomp" diff --git a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-kernel/linux/linux-imx-headers_6.1.bb b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-kernel/linux/linux-imx-headers_6.1.bb new file mode 100644 index 000000000..7da3e1d78 --- /dev/null +++ b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-kernel/linux/linux-imx-headers_6.1.bb @@ -0,0 +1,14 @@ +# Copyright 2023, 2024 Digi International Inc. + +# +# Reuse meta-freescale's linux-imx-headers_5.15.bb +# +require recipes-kernel/linux/linux-imx-headers_5.15.bb + +SRCBRANCH = "lf-6.1.y" +LOCALVERSION = "-lts-${SRCBRANCH}" +SRCREV = "770c5fe2c1d1529fae21b7043911cd50c6cf087e" + +IMX_UAPI_HEADERS:remove = "isl29023.h" + +COMPATIBLE_MACHINE = "(ccimx93)" diff --git a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-security/optee-imx/optee-client/tee-supplicant.service b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-security/optee-imx/optee-client/tee-supplicant.service index 0e2b4f6ba..c273832d7 100644 --- a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-security/optee-imx/optee-client/tee-supplicant.service +++ b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-security/optee-imx/optee-client/tee-supplicant.service @@ -3,9 +3,8 @@ Description=TEE Supplicant [Service] User=root -EnvironmentFile=-/etc/default/tee-supplicant -ExecStart=/usr/bin/tee-supplicant $OPTARGS +EnvironmentFile=-@sysconfdir@/default/tee-supplicant +ExecStart=@sbindir@/tee-supplicant $OPTARGS [Install] WantedBy=basic.target - diff --git a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-security/optee-imx/optee-client_3.21.0.imx.bb b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-security/optee-imx/optee-client_3.21.0.imx.bb deleted file mode 100644 index 882b390cd..000000000 --- a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-security/optee-imx/optee-client_3.21.0.imx.bb +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright 2023 Digi International Inc. - -# -# Reuse meta-freescale's optee-client_3.19.0.imx.bb -# -require recipes-security/optee-imx/optee-client_3.19.0.imx.bb - -SRCBRANCH = "lf-6.1.22_2.0.0" -SRCREV = "8533e0e6329840ee96cf81b6453f257204227e6c" - -# Otherwise optee-client's makefile defaults to use $(CROSS_COMPILE)pkg-config -# which is not what Yocto provides. -export PKG_CONFIG='pkg-config' - -COMPATIBLE_MACHINE = "(ccimx93)" diff --git a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-security/optee-imx/optee-client_4.0.0.imx.bb b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-security/optee-imx/optee-client_4.0.0.imx.bb new file mode 100644 index 000000000..32d91245c --- /dev/null +++ b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-security/optee-imx/optee-client_4.0.0.imx.bb @@ -0,0 +1,13 @@ +# Copyright 2023 Digi International Inc. + +# +# Reuse meta-freescale's optee-client_3.19.0.imx.bb +# +require recipes-security/optee-imx/optee-client_3.19.0.imx.bb + +SRCBRANCH = "lf-6.1.55_2.2.0" +SRCREV = "acb0885c117e73cb6c5c9b1dd9054cb3f93507ee" + +EXTRA_OEMAKE += "PKG_CONFIG=pkg-config" + +COMPATIBLE_MACHINE = "(ccimx93)" diff --git a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-security/optee-imx/optee-os/0001-core-imx-support-ccimx93-dvk.patch b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-security/optee-imx/optee-os/0001-core-imx-support-ccimx93-dvk.patch index ed58a2f7b..01e38dda9 100644 --- a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-security/optee-imx/optee-os/0001-core-imx-support-ccimx93-dvk.patch +++ b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-security/optee-imx/optee-os/0001-core-imx-support-ccimx93-dvk.patch @@ -2,25 +2,28 @@ From: Javier Viguera Date: Mon, 15 May 2023 17:59:54 +0200 Subject: [PATCH] core: imx: support ccimx93-dvk +SOC revision A0 requires a different build. + Signed-off-by: Javier Viguera --- - core/arch/arm/plat-imx/conf.mk | 6 ++++++ - core/arch/arm/plat-imx/registers/imx93.h | 1 + - 2 files changed, 7 insertions(+) + core/arch/arm/plat-imx/conf.mk | 13 +++++++++++++ + core/arch/arm/plat-imx/registers/imx93.h | 5 +++++ + 2 files changed, 18 insertions(+) diff --git a/core/arch/arm/plat-imx/conf.mk b/core/arch/arm/plat-imx/conf.mk -index 1d5081f96afe..5e2d0733dd04 100644 +index 0bd9ccd6bef1..5e4c02e27d2e 100644 --- a/core/arch/arm/plat-imx/conf.mk +++ b/core/arch/arm/plat-imx/conf.mk -@@ -88,6 +88,7 @@ mx8ulp-flavorlist = \ +@@ -88,6 +88,8 @@ mx8ulp-flavorlist = \ mx8ulpevk \ mx93-flavorlist = \ + ccimx93dvk \ ++ ccimx93dvk_a0 \ mx93evk \ ifneq (,$(filter $(PLATFORM_FLAVOR),$(mx6ul-flavorlist))) -@@ -449,6 +450,11 @@ CFG_DDR_SIZE ?= 0x80000000 +@@ -451,6 +453,17 @@ CFG_DDR_SIZE ?= 0x80000000 CFG_UART_BASE ?= UART1_BASE endif @@ -28,19 +31,34 @@ index 1d5081f96afe..5e2d0733dd04 100644 +CFG_DDR_SIZE ?= 0x40000000 +CFG_UART_BASE ?= UART6_BASE +endif ++ ++ifneq (,$(filter $(PLATFORM_FLAVOR),ccimx93dvk_a0)) ++CFG_DDR_SIZE ?= 0x40000000 ++CFG_UART_BASE ?= UART6_BASE ++$(call force,CFG_SOC_REV_A0,y) ++endif + # i.MX6 Solo/SL/SoloX/DualLite/Dual/Quad specific config ifeq ($(filter y, $(CFG_MX6QP) $(CFG_MX6Q) $(CFG_MX6D) $(CFG_MX6DL) $(CFG_MX6S) \ $(CFG_MX6SL) $(CFG_MX6SLL) $(CFG_MX6SX)), y) diff --git a/core/arch/arm/plat-imx/registers/imx93.h b/core/arch/arm/plat-imx/registers/imx93.h -index e91607537380..66a6408109c2 100644 +index 21080da82d04..29070eb917ac 100644 --- a/core/arch/arm/plat-imx/registers/imx93.h +++ b/core/arch/arm/plat-imx/registers/imx93.h -@@ -9,6 +9,7 @@ +@@ -9,11 +9,16 @@ #define GICR_BASE 0x48040000 #define UART1_BASE 0x44380000 +#define UART6_BASE 0x425a0000 - #define MU_BASE 0x47520000 + /* + * For Normal MU - Use MU_BASE as 0x47520000 + * For Trust MU - Use MU_BASE as 0x47530000 + */ ++#ifdef CFG_SOC_REV_A0 ++#define MU_BASE 0x47520000 ++#else + #define MU_BASE 0x47530000 ++#endif #define MU_SIZE 0x10000 + #define MU_TRUST_BASE 0x47530000 diff --git a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-security/optee-imx/optee-os_3.21.0.imx.bb b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-security/optee-imx/optee-os_4.0.0.imx.bb similarity index 55% rename from meta-digi-arm/dynamic-layers/freescale-layer/recipes-security/optee-imx/optee-os_3.21.0.imx.bb rename to meta-digi-arm/dynamic-layers/freescale-layer/recipes-security/optee-imx/optee-os_4.0.0.imx.bb index d837d877a..c4f613481 100644 --- a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-security/optee-imx/optee-os_3.21.0.imx.bb +++ b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-security/optee-imx/optee-os_4.0.0.imx.bb @@ -10,9 +10,19 @@ SRC_URI = " \ file://0007-allow-setting-sysroot-for-clang.patch \ file://0001-core-imx-support-ccimx93-dvk.patch \ " -SRCBRANCH = "lf-6.1.22_2.0.0" -SRCREV = "1962aec9581760803b1485d455cd62cb11c14870" +SRCBRANCH = "lf-6.1.55_2.2.0" +# Tag: lf-6.1.55-2.2.0 +SRCREV = "a303fc80f7c4bd713315687a1fa1d6ed136e78ee" PLATFORM_FLAVOR:ccimx93 = "ccimx93dvk" +do_compile:append:ccimx93 () { + oe_runmake PLATFORM=imx-${PLATFORM_FLAVOR}_a0 O=${B}-A0 all +} +do_compile[cleandirs] += "${B}-A0" + +do_deploy:append:ccimx93 () { + cp ${B}-A0/core/tee-raw.bin ${DEPLOYDIR}/tee.${PLATFORM_FLAVOR}_a0.bin +} + COMPATIBLE_MACHINE = "(ccimx93)" diff --git a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-security/optee-imx/optee-test_3.21.0.imx.bb b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-security/optee-imx/optee-test_4.0.0.imx.bb similarity index 64% rename from meta-digi-arm/dynamic-layers/freescale-layer/recipes-security/optee-imx/optee-test_3.21.0.imx.bb rename to meta-digi-arm/dynamic-layers/freescale-layer/recipes-security/optee-imx/optee-test_4.0.0.imx.bb index 916da297c..515dc1743 100644 --- a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-security/optee-imx/optee-test_3.21.0.imx.bb +++ b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-security/optee-imx/optee-test_4.0.0.imx.bb @@ -5,7 +5,9 @@ # require recipes-security/optee-imx/optee-test_3.19.0.imx.bb -SRCBRANCH = "lf-6.1.22_2.0.0" -SRCREV = "c2c9f922044d2c8a7ab384812bb124c6da2b7888" +DEPENDS += "openssl" + +SRCBRANCH = "lf-6.1.55_2.2.0" +SRCREV = "38efacef3b14b32a6792ceaebe211b5718536fbb" COMPATIBLE_MACHINE = "(ccimx93)" diff --git a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-support/opencv/opencv/0001-3rdparty-ippicv-Use-pre-downloaded-ipp.patch b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-support/opencv/opencv/0001-3rdparty-ippicv-Use-pre-downloaded-ipp.patch new file mode 100644 index 000000000..9e6a61371 --- /dev/null +++ b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-support/opencv/opencv/0001-3rdparty-ippicv-Use-pre-downloaded-ipp.patch @@ -0,0 +1,36 @@ +From 9b4959b97d2e95d4b49cf6ca2a3fce3cdb484f2d Mon Sep 17 00:00:00 2001 +From: Ricardo Ribalda Delgado +Date: Thu, 31 Mar 2016 00:20:15 +0200 +Subject: [PATCH] 3rdparty/ippicv: Use pre-downloaded ipp + +Signed-off-by: Ricardo Ribalda Delgado +Signed-off-by: Ismo Puustinen + +--- + 3rdparty/ippicv/ippicv.cmake | 15 +-------------- + 1 file changed, 1 insertion(+), 14 deletions(-) + +diff --git a/3rdparty/ippicv/ippicv.cmake b/3rdparty/ippicv/ippicv.cmake +index 257af6fcc6..f88460450f 100644 +--- a/3rdparty/ippicv/ippicv.cmake ++++ b/3rdparty/ippicv/ippicv.cmake +@@ -34,18 +34,5 @@ function(download_ippicv root_var) + endif() + + set(THE_ROOT "${OpenCV_BINARY_DIR}/3rdparty/ippicv") +- ocv_download(FILENAME ${OPENCV_ICV_NAME} +- HASH ${OPENCV_ICV_HASH} +- URL +- "${OPENCV_IPPICV_URL}" +- "$ENV{OPENCV_IPPICV_URL}" +- "https://raw.githubusercontent.com/opencv/opencv_3rdparty/${IPPICV_COMMIT}/ippicv/" +- DESTINATION_DIR "${THE_ROOT}" +- ID IPPICV +- STATUS res +- UNPACK RELATIVE_URL) +- +- if(res) +- set(${root_var} "${THE_ROOT}/${OPENCV_ICV_PACKAGE_SUBDIR}" PARENT_SCOPE) +- endif() ++ set(${root_var} "${THE_ROOT}/${OPENCV_ICV_PACKAGE_SUBDIR}" PARENT_SCOPE) + endfunction() diff --git a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-support/opencv/opencv/0001-Add-smaller-version-of-download_models.py.patch b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-support/opencv/opencv/0001-Add-smaller-version-of-download_models.py.patch new file mode 100644 index 000000000..0aabee29f --- /dev/null +++ b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-support/opencv/opencv/0001-Add-smaller-version-of-download_models.py.patch @@ -0,0 +1,179 @@ +From fca4d9eec289f22c081daa2c61a1110e3f268f92 Mon Sep 17 00:00:00 2001 +From: Tom Hochstein +Date: Tue, 1 Sep 2020 14:57:07 -0500 +Subject: [PATCH] Add smaller version of download_models.py + +Signed-off-by: Tom Hochstein +--- + testdata/dnn/download_models_basic.py | 159 ++++++++++++++++++++++++++ + 1 file changed, 159 insertions(+) + create mode 100644 testdata/dnn/download_models_basic.py + +diff --git a/testdata/dnn/download_models_basic.py b/testdata/dnn/download_models_basic.py +new file mode 100644 +index 0000000..5c8a616 +--- /dev/null ++++ b/testdata/dnn/download_models_basic.py +@@ -0,0 +1,159 @@ ++#!/usr/bin/env python ++ ++from __future__ import print_function ++import hashlib ++import sys ++import tarfile ++if sys.version_info[0] < 3: ++ from urllib2 import urlopen ++else: ++ from urllib.request import urlopen ++ ++ ++class Model: ++ MB = 1024*1024 ++ BUFSIZE = 10*MB ++ ++ def __init__(self, **kwargs): ++ self.name = kwargs.pop('name') ++ self.url = kwargs.pop('url', None) ++ self.filename = kwargs.pop('filename') ++ self.sha = kwargs.pop('sha', None) ++ self.archive = kwargs.pop('archive', None) ++ self.member = kwargs.pop('member', None) ++ ++ def __str__(self): ++ return 'Model <{}>'.format(self.name) ++ ++ def printRequest(self, r): ++ def getMB(r): ++ d = dict(r.info()) ++ for c in ['content-length', 'Content-Length']: ++ if c in d: ++ return int(d[c]) / self.MB ++ return '' ++ print(' {} {} [{} Mb]'.format(r.getcode(), r.msg, getMB(r))) ++ ++ def verify(self): ++ if not self.sha: ++ return False ++ print(' expect {}'.format(self.sha)) ++ sha = hashlib.sha1() ++ try: ++ with open(self.filename, 'rb') as f: ++ while True: ++ buf = f.read(self.BUFSIZE) ++ if not buf: ++ break ++ sha.update(buf) ++ print(' actual {}'.format(sha.hexdigest())) ++ return self.sha == sha.hexdigest() ++ except Exception as e: ++ print(' catch {}'.format(e)) ++ ++ def get(self): ++ if self.verify(): ++ print(' hash match - skipping') ++ return True ++ ++ if self.archive or self.member: ++ assert(self.archive and self.member) ++ print(' hash check failed - extracting') ++ print(' get {}'.format(self.member)) ++ self.extract() ++ else: ++ assert(self.url) ++ print(' hash check failed - downloading') ++ print(' get {}'.format(self.url)) ++ self.download() ++ ++ print(' done') ++ print(' file {}'.format(self.filename)) ++ return self.verify() ++ ++ def download(self): ++ try: ++ r = urlopen(self.url, timeout=60) ++ self.printRequest(r) ++ self.save(r) ++ except Exception as e: ++ print(' catch {}'.format(e)) ++ ++ def extract(self): ++ try: ++ with tarfile.open(self.archive) as f: ++ assert self.member in f.getnames() ++ self.save(f.extractfile(self.member)) ++ except Exception as e: ++ print(' catch {}'.format(e)) ++ ++ def save(self, r): ++ with open(self.filename, 'wb') as f: ++ print(' progress ', end='') ++ sys.stdout.flush() ++ while True: ++ buf = r.read(self.BUFSIZE) ++ if not buf: ++ break ++ f.write(buf) ++ print('>', end='') ++ sys.stdout.flush() ++ ++models = [ ++ Model( ++ name='Fcn', ++ url='http://dl.caffe.berkeleyvision.org/fcn8s-heavy-pascal.caffemodel', ++ sha='c449ea74dd7d83751d1357d6a8c323fcf4038962', ++ filename='fcn8s-heavy-pascal.caffemodel'), ++ Model( ++ name='SqueezeNet_v1.1', ++ url='https://raw.githubusercontent.com/DeepScale/SqueezeNet/b5c3f1a23713c8b3fd7b801d229f6b04c64374a5/SqueezeNet_v1.1/squeezenet_v1.1.caffemodel', ++ sha='3397f026368a45ae236403ccc81cfcbe8ebe1bd0', ++ filename='squeezenet_v1.1.caffemodel'), ++ Model( ++ name='Colorization', ++ url='https://raw.githubusercontent.com/richzhang/colorization/master/models/colorization_deploy_v2.prototxt', ++ sha='f528334e386a69cbaaf237a7611d833bef8e5219', ++ filename='colorization_deploy_v2.prototxt'), ++ Model( ++ name='Colorization', ++ url='http://eecs.berkeley.edu/~rich.zhang/projects/2016_colorization/files/demo_v2/colorization_release_v2.caffemodel', ++ sha='21e61293a3fa6747308171c11b6dd18a68a26e7f', ++ filename='colorization_release_v2.caffemodel'), ++ Model( ++ name='OpenPose/pose/coco', # https://github.com/CMU-Perceptual-Computing-Lab/openpose ++ url='http://posefs1.perception.cs.cmu.edu/OpenPose/models/pose/coco/pose_iter_440000.caffemodel', ++ sha='ac7e97da66f3ab8169af2e601384c144e23a95c1', ++ filename='openpose_pose_coco.caffemodel'), ++ Model( ++ name='YOLOv3', # https://pjreddie.com/darknet/yolo/ ++ url='https://pjreddie.com/media/files/yolov3.weights', ++ sha='520878f12e97cf820529daea502acca380f1cb8e', ++ filename='yolov3.weights'), ++ Model( ++ name='EAST', # https://github.com/argman/EAST (a TensorFlow model), https://arxiv.org/abs/1704.03155v2 (a paper) ++ url='https://www.dropbox.com/s/r2ingd0l3zt8hxs/frozen_east_text_detection.tar.gz?dl=1', ++ sha='3ca8233d6edd748f7ed23246c8ca24cbf696bb94', ++ filename='frozen_east_text_detection.tar.gz'), ++ Model( ++ name='EAST', ++ archive='frozen_east_text_detection.tar.gz', ++ member='frozen_east_text_detection.pb', ++ sha='fffabf5ac36f37bddf68e34e84b45f5c4247ed06', ++ filename='frozen_east_text_detection.pb'), ++] ++ ++# Note: models will be downloaded to current working directory ++# expected working directory is opencv_extra/testdata/dnn ++if __name__ == '__main__': ++ failedModels = [] ++ for m in models: ++ print(m) ++ if not m.get(): ++ failedModels.append(m.filename) ++ ++ if failedModels: ++ print("Following models have not been downloaded:") ++ for f in failedModels: ++ print("* {}".format(f)) ++ exit(15) +-- +2.17.1 + diff --git a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-support/opencv/opencv/0001-Dont-use-isystem.patch b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-support/opencv/opencv/0001-Dont-use-isystem.patch new file mode 100644 index 000000000..948a80faf --- /dev/null +++ b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-support/opencv/opencv/0001-Dont-use-isystem.patch @@ -0,0 +1,28 @@ +From 66e50ee69fa9ee2469d349100e70d8b296c4b4dc Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Tue, 11 Sep 2018 00:21:18 -0700 +Subject: [PATCH] Dont use isystem + +clang really does not like it + +Upstream-Status: Pending + +Signed-off-by: Khem Raj + +--- + cmake/OpenCVPCHSupport.cmake | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/cmake/OpenCVPCHSupport.cmake b/cmake/OpenCVPCHSupport.cmake +index 08cd06def4..46c9c02da3 100644 +--- a/cmake/OpenCVPCHSupport.cmake ++++ b/cmake/OpenCVPCHSupport.cmake +@@ -18,6 +18,8 @@ IF(CV_GCC) + SET(PCHSupport_FOUND TRUE) + ENDIF() + ++ SET(CMAKE_INCLUDE_SYSTEM_FLAG_C "-I") ++ SET(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-I") + SET(_PCH_include_prefix "-I") + SET(_PCH_isystem_prefix "-isystem") + SET(_PCH_define_prefix "-D") diff --git a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-support/opencv/opencv/0001-Make-ts-module-external.patch b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-support/opencv/opencv/0001-Make-ts-module-external.patch new file mode 100644 index 000000000..d56b8ae67 --- /dev/null +++ b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-support/opencv/opencv/0001-Make-ts-module-external.patch @@ -0,0 +1,42 @@ +From 11bbf909e08594628bd757d989ae34cf1bfe200b Mon Sep 17 00:00:00 2001 +From: Mingli Yu +Date: Thu, 18 Jun 2020 05:51:38 +0000 +Subject: [PATCH] Make ts module external + +Make ts module external + +Reference: https://github.com/qbonnard/opencv/commit/6b229c5834cb9a0930425e762a6c7b03244d7abb + +Upstream-Status: Submitted [https://github.com/opencv/opencv/issues/8408] + +Signed-off-by: Mingli Yu +--- + modules/ts/CMakeLists.txt | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +diff --git a/modules/ts/CMakeLists.txt b/modules/ts/CMakeLists.txt +index f95bed0793..66f315bcca 100644 +--- a/modules/ts/CMakeLists.txt ++++ b/modules/ts/CMakeLists.txt +@@ -4,9 +4,6 @@ if(NOT BUILD_opencv_ts AND NOT BUILD_TESTS AND NOT BUILD_PERF_TESTS) + ocv_module_disable(ts) + endif() + +-set(OPENCV_MODULE_TYPE STATIC) +-set(OPENCV_MODULE_IS_PART_OF_WORLD FALSE) +- + if(WINRT) + # WINRT doesn't have access to environment variables + # so adding corresponding macros during CMake run +@@ -16,7 +13,7 @@ endif() + + ocv_warnings_disable(CMAKE_CXX_FLAGS -Wundef) + +-ocv_add_module(ts INTERNAL opencv_core opencv_imgproc opencv_imgcodecs opencv_videoio opencv_highgui) ++ocv_add_module(ts opencv_core opencv_imgproc opencv_imgcodecs opencv_videoio opencv_highgui) + + ocv_glob_module_sources() + ocv_module_include_directories() +-- +2.24.1 + diff --git a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-support/opencv/opencv/0001-Temporarliy-work-around-deprecated-ffmpeg-RAW-functi.patch b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-support/opencv/opencv/0001-Temporarliy-work-around-deprecated-ffmpeg-RAW-functi.patch new file mode 100644 index 000000000..1e47f8b16 --- /dev/null +++ b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-support/opencv/opencv/0001-Temporarliy-work-around-deprecated-ffmpeg-RAW-functi.patch @@ -0,0 +1,31 @@ +From e4ec6cea72da9e9ae5ba57140fa2f5c63f1f8295 Mon Sep 17 00:00:00 2001 +From: Jason Wessel +Date: Wed, 9 May 2018 13:33:59 -0700 +Subject: [PATCH] Temporarliy work around deprecated ffmpeg RAW function + compile failure until next uprev + +Signed-off-by: Jason Wessel + +--- + modules/videoio/src/cap_ffmpeg_impl.hpp | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/modules/videoio/src/cap_ffmpeg_impl.hpp b/modules/videoio/src/cap_ffmpeg_impl.hpp +index 6dca724a89..ae55dd4555 100644 +--- a/modules/videoio/src/cap_ffmpeg_impl.hpp ++++ b/modules/videoio/src/cap_ffmpeg_impl.hpp +@@ -774,6 +774,14 @@ struct ImplMutex::Impl + + #endif + ++/* NOTE This is deprecated in ffmpeg and the code should be removed */ ++#ifndef AVFMT_RAWPICTURE ++#define AVFMT_RAWPICTURE 0x0020 ++#endif /* AVFMT_RAWPICTURE */ ++#ifndef CODEC_FLAG_GLOBAL_HEADER ++#define CODEC_FLAG_GLOBAL_HEADER AV_CODEC_FLAG_GLOBAL_HEADER ++#endif ++ + void ImplMutex::init() + { + impl = new Impl(); diff --git a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-support/opencv/opencv/0003-To-fix-errors-as-following.patch b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-support/opencv/opencv/0003-To-fix-errors-as-following.patch new file mode 100644 index 000000000..bb47ef2ba --- /dev/null +++ b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-support/opencv/opencv/0003-To-fix-errors-as-following.patch @@ -0,0 +1,70 @@ +From f42c9b8c7bafcadc7e95fb25a391707f970eb426 Mon Sep 17 00:00:00 2001 +From: Huang Qiyu +Date: Fri, 19 May 2017 04:27:50 +0900 +Subject: [PATCH] To fix errors as following: + +"test_main.cpp:45: undefined reference to `parseCustomOptions(int, char**)'" +"perf_abs.cpp:13: undefined reference to `cvtest::param_seed'" +"test_superres.cpp:270: undefined reference to `checkIppStatus()'" + +Signed-off-by: Huang Qiyu + +Also add the visibility changes for certain OpenCL-related functions in +ts module. + +Signed-off-by: Ismo Puustinen + +--- + modules/ts/include/opencv2/ts.hpp | 4 ++-- + modules/ts/include/opencv2/ts/ocl_test.hpp | 2 +- + modules/ts/include/opencv2/ts/ts_ext.hpp | 2 +- + 3 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/modules/ts/include/opencv2/ts.hpp b/modules/ts/include/opencv2/ts.hpp +index ed7491a89a..80919d13ee 100644 +--- a/modules/ts/include/opencv2/ts.hpp ++++ b/modules/ts/include/opencv2/ts.hpp +@@ -728,7 +728,7 @@ protected: + } + }; + +-extern uint64 param_seed; ++CV_EXPORTS extern uint64 param_seed; + + struct DefaultRngAuto + { +@@ -791,7 +791,7 @@ private: + #endif + #endif + +-void parseCustomOptions(int argc, char **argv); ++CV_EXPORTS void parseCustomOptions(int argc, char **argv); + + #define CV_TEST_INIT0_NOOP (void)0 + +diff --git a/modules/ts/include/opencv2/ts/ocl_test.hpp b/modules/ts/include/opencv2/ts/ocl_test.hpp +index 11572e9f48..438112e2aa 100644 +--- a/modules/ts/include/opencv2/ts/ocl_test.hpp ++++ b/modules/ts/include/opencv2/ts/ocl_test.hpp +@@ -82,7 +82,7 @@ inline UMat ToUMat(InputArray src) + return dst; + } + +-extern int test_loop_times; ++CV_EXPORTS extern int test_loop_times; + + #define MAX_VALUE 357 + +diff --git a/modules/ts/include/opencv2/ts/ts_ext.hpp b/modules/ts/include/opencv2/ts/ts_ext.hpp +index b2a4cac241..b94c681c0c 100644 +--- a/modules/ts/include/opencv2/ts/ts_ext.hpp ++++ b/modules/ts/include/opencv2/ts/ts_ext.hpp +@@ -9,7 +9,7 @@ + #define OPENCV_TS_EXT_HPP + + namespace cvtest { +-void checkIppStatus(); ++CV_EXPORTS void checkIppStatus(); + extern bool skipUnstableTests; + extern bool runBigDataTests; + extern int testThreads; diff --git a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-support/opencv/opencv/OpenCV_DNN_examples.patch b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-support/opencv/opencv/OpenCV_DNN_examples.patch new file mode 100644 index 000000000..ef7831a5f --- /dev/null +++ b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-support/opencv/opencv/OpenCV_DNN_examples.patch @@ -0,0 +1,141 @@ +From 3c4daafb54f961e376104a461ca7ec114ff0331a Mon Sep 17 00:00:00 2001 +From: Ludek Slosarcik +Date: Fri, 14 Feb 2020 15:46:50 +0100 +Subject: [PATCH] opencv_dnn: added video device for 2 examples, and change text labels + +Signed-off-by: Ludek Slosarcik + +Upstream-Status: Pending +--- + samples/cpp/logistic_regression.cpp | 2 +- + samples/dnn/classification.cpp | 7 ++++--- + samples/dnn/object_detection.cpp | 10 +++++----- + samples/dnn/segmentation.cpp | 2 +- + samples/dnn/text_detection.cpp | 5 +++-- + 5 files changed, 14 insertions(+), 12 deletions(-) + +Index: git/samples/cpp/logistic_regression.cpp +=================================================================== +--- git.orig/samples/cpp/logistic_regression.cpp ++++ git/samples/cpp/logistic_regression.cpp +@@ -28,7 +28,7 @@ static float calculateAccuracyPercent(co + + int main() + { +- const String filename = samples::findFile("data01.xml"); ++ const String filename = samples::findFile("../data/data01.xml"); + cout << "**********************************************************************" << endl; + cout << filename + << " contains digits 0 and 1 of 20 samples each, collected on an Android device" << endl; +Index: git/samples/dnn/classification.cpp +=================================================================== +--- git.orig/samples/dnn/classification.cpp ++++ git/samples/dnn/classification.cpp +@@ -12,6 +12,7 @@ std::string keys = + "{ help h | | Print help message. }" + "{ @alias | | An alias name of model to extract preprocessing parameters from models.yml file. }" + "{ zoo | models.yml | An optional path to file with preprocessing parameters }" ++ "{ device | 0 | camera device number. }" + "{ input i | | Path to input image or video file. Skip this argument to capture frames from a camera.}" + "{ initial_width | 0 | Preprocess input image by initial resizing to a specific width.}" + "{ initial_height | 0 | Preprocess input image by initial resizing to a specific height.}" +@@ -113,7 +114,7 @@ int main(int argc, char** argv) + if (parser.has("input")) + cap.open(parser.get("input")); + else +- cap.open(0); ++ cap.open(parser.get("device")); + //! [Open a video file or an image file or a camera stream] + + // Process frames. +@@ -195,14 +196,14 @@ int main(int argc, char** argv) + } + std::string label = format("Inference time of 1 round: %.2f ms", t1); + std::string label2 = format("Average time of 200 rounds: %.2f ms", timeRecorder.getTimeMilli()/200); +- putText(frame, label, Point(0, 15), FONT_HERSHEY_SIMPLEX, 0.5, Scalar(0, 255, 0)); +- putText(frame, label2, Point(0, 35), FONT_HERSHEY_SIMPLEX, 0.5, Scalar(0, 255, 0)); ++ putText(frame, label, Point(0, 20), FONT_HERSHEY_SIMPLEX, 0.8, Scalar(0, 0, 255), 2, 8, false); ++ putText(frame, label2, Point(0, 45), FONT_HERSHEY_SIMPLEX, 0.8, Scalar(0, 0, 255), 2, 8, false); + + // Print predicted class. + label = format("%s: %.4f", (classes.empty() ? format("Class #%d", classId).c_str() : + classes[classId].c_str()), + confidence); +- putText(frame, label, Point(0, 55), FONT_HERSHEY_SIMPLEX, 0.5, Scalar(0, 255, 0)); ++ putText(frame, label, Point(0, 70), FONT_HERSHEY_SIMPLEX, 0.8, Scalar(0, 0, 255), 2, 8, false); + + imshow(kWinName, frame); + } +Index: git/samples/dnn/object_detection.cpp +=================================================================== +--- git.orig/samples/dnn/object_detection.cpp ++++ git/samples/dnn/object_detection.cpp +@@ -260,13 +260,13 @@ int main(int argc, char** argv) + if (predictionsQueue.counter > 1) + { + std::string label = format("Camera: %.2f FPS", framesQueue.getFPS()); +- putText(frame, label, Point(0, 15), FONT_HERSHEY_SIMPLEX, 0.5, Scalar(0, 255, 0)); ++ putText(frame, label, Point(0, 20), FONT_HERSHEY_SIMPLEX, 0.8, Scalar(0, 0, 255), 2, 8, false); + + label = format("Network: %.2f FPS", predictionsQueue.getFPS()); +- putText(frame, label, Point(0, 30), FONT_HERSHEY_SIMPLEX, 0.5, Scalar(0, 255, 0)); ++ putText(frame, label, Point(0, 45), FONT_HERSHEY_SIMPLEX, 0.8, Scalar(0, 0, 255), 2, 8, false); + + label = format("Skipped frames: %d", framesQueue.counter - predictionsQueue.counter); +- putText(frame, label, Point(0, 45), FONT_HERSHEY_SIMPLEX, 0.5, Scalar(0, 255, 0)); ++ putText(frame, label, Point(0, 70), FONT_HERSHEY_SIMPLEX, 0.8, Scalar(0, 0, 255), 2, 8, false); + } + imshow(kWinName, frame); + } +@@ -302,7 +302,7 @@ int main(int argc, char** argv) + double freq = getTickFrequency() / 1000; + double t = net.getPerfProfile(layersTimes) / freq; + std::string label = format("Inference time: %.2f ms", t); +- putText(frame, label, Point(0, 15), FONT_HERSHEY_SIMPLEX, 0.5, Scalar(0, 255, 0)); ++ putText(frame, label, Point(0, 20), FONT_HERSHEY_SIMPLEX, 0.8, Scalar(0, 0, 255), 2, 8, false); + + imshow(kWinName, frame); + } +@@ -471,7 +471,7 @@ void drawPred(int classId, float conf, i + top = max(top, labelSize.height); + rectangle(frame, Point(left, top - labelSize.height), + Point(left + labelSize.width, top + baseLine), Scalar::all(255), FILLED); +- putText(frame, label, Point(left, top), FONT_HERSHEY_SIMPLEX, 0.5, Scalar()); ++ putText(frame, label, Point(left, top), FONT_HERSHEY_SIMPLEX, 0.8, Scalar()); + } + + void callback(int pos, void*) +Index: git/samples/dnn/segmentation.cpp +=================================================================== +--- git.orig/samples/dnn/segmentation.cpp ++++ git/samples/dnn/segmentation.cpp +@@ -162,7 +162,7 @@ int main(int argc, char** argv) + double freq = getTickFrequency() / 1000; + double t = net.getPerfProfile(layersTimes) / freq; + std::string label = format("Inference time: %.2f ms", t); +- putText(frame, label, Point(0, 15), FONT_HERSHEY_SIMPLEX, 0.5, Scalar(0, 255, 0)); ++ putText(frame, label, Point(0, 20), FONT_HERSHEY_SIMPLEX, 0.8, Scalar(0, 0, 255), 2, 8, false); + + imshow(kWinName, frame); + if (!classes.empty()) +Index: git/samples/dnn/text_detection.cpp +=================================================================== +--- git.orig/samples/dnn/text_detection.cpp ++++ git/samples/dnn/text_detection.cpp +@@ -30,6 +30,7 @@ using namespace cv::dnn; + const char* keys = + "{ help h | | Print help message. }" + "{ input i | | Path to input image or video file. Skip this argument to capture frames from a camera.}" ++ "{ device | 0 | camera device number. }" + "{ detModel dmp | | Path to a binary .pb file contains trained detector network.}" + "{ width | 320 | Preprocess input image by resizing to a specific width. It should be multiple by 32. }" + "{ height | 320 | Preprocess input image by resizing to a specific height. It should be multiple by 32. }" +@@ -106,7 +107,7 @@ int main(int argc, char** argv) + + // Open a video file or an image file or a camera stream. + VideoCapture cap; +- bool openSuccess = parser.has("input") ? cap.open(parser.get("input")) : cap.open(0); ++ bool openSuccess = parser.has("input") ? cap.open(parser.get("input")) : cap.open(parser.get("device")); + CV_Assert(openSuccess); + + static const std::string kWinName = "EAST: An Efficient and Accurate Scene Text Detector"; diff --git a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-support/opencv/opencv/download.patch b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-support/opencv/opencv/download.patch new file mode 100644 index 000000000..33ac48312 --- /dev/null +++ b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-support/opencv/opencv/download.patch @@ -0,0 +1,41 @@ +From b18a280fab06a680d9f831bf8b462647f3cb6214 Mon Sep 17 00:00:00 2001 +From: Ross Burton +Date: Thu, 9 Jan 2020 16:24:24 +0000 +Subject: [PATCH] opencv: abort configure if we need to download + +This CMake module will download files during do_configure. This is bad as it +means we can't do offline builds. + +Add an option to disallow downloads by emitting a fatal error. + +Upstream-Status: Pending +Signed-off-by: Ross Burton + +--- + cmake/OpenCVDownload.cmake | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/cmake/OpenCVDownload.cmake b/cmake/OpenCVDownload.cmake +index 63cf6d3238..4acf477f70 100644 +--- a/cmake/OpenCVDownload.cmake ++++ b/cmake/OpenCVDownload.cmake +@@ -14,6 +14,7 @@ + # RELATIVE_URL - if set, then URL is treated as a base, and FILENAME will be appended to it + # Note: uses OPENCV_DOWNLOAD_PATH folder as cache, default is /.cache + ++set(OPENCV_ALLOW_DOWNLOADS ON CACHE BOOL "Allow downloads") + set(HELP_OPENCV_DOWNLOAD_PATH "Cache directory for downloaded files") + if(DEFINED ENV{OPENCV_DOWNLOAD_PATH}) + set(OPENCV_DOWNLOAD_PATH "$ENV{OPENCV_DOWNLOAD_PATH}" CACHE PATH "${HELP_OPENCV_DOWNLOAD_PATH}") +@@ -156,6 +157,11 @@ function(ocv_download) + + # Download + if(NOT EXISTS "${CACHE_CANDIDATE}") ++ if(NOT OPENCV_ALLOW_DOWNLOADS) ++ message(FATAL_ERROR "Not going to download ${DL_FILENAME}") ++ return() ++ endif() ++ + ocv_download_log("#cmake_download \"${CACHE_CANDIDATE}\" \"${DL_URL}\"") + foreach(try ${OPENCV_DOWNLOAD_TRIES_LIST}) + ocv_download_log("#try ${try}") diff --git a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-support/opencv/opencv_4.7.0.imx.bb b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-support/opencv/opencv_4.7.0.imx.bb new file mode 100644 index 000000000..7f95691a1 --- /dev/null +++ b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-support/opencv/opencv_4.7.0.imx.bb @@ -0,0 +1,23 @@ +# Copyright 2024 Digi International Inc. + +# +# Reuse meta-freescale's opencv_4.6.0.imx.bb +# +require recipes-support/opencv/opencv_4.6.0.imx.bb + +SRC_URI:remove = "file://0001-Add-missing-header-for-LIBAVCODEC_VERSION_INT.patch" + +SRCBRANCH = "4.7.0_imx" +SRCREV_opencv = "3acf6a50fcb4f774728d2338553ad646ccc14b14" + +# Update opencv_contrib +SRC_URI:remove = "git://github.com/opencv/opencv_contrib.git;destsuffix=git/contrib;name=contrib;branch=master;protocol=https" +SRC_URI += "git://github.com/opencv/opencv_contrib.git;destsuffix=git/contrib;name=contrib;branch=4.x;protocol=https" +SRCREV_contrib = "e247b680a6bd396f110274b6c214406a93171350" + +SRC_URI:remove = "git://github.com/opencv/opencv_extra.git;destsuffix=extra;name=extra;branch=master;protocol=https" +SRC_URI =+ "git://github.com/opencv/opencv_extra.git;destsuffix=extra;name=extra;branch=4.x;protocol=https" + +SRCREV_extra = "5abbd7e0546bbb34ae7487170383d3e571fb1dd1" + +COMPATIBLE_MACHINE = "(mx9-nxp-bsp)" 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 93cd9f05f..ea93c7e6d 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 @@ -74,7 +74,7 @@ do_deploy:append() { i="$(expr ${i} + 1)" dt_config="$(echo ${FIP_DEVICETREE} | cut -d',' -f${i})" for dt in ${dt_config}; do - FIP_FILENAME="${FIP_BASENAME}-${dt}-${config}.${FIP_SUFFIX}" + FIP_FILENAME="${FIP_BASENAME}-${dt}-${config}${FIP_SIGN_SUFFIX}.${FIP_SUFFIX}" echo "${FIP_FILENAME}" if [ -f "${DEPLOYDIR}/fip/${FIP_FILENAME}" ]; then cd "${DEPLOYDIR}" @@ -104,9 +104,11 @@ tfa_sign() { 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" + trustfence-sign-artifact.sh -p "${DIGI_SOM}" -t "${DEPLOYDIR}/arm-trusted-firmware/${TF_A_FILENAME}" "${DEPLOYDIR}/arm-trusted-firmware/${TF_A_FILENAME}${TFA_SIGN_SUFFIX}" # the generated artifact lacks 'w' permission which prevents deletion by the build system - chmod u+w "${DEPLOYDIR}/arm-trusted-firmware/${TF_A_FILENAME}_signed" + chmod u+w "${DEPLOYDIR}/arm-trusted-firmware/${TF_A_FILENAME}${TFA_SIGN_SUFFIX}" + # symlink TF-A + ln -s "arm-trusted-firmware/${TF_A_FILENAME}${TFA_SIGN_SUFFIX}" "${DEPLOYDIR}/" fi esac done # for file_type in ${tfa_file_type} diff --git a/meta-digi-arm/recipes-bsp/firmware-qualcomm/firmware-qualcomm.bb b/meta-digi-arm/recipes-bsp/firmware-qualcomm/firmware-qualcomm.bb index 58b65f655..fc3437f36 100644 --- a/meta-digi-arm/recipes-bsp/firmware-qualcomm/firmware-qualcomm.bb +++ b/meta-digi-arm/recipes-bsp/firmware-qualcomm/firmware-qualcomm.bb @@ -144,4 +144,4 @@ FILES:${PN}-${QCA_MODEL}-bt = "/lib/firmware/qca" FILES:${PN}-${QCA_MODEL}-wifi = "/lib/firmware" PACKAGE_ARCH = "${MACHINE_ARCH}" -COMPATIBLE_MACHINE = "(ccimx6$|ccimx6ul|ccimx8x|ccimx8m)" +COMPATIBLE_MACHINE = "(ccimx6$|ccimx6ul|ccimx8m|ccimx8x)" diff --git a/meta-digi-arm/recipes-bsp/libubootenv/libubootenv/0005-Implement-support-for-environment-encryption-for-CCM.patch b/meta-digi-arm/recipes-bsp/libubootenv/libubootenv/0005-Implement-support-for-environment-encryption-for-CCM.patch index 04962f18a..023cb1d8c 100644 --- a/meta-digi-arm/recipes-bsp/libubootenv/libubootenv/0005-Implement-support-for-environment-encryption-for-CCM.patch +++ b/meta-digi-arm/recipes-bsp/libubootenv/libubootenv/0005-Implement-support-for-environment-encryption-for-CCM.patch @@ -1,4 +1,4 @@ -From 89b035959578fe0d7714748487dad875bc018ef5 Mon Sep 17 00:00:00 2001 +From 768cac09ee47729e3ef38b477c7a69e5b3d10c60 Mon Sep 17 00:00:00 2001 From: Mike Engel Date: Fri, 26 May 2023 11:21:43 +0200 Subject: [PATCH] Implement support for environment encryption for CCMP1 @@ -19,8 +19,8 @@ Signed-off-by: Mike Engel src/teec_benchmark.h | 37 ++ src/teec_trace.c | 141 +++++ src/teec_trace.h | 148 +++++ - src/uboot_env.c | 181 +++++- - 11 files changed, 2655 insertions(+), 4 deletions(-) + src/uboot_env.c | 180 +++++- + 11 files changed, 2654 insertions(+), 4 deletions(-) create mode 100644 src/ta_ccmp1_aes.h create mode 100644 src/tee.h create mode 100644 src/tee_bench.h @@ -2576,7 +2576,7 @@ index 0000000..b1e37ec + +#endif diff --git a/src/uboot_env.c b/src/uboot_env.c -index 86f9b9e..f9aa985 100644 +index 86f9b9e..45b356f 100644 --- a/src/uboot_env.c +++ b/src/uboot_env.c @@ -41,6 +41,9 @@ @@ -2598,15 +2598,7 @@ index 86f9b9e..f9aa985 100644 { int i; int len; -@@ -993,6 +996,7 @@ static int env_caam_get_keymod(unsigned char output[16]) - return -1; - } - ocotp_hwid[i] = ntohl(*(uint32_t *)buf); -+ fprintf(stderr, "HWID_%d %x \n ",i,ocotp_hwid[i]); - close(fd); - } else if (machine_is_compatible("digi,ccimx6ul") || - machine_is_compatible("digi,ccimx6")) { -@@ -1040,7 +1044,7 @@ static int env_caam_crypt(char *data, unsigned int size, const int enc) +@@ -1040,7 +1043,7 @@ static int env_caam_crypt(char *data, unsigned int size, const int enc) char *buffer; unsigned char key_modifier[16]; @@ -2615,7 +2607,7 @@ index 86f9b9e..f9aa985 100644 if (ret) return ret; -@@ -1087,6 +1091,165 @@ free: +@@ -1087,6 +1090,165 @@ free: return ret; } @@ -2781,7 +2773,7 @@ index 86f9b9e..f9aa985 100644 int libuboot_env_store(struct uboot_ctx *ctx) { struct var_entry *entry; -@@ -1163,7 +1326,12 @@ int libuboot_env_store(struct uboot_ctx *ctx) +@@ -1163,7 +1325,12 @@ int libuboot_env_store(struct uboot_ctx *ctx) } if (ctx->encrypted) { @@ -2795,7 +2787,7 @@ index 86f9b9e..f9aa985 100644 if (ret) { fprintf(stderr, "Error: can't encrypt env for flash\n"); -@@ -1237,7 +1405,12 @@ static int libuboot_load(struct uboot_ctx *ctx) +@@ -1237,7 +1404,12 @@ static int libuboot_load(struct uboot_ctx *ctx) crc = *(uint32_t *)(buf[i] + offsetcrc); dev->crc = crc32(0, (uint8_t *)data, usable_envsize); if (ctx->encrypted) { diff --git a/meta-digi-arm/recipes-bsp/libubootenv/libubootenv/ccimx93/mmc/fw_env.config b/meta-digi-arm/recipes-bsp/libubootenv/libubootenv/ccimx93/mmc/fw_env.config new file mode 100644 index 000000000..5e4566345 --- /dev/null +++ b/meta-digi-arm/recipes-bsp/libubootenv/libubootenv/ccimx93/mmc/fw_env.config @@ -0,0 +1,7 @@ +# Configuration file for fw_(printenv/setenv) utility. +# Up to two entries are valid, in this case the redundant +# environment sector is assumed present. + +# Device name Offset Size +/dev/mmcblk0boot0 -0x4000 0x4000 +/dev/mmcblk0boot1 -0x4000 0x4000 diff --git a/meta-digi-arm/recipes-bsp/trustfence-cst/nativesdk-trustfence-cst_3.3.1.bb b/meta-digi-arm/recipes-bsp/trustfence-cst/nativesdk-trustfence-cst_3.3.2.bb similarity index 100% rename from meta-digi-arm/recipes-bsp/trustfence-cst/nativesdk-trustfence-cst_3.3.1.bb rename to meta-digi-arm/recipes-bsp/trustfence-cst/nativesdk-trustfence-cst_3.3.2.bb diff --git a/meta-digi-arm/recipes-bsp/trustfence-cst/trustfence-cst-3.3.1.inc b/meta-digi-arm/recipes-bsp/trustfence-cst/trustfence-cst-3.3.2.inc similarity index 63% rename from meta-digi-arm/recipes-bsp/trustfence-cst/trustfence-cst-3.3.1.inc rename to meta-digi-arm/recipes-bsp/trustfence-cst/trustfence-cst-3.3.2.inc index cf5dda093..5406f6215 100644 --- a/meta-digi-arm/recipes-bsp/trustfence-cst/trustfence-cst-3.3.1.inc +++ b/meta-digi-arm/recipes-bsp/trustfence-cst/trustfence-cst-3.3.2.inc @@ -1,4 +1,4 @@ -# Copyright (C) 2017-2022 Digi International +# Copyright (C) 2017-2023 Digi International SUMMARY = "NXP Code signing Tool for the High Assurance Boot library" DESCRIPTION = "Provides software code signing support designed for use with \ @@ -9,32 +9,28 @@ LIC_FILES_CHKSUM = "file://LICENSE.bsd3;md5=1fbcd66ae51447aa94da10cbf6271530" DEPENDS = "byacc-native flex-native" -OPENSSL1_VERSION = "1.1.1s" +OPENSSL1_VERSION = "1.1.1t" SRC_URI = " \ ${DIGI_PKG_SRC}/cst-${PV}.tgz;name=cst \ https://www.openssl.org/source/openssl-${OPENSSL1_VERSION}.tar.gz;name=openssl \ file://0001-gen_auth_encrypted_data-reuse-existing-DEK-file.patch \ - file://0002-hab4_pki_tree.sh-automate-script.patch \ - file://0003-openssl_helper-use-dev-urandom-as-seed-source.patch \ - file://0004-hab4_pki_tree.sh-usa-a-random-password-for-the-defau.patch \ - file://0005-ahab_pki_tree.sh-automate-script.patch \ - file://0006-ahab_pki_tree.sh-use-a-random-password-for-the-defau.patch \ - file://0007-rules.mk-weaken-specific-function-err_msg.patch \ - file://0008-pki_tree.sh-extract-public-keys-from-certificates.patch \ + file://0002-openssl_helper-use-dev-urandom-as-seed-source.patch \ + file://0003-hab4_pki_tree.sh-adapt-script-for-DEY.patch \ + file://0004-ahab_pki_tree.sh-adapt-script-for-DEY.patch \ " -SRC_URI[cst.md5sum] = "27ba9c8bc0b8a7f14d23185775c53794" -SRC_URI[cst.sha256sum] = "8b7e44e3e126f814f5caf8a634646fe64021405302ca59ff02f5c8f3b9a5abb9" -SRC_URI[openssl.md5sum] = "077f69d357758c7d6ef686f813e16f30" -SRC_URI[openssl.sha256sum] = "c5ac01e760ee6ff0dab61d6b2bbd30146724d063eb322180c6f18a6f74e4b6aa" +SRC_URI[cst.md5sum] = "4b9fccac381fa412cba8ba7028c154c7" +SRC_URI[cst.sha256sum] = "517b11dca181e8c438a6249f56f0a13a0eb251b30e690760be3bf6191ee06c68" +SRC_URI[openssl.md5sum] = "1cfee919e0eac6be62c88c5ae8bcd91e" +SRC_URI[openssl.sha256sum] = "8dee9b24bdb1dcbf0c3d1e9b02fb8f6bf22165e807f45adeb7c9677536859d3b" S = "${WORKDIR}/cst-${PV}" do_compile() { cd code/cst oe_runmake OPENSSL_PATH=${WORKDIR}/openssl-${OPENSSL1_VERSION} OSTYPE=linux64 openssl - oe_runmake OPENSSL_PATH=${WORKDIR}/openssl-${OPENSSL1_VERSION} OSTYPE=linux64 rel_bin + oe_runmake OPENSSL_PATH=${WORKDIR}/openssl-${OPENSSL1_VERSION} OSTYPE=linux64 os_bin } do_install() { diff --git a/meta-digi-arm/recipes-bsp/trustfence-cst/trustfence-cst/0001-gen_auth_encrypted_data-reuse-existing-DEK-file.patch b/meta-digi-arm/recipes-bsp/trustfence-cst/trustfence-cst-3.3.2/0001-gen_auth_encrypted_data-reuse-existing-DEK-file.patch similarity index 66% rename from meta-digi-arm/recipes-bsp/trustfence-cst/trustfence-cst/0001-gen_auth_encrypted_data-reuse-existing-DEK-file.patch rename to meta-digi-arm/recipes-bsp/trustfence-cst/trustfence-cst-3.3.2/0001-gen_auth_encrypted_data-reuse-existing-DEK-file.patch index 709cae579..887f79e83 100644 --- a/meta-digi-arm/recipes-bsp/trustfence-cst/trustfence-cst/0001-gen_auth_encrypted_data-reuse-existing-DEK-file.patch +++ b/meta-digi-arm/recipes-bsp/trustfence-cst/trustfence-cst-3.3.2/0001-gen_auth_encrypted_data-reuse-existing-DEK-file.patch @@ -12,14 +12,14 @@ https://jira.digi.com/browse/DUB-608 Signed-off-by: Diaz de Grenu, Jose --- - code/cst/code/back_end/src/adapt_layer_openssl.c | 1 + + code/cst/code/back_end-ssl/src/adapt_layer_openssl.c | 1 + 1 file changed, 1 insertion(+) -diff --git a/code/cst/code/back_end/src/adapt_layer_openssl.c b/code/cst/code/back_end/src/adapt_layer_openssl.c -index 38b8bf5..f389e23 100755 ---- a/code/cst/code/back_end/src/adapt_layer_openssl.c -+++ b/code/cst/code/back_end/src/adapt_layer_openssl.c -@@ -1146,6 +1146,7 @@ int32_t gen_auth_encrypted_data(const char* in_file, +diff --git a/code/cst/code/back_end-ssl/src/adapt_layer_openssl.c b/code/cst/code/back_end-ssl/src/adapt_layer_openssl.c +index d8df54e..86e7e4f 100755 +--- a/code/cst/code/back_end-ssl/src/adapt_layer_openssl.c ++++ b/code/cst/code/back_end-ssl/src/adapt_layer_openssl.c +@@ -1231,6 +1231,7 @@ int32_t gen_auth_encrypted_data(const char* in_file, printf("\n"); #endif if (0 == key_init_done) { diff --git a/meta-digi-arm/recipes-bsp/trustfence-cst/trustfence-cst/0003-openssl_helper-use-dev-urandom-as-seed-source.patch b/meta-digi-arm/recipes-bsp/trustfence-cst/trustfence-cst-3.3.2/0002-openssl_helper-use-dev-urandom-as-seed-source.patch similarity index 90% rename from meta-digi-arm/recipes-bsp/trustfence-cst/trustfence-cst/0003-openssl_helper-use-dev-urandom-as-seed-source.patch rename to meta-digi-arm/recipes-bsp/trustfence-cst/trustfence-cst-3.3.2/0002-openssl_helper-use-dev-urandom-as-seed-source.patch index 4aa674105..9035f62cb 100644 --- a/meta-digi-arm/recipes-bsp/trustfence-cst/trustfence-cst/0003-openssl_helper-use-dev-urandom-as-seed-source.patch +++ b/meta-digi-arm/recipes-bsp/trustfence-cst/trustfence-cst-3.3.2/0002-openssl_helper-use-dev-urandom-as-seed-source.patch @@ -10,10 +10,10 @@ Signed-off-by: Diaz de Grenu, Jose 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/cst/code/common/src/openssl_helper.c b/code/cst/code/common/src/openssl_helper.c -index 871cf55..b62c8a8 100755 +index 1e1131b..918c82e 100755 --- a/code/cst/code/common/src/openssl_helper.c +++ b/code/cst/code/common/src/openssl_helper.c -@@ -414,7 +414,7 @@ void print_version(void) +@@ -404,7 +404,7 @@ void print_version(void) ---------------------------*/ uint32_t seed_prng(uint32_t bytes) { diff --git a/meta-digi-arm/recipes-bsp/trustfence-cst/trustfence-cst/0002-hab4_pki_tree.sh-automate-script.patch b/meta-digi-arm/recipes-bsp/trustfence-cst/trustfence-cst-3.3.2/0003-hab4_pki_tree.sh-adapt-script-for-DEY.patch similarity index 69% rename from meta-digi-arm/recipes-bsp/trustfence-cst/trustfence-cst/0002-hab4_pki_tree.sh-automate-script.patch rename to meta-digi-arm/recipes-bsp/trustfence-cst/trustfence-cst-3.3.2/0003-hab4_pki_tree.sh-adapt-script-for-DEY.patch index b28303ae0..78bde2d42 100644 --- a/meta-digi-arm/recipes-bsp/trustfence-cst/trustfence-cst/0002-hab4_pki_tree.sh-automate-script.patch +++ b/meta-digi-arm/recipes-bsp/trustfence-cst/trustfence-cst-3.3.2/0003-hab4_pki_tree.sh-adapt-script-for-DEY.patch @@ -1,23 +1,32 @@ From: Arturo Buzarra Date: Wed, 22 Jul 2020 14:37:03 +0200 -Subject: [PATCH] hab4_pki_tree.sh: automate script +Subject: [PATCH] hab4_pki_tree.sh: adapt script for DEY -This commit introduce a new command line argument to specify the -CSF path folder and prepare it to automate the build process. +* support non interactive execution: introduce a new command line + argument to specify the CSF path folder and prepare it to automate the + build process. +* use a random password for the default PKI generation + +* extract public keys from certificates: the public key needs to be + available on the rootfs so that signed SWU packages can be authenticated. + +Co-Authored-By: Javier Viguera +Co-Authored-By: Hector Palacios +Co-Authored-By: Diaz de Grenu, Jose Signed-off-by: Arturo Buzarra --- - keys/hab4_pki_tree.sh | 78 ++++++++++++++++++++++++++++--------------- - 1 file changed, 51 insertions(+), 27 deletions(-) + keys/hab4_pki_tree.sh | 80 +++++++++++++++++++++++++++++-------------- + 1 file changed, 54 insertions(+), 26 deletions(-) diff --git a/keys/hab4_pki_tree.sh b/keys/hab4_pki_tree.sh -index 944cc66..39ed3bf 100755 +index 49834f0..de0c969 100755 --- a/keys/hab4_pki_tree.sh +++ b/keys/hab4_pki_tree.sh @@ -66,6 +66,8 @@ printf " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n" - + stty erase  - + +SCRIPT_BASEDIR="$(cd $(dirname ${0}) && pwd)" + if [ $# -gt 0 ]; then @@ -27,24 +36,24 @@ index 944cc66..39ed3bf 100755 echo "$0" echo echo "Command Line Mode:" -- echo "$0 -existing-ca [-ca-key -ca-cert ] -use-ecc -kl -duration -num-srk <1-4> -srk-ca " -+ echo "$0 [-csf-path] -existing-ca [-ca-key -ca-cert ] -use-ecc -kl -duration -num-srk <1-4> -srk-ca " - echo "Options:" - echo " -kl: -use-ecc = y then Supported key lengths: p256, p384, p521" - echo " : -use-ecc = n then Supported key lengths: 1024, 2048, 3072, 4096" -@@ -89,10 +91,18 @@ usage() +- echo "$0 -existing-ca [-ca-key -ca-cert ] -kt < rsa/rsa-pss/ecc> -kl -duration -num-srk <1-4> -srk-ca " ++ echo "$0 [-csf-path] -existing-ca [-ca-key -ca-cert ] -kt < rsa/rsa-pss/ecc> -kl -duration -num-srk <1-4> -srk-ca " + echo " Key Type Options:" + echo " -kl ecc : then Supported key lengths: p256, p384, p521" + echo " -kl rsa : then Supported key lengths: 1024, 2048, 3072, 4096" +@@ -90,10 +92,18 @@ usage() echo } - + -max_param=16 -min_param=12 +max_param=18 +min_param=1 num_param=1 - + +# Default values +existing_ca="n" -+use_ecc="n" ++kt="rsa" +kl=4096 +duration=10 +num_srk=4 @@ -53,7 +62,7 @@ index 944cc66..39ed3bf 100755 if [ $interactive = "n" ] then # Validate command line parameters -@@ -111,6 +121,11 @@ then +@@ -112,6 +122,11 @@ then while [ $num_param -le $max_param ] && [ "$1" != "" ] do case $1 in @@ -65,7 +74,7 @@ index 944cc66..39ed3bf 100755 -existing-ca) shift existing_ca=$1 -@@ -164,9 +179,8 @@ then +@@ -165,9 +180,8 @@ then shift ;; *) @@ -77,10 +86,10 @@ index 944cc66..39ed3bf 100755 ;; esac num_param=$(( num_param + 2 )) -@@ -242,6 +256,16 @@ then +@@ -261,6 +275,16 @@ then read duration fi - + +# CSF folder structure +if [ ! -d "${CSF_PATH}" ]; then + echo "Invalid CSF_PATH: ${CSF_PATH}" @@ -93,8 +102,8 @@ index 944cc66..39ed3bf 100755 + # Compute validity period val_period=$((duration*365)) - -@@ -275,9 +299,9 @@ then + +@@ -294,9 +318,9 @@ then script_name=$0 fi script_path=$(cd $(dirname "${script_name}") && pwd -P) @@ -104,13 +113,13 @@ index 944cc66..39ed3bf 100755 +keys_dir=${CSF_PATH}/keys/ +crts_dir=${CSF_PATH}/crts/ +ca_dir=${CSF_PATH}/ca/ - + if [ ! -d "${keys_dir}" ] then -@@ -291,11 +315,11 @@ then +@@ -310,11 +334,11 @@ then exit 1 fi - + -if [ ! -d "${ca_dir}" ] -then - echo ERROR: "Openssl configuration directory ${ca_dir} is missing. Expecting /ca directory to hold openssl configuration files." @@ -121,28 +130,33 @@ index 944cc66..39ed3bf 100755 +# echo ERROR: "Openssl configuration directory ${ca_dir} is missing. Expecting /ca directory to hold openssl configuration files." +# exit 1 +# fi - + # Switch current working directory to keys directory, if needed. if [ "${crt_dir}" != "${keys_dir}" ] -@@ -365,7 +389,7 @@ then +@@ -337,9 +361,10 @@ fi + # Check that the file "key_pass.txt" is present, if not create it with default user/pwd: + if [ ! -f key_pass.txt ] + then +- echo "test" > key_pass.txt +- echo "test" >> key_pass.txt +- echo "A default file 'key_pass.txt' was created with password = test!" ++ password="$(openssl rand -base64 32)" ++ echo "${password}" > key_pass.txt ++ echo "${password}" >> key_pass.txt ++ echo "A file 'key_pass.txt' was created with a random password!" + fi + + # The following is required otherwise OpenSSL complains +@@ -384,7 +409,7 @@ then -x509 -extensions v3_ca \ -keyout temp_ca.pem \ -out ${ca_cert}.pem \ - -days ${val_period} -config ../ca/openssl.cnf + -days ${val_period} -config "${SCRIPT_BASEDIR}/openssl.cnf" - + # Generate CA key in PKCS #8 format - both PEM and DER openssl pkcs8 -passin file:./key_pass.txt -passout file:./key_pass.txt \ -@@ -382,7 +406,7 @@ then - openssl x509 -inform PEM -outform DER -in ${ca_cert}.pem -out ${ca_cert}.der - - # Cleanup -- \rm temp_ca.pem -+ rm temp_ca.pem - fi - - -@@ -432,10 +456,10 @@ then +@@ -452,10 +477,10 @@ then -in ./temp_srk_req.pem \ -cert ${ca_cert}.pem \ -keyfile ${ca_key}.pem \ @@ -152,19 +166,10 @@ index 944cc66..39ed3bf 100755 -days ${val_period} \ - -config ../ca/openssl.cnf + -config "${SCRIPT_BASEDIR}/openssl.cnf" - + # Convert SRK Certificate to DER format openssl x509 -inform PEM -outform DER \ -@@ -456,7 +480,7 @@ then - -out ${srk_key}.pem - - # Cleanup -- \rm ./temp_srk.pem ./temp_srk_req.pem -+ rm ./temp_srk.pem ./temp_srk_req.pem - i=$((i+1)) - done - else -@@ -505,10 +529,10 @@ do +@@ -526,10 +551,10 @@ do -in ./temp_srk_req.pem \ -cert ${ca_cert}.pem \ -keyfile ${ca_key}.pem \ @@ -174,10 +179,10 @@ index 944cc66..39ed3bf 100755 -days ${val_period} \ - -config ../ca/openssl.cnf + -config "${SCRIPT_BASEDIR}/openssl.cnf" - + # Convert SRK Certificate to DER format openssl x509 -inform PEM -outform DER \ -@@ -574,10 +598,10 @@ do +@@ -596,10 +621,10 @@ do -in ./temp_csf_req.pem \ -cert ${srk_crt_i} \ -keyfile ${srk_key_i} \ @@ -187,19 +192,10 @@ index 944cc66..39ed3bf 100755 -days ${val_period} \ - -config ../ca/openssl.cnf + -config "${SCRIPT_BASEDIR}/openssl.cnf" - + # Convert CSF Certificate to DER format openssl x509 -inform PEM -outform DER \ -@@ -596,7 +620,7 @@ do - -out ${csf_key}.pem - - # Cleanup -- \rm ./temp_csf.pem ./temp_csf_req.pem -+ rm ./temp_csf.pem ./temp_csf_req.pem - - echo - echo ++++++++++++++++++++++++++++++++++++++++ -@@ -636,10 +660,10 @@ do +@@ -659,10 +684,10 @@ do -in ./temp_img_req.pem \ -cert ${srk_crt_i} \ -keyfile ${srk_key_i} \ @@ -209,15 +205,16 @@ index 944cc66..39ed3bf 100755 -days ${val_period} \ - -config ../ca/openssl.cnf + -config "${SCRIPT_BASEDIR}/openssl.cnf" - + # Convert IMG Certificate to DER format openssl x509 -inform PEM -outform DER \ -@@ -658,7 +682,7 @@ do +@@ -680,6 +705,9 @@ do + -in temp_img.pem \ -out ${img_key}.pem - + ++ # Extract public key from the certificate ++ openssl x509 -pubkey -noout -in "${img_crt}.pem" > ../crts/key${i}.pub ++ # Cleanup -- \rm ./temp_img.pem ./temp_img_req.pem -+ rm ./temp_img.pem ./temp_img_req.pem - - i=$((i+1)) - done + \rm ./temp_img.pem ./temp_img_req.pem + diff --git a/meta-digi-arm/recipes-bsp/trustfence-cst/trustfence-cst/0005-ahab_pki_tree.sh-automate-script.patch b/meta-digi-arm/recipes-bsp/trustfence-cst/trustfence-cst-3.3.2/0004-ahab_pki_tree.sh-adapt-script-for-DEY.patch similarity index 57% rename from meta-digi-arm/recipes-bsp/trustfence-cst/trustfence-cst/0005-ahab_pki_tree.sh-automate-script.patch rename to meta-digi-arm/recipes-bsp/trustfence-cst/trustfence-cst-3.3.2/0004-ahab_pki_tree.sh-adapt-script-for-DEY.patch index e5e60aff1..11387df9d 100644 --- a/meta-digi-arm/recipes-bsp/trustfence-cst/trustfence-cst/0005-ahab_pki_tree.sh-automate-script.patch +++ b/meta-digi-arm/recipes-bsp/trustfence-cst/trustfence-cst-3.3.2/0004-ahab_pki_tree.sh-adapt-script-for-DEY.patch @@ -1,23 +1,32 @@ From: Arturo Buzarra Date: Wed, 22 Jul 2020 15:10:21 +0200 -Subject: [PATCH] ahab_pki_tree.sh: automate script +Subject: [PATCH] ahab_pki_tree.sh: adapt script for DEY -This commit introduce a new command line argument to specify the -CSF path folder and prepare it to automate the build process. +* support non interactive execution: introduce a new command line + argument to specify the CSF path folder and prepare it to automate the + build process. +* use a random password for the default PKI generation + +* extract public keys from certificates: the public key needs to be + available on the rootfs so that signed SWU packages can be authenticated. + +Co-Authored-By: Javier Viguera +Co-Authored-By: Hector Palacios +Co-Authored-By: Mike Engel Signed-off-by: Arturo Buzarra --- - keys/ahab_pki_tree.sh | 70 +++++++++++++++++++++++++++++-------------- - 1 file changed, 47 insertions(+), 23 deletions(-) + keys/ahab_pki_tree.sh | 79 ++++++++++++++++++++++++++++++------------- + 1 file changed, 55 insertions(+), 24 deletions(-) diff --git a/keys/ahab_pki_tree.sh b/keys/ahab_pki_tree.sh -index f5ab36c..2c16533 100755 +index 0327f83..5c986b2 100755 --- a/keys/ahab_pki_tree.sh +++ b/keys/ahab_pki_tree.sh @@ -64,6 +64,8 @@ printf " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n" - + stty erase  - + +SCRIPT_BASEDIR="$(cd $(dirname ${0}) && pwd)" + if [ $# -gt 0 ]; then @@ -27,33 +36,33 @@ index f5ab36c..2c16533 100755 echo "$0" echo echo "Command Line Mode:" -- echo "$0 -existing-ca [-ca-key -ca-cert ] -use-ecc -kl -da -duration -srk-ca " -+ echo "$0 [-csf-path] -existing-ca [-ca-key -ca-cert ] -use-ecc -kl -da -duration -srk-ca " +- echo "$0 -existing-ca [-ca-key -ca-cert ] -kt -kl -da -duration -srk-ca " ++ echo "$0 [-csf-path] -existing-ca [-ca-key -ca-cert ] -kt -kl -da -duration -srk-ca " echo "Options:" - echo " -kl: -use-ecc = y then Supported key lengths: p256, p384, p521" - echo " : -use-ecc = n then Supported key lengths: 2048, 3072, 4096" -@@ -88,10 +90,18 @@ usage() + echo " -kt ecc : then Supported key lengths: p256, p384, p521" + echo " -kt rsa : then Supported key lengths: 2048, 3072, 4096" +@@ -89,10 +91,18 @@ usage() echo } - + -max_param=16 -min_param=12 +max_param=18 +min_param=1 num_param=1 - + +# Default values +existing_ca="n" -+use_ecc="y" ++kt="ecc" +kl=p521 +da=sha512 +duration=10 -+srk_ca="y" ++srk_ca="n" + if [ $interactive = "n" ] then # Validate command line parameters -@@ -110,6 +120,11 @@ then +@@ -111,6 +121,11 @@ then while [ $num_param -le $max_param ] && [ "$1" != "" ] do case $1 in @@ -65,7 +74,7 @@ index f5ab36c..2c16533 100755 -existing-ca) shift existing_ca=$1 -@@ -163,9 +178,8 @@ then +@@ -164,9 +179,8 @@ then shift ;; *) @@ -77,10 +86,10 @@ index f5ab36c..2c16533 100755 ;; esac num_param=$(( num_param + 2 )) -@@ -255,6 +269,16 @@ then +@@ -274,6 +288,16 @@ then read duration fi - + +# CSF folder structure +if [ ! -d "${CSF_PATH}" ]; then + echo "Invalid CSF_PATH: ${CSF_PATH}" @@ -93,8 +102,8 @@ index f5ab36c..2c16533 100755 + # Compute validity period val_period=$((duration*365)) - -@@ -286,9 +310,9 @@ then + +@@ -305,9 +329,9 @@ then script_name=$0 fi script_path=$(cd $(dirname "${script_name}") && pwd -P) @@ -104,54 +113,73 @@ index f5ab36c..2c16533 100755 +keys_dir=${CSF_PATH}/keys/ +crts_dir=${CSF_PATH}/crts/ +ca_dir=${CSF_PATH}/ca/ - + if [ ! -d "${keys_dir}" ] then -@@ -302,11 +326,11 @@ then - exit 1 +@@ -321,11 +345,11 @@ then + exit 1 fi - + -if [ ! -d "${ca_dir}" ] -then - echo ERROR: "Openssl configuration directory ${ca_dir} is missing. Expecting /ca directory to hold openssl configuration files." -- exit 1 +- exit 1 -fi +# if [ ! -d "${ca_dir}" ] +# then +# echo ERROR: "Openssl configuration directory ${ca_dir} is missing. Expecting /ca directory to hold openssl configuration files." +# exit 1 +# fi - + # Switch current working directory to keys directory, if needed. if [ "${crt_dir}" != "${keys_dir}" ] -@@ -377,7 +401,7 @@ then +@@ -348,9 +372,10 @@ fi + # Check that the file "key_pass.txt" is present, if not create it with default user/pwd: + if [ ! -f key_pass.txt ] + then +- echo "test" > key_pass.txt +- echo "test" >> key_pass.txt +- echo "A default file 'key_pass.txt' was created with password = test!" ++ password="$(openssl rand -base64 32)" ++ echo "${password}" > key_pass.txt ++ echo "${password}" >> key_pass.txt ++ echo "A file 'key_pass.txt' was created with a random password!" + fi + + # The following is required otherwise OpenSSL complains +@@ -396,7 +421,7 @@ then -x509 -extensions v3_ca \ -keyout temp_ca.pem \ -out ${ca_cert}.pem \ - -days ${val_period} -config ../ca/openssl.cnf + -days ${val_period} -config "${SCRIPT_BASEDIR}/openssl.cnf" - + # Generate CA key in PKCS #8 format - both PEM and DER openssl pkcs8 -passin file:./key_pass.txt -passout file:./key_pass.txt \ -@@ -394,7 +418,7 @@ then - openssl x509 -inform PEM -outform DER -in ${ca_cert}.pem -out ${ca_cert}.der - - # Cleanup -- \rm temp_ca.pem -+ rm temp_ca.pem - fi - - -@@ -468,7 +492,7 @@ then +@@ -464,10 +489,10 @@ then + -in ./temp_srk_req.pem \ + -cert ${ca_cert}.pem \ + -keyfile ${ca_key}.pem \ +- -extfile ../ca/v3_usr.cnf \ ++ -extfile "${SCRIPT_BASEDIR}/v3_usr.cnf" \ + -out ${srk_crt}.pem \ + -days ${val_period} \ +- -config ../ca/openssl.cnf ++ -config "${SCRIPT_BASEDIR}/openssl.cnf" + + # Convert SRK Certificate to DER format + openssl x509 -inform PEM -outform DER \ +@@ -487,6 +512,9 @@ then + -in temp_srk.pem \ -out ${srk_key}.pem - + ++ # Extract public key from the certificate ++ openssl x509 -pubkey -noout -in "${srk_crt}.pem" > ../crts/key${i}.pub ++ # Cleanup -- \rm ./temp_srk.pem ./temp_srk_req.pem -+ rm ./temp_srk.pem ./temp_srk_req.pem + \rm ./temp_srk.pem ./temp_srk_req.pem i=$((i+1)) - done - else -@@ -517,10 +541,10 @@ do +@@ -539,10 +567,10 @@ do -in ./temp_srk_req.pem \ -cert ${ca_cert}.pem \ -keyfile ${ca_key}.pem \ @@ -161,19 +189,10 @@ index f5ab36c..2c16533 100755 -days ${val_period} \ - -config ../ca/openssl.cnf + -config "${SCRIPT_BASEDIR}/openssl.cnf" - + # Convert SRK Certificate to DER format openssl x509 -inform PEM -outform DER \ -@@ -541,7 +565,7 @@ do - -out ${srk_key}.pem - - # Cleanup -- \rm ./temp_srk.pem ./temp_srk_req.pem -+ rm ./temp_srk.pem ./temp_srk_req.pem - - echo - echo ++++++++++++++++++++++++++++++++++++++++ -@@ -586,10 +610,10 @@ do +@@ -609,10 +637,10 @@ do -in ./temp_sgk_req.pem \ -cert ${srk_crt_i} \ -keyfile ${srk_key_i} \ @@ -183,15 +202,16 @@ index f5ab36c..2c16533 100755 -days ${val_period} \ - -config ../ca/openssl.cnf + -config "${SCRIPT_BASEDIR}/openssl.cnf" - + # Convert SGK Certificate to DER format openssl x509 -inform PEM -outform DER \ -@@ -608,7 +632,7 @@ do +@@ -630,6 +658,9 @@ do + -in temp_sgk.pem \ -out ${sgk_key}.pem - + ++ # Extract public key from the certificate ++ openssl x509 -pubkey -noout -in "${srk_crt_i}" > ../crts/key${i}.pub ++ # Cleanup -- \rm ./temp_sgk.pem ./temp_sgk_req.pem -+ rm ./temp_sgk.pem ./temp_sgk_req.pem - - i=$((i+1)) - done + \rm ./temp_sgk.pem ./temp_sgk_req.pem + diff --git a/meta-digi-arm/recipes-bsp/trustfence-cst/trustfence-cst-native_3.3.1.bb b/meta-digi-arm/recipes-bsp/trustfence-cst/trustfence-cst-native_3.3.2.bb similarity index 100% rename from meta-digi-arm/recipes-bsp/trustfence-cst/trustfence-cst-native_3.3.1.bb rename to meta-digi-arm/recipes-bsp/trustfence-cst/trustfence-cst-native_3.3.2.bb diff --git a/meta-digi-arm/recipes-bsp/trustfence-cst/trustfence-cst/0004-hab4_pki_tree.sh-usa-a-random-password-for-the-defau.patch b/meta-digi-arm/recipes-bsp/trustfence-cst/trustfence-cst/0004-hab4_pki_tree.sh-usa-a-random-password-for-the-defau.patch deleted file mode 100644 index cafd77ef6..000000000 --- a/meta-digi-arm/recipes-bsp/trustfence-cst/trustfence-cst/0004-hab4_pki_tree.sh-usa-a-random-password-for-the-defau.patch +++ /dev/null @@ -1,28 +0,0 @@ -From: "Diaz de Grenu, Jose" -Date: Fri, 29 Jul 2016 17:20:28 +0200 -Subject: [PATCH] hab4_pki_tree.sh: usa a random password for the default PKI - generation - -Signed-off-by: Diaz de Grenu, Jose ---- - keys/hab4_pki_tree.sh | 7 ++++--- - 1 file changed, 4 insertions(+), 3 deletions(-) - -diff --git a/keys/hab4_pki_tree.sh b/keys/hab4_pki_tree.sh -index 39ed3bf..ac6fb29 100755 ---- a/keys/hab4_pki_tree.sh -+++ b/keys/hab4_pki_tree.sh -@@ -342,9 +342,10 @@ fi - # Check that the file "key_pass.txt" is present, if not create it with default user/pwd: - if [ ! -f key_pass.txt ] - then -- echo "test" > key_pass.txt -- echo "test" >> key_pass.txt -- echo "A default file 'key_pass.txt' was created with password = test!" -+ password="$(openssl rand -base64 32)" -+ echo "${password}" > key_pass.txt -+ echo "${password}" >> key_pass.txt -+ echo "A file 'key_pass.txt' was created with a random password!" - fi - - # The following is required otherwise OpenSSL complains diff --git a/meta-digi-arm/recipes-bsp/trustfence-cst/trustfence-cst/0006-ahab_pki_tree.sh-use-a-random-password-for-the-defau.patch b/meta-digi-arm/recipes-bsp/trustfence-cst/trustfence-cst/0006-ahab_pki_tree.sh-use-a-random-password-for-the-defau.patch deleted file mode 100644 index 1c715b10f..000000000 --- a/meta-digi-arm/recipes-bsp/trustfence-cst/trustfence-cst/0006-ahab_pki_tree.sh-use-a-random-password-for-the-defau.patch +++ /dev/null @@ -1,28 +0,0 @@ -From: Mike Engel -Date: Fri, 24 Jan 2020 17:47:56 +0100 -Subject: [PATCH] ahab_pki_tree.sh: use a random password for the default PKI - generation - -Signed-off-by: Mike Engel ---- - keys/ahab_pki_tree.sh | 7 ++++--- - 1 file changed, 4 insertions(+), 3 deletions(-) - -diff --git a/keys/ahab_pki_tree.sh b/keys/ahab_pki_tree.sh -index 2c16533..b85b00d 100755 ---- a/keys/ahab_pki_tree.sh -+++ b/keys/ahab_pki_tree.sh -@@ -353,9 +353,10 @@ fi - # Check that the file "key_pass.txt" is present, if not create it with default user/pwd: - if [ ! -f key_pass.txt ] - then -- echo "test" > key_pass.txt -- echo "test" >> key_pass.txt -- echo "A default file 'key_pass.txt' was created with password = test!" -+ password="$(openssl rand -base64 32)" -+ echo "${password}" > key_pass.txt -+ echo "${password}" >> key_pass.txt -+ echo "A file 'key_pass.txt' was created with a random password!" - fi - - # The following is required otherwise OpenSSL complains diff --git a/meta-digi-arm/recipes-bsp/trustfence-cst/trustfence-cst/0007-rules.mk-weaken-specific-function-err_msg.patch b/meta-digi-arm/recipes-bsp/trustfence-cst/trustfence-cst/0007-rules.mk-weaken-specific-function-err_msg.patch deleted file mode 100644 index 03049e35b..000000000 --- a/meta-digi-arm/recipes-bsp/trustfence-cst/trustfence-cst/0007-rules.mk-weaken-specific-function-err_msg.patch +++ /dev/null @@ -1,33 +0,0 @@ -From fe51b132c7c07de5a63c3dfc5a16bc9fc7816f7e Mon Sep 17 00:00:00 2001 -From: Hector Palacios -Date: Mon, 30 Jan 2023 10:38:22 +0100 -Subject: [PATCH] rules.mk: weaken specific function err_msg() - -A bug in binutils 2.38 objcopy '--weaken' produces malformed -binaries. -For the cst, it looks like it's enough to weaken function err_msg() -which is otherwise redefined. -Change the global '--weaken' flag with '--weaken-symbol err_msg' -to have the build process generate a valid 'cst' binary. - -Signed-off-by: Hector Palacios - -https://onedigi.atlassian.net/browse/DEL-8332 -https://onedigi.atlassian.net/browse/DEL-8033 ---- - code/cst/code/build/make/rules.mk | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/code/cst/code/build/make/rules.mk b/code/cst/code/build/make/rules.mk -index 1c0842bd070e..032e18bc5134 100755 ---- a/code/cst/code/build/make/rules.mk -+++ b/code/cst/code/build/make/rules.mk -@@ -27,7 +27,7 @@ LFLAGS := -t - $(AR) $(ARFLAGS) $@ $^ - ifneq ($(OSTYPE),mingw32) - ifneq ($(OSTYPE),osx) -- $(OBJCOPY) --weaken $@ -+ $(OBJCOPY) --weaken-symbol err_msg $@ - endif - endif - diff --git a/meta-digi-arm/recipes-bsp/trustfence-cst/trustfence-cst/0008-pki_tree.sh-extract-public-keys-from-certificates.patch b/meta-digi-arm/recipes-bsp/trustfence-cst/trustfence-cst/0008-pki_tree.sh-extract-public-keys-from-certificates.patch deleted file mode 100644 index dcaa24120..000000000 --- a/meta-digi-arm/recipes-bsp/trustfence-cst/trustfence-cst/0008-pki_tree.sh-extract-public-keys-from-certificates.patch +++ /dev/null @@ -1,42 +0,0 @@ -From: Hector Palacios -Date: Thu, 3 Aug 2023 16:25:36 +0200 -Subject: [PATCH] pki_tree.sh: extract public keys from certificates - -The public key needs to be available on the rootfs so that signed SWU -packages can be authenticated. -Do this on the PKI generation script so that recipes don't need to do it. - -Signed-off-by: Hector Palacios ---- - keys/ahab_pki_tree.sh | 3 +++ - keys/hab4_pki_tree.sh | 3 +++ - 2 files changed, 6 insertions(+) - -diff --git a/keys/ahab_pki_tree.sh b/keys/ahab_pki_tree.sh -index 7f10c5388146..63b5ce58ade7 100755 ---- a/keys/ahab_pki_tree.sh -+++ b/keys/ahab_pki_tree.sh -@@ -632,6 +632,9 @@ do - -in temp_sgk.pem \ - -out ${sgk_key}.pem - -+ # Extract public key from the certificate -+ openssl x509 -pubkey -noout -in "${srk_crt_i}" > ../crts/key${i}.pub -+ - # Cleanup - rm ./temp_sgk.pem ./temp_sgk_req.pem - -diff --git a/keys/hab4_pki_tree.sh b/keys/hab4_pki_tree.sh -index ac6fb29b7f91..e76f22f40643 100755 ---- a/keys/hab4_pki_tree.sh -+++ b/keys/hab4_pki_tree.sh -@@ -682,6 +682,9 @@ do - -in temp_img.pem \ - -out ${img_key}.pem - -+ # Extract public key from the certificate -+ openssl x509 -pubkey -noout -in "${img_crt}.pem" > ../crts/key${i}.pub -+ - # Cleanup - rm ./temp_img.pem ./temp_img_req.pem - 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 894da6074..75199b0b0 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 @@ -95,8 +95,8 @@ build_uboot_scripts() { mkimage -T script -n bootscript -C none -d ${TMP_BOOTSCR} ${DEPLOYDIR}/boot.scr rm -f ${TMP_BOOTSCR} - # Sign the scripts (TODO signing of artifacts for STM-based platforms) - if [ "${TRUSTFENCE_SIGN}" = "1" ] && [ "${DEY_SOC_VENDOR}" != "STM" ]; then + # Sign the boot script + if [ "${TRUSTFENCE_SIGN_ARTIFACTS}" = "1" ]; 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}" @@ -198,6 +198,18 @@ do_deploy:append:ccmp1() { # Deploy u-boot-nodtb.bin and ccmp1x-dvk.dtb, to be packaged in fip binary by tf-a install -d ${DEPLOYDIR}/${BOOT_TOOLS} install -m 0777 ${B}/${config}/arch/arm/dts/${UBOOT_DTB_NAME} ${DEPLOYDIR}/${BOOT_TOOLS}/${FIP_UBOOT_DTB}-${FIP_UBOOT_HEADER}.dtb - install -m 0777 ${B}/${config}/u-boot-nodtb.bin ${DEPLOYDIR}/${BOOT_TOOLS}/u-boot-nodtb.bin + + # Append signature to u-boot DT + if [ "x${UBOOT_SIGN_ENABLE}" = "x1" ] ; then + # get name of u-boot devicetree without signature + ubootdevicetree="${DEPLOYDIR}/${BOOT_TOOLS}/u-boot-${UBOOT_DTB_NAME}" + namewithoutsignature=`echo $ubootdevicetree | sed "s/\.dtb/-without-signature.dtb/g"` + namewithsignature=`echo $ubootdevicetree | sed "s/\.dtb/-with-signature.dtb/g"` + mv $ubootdevicetree $namewithoutsignature + # get name of U-Boot device tree from DEPLOY_DIR + nameonkernel="${DEPLOY_DIR_IMAGE}/u-boot-${MACHINE}*.dtb" + cp $nameonkernel $namewithsignature + cp $nameonkernel $ubootdevicetree + fi } 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 aaefeff57..503e9ceaf 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 @@ -144,6 +144,7 @@ fi # - Partition the eMMC user data area for Linux # - If Dual Boot # - Update the system partitions: linux_a, linux_b, rootfs_a, rootfs_b + - Set bootlimit to 3 # - If Normal Boot: # - Update the system partitions: linux, recovery, rootfs # - Erase the 'update' partition @@ -219,6 +220,7 @@ setenv bootcmd " exit; fi; fi; + setenv bootlimit 3; else echo \"\"; 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 b752e0aac..d4f491057 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 @@ -144,6 +144,7 @@ fi # - Partition the eMMC user data area for Linux # - If Dual Boot # - Update the system partitions: linux_a, linux_b, rootfs_a, rootfs_b + - Set bootlimit to 3 # - If Normal Boot: # - Update the system partitions: linux, recovery, rootfs # - Erase the 'update' partition @@ -222,6 +223,7 @@ setenv bootcmd " exit; fi; fi; + setenv bootlimit 3; else echo \"\"; 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 5cf3788bb..f4bed37e0 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 @@ -32,7 +32,9 @@ show_usage() echo "Usage: $0 [options]" echo "" echo " Options:" + echo " -b Activate bootcount mechanism (3 boot attempts)." echo " -d Install firmware on dualboot partitions (system A and system B)." + echo " (Implies -b)." echo " -h Show this help." echo " -i Image name that prefixes the image filenames, such as 'dey-image-qt', " echo " 'dey-image-webkit', 'core-image-base'..." @@ -70,10 +72,11 @@ echo "############################################################" # Command line admits the following parameters: # -u # -i -while getopts 'dhi:nu:' c +while getopts 'bdhi:nu:' c do case $c in - d) INSTALL_DUALBOOT=true ;; + b) BOOTCOUNT=true ;; + d) INSTALL_DUALBOOT=true && BOOTCOUNT=true ;; h) show_usage ;; i) IMAGE_NAME=${OPTARG} ;; n) NOWAIT=true ;; @@ -184,6 +187,11 @@ if [ ! -f ${INSTALL_ROOTFS_FILENAME} ]; then fi fi +# Enable bootcount mechanism by setting a bootlimit +if [ "${BOOTCOUNT}" = true ]; then + bootlimit_cmd="setenv bootlimit 3" +fi + [ "${ABORT}" = true ] && exit 1 # parts names @@ -241,6 +249,7 @@ uuu fb: ucmd mmc partconf 0 1 1 1 # Set 'bootcmd' for the second part of the script that will # - Reset environment to defaults # - Reset the bootcount +# - Set bootlimit (if required) # - Save the environment # - Partition the eMMC user data area for Linux # - Update the 'linux' partition @@ -250,6 +259,7 @@ uuu fb: ucmd setenv bootcmd " env default -a; setenv dualboot \${dualboot}; setenv bootcount 0 + ${bootlimit_cmd}; saveenv; echo \"\"; echo \"\"; 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 b4c819221..0f038724b 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 @@ -155,6 +155,7 @@ fi # - Partition the eMMC user data area for Linux # - If Dual Boot # - Update the system partitions: linux_a, linux_b, rootfs_a, rootfs_b + - Set bootlimit to 3 # - If Normal Boot: # - Update the system partitions: linux, recovery, rootfs # - Erase the 'update' partition @@ -230,6 +231,7 @@ setenv bootcmd " exit; fi; fi; + setenv bootlimit 3; else echo \"\"; 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 689669278..b7e65f7ad 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 @@ -155,6 +155,7 @@ fi # - Partition the eMMC user data area for Linux # - If Dual Boot # - Update the system partitions: linux_a, linux_b, rootfs_a, rootfs_b + - Set bootlimit to 3 # - If Normal Boot: # - Update the system partitions: linux, recovery, rootfs # - Erase the 'update' partition @@ -233,6 +234,7 @@ setenv bootcmd " exit; fi; fi; + setenv bootlimit 3; else echo \"\"; 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 655604812..d09fd528a 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 @@ -32,7 +32,9 @@ show_usage() echo "Usage: $0 [options]" echo "" echo " Options:" + echo " -b Activate bootcount mechanism (3 boot attempts)." echo " -d Install firmware on dualboot partitions (system A and system B)." + echo " (Implies -b)." echo " -h Show this help." echo " -i Image name that prefixes the image filenames, such as 'dey-image-qt', " echo " 'dey-image-webkit', 'core-image-base'..." @@ -70,10 +72,11 @@ echo "############################################################" # Command line admits the following parameters: # -u # -i -while getopts 'dhi:nu:' c +while getopts 'bdhi:nu:' c do case $c in - d) INSTALL_DUALBOOT=true ;; + b) BOOTCOUNT=true ;; + d) INSTALL_DUALBOOT=true && BOOTCOUNT=true ;; h) show_usage ;; i) IMAGE_NAME=${OPTARG} ;; n) NOWAIT=true ;; @@ -202,6 +205,11 @@ if [ ! -f ${INSTALL_ROOTFS_FILENAME} ]; then fi fi +# Enable bootcount mechanism by setting a bootlimit +if [ "${BOOTCOUNT}" = true ]; then + bootlimit_cmd="setenv bootlimit 3" +fi + [ "${ABORT}" = true ] && exit 1 # parts names @@ -259,6 +267,7 @@ uuu fb: ucmd mmc partconf 0 1 1 1 # Set 'bootcmd' for the second part of the script that will # - Reset environment to defaults # - Reset the bootcount +# - Set bootlimit (if required) # - Save the environment # - Partition the eMMC user data area for Linux # - Update the 'linux' partition @@ -268,6 +277,7 @@ uuu fb: ucmd setenv bootcmd " env default -a; setenv dualboot \${dualboot}; setenv bootcount 0 + ${bootlimit_cmd}; saveenv; echo \"\"; echo \"\"; 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 35bceb6df..c01c01e2d 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 @@ -151,6 +151,7 @@ fi # - Save the environment # - If Dual Boot # - Update the system partitions: linux_a, linux_b, rootfs_a, rootfs_b + - Set bootlimit to 3 # - If Normal Boot: # - Update the system partitions: linux, recovery, rootfs # - Erase the 'update' partition @@ -222,6 +223,7 @@ setenv bootcmd " exit; fi; fi; + setenv bootlimit 3; else echo \"\"; 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 36fdd73b4..45517feba 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 @@ -153,6 +153,7 @@ fi # - Save the environment # - If Dual Boot # - Update the system partitions: linux_a, linux_b, rootfs_a, rootfs_b + - Set bootlimit to 3 # - If Normal Boot: # - Update the system partitions: linux, recovery, rootfs # - Erase the 'update' partition @@ -225,6 +226,7 @@ setenv bootcmd " exit; fi; fi; + setenv bootlimit 3; else echo \"\"; 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 6ae7ed748..c6bab372e 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 @@ -32,7 +32,9 @@ show_usage() echo "Usage: $0 [options]" echo "" echo " Options:" + echo " -b Activate bootcount mechanism (3 boot attempts)." echo " -d Install firmware on dualboot partitions (system A and system B)." + echo " (Implies -b)." echo " -h Show this help." echo " -i Image name that prefixes the image filenames, such as 'dey-image-qt', " echo " 'dey-image-webkit', 'core-image-base'..." @@ -79,10 +81,11 @@ echo "############################################################" # Command line admits the following parameters: # -u # -i -while getopts 'dhi:nu:' c +while getopts 'bdhi:nu:' c do case $c in - d) INSTALL_DUALBOOT=true ;; + b) BOOTCOUNT=true ;; + d) INSTALL_DUALBOOT=true && BOOTCOUNT=true ;; h) show_usage ;; i) IMAGE_NAME=${OPTARG} ;; n) NOWAIT=true ;; @@ -193,6 +196,11 @@ if [ ! -f ${INSTALL_ROOTFS_FILENAME} ]; then fi fi +# Enable bootcount mechanism by setting a bootlimit +if [ "${BOOTCOUNT}" = true ]; then + bootlimit_cmd="setenv bootlimit 3" +fi + [ "${ABORT}" = true ] && exit 1 # parts names @@ -250,6 +258,7 @@ part_update "uboot" "${INSTALL_UBOOT_FILENAME}" 5000 # Set 'bootcmd' for the second part of the script that will # - Reset environment to defaults # - Reset the bootcount +# - Set bootlimit (if required) # - Save the environment # - Update the 'linux' partition # - Update the 'recovery' partition @@ -260,6 +269,7 @@ uuu fb: ucmd setenv bootcmd " setenv dualboot \${dualboot}; bootcount reset; setenv singlemtdsys \${singlemtdsys}; + ${bootlimit_cmd}; saveenv; echo \"\"; echo \"\"; 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 418d833c2..0d2d263bd 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 @@ -120,6 +120,7 @@ fi # - Partition the eMMC user data area for Linux # - If Dual Boot # - Update the system partitions: linux_a, linux_b, rootfs_a, rootfs_b + - Set bootlimit to 3 # - If Normal Boot: # - Update the system partitions: linux, recovery, rootfs # - Erase the 'update' partition @@ -196,6 +197,7 @@ setenv bootcmd " exit; fi; fi; + setenv bootlimit 3; else echo \"\"; 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 c870409fa..5b67a563e 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 @@ -120,6 +120,7 @@ fi # - Partition the eMMC user data area for Linux # - If Dual Boot # - Update the system partitions: linux_a, linux_b, rootfs_a, rootfs_b + - Set bootlimit to 3 # - If Normal Boot: # - Update the system partitions: linux, recovery, rootfs # - Erase the 'update' partition @@ -197,6 +198,7 @@ setenv bootcmd " exit; fi; fi; + setenv bootlimit 3; else echo \"\"; 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 a20af2bf3..1ee6c2f79 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 @@ -32,7 +32,9 @@ show_usage() echo "Usage: $0 [options]" echo "" echo " Options:" + echo " -b Activate bootcount mechanism (3 boot attempts)." echo " -d Install firmware on dualboot partitions (system A and system B)." + echo " (Implies -b)." echo " -h Show this help." echo " -i Image name that prefixes the image filenames, such as 'dey-image-qt', " echo " 'dey-image-webkit', 'core-image-base'..." @@ -70,10 +72,11 @@ echo "############################################################" # Command line admits the following parameters: # -u # -i -while getopts 'dhi:nu:' c +while getopts 'bdhi:nu:' c do case $c in - d) INSTALL_DUALBOOT=true ;; + b) BOOTCOUNT=true ;; + d) INSTALL_DUALBOOT=true && BOOTCOUNT=true ;; h) show_usage ;; i) IMAGE_NAME=${OPTARG} ;; n) NOWAIT=true ;; @@ -150,6 +153,11 @@ if [ ! -f ${INSTALL_ROOTFS_FILENAME} ]; then fi fi +# Enable bootcount mechanism by setting a bootlimit +if [ "${BOOTCOUNT}" = true ]; then + bootlimit_cmd="setenv bootlimit 3" +fi + [ "${ABORT}" = true ] && exit 1 # parts names @@ -210,6 +218,7 @@ uuu fb: ucmd mmc partconf 0 1 1 1 # Set 'bootcmd' for the second part of the script that will # - Reset environment to defaults # - Reset the bootcount +# - Set bootlimit (if required) # - Save the environment # - Partition the eMMC user data area for Linux # - Update the 'linux' partition @@ -219,6 +228,7 @@ uuu fb: ucmd setenv bootcmd " env default -a; setenv dualboot \${dualboot}; bootcount reset; + ${bootlimit_cmd}; saveenv; echo \"\"; echo \"\"; 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 9c75c13cf..852de0445 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 @@ -132,6 +132,7 @@ fi # - Partition the eMMC user data area for Linux # - If Dual Boot # - Update the system partitions: linux_a, linux_b, rootfs_a, rootfs_b + - Set bootlimit to 3 # - If Normal Boot: # - Update the system partitions: linux, recovery, rootfs # - Erase the 'update' partition @@ -208,6 +209,7 @@ setenv bootcmd " exit; fi; fi; + setenv bootlimit 3; else echo \"\"; 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 f8b12076a..963b0c50e 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 @@ -132,6 +132,7 @@ fi # - Partition the eMMC user data area for Linux # - If Dual Boot # - Update the system partitions: linux_a, linux_b, rootfs_a, rootfs_b + - Set bootlimit to 3 # - If Normal Boot: # - Update the system partitions: linux, recovery, rootfs # - Erase the 'update' partition @@ -211,6 +212,7 @@ setenv bootcmd " exit; fi; fi; + setenv bootlimit 3; else echo \"\"; 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 6d7ad5a4d..068e09ac0 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 @@ -32,7 +32,9 @@ show_usage() echo "Usage: $0 [options]" echo "" echo " Options:" + echo " -b Activate bootcount mechanism (3 boot attempts)." echo " -d Install firmware on dualboot partitions (system A and system B)." + echo " (Implies -b)." echo " -h Show this help." echo " -i Image name that prefixes the image filenames, such as 'dey-image-qt', " echo " 'dey-image-webkit', 'core-image-base'..." @@ -70,10 +72,11 @@ echo "############################################################" # Command line admits the following parameters: # -u # -i -while getopts 'dhi:nu:' c +while getopts 'bdhi:nu:' c do case $c in - d) INSTALL_DUALBOOT=true ;; + b) BOOTCOUNT=true ;; + d) INSTALL_DUALBOOT=true && BOOTCOUNT=true ;; h) show_usage ;; i) IMAGE_NAME=${OPTARG} ;; n) NOWAIT=true ;; @@ -157,6 +160,11 @@ if [ ! -f ${INSTALL_ROOTFS_FILENAME} ]; then fi fi +# Enable bootcount mechanism by setting a bootlimit +if [ "${BOOTCOUNT}" = true ]; then + bootlimit_cmd="setenv bootlimit 3" +fi + [ "${ABORT}" = true ] && exit 1 # parts names @@ -214,6 +222,7 @@ uuu fb: ucmd mmc partconf 0 1 1 1 # Set 'bootcmd' for the second part of the script that will # - Reset environment to defaults # - Reset the bootcount +# - Set bootlimit (if required) # - Save the environment # - Partition the eMMC user data area for Linux # - Update the 'linux' partition @@ -223,6 +232,7 @@ uuu fb: ucmd setenv bootcmd " env default -a; setenv dualboot \${dualboot}; bootcount reset; + ${bootlimit_cmd}; saveenv; echo \"\"; echo \"\"; diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx93-dvk/boot.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx93-dvk/boot.txt index 4fd2fae26..60f89ef0e 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx93-dvk/boot.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx93-dvk/boot.txt @@ -60,8 +60,6 @@ setenv ORIG_overlays ${overlays} # Determine overlays to apply depending on the hardware capabilities # described by the HWID, SOM version, and carrier board version. # -setexpr module_has_mca ${hwid_2} \& 10000 -setexpr module_has_mca ${module_has_mca} / 10000 setexpr module_has_wifi ${hwid_2} \& 20000 setexpr module_has_wifi ${module_has_wifi} / 20000 setexpr module_has_bt ${hwid_2} \& 40000 @@ -75,10 +73,6 @@ if test "${module_has_wifi}" = "1" && test -z "${disable_wifi}"; then setenv overlays _ov_som_wifi_ccimx93.dtbo,${overlays} fi -if test "${module_has_mca}" = "1" && test -z "${disable_mca}"; then - setenv overlays _ov_som_mca_ccimx93.dtbo,${overlays} -fi - if test "${cpu_type}" = "imx9352" || \ test "${cpu_type}" = "imx9351" || \ test "${cpu_type}" = "imx9322" || \ 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 f43d6a2e5..baa7d2a84 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 @@ -7,7 +7,20 @@ install_abort=0 BASEFILENAME=0 -setenv INSTALL_UBOOT_FILENAME imx-boot-##MACHINE##.bin; +# Determine U-Boot file to program basing on SOM's SOC revision +if test -z "${soc_rev}"; then + # Fallback to hardware version if soc_rev is empty + setexpr som_hv ${hwid_2} \& 78 + setexpr som_hv ${som_hv} / 8 + if test "${som_hv}" -lt "2"; then + SOCREV="-A0" + fi +else + if test "${soc_rev}" = "0x10"; then + SOCREV="-A0" + fi +fi +setenv INSTALL_UBOOT_FILENAME imx-boot-##MACHINE##${SOCREV}.bin setenv INSTALL_MMCDEV 1 if test -z "${image-name}"; then @@ -118,6 +131,7 @@ fi # - Partition the eMMC user data area for Linux # - If Dual Boot # - Update the system partitions: linux_a, linux_b, rootfs_a, rootfs_b + - Set bootlimit to 3 # - If Normal Boot: # - Update the system partitions: linux, recovery, rootfs # - Erase the 'update' partition @@ -194,6 +208,7 @@ setenv bootcmd " exit; fi; fi; + setenv bootlimit 3; else echo \"\"; 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 256accf40..e438d274e 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 @@ -7,7 +7,20 @@ install_abort=0 BASEFILENAME=0 -setenv INSTALL_UBOOT_FILENAME imx-boot-##MACHINE##.bin; +# Determine U-Boot file to program basing on SOM's SOC revision +if test -z "${soc_rev}"; then + # Fallback to hardware version if soc_rev is empty + setexpr som_hv ${hwid_2} \& 78 + setexpr som_hv ${som_hv} / 8 + if test "${som_hv}" -lt "2"; then + SOCREV="-A0" + fi +else + if test "${soc_rev}" = "0x10"; then + SOCREV="-A0" + fi +fi +setenv INSTALL_UBOOT_FILENAME imx-boot-##MACHINE##${SOCREV}.bin setenv INSTALL_USBDEV 0 if test -z "${image-name}"; then @@ -118,6 +131,7 @@ fi # - Partition the eMMC user data area for Linux # - If Dual Boot # - Update the system partitions: linux_a, linux_b, rootfs_a, rootfs_b + - Set bootlimit to 3 # - If Normal Boot: # - Update the system partitions: linux, recovery, rootfs # - Erase the 'update' partition @@ -195,6 +209,7 @@ setenv bootcmd " exit; fi; fi; + setenv bootlimit 3; else echo \"\"; 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 a20af2bf3..fcf342151 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 @@ -32,7 +32,9 @@ show_usage() echo "Usage: $0 [options]" echo "" echo " Options:" + echo " -b Activate bootcount mechanism (3 boot attempts)." echo " -d Install firmware on dualboot partitions (system A and system B)." + echo " (Implies -b)." echo " -h Show this help." echo " -i Image name that prefixes the image filenames, such as 'dey-image-qt', " echo " 'dey-image-webkit', 'core-image-base'..." @@ -70,10 +72,11 @@ echo "############################################################" # Command line admits the following parameters: # -u # -i -while getopts 'dhi:nu:' c +while getopts 'bdhi:nu:' c do case $c in - d) INSTALL_DUALBOOT=true ;; + b) BOOTCOUNT=true ;; + d) INSTALL_DUALBOOT=true && BOOTCOUNT=true ;; h) show_usage ;; i) IMAGE_NAME=${OPTARG} ;; n) NOWAIT=true ;; @@ -90,17 +93,27 @@ if [ "${dualboot}" = "yes" ]; then DUALBOOT=true; fi -# remove redirect -uuu fb: ucmd setenv stdout serial - echo "" echo "Determining image files to use..." -# Determine U-Boot file to program basing on SOM's SOC type (linked to bus width) +# Determine U-Boot file to program basing on SOM's SOC revision if [ -z "${INSTALL_UBOOT_FILENAME}" ]; then - INSTALL_UBOOT_FILENAME="imx-boot-##MACHINE##.bin" + soc_rev="$(getenv soc_rev)" + if [ -n "${soc_rev}" ]; then + [ "${soc_rev}" = "0x10" ] && SOCREV="-A0" + else + # Fallback to hardware version if soc_rev is empty + hwid_2="$(getenv hwid_2)" + hwid_2="0x${hwid_2#0x}" + som_hv="$(((hwid_2 & 0x78) >> 3))" + [ "${som_hv}" -lt "2" ] && SOCREV="-A0" + fi + INSTALL_UBOOT_FILENAME="imx-boot-##MACHINE##${SOCREV}.bin" fi +# remove redirect +uuu fb: ucmd setenv stdout serial + # Determine linux, recovery, and rootfs image filenames to update if [ -z "${IMAGE_NAME}" ]; then IMAGE_NAME="##DEFAULT_IMAGE_NAME##" @@ -150,6 +163,11 @@ if [ ! -f ${INSTALL_ROOTFS_FILENAME} ]; then fi fi +# Enable bootcount mechanism by setting a bootlimit +if [ "${BOOTCOUNT}" = true ]; then + bootlimit_cmd="setenv bootlimit 3" +fi + [ "${ABORT}" = true ] && exit 1 # parts names @@ -210,6 +228,7 @@ uuu fb: ucmd mmc partconf 0 1 1 1 # Set 'bootcmd' for the second part of the script that will # - Reset environment to defaults # - Reset the bootcount +# - Set bootlimit (if required) # - Save the environment # - Partition the eMMC user data area for Linux # - Update the 'linux' partition @@ -219,6 +238,7 @@ uuu fb: ucmd setenv bootcmd " env default -a; setenv dualboot \${dualboot}; bootcount reset; + ${bootlimit_cmd}; saveenv; echo \"\"; echo \"\"; diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccmp1/fit_legacy.cfg b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccmp1/fit_legacy.cfg new file mode 100644 index 000000000..27c702af0 --- /dev/null +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccmp1/fit_legacy.cfg @@ -0,0 +1 @@ +# CONFIG_LEGACY_IMAGE_FORMAT is not set diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccmp1/fit_signature.cfg b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccmp1/fit_signature.cfg new file mode 100644 index 000000000..eb5d7d683 --- /dev/null +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccmp1/fit_signature.cfg @@ -0,0 +1,4 @@ +CONFIG_FIT_SIGNATURE=y +CONFIG_RSA=y +CONFIG_ECDSA=y +CONFIG_ECDSA_VERIFY=y diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccmp1/install_linux_fw_sd.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccmp1/install_linux_fw_sd.txt index b2990ab35..cb0238c34 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccmp1/install_linux_fw_sd.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccmp1/install_linux_fw_sd.txt @@ -152,6 +152,7 @@ fi # environment # - If Dual Boot # - Update the system partitions: linux_a, linux_b, rootfs_a, rootfs_b + - Set bootlimit to 3 # - If Normal Boot: # - Update the system partitions: linux, recovery, rootfs # - Configure recovery to wipe 'update' partition @@ -215,6 +216,7 @@ setenv bootcmd " exit; fi; fi; + setenv bootlimit 3; else echo \"\"; echo \"\"; @@ -255,8 +257,8 @@ setenv bootcmd " echo \"\"; setenv boot_recovery yes; setenv recovery_command wipe_update; - saveenv; fi; + saveenv; echo \"\"; echo \"\"; echo \">> Firmware installation complete.\"; diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccmp1/install_linux_fw_usb.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccmp1/install_linux_fw_usb.txt index de7c1d6ae..304dc9f1a 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccmp1/install_linux_fw_usb.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccmp1/install_linux_fw_usb.txt @@ -154,6 +154,7 @@ fi # environment # - If Dual Boot # - Update the system partitions: linux_a, linux_b, rootfs_a, rootfs_b + - Set bootlimit to 3 # - If Normal Boot: # - Update the system partitions: linux, recovery, rootfs # - Configure recovery to wipe 'update' partition @@ -218,6 +219,7 @@ setenv bootcmd " exit; fi; fi; + setenv bootlimit 3; else echo \"\"; echo \"\"; @@ -258,8 +260,8 @@ setenv bootcmd " echo \"\"; setenv boot_recovery yes; setenv recovery_command wipe_update; - saveenv; fi; + saveenv; echo \"\"; echo \"\"; echo \">> Firmware installation complete.\"; diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccmp1/install_linux_fw_uuu.sh b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccmp1/install_linux_fw_uuu.sh index 2538fe4c8..f08aaf979 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccmp1/install_linux_fw_uuu.sh +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccmp1/install_linux_fw_uuu.sh @@ -40,7 +40,9 @@ show_usage() echo " Options:" echo " -a Arm-trusted-firmware filename." echo " Auto-determined by variant if not provided." + echo " -b Activate bootcount mechanism (3 boot attempts)." echo " -d Install firmware on dualboot partitions (system A and system B)." + echo " (Implies -b)." echo " -f FIP filename." echo " Auto-determined by variant if not provided." echo " -h Show this help." @@ -80,11 +82,12 @@ echo "############################################################" # -a # -f # -i -while getopts 'a:df:hi:n' c +while getopts 'a:bdf:hi:n' c do case $c in a) INSTALL_ATF_FILENAME=${OPTARG} ;; - d) INSTALL_DUALBOOT=true ;; + b) BOOTCOUNT=true ;; + d) INSTALL_DUALBOOT=true && BOOTCOUNT=true ;; f) INSTALL_FIP_FILENAME=${OPTARG} ;; h) show_usage ;; i) IMAGE_NAME=${OPTARG} ;; @@ -163,6 +166,11 @@ if [ ! -f ${INSTALL_ROOTFS_FILENAME} ]; then fi fi +# Enable bootcount mechanism by setting a bootlimit +if [ "${BOOTCOUNT}" = true ]; then + bootlimit_cmd="setenv bootlimit 3" +fi + [ "${ABORT}" = true ] && exit 1 # parts names @@ -235,6 +243,7 @@ fi # - Reset environment to defaults # - Keep the 'dualboot' status # - Reset the bootcount +# - Set bootlimit (if required) # - Save the environment # - Update the 'linux' partition(s) # - Update the 'rootfs' partition(s) @@ -242,6 +251,7 @@ uuu fb: ucmd setenv bootcmd " env default -a; setenv dualboot \${dualboot}; bootcount reset; + ${bootlimit_cmd}; saveenv; saveenv; echo \"\"; diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccmp13-dvk/boot.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccmp13-dvk/boot.txt index f73432685..34d09e9cd 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccmp13-dvk/boot.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccmp13-dvk/boot.txt @@ -66,9 +66,18 @@ if test "${module_has_wifi}" = "1" && test -z "${disable_wifi}"; then setenv overlays _ov_som_wifi_ccmp13.dtbo,${overlays} fi +# Apply DVKv2 overlay if the board_version is 2 +if test "${board_version}" -eq "2"; then + setenv overlays _ov_board_v2_ccmp13-dvk.dtbo,${overlays} +fi + if test "${boot_device}" = "mmc"; then dboot linux mmc else + if test "${dboot_kernel_var}" = "fitimage"; then + # Set temp var to avoid re-loading fitimage + setenv temp-fitimg-loaded yes + fi dboot linux nand ${mtdbootpart} fi diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccmp15-dvk/boot.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccmp15-dvk/boot.txt index f881120c3..afe3de4c0 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccmp15-dvk/boot.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccmp15-dvk/boot.txt @@ -53,8 +53,6 @@ setenv ORIG_overlays ${overlays} # Determine overlays to apply depending on the hardware capabilities # described by the HWID, SOM version, and carrier board version. # -setexpr module_has_mca ${hwid_2} \& 10000 -setexpr module_has_mca ${module_has_mca} / 10000 setexpr module_has_wifi ${hwid_2} \& 20000 setexpr module_has_wifi ${module_has_wifi} / 20000 setexpr module_has_bt ${hwid_2} \& 40000 @@ -68,18 +66,23 @@ if test "${module_has_wifi}" = "1" && test -z "${disable_wifi}"; then setenv overlays _ov_som_wifi_ccmp15.dtbo,${overlays} fi -if test "${module_has_mca}" = "1" && test -z "${disable_mca}"; then - setenv overlays _ov_som_mca_ccmp15.dtbo,${overlays} -fi - # Apply DVKv1 overlay if the board_version is 1 if test -z "${board_version}" || test "${board_version}" -eq "1"; then setenv overlays _ov_board_v1_ccmp15-dvk.dtbo,${overlays} fi +# Apply DVKv2 overlay if the board_version is 2 +if test "${board_version}" -eq "2"; then + setenv overlays _ov_board_v2_ccmp15-dvk.dtbo,${overlays} +fi + if test "${boot_device}" = "mmc"; then dboot linux mmc else + if test "${dboot_kernel_var}" = "fitimage"; then + # Set temp var to avoid re-loading fitimage + setenv temp-fitimg-loaded yes + fi dboot linux nand ${mtdbootpart} fi diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey_2020.04.bb b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey_2020.04.bb index d7a573416..4f845bdd2 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey_2020.04.bb +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey_2020.04.bb @@ -1,4 +1,4 @@ -# Copyright (C) 2020-2022 Digi International +# Copyright (C) 2020-2023 Digi International require u-boot-dey.inc LIC_FILES_CHKSUM = "file://Licenses/README;md5=30503fd321432fc713238f582193b78e" @@ -8,4 +8,4 @@ DEPENDS += "flex-native bison-native" SRCBRANCH = "v2020.04/maint" SRCREV = "${AUTOREV}" -COMPATIBLE_MACHINE = "(ccimx8x|ccimx8m|ccimx6ul)" +COMPATIBLE_MACHINE = "(ccimx6ul|ccimx8m|ccimx8x)" diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey_2021.10.bb b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey_2021.10.bb index a8e2c07d8..3fd75f9a8 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey_2021.10.bb +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey_2021.10.bb @@ -1,4 +1,4 @@ -# Copyright (C) 2022 Digi International +# Copyright (C) 2022,2023 Digi International require u-boot-dey.inc LIC_FILES_CHKSUM = "file://Licenses/README;md5=5a7450c57ffe5ae63fd732446b988025" @@ -9,4 +9,31 @@ DEPENDS += "python3-setuptools-native" SRCBRANCH = "v2021.10/maint" SRCREV = "${AUTOREV}" +UBOOT_FIT_CFG_FRAGMENTS = " \ + file://fit_legacy.cfg \ + file://fit_signature.cfg \ +" + +SRC_URI += " \ + ${@oe.utils.conditional('TRUSTFENCE_SIGN', '1', '${UBOOT_FIT_CFG_FRAGMENTS}', '', d)} \ +" +# Install UBOOT_ENV_BINARY to datadir, so that kernel can use it +# to include it into the FIT image. +install_helper_bootscr() { + if [ -f "${D}/boot/${UBOOT_ENV_BINARY}" ]; then + # Install UBOOT_ENV_BINARY into datadir to share it with the kernel + install -Dm 0644 ${D}/boot/${UBOOT_ENV_BINARY} ${D}${datadir}/${UBOOT_ENV_IMAGE} + ln -sf ${UBOOT_ENV_IMAGE} ${D}${datadir}/${UBOOT_ENV_BINARY} + else + bbwarn "${D}/boot/${UBOOT_ENV_BINARY} not found" + fi +} + +do_install:append() { + # Copy boot script, so kernel can include it when creating the FIT image + if [ "${TRUSTFENCE_FIT_IMG}" = "1" ] && [ -n "${UBOOT_ENV_BINARY}" ]; then + install_helper_bootscr + fi +} + COMPATIBLE_MACHINE = "(ccmp1)" 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 index 882507e4b..8396ae402 100644 --- 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 @@ -3,10 +3,10 @@ LICENSE = "GPL-2.0-only" LIC_FILES_CHKSUM = "file://${WORKDIR}/git/LICENSE;md5=ab04ac0f249af12befccb94447c08b77" # For Kernel 5.4 and later -SRCBRANCH = "lf-6.1.22_2.0.0" +SRCBRANCH = "lf-6.1.55_2.2.0" MRVL_SRC ?= "git://github.com/nxp-imx/mwifiex.git;protocol=https" SRC_URI = "${MRVL_SRC};branch=${SRCBRANCH}" -SRCREV = "f1382ccbd34fc22daf504e798745f6cddb702b82" +SRCREV = "952d10f3349426f917636a4560974117eb6eef5b" S = "${WORKDIR}/git/mxm_wifiex/wlan_src" diff --git a/meta-digi-arm/recipes-core/udev/udev-extraconf/automount.rules b/meta-digi-arm/recipes-core/udev/udev-extraconf/automount.rules index df3fb866a..b20cf9d05 100644 --- a/meta-digi-arm/recipes-core/udev/udev-extraconf/automount.rules +++ b/meta-digi-arm/recipes-core/udev/udev-extraconf/automount.rules @@ -18,13 +18,13 @@ SUBSYSTEM=="block", ENV{ID_PART_ENTRY_NAME}=="linux*|update*|data*", ACTION=="ad SUBSYSTEM=="mtd", ATTRS{name}=="linux*|update*|data*", ACTION=="add", RUN+="/etc/udev/scripts/mount_digiparts.sh", GOTO="automount_rules_end" SUBSYSTEM=="ubi", KERNEL=="ubi*", ATTRS{name}=="linux*|update*|data*", ACTION=="add", RUN+="/etc/udev/scripts/mount_digiparts.sh", GOTO="automount_rules_end" -# Avoid mounting recovery partition -SUBSYSTEM=="block", ENV{ID_PART_ENTRY_NAME}=="recovery*", ACTION=="add", GOTO="automount_rules_end" +# Avoid mounting recovery partition & alternative rootfs partition +SUBSYSTEM=="block", ENV{ID_PART_ENTRY_NAME}=="recovery*|rootfs*", ACTION=="add", GOTO="automount_rules_end" SUBSYSTEM=="mtd", ATTRS{name}=="recovery*", ACTION=="add", GOTO="automount_rules_end" # Media automounting -SUBSYSTEM=="block", ACTION=="add" RUN+="/etc/udev/scripts/mount.sh" -SUBSYSTEM=="block", ACTION=="remove" RUN+="/etc/udev/scripts/mount.sh" -SUBSYSTEM=="block", ACTION=="change", ENV{DISK_MEDIA_CHANGE}=="1" RUN+="/etc/udev/scripts/mount.sh" +SUBSYSTEM=="block", ENV{ID_FS_USAGE}=="filesystem", ACTION=="add", RUN+="/etc/udev/scripts/mount.sh" +SUBSYSTEM=="block", ACTION=="remove", RUN+="/etc/udev/scripts/mount.sh" +SUBSYSTEM=="block", ACTION=="change", ENV{DISK_MEDIA_CHANGE}=="1", RUN+="/etc/udev/scripts/mount.sh" LABEL="automount_rules_end" 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 f72b6da8c..e13cf8593 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 @@ -17,6 +17,47 @@ BASE_INIT="$(readlink -f "@base_sbindir@/init")" BASE_INIT_ORIG="$(readlink -f "@base_sbindir@/init.orig")" INIT_SYSTEMD="@systemd_unitdir@/systemd" +EMMCROOTFS="$(grep -qs 'root=PARTUUID.*' /proc/cmdline 2>/dev/null && echo 1)" + +get_active_system() { + if [ -z "${EMMCROOTFS}" ]; then + # For a read-only filesystem this will be /dev/ubiblock0_X + # For an ubifs filesystem this will be ubiX:rootfs_X + ACTIVE_SYSTEM="$(sed -e 's/^.*root=\([^ ]*\) .*$/\1/' /proc/cmdline 2>/dev/null)" + if ! echo "${ACTIVE_SYSTEM}" | grep -qs rootfs; then + # From /dev/ubiblock0_X to /dev/ubi0_X + ACTIVE_SYSTEM="/dev/ubi${ACTIVE_SYSTEM#/dev/ubiblock}" + #Volume ID: 5 (on ubi0) + #Type: dynamic + #Alignment: 1 + #Size: 1817 LEBs (230715392 bytes, 220.0 MiB) + #State: OK + #Name: rootfs_b + #Character device major/minor: 242:6 + ACTIVE_SYSTEM="$(ubinfo "${ACTIVE_SYSTEM}" | sed -ne '/^Name/s,.* \([^[:blank:]]\+\)$,\1,g;T;p')" + fi + else + 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 + fi + + if [ -z "${ACTIVE_SYSTEM}" ]; then + echo "[ERROR] Unable to get active system." + return 1 + fi + + ACTIVE_SYSTEM="${ACTIVE_SYSTEM##*_}" + + return 0 +} if [ "${SUBSYSTEM}" = "block" ]; then PARTNAME="${ID_PART_ENTRY_NAME}" @@ -29,7 +70,7 @@ elif [ "${SUBSYSTEM}" = "ubi" ]; then # called the same as the MTD partition. Do nothing for UBI events if the # MTD partition is called the same, as they are already handled by the # "mtd" subsystem rule - result="$(grep '\"${PARTNAME}\"$' /proc/mtd)" + result="$(grep \"${PARTNAME}\"$ /proc/mtd)" [ -n "${result}" ] && exit 0 fi @@ -48,14 +89,14 @@ if grep -qs "${MOUNTPOINT}" /proc/mounts; then exit 0 fi -DUALBOOT_MODE="$(fw_printenv -n dualboot 2>/dev/null)" -if [ "${DUALBOOT_MODE}" = "yes" ]; then - if [ "${PARTNAME}" = "linux_a" ] || [ "${PARTNAME}" = "linux_b" ]; then - ACTIVE_SYSTEM="$(fw_printenv -n active_system 2>/dev/null)" - if [ "${ACTIVE_SYSTEM}" != "${PARTNAME}" ]; then - logger "Skip mount partition '${PARTNAME}', because it is not the active system" - exit 0 - fi +# Get from proc/cmdline the active system "a" or "b" +get_active_system || exit + +if [ "${PARTNAME}" = "linux_a" ] || [ "${PARTNAME}" = "linux_b" ]; then + PARTINDEX="${PARTNAME#linux_}" + if [ "${ACTIVE_SYSTEM}" != "${PARTINDEX}" ]; then + logger "Skip mount partition '${PARTNAME}', because it is not the active system" + exit 0 fi fi 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..43e98f3f2 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 @@ -18,6 +18,12 @@ do_install:append() { install -d ${D}/mnt/linux install -d ${D}/mnt/update install -d ${D}/mnt/data + # Change mount.sh to check "/sbin/init.orig" additionally to determine if a system is using systemd. + sed -i '/^BASE_INIT=/a BASE_INIT_ORIG="$(readlink -f "@base_sbindir@/init.orig")"' \ + ${D}${sysconfdir}/udev/scripts/mount.sh + sed -i 's/if \[ "x$BASE_INIT" = "x$INIT_SYSTEMD" \];then/if \[ "x$BASE_INIT" = "x$INIT_SYSTEMD" \] || \[ "x$BASE_INIT_ORIG" = "x$INIT_SYSTEMD" \]; then/' \ + ${D}${sysconfdir}/udev/scripts/mount.sh + sed -i -e 's|@base_sbindir@|${base_sbindir}|g' ${D}${sysconfdir}/udev/scripts/mount.sh fi install -m 0755 ${WORKDIR}/mount_digiparts.sh ${D}${sysconfdir}/udev/scripts/ diff --git a/meta-digi-arm/recipes-digi/cryptoauthlib/cryptoauthlib_git.bb b/meta-digi-arm/recipes-digi/cryptoauthlib/cryptoauthlib_git.bb index ba76662dd..d9114868c 100644 --- a/meta-digi-arm/recipes-digi/cryptoauthlib/cryptoauthlib_git.bb +++ b/meta-digi-arm/recipes-digi/cryptoauthlib/cryptoauthlib_git.bb @@ -1,4 +1,4 @@ -# Copyright (C) 2017-2021 Digi International Inc. +# Copyright (C) 2017-2023 Digi International Inc. SUMMARY = "Microchip CryptoAuthentication Library" SECTION = "libs" @@ -53,4 +53,4 @@ RDEPENDS:${PN}-test = "${PN}" RRECOMMENDS:${PN} = "${PN}-test" PACKAGE_ARCH = "${MACHINE_ARCH}" -COMPATIBLE_MACHINE = "(ccimx6qpsbc|ccimx6ul|ccimx8x|ccimx8m)" +COMPATIBLE_MACHINE = "(ccimx6qpsbc|ccimx6ul|ccimx8m|ccimx8x)" diff --git a/meta-digi-arm/recipes-digi/mca/mca-tool_1.25.bb b/meta-digi-arm/recipes-digi/mca/mca-tool_1.25.bb index cd326f853..49a956947 100644 --- a/meta-digi-arm/recipes-digi/mca/mca-tool_1.25.bb +++ b/meta-digi-arm/recipes-digi/mca/mca-tool_1.25.bb @@ -1,4 +1,4 @@ -# Copyright (C) 2016-2022 Digi International. +# Copyright (C) 2016-2023 Digi International. SUMMARY = "MCA firmware management tool" SECTION = "console/tools" @@ -22,4 +22,4 @@ inherit bin_package INSANE_SKIP:${PN} = "already-stripped" -COMPATIBLE_MACHINE = "(ccimx6ul|ccimx8x|ccimx8m|ccmp1)" +COMPATIBLE_MACHINE = "(ccimx6ul|ccimx8m|ccimx8x|ccmp1)" diff --git a/meta-digi-arm/recipes-digi/trustfence/trustfence-sign-tools/trustfence-gen-pki-stm.sh b/meta-digi-arm/recipes-digi/trustfence/trustfence-sign-tools/trustfence-gen-pki-stm.sh index ad0c4548d..cba7b6627 100755 --- a/meta-digi-arm/recipes-digi/trustfence/trustfence-sign-tools/trustfence-gen-pki-stm.sh +++ b/meta-digi-arm/recipes-digi/trustfence/trustfence-sign-tools/trustfence-gen-pki-stm.sh @@ -53,14 +53,16 @@ fi [ -d "${CONFIG_SIGN_KEYS_PATH}" ] || mkdir "${CONFIG_SIGN_KEYS_PATH}" # Default values -KEY_PASS_FILE="${CONFIG_SIGN_KEYS_PATH}/keys/key_pass.txt" +KEY_PASS_BASEFILE="${CONFIG_SIGN_KEYS_PATH}/keys/key_pass" +KEY_PASS_FILE="${KEY_PASS_BASEFILE}.txt" # Generate random keys if they don't exist -N_PUBK="$(ls -l "${CONFIG_SIGN_KEYS_PATH}"/keys/publicKey*.pem 2>/dev/null | wc -l)" -N_PRVK="$(ls -l "${CONFIG_SIGN_KEYS_PATH}"/keys/privateKey*.pem 2>/dev/null | wc -l)" +N_PUBK="$(ls -l ${CONFIG_SIGN_KEYS_PATH}/keys/publicKey*.pem 2>/dev/null | wc -l)" +N_PRVK="$(ls -l ${CONFIG_SIGN_KEYS_PATH}/keys/privateKey*.pem 2>/dev/null | wc -l)" +N_PASS="$(ls -l ${KEY_PASS_BASEFILE}*.txt 2>/dev/null | wc -l)" +install -d "${CONFIG_SIGN_KEYS_PATH}/keys/" if [ "${PLATFORM}" = "ccmp15" ]; then if [ "${N_PUBK}" != "1" ] && [ "${N_PRVK}" != 1 ] && [ ! -f "${KEY_PASS_FILE}" ]; then - install -d "${CONFIG_SIGN_KEYS_PATH}/keys/" # Random password password="$(openssl rand -base64 32)" echo "Generating random key" @@ -69,21 +71,33 @@ if [ "${PLATFORM}" = "ccmp15" ]; then exit 1 fi echo "${password}" > "${KEY_PASS_FILE}" + chmod 400 "${KEY_PASS_FILE}" fi elif [ "${PLATFORM}" = "ccmp13" ]; then - 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)" + if [ "${N_PUBK}" = "8" ] && [ "${N_PRVK}" = "8" ] && [ "${N_PASS}" != "8" ] && [ -f "${KEY_PASS_FILE}" ]; then + # Backwards compatibility: if a single key_pass.txt file exists, + # split into 8 files with one password each + for i in $(seq 0 7); do + cat "${KEY_PASS_FILE}" | cut -f $((i+1)) -d " " > "${KEY_PASS_BASEFILE}0${i}.txt" + chmod 400 "${KEY_PASS_BASEFILE}0${i}.txt" + done + elif [ "${N_PUBK}" != "8" ] && [ "${N_PRVK}" != "8" ] && [ "${N_PASS}" != "8" ]; then + # Generate 8 random passwords + for i in $(seq 0 7); do + pass="$(openssl rand -base64 32)" + echo "${pass}" > "${KEY_PASS_BASEFILE}0${i}.txt" + chmod 400 "${KEY_PASS_BASEFILE}0${i}.txt" + # Combined string with 8 passwords separated by a white space + passwords="${passwords} ${pass}" done echo "Generating random keys" if ! STM32MP_KeyGen_CLI -abs "${CONFIG_SIGN_KEYS_PATH}/keys/" -pwd ${passwords} -n 8; then echo "[ERROR] Could not generate PKI tree" exit 1 fi - echo "${passwords}" > "${KEY_PASS_FILE}" + else + echo "[ERROR] Could not generate PKI tree. An incomplete PKI tree may already exist." + exit 1 fi else echo "Undefined platform" 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 index 236033d95..52f853c78 100755 --- 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 @@ -62,7 +62,6 @@ fi # 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 ! trustfence-gen-pki.sh -p ${PLATFORM}; then @@ -70,9 +69,11 @@ if ! trustfence-gen-pki.sh -p ${PLATFORM}; then fi if [ "${PLATFORM}" = "ccmp15" ]; then + KEY_PASS_FILE="${CONFIG_SIGN_KEYS_PATH}/keys/key_pass.txt" PUBLIC_KEY="${CONFIG_SIGN_KEYS_PATH}/keys/publicKey.pem" PRIVATE_KEY="${CONFIG_SIGN_KEYS_PATH}/keys/privateKey.pem" elif [ "${PLATFORM}" = "ccmp13" ]; then + KEY_PASS_FILE="${CONFIG_SIGN_KEYS_PATH}/keys/key_pass0${CONFIG_KEY_INDEX}.txt" PUBLIC_KEY="${CONFIG_SIGN_KEYS_PATH}/keys/publicKey0*.pem" PRIVATE_KEY="${CONFIG_SIGN_KEYS_PATH}/keys/privateKey0${CONFIG_KEY_INDEX}.pem" else @@ -90,8 +91,7 @@ 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 " ") +PASS=$(cat "${KEY_PASS_FILE}") # Sign TF-A artifact if [ "${ARTIFACT_TFA}" = "y" ]; then 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 cdb0f3575..29213a4a1 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 @@ -100,4 +100,4 @@ FILES:${PN} += " \ ${base_libdir}/firmware/wlan/qcom_cfg.ini \ " -COMPATIBLE_MACHINE = "(ccimx6$|ccimx6ul|ccimx8x|ccimx8m)" +COMPATIBLE_MACHINE = "(ccimx6$|ccimx6ul|ccimx8m|ccimx8x)" 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 index df541be20..e1a0c245a 100644 --- 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 @@ -3,7 +3,6 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}:" SRC_URI:append = " \ - file://0001-Fix-for-the-HE-Rate-Index.patch \ file://81-iw612-wifi.rules \ file://load_iw612.sh \ " diff --git a/meta-digi-arm/recipes-kernel/kernel-modules/kernel-module-nxp-wlan/0001-Fix-for-the-HE-Rate-Index.patch b/meta-digi-arm/recipes-kernel/kernel-modules/kernel-module-nxp-wlan/0001-Fix-for-the-HE-Rate-Index.patch deleted file mode 100644 index c2f0c04ba..000000000 --- a/meta-digi-arm/recipes-kernel/kernel-modules/kernel-module-nxp-wlan/0001-Fix-for-the-HE-Rate-Index.patch +++ /dev/null @@ -1,70 +0,0 @@ -From: Achyut Hegde -Date: Thu, 28 Apr 2022 17:51:45 +0000 -Subject: [PATCH] Fix for the HE Rate Index - ---- - .../mlinux/moal_sta_cfg80211.c | 37 ++++++++++++++++++- - 1 file changed, 35 insertions(+), 2 deletions(-) - -diff --git a/mxm_wifiex/mlinux/moal_sta_cfg80211.c b/mxm_wifiex/mlinux/moal_sta_cfg80211.c -index bf39f0e9b003..5f300288a6c8 100644 ---- a/mlinux/moal_sta_cfg80211.c -+++ b/mlinux/moal_sta_cfg80211.c -@@ -3393,6 +3393,37 @@ done: - return ret; - } - -+#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 1, 18) -+/** -+ * @brief This function convert he_gi to nl80211_he_gi -+ * -+ * @param he_gi 0/1/2/3 -+ * -+ * -+ * @return 0: NL80211_RATE_INFO_HE_GI_0_8 -+ * 1: NL80211_RATE_INFO_HE_GI_1_6 -+ * 2: NL80211_RATE_INFO_HE_GI_3_2 -+ */ -+static t_u8 woal_he_gi_to_nl80211_he_gi(t_u8 he_gi) -+{ -+ t_u8 cfg_he_gi = 0; -+ switch(he_gi){ -+ case 3: -+ cfg_he_gi = NL80211_RATE_INFO_HE_GI_3_2; -+ break; -+ case 2: -+ cfg_he_gi = NL80211_RATE_INFO_HE_GI_1_6; -+ break; -+ case 0: -+ case 1: -+ default: -+ cfg_he_gi = NL80211_RATE_INFO_HE_GI_0_8; -+ break; -+ } -+ return cfg_he_gi; -+} -+#endif -+ - /** - * @brief Request the driver to fill the tx/rx rate info - * -@@ -3469,7 +3500,8 @@ static void woal_cfg80211_fill_rate_info(moal_private *priv, - sinfo->txrate.flags = RATE_INFO_FLAGS_HE_MCS; - sinfo->txrate.nss = rate->param.data_rate.tx_nss + 1; - sinfo->txrate.mcs = rate->param.data_rate.tx_mcs_index; -- sinfo->txrate.he_gi = rate->param.data_rate.tx_ht_gi; -+ sinfo->txrate.he_gi = woal_he_gi_to_nl80211_he_gi( -+ rate->param.data_rate.tx_ht_gi); - if (rate->param.data_rate.tx_ht_bw == MLAN_VHT_BW80) - sinfo->txrate.bw = RATE_INFO_BW_80; - else if (rate->param.data_rate.tx_ht_bw == MLAN_HT_BW40) -@@ -3516,7 +3548,8 @@ static void woal_cfg80211_fill_rate_info(moal_private *priv, - sinfo->rxrate.flags = RATE_INFO_FLAGS_HE_MCS; - sinfo->rxrate.nss = rate->param.data_rate.rx_nss + 1; - sinfo->rxrate.mcs = rate->param.data_rate.rx_mcs_index; -- sinfo->rxrate.he_gi = rate->param.data_rate.rx_ht_gi; -+ sinfo->rxrate.he_gi = woal_he_gi_to_nl80211_he_gi( -+ rate->param.data_rate.rx_ht_gi); - if (rate->param.data_rate.rx_ht_bw == MLAN_VHT_BW80) - sinfo->rxrate.bw = RATE_INFO_BW_80; - else if (rate->param.data_rate.rx_ht_bw == MLAN_HT_BW40) 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 e6acea5c5..678b8f292 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 @@ -35,7 +35,7 @@ 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 +[ -d "/sys/class/net/wlan0" ] && log "Wi-Fi activated" && exit 0 log "[ERROR] cannot load Wi-Fi driver" exit 1 diff --git a/meta-digi-arm/recipes-kernel/linux/linux-dey.inc b/meta-digi-arm/recipes-kernel/linux/linux-dey.inc index de58e8115..afda6fa1e 100644 --- a/meta-digi-arm/recipes-kernel/linux/linux-dey.inc +++ b/meta-digi-arm/recipes-kernel/linux/linux-dey.inc @@ -5,7 +5,6 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46" inherit kernel inherit ${@oe.utils.conditional('DEY_SOC_VENDOR', 'NXP', 'fsl-kernel-localversion', '', d)} -require ${@oe.utils.conditional('DEY_SOC_VENDOR', 'STM', 'recipes-kernel/linux/linux-stm32mp.inc', '', d)} require ${@bb.utils.contains('DISTRO_FEATURES', 'virtualization', 'linux-virtualization.inc', '', d)} require ${@oe.utils.conditional('TRUSTFENCE_SIGN', '1', 'recipes-kernel/linux/linux-trustfence.inc', '', d)} @@ -30,8 +29,6 @@ OVERLAYS_DTC_FLAGS:ccimx6ul = "" OVERLAYS_DTC_FLAGS:ccimx6 = "" KERNEL_DTC_FLAGS = "${OVERLAYS_DTC_FLAGS}" -KERNEL_EXTRA_ARGS:stm32mpcommon += "LOADADDR=${ST_KERNEL_LOADADDR}" - # A user can provide his own kernel 'defconfig' file by: # - setting the variable KERNEL_DEFCONFIG to a custom kernel configuration file # inside the kernel repository. @@ -49,7 +46,13 @@ do_copy_defconfig () { cp -f ${KERNEL_DEFCONFIG} ${WORKDIR}/defconfig fi } -addtask copy_defconfig after do_patch before do_kernel_localversion + +python () { + if d.getVar('DEY_SOC_VENDOR') == "STM": + bb.build.addtask('copy_defconfig', 'do_configure', 'do_patch', d) + elif d.getVar('DEY_SOC_VENDOR') == "NXP": + bb.build.addtask('copy_defconfig', 'do_kernel_localversion', 'do_patch', d) +} # This is needed because kernel_localversion (in fsl-kernel-localversion.bbclass) # creates a basic ${B}/.config file and because that file exists, kernel_do_configure 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 1a908da36..50d95348e 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 @@ -7,4 +7,10 @@ SRCBRANCH:stm32mpcommon = "v5.15/stm/dey-4.0/maint" SRCREV = "${AUTOREV}" SRCREV:stm32mpcommon = "${AUTOREV}" -COMPATIBLE_MACHINE = "(ccimx6ul|ccimx8m|ccimx6|ccmp1|ccimx8x)" +do_assemble_fitimage:prepend:ccmp1() { + # Deploy u-boot script to be included into the FIT image + install -d ${STAGING_DIR_HOST}/boot + install -m 0644 ${RECIPE_SYSROOT}/${datadir}/${UBOOT_ENV_BINARY} ${STAGING_DIR_HOST}/boot/ +} + +COMPATIBLE_MACHINE = "(ccimx6|ccimx6ul|ccimx8m|ccimx8x|ccmp1)" diff --git a/meta-digi-arm/recipes-kernel/linux/linux-trustfence.inc b/meta-digi-arm/recipes-kernel/linux/linux-trustfence.inc index 690e2cdf2..6d2b06ee3 100644 --- a/meta-digi-arm/recipes-kernel/linux/linux-trustfence.inc +++ b/meta-digi-arm/recipes-kernel/linux/linux-trustfence.inc @@ -1,13 +1,9 @@ -# Copyright (C) 2022 Digi International +# Copyright (C) 2022-2023 Digi International -DEPENDS += "${@oe.utils.conditional('TRUSTFENCE_SIGN', '1', 'trustfence-sign-tools-native', '', d)}" - -do_deploy[postfuncs] += "${@oe.utils.conditional('TRUSTFENCE_SIGN', '1', 'trustfence_sign', '', d)}" +DEPENDS += "${@oe.utils.vartrue('TRUSTFENCE_SIGN_ARTIFACTS', 'trustfence-sign-tools-native', '', d)}" +do_deploy[postfuncs] += "${@oe.utils.vartrue('TRUSTFENCE_SIGN_ARTIFACTS', '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/dey-swupdate-common.bbclass b/meta-digi-dey/classes/dey-swupdate-common.bbclass index 7e3031d3e..bad51a542 100644 --- a/meta-digi-dey/classes/dey-swupdate-common.bbclass +++ b/meta-digi-dey/classes/dey-swupdate-common.bbclass @@ -1,4 +1,4 @@ -# Copyright (C) 2023 Digi International. +# Copyright (C) 2023-2024 Digi International. # ####################################### @@ -88,10 +88,53 @@ SWUPDATE_IS_IMAGES_UPDATE = "${@update_based_on_images(d)}" # Determine the correct UBoot update script file to use depending on storage type. SWUPDATE_UBOOT_SCRIPT = "${@oe.utils.conditional('STORAGE_MEDIA', 'mmc', 'swupdate_uboot_mmc.sh', 'swupdate_uboot_nand.sh', d)}" +SWUPDATE_UBOOT_SCRIPT_NAME = "${@os.path.basename(d.getVar('SWUPDATE_UBOOT_SCRIPT'))}" -UBOOT_EXT ?= ".${UBOOT_SUFFIX}" +# Retrieve the correct U-Boot prefix. +def get_uboot_prefix(d): + prefix = d.getVar('UBOOT_PREFIX') + if d.getVar('DEY_SOC_VENDOR') == "NXP" and d.getVar('TRUSTFENCE_SIGN') == "1": + if "ccimx6" in d.getVar('MACHINE'): + prefix = f"{prefix}-dtb" + if d.getVar('TRUSTFENCE_DEK_PATH') and d.getVar('TRUSTFENCE_DEK_PATH') != "0": + prefix = f"{prefix}-encrypted" + else: + prefix = f"{prefix}-signed" + return prefix -UBOOTIMG_OFFSET ?= "${BOOTLOADER_SEEK_BOOT}" +SWUPDATE_UBOOT_PREFIX ?= "${@get_uboot_prefix(d)}" +SWUPDATE_UBOOT_PREFIX_TFA ?= "tf-a" + +SWUPDATE_UBOOT_EXT ?= ".${UBOOT_SUFFIX}" +SWUPDATE_UBOOT_EXT_TFA ?= ".stm32" + +SWUPDATE_UBOOT_NAME ?= "${SWUPDATE_UBOOT_PREFIX}-${MACHINE}${SWUPDATE_UBOOT_EXT}" +SWUPDATE_UBOOT_NAME:ccimx6sbc ?= "${SWUPDATE_UBOOT_PREFIX}-ccimx6qsbc${SWUPDATE_UBOOT_EXT}" +SWUPDATE_UBOOT_NAME:ccmp1 ?= "${SWUPDATE_UBOOT_PREFIX}-${MACHINE}-optee${FIP_SIGN_SUFFIX}${SWUPDATE_UBOOT_EXT}" +SWUPDATE_UBOOT_NAME_TFA ?= "" +SWUPDATE_UBOOT_NAME_TFA:ccmp1 ?= "${SWUPDATE_UBOOT_PREFIX_TFA}-${MACHINE}-nand${SWUPDATE_UBOOT_EXT_TFA}${TFA_SIGN_SUFFIX}" + +SWUPDATE_UBOOT_OFFSET ?= "${BOOTLOADER_SEEK_BOOTPART}" + +# Retrieve the correct encryption type. +def get_swupdate_uboot_enc(d): + if d.getVar('TRUSTFENCE_DEK_PATH') and d.getVar('TRUSTFENCE_DEK_PATH') != "0" : + return "enc" + return "normal" + +SWUPDATE_UBOOT_ENC ?= "${@get_swupdate_uboot_enc(d)}" + +# Retrieve the redundant U-Boot value. +def get_uboot_redundant(d): + if d.getVar("SWUPDATE_UBOOTIMG") == "true" and d.getVar("SWUPDATE_UBOOTIMG_REDUNDANT") == "true": + if any(d.getVar("MACHINE").startswith(platform) for platform in ("ccimx6", "ccimx8")): + bb.warn("Target does not support updating redundant U-Boot. Continuing with single SWU U-Boot update.") + return "single" + return "redundant" + + return "single" + +SWUPDATE_UBOOT_REDUNDANT = "${@get_uboot_redundant(d)}" ####################################### ########## SWU Update Script ########## diff --git a/meta-digi-dey/classes/trustfence.bbclass b/meta-digi-dey/classes/trustfence.bbclass index ad405042b..eb459726c 100644 --- a/meta-digi-dey/classes/trustfence.bbclass +++ b/meta-digi-dey/classes/trustfence.bbclass @@ -9,6 +9,8 @@ # * Disabled console # +TRUSTFENCE_ENABLED = "1" + # Default secure console configuration TRUSTFENCE_CONSOLE_DISABLE ?= "0" @@ -26,6 +28,7 @@ TRUSTFENCE_DEK_PATH:ccmp1 ?= "0" TRUSTFENCE_ENCRYPT_ENVIRONMENT ?= "1" TRUSTFENCE_SRK_REVOKE_MASK ?= "0x0" TRUSTFENCE_KEY_INDEX ?= "0" +TRUSTFENCE_FIT_IMG:ccmp1 ?= "1" # Partition encryption configuration TRUSTFENCE_ENCRYPT_PARTITIONS ?= "1" @@ -34,8 +37,28 @@ TRUSTFENCE_ENCRYPT_ROOTFS ?= "${@bb.utils.contains("IMAGE_FEATURES", "read-only- # Read-only rootfs TRUSTFENCE_READ_ONLY_ROOTFS ?= "${@bb.utils.contains("IMAGE_FEATURES", "read-only-rootfs", "1", "0", d)}" +# +# NOTHING TO CUSTOMIZE BELOW THIS LINE +# + +# TrustFence sign artifacts is not supported on all platforms +TRUSTFENCE_SIGN_ARTIFACTS = "1" +TRUSTFENCE_SIGN_ARTIFACTS:ccmp1 = "0" +TRUSTFENCE_SIGN_ARTIFACTS:ccimx93 = "0" + IMAGE_FEATURES += "dey-trustfence" +# --------------------------------- +# Usage of FIT Image signed +# --------------------------------- + +# Enable FIT image build when Trustfence is enabled +MACHINE_FEATURES += "${@oe.utils.conditional('TRUSTFENCE_FIT_IMG', '1', 'fit', '', d)}" +# key to sign FIT config nodes +TRUSTFENCE_FIT_CFG_SIGN_KEYNAME ?= "fitcfg" +# key to sign FIT image nodes +TRUSTFENCE_FIT_IMG_SIGN_KEYNAME ?= "fitimg" + # Function to generate a PKI tree (with lock dir protection) GENPKI_LOCK_DIR = "${TRUSTFENCE_SIGN_KEYS_PATH}/.genpki.lock" gen_pki_tree() { @@ -82,7 +105,7 @@ copy_public_key() { if [ "${TRUSTFENCE_SIGN_MODE}" = "HAB" ]; then CERT_IMG="$(echo ${TRUSTFENCE_SIGN_KEYS_PATH}/crts/IMG${KEY_INDEX}*crt.pem)" elif [ "${TRUSTFENCE_SIGN_MODE}" = "AHAB" ]; then - CERT_IMG="$(echo ${TRUSTFENCE_SIGN_KEYS_PATH}/crts/SRK${KEY_INDEX}*_ca_crt.pem)" + CERT_IMG="$(echo ${TRUSTFENCE_SIGN_KEYS_PATH}/crts/SRK${KEY_INDEX}*crt.pem)" else bberror "Unknown TRUSTFENCE_SIGN_MODE value" exit 1 @@ -155,6 +178,8 @@ python () { d.setVar("TRUSTFENCE_PASSWORD_FILE", d.getVar("TRUSTFENCE_SIGN_KEYS_PATH") + "/keys/key_pass.txt") d.appendVar("UBOOT_TF_CONF", "CONFIG_SIGN_IMAGE=y ") + if (d.getVar("TRUSTFENCE_SIGN_ARTIFACTS") == "1"): + d.appendVar("UBOOT_TF_CONF", "CONFIG_AUTH_ARTIFACTS=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"): @@ -164,11 +189,31 @@ 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"): d.appendVar("UBOOT_TF_CONF", 'CONFIG_SIGN_MODE="%s" ' % d.getVar("TRUSTFENCE_SIGN_MODE")) + + + if (d.getVar("TRUSTFENCE_FIT_IMG") == "1"): + # FIT-related variables + # Create keys if not defined + d.setVar("FIT_GENERATE_KEYS", "1") + # Sign individual images (prevents running unsigned images in FIT) + d.setVar("FIT_SIGN_INDIVIDUAL", "1") + # Set variables required by poky to sign FIT image + d.setVar("UBOOT_SIGN_KEYNAME", d.getVar("TRUSTFENCE_FIT_CFG_SIGN_KEYNAME")) + d.setVar("UBOOT_SIGN_IMG_KEYNAME", d.getVar("TRUSTFENCE_FIT_IMG_SIGN_KEYNAME")) + d.setVar("UBOOT_MKIMAGE_DTCOPTS", "-I dts -O dtb -p 2000") + # Enable FIT signing support + d.setVar("UBOOT_SIGN_ENABLE", d.getVar("TRUSTFENCE_SIGN")) + # Set path to FIT signing keys + d.setVar("UBOOT_SIGN_KEYDIR", "%s/fit" % d.getVar("TRUSTFENCE_SIGN_KEYS_PATH")) + + else: + # Disable signing artifacts if TRUSTFENCE_SIGN != 1 + d.setVar("TRUSTFENCE_SIGN_ARTIFACTS", "0") + if (d.getVar("TRUSTFENCE_ENCRYPT_ENVIRONMENT") == "1"): if (d.getVar("DEY_SOC_VENDOR") == "NXP"): d.appendVar("UBOOT_TF_CONF", "CONFIG_ENV_AES=y CONFIG_ENV_AES_CAAM_KEY=y ") @@ -197,9 +242,15 @@ python () { 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") + # Set the key password. + d.setVar("SWUPDATE_PASSWORD_FILE", keys_path + "/keys/key_pass.txt") + elif (d.getVar("DEY_SOC_VENDOR") == "STM"): + d.setVar("SWUPDATE_PRIVATE_KEY_TEMPLATE", d.getVar("FIP_SIGN_KEY")) + # Set the key password. + if (d.getVar("DIGI_SOM") == "ccmp15"): + d.setVar("SWUPDATE_PASSWORD_FILE", keys_path + "/keys/key_pass.txt") + elif (d.getVar("DIGI_SOM") == "ccmp13"): + d.setVar("SWUPDATE_PASSWORD_FILE", keys_path + "/keys/key_pass0" + str(key_index) + ".txt") # Enable partition encryption if rootfs encryption is enabled if (d.getVar("TRUSTFENCE_ENCRYPT_ROOTFS") == "1"): diff --git a/meta-digi-dey/conf/distro/dey.conf b/meta-digi-dey/conf/distro/dey.conf index 31dae58d3..db39b4a30 100644 --- a/meta-digi-dey/conf/distro/dey.conf +++ b/meta-digi-dey/conf/distro/dey.conf @@ -3,7 +3,7 @@ require conf/distro/poky.conf # Discrete version values. YOCTO_MAJOR = "4" YOCTO_MINOR = "0" -DEY_RELEASE = "4" +DEY_RELEASE = "5" DEY_BUILD = "1" # Firmware version of the system. @@ -45,6 +45,7 @@ FEATURE_PACKAGES_dey-crank = "packagegroup-dey-crank" FEATURE_PACKAGES_dey-debug = "packagegroup-dey-debug" FEATURE_PACKAGES_dey-examples = "packagegroup-dey-examples" FEATURE_PACKAGES_dey-gstreamer = "packagegroup-dey-gstreamer" +FEATURE_PACKAGES_dey-lvgl = "packagegroup-dey-lvgl" FEATURE_PACKAGES_dey-network = "packagegroup-dey-network" FEATURE_PACKAGES_dey-qt = "packagegroup-dey-qt" FEATURE_PACKAGES_dey-trustfence = "packagegroup-dey-trustfence" @@ -84,7 +85,14 @@ PACKAGECONFIG:append:class-target:pn-qtbase = " examples" PACKAGECONFIG:append:class-target:pn-qtdeclarative = " examples" PACKAGECONFIG:append:class-target:pn-qtquick3d = " examples" PACKAGECONFIG:append:class-target:pn-qtwebengine = " examples" -# libarchive is using "zstd" in its package config. -# This is not used in the swupdate that is the only consumer of the libarchive package. -# Remove it to reduce the size of the recovery image. -PACKAGECONFIG:remove:class-target:pn-libarchive = " zstd" + +# Remove unnecessary libarchive configurations to trim down the recovery image, +# while keeping the "zlib" one to make sure our file update mechanism still +# works (libarchive needs to be able to handle .tar.gz files, every other +# format can be omitted). +PACKAGECONFIG:remove:class-target:pn-libarchive = "bz2 xz lzo zstd acl xattr" + +# cryptsetup still works as expected in our eMMC partition encryption use case +# when udev support is disabled, so remove it to avoid dragging a bunch of +# dependencies into the recovery and trustfence initramfs. +PACKAGECONFIG:remove:class-target:pn-cryptsetup = "udev" diff --git a/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/wayland/required-distro-features.inc b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/wayland/required-distro-features.inc new file mode 100644 index 000000000..bb4a0e8eb --- /dev/null +++ b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/wayland/required-distro-features.inc @@ -0,0 +1,8 @@ +# distro features required by weston recipes + +inherit features_check + +# requires pam enabled if started via systemd +# +REQUIRED_DISTRO_FEATURES = "wayland opengl ${@oe.utils.conditional('VIRTUAL-RUNTIME_init_manager', 'systemd', 'pam', '', d)}" + diff --git a/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/wayland/wayland-protocols_1.32.imx.bb b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/wayland/wayland-protocols_1.32.imx.bb new file mode 100644 index 000000000..753f901ab --- /dev/null +++ b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/wayland/wayland-protocols_1.32.imx.bb @@ -0,0 +1,16 @@ +# Copyright 2023 Digi International Inc. + +# +# Reuse meta-freescale's wayland-protocols_1.25.imx.bb +# +require recipes-graphics/wayland/wayland-protocols_1.25.imx.bb + +LIC_FILES_CHKSUM = "file://LICENSE;md5=c7b12b6702da38ca028ace54aae3d484 \ + file://stable/presentation-time/presentation-time.xml;endline=26;md5=4646cd7d9edc9fa55db941f2d3a7dc53" + +SRC_URI = "git://github.com/nxp-imx/wayland-protocols-imx.git;protocol=https;branch=wayland-protocols-imx-1.32" +SRCREV = "7ece577d467f8afb2f5a2f7fff3761a1e0ee9dad" + +BBCLASSEXTEND = "native nativesdk" + +COMPATIBLE_MACHINE = "(ccimx93)" diff --git a/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/wayland/wayland_%.bbappend b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/wayland/wayland_1.20.0.bbappend similarity index 100% rename from meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/wayland/wayland_%.bbappend rename to meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/wayland/wayland_1.20.0.bbappend diff --git a/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/wayland/weston-11.0.3.imx/0001-Revert-protocol-no-found-wayland-scanner-with-Yocto-.patch b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/wayland/weston-11.0.3.imx/0001-Revert-protocol-no-found-wayland-scanner-with-Yocto-.patch new file mode 100644 index 000000000..39439ce16 --- /dev/null +++ b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/wayland/weston-11.0.3.imx/0001-Revert-protocol-no-found-wayland-scanner-with-Yocto-.patch @@ -0,0 +1,40 @@ +From 3aa4024ac4107e68552be4dfe5fce511900629c9 Mon Sep 17 00:00:00 2001 +From: Max Krummenacher +Date: Mon, 11 Jul 2022 19:38:19 +0000 +Subject: [PATCH] Revert "protocol: no found wayland-scanner with Yocto + toolchain" + +This reverts commit 7859a762617682bd804e210ad3bda6bdcd3ea24a. + +With openembedded commit e525db4eb9 ("wayland: update 1.20.0 -> 1.21.0") +package config seems no longer to provide the path to the native +weston scanner. + +Thus the build fails with: + +| Run-time dependency wayland-scanner found: YES 1.21.0 +| Program /usr/bin/wayland-scanner found: NO +| +| ../git/protocol/meson.build:2:0: ERROR: Program '/usr/bin/wayland-scanner' not found or not executable + +Dropping weston 9.0.0-imx commit 7859a762 (protocol: no found +wayland-scanner with Yocto toolchain") fixes the issue. + +Signed-off-by: Max Krummenacher +--- + protocol/meson.build | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/protocol/meson.build b/protocol/meson.build +index e8698530..ba52089b 100644 +--- a/protocol/meson.build ++++ b/protocol/meson.build +@@ -1,4 +1,4 @@ +-dep_scanner = dependency('wayland-scanner', native: false) ++dep_scanner = dependency('wayland-scanner', native: true) + prog_scanner = find_program(dep_scanner.get_pkgconfig_variable('wayland_scanner')) + + dep_wp = dependency('wayland-protocols', version: '>= 1.26', +-- +2.25.1 + diff --git a/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/wayland/weston-11.0.3.imx/systemd-notify.weston-start b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/wayland/weston-11.0.3.imx/systemd-notify.weston-start new file mode 100644 index 000000000..a97e7b38d --- /dev/null +++ b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/wayland/weston-11.0.3.imx/systemd-notify.weston-start @@ -0,0 +1,9 @@ +#!/bin/sh + +# SPDX-FileCopyrightText: Huawei Inc. +# SPDX-License-Identifier: Apache-2.0 + + +if [[ -x "/usr/lib/weston/systemd-notify.so" ]]; then + add_weston_module "systemd-notify.so" +fi diff --git a/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/wayland/weston-11.0.3.imx/weston.desktop b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/wayland/weston-11.0.3.imx/weston.desktop new file mode 100644 index 000000000..1086ae8bf --- /dev/null +++ b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/wayland/weston-11.0.3.imx/weston.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Encoding=UTF-8 +Type=Application +Name=Weston +Comment=Wayland Compostitor +Exec=weston +Icon=weston +Terminal=false +Categories=Utility; diff --git a/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/wayland/weston-11.0.3.imx/weston.png b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/wayland/weston-11.0.3.imx/weston.png new file mode 100644 index 000000000..ea8b7e0e2 Binary files /dev/null and b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/wayland/weston-11.0.3.imx/weston.png differ diff --git a/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/wayland/weston-11.0.3.imx/xwayland.weston-start b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/wayland/weston-11.0.3.imx/xwayland.weston-start new file mode 100644 index 000000000..342ac8d12 --- /dev/null +++ b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/wayland/weston-11.0.3.imx/xwayland.weston-start @@ -0,0 +1,6 @@ +#!/bin/sh + +if type Xwayland >/dev/null 2>/dev/null; then + mkdir -m 775 -p /tmp/.X11-unix + chown root:video /tmp/.X11-unix +fi diff --git a/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/wayland/weston-init.bbappend b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/wayland/weston-init.bbappend index 5e3c1bb6e..1636278eb 100644 --- a/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/wayland/weston-init.bbappend +++ b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/wayland/weston-init.bbappend @@ -6,12 +6,14 @@ SRC_URI += " \ file://digi_background.png \ file://profile \ " +SRC_URI:append:ccimx93 = " file://weston-socket.sh" INI_UNCOMMENT_ASSIGNMENTS:append:mx9-nxp-bsp = " \ repaint-window=16 \ " INI_UNCOMMENT_ASSIGNMENTS:append:mx93-nxp-bsp = " \ - use-g2d=1 \ + gbm-format=argb8888 \ + use-g2d=true \ " update_file() { @@ -39,6 +41,10 @@ do_install:append() { } do_install:append:ccimx93() { + # The ccimx93 uses a new version of weston where 'weston-socket.sh' supercedes 'weston.sh' + \rm -f ${D}${sysconfdir}/profile.d/weston.sh + install -Dm0644 ${WORKDIR}/weston-socket.sh ${D}${sysconfdir}/profile.d/weston-socket.sh + install -d ${D}${sysconfdir}/default/ echo "QMLSCENE_DEVICE=softwarecontext" >> ${D}${sysconfdir}/default/weston } diff --git a/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/wayland/weston-init/ccimx93/weston-socket.sh b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/wayland/weston-init/ccimx93/weston-socket.sh new file mode 100755 index 000000000..86389d63a --- /dev/null +++ b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/wayland/weston-init/ccimx93/weston-socket.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +# set weston variables for use with global weston socket +global_socket="/run/wayland-0" +if [ -e "$global_socket" ]; then + weston_group=$(stat -c "%G" "$global_socket") + if [ "$(id -u)" = "0" ]; then + export WAYLAND_DISPLAY="$global_socket" + else + case "$(groups "$USER")" in + *"$weston_group"*) + export WAYLAND_DISPLAY="$global_socket" + ;; + *) + ;; + esac + fi + unset weston_group +fi +unset global_socket diff --git a/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/wayland/weston-init/ccimx93/weston.ini b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/wayland/weston-init/ccimx93/weston.ini new file mode 100644 index 000000000..164ee4f86 --- /dev/null +++ b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/wayland/weston-init/ccimx93/weston.ini @@ -0,0 +1,36 @@ +[core] +#gbm-format=argb8888 +idle-time=0 +#use-g2d=true +#xwayland=true +#repaint-window=16 +#enable-overlay-view=1 + +#[shell] +#size=1920x1080 + +[libinput] +touchscreen_calibrator=true + +#[output] +#name=HDMI-A-1 +#mode=1920x1080@60 +#transform=rotate-90 + +#[output] +#name=HDMI-A-2 +#mode=off +# WIDTHxHEIGHT Resolution size width and height in pixels +# off Disables the output +# preferred Uses the preferred mode +# current Uses the current crt controller mode +#transform=rotate-90 + +[screen-share] +command=@bindir@/weston --backend=rdp-backend.so --shell=fullscreen-shell.so --no-clients-resize +#start-on-startup=true + +# Digi: Set custom background +[shell] +background-image=/usr/share/weston/digi_background.png +background-type=scale-crop diff --git a/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/wayland/weston_10.0.1.imx.bbappend b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/wayland/weston_10.0.1.imx.bbappend deleted file mode 100644 index 8774d4608..000000000 --- a/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/wayland/weston_10.0.1.imx.bbappend +++ /dev/null @@ -1,7 +0,0 @@ -# Copyright (C) 2023 Digi International - -SRCREV = "b3ccf36b718d16f5fb38ccfc2cccaf45c79854d8" - -PACKAGECONFIG:append:mx93-nxp-bsp = " imxgpu imxg2d" - -COMPATIBLE_MACHINE = "(imx-nxp-bsp)" diff --git a/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/wayland/weston_11.0.3.imx.bb b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/wayland/weston_11.0.3.imx.bb new file mode 100644 index 000000000..812675c8f --- /dev/null +++ b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/wayland/weston_11.0.3.imx.bb @@ -0,0 +1,189 @@ +# This recipe is for the i.MX fork of weston. For ease of +# maintenance, the top section is a verbatim copy of an OE-core +# recipe. The second section customizes the recipe for i.MX. + +########### OE-core copy ################## +# Upstream hash: 7f1932cb5a408320a5b542e20ba2807718349e8f + +SUMMARY = "Weston, a Wayland compositor" +DESCRIPTION = "Weston is the reference implementation of a Wayland compositor" +HOMEPAGE = "http://wayland.freedesktop.org" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://COPYING;md5=d79ee9e66bb0f95d3386a7acae780b70 \ + file://libweston/compositor.c;endline=27;md5=eb6d5297798cabe2ddc65e2af519bcf0 \ + " + +SRC_URI = "https://gitlab.freedesktop.org/wayland/weston/uploads/f5648c818fba5432edc3ea63c4db4813/${BPN}-${PV}.tar.xz \ + file://weston.png \ + file://weston.desktop \ + file://xwayland.weston-start \ + file://systemd-notify.weston-start \ + " + +SRC_URI[sha256sum] = "a413f68c252957fc3191c3650823ec356ae8c124ccc0cb440da5cdc4e2cb9e57" + +UPSTREAM_CHECK_URI = "https://wayland.freedesktop.org/releases.html" +UPSTREAM_CHECK_REGEX = "weston-(?P\d+\.\d+\.(?!9\d+)\d+)" + +inherit meson pkgconfig useradd + +# depends on virtual/egl +# +require ${THISDIR}/required-distro-features.inc + +DEPENDS = "libxkbcommon gdk-pixbuf pixman cairo glib-2.0" +DEPENDS += "wayland wayland-protocols libinput virtual/egl pango wayland-native" + +LDFLAGS += "${@bb.utils.contains('DISTRO_FEATURES', 'lto', '-Wl,-z,undefs', '', d)}" + +WESTON_MAJOR_VERSION = "${@'.'.join(d.getVar('PV').split('.')[0:1])}" + +EXTRA_OEMESON += "-Dpipewire=false" + +PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'kms wayland egl clients', '', d)} \ + ${@bb.utils.contains('DISTRO_FEATURES', 'x11 wayland', 'xwayland', '', d)} \ + ${@bb.utils.filter('DISTRO_FEATURES', 'systemd x11', d)} \ + ${@bb.utils.contains_any('DISTRO_FEATURES', 'wayland x11', '', 'headless', d)} \ + ${@oe.utils.conditional('VIRTUAL-RUNTIME_init_manager', 'sysvinit', 'launcher-libseat', '', d)} \ + image-jpeg \ + screenshare \ + shell-desktop \ + shell-fullscreen \ + shell-ivi \ + shell-kiosk \ + " + +# Can be 'damage', 'im', 'egl', 'shm', 'touch', 'dmabuf-feedback', 'dmabuf-v4l', 'dmabuf-egl' or 'all' +SIMPLECLIENTS ?= "all" + +# +# Compositor choices +# +# Weston on KMS +PACKAGECONFIG[kms] = "-Dbackend-drm=true,-Dbackend-drm=false,drm udev virtual/egl virtual/libgles2 virtual/libgbm mtdev" +# Weston on Wayland (nested Weston) +PACKAGECONFIG[wayland] = "-Dbackend-wayland=true,-Dbackend-wayland=false,virtual/egl virtual/libgles2" +# Weston on X11 +PACKAGECONFIG[x11] = "-Dbackend-x11=true,-Dbackend-x11=false,virtual/libx11 libxcb libxcb libxcursor cairo" +# Headless Weston +PACKAGECONFIG[headless] = "-Dbackend-headless=true,-Dbackend-headless=false" +# Weston on RDP +PACKAGECONFIG[rdp] = "-Dbackend-rdp=true,-Dbackend-rdp=false,freerdp" +# VA-API desktop recorder +PACKAGECONFIG[vaapi] = "-Dbackend-drm-screencast-vaapi=true,-Dbackend-drm-screencast-vaapi=false,libva" +# Weston with EGL support +PACKAGECONFIG[egl] = "-Drenderer-gl=true,-Drenderer-gl=false,virtual/egl" +# Weston with lcms support +PACKAGECONFIG[lcms] = "-Dcolor-management-lcms=true,-Dcolor-management-lcms=false,lcms" +# Weston with webp support +PACKAGECONFIG[webp] = "-Dimage-webp=true,-Dimage-webp=false,libwebp" +# Weston with systemd-login support +PACKAGECONFIG[systemd] = "-Dsystemd=true -Dlauncher-logind=true,-Dsystemd=false -Dlauncher-logind=false,systemd dbus" +# Weston with Xwayland support (requires X11 and Wayland) +PACKAGECONFIG[xwayland] = "-Dxwayland=true,-Dxwayland=false,xwayland" +# colord CMS support +PACKAGECONFIG[colord] = "-Ddeprecated-color-management-colord=true,-Ddeprecated-color-management-colord=false,colord" +# Clients support +PACKAGECONFIG[clients] = "-Dsimple-clients=${SIMPLECLIENTS} -Ddemo-clients=true,-Dsimple-clients= -Ddemo-clients=false" +# Virtual remote output with GStreamer on DRM backend +PACKAGECONFIG[remoting] = "-Dremoting=true,-Dremoting=false,gstreamer1.0 gstreamer1.0-plugins-base" +# Weston with screen-share support +PACKAGECONFIG[screenshare] = "-Dscreenshare=true,-Dscreenshare=false" +# Traditional desktop shell +PACKAGECONFIG[shell-desktop] = "-Dshell-desktop=true,-Dshell-desktop=false" +# Fullscreen shell +PACKAGECONFIG[shell-fullscreen] = "-Dshell-fullscreen=true,-Dshell-fullscreen=false" +# In-Vehicle Infotainment (IVI) shell +PACKAGECONFIG[shell-ivi] = "-Dshell-ivi=true,-Dshell-ivi=false" +# Kiosk shell +PACKAGECONFIG[shell-kiosk] = "-Dshell-kiosk=true,-Dshell-kiosk=false" +# JPEG image loading support +PACKAGECONFIG[image-jpeg] = "-Dimage-jpeg=true,-Dimage-jpeg=false, jpeg" +# support libseat based launch +PACKAGECONFIG[launcher-libseat] = "-Dlauncher-libseat=true,-Dlauncher-libseat=false,seatd" + +do_install:append() { + # Weston doesn't need the .la files to load modules, so wipe them + rm -f ${D}/${libdir}/libweston-${WESTON_MAJOR_VERSION}/*.la + + # If X11, ship a desktop file to launch it + if [ "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}" ]; then + install -d ${D}${datadir}/applications + install ${WORKDIR}/weston.desktop ${D}${datadir}/applications + + install -d ${D}${datadir}/icons/hicolor/48x48/apps + install ${WORKDIR}/weston.png ${D}${datadir}/icons/hicolor/48x48/apps + fi + + if [ "${@bb.utils.contains('PACKAGECONFIG', 'xwayland', 'yes', 'no', d)}" = "yes" ]; then + install -Dm 644 ${WORKDIR}/xwayland.weston-start ${D}${datadir}/weston-start/xwayland + fi + + if [ "${@bb.utils.contains('PACKAGECONFIG', 'systemd', 'yes', 'no', d)}" = "yes" ]; then + install -Dm 644 ${WORKDIR}/systemd-notify.weston-start ${D}${datadir}/weston-start/systemd-notify + fi + + if [ "${@bb.utils.contains('PACKAGECONFIG', 'launch', 'yes', 'no', d)}" = "yes" ]; then + chmod u+s ${D}${bindir}/weston-launch + fi +} + +PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'xwayland', '${PN}-xwayland', '', d)} \ + libweston-${WESTON_MAJOR_VERSION} ${PN}-examples" + +FILES:${PN}-dev += "${libdir}/${BPN}/libexec_weston.so" +FILES:${PN} = "${bindir}/weston ${bindir}/weston-terminal ${bindir}/weston-info ${bindir}/weston-launch ${bindir}/wcap-decode ${libexecdir} ${libdir}/${BPN}/*.so* ${datadir}" + +FILES:libweston-${WESTON_MAJOR_VERSION} = "${libdir}/lib*${SOLIBS} ${libdir}/libweston-${WESTON_MAJOR_VERSION}/*.so" +SUMMARY:libweston-${WESTON_MAJOR_VERSION} = "Helper library for implementing 'wayland window managers'." + +FILES:${PN}-examples = "${bindir}/*" + +FILES:${PN}-xwayland = "${libdir}/libweston-${WESTON_MAJOR_VERSION}/xwayland.so" +RDEPENDS:${PN}-xwayland += "xwayland" + +RDEPENDS:${PN} += "xkeyboard-config" +RRECOMMENDS:${PN} = "weston-init liberation-fonts" +RRECOMMENDS:${PN}-dev += "wayland-protocols" + +USERADD_PACKAGES = "${PN}" +GROUPADD_PARAM:${PN} = "--system weston-launch" + +########### End of OE-core copy ########### + +########### i.MX overrides ################ + +SUMMARY = "Weston, a Wayland compositor, i.MX fork" +LIC_FILES_CHKSUM:remove = "file://COPYING;md5=d79ee9e66bb0f95d3386a7acae780b70" +LIC_FILES_CHKSUM += "file://LICENSE;md5=d79ee9e66bb0f95d3386a7acae780b70" + +DEFAULT_PREFERENCE = "-1" + +SRC_URI:remove = "https://gitlab.freedesktop.org/wayland/weston/uploads/f5648c818fba5432edc3ea63c4db4813/${BPN}-${PV}.tar.xz" +SRC_URI:prepend = "${WESTON_SRC};branch=${SRCBRANCH} " +WESTON_SRC ?= "git://github.com/nxp-imx/weston-imx.git;protocol=https" +SRC_URI += "file://0001-Revert-protocol-no-found-wayland-scanner-with-Yocto-.patch" +SRCBRANCH = "weston-imx-11.0.3" +SRCREV = "a509c319b7bfc72638c9b9d8f5e4b6259aba0ab7" +S = "${WORKDIR}/git" + +PACKAGECONFIG_IMX_REMOVALS ?= "wayland x11" +PACKAGECONFIG:remove = "${PACKAGECONFIG_IMX_REMOVALS}" + +PACKAGECONFIG:append:imxgpu2d = " imxg2d" +PACKAGECONFIG:append:mx93-nxp-bsp = " imxg2d" + +# Override +PACKAGECONFIG[xwayland] = "-Dxwayland=true,-Dxwayland=false,libxcursor xwayland" + +# Weston with i.MX G2D renderer +PACKAGECONFIG[imxg2d] = "-Drenderer-g2d=true,-Drenderer-g2d=false,virtual/libg2d" + +# links with imx-gpu libs which are pre-built for glibc +# gcompat will address it during runtime +LDFLAGS:append:imxgpu:libc-musl = " -Wl,--allow-shlib-undefined" + +PACKAGE_ARCH = "${MACHINE_SOCARCH}" +COMPATIBLE_MACHINE = "(ccimx93)" + +########### End of i.MX overrides ######### diff --git a/meta-digi-dey/dynamic-layers/freescale-layer/recipes-multimedia/alsa/imx-alsa-plugins_git.bbappend b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-multimedia/alsa/imx-alsa-plugins_git.bbappend new file mode 100644 index 000000000..d1623a172 --- /dev/null +++ b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-multimedia/alsa/imx-alsa-plugins_git.bbappend @@ -0,0 +1,4 @@ +# Copyright 2023,2024 Digi International Inc. + +SRCBRANCH:ccimx93 = "MM_04.08.02_2310_L6.1.y" +SRCREV:ccimx93 = "b2ba082e70333f187972ee4e85f63f9d2f608331" diff --git a/meta-digi-dey/dynamic-layers/freescale-layer/recipes-multimedia/gstreamer/gstreamer1.0-meta-base.bbappend b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-multimedia/gstreamer/gstreamer1.0-meta-base.bbappend new file mode 100644 index 000000000..fbc297880 --- /dev/null +++ b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-multimedia/gstreamer/gstreamer1.0-meta-base.bbappend @@ -0,0 +1,9 @@ +# Copyright 2023 Digi International Inc. + +RDEPENDS:gstreamer1.0-meta-base:remove:ccimx93 = " \ + gstreamer1.0-plugins-base-videoscale \ + gstreamer1.0-plugins-base-videoconvert \ +" +RDEPENDS:gstreamer1.0-meta-base:append:ccimx93 = " \ + gstreamer1.0-plugins-base-videoconvertscale \ +" diff --git a/meta-digi-dey/dynamic-layers/freescale-layer/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0004-opencv-resolve-missing-opencv-data-dir-in-yocto-buil.patch b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0004-opencv-resolve-missing-opencv-data-dir-in-yocto-buil.patch new file mode 100644 index 000000000..029b80e17 --- /dev/null +++ b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0004-opencv-resolve-missing-opencv-data-dir-in-yocto-buil.patch @@ -0,0 +1,33 @@ +From 3bc5d48257032b6bbee532aad15062fbbcc43bfe Mon Sep 17 00:00:00 2001 +From: Andrey Zhizhikin +Date: Mon, 27 Jan 2020 10:22:35 +0000 +Subject: [PATCH] opencv: resolve missing opencv data dir in yocto build + +When Yocto build is performed, opencv searches for data dir using simple +'test' command, this fails because pkg-config provides an absolute +path on the target which needs to be prepended by PKG_CONFIG_SYSROOT_DIR +in order for the 'test' utility to pick up the absolute path. + +Upstream-Status: Inappropriate [OE-specific] + +Signed-off-by: Andrey Zhizhikin +Signed-off-by: Jose Quaresma + +--- + ext/opencv/meson.build | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/ext/opencv/meson.build b/ext/opencv/meson.build +index 1d86b90..b5c8b95 100644 +--- a/ext/opencv/meson.build ++++ b/ext/opencv/meson.build +@@ -87,6 +87,9 @@ if opencv_found + opencv_prefix = opencv_dep.get_variable('prefix') + gstopencv_cargs += ['-DOPENCV_PREFIX="' + opencv_prefix + '"'] + ++ pkgconf_sysroot = run_command(python3, '-c', 'import os; print(os.environ.get("PKG_CONFIG_SYSROOT_DIR"))').stdout().strip() ++ opencv_prefix = pkgconf_sysroot + opencv_prefix ++ + # Check the data dir used by opencv for its xml data files + # Use prefix from pkg-config to be compatible with cross-compilation + r = run_command('test', '-d', opencv_prefix + '/share/opencv', check: false) diff --git a/meta-digi-dey/dynamic-layers/freescale-layer/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.22.5.imx.bb b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.22.5.imx.bb new file mode 100644 index 000000000..d770502ad --- /dev/null +++ b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.22.5.imx.bb @@ -0,0 +1,216 @@ +# This recipe is for the i.MX fork of gstreamer1.0-plugins-bad. For ease of +# maintenance, the top section is a verbatim copy of an OE-core +# recipe. The second section customizes the recipe for i.MX. + +########### OE-core copy ################## +# Upstream hash: 937817e5164f8af8452aec03ae3c45cb23d63df9 + +require recipes-multimedia/gstreamer/gstreamer1.0-plugins-common.inc +require recipes-multimedia/gstreamer/gstreamer1.0-plugins-license.inc + +SUMMARY = "'Bad' GStreamer plugins and helper libraries " +HOMEPAGE = "https://gstreamer.freedesktop.org/" +BUGTRACKER = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues" + +SRC_URI = "https://gstreamer.freedesktop.org/src/gst-plugins-bad/gst-plugins-bad-${PV}.tar.xz \ + file://0001-fix-maybe-uninitialized-warnings-when-compiling-with.patch \ + file://0002-avoid-including-sys-poll.h-directly.patch \ + file://0004-opencv-resolve-missing-opencv-data-dir-in-yocto-buil.patch \ + " +SRC_URI[sha256sum] = "e64e75cdafd7ff2fc7fc34e855b06b1e3ed227cc06fa378d17bbcd76780c338c" + +S = "${WORKDIR}/gst-plugins-bad-${PV}" + +LICENSE = "LGPL-2.1-or-later & GPL-2.0-or-later" +LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c" + +DEPENDS += "gstreamer1.0-plugins-base" + +inherit gobject-introspection + +PACKAGECONFIG ??= " \ + ${GSTREAMER_ORC} \ + ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} \ + ${@bb.utils.filter('DISTRO_FEATURES', 'directfb vulkan x11', d)} \ + ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland', '', d)} \ + ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'gl', '', d)} \ + bz2 closedcaption curl dash dtls hls openssl sbc smoothstreaming \ + sndfile ttml uvch264 webp \ + ${@bb.utils.contains('TUNE_FEATURES', 'mx32', '', 'rsvg', d)} \ +" + +PACKAGECONFIG[aom] = "-Daom=enabled,-Daom=disabled,aom" +PACKAGECONFIG[assrender] = "-Dassrender=enabled,-Dassrender=disabled,libass" +PACKAGECONFIG[avtp] = "-Davtp=enabled,-Davtp=disabled,libavtp" +PACKAGECONFIG[bluez] = "-Dbluez=enabled,-Dbluez=disabled,bluez5" +PACKAGECONFIG[bz2] = "-Dbz2=enabled,-Dbz2=disabled,bzip2" +PACKAGECONFIG[closedcaption] = "-Dclosedcaption=enabled,-Dclosedcaption=disabled,pango cairo" +PACKAGECONFIG[curl] = "-Dcurl=enabled,-Dcurl=disabled,curl" +PACKAGECONFIG[dash] = "-Ddash=enabled,-Ddash=disabled,libxml2" +PACKAGECONFIG[dc1394] = "-Ddc1394=enabled,-Ddc1394=disabled,libdc1394" +PACKAGECONFIG[directfb] = "-Ddirectfb=enabled,-Ddirectfb=disabled,directfb" +PACKAGECONFIG[dtls] = "-Ddtls=enabled,-Ddtls=disabled,openssl" +PACKAGECONFIG[faac] = "-Dfaac=enabled,-Dfaac=disabled,faac" +PACKAGECONFIG[faad] = "-Dfaad=enabled,-Dfaad=disabled,faad2" +PACKAGECONFIG[fluidsynth] = "-Dfluidsynth=enabled,-Dfluidsynth=disabled,fluidsynth" +PACKAGECONFIG[hls] = "-Dhls=enabled,-Dhls=disabled," +# Pick atleast one crypto backend below when enabling hls +PACKAGECONFIG[nettle] = "-Dhls-crypto=nettle,,nettle" +PACKAGECONFIG[openssl] = "-Dhls-crypto=openssl,,openssl" +PACKAGECONFIG[gcrypt] = "-Dhls-crypto=libgcrypt,,libgcrypt" +# the gl packageconfig enables OpenGL elements that haven't been ported +# to -base yet. They depend on the gstgl library in -base, so we do +# not add GL dependencies here, since these are taken care of in -base. +PACKAGECONFIG[gl] = "-Dgl=enabled,-Dgl=disabled," +PACKAGECONFIG[kms] = "-Dkms=enabled,-Dkms=disabled,libdrm" +PACKAGECONFIG[libde265] = "-Dlibde265=enabled,-Dlibde265=disabled,libde265" +PACKAGECONFIG[libssh2] = "-Dcurl-ssh2=enabled,-Dcurl-ssh2=disabled,libssh2" +PACKAGECONFIG[lcms2] = "-Dcolormanagement=enabled,-Dcolormanagement=disabled,lcms" +PACKAGECONFIG[modplug] = "-Dmodplug=enabled,-Dmodplug=disabled,libmodplug" +PACKAGECONFIG[msdk] = "-Dmsdk=enabled -Dmfx_api=oneVPL,-Dmsdk=disabled,onevpl-intel-gpu" +PACKAGECONFIG[neon] = "-Dneon=enabled,-Dneon=disabled,neon" +PACKAGECONFIG[openal] = "-Dopenal=enabled,-Dopenal=disabled,openal-soft" +PACKAGECONFIG[opencv] = "-Dopencv=enabled,-Dopencv=disabled,opencv" +PACKAGECONFIG[openh264] = "-Dopenh264=enabled,-Dopenh264=disabled,openh264" +PACKAGECONFIG[openjpeg] = "-Dopenjpeg=enabled,-Dopenjpeg=disabled,openjpeg" +PACKAGECONFIG[openmpt] = "-Dopenmpt=enabled,-Dopenmpt=disabled,libopenmpt" +# the opus encoder/decoder elements are now in the -base package, +# but the opus parser remains in -bad +PACKAGECONFIG[opusparse] = "-Dopus=enabled,-Dopus=disabled,libopus" +PACKAGECONFIG[resindvd] = "-Dresindvd=enabled,-Dresindvd=disabled,libdvdread libdvdnav" +PACKAGECONFIG[rsvg] = "-Drsvg=enabled,-Drsvg=disabled,librsvg" +PACKAGECONFIG[rtmp] = "-Drtmp=enabled,-Drtmp=disabled,rtmpdump" +PACKAGECONFIG[sbc] = "-Dsbc=enabled,-Dsbc=disabled,sbc" +PACKAGECONFIG[sctp] = "-Dsctp=enabled,-Dsctp=disabled" +PACKAGECONFIG[smoothstreaming] = "-Dsmoothstreaming=enabled,-Dsmoothstreaming=disabled,libxml2" +PACKAGECONFIG[sndfile] = "-Dsndfile=enabled,-Dsndfile=disabled,libsndfile1" +PACKAGECONFIG[srt] = "-Dsrt=enabled,-Dsrt=disabled,srt" +PACKAGECONFIG[srtp] = "-Dsrtp=enabled,-Dsrtp=disabled,libsrtp" +PACKAGECONFIG[tinyalsa] = "-Dtinyalsa=enabled,-Dtinyalsa=disabled,tinyalsa" +PACKAGECONFIG[ttml] = "-Dttml=enabled,-Dttml=disabled,libxml2 pango cairo" +PACKAGECONFIG[uvch264] = "-Duvch264=enabled,-Duvch264=disabled,libusb1 libgudev" +# this enables support for stateless V4L2 mem2mem codecs, which is a newer form of +# V4L2 codec; the V4L2 code in -base supports the older stateful V4L2 mem2mem codecs +PACKAGECONFIG[v4l2codecs] = "-Dv4l2codecs=enabled,-Dv4l2codecs=disabled,libgudev" +PACKAGECONFIG[va] = "-Dva=enabled,-Dva=disabled,libva" +PACKAGECONFIG[voaacenc] = "-Dvoaacenc=enabled,-Dvoaacenc=disabled,vo-aacenc" +PACKAGECONFIG[voamrwbenc] = "-Dvoamrwbenc=enabled,-Dvoamrwbenc=disabled,vo-amrwbenc" +PACKAGECONFIG[vulkan] = "-Dvulkan=enabled,-Dvulkan=disabled,vulkan-loader shaderc-native" +PACKAGECONFIG[wayland] = "-Dwayland=enabled,-Dwayland=disabled,wayland-native wayland wayland-protocols libdrm" +PACKAGECONFIG[webp] = "-Dwebp=enabled,-Dwebp=disabled,libwebp" +PACKAGECONFIG[webrtc] = "-Dwebrtc=enabled,-Dwebrtc=disabled,libnice" +PACKAGECONFIG[webrtcdsp] = "-Dwebrtcdsp=enabled,-Dwebrtcdsp=disabled,webrtc-audio-processing" +PACKAGECONFIG[zbar] = "-Dzbar=enabled,-Dzbar=disabled,zbar" +PACKAGECONFIG[x11] = "-Dx11=enabled,-Dx11=disabled,libxcb libxkbcommon" +PACKAGECONFIG[x265] = "-Dx265=enabled,-Dx265=disabled,x265" + +GSTREAMER_GPL = "${@bb.utils.filter('PACKAGECONFIG', 'faad resindvd x265', d)}" + +EXTRA_OEMESON += " \ + -Ddoc=disabled \ + -Daes=enabled \ + -Dcodecalpha=enabled \ + -Ddecklink=enabled \ + -Ddvb=enabled \ + -Dfbdev=enabled \ + -Dipcpipeline=enabled \ + -Dshm=enabled \ + -Dtranscode=enabled \ + -Dandroidmedia=disabled \ + -Dapplemedia=disabled \ + -Dasio=disabled \ + -Dbs2b=disabled \ + -Dchromaprint=disabled \ + -Dd3dvideosink=disabled \ + -Dd3d11=disabled \ + -Ddirectsound=disabled \ + -Ddts=disabled \ + -Dfdkaac=disabled \ + -Dflite=disabled \ + -Dgme=disabled \ + -Dgs=disabled \ + -Dgsm=disabled \ + -Diqa=disabled \ + -Dkate=disabled \ + -Dladspa=disabled \ + -Dldac=disabled \ + -Dlv2=disabled \ + -Dmagicleap=disabled \ + -Dmediafoundation=disabled \ + -Dmicrodns=disabled \ + -Dmpeg2enc=disabled \ + -Dmplex=disabled \ + -Dmusepack=disabled \ + -Dnvcodec=disabled \ + -Dopenexr=disabled \ + -Dopenni2=disabled \ + -Dopenaptx=disabled \ + -Dopensles=disabled \ + -Donnx=disabled \ + -Dqroverlay=disabled \ + -Dsoundtouch=disabled \ + -Dspandsp=disabled \ + -Dsvthevcenc=disabled \ + -Dteletext=disabled \ + -Dwasapi=disabled \ + -Dwasapi2=disabled \ + -Dwildmidi=disabled \ + -Dwinks=disabled \ + -Dwinscreencap=disabled \ + -Dwpe=disabled \ + -Dzxing=disabled \ +" + +export OPENCV_PREFIX = "${STAGING_DIR_TARGET}${prefix}" + +ARM_INSTRUCTION_SET:armv4 = "arm" +ARM_INSTRUCTION_SET:armv5 = "arm" + +FILES:${PN}-freeverb += "${datadir}/gstreamer-1.0/presets/GstFreeverb.prs" +FILES:${PN}-opencv += "${datadir}/gst-plugins-bad/1.0/opencv*" +FILES:${PN}-transcode += "${datadir}/gstreamer-1.0/encoding-profiles" +FILES:${PN}-voamrwbenc += "${datadir}/gstreamer-1.0/presets/GstVoAmrwbEnc.prs" + + +########### End of OE-core copy ########### + +########### i.MX overrides ################ + +DEFAULT_PREFERENCE = "-1" + +LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=4fbd65380cdd255951079008b364516c" + +DEPENDS:append:imxgpu2d = " virtual/libg2d" + +SRC_URI:remove = "https://gstreamer.freedesktop.org/src/gst-plugins-bad/gst-plugins-bad-${PV}.tar.xz \ + file://0001-fix-maybe-uninitialized-warnings-when-compiling-with.patch \ + file://0002-avoid-including-sys-poll.h-directly.patch \ + " +SRC_URI:prepend = "${GST1.0-PLUGINS-BAD_SRC};branch=${SRCBRANCH} " +GST1.0-PLUGINS-BAD_SRC ?= "gitsm://github.com/nxp-imx/gst-plugins-bad.git;protocol=https" +SRCBRANCH = "MM_04.08.02_2310_L6.1.y" +SRCREV = "e4edcda6b110f42eca1f2cc20bc935edf7e66d6d" + +S = "${WORKDIR}/git" + +inherit use-imx-headers + +PACKAGE_ARCH:imxpxp = "${MACHINE_SOCARCH}" +PACKAGE_ARCH:mx8-nxp-bsp = "${MACHINE_SOCARCH}" + +PACKAGECONFIG_REMOVE ?= " \ + dtls vulkan \ + ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', '', 'gl', d)} \ +" +PACKAGECONFIG:remove = "${PACKAGECONFIG_REMOVE}" +PACKAGECONFIG:append:mx8-nxp-bsp = " kms tinycompress" + +PACKAGECONFIG[tinycompress] = "-Dtinycompress=enabled,-Dtinycompress=disabled,tinycompress" + +EXTRA_OEMESON += " \ + -Dc_args="${CFLAGS} -I${STAGING_INCDIR_IMX}" \ +" + +COMPATIBLE_MACHINE = "(ccimx93)" + +########### End of i.MX overrides ######### diff --git a/meta-digi-dey/dynamic-layers/freescale-layer/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.22.5.imx.bb b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.22.5.imx.bb new file mode 100644 index 000000000..c4391f3c8 --- /dev/null +++ b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.22.5.imx.bb @@ -0,0 +1,150 @@ +# This recipe is for the i.MX fork of gstreamer1.0-plugins-base. For ease of +# maintenance, the top section is a verbatim copy of an OE-core +# recipe. The second section customizes the recipe for i.MX. + +########### OE-core copy ################## +# Upstream hash: 937817e5164f8af8452aec03ae3c45cb23d63df9 + +require recipes-multimedia/gstreamer/gstreamer1.0-plugins-common.inc + +SUMMARY = "'Base' GStreamer plugins and helper libraries" +HOMEPAGE = "https://gstreamer.freedesktop.org/" +BUGTRACKER = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/issues" +LICENSE = "LGPL-2.1-or-later" +LIC_FILES_CHKSUM = "file://COPYING;md5=69333daa044cb77e486cc36129f7a770" + +SRC_URI = "https://gstreamer.freedesktop.org/src/gst-plugins-base/gst-plugins-base-${PV}.tar.xz \ + file://0001-ENGR00312515-get-caps-from-src-pad-when-query-caps.patch \ + file://0003-viv-fb-Make-sure-config.h-is-included.patch \ + file://0002-ssaparse-enhance-SSA-text-lines-parsing.patch \ + " +SRC_URI[sha256sum] = "edd4338b45c26a9af28c0d35aab964a024c3884ba6f520d8428df04212c8c93a" + +S = "${WORKDIR}/gst-plugins-base-${PV}" + +DEPENDS += "iso-codes util-linux zlib" + +inherit gobject-introspection + +# opengl packageconfig factored out to make it easy for distros +# and BSP layers to choose OpenGL APIs/platforms/window systems +PACKAGECONFIG_X11 = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'opengl glx', '', d)}" +PACKAGECONFIG_GL ?= "${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'gles2 egl ${PACKAGECONFIG_X11}', '', d)}" + +PACKAGECONFIG ??= " \ + ${GSTREAMER_ORC} \ + ${PACKAGECONFIG_GL} \ + ${@bb.utils.filter('DISTRO_FEATURES', 'alsa x11', d)} \ + jpeg ogg pango png theora vorbis \ + ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland egl', '', d)} \ +" + +OPENGL_APIS = 'opengl gles2' +OPENGL_PLATFORMS = 'egl glx' + +X11DEPENDS = "virtual/libx11 libsm libxrender libxv" +X11ENABLEOPTS = "-Dx11=enabled -Dxvideo=enabled -Dxshm=enabled" +X11DISABLEOPTS = "-Dx11=disabled -Dxvideo=disabled -Dxshm=disabled" + +PACKAGECONFIG[alsa] = "-Dalsa=enabled,-Dalsa=disabled,alsa-lib" +PACKAGECONFIG[cdparanoia] = "-Dcdparanoia=enabled,-Dcdparanoia=disabled,cdparanoia" +PACKAGECONFIG[graphene] = "-Dgl-graphene=enabled,-Dgl-graphene=disabled,graphene" +PACKAGECONFIG[jpeg] = "-Dgl-jpeg=enabled,-Dgl-jpeg=disabled,jpeg" +PACKAGECONFIG[ogg] = "-Dogg=enabled,-Dogg=disabled,libogg" +PACKAGECONFIG[opus] = "-Dopus=enabled,-Dopus=disabled,libopus" +PACKAGECONFIG[pango] = "-Dpango=enabled,-Dpango=disabled,pango" +PACKAGECONFIG[png] = "-Dgl-png=enabled,-Dgl-png=disabled,libpng" +# This enables Qt5 QML examples in -base. The Qt5 GStreamer +# qmlglsink and qmlglsrc plugins still exist in -good. +PACKAGECONFIG[qt5] = "-Dqt5=enabled,-Dqt5=disabled,qtbase qtdeclarative qtbase-native" +PACKAGECONFIG[theora] = "-Dtheora=enabled,-Dtheora=disabled,libtheora" +PACKAGECONFIG[tremor] = "-Dtremor=enabled,-Dtremor=disabled,tremor" +PACKAGECONFIG[visual] = "-Dlibvisual=enabled,-Dlibvisual=disabled,libvisual" +PACKAGECONFIG[vorbis] = "-Dvorbis=enabled,-Dvorbis=disabled,libvorbis" +PACKAGECONFIG[x11] = "${X11ENABLEOPTS},${X11DISABLEOPTS},${X11DEPENDS}" + +# OpenGL API packageconfigs +PACKAGECONFIG[opengl] = ",,virtual/libgl libglu" +PACKAGECONFIG[gles2] = ",,virtual/libgles2" + +# OpenGL platform packageconfigs +PACKAGECONFIG[egl] = ",,virtual/egl" +PACKAGECONFIG[glx] = ",,virtual/libgl" + +# OpenGL window systems (except for X11) +PACKAGECONFIG[gbm] = ",,virtual/libgbm libgudev libdrm" +PACKAGECONFIG[wayland] = ",,wayland-native wayland wayland-protocols libdrm" +PACKAGECONFIG[dispmanx] = ",,virtual/libomxil" +PACKAGECONFIG[viv-fb] = ",,virtual/libgles2 virtual/libg2d" + +OPENGL_WINSYS = "${@bb.utils.filter('PACKAGECONFIG', 'x11 gbm wayland dispmanx egl viv-fb', d)}" + +EXTRA_OEMESON += " \ + -Ddoc=disabled \ + ${@get_opengl_cmdline_list('gl_api', d.getVar('OPENGL_APIS'), d)} \ + ${@get_opengl_cmdline_list('gl_platform', d.getVar('OPENGL_PLATFORMS'), d)} \ + ${@get_opengl_cmdline_list('gl_winsys', d.getVar('OPENGL_WINSYS'), d)} \ +" + +FILES:${PN}-dev += "${libdir}/gstreamer-1.0/include/gst/gl/gstglconfig.h" +FILES:${MLPREFIX}libgsttag-1.0 += "${datadir}/gst-plugins-base/1.0/license-translations.dict" + +def get_opengl_cmdline_list(switch_name, options, d): + selected_options = [] + if bb.utils.contains('DISTRO_FEATURES', 'opengl', True, False, d): + for option in options.split(): + if bb.utils.contains('PACKAGECONFIG', option, True, False, d): + selected_options += [option] + if selected_options: + return '-D' + switch_name + '=' + ','.join(selected_options) + else: + return '' + +CVE_PRODUCT += "gst-plugins-base" + +########### End of OE-core copy ########### + +########### i.MX overrides ################ + +DEFAULT_PREFERENCE = "-1" + +LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=69333daa044cb77e486cc36129f7a770" + +SRC_URI:remove = " \ + https://gstreamer.freedesktop.org/src/gst-plugins-base/gst-plugins-base-${PV}.tar.xz \ + file://0001-ENGR00312515-get-caps-from-src-pad-when-query-caps.patch \ + file://0003-viv-fb-Make-sure-config.h-is-included.patch \ + file://0002-ssaparse-enhance-SSA-text-lines-parsing.patch" +SRC_URI:prepend = "${GST1.0-PLUGINS-BASE_SRC};branch=${SRCBRANCH} " + +GST1.0-PLUGINS-BASE_SRC ?= "gitsm://github.com/nxp-imx/gst-plugins-base.git;protocol=https" +SRCBRANCH = "MM_04.08.02_2310_L6.1.y" +SRCREV = "53a12f4e39773ca5b052eccbf0476d4ebd3ac08e" + +S = "${WORKDIR}/git" + +inherit use-imx-headers + +PACKAGECONFIG_GL:imxgpu2d = \ + "${@bb.utils.contains('DISTRO_FEATURES', 'opengl x11', 'opengl viv-fb', '', d)}" +PACKAGECONFIG_GL:imxgpu3d = \ + "${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'gles2 egl viv-fb', '', d)}" +PACKAGECONFIG_GL:use-mainline-bsp = \ + "${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'gles2 egl gbm', '', d)}" + +PACKAGECONFIG_REMOVE ?= "jpeg" +PACKAGECONFIG:remove = "${PACKAGECONFIG_REMOVE}" +PACKAGECONFIG:append:imxgpu2d = " g2d" + +PACKAGECONFIG[g2d] = ",,virtual/libg2d" +PACKAGECONFIG[viv-fb] = ",,virtual/libgles2" + +EXTRA_OEMESON += "-Dc_args="${CFLAGS} -I${STAGING_INCDIR_IMX}"" + +# links with imx-gpu libs which are pre-built for glibc +# gcompat will address it during runtime +LDFLAGS:append:imxgpu:libc-musl = " -Wl,--allow-shlib-undefined" + +COMPATIBLE_MACHINE = "(ccimx93)" + +########### End of i.MX overrides ######### diff --git a/meta-digi-dey/dynamic-layers/freescale-layer/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.22.5.imx.bb b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.22.5.imx.bb new file mode 100644 index 000000000..4fdf4408d --- /dev/null +++ b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.22.5.imx.bb @@ -0,0 +1,119 @@ +# This recipe is for the i.MX fork of gstreamer1.0-plugins-good. For ease of +# maintenance, the top section is a verbatim copy of an OE-core +# recipe. The second section customizes the recipe for i.MX. + +########### OE-core copy ################## +# Upstream hash: 937817e5164f8af8452aec03ae3c45cb23d63df9 + +require recipes-multimedia/gstreamer/gstreamer1.0-plugins-common.inc + +SUMMARY = "'Good' GStreamer plugins" +HOMEPAGE = "https://gstreamer.freedesktop.org/" +BUGTRACKER = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/issues" + +SRC_URI = "https://gstreamer.freedesktop.org/src/gst-plugins-good/gst-plugins-good-${PV}.tar.xz \ + file://0001-qt-include-ext-qt-gstqtgl.h-instead-of-gst-gl-gstglf.patch \ + file://0001-v4l2-Define-ioctl_req_t-for-posix-linux-case.patch" + +SRC_URI[sha256sum] = "b67b31313a54c6929b82969d41d3cfdf2f58db573fb5f491e6bba5d84aea0778" + +S = "${WORKDIR}/gst-plugins-good-${PV}" + +LICENSE = "LGPL-2.1-or-later" +LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \ + file://gst/replaygain/rganalysis.c;beginline=1;endline=23;md5=b60ebefd5b2f5a8e0cab6bfee391a5fe" + +DEPENDS += "gstreamer1.0-plugins-base libcap zlib" +RPROVIDES:${PN}-pulseaudio += "${PN}-pulse" +RPROVIDES:${PN}-soup += "${PN}-souphttpsrc" +RDEPENDS:${PN}-soup += "${MLPREFIX}${@bb.utils.contains('PACKAGECONFIG', 'soup2', 'libsoup-2.4', 'libsoup', d)}" + +PACKAGECONFIG_SOUP ?= "soup3" + +PACKAGECONFIG ??= " \ + ${GSTREAMER_ORC} \ + ${PACKAGECONFIG_SOUP} \ + ${@bb.utils.filter('DISTRO_FEATURES', 'pulseaudio x11', d)} \ + ${@bb.utils.contains('TUNE_FEATURES', 'm64', 'asm', '', d)} \ + bz2 cairo flac gdk-pixbuf gudev jpeg lame libpng mpg123 speex taglib v4l2 \ +" + +X11DEPENDS = "virtual/libx11 libsm libxrender libxfixes libxdamage" +X11ENABLEOPTS = "-Dximagesrc=enabled -Dximagesrc-xshm=enabled -Dximagesrc-xfixes=enabled -Dximagesrc-xdamage=enabled" +X11DISABLEOPTS = "-Dximagesrc=disabled -Dximagesrc-xshm=disabled -Dximagesrc-xfixes=disabled -Dximagesrc-xdamage=disabled" + +QT5WAYLANDDEPENDS = "${@bb.utils.contains("DISTRO_FEATURES", "wayland", "qtwayland", "", d)}" + +PACKAGECONFIG[asm] = "-Dasm=enabled,-Dasm=disabled,nasm-native" +PACKAGECONFIG[bz2] = "-Dbz2=enabled,-Dbz2=disabled,bzip2" +PACKAGECONFIG[cairo] = "-Dcairo=enabled,-Dcairo=disabled,cairo" +PACKAGECONFIG[dv1394] = "-Ddv1394=enabled,-Ddv1394=disabled,libiec61883 libavc1394 libraw1394" +PACKAGECONFIG[flac] = "-Dflac=enabled,-Dflac=disabled,flac" +PACKAGECONFIG[gdk-pixbuf] = "-Dgdk-pixbuf=enabled,-Dgdk-pixbuf=disabled,gdk-pixbuf" +PACKAGECONFIG[gtk] = "-Dgtk3=enabled,-Dgtk3=disabled,gtk+3" +PACKAGECONFIG[gudev] = "-Dv4l2-gudev=enabled,-Dv4l2-gudev=disabled,libgudev" +PACKAGECONFIG[jack] = "-Djack=enabled,-Djack=disabled,jack" +PACKAGECONFIG[jpeg] = "-Djpeg=enabled,-Djpeg=disabled,jpeg" +PACKAGECONFIG[lame] = "-Dlame=enabled,-Dlame=disabled,lame" +PACKAGECONFIG[libpng] = "-Dpng=enabled,-Dpng=disabled,libpng" +PACKAGECONFIG[libv4l2] = "-Dv4l2-libv4l2=enabled,-Dv4l2-libv4l2=disabled,v4l-utils" +PACKAGECONFIG[mpg123] = "-Dmpg123=enabled,-Dmpg123=disabled,mpg123" +PACKAGECONFIG[pulseaudio] = "-Dpulse=enabled,-Dpulse=disabled,pulseaudio" +PACKAGECONFIG[qt5] = "-Dqt5=enabled,-Dqt5=disabled,qtbase qtdeclarative qtbase-native ${QT5WAYLANDDEPENDS}" +PACKAGECONFIG[soup2] = "-Dsoup=enabled,,libsoup-2.4,,,soup3" +PACKAGECONFIG[soup3] = "-Dsoup=enabled,,libsoup,,,soup2" +PACKAGECONFIG[speex] = "-Dspeex=enabled,-Dspeex=disabled,speex" +PACKAGECONFIG[rpi] = "-Drpicamsrc=enabled,-Drpicamsrc=disabled,userland" +PACKAGECONFIG[taglib] = "-Dtaglib=enabled,-Dtaglib=disabled,taglib" +PACKAGECONFIG[v4l2] = "-Dv4l2=enabled -Dv4l2-probe=true,-Dv4l2=disabled -Dv4l2-probe=false" +PACKAGECONFIG[vpx] = "-Dvpx=enabled,-Dvpx=disabled,libvpx" +PACKAGECONFIG[wavpack] = "-Dwavpack=enabled,-Dwavpack=disabled,wavpack" +PACKAGECONFIG[x11] = "${X11ENABLEOPTS},${X11DISABLEOPTS},${X11DEPENDS}" + +EXTRA_OEMESON += " \ + -Ddoc=disabled \ + -Daalib=disabled \ + -Ddirectsound=disabled \ + -Ddv=disabled \ + -Dlibcaca=disabled \ + -Doss=enabled \ + -Doss4=disabled \ + -Dosxaudio=disabled \ + -Dosxvideo=disabled \ + -Dshout2=disabled \ + -Dtwolame=disabled \ + -Dwaveform=disabled \ +" + +FILES:${PN}-equalizer += "${datadir}/gstreamer-1.0/presets/*.prs" + +########### End of OE-core copy ########### + +########### i.MX overrides ################ + +DEFAULT_PREFERENCE = "-1" + +LIC_FILES_CHKSUM = " \ + file://LICENSE.txt;md5=a6f89e2100d9b6cdffcea4f398e37343 \ + file://gst/replaygain/rganalysis.c;beginline=1;endline=23;md5=b60ebefd5b2f5a8e0cab6bfee391a5fe \ +" + +# fb implementation of v4l2 uses libdrm +DEPENDS += "${@bb.utils.contains('PACKAGECONFIG', 'v4l2', '${DEPENDS_V4L2}', '', d)}" +DEPENDS_V4L2 = "${@bb.utils.contains_any('DISTRO_FEATURES', 'wayland x11', '', 'libdrm', d)}" + +SRC_URI:remove = "https://gstreamer.freedesktop.org/src/gst-plugins-good/gst-plugins-good-${PV}.tar.xz \ + file://0001-qt-include-ext-qt-gstqtgl.h-instead-of-gst-gl-gstglf.patch \ + file://0001-v4l2-Define-ioctl_req_t-for-posix-linux-case.patch \ +" + +SRC_URI:prepend = "${GST1.0-PLUGINS-GOOD_SRC};branch=${SRCBRANCH} " +GST1.0-PLUGINS-GOOD_SRC ?= "gitsm://github.com/nxp-imx/gst-plugins-good.git;protocol=https" +SRCBRANCH = "MM_04.08.02_2310_L6.1.y" +SRCREV = "a4631334ad32abc513bde8f73491ef345f865a48" + +S = "${WORKDIR}/git" + +COMPATIBLE_MACHINE = "(ccimx93)" + +########### End of i.MX overrides ######### diff --git a/meta-digi-dey/dynamic-layers/freescale-layer/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly_1.22.6.bb b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly_1.22.6.bb new file mode 100644 index 000000000..b457a05f7 --- /dev/null +++ b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly_1.22.6.bb @@ -0,0 +1,12 @@ +# Copyright 2024 Digi International Inc. + +# +# Reuse poky's gstreamer1.0-plugins-ugly_1.20.7.bb +# +require recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly_1.20.7.bb + +LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343" + +SRC_URI[sha256sum] = "3e31454c98cb2f7f6d2d355eceb933a892fa0f1dc09bc36c9abc930d8e29ca48" + +COMPATIBLE_MACHINE = "(ccimx93)" diff --git a/meta-digi-dey/dynamic-layers/freescale-layer/recipes-multimedia/gstreamer/gstreamer1.0/run-ptest b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-multimedia/gstreamer/gstreamer1.0/run-ptest new file mode 100755 index 000000000..0cfa955f0 --- /dev/null +++ b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-multimedia/gstreamer/gstreamer1.0/run-ptest @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +gnome-desktop-testing-runner gstreamer diff --git a/meta-digi-dey/dynamic-layers/freescale-layer/recipes-multimedia/gstreamer/gstreamer1.0_1.22.5.imx.bb b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-multimedia/gstreamer/gstreamer1.0_1.22.5.imx.bb new file mode 100644 index 000000000..a4a0213e6 --- /dev/null +++ b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-multimedia/gstreamer/gstreamer1.0_1.22.5.imx.bb @@ -0,0 +1,112 @@ +# This recipe is for the i.MX fork of gstreamer1.0. For ease of +# maintenance, the top section is a verbatim copy of an OE-core +# recipe. The second section customizes the recipe for i.MX. + +########### OE-core copy ################## +# Upstream hash: 937817e5164f8af8452aec03ae3c45cb23d63df9 + +SUMMARY = "GStreamer 1.0 multimedia framework" +DESCRIPTION = "GStreamer is a multimedia framework for encoding and decoding video and sound. \ +It supports a wide range of formats including mp3, ogg, avi, mpeg and quicktime." +HOMEPAGE = "http://gstreamer.freedesktop.org/" +BUGTRACKER = "https://bugzilla.gnome.org/enter_bug.cgi?product=Gstreamer" +SECTION = "multimedia" +LICENSE = "LGPL-2.1-or-later" + +DEPENDS = "glib-2.0 glib-2.0-native libxml2 bison-native flex-native" + +inherit meson pkgconfig gettext upstream-version-is-even gobject-introspection ptest-gnome + +LIC_FILES_CHKSUM = "file://COPYING;md5=69333daa044cb77e486cc36129f7a770 \ + file://gst/gst.h;beginline=1;endline=21;md5=e059138481205ee2c6fc1c079c016d0d" + +S = "${WORKDIR}/gstreamer-${PV}" + +SRC_URI = "https://gstreamer.freedesktop.org/src/gstreamer/gstreamer-${PV}.tar.xz \ + file://run-ptest \ + file://0001-tests-respect-the-idententaion-used-in-meson.patch \ + file://0002-tests-add-support-for-install-the-tests.patch \ + file://0003-tests-use-a-dictionaries-for-environment.patch;striplevel=3 \ + file://0004-tests-add-helper-script-to-run-the-installed_tests.patch;striplevel=3 \ + " +SRC_URI[sha256sum] = "4408d7930f381809e85917acc19712f173261ba85bdf20c5567b2a21b1193b61" + +PACKAGECONFIG ??= "${@bb.utils.contains('PTEST_ENABLED', '1', 'tests', '', d)} \ + check \ + debug \ + tools" + +PACKAGECONFIG[debug] = "-Dgst_debug=true,-Dgst_debug=false" +PACKAGECONFIG[tracer-hooks] = "-Dtracer_hooks=true,-Dtracer_hooks=false" +PACKAGECONFIG[coretracers] = "-Dcoretracers=enabled,-Dcoretracers=disabled" +PACKAGECONFIG[check] = "-Dcheck=enabled,-Dcheck=disabled" +PACKAGECONFIG[tests] = "-Dtests=enabled -Dinstalled_tests=true,-Dtests=disabled -Dinstalled_tests=false" +PACKAGECONFIG[unwind] = "-Dlibunwind=enabled,-Dlibunwind=disabled,libunwind" +PACKAGECONFIG[dw] = "-Dlibdw=enabled,-Dlibdw=disabled,elfutils" +PACKAGECONFIG[bash-completion] = "-Dbash-completion=enabled,-Dbash-completion=disabled,bash-completion" +PACKAGECONFIG[tools] = "-Dtools=enabled,-Dtools=disabled" +PACKAGECONFIG[setcap] = "-Dptp-helper-permissions=capabilities,,libcap libcap-native" + +# TODO: put this in a gettext.bbclass patch +def gettext_oemeson(d): + if d.getVar('USE_NLS') == 'no': + return '-Dnls=disabled' + # Remove the NLS bits if USE_NLS is no or INHIBIT_DEFAULT_DEPS is set + if d.getVar('INHIBIT_DEFAULT_DEPS') and not oe.utils.inherits(d, 'cross-canadian'): + return '-Dnls=disabled' + return '-Dnls=enabled' + +EXTRA_OEMESON += " \ + -Ddoc=disabled \ + -Dexamples=disabled \ + -Ddbghelp=disabled \ + ${@gettext_oemeson(d)} \ +" + +GIR_MESON_ENABLE_FLAG = "enabled" +GIR_MESON_DISABLE_FLAG = "disabled" + +PACKAGES += "${PN}-bash-completion" + +# Add the core element plugins to the main package +FILES:${PN} += "${libdir}/gstreamer-1.0/*.so" +FILES:${PN}-dev += "${libdir}/gstreamer-1.0/*.a ${libdir}/gstreamer-1.0/include" +FILES:${PN}-bash-completion += "${datadir}/bash-completion/completions/ ${datadir}/bash-completion/helpers/gst*" +FILES:${PN}-dbg += "${datadir}/gdb ${datadir}/gstreamer-1.0/gdb" + +RDEPENDS:${PN}-ptest:append:libc-glibc = " glibc-gconv-iso8859-5" + +CVE_PRODUCT = "gstreamer" + +PTEST_BUILD_HOST_FILES = "" + +########### End of OE-core copy ########### + +########### i.MX overrides ################ + +DEFAULT_PREFERENCE = "-1" + +LIC_FILES_CHKSUM = " \ + file://LICENSE.txt;md5=69333daa044cb77e486cc36129f7a770 \ + file://gst/gst.h;beginline=1;endline=21;md5=e059138481205ee2c6fc1c079c016d0d \ +" + +# Use i.MX fork of GST for customizations +SRC_URI:remove = "https://gstreamer.freedesktop.org/src/gstreamer/gstreamer-${PV}.tar.xz \ + file://0001-tests-respect-the-idententaion-used-in-meson.patch \ + file://0002-tests-add-support-for-install-the-tests.patch \ + file://0003-tests-use-a-dictionaries-for-environment.patch;striplevel=3 \ + file://0004-tests-add-helper-script-to-run-the-installed_tests.patch;striplevel=3 \ +" +SRC_URI:prepend = "${GST1.0_SRC};branch=${SRCBRANCH} " +GST1.0_SRC ?= "gitsm://github.com/nxp-imx/gstreamer.git;protocol=https" +SRCBRANCH = "MM_04.08.02_2310_L6.1.y" +SRCREV = "e51e577a730191911b7050216814bede1b9545ae" + +S = "${WORKDIR}/git" + +PACKAGECONFIG[tests] = "-Dtests=enabled,-Dtests=disabled" + +COMPATIBLE_MACHINE = "(ccimx93)" + +########### End of i.MX overrides ######### diff --git a/meta-digi-dey/dynamic-layers/freescale-layer/recipes-multimedia/gstreamer/imx-gst1.0-plugin_%.bbappend b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-multimedia/gstreamer/imx-gst1.0-plugin_%.bbappend index 26165cb13..00076e274 100644 --- a/meta-digi-dey/dynamic-layers/freescale-layer/recipes-multimedia/gstreamer/imx-gst1.0-plugin_%.bbappend +++ b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-multimedia/gstreamer/imx-gst1.0-plugin_%.bbappend @@ -1,8 +1,13 @@ -# Copyright (C) 2016-2022 Digi International Inc. +# Copyright (C) 2016-2024 Digi International Inc. FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}:" -SRC_URI += " \ +SRC_URI:append:ccimx6ul = " \ file://0001-gstimxv4l2-map-dev-video1-to-dev-fb0.patch \ file://0002-imx-gst1.0-plugin-fix-build-using-MUSL-C-library.patch \ " + +LIC_FILES_CHKSUM:ccimx93 = "file://LICENSE.txt;md5=fbc093901857fcd118f065f900982c24" +PV:ccimx93 = "4.8.2+git${SRCPV}" +SRCBRANCH:ccimx93 = "MM_04.08.02_2310_L6.1.y" +SRCREV:ccimx93 = "a72df52acfec5f849ec93906e33cb50da01b0b2e" diff --git a/meta-digi-dey/dynamic-layers/freescale-layer/recipes-multimedia/imx-codec/imx-codec_4.8.2.bb b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-multimedia/imx-codec/imx-codec_4.8.2.bb new file mode 100644 index 000000000..5f821d078 --- /dev/null +++ b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-multimedia/imx-codec/imx-codec_4.8.2.bb @@ -0,0 +1,13 @@ +# Copyright 2024 Digi International Inc. + +# +# Reuse meta-freescale's imx-codec_4.7.2.bb +# +require recipes-multimedia/imx-codec/imx-codec_4.7.2.bb + +LIC_FILES_CHKSUM = "file://COPYING;md5=2827219e81f28aba7c6a569f7c437fa7" + +SRC_URI[md5sum] = "1977bab8d89972f08d9eee0122a64603" +SRC_URI[sha256sum] = "b0744a91c265202a79a019c72f17cae01fd5b63a3ba451592b6c8349d95719e0" + +COMPATIBLE_MACHINE = "(ccimx93)" diff --git a/meta-digi-dey/dynamic-layers/freescale-layer/recipes-multimedia/imx-parser/imx-parser_4.8.2.bb b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-multimedia/imx-parser/imx-parser_4.8.2.bb new file mode 100644 index 000000000..ae755bcb1 --- /dev/null +++ b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-multimedia/imx-parser/imx-parser_4.8.2.bb @@ -0,0 +1,13 @@ +# Copyright 2024 Digi International Inc. + +# +# Reuse meta-freescale's imx-parser_4.7.2.bb +# +require recipes-multimedia/imx-parser/imx-parser_4.7.2.bb + +LIC_FILES_CHKSUM = "file://COPYING;md5=2827219e81f28aba7c6a569f7c437fa7" + +SRC_URI[md5sum] = "2e862fce70bc82649057ed552473d982" +SRC_URI[sha256sum] = "20f326821ced5d6855f81794b66ec1f0c334e9ec7a9be1368a9b4dc501b666c6" + +COMPATIBLE_MACHINE = "(ccimx93)" diff --git a/meta-digi-dey/dynamic-layers/freescale-layer/recipes-multimedia/nxp-afe/nxp-afe-voiceseeker_git.bb b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-multimedia/nxp-afe/nxp-afe-voiceseeker_git.bb new file mode 100644 index 000000000..54fd3f29a --- /dev/null +++ b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-multimedia/nxp-afe/nxp-afe-voiceseeker_git.bb @@ -0,0 +1,50 @@ +# Copyright 2021-2023 NXP + +DESCRIPTION = "NXP RetuneDSP Voice Seeker Libraries" +SECTION = "multimedia" +LICENSE = "Proprietary" +LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=db4762b09b6bda63da103963e6e081de" + +inherit autotools pkgconfig + +DEPENDS += "alsa-lib nxp-afe" + +SRCBRANCH = "MM_04.08.02_2310_L6.1.y" +PV = "2.0+${SRCPV}" + +NXPAFE_VOICESEEKER_SRC ?= "git://github.com/nxp-imx/imx-voiceui.git;protocol=https" +SRC_URI = "${NXPAFE_VOICESEEKER_SRC};branch=${SRCBRANCH}" + +SRCREV = "5eac64dc0f93c755941770c46d5e315aec523b3d" +S = "${WORKDIR}/git" + +EXTRA_CONF = "--enable-armv8 --bindir=/unit_tests/ --libdir=${libdir}" + +EXTRA_OEMAKE:mx8-nxp-bsp = "BUILD_ARCH=CortexA53" +EXTRA_OEMAKE:mx93-nxp-bsp = "BUILD_ARCH=CortexA55" + +do_compile () { + echo "====Enter into ${WORKDIR}/git====" + cd ${WORKDIR}/git + echo "====make all===" + oe_runmake all +} + +do_install() { + install -d ${D}${libdir}/nxp-afe + install -d ${D}/unit_tests/nxp-afe + install -m 0644 ${WORKDIR}/git/release/*.so.2.0 ${D}${libdir}/nxp-afe/ + ln -sf -r ${D}${libdir}/nxp-afe/libvoiceseekerlight.so.2.0 ${D}${libdir}/nxp-afe/libvoiceseekerlight.so + install -m 0755 ${WORKDIR}/git/release/voice_ui_app ${D}/unit_tests/nxp-afe + install -m 0644 ${WORKDIR}/git/release/*.bin ${D}/unit_tests/nxp-afe + install -m 0644 ${WORKDIR}/git/release/Config.ini ${D}/unit_tests/nxp-afe +} + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +FILES:${PN} += "${libdir}/nxp-afe/* \ + /unit_tests/* \ +" +INSANE_SKIP:${PN} += "dev-so" + +COMPATIBLE_MACHINE = "(mx8-nxp-bsp|mx9-nxp-bsp)" 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 5125f8465..d8dc25472 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 @@ -6,13 +6,13 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=7bdef19938f3503cfc4c586461f99012" PV = "1.0+git${SRCPV}" -SRCBRANCH = "MM_04.06.03_2110_L5.10.y" +SRCBRANCH = "MM_04.08.02_2310_L6.1.y" NXPAFE_SRC ?= "git://github.com/nxp-imx/nxp-afe.git;protocol=https" SRC_URI = " \ ${NXPAFE_SRC};branch=${SRCBRANCH} \ " -SRCREV = "7d3295d250fe34325123cc9df94902a083308a46" +SRCREV = "77343e302fb079e3d50f6c6d0eef565c09256e56" S = "${WORKDIR}/git" @@ -33,6 +33,7 @@ do_install() { install -m 0755 ${WORKDIR}/deploy_afe/afe ${D}/unit_tests/nxp-afe install -m 0644 ${WORKDIR}/deploy_afe/asound.conf* ${D}/unit_tests/nxp-afe install -m 0644 ${WORKDIR}/deploy_afe/TODO.md ${D}/unit_tests/nxp-afe + install -m 0755 ${WORKDIR}/deploy_afe/UAC_VCOM_composite.sh ${D}/unit_tests/nxp-afe } FILES:${PN} += "/unit_tests" diff --git a/meta-digi-dey/dynamic-layers/meta-ml/recipes-devtools/cmake/cmake-native_3.25.2.bb b/meta-digi-dey/dynamic-layers/meta-ml/recipes-devtools/cmake/cmake-native_3.25.2.bb new file mode 100644 index 000000000..c150aef5e --- /dev/null +++ b/meta-digi-dey/dynamic-layers/meta-ml/recipes-devtools/cmake/cmake-native_3.25.2.bb @@ -0,0 +1,67 @@ +require cmake.inc +inherit native + +DEPENDS += "bzip2-replacement-native xz-native zlib-native ncurses-native zstd-native openssl-native" + +SRC_URI += "file://OEToolchainConfig.cmake \ + file://environment.d-cmake.sh \ + file://0001-CMakeDetermineSystem-use-oe-environment-vars-to-load.patch \ + file://0005-Disable-use-of-ext2fs-ext2_fs.h-by-cmake-s-internal-.patch \ + file://0001-CMakeLists.txt-disable-USE_NGHTTP2.patch \ + " + +LICENSE:append = " & BSD-1-Clause & MIT & BSD-2-Clause & curl" +LIC_FILES_CHKSUM:append = " \ + file://Utilities/cmjsoncpp/LICENSE;md5=5d73c165a0f9e86a1342f32d19ec5926 \ + file://Utilities/cmlibarchive/COPYING;md5=d499814247adaee08d88080841cb5665 \ + file://Utilities/cmexpat/COPYING;md5=9e2ce3b3c4c0f2670883a23bbd7c37a9 \ + file://Utilities/cmlibrhash/COPYING;md5=a8c2a557a5c53b1c12cddbee98c099af \ + file://Utilities/cmlibuv/LICENSE;md5=ad93ca1fffe931537fcf64f6fcce084d \ + file://Utilities/cmcurl/COPYING;md5=190c514872597083303371684954f238 \ +" + +B = "${WORKDIR}/build" +do_configure[cleandirs] = "${B}" + +CMAKE_EXTRACONF = "\ + -DCMAKE_LIBRARY_PATH=${STAGING_LIBDIR_NATIVE} \ + -DBUILD_CursesDialog=1 \ + -DCMAKE_USE_SYSTEM_LIBRARIES=1 \ + -DCMAKE_USE_SYSTEM_LIBRARY_JSONCPP=0 \ + -DCMAKE_USE_SYSTEM_LIBRARY_LIBARCHIVE=0 \ + -DCMAKE_USE_SYSTEM_LIBRARY_LIBUV=0 \ + -DCMAKE_USE_SYSTEM_LIBRARY_LIBRHASH=0 \ + -DCMAKE_USE_SYSTEM_LIBRARY_EXPAT=0 \ + -DCMAKE_USE_SYSTEM_LIBRARY_CURL=0 \ + -DENABLE_ACL=0 -DHAVE_ACL_LIBACL_H=0 \ + -DHAVE_SYS_ACL_H=0 \ +" + +do_configure () { + ${S}/configure --verbose --prefix=${prefix} \ + ${@oe.utils.parallel_make_argument(d, '--parallel=%d')} \ + ${@bb.utils.contains('CCACHE', 'ccache ', '--enable-ccache', '', d)} \ + -- ${CMAKE_EXTRACONF} +} + +do_compile() { + oe_runmake +} + +do_install() { + oe_runmake 'DESTDIR=${D}' install + + # The following codes are here because eSDK needs to provide compatibilty + # for SDK. That is, eSDK could also be used like traditional SDK. + mkdir -p ${D}${datadir}/cmake + install -m 644 ${WORKDIR}/OEToolchainConfig.cmake ${D}${datadir}/cmake/ + mkdir -p ${D}${base_prefix}/environment-setup.d + install -m 644 ${WORKDIR}/environment.d-cmake.sh ${D}${base_prefix}/environment-setup.d/cmake.sh + + # Help docs create tons of files in the native sysroot and aren't needed there + rm -rf ${D}${datadir}/cmake-*/Help +} + +do_compile[progress] = "percent" + +SYSROOT_DIRS_NATIVE += "${datadir}/cmake ${base_prefix}/environment-setup.d" diff --git a/meta-digi-dey/dynamic-layers/meta-ml/recipes-devtools/cmake/cmake.inc b/meta-digi-dey/dynamic-layers/meta-ml/recipes-devtools/cmake/cmake.inc new file mode 100644 index 000000000..b7e674c4c --- /dev/null +++ b/meta-digi-dey/dynamic-layers/meta-ml/recipes-devtools/cmake/cmake.inc @@ -0,0 +1,28 @@ +# Copyright (C) 2005, Koninklijke Philips Electronics NV. All Rights Reserved +# Released under the MIT license (see packages/COPYING) + +SUMMARY = "Cross-platform, open-source make system" +DESCRIPTION = "CMake is used to control the software compilation process \ +using simple platform and compiler independent configuration files. CMake \ +generates native makefiles and workspaces that can be used in the compiler \ +environment of your choice." +HOMEPAGE = "http://www.cmake.org/" +BUGTRACKER = "http://public.kitware.com/Bug/my_view_page.php" +SECTION = "console/utils" +LICENSE = "BSD-3-Clause" +LIC_FILES_CHKSUM = "file://Copyright.txt;md5=09069e0fffe4e5eaf6dde04c3b1932e5 \ + file://Source/cmake.h;beginline=1;endline=2;md5=a5f70e1fef8614734eae0d62b4f5891b \ + " + +CMAKE_MAJOR_VERSION = "${@'.'.join(d.getVar('PV').split('.')[0:2])}" + +SRC_URI = "https://cmake.org/files/v${CMAKE_MAJOR_VERSION}/cmake-${PV}.tar.gz \ +" + +SRC_URI[sha256sum] = "c026f22cb931dd532f648f087d587f07a1843c6e66a3dfca4fb0ea21944ed33c" + +UPSTREAM_CHECK_REGEX = "cmake-(?P\d+(\.\d+)+)\.tar" + +# This is specific to the npm package that installs cmake, so isn't +# relevant to OpenEmbedded +CVE_CHECK_IGNORE += "CVE-2016-10642" diff --git a/meta-digi-dey/dynamic-layers/meta-ml/recipes-devtools/cmake/cmake/0001-CMakeDetermineSystem-use-oe-environment-vars-to-load.patch b/meta-digi-dey/dynamic-layers/meta-ml/recipes-devtools/cmake/cmake/0001-CMakeDetermineSystem-use-oe-environment-vars-to-load.patch new file mode 100644 index 000000000..d13c367e7 --- /dev/null +++ b/meta-digi-dey/dynamic-layers/meta-ml/recipes-devtools/cmake/cmake/0001-CMakeDetermineSystem-use-oe-environment-vars-to-load.patch @@ -0,0 +1,44 @@ +From 5acfcb2aba1a5641d390558fdf288373f5e39cb5 Mon Sep 17 00:00:00 2001 +From: Cody P Schafer +Date: Thu, 27 Apr 2017 11:35:05 -0400 +Subject: [PATCH] CMakeDetermineSystem: use oe environment vars to load default + toolchain file in sdk + +Passing the toolchain by: + + - shell aliases does not work if cmake is called by a script + - unconditionally by a wrapper script causes cmake to believe it is + configuring things when it is not (for example, `cmake --build` breaks). + +The OE_CMAKE_TOOLCHAIN_FILE variable is only used as a default if no +toolchain is explicitly specified. + +Setting the CMAKE_TOOLCHAIN_FILE cmake variable is marked as cached +because '-D' options are cache entries themselves. + +Upstream-Status: Inappropriate [oe-core specific] +Signed-off-by: Cody P Schafer +Signed-off-by: Otavio Salvador + +--- + Modules/CMakeDetermineSystem.cmake | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/Modules/CMakeDetermineSystem.cmake b/Modules/CMakeDetermineSystem.cmake +index 2c2c2ac3..fae4f97f 100644 +--- a/Modules/CMakeDetermineSystem.cmake ++++ b/Modules/CMakeDetermineSystem.cmake +@@ -112,6 +112,13 @@ else() + endif() + endif() + ++if(NOT DEFINED CMAKE_TOOLCHAIN_FILE) ++ if(DEFINED ENV{OE_CMAKE_TOOLCHAIN_FILE}) ++ set(CMAKE_TOOLCHAIN_FILE "$ENV{OE_CMAKE_TOOLCHAIN_FILE}" CACHE FILEPATH "toolchain file") ++ message(STATUS "Toolchain file defaulted to '${CMAKE_TOOLCHAIN_FILE}'") ++ endif() ++endif() ++ + # if a toolchain file is used, the user wants to cross compile. + # in this case read the toolchain file and keep the CMAKE_HOST_SYSTEM_* + # variables around so they can be used in CMakeLists.txt. diff --git a/meta-digi-dey/dynamic-layers/meta-ml/recipes-devtools/cmake/cmake/0001-CMakeLists.txt-disable-USE_NGHTTP2.patch b/meta-digi-dey/dynamic-layers/meta-ml/recipes-devtools/cmake/cmake/0001-CMakeLists.txt-disable-USE_NGHTTP2.patch new file mode 100644 index 000000000..d6486cb45 --- /dev/null +++ b/meta-digi-dey/dynamic-layers/meta-ml/recipes-devtools/cmake/cmake/0001-CMakeLists.txt-disable-USE_NGHTTP2.patch @@ -0,0 +1,31 @@ +From 3fd6082c52a8140db5995afb59fb391f7d5c19d7 Mon Sep 17 00:00:00 2001 +From: Changqing Li +Date: Wed, 28 Dec 2022 17:51:27 +0800 +Subject: [PATCH] CMakeLists.txt: disable USE_NGHTTP2 + +nghttp2 depends on cmake-native to build, to break circular +dependency, disable nghttp2. + +Upstream-Status: Inappropriate [oe specific] + +Signed-off-by: Changqing Li +--- + Utilities/cmcurl/CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Utilities/cmcurl/CMakeLists.txt b/Utilities/cmcurl/CMakeLists.txt +index f842270b..17b1ce19 100644 +--- a/Utilities/cmcurl/CMakeLists.txt ++++ b/Utilities/cmcurl/CMakeLists.txt +@@ -68,7 +68,7 @@ set(ENABLE_UNIX_SOCKETS OFF CACHE INTERNAL "No curl Unix domain sockets support" + set(HTTP_ONLY OFF CACHE INTERNAL "Curl is not http-only") + set(PICKY_COMPILER OFF CACHE INTERNAL "Enable picky compiler options") + set(USE_LIBIDN2 ON) +-set(USE_NGHTTP2 ON) ++set(USE_NGHTTP2 OFF) + set(USE_NGTCP2 OFF) + set(USE_QUICHE OFF) + set(USE_WIN32_IDN OFF) +-- +2.25.1 + diff --git a/meta-digi-dey/dynamic-layers/meta-ml/recipes-devtools/cmake/cmake/0005-Disable-use-of-ext2fs-ext2_fs.h-by-cmake-s-internal-.patch b/meta-digi-dey/dynamic-layers/meta-ml/recipes-devtools/cmake/cmake/0005-Disable-use-of-ext2fs-ext2_fs.h-by-cmake-s-internal-.patch new file mode 100644 index 000000000..d6f7308fe --- /dev/null +++ b/meta-digi-dey/dynamic-layers/meta-ml/recipes-devtools/cmake/cmake/0005-Disable-use-of-ext2fs-ext2_fs.h-by-cmake-s-internal-.patch @@ -0,0 +1,39 @@ +From fd9a04c1434e12f21c043385e306e0b52d38d749 Mon Sep 17 00:00:00 2001 +From: Otavio Salvador +Date: Thu, 5 Jul 2018 10:28:04 -0300 +Subject: [PATCH] Disable use of ext2fs/ext2_fs.h by cmake's internal + + libarchive copy +Organization: O.S. Systems Software LTDA. + +We don't want to add a dependency on e2fsprogs-native for cmake-native, +and we don't use CPack so just disable this functionality. + +Upstream-Status: Inappropriate [config] + +Signed-off-by: Paul Eggleton +Signed-off-by: Otavio Salvador + +--- + Utilities/cmlibarchive/CMakeLists.txt | 8 ++------ + 1 file changed, 2 insertions(+), 6 deletions(-) + +diff --git a/Utilities/cmlibarchive/CMakeLists.txt b/Utilities/cmlibarchive/CMakeLists.txt +index bfcaf30..2960683 100644 +--- a/Utilities/cmlibarchive/CMakeLists.txt ++++ b/Utilities/cmlibarchive/CMakeLists.txt +@@ -682,12 +682,8 @@ LA_CHECK_INCLUDE_FILE("copyfile.h" HAVE_COPYFILE_H) + LA_CHECK_INCLUDE_FILE("direct.h" HAVE_DIRECT_H) + LA_CHECK_INCLUDE_FILE("dlfcn.h" HAVE_DLFCN_H) + LA_CHECK_INCLUDE_FILE("errno.h" HAVE_ERRNO_H) +-LA_CHECK_INCLUDE_FILE("ext2fs/ext2_fs.h" HAVE_EXT2FS_EXT2_FS_H) +- +-CHECK_C_SOURCE_COMPILES("#include +-#include +-int main(void) { return EXT2_IOC_GETFLAGS; }" HAVE_WORKING_EXT2_IOC_GETFLAGS) +- ++SET(HAVE_EXT2FS_EXT2_FS_H 0) ++SET(HAVE_WORKING_EXT2_IOC_GETFLAGS 0) + LA_CHECK_INCLUDE_FILE("fcntl.h" HAVE_FCNTL_H) + LA_CHECK_INCLUDE_FILE("grp.h" HAVE_GRP_H) + LA_CHECK_INCLUDE_FILE("io.h" HAVE_IO_H) diff --git a/meta-digi-dey/dynamic-layers/meta-ml/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake b/meta-digi-dey/dynamic-layers/meta-ml/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake new file mode 100644 index 000000000..d6a1e0464 --- /dev/null +++ b/meta-digi-dey/dynamic-layers/meta-ml/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake @@ -0,0 +1,20 @@ +set( CMAKE_SYSTEM_NAME Linux ) +set( CMAKE_C_FLAGS $ENV{CFLAGS} CACHE STRING "" FORCE ) +set( CMAKE_CXX_FLAGS $ENV{CXXFLAGS} CACHE STRING "" FORCE ) +set( CMAKE_SYSROOT $ENV{OECORE_TARGET_SYSROOT} ) + +set( CMAKE_FIND_ROOT_PATH $ENV{OECORE_TARGET_SYSROOT} ) +set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER ) +set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY ) +set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY ) +set( CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY ) + +set(CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX "$ENV{OE_CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX}") + +set( CMAKE_SYSTEM_PROCESSOR $ENV{OECORE_TARGET_ARCH} ) + +# Include the toolchain configuration subscripts +file( GLOB toolchain_config_files "${CMAKE_CURRENT_LIST_FILE}.d/*.cmake" ) +foreach(config ${toolchain_config_files}) + include(${config}) +endforeach() diff --git a/meta-digi-dey/dynamic-layers/meta-ml/recipes-devtools/cmake/cmake/environment.d-cmake.sh b/meta-digi-dey/dynamic-layers/meta-ml/recipes-devtools/cmake/cmake/environment.d-cmake.sh new file mode 100644 index 000000000..7bdb19fb6 --- /dev/null +++ b/meta-digi-dey/dynamic-layers/meta-ml/recipes-devtools/cmake/cmake/environment.d-cmake.sh @@ -0,0 +1,2 @@ +export OE_CMAKE_TOOLCHAIN_FILE="$OECORE_NATIVE_SYSROOT/usr/share/cmake/OEToolchainConfig.cmake" +export OE_CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX="`echo $OECORE_BASELIB | sed -e s/lib//`" diff --git a/meta-digi-dey/dynamic-layers/meta-ml/recipes-fsl/packagegroup/packagegroup-imx-ml.bbappend b/meta-digi-dey/dynamic-layers/meta-ml/recipes-fsl/packagegroup/packagegroup-imx-ml.bbappend index 115c1e62a..b9b63a1e7 100644 --- a/meta-digi-dey/dynamic-layers/meta-ml/recipes-fsl/packagegroup/packagegroup-imx-ml.bbappend +++ b/meta-digi-dey/dynamic-layers/meta-ml/recipes-fsl/packagegroup/packagegroup-imx-ml.bbappend @@ -1,4 +1,8 @@ -# Copyright 2023 Digi International Inc. +# Copyright 2023,2024 Digi International Inc. + +ML_NNSTREAMER_PKGS_LIST:remove = "nnstreamer-deepview-rt" + +ML_PKGS:mx9-nxp-bsp:remove = "deepview-rt-examples" # ARM ethos-u package ETHOS_U_PKGS:append:mx93-nxp-bsp = " \ 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 index c7e0fe2b6..f816bd719 100644 --- 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 @@ -1,5 +1,6 @@ -# Copyright 2023 Digi International Inc. +# Copyright 2023,2024 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}" +SRCBRANCH:ccimx93 = "imx_22.05" +SRCREV:ccimx93 = "37fc035060646db5048648da01db3738f08e3bfa" + +SCONS_MAXLINELENGTH = "" diff --git a/meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/deepview-rt/deepview-rt_2.4.46.1-aarch64.bb b/meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/deepview-rt/deepview-rt_2.4.46.1-aarch64.bb deleted file mode 100644 index ec22eec23..000000000 --- a/meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/deepview-rt/deepview-rt_2.4.46.1-aarch64.bb +++ /dev/null @@ -1,57 +0,0 @@ -DESCRIPTION = "This package includes the updated and experimental ModelRunner for TensorFlow Lite and ARM NN. Also in this repository is a pre-release of DeepViewRT with support for the OpenVX backend." -LICENSE = "Proprietary" -LIC_FILES_CHKSUM = "file://COPYING;md5=ea25d099982d035af85d193c88a1b479" - -DEPENDS = "python3 python3-pip-native" - -SRC_URI = "${FSL_MIRROR}/${BPN}-${PV}.bin;fsl-eula=true" -SRC_URI[md5sum] = "a4782e44df2254d30f7c6b0a45c4102e" -SRC_URI[sha256sum] = "40d6c12bbe5fc29a257a1717684ec650bd390eb1565c5bca82ec56e3ffbcf918" -S = "${WORKDIR}/${BPN}-${PV}" - -inherit fsl-eula-unpack python3native - -PACKAGECONFIG ?= "${PACKAGECONFIG_OPENVX}" -PACKAGECONFIG_OPENVX = "" -PACKAGECONFIG_OPENVX:mx8-nxp-bsp:imxgpu = "openvx" -PACKAGECONFIG_OPENVX:mx8mm-nxp-bsp = "" -# The tensorflow-lite implementation for 8ULP uses CPU, and so doesn't -# support OpenVX -PACKAGECONFIG_OPENVX:mx8ulp-nxp-bsp = "" - -PACKAGECONFIG[openvx] = ",,,libopenvx-imx" - -do_install () { - install -d ${D}${bindir} - install -d ${D}${libdir} - install -d ${D}${includedir} - install -d ${D}/${PYTHON_SITEPACKAGES_DIR} - - cp -r ${S}/modelrunner/bin/* ${D}${bindir} - cp -rP ${S}/modelrunner/lib/* ${D}${libdir} - cp -rP ${S}/${BPN}/lib/* ${D}${libdir} - cp -r ${S}/${BPN}/include/* ${D}${includedir} - if ${@bb.utils.contains('PACKAGECONFIG', 'openvx', 'false', 'true', d)} ; then - rm ${D}${libdir}/deepview-rt-openvx.so - fi - - ${STAGING_BINDIR_NATIVE}/pip3 install --disable-pip-version-check -v \ - -t ${D}/${PYTHON_SITEPACKAGES_DIR} --no-cache-dir --no-deps \ - ${S}/whl/deepview_rt-*.whl - - chown -R root:root "${D}" -} - -INHIBIT_PACKAGE_STRIP = "1" -INHIBIT_PACKAGE_DEBUG_SPLIT = "1" -INHIBIT_SYSROOT_STRIP = "1" - -FILES_SOLIBSDEV = "" - -FILES:${PN} += "${libdir}/*" -RDEPENDS:${PN} = "onnxruntime tensorflow-lite" -INSANE_SKIP:${PN} += "dev-so dev-deps ldflags" - -BBCLASSEXTEND = "nativesdk" - -COMPATIBLE_MACHINE = "(mx8-nxp-bsp|mx9-nxp-bsp)" diff --git a/meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/eiq-examples/eiq-examples_git.bb b/meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/eiq-examples/eiq-examples_git.bb index 127a68575..43ad704a4 100644 --- a/meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/eiq-examples/eiq-examples_git.bb +++ b/meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/eiq-examples/eiq-examples_git.bb @@ -5,8 +5,8 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327" SRC_URI = "${EIQ_EXAMPLES_SRC};branch=${SRCBRANCH}" EIQ_EXAMPLES_SRC ?= "git://github.com/nxp-imx/eiq-example.git;protocol=https" -SRCBRANCH = "lf-6.1.1_1.0.0" -SRCREV = "798519ee033fb7a5aef989a793afe16f400d6479" +SRCBRANCH = "lf-6.1.55_2.2.0" +SRCREV = "4a21f2919e7e16ca1847672b6ed1ecfa60f1a86f" S = "${WORKDIR}/git" diff --git a/meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/ethos-u-driver-stack/ethos-u-driver-stack_22.08.bbappend b/meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/ethos-u-driver-stack/ethos-u-driver-stack_22.08.bbappend deleted file mode 100644 index 7056e97c0..000000000 --- a/meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/ethos-u-driver-stack/ethos-u-driver-stack_22.08.bbappend +++ /dev/null @@ -1,6 +0,0 @@ -# Copyright (C) 2023 Digi International - -LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=e3fc50a88d0a364313df4b21ef20c29e" - -SRCBRANCH = "lf-6.1.1_1.0.0" -SRCREV = "ca1a424bcd00758e0b50043ac7f8a3ff214e9ed8" diff --git a/meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/ethos-u-driver-stack/ethos-u-driver-stack_23.08.bb b/meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/ethos-u-driver-stack/ethos-u-driver-stack_23.08.bb new file mode 100644 index 000000000..3696f747f --- /dev/null +++ b/meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/ethos-u-driver-stack/ethos-u-driver-stack_23.08.bb @@ -0,0 +1,11 @@ +# Copyright 2024 Digi International Inc. + +# +# Reuse meta-imx/meta-ml ethos-u-driver-stack_22.08.bb +# +require recipes-libraries/ethos-u-driver-stack/ethos-u-driver-stack_22.08.bb + +LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=e3fc50a88d0a364313df4b21ef20c29e" + +SRCBRANCH = "lf-6.1.55_2.2.0" +SRCREV = "f8975c4d44e7893dcf106d4afaff55e30470b463" diff --git a/meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/ethos-u-driver-stack/ethos-u-firmware/ccimx93/ethosu_firmware b/meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/ethos-u-driver-stack/ethos-u-firmware/ccimx93/ethosu_firmware index cac0eee6a..6299689f8 100755 Binary files a/meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/ethos-u-driver-stack/ethos-u-firmware/ccimx93/ethosu_firmware and b/meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/ethos-u-driver-stack/ethos-u-firmware/ccimx93/ethosu_firmware differ diff --git a/meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/ethos-u-driver-stack/ethos-u-firmware_22.08.bbappend b/meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/ethos-u-driver-stack/ethos-u-firmware_22.08.bbappend deleted file mode 100644 index abb93bf82..000000000 --- a/meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/ethos-u-driver-stack/ethos-u-firmware_22.08.bbappend +++ /dev/null @@ -1,12 +0,0 @@ -# Copyright 2023 Digi International Inc. - -FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}:" - -# Use our custom ethosu_firmware without debug port; keep the commented info for traceability -#SRCBRANCH = "lf-6.1.1_1.0.0" -#SRCREV = "c80a413664f650c366fc4721474a3fe1d1503eb5" -SRC_URI:append:ccimx93 = " file://ethosu_firmware" - -do_install:append:ccimx93 () { - install -m 0644 ${WORKDIR}/ethosu_firmware ${D}${nonarch_base_libdir}/firmware -} diff --git a/meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/ethos-u-driver-stack/ethos-u-firmware_23.08.bb b/meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/ethos-u-driver-stack/ethos-u-firmware_23.08.bb new file mode 100644 index 000000000..97a5e7eb3 --- /dev/null +++ b/meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/ethos-u-driver-stack/ethos-u-firmware_23.08.bb @@ -0,0 +1,21 @@ +# Copyright 2024 Digi International Inc. + +# +# Reuse meta-imx/meta-ml ethos-u-firmware_22.08.bb +# +require recipes-libraries/ethos-u-driver-stack/ethos-u-firmware_22.08.bb + +LIC_FILES_CHKSUM = "\ + file://LICENSE.txt;md5=e3fc50a88d0a364313df4b21ef20c29e \ + file://LICENSE-GPL-2.0.txt;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ + file://LICENSE-BSD-3.txt;md5=0858ec9c7a80c4a2cf16e4f825a2cc91 \ +" + +SRCBRANCH = "lf-6.1.55_2.2.0" +SRCREV = "7639c9a8ded082c642ff86e55ca053950e6b2486" +SRC_URI:append:ccimx93 = " file://ethosu_firmware" + +do_install:ccimx93 () { + install -d ${D}${nonarch_base_libdir}/firmware + install -m 0644 ${WORKDIR}/ethosu_firmware ${D}${nonarch_base_libdir}/firmware/ethosu_firmware +} diff --git a/meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/ethos-u-vela/ethos-u-vela_3.6.0.bb b/meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/ethos-u-vela/ethos-u-vela_3.9.0.bb similarity index 77% rename from meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/ethos-u-vela/ethos-u-vela_3.6.0.bb rename to meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/ethos-u-vela/ethos-u-vela_3.9.0.bb index 031be0fda..b145d47a0 100644 --- a/meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/ethos-u-vela/ethos-u-vela_3.6.0.bb +++ b/meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/ethos-u-vela/ethos-u-vela_3.9.0.bb @@ -1,15 +1,15 @@ -# Copyright 2022 NXP +# Copyright 2023 NXP DESCRIPTION = "The vela tool is used to compile a TensorFlow Lite for \ Microcontrollers neural network model into an optimised version that \ can run on an embedded system containing an Arm Ethos-U NPU" LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=e3fc50a88d0a364313df4b21ef20c29e" -DEPENDS = "python3-pip-native python3-wheel-native flatbuffers python3-numpy python3-lxml" +DEPENDS = "python3-pip-native python3-wheel-native flatbuffers python3-numpy python3-lxml python3-numpy-native" SRC_URI = "${VELA_SRC};branch=${SRCBRANCH}" VELA_SRC ?= "git://github.com/nxp-imx/ethos-u-vela.git;protocol=https" -SRCBRANCH = "lf-6.1.1_1.0.0" -SRCREV = "8b138a2e6880e31bd199764db9c5177c46bd5579" +SRCBRANCH = "lf-6.1.55_2.2.0" +SRCREV = "b8f74c2fcdce8ceb0fe5e2401ae10359a12224e4" S = "${WORKDIR}/git" @@ -23,6 +23,6 @@ do_compile:prepend() { export https_proxy=${https_proxy} } -RDEPENDS:${PN} += "flatbuffers python3-numpy python3-lxml" +RDEPENDS:${PN} += "python3-flatbuffers python3-numpy python3-lxml" COMPATIBLE_MACHINE = "(mx93-nxp-bsp)" diff --git a/meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/onnxruntime/onnxruntime_1.10.0.bbappend b/meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/onnxruntime/onnxruntime_1.10.0.bbappend deleted file mode 100644 index c21ee1e10..000000000 --- a/meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/onnxruntime/onnxruntime_1.10.0.bbappend +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright (C) 2023 Digi International - -SRCBRANCH_runtime:ccimx93 = "lf-6.1.1_1.0.0" -SRCREV_runtime:ccimx93 = "66e3e9a93840ed1e55dc2d7e894c0ae26fb0e51e" - -# Updated flatbuffers recipe for ccimx93, renamed the runtime python package -PYTHON_RDEPENDS:remove:ccimx93 = "flatbuffers-${PYTHON_PN}" -PYTHON_RDEPENDS:append:ccimx93 = " ${PYTHON_PN}-flatbuffers" diff --git a/meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/onnxruntime/onnxruntime_1.16.1.bb b/meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/onnxruntime/onnxruntime_1.16.1.bb new file mode 100644 index 000000000..5151c79b7 --- /dev/null +++ b/meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/onnxruntime/onnxruntime_1.16.1.bb @@ -0,0 +1,184 @@ +# Copyright 2020-2023 NXP +DESCRIPTION = "cross-platform, high performance scoring engine for ML models" +SECTION = "devel" +LICENSE = "MIT & Apache-2.0" +LIC_FILES_CHKSUM_runtime = "file://LICENSE;md5=0f7e3b1308cb5c00b372a6e78835732d" +LIC_FILES_CHKSUM_model = "file://${S}/example-models/squeezenet/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57" +LIC_FILES_CHKSUM = "${LIC_FILES_CHKSUM_runtime} ${LIC_FILES_CHKSUM_model}" + +DEPENDS = "libpng zlib" + +inherit setuptools3 + +SRC_URI = "${ONNXRUNTIME_SRC};branch=${SRCBRANCH}" +ONNXRUNTIME_SRC ?= "gitsm://github.com/nxp-imx/onnxruntime-imx.git;protocol=https" +SRCBRANCH = "lf-6.1.55_2.2.0" +SRCREV = "1582e774d7c120a5dfbdbf6e11c8788e710ab93f" + +S = "${WORKDIR}/git" + +inherit cmake python3native + +OECMAKE_SOURCEPATH = "${S}/cmake" +OECMAKE_GENERATOR = "Unix Makefiles" + +# Notes: +# Abseil: +# - FETCHCONTENT_FULLY_DISCONNECTED=OFF and do_configure:prepend() added to allow +# abseil build process (the issue was related to CMake not fetching sources) + +EXTRA_OECMAKE += "\ + -DFETCHCONTENT_FULLY_DISCONNECTED=OFF \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -Donnxruntime_BUILD_UNIT_TESTS=ON \ +" + +PYTHON_DEPENDS = "\ + ${PYTHON_PN} \ + ${PYTHON_PN}-pip-native \ + ${PYTHON_PN}-numpy-native \ + ${PYTHON_PN}-packaging-native\ + ${PYTHON_PN}-pybind11\ + ${PYTHON_PN}-pybind11-native\ +" + +PYTHON_RDEPENDS = "\ + ${PYTHON_PN} \ + ${PYTHON_PN}-numpy \ + ${PYTHON_PN}-protobuf \ + ${PYTHON_PN}-coloredlogs \ + ${PYTHON_PN}-flatbuffers \ + ${PYTHON_PN}-sympy \ +" + +PACKAGECONFIG ?= "crosscompiling sharedlib python" + +PACKAGECONFIG[nsync] = "-Donnxruntime_USE_NSYNC=ON, -Donnxruntime_USE_NSYNC=OFF" +PACKAGECONFIG[prebuilt] = "-Donnxruntime_USE_PREBUILT_PB=ON, -Donnxruntime_USE_PREBUILT_PB=OFF" +PACKAGECONFIG[openmp] = "-Donnxruntime_USE_OPENMP=ON, -Donnxruntime_USE_OPENMP=OFF" +PACKAGECONFIG[trt] = "-Donnxruntime_USE_TRT=ON, -Donnxruntime_USE_TRT=OFF" +PACKAGECONFIG[nuphar] = "-Donnxruntime_USE_NUPHAR=ON, -Donnxruntime_USE_NUPHAR=OFF" +PACKAGECONFIG[brainslice] = "-Donnxruntime_USE_BRAINSLICE=ON, -Donnxruntime_USE_BRAINSLICE=OFF" +PACKAGECONFIG[python] = "-Donnxruntime_ENABLE_PYTHON=ON, -Donnxruntime_ENABLE_PYTHON=OFF, ${PYTHON_DEPENDS}, ${PYTHON_RDEPENDS}" +PACKAGECONFIG[sharedlib] = "-Donnxruntime_BUILD_SHARED_LIB=ON, -Donnxruntime_BUILD_SHARED_LIB=OFF" +PACKAGECONFIG[eigenblas] = "-Donnxruntime_USE_EIGEN_FOR_BLAS=ON, -Donnxruntime_USE_EIGEN_FOR_BLAS=OFF" +PACKAGECONFIG[openblas] = "-Donnxruntime_USE_OPENBLAS=ON, -Donnxruntime_USE_OPENBLAS=OFF" +PACKAGECONFIG[dnnl] = "-Donnxruntime_USE_DNNL=ON, -Donnxruntime_USE_DNNL=OFF" +PACKAGECONFIG[mklml] = "-Donnxruntime_USE_MKLML=ON, -Donnxruntime_USE_MKLML=OFF" +PACKAGECONFIG[gemmlowp] = "-Donnxruntime_USE_GEMMLOWP=ON, -Donnxruntime_USE_GEMMLOWP=OFF" +PACKAGECONFIG[ngraph] = "-Donnxruntime_USE_NGRAPH=ON, -Donnxruntime_USE_NGRAPH=OFF" +PACKAGECONFIG[openvino] = "-Donnxruntime_USE_OPENVINO=ON, -Donnxruntime_USE_OPENVINO=OFF" +PACKAGECONFIG[interop] = "-Donnxruntime_ENABLE_LANGUAGE_INTEROP_OPS=ON, -Donnxruntime_ENABLE_LANGUAGE_INTEROP_OPS=OFF" +PACKAGECONFIG[dml] = "-Donnxruntime_USE_DML=ON, -Donnxruntime_USE_DML=OFF" +PACKAGECONFIG[telemetry] = "-Donnxruntime_USE_TELEMETRY=ON, -Donnxruntime_USE_TELEMETRY=OFF" +PACKAGECONFIG[armnn-relu] = "-Donnxruntime_ARMNN_RELU_USE_CPU=ON, -Donnxruntime_ARMNN_RELU_USE_CPU=OFF" +PACKAGECONFIG[armnn-bn] = "-Donnxruntime_ARMNN_BN_USE_CPU=ON, -Donnxruntime_ARMNN_BN_USE_CPU=OFF" +PACKAGECONFIG[opschema] = "-Donnxruntime_PYBIND_EXPORT_OPSCHEMA=ON, -Donnxruntime_PYBIND_EXPORT_OPSCHEMA=OFF" +PACKAGECONFIG[nnapi] = "-Donnxruntime_USE_NNAPI_BUILTIN=ON, -Donnxruntime_USE_NNAPI_BUILTIN=OFF" +PACKAGECONFIG[tvm] = "-Donnxruntime_USE_TVM=ON, -Donnxruntime_USE_TVM=OFF" +PACKAGECONFIG[llvm] = "-Donnxruntime_USE_LLVM=ON, -Donnxruntime_USE_LLVM=OFF" +PACKAGECONFIG[microsoft] = "-Donnxruntime_ENABLE_MICROSOFT_INTERNAL=ON, -Donnxruntime_ENABLE_MICROSOFT_INTERNAL=OFF" +PACKAGECONFIG[eigenthreadpool] = "-Donnxruntime_USE_EIGEN_THREADPOOL=ON, -Donnxruntime_USE_EIGEN_THREADPOOL=OFF" +PACKAGECONFIG[tensorrt] = "-Donnxruntime_USE_TENSORRT=ON, -Donnxruntime_USE_TENSORRT=OFF" +PACKAGECONFIG[crosscompiling] = "-Donnxruntime_CROSS_COMPILING=ON, -Donnxruntime_CROSS_COMPILING=OFF " +PACKAGECONFIG[server] = "-Donnxruntime_BUILD_SERVER=ON, -Donnxruntime_BUILD_SERVER=OFF" +PACKAGECONFIG[x86] = "-Donnxruntime_BUILD:x86=ON, -Donnxruntime_BUILD:x86=OFF" +PACKAGECONFIG[fullprotobuf] = "-Donnxruntime_USE_FULL_PROTOBUF=ON, -Donnxruntime_USE_FULL_PROTOBUF=OFF" +PACKAGECONFIG[ops] = "-Donnxruntime_DISABLE_CONTRIB_OPS=ON, -Donnxruntime_DISABLE_CONTRIB_OPS=OFF" +PACKAGECONFIG[staticruntime] = "-Donnxruntime_MSVC_STATIC_RUNTIME=ON, -Donnxruntime_MSVC_STATIC_RUNTIME=OFF" +PACKAGECONFIG[runtests] = "-Donnxruntime_RUN_ONNX_TESTS=ON, -Donnxruntime_RUN_ONNX_TESTS=OFF" +PACKAGECONFIG[reports] = "-Donnxruntime_GENERATE_TEST_REPORTS=ON, -Donnxruntime_GENERATE_TEST_REPORTS=OFF" +PACKAGECONFIG[devmode] = "-Donnxruntime_DEV_MODE=ON, -Donnxruntime_DEV_MODE=OFF" +PACKAGECONFIG[cuda] = "-Donnxruntime_USE_CUDA=ON, -Donnxruntime_USE_CUDA=OFF" +PACKAGECONFIG[automl] = "-Donnxruntime_USE_AUTOML=ON, -Donnxruntime_USE_AUTOML=OFF" +PACKAGECONFIG[jemalloc] = "-Donnxruntime_USE_JEMALLOC=ON, -Donnxruntime_USE_JEMALLOC=OFF" +PACKAGECONFIG[mimalloc] = "-Donnxruntime_USE_MIMALLOC=ON, -Donnxruntime_USE_MIMALLOC=OFF" +PACKAGECONFIG[csharp] = "-Donnxruntime_BUILD_CSHARP=ON, -Donnxruntime_BUILD_CSHARP=OFF" +PACKAGECONFIG[java] = "-Donnxruntime_BUILD_JAVA=ON, -Donnxruntime_BUILD_JAVA=OFF" + +do_configure[network] = "1" +do_configure:prepend() { + export HTTP_PROXY=${http_proxy} + export HTTPS_PROXY=${https_proxy} + export http_proxy=${http_proxy} + export https_proxy=${https_proxy} +} + +do_compile[network] = "1" +do_compile:prepend() { + if ${@bb.utils.contains('PACKAGECONFIG', 'python', 'true', 'false', d)}; then + # required to pull pybind11 + export HTTP_PROXY=${http_proxy} + export HTTPS_PROXY=${https_proxy} + export http_proxy=${http_proxy} + export https_proxy=${https_proxy} + fi +} + +SETUPTOOLS_SETUP_PATH = "${B}" + +do_compile:append() { + if ${@bb.utils.contains('PACKAGECONFIG', 'python', 'true', 'false', d)}; then + # Copy 'setup.py' to build dir + cp ${S}/setup.py ${B} + + # Copy path file with path 'docs/python/README.rst' to build dir + mkdir -p ${B}/docs/python && cp ${S}/docs/python/README.rst ${B}/docs/python + + setuptools3_do_compile + + git config --global --add safe.directory ${WORKDIR}/build/pybind11/src/pybind11 + fi +} + +do_install:append() { + CP_ARGS="-Prf --preserve=mode,timestamps --no-preserve=ownership" + + # Ensure target dir exists + install -d ${D}${bindir}/${BP} + + # Copy squeezenet updated model from imx-onnxruntime repo + if [ -d ${S}/example-models/ ]; then + cp $CP_ARGS ${S}/example-models/squeezenet ${D}${bindir}/${BP}/ + fi + + # If cmake installs 'onnx_test_runner' at bindir level, move to package + if [ -f ${D}${bindir}/onnx_test_runner ]; then + mv ${D}${bindir}/onnx_test_runner ${D}${bindir}/${BP}/ + fi + + # Install onnxruntime_perf_test in main package + install -m 0755 ${B}/onnxruntime_perf_test ${D}${bindir}/${BP} + + # Install test binaries and data in test package + install -d ${D}${bindir}/${BP}/tests + install -m 0744 ${B}/libcustom_op_library.so ${D}${bindir}/${BP}/tests + install -m 0744 ${B}/onnxruntime_global_thread_pools_test ${D}${bindir}/${BP}/tests + install -m 0744 ${B}/onnxruntime_mlas_test ${D}${bindir}/${BP}/tests + install -m 0744 ${B}/onnxruntime_shared_lib_test ${D}${bindir}/${BP}/tests + install -m 0744 ${B}/onnxruntime_test_all ${D}${bindir}/${BP}/tests + cp $CP_ARGS ${B}/testdata ${D}${bindir}/${BP}/tests + + if ${@bb.utils.contains('PACKAGECONFIG', 'python', 'true', 'false', d)}; then + setuptools3_do_install + find ${D}/${PYTHON_SITEPACKAGES_DIR} -type d -name "__pycache__" -exec rm -Rf {} + + git config --global --unset-all safe.directory ${TMPDIR}/.*/${PN}/.*/build/pybind11/src/pybind11 + fi +} + +# Adjust the Python runtime dependency inherited from setuptools3-base.bbclass +# since Python support for this recipe is conditional +RDEPENDS:${PN}:remove:class-target = " \ + ${@bb.utils.contains('PACKAGECONFIG', 'python', '', '${PYTHON_PN}-core', d)}" + +# libonnxruntime_providers_shared.so is being packaged into -dev which is intended +INSANE_SKIP:${PN}-dev += "dev-elf" + +# A separate tests package for the test binaries not appearing in the main package +PACKAGE_BEFORE_PN = "${PN}-tests" +FILES:${PN}-tests = "${bindir}/${BP}/tests/*" + +# libcustom_op_library.so is in bindir, which is intended; +# onnxruntime_shared_lib_test requires the shlib to be in the same directory as testdata to run properly +INSANE_SKIP:${PN}-tests += "libdir" +INSANE_SKIP:${PN}-dbg += "libdir" diff --git a/meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/tensorflow-lite/tensorflow-lite-2.10.0.inc b/meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/tensorflow-lite/tensorflow-lite-2.12.1.inc similarity index 55% rename from meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/tensorflow-lite/tensorflow-lite-2.10.0.inc rename to meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/tensorflow-lite/tensorflow-lite-2.12.1.inc index 007d1ac97..ae33fc4c9 100644 --- a/meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/tensorflow-lite/tensorflow-lite-2.10.0.inc +++ b/meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/tensorflow-lite/tensorflow-lite-2.12.1.inc @@ -1,5 +1,5 @@ # Copyright 2020-2021 NXP TENSORFLOW_LITE_SRC ?= "git://github.com/nxp-imx/tensorflow-imx.git;protocol=https" -SRCBRANCH_tf = "lf-6.1.1_1.0.0" -SRCREV_tf = "6cac366ef5b7e632305c2413875ce2d3b72c03dd" +SRCBRANCH_tf = "lf-6.1.55_2.2.0" +SRCREV_tf = "22641785b73a34cc88d8d5276bc7697013510a16" diff --git a/meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/tensorflow-lite/tensorflow-lite-ethosu-delegate_2.10.0.bb b/meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/tensorflow-lite/tensorflow-lite-ethosu-delegate_2.12.1.bb similarity index 89% rename from meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/tensorflow-lite/tensorflow-lite-ethosu-delegate_2.10.0.bb rename to meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/tensorflow-lite/tensorflow-lite-ethosu-delegate_2.12.1.bb index a0de103d8..44a7208db 100644 --- a/meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/tensorflow-lite/tensorflow-lite-ethosu-delegate_2.10.0.bb +++ b/meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/tensorflow-lite/tensorflow-lite-ethosu-delegate_2.12.1.bb @@ -8,8 +8,8 @@ DEPENDS = "tensorflow-lite ethos-u-driver-stack" require tensorflow-lite-${PV}.inc TENSORFLOW_LITE_ETHOSU_DELEGATE_SRC ?= "git://github.com/nxp-imx/tflite-ethosu-delegate-imx.git;protocol=https" -SRCBRANCH_ethosu = "lf-6.1.1_1.0.0" -SRCREV_ethosu = "4bd28d3e64d26f4d5b5ee358036b2d06f3322a57" +SRCBRANCH_ethosu = "lf-6.1.55_2.2.0" +SRCREV_ethosu = "8f4df6a8bed86feb699f77a84e5f5b02839db53f" SRCREV_FORMAT = "ethosu_tf" @@ -25,7 +25,7 @@ EXTRA_OECMAKE = "-DCMAKE_SYSROOT=${PKG_CONFIG_SYSROOT_DIR}" EXTRA_OECMAKE += " \ -DFETCHCONTENT_FULLY_DISCONNECTED=OFF \ -DFETCHCONTENT_SOURCE_DIR_TENSORFLOW=${WORKDIR}/tfgit \ - -DTFLITE_LIB_LOC=${STAGING_DIR_HOST}/usr/lib/libtensorflow-lite.so \ + -DTFLITE_LIB_LOC=${STAGING_DIR_HOST}${libdir}/libtensorflow-lite.so \ ${S} \ " diff --git a/meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/tensorflow-lite/tensorflow-lite-host-tools_2.10.0.bb b/meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/tensorflow-lite/tensorflow-lite-host-tools_2.12.1.bb similarity index 100% rename from meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/tensorflow-lite/tensorflow-lite-host-tools_2.10.0.bb rename to meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/tensorflow-lite/tensorflow-lite-host-tools_2.12.1.bb diff --git a/meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/tensorflow-lite/tensorflow-lite_2.%.bbappend b/meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/tensorflow-lite/tensorflow-lite_2.%.bbappend deleted file mode 100644 index 13b6d3f84..000000000 --- a/meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/tensorflow-lite/tensorflow-lite_2.%.bbappend +++ /dev/null @@ -1,12 +0,0 @@ -FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" - -SRC_URI:append = " file://tensorflow-lite.pc.in" - -do_install:append() { - install -d ${D}${libdir}/pkgconfig - install -m 0644 ${WORKDIR}/tensorflow-lite.pc.in ${D}${libdir}/pkgconfig/tensorflow2-lite.pc - - sed -i 's:@version@:${PV}:g - s:@libdir@:${libdir}:g - s:@includedir@:${includedir}:g' ${D}${libdir}/pkgconfig/tensorflow2-lite.pc -} diff --git a/meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/tensorflow-lite/tensorflow-lite_2.10.0.bb b/meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/tensorflow-lite/tensorflow-lite_2.12.1.bb similarity index 95% rename from meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/tensorflow-lite/tensorflow-lite_2.10.0.bb rename to meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/tensorflow-lite/tensorflow-lite_2.12.1.bb index a72ac949f..49b260040 100644 --- a/meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/tensorflow-lite/tensorflow-lite_2.10.0.bb +++ b/meta-digi-dey/dynamic-layers/meta-ml/recipes-libraries/tensorflow-lite/tensorflow-lite_2.12.1.bb @@ -18,12 +18,6 @@ S = "${WORKDIR}/git" inherit python3native cmake -PACKAGECONFIG ??= "${PACKAGECONFIG_ETHOSU}" -PACKAGECONFIG_ETHOSU = "" -PACKAGECONFIG_ETHOSU:mx93-nxp-bsp = "ethosu" - -PACKAGECONFIG[ethosu] = "-DTFLITE_ENABLE_ETHOSU=on,-DTFLITE_ENABLE_ETHOSU=off,ethos-u-driver-stack" - EXTRA_OECMAKE = " \ -DCMAKE_SYSROOT=${PKG_CONFIG_SYSROOT_DIR} \ -DFETCHCONTENT_FULLY_DISCONNECTED=OFF \ diff --git a/meta-digi-dey/dynamic-layers/meta-ml/recipes-nnstreamer/nnstreamer/nnstreamer_2.2.0.bbappend b/meta-digi-dey/dynamic-layers/meta-ml/recipes-nnstreamer/nnstreamer/nnstreamer_2.2.0.bbappend new file mode 100644 index 000000000..d81a7ba8a --- /dev/null +++ b/meta-digi-dey/dynamic-layers/meta-ml/recipes-nnstreamer/nnstreamer/nnstreamer_2.2.0.bbappend @@ -0,0 +1,3 @@ +# Copyright 2023 Digi International Inc. + +PACKAGECONFIG_SOC:mx9-nxp-bsp:remove = "deepview-rt" diff --git a/meta-digi-dey/dynamic-layers/qt5-layer/STM/recipes-qt/qt5/qtbase/cursor.json b/meta-digi-dey/dynamic-layers/qt5-layer/STM/recipes-qt/qt5/qtbase/cursor.json new file mode 100644 index 000000000..17563c866 --- /dev/null +++ b/meta-digi-dey/dynamic-layers/qt5-layer/STM/recipes-qt/qt5/qtbase/cursor.json @@ -0,0 +1,8 @@ +{ + "device": "/dev/dri/card0", + "outputs": [ + { "name": "HDMI1", "mode": "1280x720", "size": "1280x720" } + ], + "hwcursor": false +} + diff --git a/meta-digi-dey/dynamic-layers/qt5-layer/STM/recipes-qt/qt5/qtbase/qt5-eglfs.sh b/meta-digi-dey/dynamic-layers/qt5-layer/STM/recipes-qt/qt5/qtbase/qt5-eglfs.sh new file mode 100644 index 000000000..54500ffb6 --- /dev/null +++ b/meta-digi-dey/dynamic-layers/qt5-layer/STM/recipes-qt/qt5/qtbase/qt5-eglfs.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +export QT_QPA_PLATFORM=eglfs + +# Use the KMS/DRM backend +export QT_QPA_EGLFS_INTEGRATION=eglfs_kms + +if [ -e /usr/share/qt5/cursor.json ]; +then + export QT_QPA_EGLFS_KMS_CONFIG=/usr/share/qt5/cursor.json +fi + +# Force to keep the MODE SETTING set +export QT_QPA_EGLFS_ALWAYS_SET_MODE=1 + +# Force to use KMS ATOMIC +export QT_QPA_EGLFS_KMS_ATOMIC=1 + +# EGLFS environment variables accessible for qt 5.12 +# Documentation: https://doc.qt.io/qt-5/embedded-linux.html diff --git a/meta-digi-dey/dynamic-layers/qt5-layer/STM/recipes-qt/qt5/qtbase/qt5-wayland.sh b/meta-digi-dey/dynamic-layers/qt5-layer/STM/recipes-qt/qt5/qtbase/qt5-wayland.sh new file mode 100644 index 000000000..91f62aa25 --- /dev/null +++ b/meta-digi-dey/dynamic-layers/qt5-layer/STM/recipes-qt/qt5/qtbase/qt5-wayland.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +export QT_QPA_PLATFORM="wayland" diff --git a/meta-digi-dey/dynamic-layers/qt5-layer/STM/recipes-qt/qt5/qtbase/qt5.sh b/meta-digi-dey/dynamic-layers/qt5-layer/STM/recipes-qt/qt5/qtbase/qt5.sh deleted file mode 100644 index 4052b0a13..000000000 --- a/meta-digi-dey/dynamic-layers/qt5-layer/STM/recipes-qt/qt5/qtbase/qt5.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -export QT_QPA_PLATFORM="wayland" - -[ -f "/etc/profile.d/weston_profile.sh" ] && return - -# Use EGLFS platform plugin for images without Wayland -export QT_QPA_PLATFORM="eglfs" QT_QPA_EGLFS_INTEGRATION="eglfs_viv" diff --git a/meta-digi-dey/dynamic-layers/qt5-layer/STM/recipes-qt/qt5/qtbase_git.bbappend b/meta-digi-dey/dynamic-layers/qt5-layer/STM/recipes-qt/qt5/qtbase_git.bbappend index 1744da523..0b2fcb3a2 100644 --- a/meta-digi-dey/dynamic-layers/qt5-layer/STM/recipes-qt/qt5/qtbase_git.bbappend +++ b/meta-digi-dey/dynamic-layers/qt5-layer/STM/recipes-qt/qt5/qtbase_git.bbappend @@ -1,15 +1,37 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" -PACKAGECONFIG_GL = " ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'gles2', '', d)} " -PACKAGECONFIG:append = " eglfs examples accessibility " +PACKAGECONFIG_GL = " ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', \ + bb.utils.contains('DISTRO_FEATURES', 'wayland', 'gles2', \ + 'gles2 eglfs', d), '', d)}" +PACKAGECONFIG:append = " \ + eglfs \ + examples \ + accessibility \ + ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', '', 'gbm kms', d)} \ +" QT_CONFIG_FLAGS += " -no-sse2 -no-opengles3" SRC_URI:append = " \ - file://qt5.sh \ + ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', \ + 'file://qt5-wayland.sh', \ + 'file://qt5-eglfs.sh \ + file://cursor.json ', d)} \ " do_install:append () { install -d ${D}${sysconfdir}/profile.d/ - install -m 0755 ${WORKDIR}/qt5.sh ${D}${sysconfdir}/profile.d/qt5.sh + + if ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'true', 'false', d)}; then + # Wayland backend + install -m 0755 ${WORKDIR}/qt5-wayland.sh ${D}${sysconfdir}/profile.d/qt5.sh + else + # EGLFS backend + install -d ${D}${datadir}/qt5 + install -m 0755 ${WORKDIR}/qt5-eglfs.sh ${D}/${sysconfdir}/profile.d/qt5.sh + install -m 0664 ${WORKDIR}/cursor.json ${D}${datadir}/qt5/ + fi } -FILES:${PN} += "${sysconfdir}/profile.d/qt5.sh" +FILES:${PN} += " \ + ${sysconfdir}/profile.d/qt5.sh \ + ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', '', '${datadir}/qt5', d)} \ +" diff --git a/meta-digi-dey/dynamic-layers/qt5-layer/recipes-qt/packagegroups/packagegroup-qt5-dey.bb b/meta-digi-dey/dynamic-layers/qt5-layer/recipes-qt/packagegroups/packagegroup-qt5-dey.bb index 94293de24..b16f30d14 100644 --- a/meta-digi-dey/dynamic-layers/qt5-layer/recipes-qt/packagegroups/packagegroup-qt5-dey.bb +++ b/meta-digi-dey/dynamic-layers/qt5-layer/recipes-qt/packagegroups/packagegroup-qt5-dey.bb @@ -1,5 +1,5 @@ # -# Copyright (C) 2013-2023, Digi International Inc. +# Copyright (C) 2013-2024, Digi International Inc. # SUMMARY = "QT packagegroup for DEY image" @@ -35,7 +35,24 @@ QT5_RDEPENDS:imxgpu3d = " \ gstreamer1.0-plugins-good-qt \ " -QT5_RDEPENDS:ccmp15 = "${QT5_RDEPENDS_common}" +QT5_RDEPENDS_eglfs = " \ + qtbase \ + qtbase-plugins \ + qtbase-tools \ + qtdeclarative \ + qtdeclarative-qmlplugins \ + qtdeclarative-tools \ + qtgraphicaleffects-qmlplugins \ + qtmultimedia \ + qtmultimedia-plugins \ + qtmultimedia-qmlplugins \ + qtscript \ +" + +QT5_RDEPENDS:ccmp15 = " \ + ${QT5_RDEPENDS_common} \ + ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', '', '${QT5_RDEPENDS_eglfs}', d)} \ +" # Add packagegroup-qt5-webengine to QT5_RDEPENDS and comment out the line below to install qtwebengine to the rootfs. QT5_RDEPENDS:remove = " packagegroup-qt5-webengine" diff --git a/meta-digi-dey/dynamic-layers/selinux/recipes-core/images/dey-image-lvgl.bbappend b/meta-digi-dey/dynamic-layers/selinux/recipes-core/images/dey-image-lvgl.bbappend new file mode 100644 index 000000000..072993cd7 --- /dev/null +++ b/meta-digi-dey/dynamic-layers/selinux/recipes-core/images/dey-image-lvgl.bbappend @@ -0,0 +1 @@ +include selinux_dey.inc diff --git a/meta-digi-dey/recipes-connectivity/bluez/bluez5-init.bb b/meta-digi-dey/recipes-connectivity/bluez/bluez5-init.bb index f5df5aa02..a9661b0fa 100644 --- a/meta-digi-dey/recipes-connectivity/bluez/bluez5-init.bb +++ b/meta-digi-dey/recipes-connectivity/bluez/bluez5-init.bb @@ -62,4 +62,4 @@ RDEPENDS:${PN} = "initscripts-functions" RDEPENDS:${PN}:append:ccimx93 = " firmware-nxp-wifi-nxpiw612" PACKAGE_ARCH = "${MACHINE_ARCH}" -COMPATIBLE_MACHINE = "(ccimx6$|ccimx6ul|ccimx8x|ccimx8mn|ccimx8mm|ccimx93)" +COMPATIBLE_MACHINE = "(ccimx6$|ccimx6ul|ccimx8m|ccimx8x|ccimx93)" diff --git a/meta-digi-dey/recipes-connectivity/xbee/xbee.bb b/meta-digi-dey/recipes-connectivity/xbee/xbee.bb index 2b31f2531..6667c182b 100644 --- a/meta-digi-dey/recipes-connectivity/xbee/xbee.bb +++ b/meta-digi-dey/recipes-connectivity/xbee/xbee.bb @@ -1,4 +1,4 @@ -# Copyright (C) 2019-2022, Digi International Inc. +# Copyright (C) 2019-2023, Digi International Inc. SUMMARY = "Digi XBee initialization" DESCRIPTION = "Initialization scripts for XBee hardware of Digi boards" @@ -42,4 +42,4 @@ SYSTEMD_PACKAGES = "${PN}-init" SYSTEMD_SERVICE:${PN}-init = "xbee-init.service" PACKAGE_ARCH = "${MACHINE_ARCH}" -COMPATIBLE_MACHINE = "(ccimx8x|ccimx8m|ccimx93)" +COMPATIBLE_MACHINE = "(ccimx8m|ccimx8x|ccimx93)" 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 b200c71a7..432602888 100644 --- a/meta-digi-dey/recipes-core/busybox/busybox/ccimx93/standby-actions +++ b/meta-digi-dey/recipes-core/busybox/busybox/ccimx93/standby-actions @@ -3,7 +3,7 @@ # # standby-actions # -# Copyright (C) 2023 by Digi International Inc. +# Copyright (C) 2023, 2024 by Digi International Inc. # All rights reserved. # # This program is free software; you can redistribute it and/or modify it @@ -18,38 +18,47 @@ RESUME_ACTIONS="/tmp/resume_actions" -actions_needed() { +wifi_actions_needed() { [ -d "/proc/device-tree/wireless" ] && [ ! -e "/sys/firmware/devicetree/base/soc@0/bus@42800000/mmc@428b0000/keep-power-in-suspend" ] } +bt_actions_needed() { + systemctl -q is-active bluetooth-init +} + if [ "${1}" = "pre" ]; then + rm -f "${RESUME_ACTIONS}" + # Stop NetworkManager before suspend systemctl stop NetworkManager - if actions_needed; then - rm -f "${RESUME_ACTIONS}" + if wifi_actions_needed; then for iface in wlan0 uap0 wfd0; do if grep -qs ${iface} /var/run/ifstate; then ifdown ${iface} && echo "ifup ${iface}" >> "${RESUME_ACTIONS}" fi done - rmmod moal - rmmod mlan + { + echo "sleep 0.5" + echo "/etc/udev/scripts/load_iw612.sh" + } >> "${RESUME_ACTIONS}" + modprobe -r moal + fi - 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 - fi + if bt_actions_needed; then + # bluetooth service relies on bluetooth-init service, so stop/start it unconditionally + { + echo "systemctl start bluetooth-init" + echo "systemctl start bluetooth" + } >> "${RESUME_ACTIONS}" + systemctl stop bluetooth-init + systemctl stop bluetooth fi elif [ "${1}" = "post" ]; then - if actions_needed; then - /etc/udev/scripts/load_iw612.sh - sleep 0.5 - sh "${RESUME_ACTIONS}" + if [ -f ${RESUME_ACTIONS} ]; then + chmod +x "${RESUME_ACTIONS}" + eval "${RESUME_ACTIONS}" rm -f "${RESUME_ACTIONS}" fi diff --git a/meta-digi-dey/recipes-core/images/dey-image-lvgl.bb b/meta-digi-dey/recipes-core/images/dey-image-lvgl.bb new file mode 100644 index 000000000..7d0fc83e9 --- /dev/null +++ b/meta-digi-dey/recipes-core/images/dey-image-lvgl.bb @@ -0,0 +1,8 @@ +# +# Copyright (C) 2023 Digi International. +# +require dey-image-graphical.inc + +DESCRIPTION = "DEY image with LVGL graphical libraries" + +GRAPHICAL_CORE = "lvgl" diff --git a/meta-digi-dey/recipes-core/images/dey-image-recovery-initramfs.bb b/meta-digi-dey/recipes-core/images/dey-image-recovery-initramfs.bb index 32d04995a..e8b06aeb9 100644 --- a/meta-digi-dey/recipes-core/images/dey-image-recovery-initramfs.bb +++ b/meta-digi-dey/recipes-core/images/dey-image-recovery-initramfs.bb @@ -1,4 +1,4 @@ -# Copyright (C) 2016-2020, Digi International Inc. +# Copyright (C) 2016-2023, Digi International Inc. DESCRIPTION = "Recovery initramfs image" LICENSE = "MIT" @@ -12,7 +12,7 @@ PACKAGE_INSTALL = " \ recovery-initramfs \ swupdate \ trustfence-tool \ - wipe \ + ${@bb.utils.contains('DEY_SOC_VENDOR', 'NXP', bb.utils.contains('STORAGE_MEDIA', 'mtd', 'imx-kobs', '', d), '', d)} \ " # Do not pollute the initrd image with rootfs features @@ -31,6 +31,7 @@ IMAGE_ROOTFS_SIZE = "8192" BAD_RECOMMENDATIONS += " \ openssl-bin \ openssl-conf \ + openssl-ossl-module-legacy \ " export IMAGE_BASENAME = "dey-image-recovery-initramfs" diff --git a/meta-digi-dey/recipes-core/images/dey-image-trustfence-initramfs.bb b/meta-digi-dey/recipes-core/images/dey-image-trustfence-initramfs.bb index 303b22728..7b06405f1 100644 --- a/meta-digi-dey/recipes-core/images/dey-image-trustfence-initramfs.bb +++ b/meta-digi-dey/recipes-core/images/dey-image-trustfence-initramfs.bb @@ -19,6 +19,7 @@ IMAGE_ROOTFS_SIZE = "8192" # Remove some packages added via recommendations BAD_RECOMMENDATIONS += " \ openssl-conf \ + openssl-ossl-module-legacy \ " export IMAGE_BASENAME = "dey-image-trustfence-initramfs" diff --git a/meta-digi-dey/recipes-core/recovery/recovery-initramfs.bb b/meta-digi-dey/recipes-core/recovery/recovery-initramfs.bb index afb16da69..391e7ba61 100644 --- a/meta-digi-dey/recipes-core/recovery/recovery-initramfs.bb +++ b/meta-digi-dey/recipes-core/recovery/recovery-initramfs.bb @@ -14,7 +14,6 @@ DEPENDS += "${@oe.utils.conditional('TRUSTFENCE_SIGN', '1', \ SRC_URI = " \ file://recovery-initramfs-init \ - file://swupdate.cfg \ file://automount_block.sh \ file://automount_mtd.sh \ file://automount_ubi.sh \ @@ -27,7 +26,6 @@ S = "${WORKDIR}" do_install() { install -d ${D}${sysconfdir} install -m 0755 ${WORKDIR}/recovery-initramfs-init ${D}/init - install -m 0644 ${WORKDIR}/swupdate.cfg ${D}${sysconfdir} if [ "${STORAGE_MEDIA}" = "mmc" ]; then install -m 0755 ${WORKDIR}/mount_cryptrootfs.sh ${D}${sysconfdir} fi diff --git a/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init b/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init index 0e64cf8c5..1bde325b3 100644 --- a/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init +++ b/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init @@ -20,7 +20,7 @@ ENV_BOOT_RECOVERY="boot_recovery" ENV_RECOVERY_COMMAND="recovery_command" -SW_CONFIG="/etc/swupdate.cfg" +SW_CONFIG="/etc/swupdate.config" PUBLIC_KEY="/etc/ssl/certs/key.pub" USB_MOUNT_DIR="/run/media" diff --git a/meta-digi-dey/recipes-core/recovery/recovery-initramfs/swupdate.cfg b/meta-digi-dey/recipes-core/recovery/recovery-initramfs/swupdate.cfg deleted file mode 100644 index 2a63bee87..000000000 --- a/meta-digi-dey/recipes-core/recovery/recovery-initramfs/swupdate.cfg +++ /dev/null @@ -1,7 +0,0 @@ -globals : -{ - verbose = true; - loglevel = 5; - syslog = true; - mtd-blacklist = "0 1 2"; -}; diff --git a/meta-digi-dey/recipes-core/trustfence/trustfence-initramfs.bb b/meta-digi-dey/recipes-core/trustfence/trustfence-initramfs.bb index 673017e47..d92412e64 100644 --- a/meta-digi-dey/recipes-core/trustfence/trustfence-initramfs.bb +++ b/meta-digi-dey/recipes-core/trustfence/trustfence-initramfs.bb @@ -1,4 +1,4 @@ -# Copyright (C) 2016-2022, Digi International Inc. +# Copyright (C) 2016-2023, Digi International Inc. SUMMARY = "Trustfence initramfs required files" LICENSE = "GPL-2.0-only" @@ -23,8 +23,7 @@ RDEPENDS:${PN} = " \ cryptsetup \ trustfence-tool \ util-linux-findfs \ - wipe \ " PACKAGE_ARCH = "${MACHINE_ARCH}" -COMPATIBLE_MACHINE = "(ccimx6|ccimx8x|ccimx8m)" +COMPATIBLE_MACHINE = "(ccimx6|ccimx8m|ccimx8x|ccimx93)" diff --git a/meta-digi-dey/recipes-devtools/meson/meson/0001-Check-for-clang-before-guessing-gcc-or-lcc.patch b/meta-digi-dey/recipes-devtools/meson/meson/0001-Check-for-clang-before-guessing-gcc-or-lcc.patch new file mode 100644 index 000000000..58fa11943 --- /dev/null +++ b/meta-digi-dey/recipes-devtools/meson/meson/0001-Check-for-clang-before-guessing-gcc-or-lcc.patch @@ -0,0 +1,56 @@ +From 8739e1c3bef653415ad4b9b9c318ccfa76c43da6 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 31 Mar 2022 15:00:24 -0700 +Subject: [PATCH] Check for clang before guessing gcc or lcc + +clang --version can yield a string like below when its installed into +such a directory + +clang version 14.0.0 (https://github.com/llvm/llvm-project 3f43d803382d57e3fc010ca19833077d1023e9c9) +Target: aarch64-yoe-linux +Thread model: posix +InstalledDir: /mnt/b/yoe/master/build/tmp/work/cortexa72-yoe-linux/gnome-text-editor/42.0-r0/recipe-sysroot-native/usr/bin/aarch64-yoe-linux + +as you can see InstallDir has 'xt-' subtring and this trips the check to +guess gcc + +if 'Free Software Foundation' in out or 'xt-' in out: + +Therefore, check if compiler is clang then there is no point of running +this check anyway. + +Upstream-Status: Submitted [https://github.com/mesonbuild/meson/pull/10218] +Signed-off-by: Khem Raj +--- + mesonbuild/compilers/detect.py | 15 ++++++++------- + 1 file changed, 8 insertions(+), 7 deletions(-) + +diff --git a/mesonbuild/compilers/detect.py b/mesonbuild/compilers/detect.py +index 53948b01a..ba335cf39 100644 +--- a/mesonbuild/compilers/detect.py ++++ b/mesonbuild/compilers/detect.py +@@ -427,13 +427,14 @@ def _detect_c_or_cpp_compiler(env: 'Environment', lang: str, for_machine: Machin + version = search_version(out) + + guess_gcc_or_lcc: T.Optional[str] = None +- if 'Free Software Foundation' in out or 'xt-' in out: +- guess_gcc_or_lcc = 'gcc' +- if 'e2k' in out and 'lcc' in out: +- guess_gcc_or_lcc = 'lcc' +- if 'Microchip Technology' in out: +- # this output has "Free Software Foundation" in its version +- guess_gcc_or_lcc = None ++ if not 'clang' in compiler_name: ++ if 'Free Software Foundation' in out or 'xt-' in out: ++ guess_gcc_or_lcc = 'gcc' ++ if 'e2k' in out and 'lcc' in out: ++ guess_gcc_or_lcc = 'lcc' ++ if 'Microchip Technology' in out: ++ # this output has "Free Software Foundation" in its version ++ guess_gcc_or_lcc = None + + if guess_gcc_or_lcc: + defines = _get_gnu_compiler_defines(compiler) +-- +2.35.1 + diff --git a/meta-digi-dey/recipes-devtools/meson/meson/0001-Make-CPU-family-warnings-fatal.patch b/meta-digi-dey/recipes-devtools/meson/meson/0001-Make-CPU-family-warnings-fatal.patch new file mode 100644 index 000000000..848dccfbe --- /dev/null +++ b/meta-digi-dey/recipes-devtools/meson/meson/0001-Make-CPU-family-warnings-fatal.patch @@ -0,0 +1,45 @@ +From 6c4eef1d92e9e42fdbc888365cab3c95fb33c605 Mon Sep 17 00:00:00 2001 +From: Ross Burton +Date: Tue, 3 Jul 2018 13:59:09 +0100 +Subject: [PATCH] Make CPU family warnings fatal + +Upstream-Status: Inappropriate [OE specific] +Signed-off-by: Ross Burton + +--- + mesonbuild/envconfig.py | 2 +- + mesonbuild/environment.py | 4 +--- + 2 files changed, 2 insertions(+), 4 deletions(-) + +Index: meson-0.60.2/mesonbuild/envconfig.py +=================================================================== +--- meson-0.60.2.orig/mesonbuild/envconfig.py ++++ meson-0.60.2/mesonbuild/envconfig.py +@@ -266,8 +266,8 @@ class MachineInfo(HoldableObject): + 'but is missing {}.'.format(minimum_literal - set(literal))) + + cpu_family = literal['cpu_family'] +- if cpu_family not in known_cpu_families: +- mlog.warning(f'Unknown CPU family {cpu_family}, please report this at https://github.com/mesonbuild/meson/issues/new') ++ if cpu_family not in known_cpu_families and cpu_family != "riscv": ++ raise EnvironmentException('Unknown CPU family {}, see https://wiki.yoctoproject.org/wiki/Meson/UnknownCPU for directions.'.format(cpu_family)) + + endian = literal['endian'] + if endian not in ('little', 'big'): +Index: meson-0.60.2/mesonbuild/environment.py +=================================================================== +--- meson-0.60.2.orig/mesonbuild/environment.py ++++ meson-0.60.2/mesonbuild/environment.py +@@ -354,10 +354,8 @@ def detect_cpu_family(compilers: Compile + if any_compiler_has_define(compilers, '__64BIT__'): + trial = 'ppc64' + +- if trial not in known_cpu_families: +- mlog.warning(f'Unknown CPU family {trial!r}, please report this at ' +- 'https://github.com/mesonbuild/meson/issues/new with the ' +- 'output of `uname -a` and `cat /proc/cpuinfo`') ++ if trial not in known_cpu_families and trail != "riscv": ++ raise EnvironmentException('Unknown CPU family %s, see https://wiki.yoctoproject.org/wiki/Meson/UnknownCPU for directions.' % trial) + + return trial + diff --git a/meta-digi-dey/recipes-devtools/meson/meson/0001-python-module-do-not-manipulate-the-environment-when.patch b/meta-digi-dey/recipes-devtools/meson/meson/0001-python-module-do-not-manipulate-the-environment-when.patch new file mode 100644 index 000000000..f01a66781 --- /dev/null +++ b/meta-digi-dey/recipes-devtools/meson/meson/0001-python-module-do-not-manipulate-the-environment-when.patch @@ -0,0 +1,37 @@ +From 2e9582167bf9d3273004edb2637310531f0155ab Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin +Date: Mon, 19 Nov 2018 14:24:26 +0100 +Subject: [PATCH] python module: do not manipulate the environment when calling + pkg-config + +Upstream-Status: Inappropriate [oe-core specific] +Signed-off-by: Alexander Kanavin + +--- + mesonbuild/modules/python.py | 6 +----- + 1 file changed, 1 insertion(+), 5 deletions(-) + +diff --git a/mesonbuild/modules/python.py b/mesonbuild/modules/python.py +index 3bbccd1..fda7a25 100644 +--- a/mesonbuild/modules/python.py ++++ b/mesonbuild/modules/python.py +@@ -277,9 +277,6 @@ def python_factory(env: 'Environment', for_machine: 'MachineChoice', + # there is no LIBPC, so we can't search in it + return NotFoundDependency('python', env) + +- old_pkg_libdir = os.environ.pop('PKG_CONFIG_LIBDIR', None) +- old_pkg_path = os.environ.pop('PKG_CONFIG_PATH', None) +- os.environ['PKG_CONFIG_LIBDIR'] = pkg_libdir + try: + return PythonPkgConfigDependency(name, env, kwargs, installation, True) + finally: +@@ -288,8 +285,7 @@ def python_factory(env: 'Environment', for_machine: 'MachineChoice', + os.environ[name] = value + elif name in os.environ: + del os.environ[name] +- set_env('PKG_CONFIG_LIBDIR', old_pkg_libdir) +- set_env('PKG_CONFIG_PATH', old_pkg_path) ++ pass + + candidates.append(functools.partial(wrap_in_pythons_pc_dir, pkg_name, env, kwargs, installation)) + # We only need to check both, if a python install has a LIBPC. It might point to the wrong location, diff --git a/meta-digi-dey/recipes-devtools/meson/meson/0002-Support-building-allarch-recipes-again.patch b/meta-digi-dey/recipes-devtools/meson/meson/0002-Support-building-allarch-recipes-again.patch new file mode 100644 index 000000000..dcc1ce9c2 --- /dev/null +++ b/meta-digi-dey/recipes-devtools/meson/meson/0002-Support-building-allarch-recipes-again.patch @@ -0,0 +1,28 @@ +From 656bf55fed01df2d2e2ad6d9d9887173cb16b85c Mon Sep 17 00:00:00 2001 +From: Peter Kjellerstedt +Date: Thu, 26 Jul 2018 16:32:49 +0200 +Subject: [PATCH 2/2] Support building allarch recipes again + +This registers "allarch" as a known CPU family. + +Upstream-Status: Inappropriate [OE specific] +Signed-off-by: Peter Kjellerstedt +--- + mesonbuild/envconfig.py | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/mesonbuild/envconfig.py b/mesonbuild/envconfig.py +index 4d58c91..ff01ad1 100644 +--- a/mesonbuild/envconfig.py ++++ b/mesonbuild/envconfig.py +@@ -36,6 +36,7 @@ from pathlib import Path + + + known_cpu_families = ( ++ 'allarch', + 'aarch64', + 'alpha', + 'arc', +-- +2.24.0 + diff --git a/meta-digi-dey/recipes-devtools/meson/meson/meson-setup.py b/meta-digi-dey/recipes-devtools/meson/meson/meson-setup.py new file mode 100755 index 000000000..daaa551de --- /dev/null +++ b/meta-digi-dey/recipes-devtools/meson/meson/meson-setup.py @@ -0,0 +1,43 @@ +#!/usr/bin/env python3 + +import os +import string +import sys + +class Template(string.Template): + delimiter = "@" + +class Environ(): + def __getitem__(self, name): + val = os.environ[name] + val = val.split() + if len(val) > 1: + val = ["'%s'" % x for x in val] + val = ', '.join(val) + val = '[%s]' % val + elif val: + val = "'%s'" % val.pop() + return val + +try: + sysroot = os.environ['OECORE_NATIVE_SYSROOT'] +except KeyError: + print("Not in environment setup, bailing") + sys.exit(1) + +template_file = os.path.join(sysroot, 'usr/share/meson/meson.cross.template') +cross_file = os.path.join(sysroot, 'usr/share/meson/%smeson.cross' % os.environ["TARGET_PREFIX"]) +native_template_file = os.path.join(sysroot, 'usr/share/meson/meson.native.template') +native_file = os.path.join(sysroot, 'usr/share/meson/meson.native') + +with open(template_file) as in_file: + template = in_file.read() + output = Template(template).substitute(Environ()) + with open(cross_file, "w") as out_file: + out_file.write(output) + +with open(native_template_file) as in_file: + template = in_file.read() + output = Template(template).substitute({'OECORE_NATIVE_SYSROOT': os.environ['OECORE_NATIVE_SYSROOT']}) + with open(native_file, "w") as out_file: + out_file.write(output) diff --git a/meta-digi-dey/recipes-devtools/meson/meson/meson-wrapper b/meta-digi-dey/recipes-devtools/meson/meson/meson-wrapper new file mode 100755 index 000000000..745598529 --- /dev/null +++ b/meta-digi-dey/recipes-devtools/meson/meson/meson-wrapper @@ -0,0 +1,31 @@ +#!/bin/sh + +if [ -z "$OECORE_NATIVE_SYSROOT" ]; then + exec "meson.real" "$@" +fi + +if [ -z "$SSL_CERT_DIR" ]; then + export SSL_CERT_DIR="$OECORE_NATIVE_SYSROOT/etc/ssl/certs/" +fi + +# If these are set to a cross-compile path, meson will get confused and try to +# use them as native tools. Unset them to prevent this, as all the cross-compile +# config is already in meson.cross. +unset CC CXX CPP LD AR NM STRIP + +case "$1" in +setup|configure|dist|install|introspect|init|test|wrap|subprojects|rewrite|compile|devenv|env2mfile|help) MESON_CMD="$1" ;; +*) echo meson-wrapper: Implicit setup command assumed; MESON_CMD=setup ;; +esac + +if [ "$MESON_CMD" = "setup" ]; then + MESON_SETUP_OPTS=" \ + --cross-file="$OECORE_NATIVE_SYSROOT/usr/share/meson/${TARGET_PREFIX}meson.cross" \ + --native-file="$OECORE_NATIVE_SYSROOT/usr/share/meson/meson.native" \ + " + echo meson-wrapper: Running meson with setup options: \"$MESON_SETUP_OPTS\" +fi + +exec "$OECORE_NATIVE_SYSROOT/usr/bin/meson.real" \ + "$@" \ + $MESON_SETUP_OPTS diff --git a/meta-digi-dey/recipes-devtools/meson/meson_1.0.1.bb b/meta-digi-dey/recipes-devtools/meson/meson_1.0.1.bb new file mode 100644 index 000000000..6ff0b0745 --- /dev/null +++ b/meta-digi-dey/recipes-devtools/meson/meson_1.0.1.bb @@ -0,0 +1,157 @@ +HOMEPAGE = "http://mesonbuild.com" +SUMMARY = "A high performance build system" +DESCRIPTION = "Meson is a build system designed to increase programmer \ +productivity. It does this by providing a fast, simple and easy to use \ +interface for modern software development tools and practices." + +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://COPYING;md5=3b83ef96387f14655fc854ddc3c6bd57" + +GITHUB_BASE_URI = "https://github.com/mesonbuild/meson/releases/" +SRC_URI = "${GITHUB_BASE_URI}/download/${PV}/meson-${PV}.tar.gz \ + file://meson-setup.py \ + file://meson-wrapper \ + file://0001-python-module-do-not-manipulate-the-environment-when.patch \ + file://0001-Make-CPU-family-warnings-fatal.patch \ + file://0002-Support-building-allarch-recipes-again.patch \ + file://0001-Check-for-clang-before-guessing-gcc-or-lcc.patch \ + " +SRC_URI[sha256sum] = "d926b730de6f518728cc7c57bc5e701667bae0c3522f9e369427b2cc7839d3c1" + +# Removed 'github-releases' as it does not exist on Kirkstone +inherit python_setuptools_build_meta + +RDEPENDS:${PN} = "ninja python3-modules python3-pkg-resources" + +FILES:${PN} += "${datadir}/polkit-1" + +do_install:append () { + # As per the same issue in the python recipe itself: + # Unfortunately the following pyc files are non-deterministc due to 'frozenset' + # being written without strict ordering, even with PYTHONHASHSEED = 0 + # Upstream is discussing ways to solve the issue properly, until then let's + # just not install the problematic files. + # More info: http://benno.id.au/blog/2013/01/15/python-determinism + rm ${D}${libdir}/python*/site-packages/mesonbuild/dependencies/__pycache__/mpi.cpython* +} + +BBCLASSEXTEND = "native nativesdk" + +inherit meson-routines + +# The cross file logic is similar but not identical to that in meson.bbclass, +# since it's generating for an SDK rather than a cross-compile. Important +# differences are: +# - We can't set vars like CC, CXX, etc. yet because they will be filled in with +# real paths by meson-setup.sh when the SDK is extracted. +# - Some overrides aren't needed, since the SDK injects paths that take care of +# them. +def var_list2str(var, d): + items = d.getVar(var).split() + return items[0] if len(items) == 1 else ', '.join(repr(s) for s in items) + +def generate_native_link_template(d): + val = ['-L@{OECORE_NATIVE_SYSROOT}${libdir_native}', + '-L@{OECORE_NATIVE_SYSROOT}${base_libdir_native}', + '-Wl,-rpath-link,@{OECORE_NATIVE_SYSROOT}${libdir_native}', + '-Wl,-rpath-link,@{OECORE_NATIVE_SYSROOT}${base_libdir_native}', + '-Wl,--allow-shlib-undefined' + ] + build_arch = d.getVar('BUILD_ARCH') + if 'x86_64' in build_arch: + loader = 'ld-linux-x86-64.so.2' + elif 'i686' in build_arch: + loader = 'ld-linux.so.2' + elif 'aarch64' in build_arch: + loader = 'ld-linux-aarch64.so.1' + elif 'ppc64le' in build_arch: + loader = 'ld64.so.2' + elif 'loongarch64' in build_arch: + loader = 'ld-linux-loongarch-lp64d.so.1' + + if loader: + val += ['-Wl,--dynamic-linker=@{OECORE_NATIVE_SYSROOT}${base_libdir_native}/' + loader] + + return repr(val) + +install_templates() { + install -d ${D}${datadir}/meson + + cat >${D}${datadir}/meson/meson.native.template <${D}${datadir}/meson/meson.cross.template </dev/null)" = "yes" ]; then - sed -i "/firmware_download_path = \/mnt\/update/c\firmware_download_path = \/home\/root" /etc/cccs.conf + if [ -n "${CCCS_CONF_PATH}" ]; then + CONF="${CCCS_CONF_PATH}" + if [ "${CONF#file://}" != "${CONF}" ]; then + CONF="${CONF#file://}" + elif [ "${CONF#/}" != "${CONF}" ]; then + CONF="${CONF}" + else + CONF="${WORKDIR}/$(basename ${CONF})" + fi + install -m 0644 "${CONF}" ${D}${sysconfdir}/cccs.conf + else + # Set the device type. Its maximum length is 255 characters + [ -z "${CCCS_DEVICE_TYPE}" ] && device_type="${MACHINE}" || device_type="${CCCS_DEVICE_TYPE}" + device_type="$(echo "${device_type}" | cut -c1-255)" + sed -i "/device_type = .*/c\device_type = \"${device_type}\"" ${D}${sysconfdir}/cccs.conf fi } -inherit ${@bb.utils.contains("IMAGE_FEATURES", "read-only-rootfs", "remove-pkg-postinst-ontarget", "", d)} +do_install:append:ccimx6ul() { + if [ -z "${CCCS_CONF_PATH}" ]; then + sed -i "/url = \"edp12.devicecloud.com\"/c\url = \"remotemanager.digi.com\"" ${D}${sysconfdir}/cccs.conf + sed -i "/client_cert_path = \"\/mnt\/data\/drm_cert.pem\"/c\client_cert_path = \"\/etc\/ssl\/certs\/drm_cert.pem\"" ${D}${sysconfdir}/cccs.conf + fi +} + +pkg_postinst_ontarget:${PN}() { + # If dualboot is enabled, change the CCCSD download path and set on the fly to yes on the first boot + if [ "$(fw_printenv -n dualboot 2>/dev/null)" = "yes" ]; then + sed -i "/firmware_download_path = \/mnt\/update/c\firmware_download_path = \/home\/root" /etc/cccs.conf + sed -i "/on_the_fly = false/c\on_the_fly = true" /etc/cccs.conf + fi +} + +inherit ${@bb.utils.contains("IMAGE_FEATURES", "read-only-rootfs", "remove-pkg-postinst-ontarget", \ + oe.utils.ifelse(d.getVar("CCCS_CONF_PATH"), "remove-pkg-postinst-ontarget", ""), d)} INITSCRIPT_PACKAGES = "${PN}-daemon ${PN}-gs-demo" INITSCRIPT_NAME:${PN}-daemon = "cccsd" diff --git a/meta-digi-dey/recipes-digi/dey-examples/connectcore-demo-example.inc b/meta-digi-dey/recipes-digi/dey-examples/connectcore-demo-example.inc index 9fbf094b6..707d26ae8 100644 --- a/meta-digi-dey/recipes-digi/dey-examples/connectcore-demo-example.inc +++ b/meta-digi-dey/recipes-digi/dey-examples/connectcore-demo-example.inc @@ -11,6 +11,7 @@ LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0-only;md5=801f80980d171d SRC_URI += " \ file://connectcore-demo-server-init \ file://connectcore-demo-server.service \ + file://suspendtarget-connectcore-demo-server.service \ " RDEPENDS:${PN}-server = " \ @@ -41,6 +42,7 @@ do_install() { # Install systemd unit files install -d ${D}${systemd_unitdir}/system install -m 0644 ${WORKDIR}/connectcore-demo-server.service ${D}${systemd_unitdir}/system/ + install -m 0644 ${WORKDIR}/suspendtarget-connectcore-demo-server.service ${D}${systemd_unitdir}/system/ fi # Install connectcore-demo-server-init @@ -72,6 +74,7 @@ FILES:${PN}-multimedia += " \ FILES:${PN}-server = " \ /srv/www/demoserver.py \ ${systemd_unitdir}/system/connectcore-demo-server.service \ + ${systemd_unitdir}/system/suspendtarget-connectcore-demo-server.service \ ${sysconfdir}/connectcore-demo-server \ ${sysconfdir}/init.d/connectcore-demo-server \ " @@ -88,6 +91,9 @@ INITSCRIPT_NAME:${PN}-server = "connectcore-demo-server" INITSCRIPT_PARAMS:${PN}-server = "start 20 2 3 4 5 . stop 21 0 1 6 ." SYSTEMD_PACKAGES = "${PN}-server" -SYSTEMD_SERVICE:${PN}-server = "connectcore-demo-server.service" +SYSTEMD_SERVICE:${PN}-server = " \ + connectcore-demo-server.service \ + suspendtarget-connectcore-demo-server.service \ +" PACKAGE_ARCH = "${MACHINE_ARCH}" diff --git a/meta-digi-dey/recipes-digi/dey-examples/connectcore-demo-example/suspendtarget-connectcore-demo-server.service b/meta-digi-dey/recipes-digi/dey-examples/connectcore-demo-example/suspendtarget-connectcore-demo-server.service new file mode 100644 index 000000000..390537974 --- /dev/null +++ b/meta-digi-dey/recipes-digi/dey-examples/connectcore-demo-example/suspendtarget-connectcore-demo-server.service @@ -0,0 +1,11 @@ +[Unit] +Description=Restart ConnectCore demo server after suspend if running +After=suspend.target + +[Service] +Type=simple +# try-restart: only restart if it is running +ExecStart=/bin/systemctl --no-block try-restart connectcore-demo-server + +[Install] +WantedBy=suspend.target diff --git a/meta-digi-dey/recipes-digi/dey-examples/dey-examples-adc-cmp.bb b/meta-digi-dey/recipes-digi/dey-examples/dey-examples-adc-cmp.bb index bf8275cb2..4822a3272 100644 --- a/meta-digi-dey/recipes-digi/dey-examples/dey-examples-adc-cmp.bb +++ b/meta-digi-dey/recipes-digi/dey-examples/dey-examples-adc-cmp.bb @@ -1,4 +1,4 @@ -# Copyright (C) 2017-2022, Digi International Inc. +# Copyright (C) 2017-2023, Digi International Inc. SUMMARY = "DEY examples: Analog Comparator test application" SECTION = "examples" @@ -15,4 +15,4 @@ do_install() { } PACKAGE_ARCH = "${MACHINE_ARCH}" -COMPATIBLE_MACHINE = "(ccimx6ul|ccimx8x|ccimx8m)" +COMPATIBLE_MACHINE = "(ccimx6ul|ccimx8m|ccimx8x)" diff --git a/meta-digi-dey/recipes-digi/dey-examples/dey-examples-cryptochip.bb b/meta-digi-dey/recipes-digi/dey-examples/dey-examples-cryptochip.bb index 83ee98caf..47b8d3218 100644 --- a/meta-digi-dey/recipes-digi/dey-examples/dey-examples-cryptochip.bb +++ b/meta-digi-dey/recipes-digi/dey-examples/dey-examples-cryptochip.bb @@ -1,4 +1,4 @@ -# Copyright (C) 2017-2022, Digi International Inc. +# Copyright (C) 2017-2023, Digi International Inc. require recipes-digi/dey-examples/dey-examples-src.inc @@ -18,4 +18,4 @@ do_install() { } PACKAGE_ARCH = "${MACHINE_ARCH}" -COMPATIBLE_MACHINE = "(ccimx6qpsbc|ccimx6ul|ccimx8x|ccimx8m)" +COMPATIBLE_MACHINE = "(ccimx6qpsbc|ccimx6ul|ccimx8m|ccimx8x)" diff --git a/meta-digi-dey/recipes-digi/dualboot/dualboot/update-firmware b/meta-digi-dey/recipes-digi/dualboot/dualboot/update-firmware index 4fbabc52a..136109d65 100755 --- a/meta-digi-dey/recipes-digi/dualboot/dualboot/update-firmware +++ b/meta-digi-dey/recipes-digi/dualboot/dualboot/update-firmware @@ -77,8 +77,8 @@ get_active_system() { 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})" + if [ "$(stat -c"%02t%02T" "$(realpath "${label}")")" = "${MMCROOT_DEV}" ]; then + ACTIVE_SYSTEM="$(basename "${label}")" break fi done @@ -89,7 +89,7 @@ get_active_system() { return 1 fi - ACTIVE_SYSTEM="$(echo ${ACTIVE_SYSTEM} | cut -d_ -f2)" + ACTIVE_SYSTEM="${ACTIVE_SYSTEM##*_}" return 0 } diff --git a/meta-digi-dey/recipes-digi/packagegroups/packagegroup-dey-examples.bb b/meta-digi-dey/recipes-digi/packagegroups/packagegroup-dey-examples.bb index 507429885..e3943fa24 100644 --- a/meta-digi-dey/recipes-digi/packagegroups/packagegroup-dey-examples.bb +++ b/meta-digi-dey/recipes-digi/packagegroups/packagegroup-dey-examples.bb @@ -27,4 +27,4 @@ RDEPENDS:${PN}:append:ccimx6 = "\ dey-examples-v4l2 \ " -COMPATIBLE_MACHINE = "(ccimx6$|ccimx6ul|ccimx8x|ccimx8m)" +COMPATIBLE_MACHINE = "(ccimx6$|ccimx6ul|ccimx8m|ccimx8x)" diff --git a/meta-digi-dey/recipes-digi/swu-images/dey-image-lvgl-swu.bb b/meta-digi-dey/recipes-digi/swu-images/dey-image-lvgl-swu.bb new file mode 100644 index 000000000..e402e85ad --- /dev/null +++ b/meta-digi-dey/recipes-digi/swu-images/dey-image-lvgl-swu.bb @@ -0,0 +1,5 @@ +# Copyright (C) 2023 Digi International Inc. + +require swu.inc + +IMG_NAME = "${@get_baseimg_pn(d)}-${GRAPHICAL_BACKEND}" diff --git a/meta-digi-dey/recipes-digi/swu-images/files/ccimx6ul/sw-description-images_template b/meta-digi-dey/recipes-digi/swu-images/files/ccimx6ul/sw-description-images_template index d617686f8..006595b9a 100644 --- a/meta-digi-dey/recipes-digi/swu-images/files/ccimx6ul/sw-description-images_template +++ b/meta-digi-dey/recipes-digi/swu-images/files/ccimx6ul/sw-description-images_template @@ -8,11 +8,14 @@ software = images: ( ##IMAGES_PRIMARY## ); + ##FILES_UBOOT## scripts: ( { filename = "@@SWUPDATE_SCRIPT_NAME@@"; + sha256 = "$swupdate_get_sha256(@@SWUPDATE_SCRIPT_NAME@@)"; type = "shellscript"; } + ##SCRIPT_UBOOT## ); uboot: ( { @@ -25,11 +28,14 @@ software = images: ( ##IMAGES_SECONDARY## ); + ##FILES_UBOOT## scripts: ( { filename = "@@SWUPDATE_SCRIPT_NAME@@"; + sha256 = "$swupdate_get_sha256(@@SWUPDATE_SCRIPT_NAME@@)"; type = "shellscript"; } + ##SCRIPT_UBOOT## ); uboot: ( { @@ -42,11 +48,14 @@ software = images: ( ##IMAGES_SINGLE## ); + ##FILES_UBOOT## scripts: ( { filename = "@@SWUPDATE_SCRIPT_NAME@@"; + sha256 = "$swupdate_get_sha256(@@SWUPDATE_SCRIPT_NAME@@)"; type = "shellscript"; } + ##SCRIPT_UBOOT## ); uboot: ( { diff --git a/meta-digi-dey/recipes-digi/swu-images/files/ccmp1/sw-description-images_template b/meta-digi-dey/recipes-digi/swu-images/files/ccmp1/sw-description-images_template index 0cc414a85..006595b9a 100644 --- a/meta-digi-dey/recipes-digi/swu-images/files/ccmp1/sw-description-images_template +++ b/meta-digi-dey/recipes-digi/swu-images/files/ccmp1/sw-description-images_template @@ -8,17 +8,16 @@ software = images: ( ##IMAGES_PRIMARY## ); + ##FILES_UBOOT## scripts: ( { filename = "@@SWUPDATE_SCRIPT_NAME@@"; + sha256 = "$swupdate_get_sha256(@@SWUPDATE_SCRIPT_NAME@@)"; type = "shellscript"; } + ##SCRIPT_UBOOT## ); uboot: ( - { - name = "upgrade_available"; - value = "1"; - }, { name = "rootfstype" value = "@@SWUPDATE_ROOTFS_TYPE@@" @@ -29,17 +28,16 @@ software = images: ( ##IMAGES_SECONDARY## ); + ##FILES_UBOOT## scripts: ( { filename = "@@SWUPDATE_SCRIPT_NAME@@"; + sha256 = "$swupdate_get_sha256(@@SWUPDATE_SCRIPT_NAME@@)"; type = "shellscript"; } + ##SCRIPT_UBOOT## ); uboot: ( - { - name = "upgrade_available"; - value = "1"; - }, { name = "rootfstype" value = "@@SWUPDATE_ROOTFS_TYPE@@" @@ -50,11 +48,14 @@ software = images: ( ##IMAGES_SINGLE## ); + ##FILES_UBOOT## scripts: ( { filename = "@@SWUPDATE_SCRIPT_NAME@@"; + sha256 = "$swupdate_get_sha256(@@SWUPDATE_SCRIPT_NAME@@)"; type = "shellscript"; } + ##SCRIPT_UBOOT## ); uboot: ( { diff --git a/meta-digi-dey/recipes-digi/swu-images/files/file_template_uboot b/meta-digi-dey/recipes-digi/swu-images/files/file_template_uboot new file mode 100644 index 000000000..b50c47257 --- /dev/null +++ b/meta-digi-dey/recipes-digi/swu-images/files/file_template_uboot @@ -0,0 +1,5 @@ + { + filename = "##FILE_NAME##"; + path = "##FILE_PATH##"; + sha256 = "$swupdate_get_sha256(##FILE_NAME##)"; + } diff --git a/meta-digi-dey/recipes-digi/swu-images/files/script_template_uboot b/meta-digi-dey/recipes-digi/swu-images/files/script_template_uboot new file mode 100644 index 000000000..061b3e493 --- /dev/null +++ b/meta-digi-dey/recipes-digi/swu-images/files/script_template_uboot @@ -0,0 +1,6 @@ + { + filename = "@@SWUPDATE_UBOOT_SCRIPT_NAME@@"; + type = "preinstall"; + data = "@@SWUPDATE_UBOOT_NAME@@ @@SWUPDATE_UBOOT_ENC@@ @@SWUPDATE_UBOOT_OFFSET@@ @@SWUPDATE_UBOOT_REDUNDANT@@ @@SWUPDATE_UBOOT_NAME_TFA@@"; + sha256 = "$swupdate_get_sha256(@@SWUPDATE_UBOOT_SCRIPT_NAME@@)"; + } diff --git a/meta-digi-dey/recipes-digi/swu-images/files/sw-description-files_template b/meta-digi-dey/recipes-digi/swu-images/files/sw-description-files_template index 6a8173355..29130b4b6 100644 --- a/meta-digi-dey/recipes-digi/swu-images/files/sw-description-files_template +++ b/meta-digi-dey/recipes-digi/swu-images/files/sw-description-files_template @@ -13,6 +13,7 @@ software = path = "/"; sha256 = "$swupdate_get_sha256(@@SWUPDATE_FILES_TARGZ_FILE_NAME@@)"; } + ##FILES_UBOOT## ); scripts: ( { @@ -20,6 +21,7 @@ software = sha256 = "$swupdate_get_sha256(@@SWUPDATE_SCRIPT_NAME@@)"; type = "shellscript"; } + ##SCRIPT_UBOOT## ); uboot: ( { @@ -44,6 +46,7 @@ software = path = "/system/"; sha256 = "$swupdate_get_sha256(@@SWUPDATE_FILES_TARGZ_FILE_NAME@@)"; } + ##FILES_UBOOT## ); scripts: ( { @@ -51,6 +54,7 @@ software = sha256 = "$swupdate_get_sha256(@@SWUPDATE_SCRIPT_NAME@@)"; type = "shellscript"; } + ##SCRIPT_UBOOT## ); uboot: ( { diff --git a/meta-digi-dey/recipes-digi/swu-images/files/sw-description-images_template b/meta-digi-dey/recipes-digi/swu-images/files/sw-description-images_template index 4f182e352..921826bb5 100644 --- a/meta-digi-dey/recipes-digi/swu-images/files/sw-description-images_template +++ b/meta-digi-dey/recipes-digi/swu-images/files/sw-description-images_template @@ -8,12 +8,14 @@ software = images: ( ##IMAGES_PRIMARY## ); + ##FILES_UBOOT## scripts: ( { filename = "@@SWUPDATE_SCRIPT_NAME@@"; sha256 = "$swupdate_get_sha256(@@SWUPDATE_SCRIPT_NAME@@)"; type = "shellscript"; } + ##SCRIPT_UBOOT## ); uboot: ( { @@ -26,12 +28,14 @@ software = images: ( ##IMAGES_SECONDARY## ); + ##FILES_UBOOT## scripts: ( { filename = "@@SWUPDATE_SCRIPT_NAME@@"; sha256 = "$swupdate_get_sha256(@@SWUPDATE_SCRIPT_NAME@@)"; type = "shellscript"; } + ##SCRIPT_UBOOT## ); uboot: ( { @@ -44,12 +48,14 @@ software = images: ( ##IMAGES_SINGLE## ); + ##FILES_UBOOT## scripts: ( { filename = "@@SWUPDATE_SCRIPT_NAME@@"; sha256 = "$swupdate_get_sha256(@@SWUPDATE_SCRIPT_NAME@@)"; type = "shellscript"; } + ##SCRIPT_UBOOT## ); uboot: ( { diff --git a/meta-digi-dey/recipes-digi/swu-images/files/sw-description-rdiff_template b/meta-digi-dey/recipes-digi/swu-images/files/sw-description-rdiff_template index 797095ed8..c2e73479a 100644 --- a/meta-digi-dey/recipes-digi/swu-images/files/sw-description-rdiff_template +++ b/meta-digi-dey/recipes-digi/swu-images/files/sw-description-rdiff_template @@ -8,6 +8,7 @@ software = images: ( ##IMAGES_PRIMARY## ); + ##FILES_UBOOT## scripts: ( { filename = "@@SWUPDATE_SCRIPT_NAME@@"; @@ -15,6 +16,7 @@ software = data = "$swupdate_get_sha256(@@SWUPDATE_RDIFF_ROOTFS_SOURCE_FILE@@)" sha256 = "$swupdate_get_sha256(@@SWUPDATE_SCRIPT_NAME@@)"; } + ##SCRIPT_UBOOT## ); uboot: ( { @@ -27,6 +29,7 @@ software = images: ( ##IMAGES_SECONDARY## ); + ##FILES_UBOOT## scripts: ( { filename = "@@SWUPDATE_SCRIPT_NAME@@"; @@ -34,6 +37,7 @@ software = data = "$swupdate_get_sha256(@@SWUPDATE_RDIFF_ROOTFS_SOURCE_FILE@@)" sha256 = "$swupdate_get_sha256(@@SWUPDATE_SCRIPT_NAME@@)"; } + ##SCRIPT_UBOOT## ); uboot: ( { diff --git a/meta-digi-dey/recipes-digi/swu-images/files/sw-description-uboot b/meta-digi-dey/recipes-digi/swu-images/files/sw-description-uboot deleted file mode 100644 index c72e564ba..000000000 --- a/meta-digi-dey/recipes-digi/swu-images/files/sw-description-uboot +++ /dev/null @@ -1,77 +0,0 @@ -software = -{ - version = "##FW_VERSION##"; - description = "##DESCRIPTION##"; - - mmc = { - platform: { - images: ( - { - filename = "##BOOTIMG_NAME##"; - device = "##BOOT_DEV##"; - type = "raw"; - sha256 = "$swupdate_get_sha256(##BOOTIMG_NAME##)"; - installed-directly = true; - }, - { - filename = "##ROOTIMG_NAME##"; - device = "##ROOTFS_DEV##"; - type = "raw"; - sha256 = "$swupdate_get_sha256(##ROOTIMG_NAME##)"; - compressed = "zlib"; - installed-directly = true; - } - ); - files: ( - { - filename = "##UBOOTIMG_NAME##"; - path = "##UBOOT_IMAGE_PATH##"; - sha256 = "$swupdate_get_sha256(##UBOOTIMG_NAME##)"; - } - ); - scripts: ( - { - filename = "##SWUPDATE_UBOOT_SCRIPT##"; - type = "preinstall"; - data = "##UBOOTIMG_NAME## ##UBOOTIMG_ENC## ##UBOOTIMG_OFFSET##; - sha256 = "$swupdate_get_sha256(##SWUPDATE_UBOOT_SCRIPT##)"; - } - ); - }; - }; - mtd = { - platform: { - images: ( - { - filename = "##BOOTIMG_NAME##"; - volume = "##BOOT_DEV##"; - type = "ubivol"; - sha256 = "$swupdate_get_sha256(##BOOTIMG_NAME##)"; - installed-directly = true; - }, - { - filename = "##ROOTIMG_NAME##"; - volume = "##ROOTFS_DEV##"; - type = "ubivol"; - sha256 = "$swupdate_get_sha256(##ROOTIMG_NAME##)"; - installed-directly = true; - } - ); - files: ( - { - filename = "##UBOOTIMG_NAME##"; - path = "##UBOOT_IMAGE_PATH##"; - sha256 = "$swupdate_get_sha256(##UBOOTIMG_NAME##)"; - } - ); - scripts: ( - { - filename = "##SWUPDATE_UBOOT_SCRIPT##"; - type = "postinstall"; - data = "##UBOOTIMG_NAME## ##UBOOTIMG_ENC##"; - sha256 = "$swupdate_get_sha256(##SWUPDATE_UBOOT_SCRIPT##)"; - } - ); - }; - }; -} diff --git a/meta-digi-dey/recipes-digi/swu-images/files/swupdate_uboot_mmc.sh b/meta-digi-dey/recipes-digi/swu-images/files/swupdate_uboot_mmc.sh index b1e569875..fa76b176a 100755 --- a/meta-digi-dey/recipes-digi/swu-images/files/swupdate_uboot_mmc.sh +++ b/meta-digi-dey/recipes-digi/swu-images/files/swupdate_uboot_mmc.sh @@ -1,7 +1,7 @@ #!/bin/sh #=============================================================================== # -# Copyright (C) 2022 by Digi International Inc. +# Copyright (C) 2022-2024 by Digi International Inc. # All rights reserved. # # This program is free software; you can redistribute it and/or modify it @@ -13,199 +13,258 @@ # Script will be called by swupdate to install a new u-boot within linux. #=============================================================================== -UBOOT_FILE="$1" +UBOOT_NAME="$1" UBOOT_ENC="$2" -uboot_seek_kb="$3" +UBOOT_SEEK_KB="$3" +UBOOT_REDUNDANT="$4" +UBOOT_FILE="/tmp/${UBOOT_NAME}" +UBOOT_BLOCK_MAIN="mmcblk0boot0" +UBOOT_BLOCK_REDUNDANT="mmcblk0boot1" +UBOOT_MMC_DEV_MAIN="/dev/${UBOOT_BLOCK_MAIN}" +UBOOT_MMC_DUMP="/tmp/u-boot-dump.hex" +UBOOT_ENCRYPTED_DEK="/tmp/u-boot-encrypted-with-dek.imx" -echo "**** Start U-Boot update process *****" +DEK_FILE="/tmp/dek.bin" +DEK_KEY_SIZE="32" +DEK_BLOB_SIZE="$((DEK_KEY_SIZE + 56))" # DEK blob has an overhead of 56 bytes: header (8 bytes) + random AES-256 key (32 bytes)+ MAC (16 bytes). +DEK_BLOB_HEADER_CCIMX6="8100584" +DEK_BLOB_HEADER_CCIMX8M="8100484" +DEK_BLOB_HEADER_CCIMX8X="00580081" -PLATFORM="$(cat /proc/device-tree/digi,machine,name)" -UBOOT_MMC_DEV="/dev/mmcblk0boot0" +PLATFORM="$(tr -d '\0' /dev/null; then + # CCIMX8M platforms have a hardcoded DEK blob size of 96 bytes. + DEK_BLOB_SIZE="96" +fi +if expr "${PLATFORM}" : "ccimx8x.*" >/dev/null; then + # The U-Boot seek variable depends on the hardware variant of the i.MX8X module. + SOC_REV="$(fw_printenv -n soc_rev)" + if [ -n "${SOC_REV}" ]; then + case "${SOC_REV}" in + A0) + UBOOT_SEEK_KB="33" + ;; + B0) + UBOOT_SEEK_KB="32" + ;; + *) + UBOOT_SEEK_KB="0" + ;; + esac + fi +fi -dump_dek () +clean_artifacts () { - OUTPUT_FILE="/tmp/dek.bin" - KEY_SIZE_BYTES="32" - ENCRYPTED_UBOOT_DEK="u-boot-encrypted-with-dek.imx" - UBOOT_MMC_DUMP="/tmp/u-boot-dump.hex" + rm -f "${DEK_FILE}" "${UBOOT_MMC_DUMP}" "${UBOOT_ENCRYPTED_DEK}" +} - # ConnectCore 8X - if [ "${PLATFORM}" = "ccimx8x-sbc-pro" ] || [ "${PLATFORM}" = "ccimx8x-sbc-express" ]; then - AHAB_AUTH_CONTAINER_TAG="87" - AHAB_AUTH_SIG_BLOCK_TAG="90" - AHAB_AUTH_BLOB_TAG="00 58 00 81" - AHAB_VERSION="00" - CONT_HEADER_OFFSET="0x400" +exit_error () +{ + local ERROR_MESSAGE="$1" + local ERROR_CODE="$2" - dd if=${UBOOT_MMC_DEV} of=${UBOOT_MMC_DUMP} count=100 bs=1K skip=${uboot_seek_kb} 2>/dev/null - auth_container_tag=$(hexdump -C "${UBOOT_MMC_DUMP}" | grep -m 1 "${AHAB_AUTH_CONTAINER_TAG}" | awk '{print $2 $5}') - echo "auth_container_tag ${auth_container_tag}" - if [ "${auth_container_tag}" = "${AHAB_VERSION}${AHAB_AUTH_CONTAINER_TAG}" ]; then - sig_block_offset="0x$(hexdump -C "${UBOOT_MMC_DUMP}" | grep -m 1 "${AHAB_AUTH_CONTAINER_TAG}" | awk '{print $13 $14}')" - echo " ++++ signature block offset ${sig_block_offset} " + echo "${ERROR_MESSAGE}" + clean_artifacts + [ -z "${ERROR_CODE}" ] && exit 1 || exit "${ERROR_CODE}" +} - nd_sig_block="$((CONT_HEADER_OFFSET + sig_block_offset))" - printf '++++ header offset 0x%x\n' ${nd_sig_block} - auth_sig_block_tag=$(hexdump -C -s "${nd_sig_block}" "${UBOOT_MMC_DUMP}" | grep -m 1 "${AHAB_AUTH_SIG_BLOCK_TAG}" | awk '{print $2 $5}') - echo "auth_sig_block_tag ${auth_sig_block_tag}" - if [ "${auth_sig_block_tag}" = "${AHAB_VERSION}${AHAB_AUTH_SIG_BLOCK_TAG}" ]; then - blob_offset="0x$(hexdump -C -s "${nd_sig_block}" "${UBOOT_MMC_DUMP}" -n 16 | awk '{print $13 $12}')" - printf " ++++ blob offset 0x%x\n" ${blob_offset} - dek_blob="$((nd_sig_block + blob_offset))" - printf " ++++ dek_blob offset 0x%x\n" ${dek_blob} +dump_dek_ccimx8x () +{ + local AHAB_AUTH_CONTAINER_TAG="87" + local AHAB_AUTH_SIG_BLOCK_TAG="90" + local AHAB_VERSION="00" + local CONT_HEADER_OFFSET="0x400" - # DEK blobs have an overhead of 56 bytes. - dek_blob_size=$((KEY_SIZE_BYTES + 56)) - - # Dump dek blob into to a file - dd of=${OUTPUT_FILE} if=${UBOOT_MMC_DUMP} count=${dek_blob_size} bs=1 skip=${dek_blob} 2>/dev/null - rc=$? - if [ $rc -ne 0 ]; then - echo "DEK dump to the output file failed." - return $rc - fi - echo "dump_dek: output file has been created." - # Validate DEK blob - if [ -z "$(dd if=${OUTPUT_FILE} bs=1 count=4 2>/dev/null | hexdump -C | grep "${AHAB_AUTH_BLOB_TAG}")" ]; then - echo "Could not find DEK blob" - rm -rf ${OUTPUT_FILE} - return 1 - fi - echo "DEK blob correctly dumped" - else - echo "## ERROR: AHAB authentication signature block tag not found." + # Dump U-Boot first 100Kb to file. The second AHAB container, which contains the DEK blob is there. + dd if="${UBOOT_MMC_DEV_MAIN}" of="${UBOOT_MMC_DUMP}" count=100 bs=1K skip="${UBOOT_SEEK_KB}" 2>/dev/null + # Look for second AHAB authentication container. Second Container Header is set with a 1KB padding (0x400) + local AUTH_CONTAINER_TAG="$(hexdump -C "${UBOOT_MMC_DUMP}" -s "${CONT_HEADER_OFFSET}" | grep -m 1 "${AHAB_AUTH_CONTAINER_TAG}" | awk '{print $2 $5}')" + if [ "${AUTH_CONTAINER_TAG}" = "${AHAB_VERSION}${AHAB_AUTH_CONTAINER_TAG}" ]; then + # Determine second signature block relative and final offset. + local SECOND_SIG_BLOCK_OFFSET="0x$(hexdump -C -s "${CONT_HEADER_OFFSET}" "${UBOOT_MMC_DUMP}" | grep -m 1 "${AHAB_AUTH_CONTAINER_TAG}" | awk '{print $15 $14}')" + local SECOND_SIG_BLOCK="$((CONT_HEADER_OFFSET + SECOND_SIG_BLOCK_OFFSET))" + # Validate second signature block. + local AUTH_SIG_BLOCK_TAG="$(hexdump -C -s "${SECOND_SIG_BLOCK}" "${UBOOT_MMC_DUMP}" | grep -m 1 "${AHAB_AUTH_SIG_BLOCK_TAG}" | awk '{print $2 $5}')" + if [ "${AUTH_SIG_BLOCK_TAG}" = "${AHAB_VERSION}${AHAB_AUTH_SIG_BLOCK_TAG}" ]; then + # Determine DEK blob relative and final offset. + local DEK_BLOB_RELATIVE_OFFSET="0x$(hexdump -C -s "${SECOND_SIG_BLOCK}" "${UBOOT_MMC_DUMP}" | grep -m 1 "${AHAB_AUTH_SIG_BLOCK_TAG}" | awk '{print $13 $12}')" + DEK_AHAB_OFFSET="$((SECOND_SIG_BLOCK + DEK_BLOB_RELATIVE_OFFSET))" + # Dump DEK blob into to a file. + dd if="${UBOOT_MMC_DUMP}" of="${DEK_FILE}" count="${DEK_BLOB_SIZE}" bs=1 skip="${DEK_AHAB_OFFSET}" 2>/dev/null + local rc=$? + if [ "${rc}" -ne 0 ]; then + exit_error "## ERROR: DEK dump to file failed." "${rc}" + fi + # Validate DEK blob. + if ! dd if="${DEK_FILE}" bs=1 count=4 2>/dev/null | hexdump -ve '1/1 "%.2X"' | grep -q "${DEK_BLOB_HEADER_CCIMX8X}"; then + exit_error "## ERROR: Could not find DEK blob." fi else - echo "## ERROR: AHAB authentication container tag not found." - return 1 + exit_error "## ERROR: AHAB authentication signature block tag not found." fi else - #(The last byte lacks one digit on purpose, to match 40, 41 and 42; all HAB versions) - UBOOT_HEADER="d1 00 20 4" - if [ "${PLATFORM}" = "ccimx8mn-dvk" ] || [ "${PLATFORM}" = "ccimx8mm-dvk" ]; then - SKIP_BLOCKS="0" - DEK_BLOB_HEADER="81 00 48 4" - else - SKIP_BLOCKS="2" - DEK_BLOB_HEADER="81 00 58 4" - fi - - dd if=${UBOOT_MMC_DEV} of=${UBOOT_MMC_DUMP} count=1 skip=${SKIP_BLOCKS} 2>/dev/null - uboot_start="0x$(hexdump -C ${UBOOT_MMC_DUMP} | grep -m 1 "${UBOOT_HEADER}" | head -1 | cut -c -8)" - echo "++++ ${uboot_start} +++" - if [ "${uboot_start}" = "0x" ]; then - echo "Could not find U-Boot on MMC" - return 1 - fi - - uboot_size_offset="$((uboot_start + 36))" - uboot_size=$(hexdump -n 4 -s ${uboot_size_offset} -e '/4 "%d\t" "\n"' ${UBOOT_MMC_DUMP}) - - # DEK blobs have an overhead of 56 bytes. - dek_blob_size="$((KEY_SIZE_BYTES + 56))" - - # remove the output DEK file before creating it. - # Since this function is called twice. - # For the actual upgrade and then for the validation after the upgrade. - rm -f ${OUTPUT_FILE} - dump_size="$((uboot_size / 512))" - echo "++++ ${dump_size} +++" - dd if=${UBOOT_MMC_DEV} of=${UBOOT_MMC_DUMP} count=${dump_size} skip=${SKIP_BLOCKS} conv=fsync 2>/dev/null - dek_start=$(hexdump -C ${UBOOT_MMC_DUMP} | grep -m 1 "${DEK_BLOB_HEADER}" | head -1 | cut -c -8) - echo "++++ dek_start ${dek_start} +++" - dek_start="$((16#${dek_start} + 8))" - echo "++++ dek_start ${dek_start} +++" - dd of=${OUTPUT_FILE} if=${UBOOT_MMC_DUMP} count=${dek_blob_size} bs=1 skip=${dek_start} 2>/dev/null - rc=$? - if [ $rc -ne 0 ]; then - echo "DEK dump to the output file failed." - return $rc - fi - echo "dump_dek: output file has been created." - # Validate DEK blob - if [ -z "$(dd if=${OUTPUT_FILE} bs=1 count=4 2>/dev/null | hexdump -C | grep "${DEK_BLOB_HEADER}")" ]; then - echo "Could not find DEK blob" - rm -rf ${OUTPUT_FILE} - return 1 - fi - echo "DEK blob correctly dumped" - rm -f ${UBOOT_MMC_DUMP} - return 0 + exit_error "## ERROR: AHAB authentication container tag not found." fi } -if [ "${UBOOT_ENC}" = "enc" ]; then +dump_dek_ccimx8m_ccimx6 () +{ + local IVT_HEADER="d1 00 20 4" # The last byte lacks one digit on purpose, to match 40, 41 and 42; all HAB versions. + local DEK_BLOB_HEADER="$1" + + # Look for U-Boot in the eMMC. It starts with the IVT table header. + dd if="${UBOOT_MMC_DEV_MAIN}" of="${UBOOT_MMC_DUMP}" bs=1k skip="${UBOOT_SEEK_KB}" 2>/dev/null + local UBOOT_START="0x$(hexdump -C "${UBOOT_MMC_DUMP}" | grep -m 1 "${IVT_HEADER}" | head -1 | cut -c -8)" + if [ "${UBOOT_START}" = "0x" ]; then + exit_error "## ERROR: Could not find U-Boot on MMC." + fi + # DEK blob must be extracted from the SPL image. First determine SPL image size. + local SPL_SIZE_OFFSET="$((UBOOT_START + 36))" # Size information is at offset 36. + local SPL_SIZE="$(hexdump -n 4 -s "${SPL_SIZE_OFFSET}" -e '/4 "%d\t" "\n"' "${UBOOT_MMC_DUMP}")" + # Determine SPL size in blocks of 1Kb. Round up division if it is not exact. + local DUMP_SIZE="$(( (SPL_SIZE + 1023) / 1024 ))" + # Dump SPL image to file. + dd if="${UBOOT_MMC_DEV_MAIN}" of="${UBOOT_MMC_DUMP}" bs=1k count="${DUMP_SIZE}" skip="${UBOOT_SEEK_KB}" conv=fsync 2>/dev/null + # Look for the DEK blob in SPL image. + DEK_SPL_OFFSET="$(hexdump -ve '1/1 "%.2X"' ${UBOOT_MMC_DUMP} | awk -v pattern="${DEK_BLOB_HEADER}" 'BEGIN{IGNORECASE=1} {pos=index($0, pattern)} pos {print (pos-1)/2}')" + # Dump the DEK blob to file. + dd if="${UBOOT_MMC_DUMP}" of="${DEK_FILE}" count="${DEK_BLOB_SIZE}" bs=1 skip="${DEK_SPL_OFFSET}" 2>/dev/null + local rc=$? + if [ "${rc}" -ne 0 ]; then + exit_error "## ERROR: DEK dump to file failed." "${rc}" + fi + # Validate DEK blob. + if ! dd if="${DEK_FILE}" bs=1 count=4 2>/dev/null | hexdump -ve '1/1 "%.2X"' | grep -q "${DEK_BLOB_HEADER}"; then + exit_error "## ERROR: Could not find DEK blob." + fi +} + +dump_dek_ccimx93 () +{ + exit_error "## ERROR: DEK support not implemented yet for CCIMX93." +} + +dump_dek () +{ + case "${PLATFORM}" in + ccimx8x*) + dump_dek_ccimx8x + ;; + ccimx8m*) + dump_dek_ccimx8m_ccimx6 "${DEK_BLOB_HEADER_CCIMX8M}" + ;; + ccimx6*) + dump_dek_ccimx8m_ccimx6 "${DEK_BLOB_HEADER_CCIMX6}" + ;; + ccimx93*) + dump_dek_ccimx93 + ;; + *) + exit_error "## ERROR: Device not supported ${PLATFORM}." + ;; + esac +} + +append_dek_ccimx8x () +{ + cp "${UBOOT_FILE}" "${UBOOT_ENCRYPTED_DEK}" + # Insert the DEK blob into the AHAB container. + dd if="${DEK_FILE}" of="${UBOOT_ENCRYPTED_DEK}" bs=1 seek="${DEK_AHAB_OFFSET}" conv=notrunc 2>/dev/null + local rc=$? + if [ "${rc}" -ne 0 ]; then + exit_error "## ERROR: Merging DEK with AHAB container failed." "${rc}" + fi +} + +append_dek_ccimx8m () +{ + cp "${UBOOT_FILE}" "${UBOOT_ENCRYPTED_DEK}" + # Insert the DEK blob into the SPL image. + dd if="${DEK_FILE}" of="${UBOOT_ENCRYPTED_DEK}" bs=1 seek="${DEK_SPL_OFFSET}" conv=notrunc 2>/dev/null + local rc=$? + if [ "${rc}" -ne 0 ]; then + exit_error "## ERROR: Merging DEK with SPL image failed." "${rc}" + fi + # Get total iMX-Boot file size. + local UBOOT_FILE_SIZE="$(stat -L -c %s "${UBOOT_FILE}")" + # Determine FIT DEK blob offset. + local DEK_FIT_OFFSET="$((UBOOT_FILE_SIZE - DEK_BLOB_SIZE))" + # Insert the DEK blob into the FIT image. + dd if="${DEK_FILE}" of="${UBOOT_ENCRYPTED_DEK}" bs=1 seek="${DEK_FIT_OFFSET}" conv=notrunc 2>/dev/null + local rc=$? + if [ "${rc}" -ne 0 ]; then + exit_error "## ERROR: Merging DEK with FIT image failed." "${rc}" + fi +} + +append_dek_ccimx6 () +{ + cat "${UBOOT_FILE}" "${DEK_FILE}" > "${UBOOT_ENCRYPTED_DEK}" + local rc=$? + if [ "${rc}" -ne 0 ]; then + exit_error "## ERROR: Merging DEK with U-Boot image failed." "${rc}" + fi +} + +append_dek_ccimx93 () +{ + exit_error "## ERROR: DEK support not implemented yet for CCIMX93." +} + +append_dek () +{ dump_dek - rc=$? - if [ "$rc" -ne 0 ]; then - echo "u-boot: DEK dump failed" - exit $rc + case "${PLATFORM}" in + ccimx8x*) + append_dek_ccimx8x + ;; + ccimx8m*) + append_dek_ccimx8m + ;; + ccimx6*) + append_dek_ccimx6 + ;; + ccimx93*) + append_dek_ccimx93 + ;; + *) + exit_error "## ERROR: Device not supported: ${PLATFORM}." + ;; + esac + UBOOT_FILE="${UBOOT_ENCRYPTED_DEK}" +} + +write_uboot_emmc () +{ + local UBOOT_BLOCK="$1" + + # Enable write access in the U-Boot partition. + echo 0 > "/sys/block/${UBOOT_BLOCK}/force_ro" + # Write the U-Boot into the eMMC. + dd if="${UBOOT_FILE}" of="/dev/${UBOOT_BLOCK}" seek="${UBOOT_SEEK_KB}" bs=1K 2>/dev/null + local rc=$? + # Disable write access in U-Boot partition. + echo 1 > "/sys/block/${UBOOT_BLOCK}/force_ro" + # Check update operation result. + if [ "${rc}" -ne 0 ]; then + exit_error "## ERROR: failed to write file ${UBOOT_FILE} to /dev/${UBOOT_BLOCK}" "${rc}" fi - if [ "${PLATFORM}" = "ccimx8x-sbc-pro" ] || [ "${PLATFORM}" = "ccimx8x-sbc-express" ]; then - cp /tmp/${UBOOT_FILE} /tmp/${ENCRYPTED_UBOOT_DEK} - # insert the dek_blob into the AHAB container - dd if=${OUTPUT_FILE} of=/tmp/${ENCRYPTED_UBOOT_DEK} bs=1 seek=${dek_blob} conv=notrunc 2>/dev/null - rc=$? - if [ "$rc" -ne 0 ]; then - echo "u-boot: Merging DEK with U-Boot image failed (DEV/FILE = /tmp/$UBOOT_FILE)" - exit $rc - fi - elif [ "${PLATFORM}" = "ccimx8mn-dvk" ] || [ "${PLATFORM}" = "ccimx8mm-dvk" ]; then - FIT_DEK_BLOB_SIZE="96"; - cp /tmp/${UBOOT_FILE} /tmp/${ENCRYPTED_UBOOT_DEK} - # insert the dek_blob into the SPL - dd if=${OUTPUT_FILE} of=/tmp/${ENCRYPTED_UBOOT_DEK} bs=1 seek=${dek_start} conv=notrunc 2>/dev/null - rc=$? - if [ "$rc" -ne 0 ]; then - echo "u-boot: Merging DEK with SPL image failed (DEV/FILE = /tmp/$UBOOT_FILE)" - exit $rc - fi - # get u-boot image file size - uboot_file_size="$(stat -L -c %s /tmp/${UBOOT_FILE})" - echo " ++++ uboot_file_size ${uboot_file_size} ***" - uboot_dek_blob_offset="$((uboot_file_size - FIT_DEK_BLOB_SIZE))" - echo " ----- uboot_dek_blob_offset ${uboot_dek_blob_offset} **" - # insert the dek_blob at the end of the bootloader - dd of=/tmp/${ENCRYPTED_UBOOT_DEK} if=${OUTPUT_FILE} bs=1 seek=${uboot_dek_blob_offset} conv=notrunc 2>/dev/null - rc=$? - if [ "$rc" -ne 0 ]; then - echo "u-boot: Merging DEK with U-Boot image failed (DEV/FILE = /tmp/$UBOOT_FILE)" - exit $rc - fi - else - cat /tmp/${UBOOT_FILE} ${OUTPUT_FILE} > /tmp/${ENCRYPTED_UBOOT_DEK} - rc=$? - if [ "$rc" -ne 0 ]; then - echo "u-boot: Merging DEK with U-Boot image failed (DEV/FILE = /tmp/$UBOOT_FILE)" - exit $rc - fi - fi - # enable write access - echo 0 > /sys/block/mmcblk0boot0/force_ro - UBOOT_FILE="/tmp/${ENCRYPTED_UBOOT_DEK}" - # write the encrypted u-boot into the MMC - dd if=${UBOOT_FILE} of=${UBOOT_MMC_DEV} seek=${uboot_seek_kb} bs=1K - rc=$? 2>/dev/null - if [ "$rc" -ne 0 ]; then - echo "u-boot: failed to write file ${UBOOT_FILE}" - else - echo "u-boot: successfully written file ${UBOOT_FILE}" - fi - # disable write access - echo 1 > /sys/block/mmcblk0boot0/force_ro - rm -f ${UBOOT_FILE} ${OUTPUT_FILE} -else - # enable write access - echo 0 > /sys/block/mmcblk0boot0/force_ro - # write the u-boot into the MMC - dd if=${UBOOT_FILE} of=${UBOOT_MMC_DEV} seek=${uboot_seek_kb} bs=1K 2>/dev/null - rc=$? - if [ "$rc" -ne 0 ]; then - echo "u-boot: failed to write file ${UBOOT_FILE}" - else - echo "u-boot: successfully written file ${UBOOT_FILE}" - fi - # disable write access - echo 1 > /sys/block/mmcblk0boot0/force_ro - rm -f ${UBOOT_FILE} ${OUTPUT_FILE} + echo "U-Boot successfully writen to /dev/${UBOOT_BLOCK}" +} + +# If U-Boot is encrypted, the DEK key blob needs to be extracted from existing U-Boot +# and appended to the new U-Boot before writing it. +if [ "${UBOOT_ENC}" = "enc" ]; then + append_dek fi +# Write U-Boot +write_uboot_emmc ${UBOOT_BLOCK_MAIN} +# Check if redundant U-Boot update is requested. +if [ "${UBOOT_REDUNDANT}" = "redundant" ]; then + write_uboot_emmc ${UBOOT_BLOCK_REDUNDANT} +fi +# Clean intermediate artifacts. +clean_artifacts + +exit 0 diff --git a/meta-digi-dey/recipes-digi/swu-images/files/swupdate_uboot_nand.sh b/meta-digi-dey/recipes-digi/swu-images/files/swupdate_uboot_nand.sh index 58f9b4de6..c94d29cc4 100755 --- a/meta-digi-dey/recipes-digi/swu-images/files/swupdate_uboot_nand.sh +++ b/meta-digi-dey/recipes-digi/swu-images/files/swupdate_uboot_nand.sh @@ -1,7 +1,7 @@ #!/bin/sh #=============================================================================== # -# Copyright (C) 2022 by Digi International Inc. +# Copyright (C) 2022-2024 by Digi International Inc. # All rights reserved. # # This program is free software; you can redistribute it and/or modify it @@ -13,84 +13,162 @@ # Script will be called by swupdate to install a new u-boot within linux. #=============================================================================== -UBOOT_FILE="$1" +UBOOT_NAME="$1" UBOOT_ENC="$2" +UBOOT_SEEK_KB="$3" +UBOOT_REDUNDANT="$4" +UBOOT_TFA_NAME="$5" +UBOOT_TFA_FILE="/tmp/${UBOOT_TFA_NAME}" +UBOOT_FILE="/tmp/${UBOOT_NAME}" +UBOOT_NAND_DUMP="/tmp/u-boot-dump.hex" +UBOOT_ENCRYPTED_DEK="/tmp/u-boot-encrypted-with-dek.imx" -echo "**** Start U-Boot update process *****" +DEK_FILE="/tmp/dek.bin" +DEK_KEY_SIZE="32" +DEK_BLOB_SIZE="$((DEK_KEY_SIZE + 56))" # DEK blob has an overhead of 56 bytes: header (8 bytes) + random AES-256 key (32 bytes) + MAC (16 bytes). +DEK_BLOB_HEADER="8100584" # The last byte lacks one digit on purpose, to match 40, 41 and 42; all HAB versions. -# need to mount debufs to remove some kobs-ng warnings -if ! grep -qs debugfs /proc/mounts; then - mount -t debugfs debugfs /sys/kernel/debug/ -fi +PLATFORM="$(tr -d '\0' "${DEK_FILE}" + local rc=$? + if [ "${rc}" -ne 0 ]; then + exit_error "## ERROR: DEK dump to file failed." "${rc}" + fi + # Validate the DEK blob. + if ! dd if="${DEK_FILE}" bs=1 count=4 2>/dev/null | hexdump -ve '1/1 "%.2X"' | grep -q "${DEK_BLOB_HEADER}"; then + exit_error "## ERROR: Could not find DEK blob." + fi +} dump_dek () { - echo "**** Get DEK and append to the new u-boot *****" - UBOOT_MTD_DEV="/dev/mtd0" - OUTPUT_FILE="/tmp/dek.bin" - KEY_SIZE_BYTES="32" - ENCRYPTED_UBOOT_DEK="u-boot-encrypted-with-dek.imx" - - #(The last byte lacks one digit on purpose, to match 40, 41 and 42; all HAB versions) - UBOOT_HEADER="d1 00 20 4" - DEK_BLOB_HEADER="81 00 58 4" - - uboot_start="0x$(nanddump ${UBOOT_MTD_DEV} | hexdump -C | grep -m 1 "${UBOOT_HEADER}" | head -1 | cut -c -8)" - if [ "${uboot_start}" = "0x" ]; then - echo "Could not find U-Boot on NAND" - return 78 - fi - - uboot_size_offset=$((uboot_start + 36)) - uboot_size=$(hexdump -n 4 -s ${uboot_size_offset} -e '/4 "0x%08x\t" "\n"' ${UBOOT_MTD_DEV}) - # dump start needs to be aligned (U-Boot always leaves 0x400 for DOS table) - dump_start=$((uboot_start - 0x400)) - # DEK blobs have an overhead of 56 bytes. - dek_blob_size=$((KEY_SIZE_BYTES + 56)) - - # remove the output DEK file before creating it. - # Since this function is called twice. - # For the actual upgrade and then for the validation after the upgrade. - rm -f ${OUTPUT_FILE} - # read the complete U-Boot (to skip alignment issues) and keep the dek_blob (which is at the end) - nanddump -s ${dump_start} -l ${uboot_size} ${UBOOT_MTD_DEV} | tail -c ${dek_blob_size} > ${OUTPUT_FILE} - rc=$? - if [ $rc -ne 0 ]; then - echo "DEK dump to the output file failed." - return $rc - fi - echo "dump_dek: output file has been created." - # Validate DEK blob - if [ -z "$(dd if=${OUTPUT_FILE} bs=1 count=4 2>/dev/null | hexdump -C | grep "${DEK_BLOB_HEADER}")" ]; then - echo "Could not find DEK blob" - rm -rf ${OUTPUT_FILE} - return 60 - fi - echo "DEK blob correctly dumped" - return 0 + case "${PLATFORM}" in + ccimx6ul*) + dump_dek_ccimx6ul + ;; + *) + exit_error "## ERROR: Device not supported ${PLATFORM}." + ;; + esac } -if [ "${UBOOT_ENC}" = "enc" ]; then - dump_dek - rc=$? - if [ "$rc" -ne 0 ]; then - echo "u-boot: DEK dump failed" - exit $rc +append_dek_ccimx6ul () +{ + cat "${UBOOT_FILE}" "${DEK_FILE}" > "${UBOOT_ENCRYPTED_DEK}" + local rc=$? + if [ "${rc}" -ne 0 ]; then + exit_error "## ERROR: Merging DEK with U-Boot image failed." "${rc}" fi - cat $UBOOT_FILE $OUTPUT_FILE > /tmp/$ENCRYPTED_UBOOT_DEK - rc=$? - if [ "$rc" -ne 0 ]; then - echo "u-boot: Merging DEK with U-Boot image failed (DEV/FILE = $UBOOT_FILE)" - exit $rc - fi - UBOOT_FILE="${ENCRYPTED_UBOOT_DEK}" -fi +} -# install U-Boot onto the Nand Flash -kobs-ng init -x -v /mnt/update/${UBOOT_FILE} -rc=$? -if [ "$rc" -ne 0 ]; then - echo "u-Boot: Updating U-Boot partition failed" -else - echo "u-Boot: Updating U-Boot partition successful" +append_dek () +{ + dump_dek + case "${PLATFORM}" in + ccimx6ul*) + append_dek_ccimx6ul + ;; + *) + exit_error "## ERROR: Device not supported: ${PLATFORM}." + ;; + esac + UBOOT_FILE="${UBOOT_ENCRYPTED_DEK}" +} + +write_file_to_nand () +{ + local FLASH_DEV="$1" + local FW_FILE="$2" + + # Sanity check. + if [ ! -c "${FLASH_DEV}" ]; then + exit_error "## ERROR: Invalid MTD partition: ${FLASH_DEV}." + fi + # Clean MTD partition. + flash_eraseall "${FLASH_DEV}" + local rc=$? + if [ "${rc}" -ne 0 ]; then + exit_error "## ERROR: Could not erase ${FLASH_DEV} partition." "${rc}" + fi + # Write file to NAND. + nandwrite -p "${FLASH_DEV}" "${FW_FILE}" + local rc=$? + if [ "${rc}" -ne 0 ]; then + exit_error "## ERROR: Could not write file to NAND." "${rc}" + fi +} + +get_mtd_number_from_partition () +{ + local PARTITION_NAME="$1" + local MTD_NUM="$(sed -ne "/${PARTITION_NAME}/s,^mtd\([0-9]\+\).*,\1,g;T;p" /proc/mtd)" + + echo "${MTD_NUM}" +} + +# If U-Boot is encrypted, the DEK key blob needs to be extracted from existing U-Boot +# and appended to the new U-Boot before writing it. +if [ "${UBOOT_ENC}" = "enc" ]; then + append_dek fi +# Write U-Boot +if expr "${PLATFORM}" : "ccmp1.*" >/dev/null; then + # Install TFA file in fsbl1 partition. + write_file_to_nand "/dev/mtd$(get_mtd_number_from_partition fsbl1)" "${UBOOT_TFA_FILE}" + # Install U-Boot FIP file in fip-a partition. + write_file_to_nand "/dev/mtd$(get_mtd_number_from_partition fip-a)" "${UBOOT_FILE}" + # Check if redundant U-Boot update is requested. + if [ "${UBOOT_REDUNDANT}" = "redundant" ]; then + # Install TFA file in fsbl2 partition (redundant). + write_file_to_nand "/dev/mtd$(get_mtd_number_from_partition fsbl2)" "${UBOOT_TFA_FILE}" + # Install U-Boot FIP file in fip-b partition (redundant). + write_file_to_nand "/dev/mtd$(get_mtd_number_from_partition fip-b)" "${UBOOT_FILE}" + fi +else + # Mount debug file system to remove some kobs-ng warnings. + if ! grep -qs debugfs /proc/mounts; then + mount -t debugfs debugfs /sys/kernel/debug/ + fi + # Install U-Boot onto the Nand Flash using kobs-ng. + kobs-ng init -x -v "${UBOOT_FILE}" + rc=$? + if [ "${rc}" -ne 0 ]; then + exit_error "## ERROR: Could not write file to NAND." "${rc}" + fi +fi +# Clean intermediate artifacts. +clean_artifacts + +exit 0 diff --git a/meta-digi-dey/recipes-digi/swu-images/swu.inc b/meta-digi-dey/recipes-digi/swu-images/swu.inc index 6d6933350..9aff6d212 100644 --- a/meta-digi-dey/recipes-digi/swu-images/swu.inc +++ b/meta-digi-dey/recipes-digi/swu-images/swu.inc @@ -9,13 +9,14 @@ SRC_URI = " \ file://sw-description-images_template \ file://sw-description-files_template \ file://sw-description-rdiff_template \ - file://sw-description-uboot \ file://swupdate_uboot_nand.sh \ file://swupdate_uboot_mmc.sh \ file://image_template_mmc \ file://image_template_nand \ file://image_template_rdiff_mmc \ file://image_template_rdiff_nand \ + file://file_template_uboot \ + file://script_template_uboot\ file://update_images.sh \ file://update_files.sh \ file://update_rdiff.sh \ @@ -31,8 +32,7 @@ SWUPDATE_IMAGES = " \ ${@oe.utils.ifelse(d.getVar('SWUPDATE_IS_IMAGES_UPDATE') == 'true', '${IMG_NAME}', '')} \ ${@oe.utils.ifelse(d.getVar('SWUPDATE_IS_FILES_UPDATE') == 'true', '${SWUPDATE_FILES_TARGZ_FILE_NAME}', '')} \ ${@oe.utils.ifelse(d.getVar('SWUPDATE_IS_RDIFF_UPDATE') == 'true', '${IMG_NAME} ${SWUPDATE_RDIFF_ROOTFS_DELTA_FILE_NAME}', '')} \ - ${@oe.utils.ifelse(d.getVar('SWUPDATE_UBOOTIMG') == 'true', '${UBOOT_PREFIX}', '')} \ - ${@oe.utils.ifelse(d.getVar('SWUPDATE_UBOOTIMG') == 'true', '${SWUPDATE_UBOOT_SCRIPT}', '')} \ + ${@oe.utils.ifelse(d.getVar('SWUPDATE_UBOOTIMG') == 'true', '${SWUPDATE_UBOOT_NAME} ${SWUPDATE_UBOOT_NAME_TFA} ${SWUPDATE_UBOOT_SCRIPT_NAME}', '')} \ ${SWUPDATE_SCRIPT_NAME} \ " @@ -43,8 +43,11 @@ python () { img_fstypes = img_fstypes + " " + d.getVar('ROOTFS_EXT') d.setVarFlag("SWUPDATE_IMAGES_FSTYPES", d.getVar('IMG_NAME'), img_fstypes) if (d.getVar('SWUPDATE_UBOOTIMG') == "true"): - uboot_fstypes = d.getVar('UBOOT_EXT') - d.setVarFlag("SWUPDATE_IMAGES_FSTYPES", d.getVar('UBOOT_PREFIX'), uboot_fstypes) + uboot_fstypes = d.getVar('SWUPDATE_UBOOT_EXT') + d.setVarFlag("SWUPDATE_IMAGES_FSTYPES", d.getVar('SWUPDATE_UBOOT_PREFIX'), uboot_fstypes) + if (d.getVar('DEY_SOC_VENDOR') == "STM"): + uboot_tfa_fstypes = d.getVar('SWUPDATE_UBOOT_EXT_TFA') + d.setVarFlag("SWUPDATE_IMAGES_FSTYPES", d.getVar('SWUPDATE_UBOOT_PREFIX_TFA'), uboot_tfa_fstypes) } # Execute extra tasks before creating SWU update package. @@ -65,6 +68,15 @@ python do_swuimage:prepend() { updatescript = os.path.join(workdir, updatescript) if os.path.isfile(updatescript): shutil.copyfile(updatescript, os.path.join(imgdeploydir, os.path.basename(updatescript))) + + # Copy U-Boot script file. + if d.getVar('SWUPDATE_UBOOTIMG') == "true": + uboot_updatescript = d.getVar('SWUPDATE_UBOOT_SCRIPT_NAME', True) + if "/" not in uboot_updatescript: + workdir = d.getVar('WORKDIR', True) + uboot_updatescript = os.path.join(workdir, uboot_updatescript) + if os.path.isfile(uboot_updatescript): + shutil.copyfile(uboot_updatescript, os.path.join(imgdeploydir, os.path.basename(uboot_updatescript))) } # Upgrade available. @@ -73,18 +85,7 @@ UPGRADE_AVAILABLE:ccimx6 = "1" # Create and fill 'sw-description' file. fill_description() { - if [ "${SWUPDATE_UBOOTIMG}" = "true" ]; then - cp ${WORKDIR}/sw-description-uboot ${WORKDIR}/sw-description - cp ${WORKDIR}/${SWUPDATE_UBOOT_SCRIPT} ${DEPLOY_DIR_IMAGE}/${SWUPDATE_UBOOT_SCRIPT} - if [ "${TRUSTFENCE_DEK_PATH}" != "0" ] && [ "${TRUSTFENCE_DEK_PATH}" != "default" ]; then - sed -i -e "s,##UBOOTIMG_ENC##,enc,g" "${WORKDIR}/sw-description" - else - sed -i -e "s,##UBOOTIMG_ENC##,normal,g" "${WORKDIR}/sw-description" - fi - sed -i -e "s,##UBOOTIMG_NAME##,${UBOOT_PREFIX}-${MACHINE}${UBOOT_EXT},g" "${WORKDIR}/sw-description" - sed -i -e "s,##SWUPDATE_UBOOT_SCRIPT##,${SWUPDATE_UBOOT_SCRIPT},g" "${WORKDIR}/sw-description" - sed -i -e "s,##UBOOTIMG_OFFSET##,${UBOOTIMG_OFFSET},g" "${WORKDIR}/sw-description" - elif [ "${SWUPDATE_IS_FILES_UPDATE}" = "true" ]; then + if [ "${SWUPDATE_IS_FILES_UPDATE}" = "true" ]; then cp ${WORKDIR}/sw-description-files_template ${WORKDIR}/sw-description elif [ "${SWUPDATE_IS_RDIFF_UPDATE}" = "true" ]; then cp ${WORKDIR}/sw-description-rdiff_template ${WORKDIR}/sw-description @@ -92,7 +93,45 @@ fill_description() { cp ${WORKDIR}/sw-description-images_template ${WORKDIR}/sw-description fi + # Add U-Boot sections if required. + if [ "${SWUPDATE_UBOOTIMG}" = "true" ]; then + # Add U-Boot files section. + UBOOT_FILE_TEMPLATE="file_template_uboot" + FILES_TEMPLATE="%s\n" + if [ "${DEY_SOC_VENDOR}" = "STM" ]; then + FILES_TEMPLATE="%s,\n%s\n" + fi + if [ "${SWUPDATE_IS_FILES_UPDATE}" != "true" ]; then + FILES_TEMPLATE=" files: (\n${FILES_TEMPLATE} );\n" + else + FILES_TEMPLATE=" ,\n${FILES_TEMPLATE}" + fi + if [ "${DEY_SOC_VENDOR}" = "STM" ]; then + printf "${FILES_TEMPLATE}" \ + "$(sed -e "s,##FILE_NAME##,${SWUPDATE_UBOOT_NAME},g" -e "s,##FILE_PATH##,/tmp/${SWUPDATE_UBOOT_NAME},g" "${UBOOT_FILE_TEMPLATE}")" \ + "$(sed -e "s,##FILE_NAME##,${SWUPDATE_UBOOT_NAME_TFA},g" -e "s,##FILE_PATH##,/tmp/${SWUPDATE_UBOOT_NAME_TFA},g" "${UBOOT_FILE_TEMPLATE}")" \ + > template_out.txt + else + printf "${FILES_TEMPLATE}" \ + "$(sed -e "s,##FILE_NAME##,${SWUPDATE_UBOOT_NAME},g" -e "s,##FILE_PATH##,/tmp/${SWUPDATE_UBOOT_NAME},g" "${UBOOT_FILE_TEMPLATE}")" \ + > template_out.txt + fi + sed -i -e "/##FILES_UBOOT##/r template_out.txt" -e "/##FILES_UBOOT##/d" "${WORKDIR}/sw-description" + + # Add U-Boot script section. + UBOOT_SCRIPT_TEMPLATE="script_template_uboot" + printf " ,\n%s\n" \ + "$(cat "${UBOOT_SCRIPT_TEMPLATE}")" \ + > template_out.txt + sed -i -e "/##SCRIPT_UBOOT##/r template_out.txt" -e "/##SCRIPT_UBOOT##/d" "${WORKDIR}/sw-description" + else + # Remove U-Boot entries if U-Boot is not being updated. + sed -i -e "s,##FILES_UBOOT##,,g" "${WORKDIR}/sw-description" + sed -i -e "s,##SCRIPT_UBOOT##,,g" "${WORKDIR}/sw-description" + fi + if [ "${SWUPDATE_IS_FILES_UPDATE}" = "true" ]; then + rm -f template_out.txt return 0 fi @@ -111,23 +150,23 @@ fill_description() { printf "%s,\n%s\n" \ "$(sed -e "s,##IMG_NAME##,${BOOT_IMAGE_NAME},g" -e "s,##DEV##,${BOOT_DEV_NAME_A},g" -e "/compressed/d" "${BOOT_IMAGE_TEMPLATE}")" \ "$(sed -e "s,##IMG_NAME##,${ROOTFS_IMAGE_NAME},g" -e "s,##DEV##,${ROOTFS_DEV_NAME_A},g" "${ROOTFS_IMAGE_TEMPLATE}")" \ - > images_temp.txt - sed -i -e "/##IMAGES_PRIMARY##/r images_temp.txt" -e "/##IMAGES_PRIMARY##/d" "${WORKDIR}/sw-description" + > template_out.txt + sed -i -e "/##IMAGES_PRIMARY##/r template_out.txt" -e "/##IMAGES_PRIMARY##/d" "${WORKDIR}/sw-description" # Add secondary bank images section for dual boot systems. printf "%s,\n%s\n" \ "$(sed -e "s,##IMG_NAME##,${BOOT_IMAGE_NAME},g" -e "s,##DEV##,${BOOT_DEV_NAME_B},g" -e "/compressed/d" "${BOOT_IMAGE_TEMPLATE}")" \ "$(sed -e "s,##IMG_NAME##,${ROOTFS_IMAGE_NAME},g" -e "s,##DEV##,${ROOTFS_DEV_NAME_B},g" "${ROOTFS_IMAGE_TEMPLATE}")" \ - > images_temp.txt - sed -i -e "/##IMAGES_SECONDARY##/r images_temp.txt" -e "/##IMAGES_SECONDARY##/d" "${WORKDIR}/sw-description" + > template_out.txt + sed -i -e "/##IMAGES_SECONDARY##/r template_out.txt" -e "/##IMAGES_SECONDARY##/d" "${WORKDIR}/sw-description" # Add images section for single boot systems. if [ "${SWUPDATE_IS_RDIFF_UPDATE}" != "true" ]; then printf "%s,\n%s\n" \ "$(sed -e "s,##IMG_NAME##,${BOOT_IMAGE_NAME},g" -e "s,##DEV##,${BOOT_DEV_NAME},g" -e "/compressed/d" "${BOOT_IMAGE_TEMPLATE}")" \ "$(sed -e "s,##IMG_NAME##,${ROOTFS_IMAGE_NAME},g" -e "s,##DEV##,${ROOTFS_DEV_NAME_FINAL},g" "${ROOTFS_IMAGE_TEMPLATE}")" \ - > images_temp.txt - sed -i -e "/##IMAGES_SINGLE##/r images_temp.txt" -e "/##IMAGES_SINGLE##/d" "${WORKDIR}/sw-description" + > template_out.txt + sed -i -e "/##IMAGES_SINGLE##/r template_out.txt" -e "/##IMAGES_SINGLE##/d" "${WORKDIR}/sw-description" fi # Remove 'compressed' flag for read-only file systems as they use 'squashfs' images. @@ -136,7 +175,7 @@ fill_description() { fi # Clean dir. - rm -f images_temp.txt + rm -f template_out.txt } fill_description[dirs] = "${DEPLOY_DIR_IMAGE} ${WORKDIR}" do_unpack[postfuncs] += "fill_description" diff --git a/meta-digi-dey/recipes-graphics/lvgl/lv-drivers.inc b/meta-digi-dey/recipes-graphics/lvgl/lv-drivers.inc new file mode 100644 index 000000000..aca56b15c --- /dev/null +++ b/meta-digi-dey/recipes-graphics/lvgl/lv-drivers.inc @@ -0,0 +1,42 @@ +PACKAGECONFIG[drm] = ",,libdrm" +PACKAGECONFIG[fbdev] = ",," +PACKAGECONFIG[sdl] = ",,virtual/libsdl2" +PACKAGECONFIG[wayland] = ",,libxkbcommon wayland" + +LVGL_CONFIG_USE_DRM = "${@bb.utils.contains('PACKAGECONFIG', 'drm', '1', '0', d)}" +LVGL_CONFIG_DRM_CARD ?= "/dev/dri/card0" + +LVGL_CONFIG_USE_EVDEV = "${@bb.utils.contains_any('PACKAGECONFIG', 'drm fbdev', '1', '0', d)}" +LVGL_CONFIG_EVDEV_INPUT ?= "/dev/input/mouse0" + +LVGL_CONFIG_USE_FBDEV = "${@bb.utils.contains('PACKAGECONFIG', 'fbdev', '1', '0', d)}" + +LVGL_CONFIG_USE_SDL = "${@bb.utils.contains('PACKAGECONFIG', 'sdl', '1', '0', d)}" + +LVGL_CONFIG_USE_WAYLAND = "${@bb.utils.contains('PACKAGECONFIG', 'wayland', '1', '0', d)}" + +ALLOW_EMPTY:${PN} = "1" + +EXTRA_OECMAKE += "-Dinstall:BOOL=ON -DLIB_INSTALL_DIR=${baselib}" + +do_configure:append() { + # If there is a configuration template, start from that + [ -r "${S}/lv_drv_conf_template.h" ] && cp -Lv "${S}/lv_drv_conf_template.h" "${S}/lv_drv_conf.h" + + # Configure the software using sed + sed -e "s|#if 0 .*Set it to \"1\" to enable the content.*|#if 1 // Enabled by ${PN}|g" \ + \ + -e "s|\(^# define USE_DRM \).*|# define USE_DRM ${LVGL_CONFIG_USE_DRM}|g" \ + -e "s|\(^# define DRM_CARD \).*|# define DRM_CARD \"${LVGL_CONFIG_DRM_CARD}\"|g" \ + \ + -e "s|\(^# define USE_EVDEV \).*|# define USE_EVDEV ${LVGL_CONFIG_USE_EVDEV}|g" \ + -e "s|\(^# define EVDEV_NAME \).*|# define EVDEV_NAME \"${LVGL_CONFIG_EVDEV_INPUT}\"|g" \ + \ + -e "s|\(^# define USE_FBDEV \).*|# define USE_FBDEV ${LVGL_CONFIG_USE_FBDEV}|g" \ + \ + -e "s|\(^# define USE_SDL \).*|# define USE_SDL ${LVGL_CONFIG_USE_SDL}|g" \ + \ + -e "s|\(^# define USE_WAYLAND \).*|# define USE_WAYLAND ${LVGL_CONFIG_USE_WAYLAND}|g" \ + \ + -i "${S}/lv_drv_conf.h" +} diff --git a/meta-digi-dey/recipes-graphics/lvgl/lvgl-demo_8.3.0.bb b/meta-digi-dey/recipes-graphics/lvgl/lvgl-demo_8.3.0.bb new file mode 100644 index 000000000..ebe8355f8 --- /dev/null +++ b/meta-digi-dey/recipes-graphics/lvgl/lvgl-demo_8.3.0.bb @@ -0,0 +1,66 @@ +SUMMARY = "LVGL Demo Application" +HOMEPAGE = "https://github.com/digi-embedded/lv_port_linux_frame_buffer" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://LICENSE;md5=802d3d83ae80ef5f343050bf96cce3a4 \ + file://lv_drivers/LICENSE;md5=d6fc0df890c5270ef045981b516bb8f2 \ + file://lvgl/LICENCE.txt;md5=bf1198c89ae87f043108cea62460b03a" + +SRCBRANCH ?= "dey/master" + +SRC_URI = " \ + gitsm://github.com/digi-embedded/lv_port_linux_frame_buffer.git;branch=${SRCBRANCH};protocol=https \ +" +SRCREV = "f9426988a70f485ba7895bb1c26493f2fffcd957" + +EXTRA_OEMAKE = "DESTDIR=${D}" + +# By default, use wayland backend if possible. +# If unavailable, fall back to a secondary backend +MINIMAL_BACKEND ?= "fbdev" +MINIMAL_BACKEND:imxdrm = "drm" +MINIMAL_BACKEND:ccmp15 = "sdl" +PACKAGECONFIG = "${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland', '${MINIMAL_BACKEND}', d)}" + +require lv-drivers.inc + +inherit cmake + +S = "${WORKDIR}/git" + +TARGET_CFLAGS += "-I${STAGING_INCDIR}/libdrm" + +# Change DRM card used for i.MX8-based platforms +LVGL_CONFIG_DRM_CARD:mx8-generic-bsp = "/dev/dri/card1" + +LVGL_CONFIG_HOR_RES ?= "800" +LVGL_CONFIG_VER_RES ?= "480" + +do_configure:prepend() { + if [ "${LVGL_CONFIG_USE_DRM}" -eq 1 ] ; then + # Add libdrm build dependency + sed -i '/^target_link_libraries/ s@lvgl::drivers@& drm@' "${S}/CMakeLists.txt" + fi + + if [ "${LVGL_CONFIG_USE_SDL}" -eq 1 ] ; then + # Add libsdl build dependency + sed -i '/^target_link_libraries/ s@lvgl::drivers@& SDL2@' "${S}/CMakeLists.txt" + fi + + if [ "${LVGL_CONFIG_USE_WAYLAND}" -eq 1 ] ; then + # Add wayland build dependencies + sed -i '/^target_link_libraries/ s@lvgl::drivers@& wayland-client wayland-cursor xkbcommon@' "${S}/CMakeLists.txt" + fi + + # Configure the app's dimensions + sed -e "s|\(^#define *LV_DRV_DISP_HOR_RES *\).*|\1${LVGL_CONFIG_HOR_RES}|g" \ + -e "s|\(^#define *LV_DRV_DISP_VER_RES *\).*|\1${LVGL_CONFIG_VER_RES}|g" \ + \ + -i "${S}/lv_drv_conf.h" +} + +do_install:append() { + install -d ${D}${bindir} + install -m 0755 ${B}/lvgl_fb ${D}${bindir}/lvgl_demo +} + +COMPATIBLE_MACHINE = "(ccimx6$|ccimx6ul|ccimx8m|ccimx8x|ccimx93|ccmp15)" diff --git a/meta-digi-dey/recipes-graphics/packagegroups/packagegroup-dey-lvgl.bb b/meta-digi-dey/recipes-graphics/packagegroups/packagegroup-dey-lvgl.bb new file mode 100644 index 000000000..f00ea6a1e --- /dev/null +++ b/meta-digi-dey/recipes-graphics/packagegroups/packagegroup-dey-lvgl.bb @@ -0,0 +1,11 @@ +# +# Copyright (C) 2023 Digi International Inc. +# +SUMMARY = "LVGL packagegroup for DEY image" + +PACKAGE_ARCH = "${MACHINE_ARCH}" +inherit packagegroup + +RDEPENDS:${PN} += " \ + lvgl-demo \ +" diff --git a/meta-digi-dey/recipes-support/libcap/libcap_%.bbappend b/meta-digi-dey/recipes-support/libcap/libcap_%.bbappend new file mode 100644 index 000000000..d36eea536 --- /dev/null +++ b/meta-digi-dey/recipes-support/libcap/libcap_%.bbappend @@ -0,0 +1,7 @@ +# Copyright (C) 2024 Digi International Inc. + +# Don't link the pam_cap module against libpam at build-time to avoid +# a libpam dependency in the recovery initramfs- +EXTRA_OEMAKE += " \ + FORCELINKPAM=no \ +" diff --git a/meta-digi-dey/recipes-support/swupdate/swupdate/defconfig b/meta-digi-dey/recipes-support/swupdate/swupdate/defconfig index 8b52b25d9..464fe703f 100644 --- a/meta-digi-dey/recipes-support/swupdate/swupdate/defconfig +++ b/meta-digi-dey/recipes-support/swupdate/swupdate/defconfig @@ -14,7 +14,7 @@ # CONFIG_CURL_SSL is not set # CONFIG_DISKFORMAT is not set # CONFIG_SYSTEMD is not set -CONFIG_DEFAULT_CONFIG_FILE="/etc/swupdate.cfg" +CONFIG_DEFAULT_CONFIG_FILE="/etc/swupdate.config" CONFIG_SCRIPTS=y # CONFIG_HW_COMPATIBILITY is not set CONFIG_SW_VERSIONS_FILE="/etc/sw-versions" diff --git a/meta-digi-dey/recipes-support/swupdate/swupdate/swupdate.config b/meta-digi-dey/recipes-support/swupdate/swupdate/swupdate.config new file mode 100644 index 000000000..6b754a834 --- /dev/null +++ b/meta-digi-dey/recipes-support/swupdate/swupdate/swupdate.config @@ -0,0 +1,38 @@ +# SWUpdate configuration file +# +# SPDX-FileCopyrightText: 2014-2021 Stefano Babic +# SPDX-License-Identifier: CC0-1.0 +# +# This is responsible to pass configuration and parameters +# to SWUpdate. Most of configuration can be overwritten +# with command line parameters. +# + +globals : { + verbose = true; + loglevel = 5; + syslog = true; + #mtd-blacklist + #public-key-file +}; + +# logcolors : set colors for output to stdout / stderr +# color is set indivisually for each level +# each entry is in the format +# loglevel = color:attribute +# where loglevel is one of: +# "error","warning", "info", "debug", "trace" +# and color is one of: +# "black", "red", "green", "yellow", "blue", "magenta", "cyan", "white" +# and attribute is one of: +# "normal", "bright", "dim", "underline", "blink", "reverse", "hidden" +# +# Example : +# error = "red"; +# +logcolors : { + error = "red:blink"; + trace = "green:normal"; + debug = "magenta:normal"; + warning = "yellow:underline"; +}; diff --git a/meta-digi-dey/recipes-support/swupdate/swupdate_%.bbappend b/meta-digi-dey/recipes-support/swupdate/swupdate_%.bbappend index de0feed77..2e3b33e6c 100644 --- a/meta-digi-dey/recipes-support/swupdate/swupdate_%.bbappend +++ b/meta-digi-dey/recipes-support/swupdate/swupdate_%.bbappend @@ -12,12 +12,27 @@ SRC_URI += " \ ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'file://systemd.cfg', '', d)} \ ${@bb.utils.contains('STORAGE_MEDIA', 'mtd', 'file://mtd.cfg', '', d)} \ ${@oe.utils.conditional('TRUSTFENCE_SIGN', '1', 'file://signed_images.cfg', '', d)} \ + file://swupdate.config \ " do_install:append() { # Copy the 'progress' binary. install -d ${D}${bindir}/ install -m 0755 tools/swupdate-progress ${D}${bindir}/progress + + # Copy config file + install -d ${D}${sysconfdir}/ + install -m 0755 ${WORKDIR}/swupdate.config ${D}${sysconfdir} + + # Add MTD blacklist + if ${@oe.utils.conditional('STORAGE_MEDIA', 'mtd', 'true', 'false', d)}; then + sed -i "s,\(^\s*\)#mtd-blacklist,\1mtd-blacklist = \"${SWUPDATE_MTD_BLACKLIST}\",g" ${D}${sysconfdir}/swupdate.config + fi + + # Add public-key-file setting to config file if TrustFence is enabled + if ${@oe.utils.conditional('TRUSTFENCE_ENABLED', '1', 'true', 'false', d)}; then + sed -i "s,\(^\s*\)#public-key-file,\1public-key-file = \"${sysconfdir}/ssl/certs/key.pub\",g" ${D}${sysconfdir}/swupdate.config + fi } pkg_postinst_ontarget:${PN}() { diff --git a/sdk/build-github.sh b/sdk/build-github.sh index 36ad9a8f4..9f1e07031 100755 --- a/sdk/build-github.sh +++ b/sdk/build-github.sh @@ -14,9 +14,11 @@ # !Description: Yocto autobuild script from Jenkins. # # Parameters set by Jenkins: -# DY_PLATFORMS: Platforms to build -# DY_REVISION: Revision of the manifest repository (for 'repo init') -# DY_TARGET: Target image (the default is platform dependent) +# DY_BUILD_RELEASE: Build for release mode +# DY_BUILD_TCHAIN: Build toolchains for DEY images +# DY_PLATFORMS: Platforms to build +# DY_REVISION: Revision of the manifest repository (for 'repo init') +# DY_TARGET: Target image (the default is platform dependent) # #=============================================================================== @@ -56,10 +58,15 @@ copy_images() { # Copy individual packages only for 'release' builds, not for 'daily'. # For 'daily' builds just copy the firmware images (the buildserver # cannot afford such amount of disk space) - if echo "${JOB_NAME}" | grep -qs 'dey.*release'; then + if [ "${DY_BUILD_RELEASE}" = "true" ]; then cp -r tmp/deploy/* "${1}"/ else cp -r tmp/deploy/images "${1}"/ + if [ "${DY_BUILD_TCHAIN}" = "true" ]; then + if [ -d tmp/deploy/sdk ]; then + cp -r tmp/deploy/sdk "${1}"/ + fi + fi fi # Images directory post-processing @@ -90,6 +97,7 @@ purge_sstate() { packagegroup-dey-debug \ packagegroup-dey-examples \ packagegroup-dey-gstreamer \ + packagegroup-dey-lvgl \ packagegroup-dey-network \ packagegroup-dey-qt \ packagegroup-dey-webkit \ @@ -109,9 +117,15 @@ swu_recipe_name() { fi } -# Sanity checks (Jenkins environment) -[ -z "${DY_REVISION}" ] && error "DY_REVISION not specified" -[ -z "${WORKSPACE}" ] && error "WORKSPACE not specified" +# Sanity check (Jenkins environment) +[ -z "${DY_REVISION}" ] && error "DY_REVISION not specified" +[ -z "${WORKSPACE}" ] && error "WORKSPACE not specified" + +# Set default settings if Jenkins does not do it +[ -z "${DY_BUILD_RELEASE}" ] && [[ "${JOB_NAME}" =~ dey-.*-release ]] && DY_BUILD_RELEASE="true" + +# If DY_BUILD_TCHAIN is unset, set it for release jobs +[ -z "${DY_BUILD_TCHAIN}" ] && [ "${DY_BUILD_RELEASE}" = "true" ] && DY_BUILD_TCHAIN="true" # Per-platform data while read -r _pl _tgt; do @@ -138,7 +152,8 @@ _EOF_ DY_PLATFORMS="${DY_PLATFORMS:-${AVAILABLE_PLATFORMS}}" YOCTO_IMGS_DIR="${WORKSPACE}/images" -YOCTO_INST_DIR="${WORKSPACE}/dey.$(echo "${DY_REVISION}" | tr '/' '_')" +YOCTO_INST_DIR="${WORKSPACE}/digi-yocto-sdk-github.$(echo "${DY_REVISION}" | tr '/' '_')" +YOCTO_DOWNLOAD_DIR="${DY_DOWNLOADS:-${WORKSPACE}}/downloads" YOCTO_PROJ_DIR="${WORKSPACE}/projects" # If CPUS is unset, set it with the machine cpus @@ -149,8 +164,8 @@ fi printf "\n[INFO] Build Yocto \"%s\" for \"%s\" (cpus=%s)\n\n" "${DY_REVISION}" "${DY_PLATFORMS}" "${CPUS}" -# Install DEY -rm -rf "${YOCTO_INST_DIR}" && mkdir -p "${YOCTO_INST_DIR}" +# Install/Update Digi's Yocto SDK +mkdir -p "${YOCTO_INST_DIR}" if pushd "${YOCTO_INST_DIR}"; then # Use git ls-remote to check the revision type if [ "${DY_REVISION}" != "master" ]; then @@ -174,13 +189,20 @@ if pushd "${YOCTO_INST_DIR}"; then popd fi -# Create projects and build +# Clean downloads directory +if [ "${DY_RM_DOWNLOADS}" = "true" ]; then + printf "\n[INFO] Removing the downloads folder.\n" + rm -rf "${YOCTO_DOWNLOAD_DIR}" +fi + +# Clean images and projects folders rm -rf "${YOCTO_IMGS_DIR}" "${YOCTO_PROJ_DIR}" + +# Create projects and build for platform in ${DY_PLATFORMS}; do # The variable _tgt got its dashes converted to # underscores, so we must convert also the ones in ${platform}. eval "platform_targets=\"\${${platform//-/_}_tgt}\"" - _this_prj_dir="${YOCTO_PROJ_DIR}/${platform}" _this_img_dir="${YOCTO_IMGS_DIR}/${platform}" mkdir -p "${_this_img_dir}" "${_this_prj_dir}" @@ -192,7 +214,7 @@ for platform in ${DY_PLATFORMS}; do # shellcheck disable=SC1091,SC2086 MKP_PAGER="" . ${YOCTO_INST_DIR}/mkproject.sh -p "${platform}" <<< "y" # Set a common DL_DIR and SSTATE_DIR for all platforms - sed -i -e "/^#DL_DIR ?=/cDL_DIR ?= \"${YOCTO_PROJ_DIR}/downloads\"" \ + sed -i -e "/^#DL_DIR ?=/cDL_DIR ?= \"${YOCTO_DOWNLOAD_DIR}\"" \ -e "/^#SSTATE_DIR ?=/cSSTATE_DIR ?= \"${YOCTO_PROJ_DIR}/sstate-cache\"" \ conf/local.conf { @@ -204,6 +226,11 @@ for platform in ${DY_PLATFORMS}; do printf "\n[INFO] Building the %s target.\n" "${target}" # shellcheck disable=SC2046 time bitbake "${target}" $(swu_recipe_name "${target}") + # Build the toolchain for DEY images + if [ "${DY_BUILD_TCHAIN}" = "true" ] && echo "${target}" | grep -qs '^\(core\|dey\)-image-[^-]\+$'; then + printf "\n[INFO] Building the toolchain for %s.\n" "${target}" + time bitbake -c populate_sdk "${target}" + fi done purge_sstate ) diff --git a/sdk/build.sh b/sdk/build.sh index 0c803c107..80f189f4d 100755 --- a/sdk/build.sh +++ b/sdk/build.sh @@ -14,12 +14,13 @@ # !Description: Yocto autobuild script from Jenkins. # # Parameters set by Jenkins: +# DY_BUILD_RELEASE: Build for release mode # DY_BUILD_TCHAIN: Build toolchains for DEY images # DY_DISTRO: Distribution name (the default is 'dey') # DY_PLATFORMS: Platforms to build # DY_REVISION: Revision of the manifest repository (for 'repo init') # DY_RM_WORK: Remove the package working folders to save disk space. -# DY_TARGET: Target image (the default is 'dey-image-qt') +# DY_TARGET: Target image (the default is platform dependent) # DY_USE_MIRROR: Use internal Digi mirror to download packages # DY_CVE_REPORT: Generate Vigiles CVE report # DY_VIGILES_DIR: Path to Vigiles configuration files on the build server @@ -118,6 +119,7 @@ purge_sstate() { packagegroup-dey-debug \ packagegroup-dey-examples \ packagegroup-dey-gstreamer \ + packagegroup-dey-lvgl \ packagegroup-dey-network \ packagegroup-dey-qt \ packagegroup-dey-webkit \ @@ -138,7 +140,6 @@ swu_recipe_name() { } # Sanity check (Jenkins environment) -[ -z "${DY_PLATFORMS}" ] && error "DY_PLATFORMS not specified" [ -z "${DY_REVISION}" ] && error "DY_REVISION not specified" [ -z "${DY_RM_WORK}" ] && error "DY_RM_WORK not specified" [ -z "${DY_USE_MIRROR}" ] && error "DY_USE_MIRROR not specified" @@ -164,27 +165,31 @@ fi # Per-platform data while read -r _pl _tgt; do + AVAILABLE_PLATFORMS="${AVAILABLE_PLATFORMS:+${AVAILABLE_PLATFORMS} }${_pl}" # shellcheck disable=SC2015 [ -n "${DY_TARGET}" ] && _tgt="${DY_TARGET}" || true # Dashes are not allowed in variables so let's substitute them on # the fly with underscores. eval "${_pl//-/_}_tgt=\"${_tgt//,/ }\"" done<<-_EOF_ - ccimx8mm-dvk dey-image-qt,dey-image-crank,dey-image-webkit - ccimx8mn-dvk dey-image-qt,dey-image-crank,dey-image-webkit - ccimx8x-sbc-pro dey-image-qt,dey-image-crank,dey-image-webkit + ccimx8mm-dvk dey-image-qt,dey-image-crank,dey-image-webkit,dey-image-lvgl + ccimx8mn-dvk dey-image-qt,dey-image-crank,dey-image-webkit,dey-image-lvgl + ccimx8x-sbc-pro dey-image-qt,dey-image-crank,dey-image-webkit,dey-image-lvgl ccimx8x-sbc-express dey-image-qt - ccimx6qpsbc dey-image-qt,dey-image-crank - ccimx6sbc dey-image-qt,dey-image-crank - ccimx6ulsbc core-image-base,dey-image-qt,dey-image-crank + ccimx6qpsbc dey-image-qt,dey-image-crank,dey-image-webkit,dey-image-lvgl + ccimx6sbc dey-image-qt,dey-image-crank,dey-image-webkit,dey-image-lvgl + ccimx6ulsbc core-image-base,dey-image-qt,dey-image-crank,dey-image-lvgl ccimx6ulstarter core-image-base ccimx6ulsom dey-image-mft-module-min ccimx6ulrftest dey-image-mft-module-rf - ccmp15-dvk dey-image-qt,dey-image-crank,dey-image-webkit + ccmp15-dvk dey-image-qt,dey-image-crank,dey-image-webkit,dey-image-lvgl ccmp13-dvk core-image-base - ccimx93-dvk dey-image-qt + ccimx93-dvk dey-image-qt,dey-image-lvgl _EOF_ +# Set default values if not provided by Jenkins +DY_PLATFORMS="${DY_PLATFORMS:-${AVAILABLE_PLATFORMS}}" + YOCTO_IMGS_DIR="${WORKSPACE}/images" YOCTO_INST_DIR="${WORKSPACE}/digi-yocto-sdk.$(echo "${DY_REVISION}" | tr '/' '_')" YOCTO_DOWNLOAD_DIR="${DY_DOWNLOADS:-${WORKSPACE}}/downloads" diff --git a/sdk/config/ccimx6qpsbc/conf-notes.txt b/sdk/config/ccimx6qpsbc/conf-notes.txt index b49f5e14b..7c10edbcf 100644 --- a/sdk/config/ccimx6qpsbc/conf-notes.txt +++ b/sdk/config/ccimx6qpsbc/conf-notes.txt @@ -9,3 +9,8 @@ Digi Embedded Yocto provides the following image recipes: By default the image is XWayland-based so it provides a full Weston desktop environment. + + * dey-image-lvgl: graphical LVGL image + + By default the image is XWayland-based so it provides a full Weston + desktop environment. diff --git a/sdk/config/ccimx6sbc/conf-notes.txt b/sdk/config/ccimx6sbc/conf-notes.txt index b49f5e14b..7c10edbcf 100644 --- a/sdk/config/ccimx6sbc/conf-notes.txt +++ b/sdk/config/ccimx6sbc/conf-notes.txt @@ -9,3 +9,8 @@ Digi Embedded Yocto provides the following image recipes: By default the image is XWayland-based so it provides a full Weston desktop environment. + + * dey-image-lvgl: graphical LVGL image + + By default the image is XWayland-based so it provides a full Weston + desktop environment. diff --git a/sdk/config/ccimx6ulsbc/conf-notes.txt b/sdk/config/ccimx6ulsbc/conf-notes.txt index 8a9a68710..44fd937f9 100644 --- a/sdk/config/ccimx6ulsbc/conf-notes.txt +++ b/sdk/config/ccimx6ulsbc/conf-notes.txt @@ -5,6 +5,11 @@ Digi Embedded Yocto provides the following image recipes: By default the image is X11-based so it provides a full SATO theme desktop environment. + * dey-image-lvgl: graphical LVGL image + + By default the image is X11-based so it provides a full SATO theme + desktop environment. + * core-image-base: a console-only image Expansion of native core-image-base by including all the support for the diff --git a/sdk/config/ccimx8mm-dvk/conf-notes.txt b/sdk/config/ccimx8mm-dvk/conf-notes.txt index b49f5e14b..7c10edbcf 100644 --- a/sdk/config/ccimx8mm-dvk/conf-notes.txt +++ b/sdk/config/ccimx8mm-dvk/conf-notes.txt @@ -9,3 +9,8 @@ Digi Embedded Yocto provides the following image recipes: By default the image is XWayland-based so it provides a full Weston desktop environment. + + * dey-image-lvgl: graphical LVGL image + + By default the image is XWayland-based so it provides a full Weston + desktop environment. diff --git a/sdk/config/ccimx8mn-dvk/conf-notes.txt b/sdk/config/ccimx8mn-dvk/conf-notes.txt index b49f5e14b..7c10edbcf 100644 --- a/sdk/config/ccimx8mn-dvk/conf-notes.txt +++ b/sdk/config/ccimx8mn-dvk/conf-notes.txt @@ -9,3 +9,8 @@ Digi Embedded Yocto provides the following image recipes: By default the image is XWayland-based so it provides a full Weston desktop environment. + + * dey-image-lvgl: graphical LVGL image + + By default the image is XWayland-based so it provides a full Weston + desktop environment. diff --git a/sdk/config/ccimx8x-sbc-express/conf-notes.txt b/sdk/config/ccimx8x-sbc-express/conf-notes.txt index b49f5e14b..7c10edbcf 100644 --- a/sdk/config/ccimx8x-sbc-express/conf-notes.txt +++ b/sdk/config/ccimx8x-sbc-express/conf-notes.txt @@ -9,3 +9,8 @@ Digi Embedded Yocto provides the following image recipes: By default the image is XWayland-based so it provides a full Weston desktop environment. + + * dey-image-lvgl: graphical LVGL image + + By default the image is XWayland-based so it provides a full Weston + desktop environment. diff --git a/sdk/config/ccimx8x-sbc-pro/conf-notes.txt b/sdk/config/ccimx8x-sbc-pro/conf-notes.txt index b49f5e14b..7c10edbcf 100644 --- a/sdk/config/ccimx8x-sbc-pro/conf-notes.txt +++ b/sdk/config/ccimx8x-sbc-pro/conf-notes.txt @@ -9,3 +9,8 @@ Digi Embedded Yocto provides the following image recipes: By default the image is XWayland-based so it provides a full Weston desktop environment. + + * dey-image-lvgl: graphical LVGL image + + By default the image is XWayland-based so it provides a full Weston + desktop environment. diff --git a/sdk/config/ccimx93-dvk/conf-notes.txt b/sdk/config/ccimx93-dvk/conf-notes.txt index d9cb627a2..4d03f59dd 100644 --- a/sdk/config/ccimx93-dvk/conf-notes.txt +++ b/sdk/config/ccimx93-dvk/conf-notes.txt @@ -5,3 +5,8 @@ Digi Embedded Yocto provides the following image recipes: By default the image is XWayland-based so it provides a full Weston desktop environment. + * dey-image-lvgl: graphical LVGL image + + By default the image is XWayland-based so it provides a full Weston + desktop environment. + diff --git a/sdk/config/ccmp15-dvk/conf-notes.txt b/sdk/config/ccmp15-dvk/conf-notes.txt index 61380b8fe..a0a98b6e5 100644 --- a/sdk/config/ccmp15-dvk/conf-notes.txt +++ b/sdk/config/ccmp15-dvk/conf-notes.txt @@ -10,6 +10,11 @@ Digi Embedded Yocto provides the following image recipes: By default the image is Wayland-based so it provides a full Weston desktop environment. + * dey-image-lvgl: graphical LVGL image + + By default the image is Wayland-based so it provides a full Weston + desktop environment. + * core-image-base: a console-only image Expansion of native core-image-base by including all the support for the