From 7239d52bf59016e722bc88890d6c9be3b111b545 Mon Sep 17 00:00:00 2001 From: Max Krummenacher Date: Mon, 29 Jan 2024 11:33:57 +0100 Subject: packagegroup-fsl-isp: drop the basler-camera-dev package This pulls in all other dev packages. It looks like the unversioned shared object is not (no longer?) needed, i.e. the driver points to the versioned object. | readelf --dynamic opt/imx8-isp/bin/daA3840_30mc.drv | ... | 0x000000000000000e (SONAME) Library soname: [libdaA3840_30mc.so.1] (/usr/lib/libdaA3840_30mc.so is the only file in the -dev package.) Signed-off-by: Max Krummenacher --- recipes-fsl/packagegroups/packagegroup-fsl-isp.bb | 1 - 1 file changed, 1 deletion(-) diff --git a/recipes-fsl/packagegroups/packagegroup-fsl-isp.bb b/recipes-fsl/packagegroups/packagegroup-fsl-isp.bb index 415587a82..09eac053b 100644 --- a/recipes-fsl/packagegroups/packagegroup-fsl-isp.bb +++ b/recipes-fsl/packagegroups/packagegroup-fsl-isp.bb @@ -8,7 +8,6 @@ ISP_PKGS ?= "" ISP_PKGS:mx8mp-nxp-bsp = " \ isp-imx \ basler-camera \ - basler-camera-dev \ kernel-module-isp-vvcam \ " RDEPENDS:${PN} = " \ -- cgit v1.2.3-54-g00ecf From e97baaae6fd79d9c9a6b53dc712163c6b68d011b Mon Sep 17 00:00:00 2001 From: Max Krummenacher Date: Sun, 19 Jan 2025 16:21:49 +0100 Subject: ixp-imx: update to 4.2.2.24.4 Make tuningext a packageconfig as it no longer builds with latest master (walnascar): isp-imx contains the 3rd party cpp-netlib package. Compiling that package against boost 1.87 results in build errors. boost 1.87 is provided with latest master (walnascar). Compare also with meta-oe commit a46de2745b30 ("cpp-netlib: Skip recipe, not buildable with boost >= 1.87") Drop patch. Fix now present in package sources. Add jsoncpp to DEPENDS as the package no longer compiles its own version thereoff and dynamically links against the OE provided one. Sync CMake options with upstream recipe. The binary blobs provided now link against libtinyxml2.so.10. Drop the fix. The binary blobs provided still link against libjsoncpp.so.25, but OE provides libjsoncpp.so.26. Fixup the binaries. The package now provides a Makefile with a install task. Use that. Signed-off-by: Max Krummenacher --- ...pp-netlib-parsers.ipp-add-missing-include.patch | 44 --------- recipes-bsp/isp-imx/isp-imx_4.2.2.24.0.bb | 105 --------------------- recipes-bsp/isp-imx/isp-imx_4.2.2.24.4.bb | 95 +++++++++++++++++++ 3 files changed, 95 insertions(+), 149 deletions(-) delete mode 100644 recipes-bsp/isp-imx/isp-imx/0001-cpp-netlib-parsers.ipp-add-missing-include.patch delete mode 100644 recipes-bsp/isp-imx/isp-imx_4.2.2.24.0.bb create mode 100644 recipes-bsp/isp-imx/isp-imx_4.2.2.24.4.bb diff --git a/recipes-bsp/isp-imx/isp-imx/0001-cpp-netlib-parsers.ipp-add-missing-include.patch b/recipes-bsp/isp-imx/isp-imx/0001-cpp-netlib-parsers.ipp-add-missing-include.patch deleted file mode 100644 index 3f04000cf..000000000 --- a/recipes-bsp/isp-imx/isp-imx/0001-cpp-netlib-parsers.ipp-add-missing-include.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 15aae364fb52df30e4a49e73e2048fdc633e6868 Mon Sep 17 00:00:00 2001 -From: Max Krummenacher -Date: Sun, 8 Oct 2023 09:15:54 -0300 -Subject: [PATCH] cpp-netlib: parsers.ipp: add missing include - -With the update to boost from 1.82.0 -> 1.83.0 we now get compiler errors: - -| .../isp-imx/4.2.2.22.0/isp-imx-4.2.2.22.0/utils3rd/3rd/cpp-netlib/boost/network/protocol/http/server/impl/parsers.ipp:58:3: error: 'u8_to_u32_iterator' was not declared in this scope - -Add the missing explicit include. Before the file was indirectly included from qi.hpp: - -| In file included from .../isp-imx/4.2.2.22.0/recipe-sysroot/usr/include/boost/regex/pending/unicode_iterator.hpp:27, -| from .../isp-imx/4.2.2.22.0/recipe-sysroot/usr/include/boost/spirit/home/support/utf8.hpp:15, -| from .../isp-imx/4.2.2.22.0/recipe-sysroot/usr/include/boost/spirit/home/support/info.hpp:17, -| from .../isp-imx/4.2.2.22.0/recipe-sysroot/usr/include/boost/spirit/home/qi/domain.hpp:16, -| from .../isp-imx/4.2.2.22.0/recipe-sysroot/usr/include/boost/spirit/home/qi/meta_compiler.hpp:15, -| from .../isp-imx/4.2.2.22.0/recipe-sysroot/usr/include/boost/spirit/home/qi/action/action.hpp:14, -| from .../isp-imx/4.2.2.22.0/recipe-sysroot/usr/include/boost/spirit/home/qi/action.hpp:14, -| from .../isp-imx/4.2.2.22.0/recipe-sysroot/usr/include/boost/spirit/home/qi.hpp:14, -| from .../isp-imx/4.2.2.22.0/recipe-sysroot/usr/include/boost/spirit/include/qi.hpp:16, -| from .../isp-imx/4.2.2.22.0/isp-imx-4.2.2.22.0/utils3rd/3rd/cpp-netlib/boost/network/protocol/http/server/impl/parsers.ipp:5, - -Upstream-Status: Pending - -Signed-off-by: Max Krummenacher ---- - .../boost/network/protocol/http/server/impl/parsers.ipp | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/utils3rd/3rd/cpp-netlib/boost/network/protocol/http/server/impl/parsers.ipp b/utils3rd/3rd/cpp-netlib/boost/network/protocol/http/server/impl/parsers.ipp -index c31e60e..2b83fbe 100755 ---- a/utils3rd/3rd/cpp-netlib/boost/network/protocol/http/server/impl/parsers.ipp -+++ b/utils3rd/3rd/cpp-netlib/boost/network/protocol/http/server/impl/parsers.ipp -@@ -13,6 +13,7 @@ - #include - #include - #include -+#include - - #ifdef BOOST_NETWORK_NO_LIB - #ifndef BOOST_NETWORK_INLINE --- -2.35.3 - diff --git a/recipes-bsp/isp-imx/isp-imx_4.2.2.24.0.bb b/recipes-bsp/isp-imx/isp-imx_4.2.2.24.0.bb deleted file mode 100644 index 9e0f02656..000000000 --- a/recipes-bsp/isp-imx/isp-imx_4.2.2.24.0.bb +++ /dev/null @@ -1,105 +0,0 @@ -# Copyright 2020-2023 NXP - -DESCRIPTION = "i.MX Verisilicon Software ISP" -LICENSE = "Proprietary" -LIC_FILES_CHKSUM = "file://COPYING;md5=2827219e81f28aba7c6a569f7c437fa7" -DEPENDS = "boost libdrm virtual/libg2d libtinyxml2 patchelf-native" - -SRC_URI = " \ - ${FSL_MIRROR}/${BP}.bin;fsl-eula=true \ - file://0001-cpp-netlib-parsers.ipp-add-missing-include.patch \ -" - -SRC_URI[sha256sum] = "34b23f5b9f0856a8f5722e339a7ad4ccf4d99614788598306ff8b20093c1e846" - -inherit fsl-eula-unpack cmake systemd use-imx-headers - -# Build the sub-folder appshell -OECMAKE_SOURCEPATH = "${S}/appshell" - -# Use make instead of ninja -OECMAKE_GENERATOR = "Unix Makefiles" - -# Workaround for linking issues seen with gold linker -LDFLAGS:append = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', ' -fuse-ld=bfd ', '', d)}" - -SYSTEMD_SERVICE:${PN} = "imx8-isp.service" - -EXTRA_OECMAKE += " \ - -DSDKTARGETSYSROOT=${STAGING_DIR_HOST} \ - -DCMAKE_BUILD_TYPE=release \ - -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \ - -DCMAKE_INSTALL_LIBDIR=${libdir} \ - -DISP_VERSION=ISP8000NANO_V1802 \ - -DPLATFORM=ARM64 \ - -DAPPMODE=V4L2 \ - -DTUNINGEXT=1 \ - -DQTLESS=1 \ - -DFULL_SRC_COMPILE=1 \ - -DWITH_DRM=1 \ - -DWITH_DWE=1 \ - -DSERVER_LESS=1 \ - -DSUBDEV_V4L2=1 \ - -DENABLE_IRQ=1 \ - -DPARTITION_BUILD=0 \ - -D3A_SRC_BUILD=0 \ - -DIMX_G2D=ON \ - -Wno-dev \ -" - -do_configure:prepend () { - # FIXME: Should be rebuild. - patchelf --replace-needed libtinyxml2.so.9 libtinyxml2.so.10 ${S}/units/cam_device/proprietories/lib/libcam_device.so - patchelf --replace-needed libtinyxml2.so.9 libtinyxml2.so.10 ${S}/mediacontrol/lib/arm-64/fpga/libcam_device.so -} - -do_install() { - # FIXME: provided by the basler-camera package, do not install them here additionally - rm -f ${S}/dewarp/dewarp_config//daA3840_30mc*.json - - install -d ${D}/${libdir} - install -d ${D}/${includedir} - install -d ${D}/opt/imx8-isp/bin - install -d ${D}/opt/imx8-isp/bin/dewarp_config - - cp -r ${B}/generated/release/bin/*_test ${D}/opt/imx8-isp/bin - cp -r ${B}/generated/release/bin/*.xml ${D}/opt/imx8-isp/bin - cp -r ${B}/generated/release/bin/*.drv ${D}/opt/imx8-isp/bin - cp -r ${B}/generated/release/bin/tuningext ${D}/opt/imx8-isp/bin - cp -r ${B}/generated/release/bin/isp_media_server ${D}/opt/imx8-isp/bin - cp -r ${B}/generated/release/bin/vvext ${D}/opt/imx8-isp/bin - - cp -r ${B}/generated/release/lib/*.so* ${D}/${libdir} - cp -r ${B}/generated/release/include/* ${D}/${includedir} - - cp -r ${S}/dewarp/dewarp_config/ ${D}/opt/imx8-isp/bin - cp ${S}/imx/run.sh ${D}/opt/imx8-isp/bin - cp ${S}/imx/start_isp.sh ${D}/opt/imx8-isp/bin - - chmod +x ${D}/opt/imx8-isp/bin/run.sh - chmod +x ${D}/opt/imx8-isp/bin/start_isp.sh - - if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then - install -d ${D}${systemd_system_unitdir} - install -m 0644 ${S}/imx/imx8-isp.service ${D}${systemd_system_unitdir} - fi -} - -# The build contains a mix of versioned and unversioned libraries, so -# the default packaging configuration needs some modification so that -# unversioned .so libraries go to the main package and versioned .so -# symlinks go to -dev. -FILES_SOLIBSDEV = "" -FILES:${PN} += "/opt ${libdir}/lib*${SOLIBSDEV}" -FILES:${PN}-dev += "${FILES_SOLIBS_VERSIONED}" -FILES_SOLIBS_VERSIONED = " \ - ${libdir}/libcppnetlib-client-connections.so \ - ${libdir}/libcppnetlib-server-parsers.so \ - ${libdir}/libcppnetlib-uri.so \ - ${libdir}/libjsoncpp.so \ - ${libdir}/libos08a20.so \ -" - -RDEPENDS:${PN} = "libdrm" - -COMPATIBLE_MACHINE = "(mx8mp-nxp-bsp)" diff --git a/recipes-bsp/isp-imx/isp-imx_4.2.2.24.4.bb b/recipes-bsp/isp-imx/isp-imx_4.2.2.24.4.bb new file mode 100644 index 000000000..8694489b0 --- /dev/null +++ b/recipes-bsp/isp-imx/isp-imx_4.2.2.24.4.bb @@ -0,0 +1,95 @@ +# Copyright 2020-2023 NXP + +DESCRIPTION = "i.MX Verisilicon Software ISP" +LICENSE = "Proprietary" +LIC_FILES_CHKSUM = "file://COPYING;md5=ca53281cc0caa7e320d4945a896fb837" +DEPENDS = "boost libdrm virtual/libg2d libtinyxml2 jsoncpp patchelf-native" + +SRC_URI = " \ + ${FSL_MIRROR}/${BP}-${IMX_SRCREV_ABBREV}.bin;fsl-eula=true \ +" +IMX_SRCREV_ABBREV = "8527c7b" +S = "${WORKDIR}/${BP}-${IMX_SRCREV_ABBREV}" + +SRC_URI[sha256sum] = "481e49e9da6d7783d6c28385bb68463eac7b9e9fef6ea958950260a8ad6b1e4c" + +inherit fsl-eula-unpack cmake systemd use-imx-headers + +PACKAGECONFIG = "" +# Note: building with tuningext fails with boost 1.87. +# (update to 1.87 with walnascar) +PACKAGECONFIG[tuningext] = "-DTUNINGEXT=1,-DTUNINGEXT=0" + +# Build the sub-folder appshell +OECMAKE_SOURCEPATH = "${S}/appshell" + +# Use make instead of ninja +OECMAKE_GENERATOR = "Unix Makefiles" + +# Workaround for linking issues seen with gold linker +LDFLAGS:append = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', ' -fuse-ld=bfd ', '', d)}" + +SYSTEMD_SERVICE:${PN} = "imx8-isp.service" + +EXTRA_OECMAKE += " \ + -DSDKTARGETSYSROOT=${STAGING_DIR_HOST} \ + -DCMAKE_BUILD_TYPE=release \ + -DISP_VERSION=ISP8000NANO_V1802 \ + -DPLATFORM=ARM64 \ + -DQTLESS=1 \ + -DFULL_SRC_COMPILE=1 \ + -DWITH_DRM=1 \ + -DWITH_DWE=1 \ + -DSUBDEV_V4L2=1 \ + -DPARTITION_BUILD=0 \ + -D3A_SRC_BUILD=0 \ + -DIMX_G2D=ON \ + -Wno-dev \ +" + +do_configure:prepend () { + # FIXME: should be rebuild. + patchelf --replace-needed libjsoncpp.so.25 libjsoncpp.so.26 ${S}/mediacontrol/install/bin/isp_media_server + patchelf --replace-needed libjsoncpp.so.25 libjsoncpp.so.26 ${S}/mediacontrol/install/lib/libmedia_server.so + patchelf --replace-needed libjsoncpp.so.25 libjsoncpp.so.26 ${S}/tuningext/install/tuningext +} + +do_install() { + # FIXME: provided by the basler-camera package, do not install them here additionally + rm -f ${S}/dewarp/dewarp_config//daA3840_30mc*.json + + # The Makefile unconditionally installs tuningext even if it is not built + if ${@bb.utils.contains('PACKAGECONFIG','tuningext','false','true',d)}; then + touch ${B}/generated/release/bin/tuningext + fi + + oe_runmake -f ${S}/Makefile install INSTALL_DIR=${D} SOURCE_DIR=${S} + + if ${@bb.utils.contains('PACKAGECONFIG','tuningext','false','true',d)}; then + rm ${D}/opt/imx8-isp/bin/tuningext + fi + + if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then + install -d ${D}${systemd_system_unitdir} + install -m 0644 ${S}/imx/imx8-isp.service ${D}${systemd_system_unitdir} + fi + +} + +# The build contains a mix of versioned and unversioned libraries, so +# the default packaging configuration needs some modification so that +# unversioned .so libraries go to the main package and versioned .so +# symlinks go to -dev. +FILES_SOLIBSDEV = "" +FILES:${PN} += "/opt ${libdir}/lib*${SOLIBSDEV}" +FILES:${PN}-dev += "${FILES_SOLIBS_VERSIONED}" +FILES_SOLIBS_VERSIONED = " \ + ${libdir}/libcppnetlib-client-connections.so \ + ${libdir}/libcppnetlib-server-parsers.so \ + ${libdir}/libcppnetlib-uri.so \ + ${libdir}/libos08a20.so \ +" + +RDEPENDS:${PN} = "libdrm" + +COMPATIBLE_MACHINE = "(mx8mp-nxp-bsp)" -- cgit v1.2.3-54-g00ecf From b598f3a7d215e180b0a292522c6820921956d6e1 Mon Sep 17 00:00:00 2001 From: Markus Niebel Date: Tue, 28 Jan 2025 11:13:50 +0100 Subject: tinycompress: update to the version used in LF6.6.52_2.2.0 Bump revision to 1.2.5 and remove old patches. This also switches to new upstream location at github. The old location uses git-protocol which can cause problems in corporate network environments. Signed-off-by: Markus Niebel --- .../0001-tinycompress-Add-id3-decoding.patch | 1002 -------------------- .../0002-cplay-Support-wave-file.patch | 215 ----- .../0003-cplay-Add-pause-feature.patch | 146 --- ...ss-pass-NULL-buffer-with-0-size-to-driver.patch | 40 - .../0005-cplay-Support-aac-streams.patch | 251 ----- .../tinycompress/tinycompress_1.1.6.bb | 16 - .../tinycompress/tinycompress_1.2.5.bb | 18 + 7 files changed, 18 insertions(+), 1670 deletions(-) delete mode 100755 recipes-multimedia/tinycompress/tinycompress/0001-tinycompress-Add-id3-decoding.patch delete mode 100755 recipes-multimedia/tinycompress/tinycompress/0002-cplay-Support-wave-file.patch delete mode 100755 recipes-multimedia/tinycompress/tinycompress/0003-cplay-Add-pause-feature.patch delete mode 100755 recipes-multimedia/tinycompress/tinycompress/0004-tinycompress-pass-NULL-buffer-with-0-size-to-driver.patch delete mode 100755 recipes-multimedia/tinycompress/tinycompress/0005-cplay-Support-aac-streams.patch delete mode 100644 recipes-multimedia/tinycompress/tinycompress_1.1.6.bb create mode 100644 recipes-multimedia/tinycompress/tinycompress_1.2.5.bb diff --git a/recipes-multimedia/tinycompress/tinycompress/0001-tinycompress-Add-id3-decoding.patch b/recipes-multimedia/tinycompress/tinycompress/0001-tinycompress-Add-id3-decoding.patch deleted file mode 100755 index 78ff6989c..000000000 --- a/recipes-multimedia/tinycompress/tinycompress/0001-tinycompress-Add-id3-decoding.patch +++ /dev/null @@ -1,1002 +0,0 @@ -From 16f6b7a5baec41f18fde75fd311fb988e3c31810 Mon Sep 17 00:00:00 2001 -From: Shengjiu Wang -Date: Fri, 13 Jul 2018 18:13:24 +0800 -Subject: [PATCH] tinycompress: Add id3 decoding - -Upstream-Status: Pending -Signed-off-by: Shengjiu Wang ---- - include/tinycompress/id3_tag_decode.h | 198 +++++++++++ - src/utils/Makefile.am | 2 +- - src/utils/cplay.c | 88 +++++ - src/utils/id3_tag_decode.c | 642 ++++++++++++++++++++++++++++++++++ - 4 files changed, 929 insertions(+), 1 deletion(-) - create mode 100644 include/tinycompress/id3_tag_decode.h - create mode 100644 src/utils/id3_tag_decode.c - -diff --git a/include/tinycompress/id3_tag_decode.h b/include/tinycompress/id3_tag_decode.h -new file mode 100644 -index 0000000..1a911d7 ---- /dev/null -+++ b/include/tinycompress/id3_tag_decode.h -@@ -0,0 +1,198 @@ -+/* -+ * Copyright (c) 2006-2017 Cadence Design Systems, Inc. -+ * Copyright 2018 NXP -+ * -+ * Permission is hereby granted, free of charge, to any person obtaining -+ * a copy of this software and associated documentation files (the -+ * "Software"), to deal in the Software without restriction, including -+ * without limitation the rights to use, copy, modify, merge, publish, -+ * distribute, sublicense, and/or sell copies of the Software, and to -+ * permit persons to whom the Software is furnished to do so, subject to -+ * the following conditions: -+ * -+ * The above copyright notice and this permission notice shall be included -+ * in all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -+ */ -+ -+/****************************************************************** -+ * file name : id3_tag_decode.h -+ * -+ * description : stores typedefs of structures specific to MP3 tag -+ * -+ * revision history: -+ * 29 04 2004 DK creation -+ *****************************************************************/ -+ -+#ifndef ID3_TAG_DECODE_H -+#define ID3_TAG_DECODE_H -+ -+typedef signed char WORD8; -+typedef signed char * pWORD8; -+typedef unsigned char UWORD8; -+typedef unsigned char * pUWORD8; -+ -+typedef signed short WORD16; -+typedef signed short * pWORD16; -+typedef unsigned short UWORD16; -+typedef unsigned short * pUWORD16; -+ -+typedef signed int WORD24; -+typedef signed int * pWORD24; -+typedef unsigned int UWORD24; -+typedef unsigned int * pUWORD24; -+ -+typedef signed int WORD32; -+typedef signed int * pWORD32; -+typedef unsigned int UWORD32; -+typedef unsigned int * pUWORD32; -+ -+typedef void VOID; -+typedef void * pVOID; -+ -+typedef signed int BOOL; -+typedef unsigned int UBOOL; -+typedef signed int FLAG; -+typedef unsigned int UFLAG; -+typedef signed int LOOPIDX; -+typedef unsigned int ULOOPIDX; -+typedef signed int WORD; -+typedef unsigned int UWORD; -+ -+#define MAX_TAG_FRAME_SIZE 100 -+ -+#define ID3V1 (0x544147) /* 0x544147 is TAG in WORD8 */ -+ -+#define ID3V2 (0x494433) /* 0x494433 is ID3 in WORD8 */ -+ -+/* -+ * structure corresponding to ID3 tag v1 header. -+ * this structure has all the field corresponding to ID3 tag v1 header. -+ */ -+ -+typedef struct { -+ WORD32 tag; // 3 bytes -+ -+ WORD16 version; // 2 bytes -+ -+ WORD8 flag; //1 byte -+ -+ WORD32 size; //4 bytes -+ -+} id3_v2_header_struct; -+ -+/* structure which will store the frame data and -+ * also put a limit max data to be stored -+ */ -+typedef struct { -+ WORD8 frame_data[MAX_TAG_FRAME_SIZE]; -+ -+ WORD32 max_size; //4 bytes -+ -+ WORD16 tag_present; -+ -+ WORD16 exceeds_buffer_size; -+ -+} id3_v2_frame_struct; -+ -+/* -+ * structure corresponding to ID3 tag v2. -+ * this structure has some of the field corresponding to ID3 tag v2. -+ * if user wants to read some more tag information from -+ * the MP3 file, he can add that field in this structure and pass address -+ * of that element to get_inf function in id3_tag_decode.c under the -+ * corresponding field frame header. few fields which are needed are already -+ * populated by reading from the TAG header. -+ */ -+typedef struct { -+ id3_v2_frame_struct album_movie_show_title; -+ -+ id3_v2_frame_struct composer_name; -+ -+ id3_v2_frame_struct content_type; -+ -+ id3_v2_frame_struct encoded_by; -+ -+ id3_v2_frame_struct lyricist_text_writer; -+ -+ id3_v2_frame_struct content_group_description; -+ -+ id3_v2_frame_struct title_songname_content_description; -+ -+ id3_v2_frame_struct medxa_type; -+ -+ id3_v2_frame_struct original_album_movie_show_title; -+ -+ id3_v2_frame_struct original_filename; -+ -+ id3_v2_frame_struct original_lyricist_text_writer; -+ -+ id3_v2_frame_struct original_artist_performer; -+ -+ id3_v2_frame_struct file_owner_licensee; -+ -+ id3_v2_frame_struct lead_performer_soloist; -+ -+ id3_v2_frame_struct publisher; -+ -+ id3_v2_frame_struct private_frame; -+ -+ id3_v2_frame_struct other_info; -+ -+ id3_v2_header_struct id3_v2_header; -+ -+ WORD32 header_end; -+ -+ WORD32 bytes_consumed; -+ -+} id3v2_struct; -+ -+/* -+ * structure corresponding to ID3 tag v1. -+ * this structure has all the field corresponding to ID3 tag v1. -+ */ -+typedef struct { -+ WORD8 song_title[30]; //30 word8acters -+ -+ WORD8 artist[30]; //30 word8acters -+ -+ WORD8 album[30]; //30 word8acters -+ -+ WORD8 year[4]; //4 word8acters -+ -+ WORD8 comment[30]; //30 word8acters -+ -+ WORD8 genre[1]; //1 byte -+ -+} id3v1_struct; -+ -+WORD32 get_info(const char *inp_buffer, -+ unsigned int avail_inp, -+ WORD32 tag_size, -+ id3_v2_frame_struct *dest); -+ -+WORD32 search_id3_v2(UWORD8 *buffer); -+ -+WORD32 decode_id3_v2(const char *const buffer, -+ id3v2_struct *id3v2, -+ WORD32 continue_flag, -+ WORD32 insize); -+ -+WORD32 get_id3_v2_bytes(UWORD8 *buffer); -+ -+WORD32 get_v1_info(UWORD8 *buffer, id3v1_struct *id3v1); -+ -+WORD32 search_id3_v1(UWORD8 *buffer); -+ -+WORD32 decode_id3_v1(UWORD8 *buffer, id3v1_struct *id3v1); -+ -+void init_id3v2_field(id3v2_struct *id3v2); -+ -+#endif -diff --git a/src/utils/Makefile.am b/src/utils/Makefile.am -index 1b996d4..e813689 100644 ---- a/src/utils/Makefile.am -+++ b/src/utils/Makefile.am -@@ -1,6 +1,6 @@ - bin_PROGRAMS = cplay crecord - --cplay_SOURCES = cplay.c -+cplay_SOURCES = cplay.c id3_tag_decode.c - crecord_SOURCES = crecord.c - - cplay_CFLAGS = -I$(top_srcdir)/include -diff --git a/src/utils/cplay.c b/src/utils/cplay.c -index 87863a3..2a52b52 100644 ---- a/src/utils/cplay.c -+++ b/src/utils/cplay.c -@@ -72,6 +72,7 @@ - #include "sound/compress_params.h" - #include "tinycompress/tinycompress.h" - #include "tinycompress/tinymp3.h" -+#include "tinycompress/id3_tag_decode.h" - - static int verbose; - static const unsigned int DEFAULT_CODEC_ID = SND_AUDIOCODEC_PCM; -@@ -245,12 +246,97 @@ int main(int argc, char **argv) - exit(EXIT_SUCCESS); - } - -+void shift_buffer(char *buf, int buf_size, int bytes_consumed) -+{ -+ int i; -+ -+ if (bytes_consumed <= 0) -+ return; -+ -+ for (i = 0; i < buf_size - bytes_consumed; i++) -+ buf[i] = buf[i + bytes_consumed]; -+} -+ -+void parse_id3(FILE *file, int *offset) { -+ /* ID3 tag specific declarations */ -+ unsigned char id3_buf[128]; -+ unsigned char id3v2_buf[4096]; -+ signed int id3_v1_found = 0, id3_v1_decoded = 0; -+ signed int id3_v2_found = 0, id3_v2_complete = 0; -+ signed int i_bytes_consumed = 0; -+ signed int i_fread_bytes; -+ id3v1_struct id3v1; -+ id3v2_struct id3v2; -+ -+ { -+ fseek(file, -128, SEEK_END); -+ fread(id3_buf, 1, 128, file); -+ -+ /* search for ID3V1 */ -+ id3_v1_found = search_id3_v1(id3_buf + 0); -+ if (id3_v1_found) { -+ /* if ID3V1 is found, decode ID3V1 */ -+ decode_id3_v1(id3_buf + 3, &id3v1); -+ id3_v1_decoded = 1; -+ } -+ fseek(file, 0, SEEK_SET); -+ } -+ -+ { -+ signed int flag = 0; -+ signed int continue_flag = 0; -+ -+ i_fread_bytes = fread(id3v2_buf, -+ sizeof(char), 0x1000, file); -+ -+ /* search for ID3V2 */ -+ id3_v2_found = -+ search_id3_v2(id3v2_buf); -+ -+ if (id3_v2_found) { -+ /* initialise the max fields */ -+ init_id3v2_field(&id3v2); -+ -+ while (!id3_v2_complete && id3_v2_found) { -+ /* if ID3V2 is found, decode ID3V2 */ -+ id3_v2_complete = decode_id3_v2((const char *const)id3v2_buf, -+ &id3v2, continue_flag, i_fread_bytes); -+ -+ if (!id3_v2_complete) { -+ continue_flag = 1; -+ i_bytes_consumed = id3v2.bytes_consumed; -+ -+ fseek(file, i_bytes_consumed, SEEK_SET); -+ -+ i_fread_bytes = fread(id3v2_buf, -+ sizeof(unsigned char), 0x1000, file); -+ if (i_fread_bytes <= 0) { -+ return; -+ } -+ } -+ } -+ -+ if (id3_v2_complete) { -+ i_bytes_consumed = id3v2.bytes_consumed; -+ fseek(file, i_bytes_consumed, SEEK_SET); -+ } -+ } -+ } -+ -+ *offset = i_bytes_consumed; -+} -+ - void get_codec_mp3(FILE *file, struct compr_config *config, - struct snd_codec *codec) - { - size_t read; - struct mp3_header header; - unsigned int channels, rate, bits; -+ int offset = 0; -+ -+ parse_id3(file, &offset); -+ -+ fseek(file, offset, SEEK_SET); - - read = fread(&header, 1, sizeof(header), file); - if (read != sizeof(header)) { -@@ -279,6 +365,8 @@ void get_codec_mp3(FILE *file, struct compr_config *config, - codec->level = 0; - codec->ch_mode = 0; - codec->format = 0; -+ -+ fseek(file, offset, SEEK_SET); - } - - void get_codec_iec(FILE *file, struct compr_config *config, -diff --git a/src/utils/id3_tag_decode.c b/src/utils/id3_tag_decode.c -new file mode 100644 -index 0000000..393967a ---- /dev/null -+++ b/src/utils/id3_tag_decode.c -@@ -0,0 +1,642 @@ -+/* -+ * Copyright (c) 2006-2017 Cadence Design Systems, Inc. -+ * Copyright 2018 NXP -+ * -+ * Permission is hereby granted, free of charge, to any person obtaining -+ * a copy of this software and associated documentation files (the -+ * "Software"), to deal in the Software without restriction, including -+ * without limitation the rights to use, copy, modify, merge, publish, -+ * distribute, sublicense, and/or sell copies of the Software, and to -+ * permit persons to whom the Software is furnished to do so, subject to -+ * the following conditions: -+ * -+ * The above copyright notice and this permission notice shall be included -+ * in all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -+ */ -+#include -+#include "tinycompress/id3_tag_decode.h" -+ -+#define CHAR4(c1, c2, c3, c4) \ -+ (int)(((unsigned char)(c1) << 24) | \ -+ ((unsigned char)(c2) << 16) | \ -+ ((unsigned char)(c3) << 8) | \ -+ ((unsigned char)c4)) -+ -+#ifndef MSVC_BUILD -+unsigned int umin(unsigned int a, unsigned int b) -+{ -+ return (a < b ? a : b); -+} -+ -+#else -+unsigned int umin(unsigned int a, unsigned int b) -+{ -+ return (a < b ? a : b); -+} -+#endif -+ -+/*********************************************************** -+ * function name : display -+ * -+ * description : display ID3 tag contents. -+ * -+ * arguments : input parameters -+ * -+ * values returned : 0 -+ ***********************************************************/ -+ -+static void display2(const id3_v2_frame_struct * const src, -+ int size, -+ const char * const disp) -+{ -+ int j; -+ -+ -+ for (j = 0; j < size; j++) { -+ int c = src->frame_data[j]; -+ -+ if (c) { -+ if (!isprint(c)) -+ break; -+ } -+ } -+} -+ -+static VOID display1(WORD8 src[], WORD32 size, WORD8 disp[]) -+{ -+ WORD32 j; -+ -+ for (j = 0; j < size ; j++) { -+ int c = src[j]; -+ -+ if (c) { -+ if (!isprint(c)) -+ break; -+ } -+ } -+} -+ -+/***************************************************************** -+ * function name : init_id3_header -+ * -+ * description : initialise the max filed size of teh farem. -+ * -+ * arguments : input parameters -+ * -+ * values returned : 0 -+ ****************************************************************/ -+ -+VOID init_id3v2_field(id3v2_struct *id3v2) -+{ -+ id3v2->album_movie_show_title.max_size = MAX_TAG_FRAME_SIZE; -+ id3v2->composer_name.max_size = MAX_TAG_FRAME_SIZE; -+ id3v2->content_type.max_size = MAX_TAG_FRAME_SIZE; -+ id3v2->encoded_by.max_size = MAX_TAG_FRAME_SIZE; -+ id3v2->lyricist_text_writer.max_size = MAX_TAG_FRAME_SIZE; -+ id3v2->content_group_description.max_size = MAX_TAG_FRAME_SIZE; -+ id3v2->title_songname_content_description.max_size = MAX_TAG_FRAME_SIZE; -+ id3v2->medxa_type.max_size = MAX_TAG_FRAME_SIZE; -+ id3v2->original_album_movie_show_title.max_size = MAX_TAG_FRAME_SIZE; -+ id3v2->original_filename.max_size = MAX_TAG_FRAME_SIZE; -+ id3v2->original_lyricist_text_writer.max_size = MAX_TAG_FRAME_SIZE; -+ id3v2->original_artist_performer.max_size = MAX_TAG_FRAME_SIZE; -+ id3v2->file_owner_licensee.max_size = MAX_TAG_FRAME_SIZE; -+ id3v2->lead_performer_soloist.max_size = MAX_TAG_FRAME_SIZE; -+ id3v2->publisher.max_size = MAX_TAG_FRAME_SIZE; -+ id3v2->private_frame.max_size = MAX_TAG_FRAME_SIZE; -+ id3v2->other_info.max_size = MAX_TAG_FRAME_SIZE; -+ -+ /* resetting the flag to indicate presese of frame */ -+ id3v2->album_movie_show_title.tag_present = 0; -+ id3v2->composer_name.tag_present = 0; -+ id3v2->content_type.tag_present = 0; -+ id3v2->encoded_by.tag_present = 0; -+ id3v2->lyricist_text_writer.tag_present = 0; -+ id3v2->content_group_description.tag_present = 0; -+ id3v2->title_songname_content_description.tag_present = 0; -+ id3v2->medxa_type.tag_present = 0; -+ id3v2->original_album_movie_show_title.tag_present = 0; -+ id3v2->original_filename.tag_present = 0; -+ id3v2->original_lyricist_text_writer.tag_present = 0; -+ id3v2->original_artist_performer.tag_present = 0; -+ id3v2->file_owner_licensee.tag_present = 0; -+ id3v2->lead_performer_soloist.tag_present = 0; -+ id3v2->publisher.tag_present = 0; -+ id3v2->private_frame.tag_present = 0; -+ id3v2->other_info.tag_present = 0; -+ -+ /* resetting the flag which indicates that size of the frame has -+ * exceeded the max buffer size -+ */ -+ id3v2->album_movie_show_title.exceeds_buffer_size = 0; -+ id3v2->composer_name.exceeds_buffer_size = 0; -+ id3v2->content_type.exceeds_buffer_size = 0; -+ id3v2->encoded_by.exceeds_buffer_size = 0; -+ id3v2->lyricist_text_writer.exceeds_buffer_size = 0; -+ id3v2->content_group_description.exceeds_buffer_size = 0; -+ id3v2->title_songname_content_description.exceeds_buffer_size = 0; -+ id3v2->medxa_type.exceeds_buffer_size = 0; -+ id3v2->original_album_movie_show_title.exceeds_buffer_size = 0; -+ id3v2->original_filename.exceeds_buffer_size = 0; -+ id3v2->original_lyricist_text_writer.exceeds_buffer_size = 0; -+ id3v2->original_artist_performer.exceeds_buffer_size = 0; -+ id3v2->file_owner_licensee.exceeds_buffer_size = 0; -+ id3v2->lead_performer_soloist.exceeds_buffer_size = 0; -+ id3v2->publisher.exceeds_buffer_size = 0; -+ id3v2->private_frame.exceeds_buffer_size = 0; -+ id3v2->other_info.exceeds_buffer_size = 0; -+ -+ id3v2->bytes_consumed = 0; -+ id3v2->header_end = 0; -+} -+ -+/*************************************************************** -+ * function name : search_id3_v2 -+ * -+ * description : finds if ID3V2 starts at the start of given buffer. -+ * -+ * arguments : input parameters -+ * buffer input buffer -+ * -+ * values returned : FLAG 1: ID3 found 0: ID3 not found -+ ***************************************************************/ -+WORD32 search_id3_v2(UWORD8 *buffer) -+{ -+ UWORD32 temp; -+ -+ temp = buffer[0] << 16; -+ temp |= buffer[1] << 8; -+ temp |= buffer[2]; -+ -+ if (temp == ID3V2) -+ return 1; /* ID3 found */ -+ -+ return 0; /* ID3 not found */ -+} -+ -+/************************************************************** -+ * function name : search_id3_v1 -+ * -+ * description : finds if ID3V1 starts at the start of given buffer. -+ * -+ * arguments : input parameters -+ * buffer input buffer -+ * -+ * values returned : FLAG 1: ID3 found 0: ID3 not found -+ **************************************************************/ -+WORD32 search_id3_v1(UWORD8 *buffer) -+{ -+ UWORD32 temp; -+ -+ temp = buffer[0] << 16; -+ temp |= buffer[1] << 8; -+ temp |= buffer[2]; -+ -+ if (temp == ID3V1) -+ return 1; /* ID3 found */ -+ -+ return 0; /* ID3 not found */ -+} -+ -+/*************************************************************** -+ * function name : decode_id3_v1 -+ * -+ * description : decodes ID3V1 tag. -+ * -+ * arguments : input parameters -+ * buffer input buffer -+ * id3v1 structure -+ * -+ * values returned : bytes consumed -+ **************************************************************/ -+WORD32 decode_id3_v1(UWORD8 *buffer, id3v1_struct *id3v1) -+{ -+ WORD32 bytes_consumed = 0; -+ short tag_type; -+ -+ /* setting the tag type */ -+ tag_type = 1; -+ -+ bytes_consumed = get_v1_info(buffer, id3v1); -+ -+ return bytes_consumed; -+} -+ -+/*********************************************************** -+ * function name : get_v1_info -+ * -+ * description : gets ID3V1 information fields. -+ * -+ * arguments : input parameters -+ * buffer input buffer -+ * id3v1 structure -+ * -+ * values returned : bytes consumed -+ ***********************************************************/ -+WORD32 get_v1_info(UWORD8 *buffer, id3v1_struct *id3v1) -+{ -+ WORD32 i; -+ WORD32 bytes_consumed = 0; -+ -+ /* get song_title */ -+ for (i = 0; i < 30; i++) -+ id3v1->song_title[i] = buffer[i]; -+ -+ buffer += 30; -+ bytes_consumed += 30; -+ display1(id3v1->song_title, 30, (WORD8 *)"song_title : "); -+ -+ /* get artist */ -+ for (i = 0; i < 30; i++) -+ id3v1->artist[i] = buffer[i]; -+ -+ buffer += 30; -+ bytes_consumed += 30; -+ display1(id3v1->artist, 30, (WORD8 *)"artist : "); -+ -+ /* get album */ -+ for (i = 0; i < 30; i++) -+ id3v1->album[i] = buffer[i]; -+ -+ buffer += 30; -+ bytes_consumed += 30; -+ display1(id3v1->album, 30, (WORD8 *)"album : "); -+ -+ /* get year */ -+ for (i = 0; i < 4; i++) -+ id3v1->year[i] = buffer[i]; -+ -+ buffer += 4; -+ bytes_consumed += 4; -+ display1(id3v1->year, 4, (WORD8 *)"year : "); -+ -+ /* get comment */ -+ for (i = 0; i < 30; i++) -+ id3v1->comment[i] = buffer[i]; -+ -+ buffer += 30; -+ bytes_consumed += 30; -+ display1(id3v1->comment, 30, (WORD8 *)"comment : "); -+ -+ /* get genre */ -+ for (i = 0; i < 1; i++) -+ id3v1->genre[i] = buffer[i]; -+ -+ buffer += 1; -+ bytes_consumed += 1; -+ -+ return bytes_consumed; -+} -+ -+/***************************************************** -+ * function name : decode_id3_v2 -+ * -+ * description : decodes ID3V2 tag. -+ * -+ * arguments : input parameters -+ * buffer input buffer -+ * id3v2 structure -+ * continue_flag FLAG to indicate whether -+ * it is first call or not -+ * insize input buffer size -+ * -+ * values returned : bytes consumed -+ ******************************************************/ -+WORD32 decode_id3_v2(const char *const buffer, -+ id3v2_struct *const id3v2, -+ WORD32 continue_flag, -+ WORD32 insize) -+{ -+ UWORD32 size = 0, flag; -+ WORD32 i, buf_update_val; -+ UWORD8 buf[4], frame_header[10], id3_buffer[10]; -+ WORD8 *bitstream_ptr; -+ short tag_type; -+ -+ WORD32 bytes_consumed = 0; -+ -+ if (id3v2->header_end == 1) { -+ id3v2->bytes_consumed += insize; -+ if (id3v2->bytes_consumed < id3v2->id3_v2_header.size) -+ return 0; -+ -+ id3v2->bytes_consumed = (id3v2->id3_v2_header.size + 10); -+ return 1; -+ } -+ -+ bitstream_ptr = (WORD8 *)id3_buffer; -+ -+ if (!continue_flag) { -+ bytes_consumed += 3; -+ /* setting the tag type */ -+ tag_type = 2; -+ id3v2->id3_v2_header.version = buffer[bytes_consumed + 0] << 8; -+ id3v2->id3_v2_header.version |= buffer[bytes_consumed + 1]; -+ id3v2->id3_v2_header.flag = buffer[bytes_consumed + 2]; -+ -+ /* making the msb of each byte zero */ -+ buf[0] = buffer[bytes_consumed + 6] & 0x7f; -+ buf[1] = buffer[bytes_consumed + 5] & 0x7f; -+ buf[2] = buffer[bytes_consumed + 4] & 0x7f; -+ buf[3] = buffer[bytes_consumed + 3] & 0x7f; -+ -+ bytes_consumed += 7; -+ -+ /* concatenation the bytes after making -+ * 7th bit zero to get 28 bits size -+ */ -+ size = buf[0]; -+ size |= (buf[1] << 7); -+ size |= (buf[2] << 14); -+ size |= (buf[3] << 21); -+ /* storing the size */ -+ id3v2->id3_v2_header.size = size; -+ -+ /* check for extended header */ -+ if (id3v2->id3_v2_header.flag & 0x20) { -+ for (i = 0; i < 10; i++) -+ bitstream_ptr[i] = buffer[bytes_consumed + i]; -+ -+ i = 0; -+ bytes_consumed += 10; -+ -+ size = bitstream_ptr[i++] << 24; -+ size |= bitstream_ptr[i++] << 16; -+ size |= bitstream_ptr[i++] << 8; -+ size |= bitstream_ptr[i++]; -+ -+ /* two bytes for flag */ -+ i += 2; -+ { -+ UWORD32 padding_size; -+ -+ padding_size = bitstream_ptr[i++] << 24; -+ padding_size |= bitstream_ptr[i++] << 16; -+ padding_size |= bitstream_ptr[i++] << 8; -+ padding_size |= bitstream_ptr[i++]; -+ -+ /* skipping the padding and frame size -+ * number of bytes -+ */ -+ bytes_consumed += (padding_size + size); -+ } -+ } -+ } -+ -+ while (id3v2->header_end != 1) { -+ char *key; -+ id3_v2_frame_struct *value; -+ unsigned int avail_inp; -+ -+ /* reading the 10 bytes to get the frame header */ -+ -+ for (i = 0; i < 10; i++) -+ frame_header[i] = buffer[bytes_consumed + i]; -+ bytes_consumed += 10; -+ -+ /* getting the size from the header */ -+ size = frame_header[4] << 24; -+ size |= frame_header[5] << 16; -+ size |= frame_header[6] << 8; -+ size |= frame_header[7]; -+ -+ /* decoding the flag, currently not used */ -+ flag = frame_header[8] << 8; -+ flag |= frame_header[9]; -+ -+ avail_inp = insize - bytes_consumed; -+ -+ /* switching to the frame type */ -+ switch (CHAR4(frame_header[0], -+ frame_header[1], -+ frame_header[2], -+ frame_header[3])) { -+ case CHAR4('A', 'E', 'N', 'C'): -+ case CHAR4('A', 'P', 'I', 'C'): -+ case CHAR4('C', 'O', 'M', 'M'): -+ case CHAR4('C', 'O', 'M', 'R'): -+ case CHAR4('E', 'N', 'C', 'R'): -+ case CHAR4('E', 'Q', 'U', 'A'): -+ case CHAR4('E', 'T', 'C', 'O'): -+ case CHAR4('G', 'E', 'O', 'B'): -+ case CHAR4('G', 'R', 'I', 'D'): -+ case CHAR4('I', 'P', 'L', 'S'): -+ case CHAR4('L', 'I', 'N', 'K'): -+ case CHAR4('M', 'C', 'D', 'I'): -+ case CHAR4('M', 'L', 'L', 'T'): -+ case CHAR4('O', 'W', 'N', 'E'): -+ case CHAR4('P', 'C', 'N', 'T'): -+ case CHAR4('P', 'O', 'P', 'M'): -+ case CHAR4('P', 'O', 'S', 'S'): -+ case CHAR4('R', 'B', 'U', 'F'): -+ case CHAR4('R', 'V', 'A', 'D'): -+ case CHAR4('R', 'V', 'R', 'B'): -+ case CHAR4('S', 'Y', 'L', 'T'): -+ case CHAR4('S', 'Y', 'T', 'C'): -+ case CHAR4('T', 'B', 'P', 'M'): -+ case CHAR4('T', 'C', 'O', 'P'): -+ case CHAR4('T', 'D', 'A', 'T'): -+ case CHAR4('T', 'D', 'L', 'Y'): -+ case CHAR4('T', 'F', 'L', 'T'): -+ case CHAR4('T', 'I', 'M', 'E'): -+ case CHAR4('T', 'K', 'E', 'Y'): -+ case CHAR4('T', 'L', 'A', 'N'): -+ case CHAR4('T', 'L', 'E', 'N'): -+ case CHAR4('T', 'M', 'E', 'D'): -+ case CHAR4('T', 'O', 'F', 'N'): -+ case CHAR4('T', 'O', 'L', 'Y'): -+ case CHAR4('T', 'O', 'R', 'Y'): -+ case CHAR4('T', 'P', 'E', '2'): -+ case CHAR4('T', 'P', 'E', '3'): -+ case CHAR4('T', 'P', 'E', '4'): -+ case CHAR4('T', 'P', 'O', 'S'): -+ case CHAR4('T', 'R', 'C', 'K'): -+ case CHAR4('T', 'R', 'D', 'A'): -+ case CHAR4('T', 'R', 'S', 'N'): -+ case CHAR4('T', 'R', 'S', 'O'): -+ case CHAR4('T', 'S', 'I', 'Z'): -+ case CHAR4('T', 'S', 'R', 'C'): -+ case CHAR4('T', 'S', 'S', 'E'): -+ case CHAR4('T', 'Y', 'E', 'R'): -+ case CHAR4('T', 'X', 'X', 'X'): -+ case CHAR4('U', 'F', 'I', 'D'): -+ case CHAR4('U', 'S', 'E', 'R'): -+ case CHAR4('U', 'S', 'L', 'T'): -+ case CHAR4('W', 'C', 'O', 'M'): -+ case CHAR4('W', 'C', 'O', 'P'): -+ case CHAR4('W', 'O', 'A', 'F'): -+ case CHAR4('W', 'O', 'A', 'R'): -+ case CHAR4('W', 'O', 'A', 'S'): -+ case CHAR4('W', 'O', 'R', 'S'): -+ case CHAR4('W', 'P', 'A', 'Y'): -+ case CHAR4('W', 'P', 'U', 'B'): -+ case CHAR4('W', 'X', 'X', 'X'): -+ case CHAR4('T', 'I', 'T', '3'): -+ key = "other_info : "; -+ value = &id3v2->other_info; -+ break; -+ case CHAR4('P', 'R', 'I', 'V'): -+ key = "private_frame : "; -+ value = &id3v2->private_frame; -+ break; -+ case CHAR4('T', 'A', 'L', 'B'): -+ key = "album_movie_show_title : "; -+ value = &id3v2->album_movie_show_title; -+ break; -+ case CHAR4('T', 'C', 'O', 'M'): -+ key = "composer_name : "; -+ value = &id3v2->composer_name; -+ break; -+ case CHAR4('T', 'C', 'O', 'N'): -+ key = "content_type : "; -+ value = &id3v2->content_type; -+ break; -+ case CHAR4('T', 'E', 'N', 'C'): -+ key = "encoded_by : "; -+ value = &id3v2->encoded_by; -+ break; -+ case CHAR4('T', 'E', 'X', 'T'): -+ key = "lyricist_text_writer : "; -+ value = &id3v2->lyricist_text_writer; -+ break; -+ case CHAR4('T', 'I', 'T', '1'): -+ key = "content_group_description : "; -+ value = &id3v2->content_group_description; -+ break; -+ case CHAR4('T', 'I', 'T', '2'): -+ key = "title_songname_content_description : "; -+ value = &id3v2->title_songname_content_description; -+ break; -+ case CHAR4('T', 'O', 'A', 'L'): -+ key = "original_album_movie_show_title : "; -+ value = &id3v2->original_album_movie_show_title; -+ break; -+ case CHAR4('T', 'O', 'P', 'E'): -+ key = "original_artist_performer : "; -+ value = &id3v2->original_artist_performer; -+ break; -+ case CHAR4('T', 'O', 'W', 'N'): -+ key = "file_owner_licensee : "; -+ value = &id3v2->file_owner_licensee; -+ break; -+ case CHAR4('T', 'P', 'E', '1'): -+ key = "lead_performer_soloist : "; -+ value = &id3v2->lead_performer_soloist; -+ break; -+ case CHAR4('T', 'P', 'U', 'B'): -+ key = "publisher : "; -+ value = &id3v2->publisher; -+ break; -+ default: -+ /* skipping the read 10 bytes */ -+ buf_update_val = -10; -+ id3v2->header_end = 1; -+ value = 0; -+ key = 0; -+ break; -+ } -+ -+ if (value != 0) -+ buf_update_val = get_info(&buffer[bytes_consumed], -+ avail_inp, size, value); -+ -+ /* Negative value for buf_update_val means one of two things: -+ * 1. The default case happened and we're done with ID3V2 tag -+ * frames, or -+ * 2. get_info() returned -1 to indicate that more input is -+ * required to decode this frame of the tag. -+ */ -+ if (buf_update_val >= 0) -+ display2(value, -+ umin(value->max_size, buf_update_val), key); -+ -+ if (buf_update_val == -1) { -+ id3v2->bytes_consumed += bytes_consumed; -+ return 1; -+ } -+ -+ bytes_consumed += buf_update_val; -+ -+ /* Is there enough input left (10 bytes) to begin -+ * decoding another frame? If not, bag out temporarily -+ * now. The caller will refill our input buffer and -+ * call us again with continue_flag == 1. -+ */ -+ if (insize - bytes_consumed < 10) { -+ id3v2->bytes_consumed += bytes_consumed; -+ return 0; /* not completely decoded */ -+ } -+ } -+ -+ id3v2->bytes_consumed += bytes_consumed; -+ if ((id3v2->bytes_consumed + 10) < id3v2->id3_v2_header.size) -+ return 0; /* not completely decoded */ -+ -+ return 1; /* completely decoded */ -+} -+ -+/******************************************************* -+ * function name : get_id3_v2_bytes -+ * -+ * description : tells the size of ID3V2 tag. -+ * -+ * arguments : input parameters -+ * buffer input buffer -+ * -+ * values returned : bytes consumed -+ ********************************************************/ -+WORD32 get_id3_v2_bytes(UWORD8 *buffer) -+{ -+ WORD32 size; -+ -+ /* making the msb of each byte zero */ -+ size = (buffer[9] & 0x7f); -+ size |= ((buffer[8] & 0x7f) << 7); -+ size |= ((buffer[7] & 0x7f) << 14); -+ size |= ((buffer[6] & 0x7f) << 21); -+ -+ return (size + 10); -+} -+ -+/**************************************************** -+ * function name : get_info -+ * -+ * description : read the frame information from the input buffer. -+ * -+ * arguments : input parameters -+ * -+ * values returned : update value for buffer -+ ****************************************************/ -+WORD32 get_info(const char *inp_buffer, -+ unsigned int avail_inp, -+ WORD32 tag_size, -+ id3_v2_frame_struct *dest) -+{ -+ WORD32 j; -+ -+ /* setting the tag to indicate the presence of frame */ -+ dest->tag_present = 1; -+ /* If there isn't enough input available, we punt back to the top -+ * level and ask for more. -+ */ -+ if (avail_inp < umin(tag_size, dest->max_size)) -+ return -1; -+ -+ if (dest->max_size >= tag_size) { -+ for (j = 0; j < tag_size ; j++) -+ dest->frame_data[j] = inp_buffer[j]; -+ } else { -+ dest->exceeds_buffer_size = 1; -+ for (j = 0; j < dest->max_size ; j++) -+ dest->frame_data[j] = inp_buffer[j]; -+ } -+ return tag_size; -+} --- -2.7.4 - diff --git a/recipes-multimedia/tinycompress/tinycompress/0002-cplay-Support-wave-file.patch b/recipes-multimedia/tinycompress/tinycompress/0002-cplay-Support-wave-file.patch deleted file mode 100755 index 795447118..000000000 --- a/recipes-multimedia/tinycompress/tinycompress/0002-cplay-Support-wave-file.patch +++ /dev/null @@ -1,215 +0,0 @@ -From 4d4bc0a958fe254531920095fbabc241aad88113 Mon Sep 17 00:00:00 2001 -From: Shengjiu Wang -Date: Tue, 28 Jul 2020 13:00:36 +0800 -Subject: [PATCH] cplay: Support wave file - -The supported format is mono/stereo, S16_LE/S32_LE, 8kHz-192kHz. -Command is: -cplay -c x -I PCM test.wav - -Upstream-Status: Inappropriate [i.MX specific] -Signed-off-by: Shengjiu Wang ---- - include/tinycompress/wave_formats.h | 51 +++++++++++++ - src/utils/cplay.c | 107 ++++++++++++++++++++++++++++ - 2 files changed, 158 insertions(+) - create mode 100644 include/tinycompress/wave_formats.h - ---- /dev/null -+++ b/include/tinycompress/wave_formats.h -@@ -0,0 +1,53 @@ -+#ifndef WAVE_FORMATS_H -+#define WAVE_FORMATS_H 1 -+ -+#include -+ -+#define COMPOSE_ID(a,b,c,d) ((a) | ((b)<<8) | ((c)<<16) | ((d)<<24)) -+ -+#define WAV_RIFF COMPOSE_ID('R','I','F','F') -+#define WAV_RIFX COMPOSE_ID('R','I','F','X') -+#define WAV_WAVE COMPOSE_ID('W','A','V','E') -+#define WAV_FMT COMPOSE_ID('f','m','t',' ') -+#define WAV_DATA COMPOSE_ID('d','a','t','a') -+ -+/* WAVE fmt block constants from Microsoft mmreg.h header */ -+#define WAV_FMT_PCM 0x0001 -+#define WAV_FMT_IEEE_FLOAT 0x0003 -+#define WAV_FMT_DOLBY_AC3_SPDIF 0x0092 -+#define WAV_FMT_EXTENSIBLE 0xfffe -+ -+/* Used with WAV_FMT_EXTENSIBLE format */ -+#define WAV_GUID_TAG "\x00\x00\x00\x00\x10\x00\x80\x00\x00\xAA\x00\x38\x9B\x71" -+ -+typedef struct { -+ u_int magic; /* 'RIFF' */ -+ u_int length; /* filelen */ -+ u_int type; /* 'WAVE' */ -+} WaveHeader; -+ -+typedef struct { -+ u_short format; /* see WAV_FMT_* */ -+ u_short channels; -+ u_int sample_fq; /* frequence of sample */ -+ u_int byte_p_sec; -+ u_short byte_p_spl; /* samplesize; 1 or 2 bytes */ -+ u_short bit_p_spl; /* 8, 12 or 16 bit */ -+} WaveFmtBody; -+ -+typedef struct { -+ WaveFmtBody format; -+ u_short ext_size; -+ u_short bit_p_spl; -+ u_int channel_mask; -+ u_short guid_format; /* WAV_FMT_* */ -+ u_char guid_tag[14]; /* WAV_GUID_TAG */ -+} WaveFmtExtensibleBody; -+ -+typedef struct { -+ u_int type; /* 'data' */ -+ u_int length; /* samplecount */ -+} WaveChunkHeader; -+ -+ -+#endif /* FORMATS */ ---- a/src/utils/cplay.c -+++ b/src/utils/cplay.c -@@ -1,4 +1,6 @@ - /* -+ * Copyright 2020 NXP -+ * - * This file is provided under a dual BSD/LGPLv2.1 license. When using or - * redistributing this file, you may do so under either license. - * -@@ -73,6 +75,8 @@ - #include "tinycompress/tinycompress.h" - #include "tinycompress/tinymp3.h" - #include "tinycompress/id3_tag_decode.h" -+#include "tinycompress/wave_formats.h" -+#include - - static int verbose; - static const unsigned int DEFAULT_CODEC_ID = SND_AUDIOCODEC_PCM; -@@ -166,6 +170,77 @@ static int parse_mp3_header(struct mp3_h - return 0; - } - -+static int parse_wav_header(FILE *file, unsigned int *num_channels, unsigned int *sample_rate, -+ unsigned int *format) { -+ WaveHeader wave_header; -+ WaveChunkHeader chunk_header; -+ WaveFmtBody fmt_body; -+ int more_chunks = 1; -+ -+ fread(&wave_header, sizeof(WaveHeader), 1, file); -+ if ((wave_header.magic != WAV_RIFF) || -+ (wave_header.type != WAV_WAVE)) { -+ fprintf(stderr, "Error: it is not a riff/wave file\n"); -+ return -1; -+ } -+ -+ do { -+ fread(&chunk_header, sizeof(WaveChunkHeader), 1, file); -+ switch (chunk_header.type) { -+ case WAV_FMT: -+ fread(&fmt_body, sizeof(WaveFmtBody), 1, file); -+ /* If the format header is larger, skip the rest */ -+ if (chunk_header.length > sizeof(WaveFmtBody)) -+ fseek(file, chunk_header.length - sizeof(WaveFmtBody), SEEK_CUR); -+ -+ *num_channels = fmt_body.channels; -+ *sample_rate = fmt_body.sample_fq; -+ -+ switch (fmt_body.bit_p_spl) { -+ case 8: -+ *format = SND_PCM_FORMAT_U8; -+ break; -+ case 16: -+ *format = SND_PCM_FORMAT_S16_LE; -+ break; -+ case 24: -+ switch (fmt_body.byte_p_spl / fmt_body.channels) { -+ case 3: -+ *format = SND_PCM_FORMAT_S24_3LE; -+ break; -+ case 4: -+ *format = SND_PCM_FORMAT_S24_LE; -+ break; -+ default: -+ fprintf(stderr, "format error\n"); -+ return -1; -+ } -+ break; -+ case 32: -+ if (fmt_body.format == WAV_FMT_PCM) { -+ *format = SND_PCM_FORMAT_S32_LE; -+ } else if (fmt_body.format == WAV_FMT_IEEE_FLOAT) { -+ *format = SND_PCM_FORMAT_FLOAT_LE; -+ } -+ break; -+ default: -+ fprintf(stderr, "format error\n"); -+ return -1; -+ } -+ break; -+ case WAV_DATA: -+ /* Stop looking for chunks */ -+ more_chunks = 0; -+ break; -+ default: -+ /* Unknown chunk, skip bytes */ -+ fseek(file, chunk_header.length, SEEK_CUR); -+ } -+ } while (more_chunks); -+ -+ return 0; -+} -+ - static int print_time(struct compress *compress) - { - unsigned int avail; -@@ -385,6 +460,35 @@ void get_codec_iec(FILE *file, struct co - codec->format = 0; - } - -+void get_codec_pcm(FILE *file, struct compr_config *config, -+ struct snd_codec *codec) -+{ -+ unsigned int channels, rate, format; -+ -+ if (parse_wav_header(file, &channels, &rate, &format) == -1) { -+ fclose(file); -+ exit(EXIT_FAILURE); -+ } -+ -+ if (channels > 2 || (format != SND_PCM_FORMAT_S16_LE && format != SND_PCM_FORMAT_S32_LE) || -+ rate > 192000) { -+ fprintf(stderr, "unsupported wave file\n"); -+ fclose(file); -+ exit(EXIT_FAILURE); -+ } -+ -+ codec->id = SND_AUDIOCODEC_PCM; -+ codec->ch_in = channels; -+ codec->ch_out = channels; -+ codec->sample_rate = rate; -+ codec->bit_rate = 0; -+ codec->rate_control = 0; -+ codec->profile = SND_AUDIOPROFILE_PCM; -+ codec->level = 0; -+ codec->ch_mode = 0; -+ codec->format = format; -+} -+ - void play_samples(char *name, unsigned int card, unsigned int device, - unsigned long buffer_size, unsigned int frag, - unsigned long codec_id) -@@ -411,6 +515,9 @@ void play_samples(char *name, unsigned i - case SND_AUDIOCODEC_IEC61937: - get_codec_iec(file, &config, &codec); - break; -+ case SND_AUDIOCODEC_PCM: -+ get_codec_pcm(file, &config, &codec); -+ break; - default: - fprintf(stderr, "codec ID %ld is not supported\n", codec_id); - exit(EXIT_FAILURE); diff --git a/recipes-multimedia/tinycompress/tinycompress/0003-cplay-Add-pause-feature.patch b/recipes-multimedia/tinycompress/tinycompress/0003-cplay-Add-pause-feature.patch deleted file mode 100755 index 7d8492b7d..000000000 --- a/recipes-multimedia/tinycompress/tinycompress/0003-cplay-Add-pause-feature.patch +++ /dev/null @@ -1,146 +0,0 @@ -From 6f778c21ee357a662cdd758cff578a3e4b85eedf Mon Sep 17 00:00:00 2001 -From: Zhang Peng -Date: Tue, 4 Aug 2020 15:29:29 +0800 -Subject: [PATCH] cplay: Add pause feature - -Add option: -p pause - -Upstream-Status: Inappropriate [i.MX specific] -Signed-off-by: Zhang Peng ---- - src/utils/cplay.c | 56 +++++++++++++++++++++++++++++++++++++++++++---- - 1 file changed, 52 insertions(+), 4 deletions(-) - -diff --git a/src/utils/cplay.c b/src/utils/cplay.c -index 8882f4d..8e3dcbb 100644 ---- a/src/utils/cplay.c -+++ b/src/utils/cplay.c -@@ -117,6 +117,9 @@ static void usage(void) - "-f\tfragments\n\n" - "-v\tverbose mode\n" - "-h\tPrints this help list\n\n" -+ "-p\tpause\n" -+ "-m\tpause blocks\n" -+ "-n\tpause time duration\n" - "Example:\n" - "\tcplay -c 1 -d 2 test.mp3\n" - "\tcplay -f 5 test.mp3\n\n" -@@ -133,7 +136,8 @@ static void usage(void) - - void play_samples(char *name, unsigned int card, unsigned int device, - unsigned long buffer_size, unsigned int frag, -- unsigned long codec_id); -+ unsigned long codec_id, int pause_count, int pause_block, -+ int pause_duration); - - struct mp3_header { - uint16_t sync; -@@ -262,12 +266,15 @@ int main(int argc, char **argv) - int c, i; - unsigned int card = 0, device = 0, frag = 0; - unsigned int codec_id = SND_AUDIOCODEC_MP3; -+ int pause_count = 0; -+ int pause_block = 6; -+ int pause_duration = 10; - - if (argc < 2) - usage(); - - verbose = 0; -- while ((c = getopt(argc, argv, "hvb:f:c:d:I:")) != -1) { -+ while ((c = getopt(argc, argv, "hvb:f:c:d:I:p:m:n:")) != -1) { - switch (c) { - case 'h': - usage(); -@@ -306,6 +313,23 @@ int main(int argc, char **argv) - case 'v': - verbose = 1; - break; -+ case 'p': -+ pause_count = strtol(optarg, NULL, 10); -+ break; -+ case 'm': -+ pause_block = strtol(optarg, NULL, 10); -+ if (pause_duration < 0) { -+ printf("Set wrong paramter! Set duration default 6.\n"); -+ pause_duration = 6; -+ } -+ break; -+ case 'n': -+ pause_duration = strtol(optarg, NULL, 10); -+ if (pause_duration < 0) { -+ printf("Set wrong paramter! Set duration default 10.\n"); -+ pause_duration = 10; -+ } -+ break; - default: - exit(EXIT_FAILURE); - } -@@ -315,7 +339,7 @@ int main(int argc, char **argv) - - file = argv[optind]; - -- play_samples(file, card, device, buffer_size, frag, codec_id); -+ play_samples(file, card, device, buffer_size, frag, codec_id, pause_count, pause_block, pause_duration); - - fprintf(stderr, "Finish Playing.... Close Normally\n"); - exit(EXIT_SUCCESS); -@@ -491,7 +515,8 @@ void get_codec_pcm(FILE *file, struct compr_config *config, - - void play_samples(char *name, unsigned int card, unsigned int device, - unsigned long buffer_size, unsigned int frag, -- unsigned long codec_id) -+ unsigned long codec_id, int pause_count, int pause_block, -+ int pause_duration) - { - struct compr_config config; - struct snd_codec codec; -@@ -499,6 +524,7 @@ void play_samples(char *name, unsigned int card, unsigned int device, - FILE *file; - char *buffer; - int size, num_read, wrote; -+ int write_count = 0; - - if (verbose) - printf("%s: entry\n", __func__); -@@ -574,6 +600,13 @@ void play_samples(char *name, unsigned int card, unsigned int device, - if (verbose) - printf("%s: You should hear audio NOW!!!\n", __func__); - -+ if (pause_count > 0) { -+ printf("sleep...\n"); -+ compress_pause(compress); -+ sleep(pause_duration); -+ compress_resume(compress); -+ } -+ - do { - num_read = fread(buffer, 1, size, file); - if (num_read > 0) { -@@ -592,8 +625,23 @@ void play_samples(char *name, unsigned int card, unsigned int device, - printf("%s: wrote %d\n", __func__, wrote); - } - } -+ write_count++; -+ if ((pause_count > 0) && (write_count % pause_block == 0)) { -+ printf("pause...\n"); -+ compress_pause(compress); -+ sleep(pause_duration); -+ printf("pause release...\n"); -+ compress_resume(compress); -+ pause_count--; -+ } - } while (num_read > 0); - -+ if (pause_count > 0) { -+ compress_pause(compress); -+ sleep(5); -+ compress_resume(compress); -+ } -+ - if (verbose) - printf("%s: exit success\n", __func__); - /* issue drain if it supports */ --- -2.17.1 - diff --git a/recipes-multimedia/tinycompress/tinycompress/0004-tinycompress-pass-NULL-buffer-with-0-size-to-driver.patch b/recipes-multimedia/tinycompress/tinycompress/0004-tinycompress-pass-NULL-buffer-with-0-size-to-driver.patch deleted file mode 100755 index dfedd186a..000000000 --- a/recipes-multimedia/tinycompress/tinycompress/0004-tinycompress-pass-NULL-buffer-with-0-size-to-driver.patch +++ /dev/null @@ -1,40 +0,0 @@ -From a2892bf5db7520689fa9cb1d1589fa804bd9dc1a Mon Sep 17 00:00:00 2001 -From: Bing Song -Date: Tue, 18 Aug 2020 15:26:51 +0800 -Subject: [PATCH] tinycompress: pass NULL buffer with 0 size to driver. - -The NULL buffer with 0 size to indecate driver drain input data with -non-block mode. The defaul drain is block mode. - -Upstream-Status: Inappropriate [i.MX specific] -Signed-off-by: Bing Song ---- - src/lib/compress.c | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/src/lib/compress.c b/src/lib/compress.c -index bba4fcf..d66df0b 100644 ---- a/src/lib/compress.c -+++ b/src/lib/compress.c -@@ -315,7 +315,8 @@ int compress_write(struct compress *compress, const void *buf, unsigned int size - fds.events = POLLOUT; - - /*TODO: treat auto start here first */ -- while (size) { -+ /* NULL buffer with 0 size for non-block drain */ -+ do { - if (ioctl(compress->fd, SNDRV_COMPRESS_AVAIL, &avail)) - return oops(compress, errno, "cannot get avail"); - -@@ -357,7 +358,7 @@ int compress_write(struct compress *compress, const void *buf, unsigned int size - size -= written; - cbuf += written; - total += written; -- } -+ } while (size); - return total; - } - --- -2.17.1 - diff --git a/recipes-multimedia/tinycompress/tinycompress/0005-cplay-Support-aac-streams.patch b/recipes-multimedia/tinycompress/tinycompress/0005-cplay-Support-aac-streams.patch deleted file mode 100755 index 2f36551ab..000000000 --- a/recipes-multimedia/tinycompress/tinycompress/0005-cplay-Support-aac-streams.patch +++ /dev/null @@ -1,251 +0,0 @@ -From 2912f8573cea25fbd38ac7a8b68af2ea6a05e599 Mon Sep 17 00:00:00 2001 -From: Zhang Peng -Date: Wed, 28 Oct 2020 19:08:53 +0800 -Subject: [PATCH] cplay: Support aac streams - -Support run aac format streams for cplay. - -Upstream-Status: Inappropriate [i.MX specific] -Signed-off-by: Zhang Peng ---- - src/utils/cplay.c | 210 ++++++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 210 insertions(+) - -diff --git a/src/utils/cplay.c b/src/utils/cplay.c -index 8e3dcbb..2a1464a 100644 ---- a/src/utils/cplay.c -+++ b/src/utils/cplay.c -@@ -245,6 +245,190 @@ static int parse_wav_header(FILE *file, unsigned int *num_channels, unsigned int - return 0; - } - -+int find_adts_header(FILE *file, unsigned int *num_channels, unsigned int *sample_rate, unsigned int *format) -+{ -+ int ret; -+ unsigned char buf[5]; -+ -+ ret = fread(buf, sizeof(buf), 1, file); -+ if (ret < 0) { -+ fprintf(stderr, "open file error: %d\n", ret); -+ return 0; -+ } -+ fseek(file, 0, SEEK_SET); -+ -+ if ((buf[0] != 0xff) || (buf[1] & 0xf0 != 0xf0)) -+ return 0; -+ /* mpeg id */ -+ switch (buf[1]>>3 & 0x1) { -+ case 0x0: -+ *format = SND_AUDIOSTREAMFORMAT_MP4ADTS; -+ break; -+ case 0x1: -+ *format = SND_AUDIOSTREAMFORMAT_MP2ADTS; -+ break; -+ default: -+ fprintf(stderr, "can't find stream format\n"); -+ break; -+ } -+ /* sample_rate */ -+ switch (buf[2]>>2 & 0xf) { -+ case 0x0: -+ *sample_rate = 96000; -+ break; -+ case 0x1: -+ *sample_rate = 88200; -+ break; -+ case 0x2: -+ *sample_rate = 64000; -+ break; -+ case 0x3: -+ *sample_rate = 48000; -+ break; -+ case 0x4: -+ *sample_rate = 44100; -+ break; -+ case 0x5: -+ *sample_rate = 32000; -+ break; -+ case 0x6: -+ *sample_rate = 24000; -+ break; -+ case 0x7: -+ *sample_rate = 22050; -+ break; -+ case 0x8: -+ *sample_rate = 16000; -+ break; -+ case 0x9: -+ *sample_rate = 12000; -+ break; -+ case 0xa: -+ *sample_rate = 11025; -+ break; -+ case 0xb: -+ *sample_rate = 8000; -+ break; -+ case 0xc: -+ *sample_rate = 7350; -+ break; -+ default: -+ break; -+ } -+ /* channel */ -+ switch (((buf[2]&0x1) << 2) | (buf[3]>>6)) { -+ case 1: -+ *num_channels = 1; -+ break; -+ case 2: -+ *num_channels = 2; -+ break; -+ case 3: -+ *num_channels = 3; -+ break; -+ case 4: -+ *num_channels = 4; -+ break; -+ case 5: -+ *num_channels = 5; -+ break; -+ case 6: -+ *num_channels = 6; -+ break; -+ case 7: -+ *num_channels = 7; -+ break; -+ default: -+ break; -+ } -+ return 1; -+} -+ -+static const int aac_sample_rates[] = { 96000, 88200, 64000, 48000, 44100, -+ 32000, 24000, 22050, 16000, 12000, 11025, 8000, 7350 -+}; -+ -+#define MAX_SR_NUM sizeof(aac_sample_rates)/sizeof(aac_sample_rates[0]) -+ -+static int get_sample_rate_from_index(int sr_index) -+{ -+ if (sr_index >= 0 && sr_index < MAX_SR_NUM) -+ return aac_sample_rates[sr_index]; -+ -+ return 0; -+} -+ -+int find_adif_header(FILE *file, unsigned int *num_channels, unsigned int *sample_rate, unsigned int *format) -+{ -+ int ret; -+ unsigned char adif_id[4]; -+ unsigned char adif_header[20]; -+ int bitstream_type; -+ int bitrate; -+ int object_type; -+ int sr_index; -+ int skip_size = 0; -+ -+ ret = fread(adif_id, sizeof(unsigned char), 4, file); -+ if (ret < 0) { -+ fprintf(stderr, "read data from file err: %d\n", ret); -+ return 0; -+ } -+ /* adif id */ -+ if ((adif_id[0] != 0x41) || (adif_id[1] != 0x44) || -+ (adif_id[2] != 0x49) || (adif_id[3] != 0x46)) -+ return 0; -+ -+ fread(adif_header, sizeof(unsigned char), 20, file); -+ -+ /* copyright string */ -+ if (adif_header[0] & 0x80) -+ skip_size = 9; -+ -+ bitstream_type = adif_header[0 + skip_size] & 0x10; -+ bitrate = -+ ((unsigned int) (adif_header[0 + skip_size] & 0x0f) << 19) | -+ ((unsigned int) adif_header[1 + skip_size] << 11) | -+ ((unsigned int) adif_header[2 + skip_size] << 3) | -+ ((unsigned int) adif_header[3 + skip_size] & 0xe0); -+ -+ if (bitstream_type == 0) { -+ object_type = ((adif_header[6 + skip_size] & 0x01) << 1) | -+ ((adif_header[7 + skip_size] & 0x80) >> 7); -+ sr_index = (adif_header[7 + skip_size] & 0x78) >> 3; -+ } -+ /* VBR */ -+ else { -+ object_type = (adif_header[4 + skip_size] & 0x18) >> 3; -+ sr_index = ((adif_header[4 + skip_size] & 0x07) << 1) | -+ ((adif_header[5 + skip_size] & 0x80) >> 7); -+ } -+ -+ /* sample rate */ -+ *sample_rate = get_sample_rate_from_index(sr_index); -+ -+ /* FIXME: assume channels is 2 */ -+ *num_channels = 2; -+ -+ *format = SND_AUDIOSTREAMFORMAT_ADIF; -+ fseek(file, 0, SEEK_SET); -+ return 1; -+} -+ -+static int parse_aac_header(FILE *file, unsigned int *num_channels, unsigned int *sample_rate, unsigned int *format) -+{ -+ if (find_adts_header(file, num_channels, sample_rate, format)) -+ return 1; -+ else if (find_adif_header(file, num_channels, sample_rate, format)) -+ return 1; -+ else { -+ fprintf(stderr, "can't find streams format\n"); -+ return 0; -+ } -+ -+ return 1; -+} -+ - static int print_time(struct compress *compress) - { - unsigned int avail; -@@ -513,6 +697,29 @@ void get_codec_pcm(FILE *file, struct compr_config *config, - codec->format = format; - } - -+void get_codec_aac(FILE *file, struct compr_config *config, -+ struct snd_codec *codec) -+{ -+ unsigned int channels, rate, format; -+ -+ if (parse_aac_header(file, &channels, &rate, &format) == 0) { -+ fclose(file); -+ exit(EXIT_FAILURE); -+ }; -+ fseek(file, 0, SEEK_SET); -+ -+ codec->id = SND_AUDIOCODEC_AAC; -+ codec->ch_in = channels; -+ codec->ch_out = channels; -+ codec->sample_rate = rate; -+ codec->bit_rate = 0; -+ codec->rate_control = 0; -+ codec->profile = SND_AUDIOPROFILE_AAC; -+ codec->level = 0; -+ codec->ch_mode = 0; -+ codec->format = format; -+ -+} - void play_samples(char *name, unsigned int card, unsigned int device, - unsigned long buffer_size, unsigned int frag, - unsigned long codec_id, int pause_count, int pause_block, -@@ -544,6 +751,9 @@ void play_samples(char *name, unsigned int card, unsigned int device, - case SND_AUDIOCODEC_PCM: - get_codec_pcm(file, &config, &codec); - break; -+ case SND_AUDIOCODEC_AAC: -+ get_codec_aac(file, &config, &codec); -+ break; - default: - fprintf(stderr, "codec ID %ld is not supported\n", codec_id); - exit(EXIT_FAILURE); --- -2.17.1 - diff --git a/recipes-multimedia/tinycompress/tinycompress_1.1.6.bb b/recipes-multimedia/tinycompress/tinycompress_1.1.6.bb deleted file mode 100644 index 5cad5ba67..000000000 --- a/recipes-multimedia/tinycompress/tinycompress_1.1.6.bb +++ /dev/null @@ -1,16 +0,0 @@ -DESCRIPTION = "A library to handle compressed formats like MP3 etc." -LICENSE = "LGPL-2.1-only | BSD-3-Clause" -LIC_FILES_CHKSUM = "file://COPYING;md5=cf9105c1a2d4405cbe04bbe3367373a0" -DEPENDS = "alsa-lib" - -SRC_URI = "git://git.alsa-project.org/http/tinycompress.git;protocol=https;branch=master \ - file://0001-tinycompress-Add-id3-decoding.patch \ - file://0002-cplay-Support-wave-file.patch \ - file://0003-cplay-Add-pause-feature.patch \ - file://0004-tinycompress-pass-NULL-buffer-with-0-size-to-driver.patch \ - file://0005-cplay-Support-aac-streams.patch \ -" -SRCREV = "995f2ed91045dad8c20485ab1a64727d22cd92e5" -S = "${WORKDIR}/git" - -inherit autotools pkgconfig diff --git a/recipes-multimedia/tinycompress/tinycompress_1.2.5.bb b/recipes-multimedia/tinycompress/tinycompress_1.2.5.bb new file mode 100644 index 000000000..f37e786b6 --- /dev/null +++ b/recipes-multimedia/tinycompress/tinycompress_1.2.5.bb @@ -0,0 +1,18 @@ +DESCRIPTION = "A library to handle compressed formats like MP3 etc." +LICENSE = "LGPL-2.1-only | BSD-3-Clause" +LIC_FILES_CHKSUM = "file://COPYING;md5=cf9105c1a2d4405cbe04bbe3367373a0" +DEPENDS = "alsa-lib" + +inherit autotools pkgconfig + +PV .= "+git" + +SRC_URI = "git://github.com/alsa-project/tinycompress.git;protocol=https;branch=master \ +" +SRCREV = "f3ba6e5c2126f2fb07e3d890f990d50c3e204e67" + +EXTRA_OECONF:append = " --enable-pcm" + +S = "${WORKDIR}/git" + +inherit autotools pkgconfig -- cgit v1.2.3-54-g00ecf From 6cccf78d54c9907844df399a792ecb55bb1120c9 Mon Sep 17 00:00:00 2001 From: Daiane Angolini Date: Wed, 12 Feb 2025 17:59:24 -0300 Subject: imx-atf: Bum to match 6.6.52-2.2.0 Relevant changes: - 1b27ee3ed Pull request #96: MA-23026 Fix bug: failed boot on LS platforms due caam driver - 02b06d177 MA-23026 Fix bug: failed boot on LS platforms due caam driver - afd50b207 LF-13734 fix(imx95): add missing license header - 0efc2fff8 Pull request #95: MA-23009 Fix i.MX 8Q boot failed when trusty disabled - 0728e974a MA-23009 Fix i.MX 8Q boot failed when trusty disabled - f590c74e5 Pull request #94: MA-23007 Fix bug, i.MX 8MN ATF failed to build - e9823459d MA-23007 Fix i.MX 8MN build break - a53124bcd Pull request #92: ATF RNG - 5b66f7321 MA-21916 Enable caam driver for i.MX - 55f8854fc MA-21915 Make the CAAM driver compatible with i.MX devices - 1d6489907 MA-22997 Fix bug: 8q failed to print any logs in ATF - dfda4210e Pull request #88: Lf v2.10 LF-13160 - 8b770b71f MA-22946-2 Guard the FF-A functions - b02708418 MA-22946 Enlarge the trusty stack - 66b6ed7e1 trusty: delete the fp registers save&restore at init stage - fea70c8d6 spd: trusty: Add FFA_PARTITION_INFO_GET - 96c52d0c2 spd: trusty: Add FFA_RX_RELEASE - afff18cea spd: trusty: add secure partition and non secure client descriptors - 77ba0234d spd: trusty: use FFA specific macros from ffa_svc - c80318969 trusty: generic-arm64-smcall: Add echo smcalls - 42164a24c LF-13673 fix(imx93): correct the ecc en bit define - 0e31b369c LF-13160-3: plat: imx8ulp: scmi sensor update temp return val - f6f942d2e LF-13160-2: drivers: scmi-msg: sensor: follow return temp val with spec data types - 3399b1786 LF-13160-1: plat: imx8ulp: scmi sensor: fix invalid temp error - 5e2ae7751 LF-13235 feat(imx95): support LM boot and shutdown - 7f72130b5 LF-13233 feat(imx95): support setting M7 reset address - 7c4a94d42 LF-13603 fix(imx9): reduce the pmic stby off delay on imx93/91 - efbc6f46a LF-13319 feat(imx95): Implement a semaphore for GIC quiescing between SM and ATF Signed-off-by: Daiane Angolini --- recipes-bsp/imx-atf/imx-atf_2.10.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes-bsp/imx-atf/imx-atf_2.10.bb b/recipes-bsp/imx-atf/imx-atf_2.10.bb index 04826b4cb..ec4088dcd 100644 --- a/recipes-bsp/imx-atf/imx-atf_2.10.bb +++ b/recipes-bsp/imx-atf/imx-atf_2.10.bb @@ -9,7 +9,7 @@ PV .= "+git${SRCPV}" SRC_URI = "git://github.com/nxp-imx/imx-atf.git;protocol=https;branch=${SRCBRANCH}" SRCBRANCH = "lf_v2.10" -SRCREV = "28affcae957cb8194917b5246276630f9e6343e1" +SRCREV = "1b27ee3edbb40ef9432c69ccaa744d1ac5d54c5d" S = "${WORKDIR}/git" -- cgit v1.2.3-54-g00ecf From 20680052ffd9b035d7d1c44958e9fc12e9cceb71 Mon Sep 17 00:00:00 2001 From: Zelan Zou Date: Mon, 6 Jan 2025 07:05:48 +0100 Subject: imx-alsa-plugins_git: Switch to L6.6.52-2.2.0 release branch Signed-off-by: Zelan Zou --- recipes-multimedia/alsa/imx-alsa-plugins_git.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes-multimedia/alsa/imx-alsa-plugins_git.bb b/recipes-multimedia/alsa/imx-alsa-plugins_git.bb index d1eec405e..7b17ccb0a 100644 --- a/recipes-multimedia/alsa/imx-alsa-plugins_git.bb +++ b/recipes-multimedia/alsa/imx-alsa-plugins_git.bb @@ -20,7 +20,7 @@ inherit autotools pkgconfig use-imx-headers PV = "1.0.26+${SRCPV}" SRC_URI = "git://github.com/nxp-imx/imx-alsa-plugins.git;protocol=https;branch=${SRCBRANCH}" -SRCBRANCH = "MM_04.09.01_2408_L6.6.y" +SRCBRANCH = "MM_04.09.02_2410_L6.6.y" SRCREV = "b2ba082e70333f187972ee4e85f63f9d2f608331" S = "${WORKDIR}/git" -- cgit v1.2.3-54-g00ecf From cb1a65c7686a647934054423105af61d484ad9a3 Mon Sep 17 00:00:00 2001 From: Zelan Zou Date: Mon, 6 Jan 2025 07:44:11 +0100 Subject: imx-dsp: Update to L6.6.52_2.2.0 release Bump version 2.1.8 -> 2.1.9 License update to EULA V58 Signed-off-by: Zelan Zou --- recipes-multimedia/imx-dsp/imx-dsp_2.1.8.bb | 56 ---------------------------- recipes-multimedia/imx-dsp/imx-dsp_2.1.9.bb | 58 +++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 56 deletions(-) delete mode 100644 recipes-multimedia/imx-dsp/imx-dsp_2.1.8.bb create mode 100644 recipes-multimedia/imx-dsp/imx-dsp_2.1.9.bb diff --git a/recipes-multimedia/imx-dsp/imx-dsp_2.1.8.bb b/recipes-multimedia/imx-dsp/imx-dsp_2.1.8.bb deleted file mode 100644 index e1cf08774..000000000 --- a/recipes-multimedia/imx-dsp/imx-dsp_2.1.8.bb +++ /dev/null @@ -1,56 +0,0 @@ -# Copyright 2017-2023 NXP - -DESCRIPTION = "i.MX DSP Wrapper, Firmware Binary, Codec Libraries" -LICENSE = "Proprietary" -LIC_FILES_CHKSUM = "file://COPYING;md5=10c0fda810c63b052409b15a5445671a" - - -inherit fsl-eula-unpack autotools pkgconfig - -SRC_URI = "${FSL_MIRROR}/${BP}.bin;fsl-eula=true" - -SRC_URI[sha256sum] = "5d42c8f39fb36bcc48e9f0c4caffd125b89c257fa8eccb3b61608bc690a16462" - -EXTRA_OECONF = " \ - -datadir=${base_libdir}/firmware \ - --bindir=/unit_tests \ - ${@bb.utils.contains('TUNE_FEATURES', 'aarch64', '--enable-armv8', '', d)} \ -" - -HIFI4_PLATFORM ?= "HIFI4_PLATFORM_IS_UNDEFINED" -HIFI4_PLATFORM:mx8qm-nxp-bsp = "imx8qmqxp" -HIFI4_PLATFORM:mx8qxp-nxp-bsp = "imx8qmqxp" -HIFI4_PLATFORM:mx8dx-nxp-bsp = "imx8qmqxp" -HIFI4_PLATFORM:mx8mp-nxp-bsp = "imx8mp" -HIFI4_PLATFORM:mx8ulp-nxp-bsp = "imx8ulp" - -UNSUPPORTED_TESTS = "dsp_tflm" -UNSUPPORTED_TESTS:mx8ulp-nxp-bsp = "" - -do_install:append () { - # Remove firmware not for this platform - find ${D}/${base_libdir}/firmware/imx/dsp -name hifi4_*.bin -not -name *${HIFI4_PLATFORM}* -exec rm {} \; - # Set the expected generic name for the firmware - mv ${D}/${base_libdir}/firmware/imx/dsp/hifi4_${HIFI4_PLATFORM}.bin ${D}/${base_libdir}/firmware/imx/dsp/hifi4.bin - # Remove unit tests not for this platform - for unsupported_test in ${UNSUPPORTED_TESTS}; do - find ${D}/unit_tests/DSP -name $unsupported_test* -exec rm {} \; - done -} - -FILES:${PN} = "${libdir}/imx-mm/audio-codec/dsp \ - ${libdir}/imx-mm/audio-codec/wrap \ - ${base_libdir}/firmware/imx/dsp \ - /unit_tests \ -" -RDEPENDS:${PN} += "imx-dsp-codec-ext" - -INSANE_SKIP:${PN} = "already-stripped arch ldflags dev-so" - -# Fix strip command failed: 'Unable to recognise the format of the input file' -INHIBIT_PACKAGE_STRIP = "1" -INHIBIT_PACKAGE_DEBUG_SPLIT = "1" -INHIBIT_SYSROOT_STRIP = "1" - -PACKAGE_ARCH = "${MACHINE_ARCH}" -COMPATIBLE_MACHINE = "(mx8qm-nxp-bsp|mx8qxp-nxp-bsp|mx8dx-nxp-bsp|mx8mp-nxp-bsp|mx8ulp-nxp-bsp)" diff --git a/recipes-multimedia/imx-dsp/imx-dsp_2.1.9.bb b/recipes-multimedia/imx-dsp/imx-dsp_2.1.9.bb new file mode 100644 index 000000000..73321ddc8 --- /dev/null +++ b/recipes-multimedia/imx-dsp/imx-dsp_2.1.9.bb @@ -0,0 +1,58 @@ +# Copyright 2017-2022,2024 NXP + +DESCRIPTION = "i.MX DSP Wrapper, Firmware Binary, Codec Libraries" +LICENSE = "Proprietary" +LIC_FILES_CHKSUM = "file://COPYING;md5=ca53281cc0caa7e320d4945a896fb837" + +inherit fsl-eula-unpack autotools pkgconfig + +IMX_SRCREV_ABBREV = "a3074e2" +SRC_URI = "${FSL_MIRROR}/${BP}-${IMX_SRCREV_ABBREV}.bin;fsl-eula=true" + +S = "${WORKDIR}/${BP}-${IMX_SRCREV_ABBREV}" + +SRC_URI[sha256sum] = "1f763c21f20abfbb013a0d1acb5846fec55241e9fa8c8aae47fd95b007d800fe" + +EXTRA_OECONF = " \ + -datadir=${base_libdir}/firmware \ + --bindir=/unit_tests \ + ${@bb.utils.contains('TUNE_FEATURES', 'aarch64', '--enable-armv8', '', d)} \ +" + +HIFI4_PLATFORM ?= "HIFI4_PLATFORM_IS_UNDEFINED" +HIFI4_PLATFORM:mx8qm-nxp-bsp = "imx8qmqxp" +HIFI4_PLATFORM:mx8qxp-nxp-bsp = "imx8qmqxp" +HIFI4_PLATFORM:mx8dx-nxp-bsp = "imx8qmqxp" +HIFI4_PLATFORM:mx8mp-nxp-bsp = "imx8mp" +HIFI4_PLATFORM:mx8ulp-nxp-bsp = "imx8ulp" + +UNSUPPORTED_TESTS = "dsp_tflm" +UNSUPPORTED_TESTS:mx8ulp-nxp-bsp = "" + +do_install:append () { + # Remove firmware not for this platform + find ${D}/${base_libdir}/firmware/imx/dsp -name hifi4_*.bin -not -name *${HIFI4_PLATFORM}* -exec rm {} \; + # Set the expected generic name for the firmware + mv ${D}/${base_libdir}/firmware/imx/dsp/hifi4_${HIFI4_PLATFORM}.bin ${D}/${base_libdir}/firmware/imx/dsp/hifi4.bin + # Remove unit tests not for this platform + for unsupported_test in ${UNSUPPORTED_TESTS}; do + find ${D}/unit_tests/DSP -name $unsupported_test* -exec rm {} \; + done +} + +FILES:${PN} = "${libdir}/imx-mm/audio-codec/dsp \ + ${libdir}/imx-mm/audio-codec/wrap \ + ${base_libdir}/firmware/imx/dsp \ + /unit_tests \ +" +RDEPENDS:${PN} += "imx-dsp-codec-ext" + +INSANE_SKIP:${PN} = "already-stripped arch ldflags dev-so" + +# Fix strip command failed: 'Unable to recognise the format of the input file' +INHIBIT_PACKAGE_STRIP = "1" +INHIBIT_PACKAGE_DEBUG_SPLIT = "1" +INHIBIT_SYSROOT_STRIP = "1" + +PACKAGE_ARCH = "${MACHINE_ARCH}" +COMPATIBLE_MACHINE = "(mx8qm-nxp-bsp|mx8qxp-nxp-bsp|mx8dx-nxp-bsp|mx8mp-nxp-bsp|mx8ulp-nxp-bsp)" -- cgit v1.2.3-54-g00ecf From f59494ed31672b9d906fab7f061926f20377fa50 Mon Sep 17 00:00:00 2001 From: Zelan Zou Date: Mon, 6 Jan 2025 07:45:34 +0100 Subject: imx-opencl-converter: Update to L6.6.52_2.2.0 release Bump version 0.5.0 -> 0.6.0 Signed-off-by: Zelan Zou --- .../imx-opencl-converter_0.5.0.bb | 20 -------------------- .../imx-opencl-converter_0.6.0.bb | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+), 20 deletions(-) delete mode 100644 recipes-multimedia/imx-opencl-converter/imx-opencl-converter_0.5.0.bb create mode 100644 recipes-multimedia/imx-opencl-converter/imx-opencl-converter_0.6.0.bb diff --git a/recipes-multimedia/imx-opencl-converter/imx-opencl-converter_0.5.0.bb b/recipes-multimedia/imx-opencl-converter/imx-opencl-converter_0.5.0.bb deleted file mode 100644 index 6b9ad815e..000000000 --- a/recipes-multimedia/imx-opencl-converter/imx-opencl-converter_0.5.0.bb +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright 2023-2024 NXP -DESCRIPTION = "NXP Multimedia opencl converter lib" -LICENSE = "Proprietary" -SECTION = "multimedia" -LIC_FILES_CHKSUM = "file://COPYING;md5=ca53281cc0caa7e320d4945a896fb837" -DEPENDS = "virtual/opencl-icd" - -SRC_URI = "${FSL_MIRROR}/${BP}-${IMX_SRCREV_ABBREV}.bin;fsl-eula=true" -IMX_SRCREV_ABBREV = "f2c3930" - -SRC_URI[sha256sum] = "eb3df72a7e1d16ec1660978cf36b7818b8ac7c7defe3222ae4bb7dabd4a5f4cc" - -S = "${WORKDIR}/${BP}-${IMX_SRCREV_ABBREV}" -inherit fsl-eula-unpack autotools pkgconfig meson - -FILES:${PN} += "${datadir}/" - -COMPATIBLE_MACHINE = "(^$)" -COMPATIBLE_MACHINE:imxgpu = "(mx8-nxp-bsp|mx95-nxp-bsp)" -COMPATIBLE_MACHINE:mx8mm-nxp-bsp = "(^$)" diff --git a/recipes-multimedia/imx-opencl-converter/imx-opencl-converter_0.6.0.bb b/recipes-multimedia/imx-opencl-converter/imx-opencl-converter_0.6.0.bb new file mode 100644 index 000000000..7f0c22561 --- /dev/null +++ b/recipes-multimedia/imx-opencl-converter/imx-opencl-converter_0.6.0.bb @@ -0,0 +1,20 @@ +# Copyright 2023-2024 NXP +DESCRIPTION = "NXP Multimedia opencl converter lib" +LICENSE = "Proprietary" +SECTION = "multimedia" +LIC_FILES_CHKSUM = "file://COPYING;md5=ca53281cc0caa7e320d4945a896fb837" +DEPENDS = "virtual/opencl-icd" + +SRC_URI = "${FSL_MIRROR}/${BP}-${IMX_SRCREV_ABBREV}.bin;fsl-eula=true" +IMX_SRCREV_ABBREV = "605ef75" + +SRC_URI[sha256sum] = "777f49805d5455ebc27e63d19552e2924174011d2ae7d9b392febfa8794d4dc6" + +S = "${WORKDIR}/${BP}-${IMX_SRCREV_ABBREV}" +inherit fsl-eula-unpack autotools pkgconfig meson + +FILES:${PN} += "${datadir}/" + +COMPATIBLE_MACHINE = "(^$)" +COMPATIBLE_MACHINE:imxgpu = "(mx8-nxp-bsp|mx95-nxp-bsp)" +COMPATIBLE_MACHINE:mx8mm-nxp-bsp = "(^$)" -- cgit v1.2.3-54-g00ecf From bc39db935f5fd3684b807c064324ccfa8a85b4b8 Mon Sep 17 00:00:00 2001 From: Zelan Zou Date: Mon, 6 Jan 2025 07:46:45 +0100 Subject: imx-parser: Update to L6.6.52_2.2.0 release Bump version 4.9.1 -> 4.9.2 Signed-off-by: Zelan Zou --- recipes-multimedia/imx-parser/imx-parser_4.9.1.bb | 46 ----------------------- recipes-multimedia/imx-parser/imx-parser_4.9.2.bb | 46 +++++++++++++++++++++++ 2 files changed, 46 insertions(+), 46 deletions(-) delete mode 100644 recipes-multimedia/imx-parser/imx-parser_4.9.1.bb create mode 100644 recipes-multimedia/imx-parser/imx-parser_4.9.2.bb diff --git a/recipes-multimedia/imx-parser/imx-parser_4.9.1.bb b/recipes-multimedia/imx-parser/imx-parser_4.9.1.bb deleted file mode 100644 index a4bb2333c..000000000 --- a/recipes-multimedia/imx-parser/imx-parser_4.9.1.bb +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (C) 2012-2018 O.S. Systems Software LTDA. -# Copyright (C) 2012-2016 Freescale Semiconductor -# Copyright (C) 2017-2023 NXP -# Released under the MIT license (see COPYING.MIT for the terms) -DESCRIPTION = "Freescale Multimedia parser libs" -LICENSE = "Proprietary" -SECTION = "multimedia" -LIC_FILES_CHKSUM = "file://COPYING;md5=ca53281cc0caa7e320d4945a896fb837" - -# For backwards compatibility -PROVIDES += "libfslparser" -RREPLACES:${PN} = "libfslparser" -RPROVIDES:${PN} = "libfslparser" -RCONFLICTS:${PN} = "libfslparser" - -SRC_URI = "${FSL_MIRROR}/${BP}-${IMX_SRCREV_ABBREV}.bin;fsl-eula=true" -IMX_SRCREV_ABBREV = "5d91190" -S = "${WORKDIR}/${BP}-${IMX_SRCREV_ABBREV}" - -SRC_URI[sha256sum] = "087badea414540d1b9403be1a0c7fc91ac42a61f0374857972cd06d8c392ddec" - -inherit fsl-eula-unpack autotools pkgconfig - -# Choose between 32-bit and 64-bit binaries and between Soft Float-Point and Hard Float-Point -EXTRA_OECONF = "${@bb.utils.contains('TUNE_FEATURES', 'aarch64', '--enable-armv8', \ - bb.utils.contains('TUNE_FEATURES', 'callconvention-hard', '--enable-fhw', '--enable-fsw', d), d)}" - -INHIBIT_PACKAGE_STRIP = "1" -INHIBIT_PACKAGE_DEBUG_SPLIT = "1" - -python __set_insane_skip() { - # FIXME: All binaries lack GNU_HASH in elf binary but as we don't have - # the source we cannot fix it. Disable the insane check for now. - # FIXME: gst-fsl-plugin looks for the .so files so we need to deploy those - for p in d.getVar('PACKAGES').split(): - d.setVar("INSANE_SKIP:%s" % p, "ldflags dev-so textrel") -} - -do_package_qa[prefuncs] += "__set_insane_skip" - -# FIXME: gst-fsl-plugin looks for the .so files so we need to deploy those -FILES:${PN} += "${libdir}/imx-mm/*/*${SOLIBS} ${libdir}/imx-mm/*/*${SOLIBSDEV}" - -INHIBIT_SYSROOT_STRIP = "1" - -COMPATIBLE_MACHINE = "(imx-nxp-bsp)" diff --git a/recipes-multimedia/imx-parser/imx-parser_4.9.2.bb b/recipes-multimedia/imx-parser/imx-parser_4.9.2.bb new file mode 100644 index 000000000..78b48da03 --- /dev/null +++ b/recipes-multimedia/imx-parser/imx-parser_4.9.2.bb @@ -0,0 +1,46 @@ +# Copyright (C) 2012-2018 O.S. Systems Software LTDA. +# Copyright (C) 2012-2016 Freescale Semiconductor +# Copyright (C) 2017-2023 NXP +# Released under the MIT license (see COPYING.MIT for the terms) +DESCRIPTION = "Freescale Multimedia parser libs" +LICENSE = "Proprietary" +SECTION = "multimedia" +LIC_FILES_CHKSUM = "file://COPYING;md5=ca53281cc0caa7e320d4945a896fb837" + +# For backwards compatibility +PROVIDES += "libfslparser" +RREPLACES:${PN} = "libfslparser" +RPROVIDES:${PN} = "libfslparser" +RCONFLICTS:${PN} = "libfslparser" + +SRC_URI = "${FSL_MIRROR}/${BP}-${IMX_SRCREV_ABBREV}.bin;fsl-eula=true" +IMX_SRCREV_ABBREV = "828fcb7" +S = "${WORKDIR}/${BP}-${IMX_SRCREV_ABBREV}" + +SRC_URI[sha256sum] = "7414db9e2cce2cb2d6fe63ac7d193a0ea65ad8a184e6a2e2ce2785e43acbb339" + +inherit fsl-eula-unpack autotools pkgconfig + +# Choose between 32-bit and 64-bit binaries and between Soft Float-Point and Hard Float-Point +EXTRA_OECONF = "${@bb.utils.contains('TUNE_FEATURES', 'aarch64', '--enable-armv8', \ + bb.utils.contains('TUNE_FEATURES', 'callconvention-hard', '--enable-fhw', '--enable-fsw', d), d)}" + +INHIBIT_PACKAGE_STRIP = "1" +INHIBIT_PACKAGE_DEBUG_SPLIT = "1" + +python __set_insane_skip() { + # FIXME: All binaries lack GNU_HASH in elf binary but as we don't have + # the source we cannot fix it. Disable the insane check for now. + # FIXME: gst-fsl-plugin looks for the .so files so we need to deploy those + for p in d.getVar('PACKAGES').split(): + d.setVar("INSANE_SKIP:%s" % p, "ldflags dev-so textrel") +} + +do_package_qa[prefuncs] += "__set_insane_skip" + +# FIXME: gst-fsl-plugin looks for the .so files so we need to deploy those +FILES:${PN} += "${libdir}/imx-mm/*/*${SOLIBS} ${libdir}/imx-mm/*/*${SOLIBSDEV}" + +INHIBIT_SYSROOT_STRIP = "1" + +COMPATIBLE_MACHINE = "(imx-nxp-bsp)" -- cgit v1.2.3-54-g00ecf From e983edae3f4a230457ded5f3b44cfe7d54913914 Mon Sep 17 00:00:00 2001 From: Zelan Zou Date: Mon, 6 Jan 2025 07:48:13 +0100 Subject: imx-vpuwrap: Update to L6.6.52_2.2.0 release Signed-off-by: Zelan Zou --- ..._hantro_VCencoder-add-sys-time.h-for-gett.patch | 31 ---------------------- ..._hantro_encoder-add-sys-time.h-for-gettim.patch | 29 -------------------- recipes-multimedia/imx-vpuwrap/imx-vpuwrap_git.bb | 6 ++--- 3 files changed, 2 insertions(+), 64 deletions(-) delete mode 100644 recipes-multimedia/imx-vpuwrap/imx-vpuwrap/0001-vpu_wrapper_hantro_VCencoder-add-sys-time.h-for-gett.patch delete mode 100644 recipes-multimedia/imx-vpuwrap/imx-vpuwrap/0001-vpu_wrapper_hantro_encoder-add-sys-time.h-for-gettim.patch diff --git a/recipes-multimedia/imx-vpuwrap/imx-vpuwrap/0001-vpu_wrapper_hantro_VCencoder-add-sys-time.h-for-gett.patch b/recipes-multimedia/imx-vpuwrap/imx-vpuwrap/0001-vpu_wrapper_hantro_VCencoder-add-sys-time.h-for-gett.patch deleted file mode 100644 index ab8b50de4..000000000 --- a/recipes-multimedia/imx-vpuwrap/imx-vpuwrap/0001-vpu_wrapper_hantro_VCencoder-add-sys-time.h-for-gett.patch +++ /dev/null @@ -1,31 +0,0 @@ -From a57daf8f58cf69be06de8ebc9eab3a3077143760 Mon Sep 17 00:00:00 2001 -From: Hiago De Franco -Date: Fri, 26 Jul 2024 14:43:55 -0300 -Subject: [PATCH] vpu_wrapper_hantro_VCencoder: add sys/time.h for gettimeofday - -Fixes: -| ../git/vpu_wrapper_hantro_VCencoder.c:1965:5: error: implicit declaration of function 'gettimeofday' [-Wimplicit-function-declaration] -| 1965 | gettimeofday (&pObj->tvBegin, NULL); -| | ^~~~~~~~~~~~ - -Upstream-Status: Submitted [https://github.com/nxp-imx/imx-vpuwrap/pull/2] -Signed-off-by: Hiago De Franco ---- - vpu_wrapper_hantro_VCencoder.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/vpu_wrapper_hantro_VCencoder.c b/vpu_wrapper_hantro_VCencoder.c -index efae31a77ca4..6185cfc067d1 100755 ---- a/vpu_wrapper_hantro_VCencoder.c -+++ b/vpu_wrapper_hantro_VCencoder.c -@@ -17,6 +17,7 @@ - #include - #include - #include -+#include - #include - #include - #include --- -2.39.2 - diff --git a/recipes-multimedia/imx-vpuwrap/imx-vpuwrap/0001-vpu_wrapper_hantro_encoder-add-sys-time.h-for-gettim.patch b/recipes-multimedia/imx-vpuwrap/imx-vpuwrap/0001-vpu_wrapper_hantro_encoder-add-sys-time.h-for-gettim.patch deleted file mode 100644 index cbf37417e..000000000 --- a/recipes-multimedia/imx-vpuwrap/imx-vpuwrap/0001-vpu_wrapper_hantro_encoder-add-sys-time.h-for-gettim.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 482c639a0da4b093cfc029009604e9653ced33c4 Mon Sep 17 00:00:00 2001 -From: Max Krummenacher -Date: Thu, 13 Jun 2024 07:15:12 +0000 -Subject: [PATCH] vpu_wrapper_hantro_encoder: add sys/time.h for gettimeofday - -Fixes: -| ../git/vpu_wrapper_hantro_encoder.c:953:3: error: implicit declaration of function 'gettimeofday' [-Wimplicit-function-declaration] - -Upstream-Status: Pending -Signed-off-by: Max Krummenacher ---- - vpu_wrapper_hantro_encoder.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/vpu_wrapper_hantro_encoder.c b/vpu_wrapper_hantro_encoder.c -index 3819c389320c..635c98bf1f19 100755 ---- a/vpu_wrapper_hantro_encoder.c -+++ b/vpu_wrapper_hantro_encoder.c -@@ -24,6 +24,7 @@ - #include - #include - #include -+#include - #include - - #include "headers/OMX_Video.h" --- -2.42.0 - diff --git a/recipes-multimedia/imx-vpuwrap/imx-vpuwrap_git.bb b/recipes-multimedia/imx-vpuwrap/imx-vpuwrap_git.bb index 2b737999e..86533c3c0 100644 --- a/recipes-multimedia/imx-vpuwrap/imx-vpuwrap_git.bb +++ b/recipes-multimedia/imx-vpuwrap/imx-vpuwrap_git.bb @@ -12,11 +12,9 @@ DEPENDS:append:mx8mp-nxp-bsp = " imx-vpu-hantro-vc" SRC_URI = " \ git://github.com/NXP/imx-vpuwrap.git;protocol=https;branch=${SRCBRANCH} \ - file://0001-vpu_wrapper_hantro_encoder-add-sys-time.h-for-gettim.patch \ - file://0001-vpu_wrapper_hantro_VCencoder-add-sys-time.h-for-gett.patch \ " -SRCBRANCH = "MM_04.09.01_2408_L6.6.y" -SRCREV = "c13069d239cae314adc3651df25b96afa46cb434" +SRCBRANCH = "MM_04.09.02_2410_L6.6.y" +SRCREV = "378e33989cf72d6c2eb57a585072ba9abe87c6ff" S = "${WORKDIR}/git" -- cgit v1.2.3-54-g00ecf From 9b53d8ac1d04f896466e7bfdcf5a6808e3f623c0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 27 Feb 2025 19:28:16 +0000 Subject: Auto-update LICENSE file with current recipe licenses --- LICENSE | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/LICENSE b/LICENSE index bc4cbb106..0c5b7af26 100644 --- a/LICENSE +++ b/LICENSE @@ -143,10 +143,10 @@ LICENSE_FLAGS = "commercial" ./recipes-multimedia/gstreamer/imx-gst1.0-plugin_git.bb: LICENSE = "GPL-2.0-only & LGPL-2.0-only & LGPL-2.1-only" ./recipes-multimedia/imx-codec/imx-codec_4.9.0.bb: LICENSE = "Proprietary" ./recipes-multimedia/imx-dsp/imx-dsp-codec-ext_2.1.8.bb: LICENSE = "Proprietary" -./recipes-multimedia/imx-dsp/imx-dsp_2.1.8.bb: LICENSE = "Proprietary" +./recipes-multimedia/imx-dsp/imx-dsp_2.1.9.bb: LICENSE = "Proprietary" ./recipes-multimedia/imx-dspc-asrc/imx-dspc-asrc_1.0.1.bb: LICENSE = "Proprietary" -./recipes-multimedia/imx-opencl-converter/imx-opencl-converter_0.5.0.bb: LICENSE = "Proprietary" -./recipes-multimedia/imx-parser/imx-parser_4.9.1.bb: LICENSE = "Proprietary" +./recipes-multimedia/imx-opencl-converter/imx-opencl-converter_0.6.0.bb: LICENSE = "Proprietary" +./recipes-multimedia/imx-parser/imx-parser_4.9.2.bb: LICENSE = "Proprietary" ./recipes-multimedia/imx-sw-pdm/imx-sw-pdm_1.0.3.bb: LICENSE = "Proprietary" ./recipes-multimedia/imx-vpuwrap/imx-vpuwrap_git.bb: LICENSE = "Proprietary" ./recipes-multimedia/libimxvpuapi/libimxvpuapi2_2.3.1.bb: LICENSE = "LGPL-2.1-only" -- cgit v1.2.3-54-g00ecf From d96aff8e6a301c93639c23a8ccf198f44140223c Mon Sep 17 00:00:00 2001 From: Max Krummenacher Date: Mon, 3 Mar 2025 09:31:45 +0100 Subject: imx-vpuwrap: fix build error Add missing include file. Otherwise with latest master we see: | ../git/vpu_wrapper_hantro_encoder.c:953:3: error: implicit declaration of function 'gettimeofday' [-Wimplicit-function-declaration] | 953 | gettimeofday (&pObj->tvEnd, NULL); Signed-off-by: Max Krummenacher --- ...rapper_hantro_encoder-fix-missing-include.patch | 32 ++++++++++++++++++++++ recipes-multimedia/imx-vpuwrap/imx-vpuwrap_git.bb | 1 + 2 files changed, 33 insertions(+) create mode 100644 recipes-multimedia/imx-vpuwrap/imx-vpuwrap/0001-vpu_wrapper_hantro_encoder-fix-missing-include.patch diff --git a/recipes-multimedia/imx-vpuwrap/imx-vpuwrap/0001-vpu_wrapper_hantro_encoder-fix-missing-include.patch b/recipes-multimedia/imx-vpuwrap/imx-vpuwrap/0001-vpu_wrapper_hantro_encoder-fix-missing-include.patch new file mode 100644 index 000000000..74ea5206c --- /dev/null +++ b/recipes-multimedia/imx-vpuwrap/imx-vpuwrap/0001-vpu_wrapper_hantro_encoder-fix-missing-include.patch @@ -0,0 +1,32 @@ +From a3c2f61649afd05e4bab457370f0b32d7644505c Mon Sep 17 00:00:00 2001 +From: Max Krummenacher +Date: Mon, 3 Mar 2025 08:24:51 +0000 +Subject: [PATCH] vpu_wrapper_hantro_encoder: fix missing include + +gettimeofday is declared in sys/time.h. Add the include. + +Fixes the build error: +| ../git/vpu_wrapper_hantro_encoder.c:953:3: error: implicit declaration of function 'gettimeofday' [-Wimplicit-function-declaration] +| 953 | gettimeofday (&pObj->tvEnd, NULL); + +Upstream-Status: Pending +Signed-off-by: Max Krummenacher +--- + vpu_wrapper_hantro_encoder.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/vpu_wrapper_hantro_encoder.c b/vpu_wrapper_hantro_encoder.c +index 3819c389320c..a0bdb2f4f6c0 100755 +--- a/vpu_wrapper_hantro_encoder.c ++++ b/vpu_wrapper_hantro_encoder.c +@@ -25,6 +25,7 @@ + #include + #include + #include ++#include + + #include "headers/OMX_Video.h" + #include "headers/OMX_VideoExt.h" +-- +2.42.0 + diff --git a/recipes-multimedia/imx-vpuwrap/imx-vpuwrap_git.bb b/recipes-multimedia/imx-vpuwrap/imx-vpuwrap_git.bb index 86533c3c0..de9b0daf2 100644 --- a/recipes-multimedia/imx-vpuwrap/imx-vpuwrap_git.bb +++ b/recipes-multimedia/imx-vpuwrap/imx-vpuwrap_git.bb @@ -12,6 +12,7 @@ DEPENDS:append:mx8mp-nxp-bsp = " imx-vpu-hantro-vc" SRC_URI = " \ git://github.com/NXP/imx-vpuwrap.git;protocol=https;branch=${SRCBRANCH} \ + file://0001-vpu_wrapper_hantro_encoder-fix-missing-include.patch \ " SRCBRANCH = "MM_04.09.02_2410_L6.6.y" SRCREV = "378e33989cf72d6c2eb57a585072ba9abe87c6ff" -- cgit v1.2.3-54-g00ecf From 9a175e74233071afde7b4106dc7a41be1a473f93 Mon Sep 17 00:00:00 2001 From: Jasper Orschulko Date: Mon, 3 Mar 2025 11:16:01 +0100 Subject: u-boot: Add CVE_PRODUCT definition Adding a correct CVE_PRODUCT definition helps to keep track of upstream CVEs Signed-off-by: Jasper Orschulko --- recipes-bsp/u-boot/u-boot-fslc-common_2025.01.inc | 1 + recipes-bsp/u-boot/u-boot-imx-common_2024.04.inc | 1 + 2 files changed, 2 insertions(+) diff --git a/recipes-bsp/u-boot/u-boot-fslc-common_2025.01.inc b/recipes-bsp/u-boot/u-boot-fslc-common_2025.01.inc index f6262324d..134028503 100644 --- a/recipes-bsp/u-boot/u-boot-fslc-common_2025.01.inc +++ b/recipes-bsp/u-boot/u-boot-fslc-common_2025.01.inc @@ -14,6 +14,7 @@ SRCREV = "aa4bc52d08c342df83e3c576e2c108d7c8816e0e" SRCBRANCH = "2025.01+fslc" PV = "2025.01+fslc+git${SRCPV}" +CVE_PRODUCT = "denx:u-boot" S = "${WORKDIR}/git" B = "${WORKDIR}/build" diff --git a/recipes-bsp/u-boot/u-boot-imx-common_2024.04.inc b/recipes-bsp/u-boot/u-boot-imx-common_2024.04.inc index f4e78c6c6..39ac4135a 100644 --- a/recipes-bsp/u-boot/u-boot-imx-common_2024.04.inc +++ b/recipes-bsp/u-boot/u-boot-imx-common_2024.04.inc @@ -7,6 +7,7 @@ SRC_URI = "git://github.com/nxp-imx/uboot-imx.git;protocol=https;branch=${SRCBRA SRCBRANCH = "lf_v2024.04" LOCALVERSION ?= "-imx_v2024.04_6.6.52-2.2.0" SRCREV = "6c4545203d123c246c5d7995f2893959506d28e0" +CVE_PRODUCT = "nxp:uboot_secondary_program_loader denx:u-boot" DEPENDS += " \ bc-native \ -- cgit v1.2.3-54-g00ecf From 1f707c600df08edc9ea1199ea489ff1236d2a964 Mon Sep 17 00:00:00 2001 From: Alexander Stein Date: Wed, 5 Mar 2025 08:25:47 +0100 Subject: optee-os: Remove upstreamed patches Both patches have been upstreamed since 3.19. Signed-off-by: Alexander Stein --- ...ils-libutee-ta-add-.note.GNU-stack-sectio.patch | 133 --------------------- .../0004-core-link-add-no-warn-rwx-segments.patch | 67 ----------- recipes-security/optee-imx/optee-os_4.2.0.imx.bb | 2 - 3 files changed, 202 deletions(-) delete mode 100644 recipes-security/optee-imx/optee-os/0003-arm32-libutils-libutee-ta-add-.note.GNU-stack-sectio.patch delete mode 100644 recipes-security/optee-imx/optee-os/0004-core-link-add-no-warn-rwx-segments.patch diff --git a/recipes-security/optee-imx/optee-os/0003-arm32-libutils-libutee-ta-add-.note.GNU-stack-sectio.patch b/recipes-security/optee-imx/optee-os/0003-arm32-libutils-libutee-ta-add-.note.GNU-stack-sectio.patch deleted file mode 100644 index 1c5753c7f..000000000 --- a/recipes-security/optee-imx/optee-os/0003-arm32-libutils-libutee-ta-add-.note.GNU-stack-sectio.patch +++ /dev/null @@ -1,133 +0,0 @@ -From 6f738803a59613ec4a683ddbc1747ebffd75a4e6 Mon Sep 17 00:00:00 2001 -From: Jerome Forissier -Date: Tue, 23 Aug 2022 12:31:46 +0000 -Subject: [PATCH 3/4] arm32: libutils, libutee, ta: add .note.GNU-stack section - to - - .S files - -When building for arm32 with GNU binutils 2.39, the linker outputs -warnings when linking Trusted Applications: - - arm-unknown-linux-uclibcgnueabihf-ld.bfd: warning: utee_syscalls_a32.o: missing .note.GNU-stack section implies executable stack - arm-unknown-linux-uclibcgnueabihf-ld.bfd: NOTE: This behaviour is deprecated and will be removed in a future version of the linker - -We could silence the warning by adding the '-z execstack' option to the -TA link flags, like we did in the parent commit for the TEE core and -ldelf. Indeed, ldelf always allocates a non-executable piece of memory -for the TA to use as a stack. - -However it seems preferable to comply with the common ELF practices in -this case. A better fix is therefore to add the missing .note.GNU-stack -sections in the assembler files. - -Signed-off-by: Jerome Forissier - -Signed-off-by: Anton Antonov -Upstream-Status: Backport [https://github.com/OP-TEE/optee_os/pull/5499] -Signed-off-by: Oleksandr Suvorov ---- - - lib/libutee/arch/arm/utee_syscalls_a32.S | 2 ++ - lib/libutils/ext/arch/arm/atomic_a32.S | 2 ++ - lib/libutils/ext/arch/arm/mcount_a32.S | 2 ++ - lib/libutils/isoc/arch/arm/arm32_aeabi_divmod_a32.S | 2 ++ - lib/libutils/isoc/arch/arm/arm32_aeabi_ldivmod_a32.S | 2 ++ - lib/libutils/isoc/arch/arm/setjmp_a32.S | 2 ++ - ta/arch/arm/ta_entry_a32.S | 2 ++ - 7 files changed, 14 insertions(+) - -diff --git a/lib/libutee/arch/arm/utee_syscalls_a32.S b/lib/libutee/arch/arm/utee_syscalls_a32.S -index 2dea83ab8..668b65a86 100644 ---- a/lib/libutee/arch/arm/utee_syscalls_a32.S -+++ b/lib/libutee/arch/arm/utee_syscalls_a32.S -@@ -9,6 +9,8 @@ - - .section .note.GNU-stack,"",%progbits - -+ .section .note.GNU-stack,"",%progbits -+ - .section .text - .balign 4 - .code 32 -diff --git a/lib/libutils/ext/arch/arm/atomic_a32.S b/lib/libutils/ext/arch/arm/atomic_a32.S -index 2be73ffad..87ddf1065 100644 ---- a/lib/libutils/ext/arch/arm/atomic_a32.S -+++ b/lib/libutils/ext/arch/arm/atomic_a32.S -@@ -7,6 +7,8 @@ - - .section .note.GNU-stack,"",%progbits - -+ .section .note.GNU-stack,"",%progbits -+ - /* uint32_t atomic_inc32(uint32_t *v); */ - FUNC atomic_inc32 , : - ldrex r1, [r0] -diff --git a/lib/libutils/ext/arch/arm/mcount_a32.S b/lib/libutils/ext/arch/arm/mcount_a32.S -index 54dc3c02d..2f24632b8 100644 ---- a/lib/libutils/ext/arch/arm/mcount_a32.S -+++ b/lib/libutils/ext/arch/arm/mcount_a32.S -@@ -9,6 +9,8 @@ - - .section .note.GNU-stack,"",%progbits - -+ .section .note.GNU-stack,"",%progbits -+ - /* - * Convert return address to call site address by subtracting the size of the - * mcount call instruction (blx __gnu_mcount_nc). -diff --git a/lib/libutils/isoc/arch/arm/arm32_aeabi_divmod_a32.S b/lib/libutils/isoc/arch/arm/arm32_aeabi_divmod_a32.S -index 37ae9ec6f..bc6c48b1a 100644 ---- a/lib/libutils/isoc/arch/arm/arm32_aeabi_divmod_a32.S -+++ b/lib/libutils/isoc/arch/arm/arm32_aeabi_divmod_a32.S -@@ -7,6 +7,8 @@ - - .section .note.GNU-stack,"",%progbits - -+ .section .note.GNU-stack,"",%progbits -+ - /* - * signed ret_idivmod_values(signed quot, signed rem); - * return quotient and remaining the EABI way (regs r0,r1) -diff --git a/lib/libutils/isoc/arch/arm/arm32_aeabi_ldivmod_a32.S b/lib/libutils/isoc/arch/arm/arm32_aeabi_ldivmod_a32.S -index 5c3353e2c..9fb5e0283 100644 ---- a/lib/libutils/isoc/arch/arm/arm32_aeabi_ldivmod_a32.S -+++ b/lib/libutils/isoc/arch/arm/arm32_aeabi_ldivmod_a32.S -@@ -7,6 +7,8 @@ - - .section .note.GNU-stack,"",%progbits - -+ .section .note.GNU-stack,"",%progbits -+ - /* - * __value_in_regs lldiv_t __aeabi_ldivmod( long long n, long long d) - */ -diff --git a/lib/libutils/isoc/arch/arm/setjmp_a32.S b/lib/libutils/isoc/arch/arm/setjmp_a32.S -index f8a0b70df..37d7cb88e 100644 ---- a/lib/libutils/isoc/arch/arm/setjmp_a32.S -+++ b/lib/libutils/isoc/arch/arm/setjmp_a32.S -@@ -53,6 +53,8 @@ - - .section .note.GNU-stack,"",%progbits - -+ .section .note.GNU-stack,"",%progbits -+ - /* Arm/Thumb interworking support: - - The interworking scheme expects functions to use a BX instruction -diff --git a/ta/arch/arm/ta_entry_a32.S b/ta/arch/arm/ta_entry_a32.S -index cd9a12f9d..ccdc19928 100644 ---- a/ta/arch/arm/ta_entry_a32.S -+++ b/ta/arch/arm/ta_entry_a32.S -@@ -7,6 +7,8 @@ - - .section .note.GNU-stack,"",%progbits - -+ .section .note.GNU-stack,"",%progbits -+ - /* - * This function is the bottom of the user call stack. Mark it as such so that - * the unwinding code won't try to go further down. --- -2.43.2 - diff --git a/recipes-security/optee-imx/optee-os/0004-core-link-add-no-warn-rwx-segments.patch b/recipes-security/optee-imx/optee-os/0004-core-link-add-no-warn-rwx-segments.patch deleted file mode 100644 index f32b2284f..000000000 --- a/recipes-security/optee-imx/optee-os/0004-core-link-add-no-warn-rwx-segments.patch +++ /dev/null @@ -1,67 +0,0 @@ -From a63f82f74e015eb662242cdb51ef814e3f576829 Mon Sep 17 00:00:00 2001 -From: Jerome Forissier -Date: Fri, 5 Aug 2022 09:48:03 +0200 -Subject: [PATCH 4/4] core: link: add --no-warn-rwx-segments - -Signed-off-by: Anton Antonov -Upstream-Status: Backport [https://github.com/OP-TEE/optee_os/pull/5474] - -binutils ld.bfd generates one RWX LOAD segment by merging several sections -with mixed R/W/X attributes (.text, .rodata, .data). After version 2.38 it -also warns by default when that happens [1], which breaks the build due to ---fatal-warnings. The RWX segment is not a problem for the TEE core, since -that information is not used to set memory permissions. Therefore, silence -the warning. - -Link: [1] https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=ba951afb99912da01a6e8434126b8fac7aa75107 -Link: https://sourceware.org/bugzilla/show_bug.cgi?id=29448 -Reported-by: Dominique Martinet -Signed-off-by: Jerome Forissier -Acked-by: Jens Wiklander -Signed-off-by: Oleksandr Suvorov ---- - - core/arch/arm/kernel/link.mk | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/core/arch/arm/kernel/link.mk b/core/arch/arm/kernel/link.mk -index 49e9f4fa1..9e1cc172f 100644 ---- a/core/arch/arm/kernel/link.mk -+++ b/core/arch/arm/kernel/link.mk -@@ -37,6 +37,7 @@ link-ldflags += --sort-section=alignment - link-ldflags += --fatal-warnings - link-ldflags += --gc-sections - link-ldflags += $(link-ldflags-common) -+link-ldflags += $(call ld-option,--no-warn-rwx-segments) - - link-ldadd = $(LDADD) - link-ldadd += $(ldflags-external) -@@ -61,6 +62,7 @@ link-script-cppflags := \ - $(cppflagscore)) - - ldargs-all_objs := -T $(link-script-dummy) --no-check-sections \ -+ $(call ld-option,--no-warn-rwx-segments) \ - $(link-ldflags-common) \ - $(link-objs) $(link-ldadd) $(libgcccore) - cleanfiles += $(link-out-dir)/all_objs.o -@@ -75,7 +77,7 @@ $(link-out-dir)/unpaged_entries.txt: $(link-out-dir)/all_objs.o - $(AWK) '/ ____keep_pager/ { printf "-u%s ", $$3 }' > $@ - - unpaged-ldargs := -T $(link-script-dummy) --no-check-sections --gc-sections \ -- $(link-ldflags-common) -+ $(link-ldflags-common) $(call ld-option,--no-warn-rwx-segments) - unpaged-ldadd := $(objs) $(link-ldadd) $(libgcccore) - cleanfiles += $(link-out-dir)/unpaged.o - $(link-out-dir)/unpaged.o: $(link-out-dir)/unpaged_entries.txt -@@ -104,7 +106,7 @@ $(link-out-dir)/init_entries.txt: $(link-out-dir)/all_objs.o - $(AWK) '/ ____keep_init/ { printf "-u%s ", $$3 }' > $@ - - init-ldargs := -T $(link-script-dummy) --no-check-sections --gc-sections \ -- $(link-ldflags-common) -+ $(link-ldflags-common) $(call ld-option,--no-warn-rwx-segments) - init-ldadd := $(link-objs-init) $(link-out-dir)/version.o $(link-ldadd) \ - $(libgcccore) - cleanfiles += $(link-out-dir)/init.o --- -2.43.2 - diff --git a/recipes-security/optee-imx/optee-os_4.2.0.imx.bb b/recipes-security/optee-imx/optee-os_4.2.0.imx.bb index ada545a63..11da204e9 100644 --- a/recipes-security/optee-imx/optee-os_4.2.0.imx.bb +++ b/recipes-security/optee-imx/optee-os_4.2.0.imx.bb @@ -5,8 +5,6 @@ require optee-os-fslc-imx.inc SRC_URI += " \ file://0001-core-Define-section-attributes-for-clang.patch \ file://0002-optee-enable-clang-support.patch \ - file://0003-arm32-libutils-libutee-ta-add-.note.GNU-stack-sectio.patch \ - file://0004-core-link-add-no-warn-rwx-segments.patch \ " SRCBRANCH = "lf-6.6.36_2.1.0" SRCREV = "612bc5a642a4608d282abeee2349d86de996d7ee" -- cgit v1.2.3-54-g00ecf From a4158653a5bd786367dca9f1bfd755b9c66127d4 Mon Sep 17 00:00:00 2001 From: Zelan Zou Date: Wed, 15 Jan 2025 07:12:16 +0100 Subject: mcore-demos: Upgrade to 6.6.52_2.2.0 imx95: 2.16.001 -> 24.12.00 Signed-off-by: Zelan Zou --- recipes-fsl/mcore-demos/README | 2 +- recipes-fsl/mcore-demos/imx-m4-demos_1.0.1.bb | 26 ++++++------------------ recipes-fsl/mcore-demos/imx-m7-demos_2.16.001.bb | 10 --------- recipes-fsl/mcore-demos/imx-m7-demos_24.12.00.bb | 10 +++++++++ recipes-fsl/mcore-demos/imx-mcore-demos.inc | 12 +++++------ 5 files changed, 23 insertions(+), 37 deletions(-) delete mode 100644 recipes-fsl/mcore-demos/imx-m7-demos_2.16.001.bb create mode 100644 recipes-fsl/mcore-demos/imx-m7-demos_24.12.00.bb diff --git a/recipes-fsl/mcore-demos/README b/recipes-fsl/mcore-demos/README index 0023bb26f..addd1c376 100644 --- a/recipes-fsl/mcore-demos/README +++ b/recipes-fsl/mcore-demos/README @@ -5,7 +5,7 @@ The M4 demo app version of each SoCs are followed: The M7 demo app version of each SoCs are followed: * 2.16.000 -- i.MX 8MP , 8MNULite, 8MN -* 2.16.001 -- i.MX95 +* 24.12.00 -- i.MX95 The M33 demo app version of each SoCs are followed: * 2.16.000 -- i.MX 8ULP, i.MX 93 diff --git a/recipes-fsl/mcore-demos/imx-m4-demos_1.0.1.bb b/recipes-fsl/mcore-demos/imx-m4-demos_1.0.1.bb index 78a837af2..6791553bf 100644 --- a/recipes-fsl/mcore-demos/imx-m4-demos_1.0.1.bb +++ b/recipes-fsl/mcore-demos/imx-m4-demos_1.0.1.bb @@ -1,27 +1,13 @@ -SUMMARY = "i.MX M4 core Demo images" -SECTION = "app" -LICENSE = "Proprietary" -LIC_FILES_CHKSUM:mx7d-nxp-bsp = "file://COPYING;md5=8cf95184c220e247b9917e7244124c5a" +# Copyright 2017-2021 NXP +# Released under the MIT license (see COPYING.MIT for the terms) -inherit deploy fsl-eula-unpack +require imx-mcore-demos.inc -M4_SOC ?= "INVALID" -M4_SOC:mx7d-nxp-bsp = "imx7d-sabresd" +LIC_FILES_CHKSUM:mx7d-nxp-bsp = "file://COPYING;md5=8cf95184c220e247b9917e7244124c5a" -SRC_URI = "${FSL_MIRROR}/${M4_SOC}-m4-freertos-${PV}.bin;fsl-eula=true" -S = "${WORKDIR}/${M4_SOC}-m4-freertos-${PV}" +SRC_URI = "${FSL_MIRROR}/${SOC}-m4-freertos-${PV}.bin;fsl-eula=true" +S = "${WORKDIR}/${SOC}-m4-freertos-${PV}" SRC_URI[sha256sum] = "cc00d3b936d49b2794a2a99e10129437e70caba3fd26b8379b8c50dd22f73254" -do_deploy () { - # Install the demo binaries - install -d ${DEPLOYDIR} - cp ${S}/*.bin ${DEPLOYDIR}/ - ls ${DEPLOYDIR}/ -} - -addtask deploy before do_build after do_compile - -PACKAGE_ARCH = "${MACHINE_SOCARCH}" COMPATIBLE_MACHINE = "(mx7d-nxp-bsp)" - diff --git a/recipes-fsl/mcore-demos/imx-m7-demos_2.16.001.bb b/recipes-fsl/mcore-demos/imx-m7-demos_2.16.001.bb deleted file mode 100644 index 56ddbf80f..000000000 --- a/recipes-fsl/mcore-demos/imx-m7-demos_2.16.001.bb +++ /dev/null @@ -1,10 +0,0 @@ -# Copyright 2023-2024 NXP -# Released under the MIT license (see COPYING.MIT for the terms) - -require imx-mcore-demos.inc - -LIC_FILES_CHKSUM:mx95-nxp-bsp = "file://COPYING;md5=ca53281cc0caa7e320d4945a896fb837" - -SRC_URI[imx95.sha256sum] = "0569f128e2068c509dcd4afe6689a62cdb5a4ac9f8eb1b522b2bfaac0e7d09fd" - -COMPATIBLE_MACHINE = "(mx95-nxp-bsp)" diff --git a/recipes-fsl/mcore-demos/imx-m7-demos_24.12.00.bb b/recipes-fsl/mcore-demos/imx-m7-demos_24.12.00.bb new file mode 100644 index 000000000..17d90903a --- /dev/null +++ b/recipes-fsl/mcore-demos/imx-m7-demos_24.12.00.bb @@ -0,0 +1,10 @@ +# Copyright 2023-2024 NXP +# Released under the MIT license (see COPYING.MIT for the terms) + +require imx-mcore-demos.inc + +LIC_FILES_CHKSUM:mx95-nxp-bsp = "file://COPYING;md5=ca53281cc0caa7e320d4945a896fb837" + +SRC_URI[imx95.sha256sum] = "01603b53fd01181631b71f5139a4a3e215f7e03cc531638ef4fa805a678ede3d" + +COMPATIBLE_MACHINE = "(mx95-nxp-bsp)" diff --git a/recipes-fsl/mcore-demos/imx-mcore-demos.inc b/recipes-fsl/mcore-demos/imx-mcore-demos.inc index 11621752f..8bf66617f 100644 --- a/recipes-fsl/mcore-demos/imx-mcore-demos.inc +++ b/recipes-fsl/mcore-demos/imx-mcore-demos.inc @@ -9,6 +9,7 @@ inherit deploy fsl-eula-unpack SOC ?= "INVALID" SOC:mx7ulp-nxp-bsp = "imx7ulp" +SOC:mx7d-nxp-bsp = "imx7d-sabresd" SOC:mx8dxl-nxp-bsp = "imx8dxl" SOC:mx8mm-nxp-bsp = "imx8mm" SOC:mx8mn-nxp-bsp = "imx8mn" @@ -32,26 +33,25 @@ MCORE_TYPE:mx8ulp-nxp-bsp = "m33" MCORE_TYPE:mx93-nxp-bsp = "m33" MCORE_TYPE:mx95-nxp-bsp = "m7" -SRC_URI = "${FSL_MIRROR}${SOC}-${MCORE_TYPE}-demo-${PV}.bin;name=${SOC};fsl-eula=true" +SRC_URI = "${FSL_MIRROR}/${SOC}-${MCORE_TYPE}-demo-${PV}.bin;name=${SOC};fsl-eula=true" S = "${WORKDIR}/${SOC}-${MCORE_TYPE}-demo-${PV}" -#SRC_URI="https://www.nxp.com/lgfiles/NMG/MAD/YOCTO//imx93-m33-demo-2.14.0.bin;fsl-eula=true;name=imx93" - - SCR = "SCR-${SOC}-${MCORE_TYPE}-demo.txt" do_install () { install -d ${D}${nonarch_base_libdir}/firmware install -m 0644 ${S}/*.elf ${D}${nonarch_base_libdir}/firmware + install -m 0644 ${S}/*.bin ${D}${nonarch_base_libdir}/firmware } DEPLOY_FILE_EXT ?= "bin" DEPLOY_FILE_EXT:mx7ulp-nxp-bsp = "img" do_deploy () { - # Install the demo binaries - install -m 0644 ${S}/*.${DEPLOY_FILE_EXT} ${DEPLOYDIR}/ + # Install the demo binaries + install -d ${DEPLOYDIR}/mcore-demos + install -m 0644 ${S}/*.${DEPLOY_FILE_EXT} ${DEPLOYDIR}/mcore-demos/ } addtask deploy after do_install -- cgit v1.2.3-54-g00ecf From 07d2c4cedaa939690bef06dba5a11879385e9e33 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 13 Mar 2025 15:43:15 +0000 Subject: Auto-update LICENSE file with current recipe licenses --- LICENSE | 1 - 1 file changed, 1 deletion(-) diff --git a/LICENSE b/LICENSE index 0c5b7af26..69e951083 100644 --- a/LICENSE +++ b/LICENSE @@ -85,7 +85,6 @@ This file lists all licenses used by recipes in the meta-freescale layer. ./recipes-extended/testfloat/testfloat_2a.bb: LICENSE = "TestFloat" ./recipes-extended/tsntool/tsntool_git.bb: LICENSE = "GPL-2.0-only" ./recipes-fsl/images/fsl-image-mfgtool-initramfs.bb: LICENSE = "MIT" -./recipes-fsl/mcore-demos/imx-m4-demos_1.0.1.bb: LICENSE = "Proprietary" ./recipes-fsl/mcore-demos/imx-mcore-demos.inc: LICENSE = "Proprietary" ./recipes-fsl/packagegroups/packagegroup-fsl-mfgtool.bb: LICENSE = "MIT" ./recipes-graphics/drm/libdrm_2.4.116.imx.bb: LICENSE = "MIT" -- cgit v1.2.3-54-g00ecf From 2d7b30c7548bb73e1d092e08a05249211c7901e3 Mon Sep 17 00:00:00 2001 From: Tom Hochstein Date: Thu, 13 Mar 2025 09:00:35 -0700 Subject: imx-mcore-demos: Fix 7ULP install The demo extension is overridable so the new install behavior needs to use the variable. Fixes #2056. Signed-off-by: Tom Hochstein --- recipes-fsl/mcore-demos/imx-mcore-demos.inc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/recipes-fsl/mcore-demos/imx-mcore-demos.inc b/recipes-fsl/mcore-demos/imx-mcore-demos.inc index 8bf66617f..5f2054355 100644 --- a/recipes-fsl/mcore-demos/imx-mcore-demos.inc +++ b/recipes-fsl/mcore-demos/imx-mcore-demos.inc @@ -39,19 +39,19 @@ S = "${WORKDIR}/${SOC}-${MCORE_TYPE}-demo-${PV}" SCR = "SCR-${SOC}-${MCORE_TYPE}-demo.txt" +MCORE_DEMO_FILE_EXTENSION ?= "bin" +MCORE_DEMO_FILE_EXTENSION:mx7ulp-nxp-bsp = "img" + do_install () { install -d ${D}${nonarch_base_libdir}/firmware install -m 0644 ${S}/*.elf ${D}${nonarch_base_libdir}/firmware - install -m 0644 ${S}/*.bin ${D}${nonarch_base_libdir}/firmware + install -m 0644 ${S}/*.${MCORE_DEMO_FILE_EXTENSION} ${D}${nonarch_base_libdir}/firmware } -DEPLOY_FILE_EXT ?= "bin" -DEPLOY_FILE_EXT:mx7ulp-nxp-bsp = "img" - do_deploy () { # Install the demo binaries install -d ${DEPLOYDIR}/mcore-demos - install -m 0644 ${S}/*.${DEPLOY_FILE_EXT} ${DEPLOYDIR}/mcore-demos/ + install -m 0644 ${S}/*.${MCORE_DEMO_FILE_EXTENSION} ${DEPLOYDIR}/mcore-demos/ } addtask deploy after do_install -- cgit v1.2.3-54-g00ecf From 1031bfd2d5bb93fad4c2a8a6dcd3a717f24c396d Mon Sep 17 00:00:00 2001 From: Tom Hochstein Date: Thu, 13 Mar 2025 10:23:16 -0700 Subject: imx-mcore-demos: Fix 7D For 7D there are no .elf files and there is a build break: ``` | install: cannot stat '.../imx7d-sabresd-m4-freertos-1.0.1/*.elf': No such file or directory ``` Fixes #2056. Signed-off-by: Tom Hochstein --- recipes-fsl/mcore-demos/imx-mcore-demos.inc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/recipes-fsl/mcore-demos/imx-mcore-demos.inc b/recipes-fsl/mcore-demos/imx-mcore-demos.inc index 5f2054355..b8e747105 100644 --- a/recipes-fsl/mcore-demos/imx-mcore-demos.inc +++ b/recipes-fsl/mcore-demos/imx-mcore-demos.inc @@ -44,7 +44,9 @@ MCORE_DEMO_FILE_EXTENSION:mx7ulp-nxp-bsp = "img" do_install () { install -d ${D}${nonarch_base_libdir}/firmware - install -m 0644 ${S}/*.elf ${D}${nonarch_base_libdir}/firmware + if ls ${S}/*.elf > /dev/null 2>&1; then + install -m 0644 ${S}/*.elf ${D}${nonarch_base_libdir}/firmware + fi install -m 0644 ${S}/*.${MCORE_DEMO_FILE_EXTENSION} ${D}${nonarch_base_libdir}/firmware } -- cgit v1.2.3-54-g00ecf From a677778a9f0b1ef8ac2af44bf694898d3f4e5a84 Mon Sep 17 00:00:00 2001 From: Tom Hochstein Date: Fri, 14 Mar 2025 05:30:08 -0700 Subject: imx8qm-mek,imx8qxp-mek: Fix SERIAL_CONSOLES On Walnascar, 8QM and 8QXP MEK fail to boot. One difference in the log compared with Styhead is the getty on ttyAMA0 instead of ttyLP0 and a failure: ``` [ TIME ] Timed out waiting for device /dev/ttyAMA0. ``` It seems SERIAL_CONSOLES for these two boards has been wrong all along but masked until recently: https://git.yoctoproject.org/poky/commit/meta/recipes-core/systemd?id=d1eaffbd6bde845c3fcd81660b694e1ea1f46ab2 Signed-off-by: Tom Hochstein --- conf/machine/imx8qm-mek.conf | 2 +- conf/machine/include/imx8x-mek.inc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/machine/imx8qm-mek.conf b/conf/machine/imx8qm-mek.conf index 47cfde198..648320d89 100644 --- a/conf/machine/imx8qm-mek.conf +++ b/conf/machine/imx8qm-mek.conf @@ -20,7 +20,7 @@ RRECOMMENDS:${KERNEL_PACKAGE_NAME}-base = "" LOADADDR = "" # We have to disable SERIAL_CONSOLE due to auto-serial-console -SERIAL_CONSOLES = "115200;ttyAMA0" +SERIAL_CONSOLES = "115200;ttyLP0" # we do not want to have getty running on tty1 as we run # auto-serial-console there diff --git a/conf/machine/include/imx8x-mek.inc b/conf/machine/include/imx8x-mek.inc index 9eaa77c53..adfcab47f 100644 --- a/conf/machine/include/imx8x-mek.inc +++ b/conf/machine/include/imx8x-mek.inc @@ -12,7 +12,7 @@ RRECOMMENDS:${KERNEL_PACKAGE_NAME}-base = "" LOADADDR = "" # We have to disable SERIAL_CONSOLE due to auto-serial-console -SERIAL_CONSOLES = "115200;ttyAMA0" +SERIAL_CONSOLES = "115200;ttyLP0" # we do not want to have getty running on tty1 as we run # auto-serial-console there -- cgit v1.2.3-54-g00ecf From a40d522ff1ea74a7b446775d18392e18de816eb6 Mon Sep 17 00:00:00 2001 From: Tom Hochstein Date: Tue, 18 Mar 2025 12:42:02 -0700 Subject: imx-uuc: Don't inherit autotools The do_configure task is failing: ``` ERROR: imx-uuc-0.5.1+git-r1 do_configure: no configure script found at ./configure ``` It appears to be due to this OE-Core change: autotools: require that a configure script exists There's no point inheriting autotools if you're not actually going to run a configure script, so make a missing configure script fatal. https://github.com/openembedded/openembedded-core/commit/6d327a39befae44a88a812bdf4acde800dcee57b imx-uuc doesn't need autotools, just a simple do_install implementation. Signed-off-by: Tom Hochstein --- recipes-bsp/imx-uuc/imx-uuc_git.bb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/recipes-bsp/imx-uuc/imx-uuc_git.bb b/recipes-bsp/imx-uuc/imx-uuc_git.bb index 49fc15581..e245f28ba 100644 --- a/recipes-bsp/imx-uuc/imx-uuc_git.bb +++ b/recipes-bsp/imx-uuc/imx-uuc_git.bb @@ -6,8 +6,6 @@ DEPENDS = "virtual/kernel dosfstools-native" LICENSE = "GPL-2.0-only" LIC_FILES_CHKSUM = "file://LICENSE;md5=b234ee4d69f5fce4486a80fdaf4a4263" -inherit autotools-brokensep - PR = "r1" PV = "0.5.1+git${SRCPV}" @@ -16,6 +14,10 @@ SRCREV = "9b4adc0cde346fbae743dc21fcf5115488307b83" S = "${WORKDIR}/git" +do_install() { + oe_runmake 'DESTDIR=${D}' install +} + FILES:${PN} += "/linuxrc /fat" COMPATIBLE_MACHINE = "(imx-generic-bsp)" -- cgit v1.2.3-54-g00ecf From 13b8d981e7e41acb5ba383e600680ace25ed6d88 Mon Sep 17 00:00:00 2001 From: Tom Hochstein Date: Fri, 21 Mar 2025 11:12:56 -0700 Subject: imx-mkimage: Upgrade to NXP BSP 6.6.52_2.2.0 71b8c18 Add flash_all_ap target for non-Linux ap image. b8f5454 For iMX95, change verdin M7 image name. d97f0eb For iMX95, change 15x15 M7 image name. 0576197 M7 image names changed again. Signed-off-by: Tom Hochstein --- recipes-bsp/imx-mkimage/imx-mkimage_git.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes-bsp/imx-mkimage/imx-mkimage_git.inc b/recipes-bsp/imx-mkimage/imx-mkimage_git.inc index 8617ca36e..abc60c9e0 100644 --- a/recipes-bsp/imx-mkimage/imx-mkimage_git.inc +++ b/recipes-bsp/imx-mkimage/imx-mkimage_git.inc @@ -5,8 +5,8 @@ DEPENDS = "zlib-native openssl-native" SRC_URI = "git://github.com/nxp-imx/imx-mkimage.git;protocol=https;branch=${SRCBRANCH} \ file://0001-iMX8M-soc.mak-use-native-mkimage-from-sysroot.patch \ " -SRCBRANCH = "lf-6.6.36_2.1.0" -SRCREV = "4622115cbc037f79039c4522faeced4aabea986b" +SRCBRANCH = "lf-6.6.52_2.2.0" +SRCREV = "71b8c18af93a5eb972d80fbec290006066cff24f" S = "${WORKDIR}/git" -- cgit v1.2.3-54-g00ecf From c611cefd8038dce0c7e1e4ecfb0ce5bebff2d809 Mon Sep 17 00:00:00 2001 From: Tom Hochstein Date: Wed, 26 Mar 2025 06:59:25 -0700 Subject: optee-imx: Upgrade 4.2.0.imx -> 4.4.0.imx Copy latest support from NXP BSP LF6.6.52_2.2.0. Note that clang is disabled in optee-os-fslc.inc, which is copied from meta-arm optee-os.inc. Fixes: Issue 2048 - Upgrade BSP to LF6.6.52_2.2.0 Signed-off-by: Tom Hochstein --- conf/machine/include/imx-base.inc | 12 +-- .../optee-imx/optee-client-fslc-imx.inc | 35 ++++++- recipes-security/optee-imx/optee-client-fslc.inc | 59 +++++------ .../optee-imx/optee-client/tee-supplicant.service | 11 --- .../optee-imx/optee-client/tee-supplicant.sh | 46 +++++++++ .../optee-imx/optee-client/tee-supplicant@.service | 10 ++ .../optee-imx/optee-client/tee-udev.rules | 7 ++ .../optee-imx/optee-client_4.2.0.imx.bb | 7 -- .../optee-imx/optee-client_4.4.0.imx.bb | 4 + recipes-security/optee-imx/optee-fslc.inc | 53 ++++++---- .../optee-imx/optee-os-common-fslc-imx.inc | 62 ++++++++++++ recipes-security/optee-imx/optee-os-fslc-imx.inc | 47 +++++---- recipes-security/optee-imx/optee-os-fslc.inc | 110 ++++++++++----------- .../optee-imx/optee-os-tadevkit-fslc-imx.inc | 27 +++++ .../optee-imx/optee-os-tadevkit_4.4.0.imx.bb | 4 + .../0007-allow-setting-sysroot-for-clang.patch | 30 ++++++ recipes-security/optee-imx/optee-os_4.2.0.imx.bb | 10 -- recipes-security/optee-imx/optee-os_4.4.0.imx.bb | 10 ++ recipes-security/optee-imx/optee-test-fslc-imx.inc | 18 ++++ recipes-security/optee-imx/optee-test-fslc.inc | 67 +++++++++---- recipes-security/optee-imx/optee-test/run-ptest | 52 ++++++++++ recipes-security/optee-imx/optee-test_4.2.0.imx.bb | 10 -- recipes-security/optee-imx/optee-test_4.4.0.imx.bb | 13 +++ 23 files changed, 509 insertions(+), 195 deletions(-) delete mode 100644 recipes-security/optee-imx/optee-client/tee-supplicant.service create mode 100644 recipes-security/optee-imx/optee-client/tee-supplicant.sh create mode 100644 recipes-security/optee-imx/optee-client/tee-supplicant@.service create mode 100644 recipes-security/optee-imx/optee-client/tee-udev.rules delete mode 100644 recipes-security/optee-imx/optee-client_4.2.0.imx.bb create mode 100644 recipes-security/optee-imx/optee-client_4.4.0.imx.bb create mode 100644 recipes-security/optee-imx/optee-os-common-fslc-imx.inc create mode 100644 recipes-security/optee-imx/optee-os-tadevkit-fslc-imx.inc create mode 100644 recipes-security/optee-imx/optee-os-tadevkit_4.4.0.imx.bb create mode 100644 recipes-security/optee-imx/optee-os/0007-allow-setting-sysroot-for-clang.patch delete mode 100644 recipes-security/optee-imx/optee-os_4.2.0.imx.bb create mode 100644 recipes-security/optee-imx/optee-os_4.4.0.imx.bb create mode 100644 recipes-security/optee-imx/optee-test-fslc-imx.inc create mode 100644 recipes-security/optee-imx/optee-test/run-ptest delete mode 100644 recipes-security/optee-imx/optee-test_4.2.0.imx.bb create mode 100644 recipes-security/optee-imx/optee-test_4.4.0.imx.bb diff --git a/conf/machine/include/imx-base.inc b/conf/machine/include/imx-base.inc index 8ccdeb648..932b1e696 100644 --- a/conf/machine/include/imx-base.inc +++ b/conf/machine/include/imx-base.inc @@ -606,12 +606,12 @@ PREFERRED_VERSION_vulkan-tools:imxvulkan ??= "1.3.275.0.imx" PREFERRED_VERSION_vulkan-validation-layers:imxvulkan ??= "1.3.275.0.imx" # Use i.MX optee Version -PREFERRED_VERSION_optee-os:mx8-nxp-bsp ??= "4.2.0.imx" -PREFERRED_VERSION_optee-os:mx9-nxp-bsp ??= "4.2.0.imx" -PREFERRED_VERSION_optee-client:mx8-nxp-bsp ??= "4.2.0.imx" -PREFERRED_VERSION_optee-client:mx9-nxp-bsp ??= "4.2.0.imx" -PREFERRED_VERSION_optee-test:mx8-nxp-bsp ??= "4.2.0.imx" -PREFERRED_VERSION_optee-test:mx9-nxp-bsp ??= "4.2.0.imx" +PREFERRED_VERSION_optee-os:mx8-nxp-bsp ??= "4.4.0.imx" +PREFERRED_VERSION_optee-os:mx9-nxp-bsp ??= "4.4.0.imx" +PREFERRED_VERSION_optee-client:mx8-nxp-bsp ??= "4.4.0.imx" +PREFERRED_VERSION_optee-client:mx9-nxp-bsp ??= "4.4.0.imx" +PREFERRED_VERSION_optee-test:mx8-nxp-bsp ??= "4.4.0.imx" +PREFERRED_VERSION_optee-test:mx9-nxp-bsp ??= "4.4.0.imx" # Use i.MX opencv Version PREFERRED_VERSION_opencv:mx8-nxp-bsp ??= "4.6.0.imx" diff --git a/recipes-security/optee-imx/optee-client-fslc-imx.inc b/recipes-security/optee-imx/optee-client-fslc-imx.inc index 60e9e1fa5..7aeff9fd5 100644 --- a/recipes-security/optee-imx/optee-client-fslc-imx.inc +++ b/recipes-security/optee-imx/optee-client-fslc-imx.inc @@ -1,7 +1,36 @@ -# Copyright 2017-2024 NXP +# Copied from meta-imx/meta-imx-bsp/recipes-security/optee/optee-client-imx.inc. +# See: https://github.com/nxp-imx/imx-manifest/blob/imx-linux-scarthgap/imx-6.6.52-2.2.0.xml#L37 require optee-client-fslc.inc -SRC_URI += "git://github.com/nxp-imx/imx-optee-client.git;protocol=https;branch=${SRCBRANCH}" +DEPENDS += "util-linux-libuuid" -COMPATIBLE_MACHINE = "(imx-nxp-bsp)" +FILESEXTRAPATHS:prepend := "${THISDIR}/optee-client:" +SRC_URI:remove = "git://github.com/OP-TEE/optee_client.git;branch=master;protocol=https" +SRC_URI:prepend = "${OPTEE_CLIENT_SRC};branch=${SRCBRANCH} " +OPTEE_CLIENT_SRC ?= "git://github.com/nxp-imx/imx-optee-client.git;protocol=https" + +inherit pkgconfig + +EXTRA_OECMAKE += "-DCFG_TEE_CLIENT_LOAD_PATH=${nonarch_base_libdir}" + +# Copy the udev rule from the libts recipe for starting tee-supplicant@.service +SRC_URI += "file://tee-udev.rules" +# Unix group name for dev/tee* ownership. +TEE_GROUP_NAME ?= "teeclnt" +do_install:append () { + if ${@oe.utils.conditional('VIRTUAL-RUNTIME_dev_manager', 'busybox-mdev', 'false', 'true', d)}; then + install -d ${D}${nonarch_base_libdir}/udev/rules.d/ + install -m 755 ${UNPACKDIR}/tee-udev.rules ${D}${nonarch_base_libdir}/udev/rules.d/ + sed -i -e "s/teeclnt/${TEE_GROUP_NAME}/" ${D}${nonarch_base_libdir}/udev/rules.d/tee-udev.rules + fi + + if [ "${libdir}" != "${nonarch_base_libdir}" ]; then + rm -rf ${D}${libdir}/systemd + fi +} +inherit ${@oe.utils.conditional('VIRTUAL-RUNTIME_dev_manager', 'busybox-mdev', '', 'useradd', d)} +USERADD_PACKAGES = "${PN}" +GROUPADD_PARAM:${PN} = "--system ${TEE_GROUP_NAME}" + +FILES:${PN} += "${libdir}/* ${includedir}/*" diff --git a/recipes-security/optee-imx/optee-client-fslc.inc b/recipes-security/optee-imx/optee-client-fslc.inc index f55f0ab24..455bdd780 100644 --- a/recipes-security/optee-imx/optee-client-fslc.inc +++ b/recipes-security/optee-imx/optee-client-fslc.inc @@ -1,42 +1,43 @@ -# Copyright 2017-2024 NXP +# Copied from meta-arm/recipes-security/optee/optee-client.inc. +# See: https://github.com/nxp-imx/imx-manifest/blob/imx-linux-scarthgap/imx-6.6.52-2.2.0.xml#L30 + +SUMMARY = "OP-TEE Client API" +DESCRIPTION = "Open Portable Trusted Execution Environment - Normal World Client side of the TEE" +HOMEPAGE = "https://www.op-tee.org/" -SUMMARY = "OPTEE Client libs" -HOMEPAGE = "http://www.optee.org/" LICENSE = "BSD-2-Clause" LIC_FILES_CHKSUM = "file://LICENSE;md5=69663ab153298557a59c67a60a743e5b" -SRC_URI = "file://tee-supplicant.service" - -S = "${WORKDIR}/git" -B = "${WORKDIR}/build" +inherit systemd update-rc.d cmake -inherit python3native systemd features_check pkgconfig - -DEPENDS = "util-linux-libuuid" +SRC_URI = " \ + git://github.com/OP-TEE/optee_client.git;branch=master;protocol=https \ + file://tee-supplicant@.service \ + file://tee-supplicant.sh \ +" -REQUIRED_MACHINE_FEATURES = "optee" +UPSTREAM_CHECK_GITTAGREGEX = "^(?P\d+(\.\d+)+)$" -SYSTEMD_SERVICE:${PN} = "tee-supplicant.service" +S = "${WORKDIR}/git" -EXTRA_OEMAKE = " \ - -C ${S} O=${B} \ +EXTRA_OECMAKE = " \ + -DBUILD_SHARED_LIBS=ON \ + -DCFG_TEE_FS_PARENT_PATH='${localstatedir}/lib/tee' \ " +EXTRA_OECMAKE:append:toolchain-clang = " -DCFG_WERROR=0" -do_install () { - oe_runmake -C ${S} install - - install -D -p -m0644 ${B}/export/usr/lib/libteec.so.2.0.0 ${D}${libdir}/libteec.so.2.0.0 - ln -sf libteec.so.2.0.0 ${D}${libdir}/libteec.so.2 - ln -sf libteec.so.2.0.0 ${D}${libdir}/libteec.so - - install -D -p -m0644 ${B}/export/usr/lib/libckteec.so.0.1.0 ${D}${libdir}/libckteec.so.0.1.0 - ln -sf libckteec.so.0.1.0 ${D}${libdir}/libckteec.so.0 - ln -sf libckteec.so.0.1.0 ${D}${libdir}/libckteec.so +do_install:append() { + install -D -p -m0644 ${UNPACKDIR}/tee-supplicant@.service ${D}${systemd_system_unitdir}/tee-supplicant@.service + install -D -p -m0755 ${UNPACKDIR}/tee-supplicant.sh ${D}${sysconfdir}/init.d/tee-supplicant - install -D -p -m0755 ${B}/export/usr/sbin/tee-supplicant ${D}${bindir}/tee-supplicant + sed -i -e s:@sysconfdir@:${sysconfdir}:g \ + -e s:@sbindir@:${sbindir}:g \ + ${D}${systemd_system_unitdir}/tee-supplicant@.service \ + ${D}${sysconfdir}/init.d/tee-supplicant +} - cp -a ${B}/export/usr/include ${D}${includedir} +SYSTEMD_SERVICE:${PN} = "tee-supplicant@.service" - sed -i -e s:/etc:${sysconfdir}:g -e s:/usr/bin:${bindir}:g ${UNPACKDIR}/tee-supplicant.service - install -D -p -m0644 ${UNPACKDIR}/tee-supplicant.service ${D}${systemd_system_unitdir}/tee-supplicant.service -} +INITSCRIPT_PACKAGES = "${PN}" +INITSCRIPT_NAME:${PN} = "tee-supplicant" +INITSCRIPT_PARAMS:${PN} = "start 10 1 2 3 4 5 . stop 90 0 6 ." diff --git a/recipes-security/optee-imx/optee-client/tee-supplicant.service b/recipes-security/optee-imx/optee-client/tee-supplicant.service deleted file mode 100644 index 0e2b4f6ba..000000000 --- a/recipes-security/optee-imx/optee-client/tee-supplicant.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=TEE Supplicant - -[Service] -User=root -EnvironmentFile=-/etc/default/tee-supplicant -ExecStart=/usr/bin/tee-supplicant $OPTARGS - -[Install] -WantedBy=basic.target - diff --git a/recipes-security/optee-imx/optee-client/tee-supplicant.sh b/recipes-security/optee-imx/optee-client/tee-supplicant.sh new file mode 100644 index 000000000..b4d219502 --- /dev/null +++ b/recipes-security/optee-imx/optee-client/tee-supplicant.sh @@ -0,0 +1,46 @@ +#!/bin/sh + +# Source function library +. /etc/init.d/functions + +NAME=tee-supplicant +PATH=/sbin:/bin:/usr/sbin:/usr/bin +DESC="OP-TEE Supplicant" + +DAEMON=@sbindir@/$NAME + +test -f $DAEMON || exit 0 + +test -f @sysconfdir@/default/$NAME && . @sysconfdir@/default/$NAME +test -f @sysconfdir@/default/rcS && . @sysconfdir@/default/rcS + +SSD_OPTIONS="--oknodo --quiet --exec $DAEMON -- -d $OPTARGS" + +set -e + +case $1 in + start) + echo -n "Starting $DESC: " + start-stop-daemon --start $SSD_OPTIONS + echo "${DAEMON##*/}." + ;; + stop) + echo -n "Stopping $DESC: " + start-stop-daemon --stop $SSD_OPTIONS + echo "${DAEMON##*/}." + ;; + restart|force-reload) + $0 stop + sleep 1 + $0 start + ;; + status) + status ${DAEMON} || exit $? + ;; + *) + echo "Usage: $0 {start|stop|restart|force-reload|status}" >&2 + exit 1 + ;; +esac + +exit 0 diff --git a/recipes-security/optee-imx/optee-client/tee-supplicant@.service b/recipes-security/optee-imx/optee-client/tee-supplicant@.service new file mode 100644 index 000000000..72c0b9aa5 --- /dev/null +++ b/recipes-security/optee-imx/optee-client/tee-supplicant@.service @@ -0,0 +1,10 @@ +[Unit] +Description=TEE Supplicant on %i + +[Service] +User=root +EnvironmentFile=-@sysconfdir@/default/tee-supplicant +ExecStart=@sbindir@/tee-supplicant $OPTARGS + +[Install] +WantedBy=basic.target diff --git a/recipes-security/optee-imx/optee-client/tee-udev.rules b/recipes-security/optee-imx/optee-client/tee-udev.rules new file mode 100644 index 000000000..43fafd8c9 --- /dev/null +++ b/recipes-security/optee-imx/optee-client/tee-udev.rules @@ -0,0 +1,7 @@ +# tee devices can only be accessed by the teeclnt group members +KERNEL=="tee[0-9]*", TAG+="systemd", MODE="0660", GROUP="teeclnt" + +# If a /dev/teepriv[0-9]* device is detected, start an instance of +# tee-supplicant.service with the device name as parameter +KERNEL=="teepriv[0-9]*", MODE="0660", OWNER="root", GROUP="tee", \ + TAG+="systemd", ENV{SYSTEMD_WANTS}+="tee-supplicant@%k.service" diff --git a/recipes-security/optee-imx/optee-client_4.2.0.imx.bb b/recipes-security/optee-imx/optee-client_4.2.0.imx.bb deleted file mode 100644 index 59f8c84d7..000000000 --- a/recipes-security/optee-imx/optee-client_4.2.0.imx.bb +++ /dev/null @@ -1,7 +0,0 @@ -require optee-client-fslc-imx.inc - -SRCBRANCH = "lf-6.6.36_2.1.0" -SRCREV = "3eac340a781c00ccd61b151b0e9c22a8c6e9f9f0" - -DEPENDS += "util-linux" -EXTRA_OEMAKE += "PKG_CONFIG=pkg-config" diff --git a/recipes-security/optee-imx/optee-client_4.4.0.imx.bb b/recipes-security/optee-imx/optee-client_4.4.0.imx.bb new file mode 100644 index 000000000..322f998fc --- /dev/null +++ b/recipes-security/optee-imx/optee-client_4.4.0.imx.bb @@ -0,0 +1,4 @@ +require optee-client-fslc-imx.inc + +SRCBRANCH = "lf-6.6.52_2.2.0" +SRCREV = "d221676a58b305bddbf97db00395205b3038de8e" diff --git a/recipes-security/optee-imx/optee-fslc.inc b/recipes-security/optee-imx/optee-fslc.inc index 6c96dc2bc..42e23fc22 100644 --- a/recipes-security/optee-imx/optee-fslc.inc +++ b/recipes-security/optee-imx/optee-fslc.inc @@ -1,26 +1,43 @@ -HOMEPAGE = "http://www.optee.org/" +# Copied from meta-arm/recipes-security/optee/optee.inc. +# See: https://github.com/nxp-imx/imx-manifest/blob/imx-linux-scarthgap/imx-6.6.52-2.2.0.xml#L30 -inherit python3native features_check +UPSTREAM_CHECK_GITTAGREGEX = "^(?P\d+(\.\d+)+)$" -REQUIRED_MACHINE_FEATURES = "optee" +COMPATIBLE_MACHINE ?= "invalid" +COMPATIBLE_MACHINE:qemuarm64 ?= "qemuarm64" +COMPATIBLE_MACHINE:qemuarm ?= "qemuarm" +# Please add supported machines below or set it in .bbappend or .conf -DEPENDS = "python3-cryptography-native" +OPTEEMACHINE ?= "${MACHINE}" +OPTEEMACHINE:aarch64:qemuall ?= "vexpress-qemu_armv8a" +OPTEEMACHINE:arm:qemuall ?= "vexpress-qemu_virt" -S = "${WORKDIR}/git" -B = "${WORKDIR}/build" - -OPTEE_ARCH:arm = "arm32" +OPTEE_ARCH = "null" +OPTEE_ARCH:arm = "arm32" OPTEE_ARCH:aarch64 = "arm64" +OPTEE_CORE = "${@d.getVar('OPTEE_ARCH').upper()}" + +# FIXME - breaks with Clang 18. See https://github.com/OP-TEE/optee_os/issues/6754 +TOOLCHAIN = "gcc" + +OPTEE_TOOLCHAIN = "${@d.getVar('TOOLCHAIN') or 'gcc'}" +OPTEE_COMPILER = "${@bb.utils.contains("BBFILE_COLLECTIONS", "clang-layer", "${OPTEE_TOOLCHAIN}", "gcc", d)}" -COMPILER ?= "gcc" -COMPILER:toolchain-clang = "clang" +# Set here but not passed to EXTRA_OEMAKE by default as that breaks +# the optee-os build +TA_DEV_KIT_DIR = "${STAGING_INCDIR}/optee/export-user_ta" + +EXTRA_OEMAKE += "V=1 \ + LIBGCC_LOCATE_CFLAGS='${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}' \ + COMPILER=${OPTEE_COMPILER} \ + OPTEE_CLIENT_EXPORT=${STAGING_DIR_HOST}${prefix} \ + TEEC_EXPORT=${STAGING_DIR_HOST}${prefix} \ + " +# python3-cryptography needs the legacy provider, so set OPENSSL_MODULES to the +# right path until this is relocated automatically. +export OPENSSL_MODULES="${STAGING_LIBDIR_NATIVE}/ossl-modules" CFLAGS += "--sysroot=${STAGING_DIR_HOST}" -CXXFLAGS += "--sysroot=${STAGING_DIR_HOST}" - -EXTRA_OEMAKE = " \ - COMPILER=${COMPILER} \ - OPENSSL_MODULES=${STAGING_LIBDIR_NATIVE}/ossl-modules \ - OPTEE_CLIENT_EXPORT=${STAGING_DIR_HOST}${exec_prefix} \ - -C ${S} O=${B} \ -" + +# See the rationale in https://github.com/f-secure-foundry/advisories/blob/master/Security_Advisory-Ref_FSC-HWSEC-VR2021-0001-OP-TEE_TrustZone_bypass.txt. +CVE_STATUS[CVE-2021-36133] = "disputed: devices shipped open for development purposes" diff --git a/recipes-security/optee-imx/optee-os-common-fslc-imx.inc b/recipes-security/optee-imx/optee-os-common-fslc-imx.inc new file mode 100644 index 000000000..941182fe9 --- /dev/null +++ b/recipes-security/optee-imx/optee-os-common-fslc-imx.inc @@ -0,0 +1,62 @@ +# Copied from meta-imx/meta-imx-bsp/recipes-security/optee/optee-os-common-imx.inc. +# See: https://github.com/nxp-imx/imx-manifest/blob/imx-linux-scarthgap/imx-6.6.52-2.2.0.xml#L37 + +require optee-os-fslc.inc + +DEPENDS:append:arm = "u-boot-mkimage-native" + +FILESEXTRAPATHS:prepend := "${THISDIR}/optee-os:" + +SRC_URI:remove = "git://github.com/OP-TEE/optee_os.git;branch=master;protocol=https" +SRC_URI:prepend = "${OPTEE_OS_SRC};branch=${SRCBRANCH} " +SRC_URI:append = " file://0007-allow-setting-sysroot-for-clang.patch" +SRC_URI:remove = "file://0001-allow-setting-sysroot-for-libgcc-lookup.patch \ + file://0002-optee-enable-clang-support.patch \ + file://0003-core-link-add-no-warn-rwx-segments.patch" + +OPTEE_OS_SRC ?= "git://github.com/nxp-imx/imx-optee-os.git;protocol=https" + +inherit features_check + +REQUIRED_MACHINE_FEATURES = "optee" + +OPTEEMACHINE = "imx-${@d.getVar('MACHINE')[1:]}" +OPTEEMACHINE:imx6qpdlsolox = "imx-mx6qsabresd" +OPTEEMACHINE:mx6ul-nxp-bsp = "imx-mx6ulevk" +OPTEEMACHINE:mx6ull-nxp-bsp = "imx-mx6ullevk" +OPTEEMACHINE:mx6ulz-nxp-bsp = "imx-mx6ulzevk" +OPTEEMACHINE:mx8mq-nxp-bsp = "imx-mx8mqevk" +OPTEEMACHINE:mx8mm-nxp-bsp = "imx-mx8mmevk" +OPTEEMACHINE:mx8mn-nxp-bsp = "imx-mx8mnevk" +OPTEEMACHINE:mx8mp-nxp-bsp = "imx-mx8mpevk" +OPTEEMACHINE:mx8mpul-nxp-bsp = "imx-mx8mpevk" +OPTEEMACHINE:mx8qm-nxp-bsp = "imx-mx8qmmek" +OPTEEMACHINE:mx8qxp-nxp-bsp = "imx-mx8qxpmek" +OPTEEMACHINE:mx8dx-nxp-bsp = "imx-mx8dxmek" +OPTEEMACHINE:mx8dxl-nxp-bsp = "imx-mx8dxlevk" +OPTEEMACHINE:mx8mnul-nxp-bsp = "imx-mx8mnevk" +OPTEEMACHINE:mx8ulp-nxp-bsp = "imx-mx8ulpevk" +OPTEEMACHINE:mx91-nxp-bsp = "imx-mx91evk" +OPTEEMACHINE:mx93-nxp-bsp = "imx-mx93evk" +OPTEEMACHINE:mx95-nxp-bsp = "imx-mx95evk" + +# Strip the leading imx- +PLATFORM_FLAVOR = "${@d.getVar('OPTEEMACHINE')[4:]}" + +EXTRA_OEMAKE:append = " \ + CFG_TEE_TA_LOG_LEVEL=0 \ + CFG_TEE_CORE_LOG_LEVEL=0 \ +" + +EXTRA_OEMAKE:append:imx8mq-lpddr4-wevk = " \ + CFG_CORE_LARGE_PHYS_ADDR=y \ + CFG_CORE_ARM64_PA_BITS=36 \ + CFG_DDR_SIZE=0x100000000 \ + CFG_TZDRAM_START=0xfe000000 \ +" + +EXTRA_OEMAKE:append:imx8dxlb0-fips-lpddr4-evk = " \ + CFG_NXP_CAAM=n \ +" + +COMPATIBLE_MACHINE = "(imx-nxp-bsp)" diff --git a/recipes-security/optee-imx/optee-os-fslc-imx.inc b/recipes-security/optee-imx/optee-os-fslc-imx.inc index f4a532b7b..5fe6a75a5 100644 --- a/recipes-security/optee-imx/optee-os-fslc-imx.inc +++ b/recipes-security/optee-imx/optee-os-fslc-imx.inc @@ -1,27 +1,26 @@ -require optee-os-fslc.inc +# Copied from meta-imx/meta-imx-bsp/recipes-security/optee/optee-os-imx.inc. +# See: https://github.com/nxp-imx/imx-manifest/blob/imx-linux-scarthgap/imx-6.6.52-2.2.0.xml#L37 -SRC_URI = "git://github.com/nxp-imx/imx-optee-os.git;protocol=https;branch=${SRCBRANCH}" +require optee-os-common-fslc-imx.inc -# The platform flavor corresponds to the Yocto machine without the leading 'i'. -PLATFORM_FLAVOR = "${@d.getVar('MACHINE')[1:]}" -PLATFORM_FLAVOR:imx6qdlsabresd = "mx6qsabresd" -PLATFORM_FLAVOR:imx6qdlsabreauto = "mx6qsabreauto" -PLATFORM_FLAVOR:imx6qpdlsolox = "mx6qsabresd" -PLATFORM_FLAVOR:mx6ul-nxp-bsp = "mx6ulevk" -PLATFORM_FLAVOR:mx6ull-nxp-bsp = "mx6ullevk" -PLATFORM_FLAVOR:mx6ulz-nxp-bsp = "mx6ulzevk" -PLATFORM_FLAVOR:mx8mq-nxp-bsp = "mx8mqevk" -PLATFORM_FLAVOR:mx8mm-nxp-bsp = "mx8mmevk" -PLATFORM_FLAVOR:mx8mn-nxp-bsp = "mx8mnevk" -PLATFORM_FLAVOR:mx8mnul-nxp-bsp = "mx8mnevk" -PLATFORM_FLAVOR:mx8mp-nxp-bsp = "mx8mpevk" -PLATFORM_FLAVOR:mx8mpul-nxp-bsp = "mx8mpevk" -PLATFORM_FLAVOR:mx8qm-nxp-bsp = "mx8qmmek" -PLATFORM_FLAVOR:mx8qxp-nxp-bsp = "mx8qxpmek" -PLATFORM_FLAVOR:mx8dx-nxp-bsp = "mx8dxmek" -PLATFORM_FLAVOR:mx8dxl-nxp-bsp = "mx8dxlevk" -PLATFORM_FLAVOR:mx8ulp-nxp-bsp = "mx8ulpevk" -PLATFORM_FLAVOR:mx93-nxp-bsp = "mx93evk" -PLATFORM_FLAVOR:mx95-nxp-bsp = "mx95evk" +do_compile:arm() { + oe_runmake -C ${S} all uTee +} -COMPATIBLE_MACHINE = "(imx-nxp-bsp)" +do_install:append () { + # Install embedded TAs + install -d ${D}${nonarch_base_libdir}/optee_armtz/ + install -m 444 ${B}/ta/*/*.ta ${D}${nonarch_base_libdir}/optee_armtz/ +} + +do_deploy:append() { + cp ${B}/core/tee-raw.bin ${DEPLOYDIR}/${MLPREFIX}optee/tee.${PLATFORM_FLAVOR}.bin + ln -sf ${MLPREFIX}optee/tee.${PLATFORM_FLAVOR}.bin ${DEPLOYDIR}/tee.bin +} + +do_deploy:append:arm() { + cp ${B}/core/uTee ${DEPLOYDIR}/${MLPREFIX}optee/uTee-${OPTEE_BIN_EXT} + ln -sf ${MLPREFIX}optee/uTee-${OPTEE_BIN_EXT} ${DEPLOYDIR}/uTee-${OPTEE_BIN_EXT} +} + +FILES:${PN} += "${nonarch_base_libdir}/optee_armtz" diff --git a/recipes-security/optee-imx/optee-os-fslc.inc b/recipes-security/optee-imx/optee-os-fslc.inc index 61906344f..c1f1f48f5 100644 --- a/recipes-security/optee-imx/optee-os-fslc.inc +++ b/recipes-security/optee-imx/optee-os-fslc.inc @@ -1,90 +1,86 @@ -# Copyright (C) 2017-2021,2024 NXP +# Copied from meta-arm/recipes-security/optee/optee-os.inc. +# See: https://github.com/nxp-imx/imx-manifest/blob/imx-linux-scarthgap/imx-6.6.52-2.2.0.xml#L30 + +SUMMARY = "OP-TEE Trusted OS" +DESCRIPTION = "Open Portable Trusted Execution Environment - Trusted side of the TEE" +HOMEPAGE = "https://www.op-tee.org/" -SUMMARY = "OPTEE OS" -DESCRIPTION = "OPTEE OS" LICENSE = "BSD-2-Clause" LIC_FILES_CHKSUM = "file://LICENSE;md5=c1f21c4f72f372ef38a5a4aee55ec173" +inherit deploy python3native require optee-fslc.inc -DEPENDS += "python3-pyelftools-native u-boot-mkimage-native" +CVE_PRODUCT = "linaro:op-tee op-tee:op-tee_os" + +DEPENDS = "python3-pyelftools-native python3-cryptography-native" + DEPENDS:append:toolchain-clang = " compiler-rt" -inherit deploy autotools +SRC_URI = "git://github.com/OP-TEE/optee_os.git;branch=master;protocol=https" -# Optee-os can be built for 32 bits and 64 bits at the same time -# as long as the compilers are correctly defined. -# For 64bits, CROSS_COMPILE64 must be set -# When defining CROSS_COMPILE and CROSS_COMPILE64, we assure that -# any 32 or 64 bits builds will pass -EXTRA_OEMAKE += " \ - PLATFORM=imx-${PLATFORM_FLAVOR} \ - CROSS_COMPILE=${HOST_PREFIX} \ - CROSS_COMPILE64=${HOST_PREFIX} \ - CFLAGS32=--sysroot=${STAGING_DIR_HOST} \ - CFLAGS64=--sysroot=${STAGING_DIR_HOST} \ - CFG_TEE_TA_LOG_LEVEL=0 \ - CFG_TEE_CORE_LOG_LEVEL=0 \ -" +S = "${WORKDIR}/git" +B = "${WORKDIR}/build" -EXTRA_OEMAKE:append:imx8mq-lpddr4-wevk = " \ - CFG_CORE_LARGE_PHYS_ADDR=y \ - CFG_CORE_ARM64_PA_BITS=36 \ - CFG_DDR_SIZE=0x100000000 \ - CFG_TZDRAM_START=0xfe000000 \ +EXTRA_OEMAKE += " \ + PLATFORM=${OPTEEMACHINE} \ + CFG_${OPTEE_CORE}_core=y \ + CROSS_COMPILE_core=${HOST_PREFIX} \ + CROSS_COMPILE_ta_${OPTEE_ARCH}=${HOST_PREFIX} \ + NOWERROR=1 \ + ta-targets=ta_${OPTEE_ARCH} \ + O=${B} \ " +EXTRA_OEMAKE += " HOST_PREFIX=${HOST_PREFIX}" +EXTRA_OEMAKE += " CROSS_COMPILE64=${HOST_PREFIX}" LDFLAGS[unexport] = "1" CPPFLAGS[unexport] = "1" AS[unexport] = "1" LD[unexport] = "1" -do_configure[noexec] = "1" - do_compile:prepend() { - PLAT_LIBGCC_PATH=$(${CC} -print-libgcc-file-name) -} - -do_compile:arm () { - oe_runmake all uTee + PLAT_LIBGCC_PATH=$(${CC} -print-libgcc-file-name) } -do_compile:aarch64 () { - oe_runmake all +do_compile() { + oe_runmake -C ${S} all } do_compile[cleandirs] = "${B}" -do_deploy () { - install -d ${DEPLOYDIR} - cp ${B}/core/tee-raw.bin ${DEPLOYDIR}/tee.${PLATFORM_FLAVOR}.bin - ln -sf tee.${PLATFORM_FLAVOR}.bin ${DEPLOYDIR}/tee.bin -} +do_install() { + #install core in firmware + install -d ${D}${nonarch_base_libdir}/firmware/ + install -m 644 ${B}/core/*.bin ${B}/core/tee.elf ${D}${nonarch_base_libdir}/firmware/ -do_deploy:append:arm () { - cp ${B}/core/uTee ${DEPLOYDIR}/uTee-${OPTEE_BIN_EXT} + #install tas in optee_armtz + install -d ${D}${nonarch_base_libdir}/optee_armtz/ + install -m 444 ${B}/ta/*/*.ta ${D}${nonarch_base_libdir}/optee_armtz } -do_install () { - install -d ${D}${nonarch_base_libdir}/firmware/ - install -m 644 ${B}/core/*.bin ${D}${nonarch_base_libdir}/firmware/ +PACKAGE_ARCH = "${MACHINE_ARCH}" - # Install embedded TAs - install -d ${D}${nonarch_base_libdir}/optee_armtz/ - install -m 444 ${B}/ta/*/*.ta ${D}${nonarch_base_libdir}/optee_armtz/ +do_deploy() { + install -d ${DEPLOYDIR}/${MLPREFIX}optee + install -m 644 ${D}${nonarch_base_libdir}/firmware/* ${DEPLOYDIR}/${MLPREFIX}optee - # Install the TA devkit - install -d ${D}${includedir}/optee/export-user_ta_${OPTEE_ARCH}/ - cp -aR ${B}/export-ta_${OPTEE_ARCH}/* \ - ${D}${includedir}/optee/export-user_ta_${OPTEE_ARCH}/ + install -d ${DEPLOYDIR}/${MLPREFIX}optee/ta + install -m 644 ${B}/ta/*/*.elf ${DEPLOYDIR}/${MLPREFIX}optee/ta } -addtask deploy after do_compile before do_install +addtask deploy before do_build after do_install -FILES:${PN} = "${nonarch_base_libdir}/firmware/ ${nonarch_base_libdir}/optee_armtz/" -FILES:${PN}-staticdev = "${includedir}/optee/" -RDEPENDS:${PN}-dev += "${PN}-staticdev" +SYSROOT_DIRS += "${nonarch_base_libdir}/firmware" -# FIXME: Build paths are currently embedded -INSANE_SKIP:${PN}-staticdev += "buildpaths" +PACKAGES += "${PN}-ta" +FILES:${PN} = "${nonarch_base_libdir}/firmware/" +FILES:${PN}-ta = "${nonarch_base_libdir}/optee_armtz/*" + + +# note: "textrel" is not triggered on all archs +INSANE_SKIP:${PN} = "textrel" +# Build paths are currently embedded +INSANE_SKIP:${PN} += "buildpaths" +INSANE_SKIP:${PN}-dev = "staticdev" +INHIBIT_PACKAGE_STRIP = "1" -PACKAGE_ARCH = "${MACHINE_ARCH}" diff --git a/recipes-security/optee-imx/optee-os-tadevkit-fslc-imx.inc b/recipes-security/optee-imx/optee-os-tadevkit-fslc-imx.inc new file mode 100644 index 000000000..18cf9a374 --- /dev/null +++ b/recipes-security/optee-imx/optee-os-tadevkit-fslc-imx.inc @@ -0,0 +1,27 @@ +# Copied from meta-imx/meta-imx-bsp/recipes-security/optee/optee-os-tadevkit-imx.inc. +# See: https://github.com/nxp-imx/imx-manifest/blob/imx-linux-scarthgap/imx-6.6.52-2.2.0.xml#L37 + +require optee-os-common-fslc-imx.inc + +SUMMARY = "OP-TEE Trusted OS TA devkit" +DESCRIPTION = "OP-TEE TA devkit for build TAs" +HOMEPAGE = "https://www.op-tee.org/" + +DEPENDS += "python3-pycryptodome-native" + +do_install() { + #install TA devkit + install -d ${D}${includedir}/optee/export-user_ta/ + for f in ${B}/export-ta_${OPTEE_ARCH}/* ; do + cp -aR $f ${D}${includedir}/optee/export-user_ta/ + done +} + +do_deploy() { + echo "Do not inherit do_deploy from optee-os." +} + +FILES:${PN} = "${includedir}/optee/" + +# Build paths are currently embedded +INSANE_SKIP:${PN}-dev += "buildpaths" diff --git a/recipes-security/optee-imx/optee-os-tadevkit_4.4.0.imx.bb b/recipes-security/optee-imx/optee-os-tadevkit_4.4.0.imx.bb new file mode 100644 index 000000000..bb2e2cf6b --- /dev/null +++ b/recipes-security/optee-imx/optee-os-tadevkit_4.4.0.imx.bb @@ -0,0 +1,4 @@ +require optee-os-tadevkit-fslc-imx.inc + +SRCBRANCH = "lf-6.6.52_2.2.0" +SRCREV = "60beb308810f9561a67fdb435388a64c85eb6dcb" diff --git a/recipes-security/optee-imx/optee-os/0007-allow-setting-sysroot-for-clang.patch b/recipes-security/optee-imx/optee-os/0007-allow-setting-sysroot-for-clang.patch new file mode 100644 index 000000000..067ba6ebf --- /dev/null +++ b/recipes-security/optee-imx/optee-os/0007-allow-setting-sysroot-for-clang.patch @@ -0,0 +1,30 @@ +From db9e44af75c7cfd3316cab15aaa387383df3e57e Mon Sep 17 00:00:00 2001 +From: Brett Warren +Date: Wed, 23 Sep 2020 09:27:34 +0100 +Subject: [PATCH] optee: enable clang support + +When compiling with clang, the LIBGCC_LOCATE_CFLAG variable used +to provide a sysroot wasn't included, which results in not locating +compiler-rt. This is mitigated by including the variable as ammended. + +Upstream-Status: Pending +ChangeId: 8ba69a4b2eb8ebaa047cb266c9aa6c2c3da45701 +Signed-off-by: Brett Warren + +--- + mk/clang.mk | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/mk/clang.mk b/mk/clang.mk +index c141a3f2..7d067cc0 100644 +--- a/mk/clang.mk ++++ b/mk/clang.mk +@@ -27,7 +27,7 @@ comp-cflags-warns-clang := -Wno-language-extension-token \ + + # Note, use the compiler runtime library (libclang_rt.builtins.*.a) instead of + # libgcc for clang +-libgcc$(sm) := $(shell $(CC$(sm)) $(CFLAGS$(arch-bits-$(sm))) \ ++libgcc$(sm) := $(shell $(CC$(sm)) $(LIBGCC_LOCATE_CFLAGS) $(CFLAGS$(arch-bits-$(sm))) \ + -rtlib=compiler-rt -print-libgcc-file-name 2> /dev/null) + + # Core ASLR relies on the executable being ready to run from its preferred load diff --git a/recipes-security/optee-imx/optee-os_4.2.0.imx.bb b/recipes-security/optee-imx/optee-os_4.2.0.imx.bb deleted file mode 100644 index 11da204e9..000000000 --- a/recipes-security/optee-imx/optee-os_4.2.0.imx.bb +++ /dev/null @@ -1,10 +0,0 @@ -# Copyright 2017-2024 NXP - -require optee-os-fslc-imx.inc - -SRC_URI += " \ - file://0001-core-Define-section-attributes-for-clang.patch \ - file://0002-optee-enable-clang-support.patch \ -" -SRCBRANCH = "lf-6.6.36_2.1.0" -SRCREV = "612bc5a642a4608d282abeee2349d86de996d7ee" diff --git a/recipes-security/optee-imx/optee-os_4.4.0.imx.bb b/recipes-security/optee-imx/optee-os_4.4.0.imx.bb new file mode 100644 index 000000000..5ff12a599 --- /dev/null +++ b/recipes-security/optee-imx/optee-os_4.4.0.imx.bb @@ -0,0 +1,10 @@ +# Copyright 2017-2024 NXP + +require optee-os-fslc-imx.inc + +SRC_URI += " \ + file://0001-core-Define-section-attributes-for-clang.patch \ + file://0002-optee-enable-clang-support.patch \ +" +SRCBRANCH = "lf-6.6.52_2.2.0" +SRCREV = "60beb308810f9561a67fdb435388a64c85eb6dcb" diff --git a/recipes-security/optee-imx/optee-test-fslc-imx.inc b/recipes-security/optee-imx/optee-test-fslc-imx.inc new file mode 100644 index 000000000..ab16fd221 --- /dev/null +++ b/recipes-security/optee-imx/optee-test-fslc-imx.inc @@ -0,0 +1,18 @@ +# Copied from meta-imx/meta-imx-bsp/recipes-security/optee/optee-test-imx.inc. +# See: https://github.com/nxp-imx/imx-manifest/blob/imx-linux-scarthgap/imx-6.6.52-2.2.0.xml#L37 + +require optee-test-fslc.inc + +DEPENDS += "openssl" + +FILESEXTRAPATHS:prepend := "${THISDIR}/optee-test:" + +SRC_URI:remove = "git://github.com/OP-TEE/optee_test.git;branch=master;protocol=https" +SRC_URI:prepend = "${OPTEE_TEST_SRC};branch=${SRCBRANCH} " + +OPTEE_TEST_SRC ?= "git://github.com/nxp-imx/imx-optee-test.git;protocol=https" + +EXTRA_OEMAKE:append:libc-musl = " OPTEE_OPENSSL_EXPORT=${STAGING_INCDIR}" +CFLAGS:append:libc-musl = " -Wno-error=deprecated-declarations" + +COMPATIBLE_MACHINE = "(imx-nxp-bsp)" diff --git a/recipes-security/optee-imx/optee-test-fslc.inc b/recipes-security/optee-imx/optee-test-fslc.inc index e0c133a7c..0fb5f878a 100644 --- a/recipes-security/optee-imx/optee-test-fslc.inc +++ b/recipes-security/optee-imx/optee-test-fslc.inc @@ -1,38 +1,65 @@ -# Copyright (C) 2017-2021 NXP +# Copied from meta-arm/recipes-security/optee/optee-test.inc. +# See: https://github.com/nxp-imx/imx-manifest/blob/imx-linux-scarthgap/imx-6.6.52-2.2.0.xml#L30 + +SUMMARY = "OP-TEE sanity testsuite" +DESCRIPTION = "Open Portable Trusted Execution Environment - Test suite" +HOMEPAGE = "https://www.op-tee.org/" -SUMMARY = "OPTEE test" LICENSE = "BSD-2-Clause & GPL-2.0-only" LIC_FILES_CHKSUM = "file://LICENSE.md;md5=daa2bcccc666345ab8940aab1315a4fa" +inherit python3native ptest +inherit deploy require optee-fslc.inc -DEPENDS += "optee-os optee-client openssl" +DEPENDS = "optee-client optee-os-tadevkit python3-cryptography-native openssl" + +SRC_URI = "git://github.com/OP-TEE/optee_test.git;branch=master;protocol=https \ + file://run-ptest \ + " + +S = "${WORKDIR}/git" +B = "${WORKDIR}/build" -EXTRA_OEMAKE += " \ - TA_DEV_KIT_DIR=${STAGING_INCDIR}/optee/export-user_ta_${OPTEE_ARCH}/ \ - CROSS_COMPILE_HOST=${HOST_PREFIX} \ - CROSS_COMPILE_TA=${HOST_PREFIX} \ - CROSS_COMPILE=${HOST_PREFIX} \ -" +EXTRA_OEMAKE += "TA_DEV_KIT_DIR=${TA_DEV_KIT_DIR} \ + OPTEE_OPENSSL_EXPORT=${STAGING_INCDIR} \ + CROSS_COMPILE_HOST=${HOST_PREFIX} \ + CROSS_COMPILE_TA=${HOST_PREFIX} \ + O=${B} \ + " + +CFLAGS += "-Wno-error=deprecated-declarations" do_compile() { - oe_runmake all + cd ${S} + # Top level makefile doesn't seem to handle parallel make gracefully + oe_runmake xtest + oe_runmake ta + oe_runmake test_plugin } do_compile[cleandirs] = "${B}" do_install () { - install -d ${D}${bindir} - install ${B}/xtest/xtest ${D}${bindir} + install -D -p -m0755 ${B}/xtest/xtest ${D}${bindir}/xtest - install -d ${D}${nonarch_base_libdir}/optee_armtz - find ${B}/ta -name '*.ta' | while read name; do - install -m 444 $name ${D}${nonarch_base_libdir}/optee_armtz/ - done + # install path should match the value set in optee-client/tee-supplicant + # default TEEC_LOAD_PATH is /lib + mkdir -p ${D}${nonarch_base_libdir}/optee_armtz/ + install -D -p -m0444 ${B}/ta/*/*.ta ${D}${nonarch_base_libdir}/optee_armtz/ + mkdir -p ${D}${libdir}/tee-supplicant/plugins + install -D -p -m0444 ${B}/supp_plugin/*.plugin ${D}${libdir}/tee-supplicant/plugins/ +} - install -d ${D}${libdir}/tee-supplicant/plugins/ - install ${B}/supp_plugin/*plugin ${D}${libdir}/tee-supplicant/plugins/ +do_deploy () { + install -d ${DEPLOYDIR}/${MLPREFIX}optee/ta + install -m 644 ${B}/ta/*/*.elf ${DEPLOYDIR}/${MLPREFIX}optee/ta } -FILES:${PN} += "${nonarch_base_libdir}/optee_armtz/ ${libdir}/tee-supplicant/plugins/" +addtask deploy before do_build after do_install + +FILES:${PN} += "${nonarch_base_libdir}/optee_armtz/ \ + ${libdir}/tee-supplicant/plugins/ \ + " -RDEPENDS:${PN} = "optee-os" +# Imports machine specific configs from staging to build +PACKAGE_ARCH = "${MACHINE_ARCH}" diff --git a/recipes-security/optee-imx/optee-test/run-ptest b/recipes-security/optee-imx/optee-test/run-ptest new file mode 100644 index 000000000..ba88c14d3 --- /dev/null +++ b/recipes-security/optee-imx/optee-test/run-ptest @@ -0,0 +1,52 @@ +#!/bin/sh +xtest | awk ' + + # Escapes the special characters in a string so that, when + # included in a regex, it represents a literal match + function regx_escape_literal(str, ret) { + ret = str + gsub(/[\[\]\^\$\.\*\?\+\{\}\\\(\)\|]/ , "\\\\&", str) + return str + } + + # Returns the simple test formatted name + function name(n, ret) { + ret = n + gsub(/\./, " ", ret) + return ret + } + + # Returns the simple test formatted result + function result(res) { + if(res ~ /OK/) { + return "PASS" + } else if(res ~ /FAILED/) { + return "FAIL" + } + } + + function parse(name, description, has_subtests, result_line) { + has_subtests = 0 + + # Consume every line up to the result line + result_line = " " regx_escape_literal(name) " (OK|FAILED)" + do { + getline + + # If this is a subtest (denoted by an "o" bullet) then subparse + if($0 ~ /^o /) { + parse($2, description " : " substr($0, index($0, $3))) + has_subtests = 1 + } + } while ($0 !~ result_line) + + # Only print the results for the deepest nested subtests + if(!has_subtests) { + print result($2) ": " name(name) " - " description + } + } + + # Start parsing at the beginning of every test (denoted by a "*" bullet) + /^\* / { parse($2, substr($0, index($0, $3))) } + +' diff --git a/recipes-security/optee-imx/optee-test_4.2.0.imx.bb b/recipes-security/optee-imx/optee-test_4.2.0.imx.bb deleted file mode 100644 index e2cf40e93..000000000 --- a/recipes-security/optee-imx/optee-test_4.2.0.imx.bb +++ /dev/null @@ -1,10 +0,0 @@ -# Copyright 2017-2024 NXP - -require optee-test-fslc.inc - -SRC_URI = "git://github.com/nxp-imx/imx-optee-test.git;protocol=https;branch=${SRCBRANCH}" - -SRCBRANCH = "lf-6.6.36_2.1.0" -SRCREV = "5b52b48a73b4cc3f228ec66ae6cf9920897bb2e6" - -COMPATIBLE_MACHINE = "(imx-nxp-bsp)" diff --git a/recipes-security/optee-imx/optee-test_4.4.0.imx.bb b/recipes-security/optee-imx/optee-test_4.4.0.imx.bb new file mode 100644 index 000000000..b4ac12714 --- /dev/null +++ b/recipes-security/optee-imx/optee-test_4.4.0.imx.bb @@ -0,0 +1,13 @@ +# Copyright 2017-2024 NXP + +require optee-test-fslc-imx.inc + +# The BSD and GPL license files are now included in the source +# https://github.com/OP-TEE/optee_test/commit/a748f5fcd9ec8a574dc86a5aa56d05bc6ac174e7 +LIC_FILES_CHKSUM = "file://LICENSE.md;md5=a8fa504109e4cd7ea575bc49ea4be560 \ + file://LICENSE-BSD;md5=dca16d6efa93b55d0fd662ae5cd6feeb \ + file://LICENSE-GPL;md5=10e86b5d2a6cb0e2b9dcfdd26a9ac58d" + + +SRCBRANCH = "lf-6.6.52_2.2.0" +SRCREV = "dafc98ed8364d7281a9a7f0788dd0a2067844a59" -- cgit v1.2.3-54-g00ecf From a4f45888cf63798e86a0fee13a1793f6292fc1da Mon Sep 17 00:00:00 2001 From: Tom Hochstein Date: Wed, 26 Mar 2025 07:23:35 -0700 Subject: optee-imx: Updates for clang Clang is on version 20 now, so the disablement of it and the patches for it are no longer needed. Signed-off-by: Tom Hochstein --- recipes-security/optee-imx/optee-fslc.inc | 3 - ...-core-Define-section-attributes-for-clang.patch | 245 --------------------- .../optee-os/0002-optee-enable-clang-support.patch | 34 --- recipes-security/optee-imx/optee-os_4.4.0.imx.bb | 4 - 4 files changed, 286 deletions(-) delete mode 100644 recipes-security/optee-imx/optee-os/0001-core-Define-section-attributes-for-clang.patch delete mode 100644 recipes-security/optee-imx/optee-os/0002-optee-enable-clang-support.patch diff --git a/recipes-security/optee-imx/optee-fslc.inc b/recipes-security/optee-imx/optee-fslc.inc index 42e23fc22..6e380e050 100644 --- a/recipes-security/optee-imx/optee-fslc.inc +++ b/recipes-security/optee-imx/optee-fslc.inc @@ -17,9 +17,6 @@ OPTEE_ARCH:arm = "arm32" OPTEE_ARCH:aarch64 = "arm64" OPTEE_CORE = "${@d.getVar('OPTEE_ARCH').upper()}" -# FIXME - breaks with Clang 18. See https://github.com/OP-TEE/optee_os/issues/6754 -TOOLCHAIN = "gcc" - OPTEE_TOOLCHAIN = "${@d.getVar('TOOLCHAIN') or 'gcc'}" OPTEE_COMPILER = "${@bb.utils.contains("BBFILE_COLLECTIONS", "clang-layer", "${OPTEE_TOOLCHAIN}", "gcc", d)}" diff --git a/recipes-security/optee-imx/optee-os/0001-core-Define-section-attributes-for-clang.patch b/recipes-security/optee-imx/optee-os/0001-core-Define-section-attributes-for-clang.patch deleted file mode 100644 index 54fbe5419..000000000 --- a/recipes-security/optee-imx/optee-os/0001-core-Define-section-attributes-for-clang.patch +++ /dev/null @@ -1,245 +0,0 @@ -From ef83625c9a5f50610e25aa860c4b9c5e64723a66 Mon Sep 17 00:00:00 2001 -From: Emekcan Aras -Date: Wed, 21 Dec 2022 10:55:58 +0000 -Subject: [PATCH 1/4] core: Define section attributes for clang - -Clang's attribute section is not same as gcc, here we need to add flags -to sections so they can be eventually collected by linker into final -output segments. Only way to do so with clang is to use - -pragma clang section ... - -The behavious is described here [1], this allows us to define names bss -sections. This was not an issue until clang-15 where LLD linker starts -to detect the section flags before merging them and throws the following -errors - -| ld.lld: error: section type mismatch for .nozi.kdata_page -| >>> /mnt/b/yoe/master/build/tmp/work/qemuarm64-yoe-linux/optee-os-tadevkit/3.17.0-r0/build/core/arch/arm/kernel/thread.o:(.nozi.kdata_page): SHT_PROGBITS -| >>> output section .nozi: SHT_NOBITS -| -| ld.lld: error: section type mismatch for .nozi.mmu.l2 -| >>> /mnt/b/yoe/master/build/tmp/work/qemuarm64-yoe-linux/optee-os-tadevkit/3.17.0-r0/build/core/arch/arm/mm/core_mmu_lpae.o:(.nozi.mmu.l2): SHT_PROGBITS -| >>> output section .nozi: SHT_NOBITS - -These sections should be carrying SHT_NOBITS but so far it was not -possible to do so, this patch tries to use clangs pragma to get this -going and match the functionality with gcc. - -[1] https://intel.github.io/llvm-docs/clang/LanguageExtensions.html#specifying-section-names-for-global-objects-pragma-clang-section - -Upstream-Status: Pending -Signed-off-by: Khem Raj -Signed-off-by: Oleksandr Suvorov ---- - - core/arch/arm/kernel/thread.c | 19 +++++++++++++++-- - core/arch/arm/mm/core_mmu_lpae.c | 35 +++++++++++++++++++++++++++---- - core/arch/arm/mm/core_mmu_v7.c | 36 +++++++++++++++++++++++++++++--- - core/kernel/thread.c | 13 +++++++++++- - core/mm/pgt_cache.c | 12 ++++++++++- - 5 files changed, 104 insertions(+), 11 deletions(-) - -diff --git a/core/arch/arm/kernel/thread.c b/core/arch/arm/kernel/thread.c -index 66833b3a0..b3eb9cf9a 100644 ---- a/core/arch/arm/kernel/thread.c -+++ b/core/arch/arm/kernel/thread.c -@@ -45,15 +45,30 @@ static size_t thread_user_kcode_size __nex_bss; - #if defined(CFG_CORE_UNMAP_CORE_AT_EL0) && \ - defined(CFG_CORE_WORKAROUND_SPECTRE_BP_SEC) && defined(ARM64) - long thread_user_kdata_sp_offset __nex_bss; -+#ifdef __clang__ -+#ifndef CFG_VIRTUALIZATION -+#pragma clang section bss=".nozi.kdata_page" -+#else -+#pragma clang section bss=".nex_nozi.kdata_page" -+#endif -+#endif - static uint8_t thread_user_kdata_page[ - ROUNDUP(sizeof(struct thread_core_local) * CFG_TEE_CORE_NB_CORE, - SMALL_PAGE_SIZE)] - __aligned(SMALL_PAGE_SIZE) -+#ifndef __clang__ - #ifndef CFG_NS_VIRTUALIZATION -- __section(".nozi.kdata_page"); -+ __section(".nozi.kdata_page") - #else -- __section(".nex_nozi.kdata_page"); -+ __section(".nex_nozi.kdata_page") - #endif -+#endif -+ ; -+#endif -+ -+/* reset BSS section to default ( .bss ) */ -+#ifdef __clang__ -+#pragma clang section bss="" - #endif - - #ifdef ARM32 -diff --git a/core/arch/arm/mm/core_mmu_lpae.c b/core/arch/arm/mm/core_mmu_lpae.c -index 4c8b85e39..1885e1d3f 100644 ---- a/core/arch/arm/mm/core_mmu_lpae.c -+++ b/core/arch/arm/mm/core_mmu_lpae.c -@@ -234,19 +234,46 @@ typedef uint16_t l1_idx_t; - typedef uint64_t base_xlat_tbls_t[CFG_TEE_CORE_NB_CORE][NUM_BASE_LEVEL_ENTRIES]; - typedef uint64_t xlat_tbl_t[XLAT_TABLE_ENTRIES]; - -+#ifdef __clang__ -+#pragma clang section bss=".nozi.mmu.base_table" -+#endif - static base_xlat_tbls_t base_xlation_table[NUM_BASE_TABLES] - __aligned(NUM_BASE_LEVEL_ENTRIES * XLAT_ENTRY_SIZE) -- __section(".nozi.mmu.base_table"); -+#ifndef __clang__ -+ __section(".nozi.mmu.base_table") -+#endif -+; -+#ifdef __clang__ -+#pragma clang section bss="" -+#endif - -+#ifdef __clang__ -+#pragma clang section bss=".nozi.mmu.l2" -+#endif - static xlat_tbl_t xlat_tables[MAX_XLAT_TABLES] -- __aligned(XLAT_TABLE_SIZE) __section(".nozi.mmu.l2"); -+ __aligned(XLAT_TABLE_SIZE) -+#ifndef __clang__ -+ __section(".nozi.mmu.l2") -+#endif -+; -+#ifdef __clang__ -+#pragma clang section bss="" -+#endif - - #define XLAT_TABLES_SIZE (sizeof(xlat_tbl_t) * MAX_XLAT_TABLES) - -+#ifdef __clang__ -+#pragma clang section bss=".nozi.mmu.l2" -+#endif - /* MMU L2 table for TAs, one for each thread */ - static xlat_tbl_t xlat_tables_ul1[CFG_NUM_THREADS] -- __aligned(XLAT_TABLE_SIZE) __section(".nozi.mmu.l2"); -- -+#ifndef __clang__ -+ __aligned(XLAT_TABLE_SIZE) __section(".nozi.mmu.l2") -+#endif -+; -+#ifdef __clang__ -+#pragma clang section bss="" -+#endif - /* - * TAs page table entry inside a level 1 page table. - * -diff --git a/core/arch/arm/mm/core_mmu_v7.c b/core/arch/arm/mm/core_mmu_v7.c -index 61e703da8..1960c08ca 100644 ---- a/core/arch/arm/mm/core_mmu_v7.c -+++ b/core/arch/arm/mm/core_mmu_v7.c -@@ -204,16 +204,46 @@ typedef uint32_t l1_xlat_tbl_t[NUM_L1_ENTRIES]; - typedef uint32_t l2_xlat_tbl_t[NUM_L2_ENTRIES]; - typedef uint32_t ul1_xlat_tbl_t[NUM_UL1_ENTRIES]; - -+#ifdef __clang__ -+#pragma clang section bss=".nozi.mmu.l1" -+#endif - static l1_xlat_tbl_t main_mmu_l1_ttb -- __aligned(L1_ALIGNMENT) __section(".nozi.mmu.l1"); -+ __aligned(L1_ALIGNMENT) -+#ifndef __clang__ -+ __section(".nozi.mmu.l1") -+#endif -+; -+#ifdef __clang__ -+#pragma clang section bss="" -+#endif - - /* L2 MMU tables */ -+#ifdef __clang__ -+#pragma clang section bss=".nozi.mmu.l2" -+#endif - static l2_xlat_tbl_t main_mmu_l2_ttb[MAX_XLAT_TABLES] -- __aligned(L2_ALIGNMENT) __section(".nozi.mmu.l2"); -+ __aligned(L2_ALIGNMENT) -+#ifndef __clang__ -+ __section(".nozi.mmu.l2") -+#endif -+; -+#ifdef __clang__ -+#pragma clang section bss="" -+#endif - - /* MMU L1 table for TAs, one for each thread */ -+#ifdef __clang__ -+#pragma clang section bss=".nozi.mmu.ul1" -+#endif - static ul1_xlat_tbl_t main_mmu_ul1_ttb[CFG_NUM_THREADS] -- __aligned(UL1_ALIGNMENT) __section(".nozi.mmu.ul1"); -+ __aligned(UL1_ALIGNMENT) -+#ifndef __clang__ -+ __section(".nozi.mmu.ul1") -+#endif -+; -+#ifdef __clang__ -+#pragma clang section bss="" -+#endif - - struct mmu_partition { - l1_xlat_tbl_t *l1_table; -diff --git a/core/kernel/thread.c b/core/kernel/thread.c -index 2a1f22dce..5516b6771 100644 ---- a/core/kernel/thread.c -+++ b/core/kernel/thread.c -@@ -39,13 +39,24 @@ static uint32_t end_canary_value = 0xababab00; - name[stack_num][sizeof(name[stack_num]) / sizeof(uint32_t) - 1] - #endif - -+#define DO_PRAGMA(x) _Pragma (#x) -+ -+#ifdef __clang__ -+#define DECLARE_STACK(name, num_stacks, stack_size, linkage) \ -+DO_PRAGMA (clang section bss=".nozi_stack." #name) \ -+linkage uint32_t name[num_stacks] \ -+ [ROUNDUP(stack_size + STACK_CANARY_SIZE + STACK_CHECK_EXTRA, \ -+ STACK_ALIGNMENT) / sizeof(uint32_t)] \ -+ __attribute__((aligned(STACK_ALIGNMENT))); \ -+DO_PRAGMA(clang section bss="") -+#else - #define DECLARE_STACK(name, num_stacks, stack_size, linkage) \ - linkage uint32_t name[num_stacks] \ - [ROUNDUP(stack_size + STACK_CANARY_SIZE + STACK_CHECK_EXTRA, \ - STACK_ALIGNMENT) / sizeof(uint32_t)] \ - __attribute__((section(".nozi_stack." # name), \ - aligned(STACK_ALIGNMENT))) -- -+#endif - #define GET_STACK(stack) ((vaddr_t)(stack) + STACK_SIZE(stack)) - - DECLARE_STACK(stack_tmp, CFG_TEE_CORE_NB_CORE, STACK_TMP_SIZE, -diff --git a/core/mm/pgt_cache.c b/core/mm/pgt_cache.c -index 79553c6d2..b9efdf427 100644 ---- a/core/mm/pgt_cache.c -+++ b/core/mm/pgt_cache.c -@@ -410,8 +410,18 @@ void pgt_init(void) - * has a large alignment, while .bss has a small alignment. The current - * link script is optimized for small alignment in .bss - */ -+#ifdef __clang__ -+#pragma clang section bss=".nozi.mmu.l2" -+#endif - static uint8_t pgt_tables[PGT_CACHE_SIZE][PGT_SIZE] -- __aligned(PGT_SIZE) __section(".nozi.pgt_cache"); -+ __aligned(PGT_SIZE) -+#ifndef __clang__ -+ __section(".nozi.pgt_cache") -+#endif -+ ; -+#ifdef __clang__ -+#pragma clang section bss="" -+#endif - size_t n; - - for (n = 0; n < ARRAY_SIZE(pgt_tables); n++) { --- -2.43.2 - diff --git a/recipes-security/optee-imx/optee-os/0002-optee-enable-clang-support.patch b/recipes-security/optee-imx/optee-os/0002-optee-enable-clang-support.patch deleted file mode 100644 index dbc53542e..000000000 --- a/recipes-security/optee-imx/optee-os/0002-optee-enable-clang-support.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 2ba573c9763329fbfdfacc8393d565ab747cac4d Mon Sep 17 00:00:00 2001 -From: Brett Warren -Date: Wed, 23 Sep 2020 09:27:34 +0100 -Subject: [PATCH 2/4] optee: enable clang support - -When compiling with clang, the LIBGCC_LOCATE_CFLAG variable used -to provide a sysroot wasn't included, which results in not locating -compiler-rt. This is mitigated by including the variable as ammended. - -Upstream-Status: Pending -ChangeId: 8ba69a4b2eb8ebaa047cb266c9aa6c2c3da45701 -Signed-off-by: Brett Warren -Signed-off-by: Oleksandr Suvorov ---- - - mk/clang.mk | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/mk/clang.mk b/mk/clang.mk -index a045beee8..1ebe2f702 100644 ---- a/mk/clang.mk -+++ b/mk/clang.mk -@@ -30,7 +30,7 @@ comp-cflags-warns-clang := -Wno-language-extension-token \ - - # Note, use the compiler runtime library (libclang_rt.builtins.*.a) instead of - # libgcc for clang --libgcc$(sm) := $(shell $(CC$(sm)) $(CFLAGS$(arch-bits-$(sm))) \ -+libgcc$(sm) := $(shell $(CC$(sm)) $(LIBGCC_LOCATE_CFLAGS) $(CFLAGS$(arch-bits-$(sm))) \ - -rtlib=compiler-rt -print-libgcc-file-name 2> /dev/null) - - # Core ASLR relies on the executable being ready to run from its preferred load --- -2.43.2 - diff --git a/recipes-security/optee-imx/optee-os_4.4.0.imx.bb b/recipes-security/optee-imx/optee-os_4.4.0.imx.bb index 5ff12a599..dc6d3901d 100644 --- a/recipes-security/optee-imx/optee-os_4.4.0.imx.bb +++ b/recipes-security/optee-imx/optee-os_4.4.0.imx.bb @@ -2,9 +2,5 @@ require optee-os-fslc-imx.inc -SRC_URI += " \ - file://0001-core-Define-section-attributes-for-clang.patch \ - file://0002-optee-enable-clang-support.patch \ -" SRCBRANCH = "lf-6.6.52_2.2.0" SRCREV = "60beb308810f9561a67fdb435388a64c85eb6dcb" -- cgit v1.2.3-54-g00ecf From f5155c039617250b18d5b8c66c3c2bfa33bedb7c Mon Sep 17 00:00:00 2001 From: Tom Hochstein Date: Fri, 28 Mar 2025 05:43:37 -0700 Subject: imx6sllevk.conf: Use IMX_DEFAULT_BOOTLOADER The machine improperly hard-codes PREFERRED_PROVIDER instead of using the layer variable. Signed-off-by: Tom Hochstein --- conf/machine/imx6sllevk.conf | 3 --- 1 file changed, 3 deletions(-) diff --git a/conf/machine/imx6sllevk.conf b/conf/machine/imx6sllevk.conf index 5a1dc666c..858699c93 100644 --- a/conf/machine/imx6sllevk.conf +++ b/conf/machine/imx6sllevk.conf @@ -33,6 +33,3 @@ MACHINE_FEATURES += "wifi bluetooth bcm4339 bcm43455 nxp8987-sdio" # MESA DRI library XSERVER += "mesa-driver-swrast" - -PREFERRED_PROVIDER_u-boot = "u-boot-fslc" -PREFERRED_PROVIDER_virtual/bootloader = "u-boot-fslc" -- cgit v1.2.3-54-g00ecf From d36333dce83f1848f44eaa9507ab170f2c360cd9 Mon Sep 17 00:00:00 2001 From: Tom Hochstein Date: Sat, 22 Mar 2025 06:20:07 -0700 Subject: imx-base.inc: Drop redundant i.MX 91 override IMX_SOC_REV defaults to A0, so no need to override it. Signed-off-by: Tom Hochstein --- conf/machine/include/imx-base.inc | 1 - 1 file changed, 1 deletion(-) diff --git a/conf/machine/include/imx-base.inc b/conf/machine/include/imx-base.inc index 932b1e696..7a3518cd3 100644 --- a/conf/machine/include/imx-base.inc +++ b/conf/machine/include/imx-base.inc @@ -184,7 +184,6 @@ IMX_SOC_REV:mx8dx-generic-bsp ??= "C0" IMX_SOC_REV:mx8ulp-generic-bsp ??= \ "${@bb.utils.contains('MACHINE_FEATURES', 'soc-reva0', 'A0', \ 'A2', d)}" -IMX_SOC_REV:mx91-generic-bsp ??= "A0" IMX_SOC_REV:mx93-generic-bsp ??= "A1" IMX_SOC_REV_LOWER = "${@d.getVar('IMX_SOC_REV').lower()}" -- cgit v1.2.3-54-g00ecf