Skip to contentSkip to conversation

package/freescale-imx/imx-m4-demos: new package

PATCH New Fabrice Goucem 2 participants 4 messages Jul 28, 2020 – Jul 29, 2020 Arm i.MX and Layerscape

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 package/freescale-imx/imx-m4-demos: new package

New package to download and install i.MX Cortex-M4 demos for following SoCs:
* i.MX7D
* i.MX7ULP
* i.MX8M
* i.MX8MM
* i.MX8MN
* i.MX8QM
* i.MX8QXP

Yocto recipes from where the demos location has been extracted:
https://source.codeaurora.org/external/imx/meta-fsl-bsp-release/tree/imx/meta-sdk/recipes-fsl/m4-demos?h=imx-morty&id=bfb1e26798775f161b14218ac6f1d50069bea8ed

---
 DEVELOPERS                                    |  1 +
 board/freescale/common/imx/post-image.sh      | 14 ++-
 package/freescale-imx/Config.in               | 10 ++
 package/freescale-imx/imx-m4-demos/Config.in  | 11 +++
 .../imx-m4-demos/imx-m4-demos.hash            | 10 ++
 .../imx-m4-demos/imx-m4-demos.mk              | 95 +++++++++++++++++++
 6 files changed, 140 insertions(+), 1 deletion(-)
 create mode 100644 package/freescale-imx/imx-m4-demos/Config.in
 create mode 100644 package/freescale-imx/imx-m4-demos/imx-m4-demos.hash
 create mode 100644 package/freescale-imx/imx-m4-demos/imx-m4-demos.mk
DEVELOPERS +1 -0
index ee840dbb8b..5e24b55167 100644
@@ -908,6 +908,7 @@ F:	package/whois/
 N:	Fabrice Goucem <[email protected]>
 F:	board/freescale/imx6ullevk/
 F:	configs/freescale_imx6ullevk_defconfig
+F:	package/freescale-imx/imx-m4-demos/
 
 N:	Falco Hyfing <[email protected]>
 F:	package/python-pymodbus/
board/freescale/common/imx/post-image.sh +13 -1
index 06ccaac3a4..4ac7ae09f8 100755
@@ -30,6 +30,18 @@ linux_image()
 	fi
 }
 
+#
+# m4_image prints all available M4 demo file names for the genimage
+# configuration file
+#
+m4_image()
+{
+	if grep -Eq "^BR2_PACKAGE_IMX_M4_DEMOS=y$" ${BR2_CONFIG}; then
+		echo -n ", "
+		for f in $(ls ${BINARIES_DIR}/m4_*); do echo -n "$(basename $f), "; done
+	fi
+}
+
 genimage_type()
 {
 	if grep -Eq "^BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8=y$" ${BR2_CONFIG}; then
@@ -79,7 +91,7 @@ uboot_image()
 
 main()
 {
-	local FILES="$(dtb_list) $(linux_image)"
+	local FILES="$(dtb_list) $(linux_image) $(m4_image)"
 	local IMXOFFSET="$(imx_offset)"
 	local UBOOTBIN="$(uboot_image)"
 	local GENIMAGE_CFG="$(mktemp --suffix genimage.cfg)"
package/freescale-imx/Config.in +10 -0
index b0c7de8436..b95de54f4c 100644
@@ -96,10 +96,20 @@ config BR2_PACKAGE_FREESCALE_IMX_HAS_VIV_GPU
 		BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8MN || \
 		BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8X
 
+config BR2_PACKAGE_FREESCALE_IMX_HAS_M4
+	bool
+	default y if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX7 || \
+		BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8 || \
+		BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8M || \
+		BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8MM || \
+		BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8MN || \
+		BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8X
+
 source "package/freescale-imx/imx-alsa-plugins/Config.in"
 source "package/freescale-imx/imx-codec/Config.in"
 source "package/freescale-imx/imx-kobs/Config.in"
 source "package/freescale-imx/imx-lib/Config.in"
+source "package/freescale-imx/imx-m4-demos/Config.in"
 source "package/freescale-imx/imx-m4fwloader/Config.in"
 source "package/freescale-imx/imx-parser/Config.in"
 source "package/freescale-imx/imx-uuc/Config.in"
package/freescale-imx/imx-m4-demos/Config.in new file +11 -0
new file mode 100644
index 0000000000..b1cbebb74f
@@ -0,0 +1,11 @@
+comment "imx-m4-demos needs an i.MX platform with Cortex-M4"
+	depends on !BR2_PACKAGE_FREESCALE_IMX_HAS_M4
+
+config BR2_PACKAGE_IMX_M4_DEMOS
+	bool "imx-m4-demos"
+	depends on BR2_PACKAGE_FREESCALE_IMX_HAS_M4
+	help
+	  Cortex-M4 demo blobs for the Freescale i.MX SoCs.
+
+	  This library is provided by Freescale as-is and doesn't have
+	  an upstream.
package/freescale-imx/imx-m4-demos/imx-m4-demos.hash new file +10 -0
new file mode 100644
index 0000000000..feda867952
@@ -0,0 +1,10 @@
+# locally computed
+sha256  cc00d3b936d49b2794a2a99e10129437e70caba3fd26b8379b8c50dd22f73254  imx7d-sabresd-m4-freertos-1.0.1.bin
+sha256  a8fbe1180b3d20e933a410cd76e60baac7a9f54e8b2bae8b6b8a3e1af550eca6  imx7ulp-m4-demo-2.8.0.bin
+sha256  4e41e270506870e0fd2d53e3d69afdcf6d613d099b0da5c516a512944c5c12c3  imx8mm-m4-demo-2.5.0.bin
+sha256  e877c7462b6ea87c498563842f42352d204eb28a65f35f7dc1fec643f84abb66  imx8mn-m7-demo-2.8.0.bin
+sha256  fd441e75395b0c6f90626c883ee8a93406b14e7d55adc7925116254394bb7ad8  imx8mq-m4-demo-2.3.0.bin
+sha256  d06a636b84cd559483091cbdb07b5ce9e15a534bca31d4cb756b33b696c2160b  imx8qm-m4-demo-2.8.0.bin
+sha256  7800cdbebe07f426cdac50b0e295d64215164a767e79ca58bd917445c50e345f  imx8qx-m4-demo-2.8.0.bin
+
+# no hash for license file as it is different for each package listed above
package/freescale-imx/imx-m4-demos/imx-m4-demos.mk new file +95 -0

95 lines not on this page · raw message

Signature · 1 line
2.27.0
#1 lore raw

PATCH 2/2 configs/freescale_imx7ulpevk: new defconfig

Add basic support for NXP's i.MX7 ULP EVK board:

https://www.nxp.com/design/development-boards/i.mx-evaluation-and-development-boards/evaluation-kit-for-the-i.mx-7ulp-applications-processor:MCIMX7ULP-EVK

---
Changes v5 -> v6:
- Enable flag BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL
- Bump Linux and u-boot to rel_imx_5.4.24-2.1.0
- Update URL for Quick Start Guide
- Email address update

---
 DEVELOPERS                             |  2 +
 board/freescale/imx7ulpevk/readme.txt  | 76 ++++++++++++++++++++++++++
 configs/freescale_imx7ulpevk_defconfig | 29 ++++++++++
 package/freescale-imx/Config.in        |  8 ++-
 4 files changed, 114 insertions(+), 1 deletion(-)
 create mode 100644 board/freescale/imx7ulpevk/readme.txt
 create mode 100644 configs/freescale_imx7ulpevk_defconfig
DEVELOPERS +2 -0
index 5e24b55167..e29840c371 100644
@@ -907,7 +907,9 @@ F:	package/whois/
 
 N:	Fabrice Goucem <[email protected]>
 F:	board/freescale/imx6ullevk/
+F:	board/freescale/imx7ulpevk/
 F:	configs/freescale_imx6ullevk_defconfig
+F:	configs/freescale_imx7ulpevk_defconfig
 F:	package/freescale-imx/imx-m4-demos/
 
 N:	Falco Hyfing <[email protected]>
board/freescale/imx7ulpevk/readme.txt new file +76 -0

76 lines not on this page · raw message

configs/freescale_imx7ulpevk_defconfig new file +29 -0
new file mode 100644
index 0000000000..816e90a0f4
@@ -0,0 +1,29 @@
+BR2_arm=y
+BR2_cortex_a7=y
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_4=y
+BR2_TARGET_GENERIC_GETTY_PORT="ttyLP0"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/imx/post-image.sh"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_GIT=y
+BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://source.codeaurora.org/external/imx/linux-imx.git"
+BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="rel_imx_5.4.24_2.1.0"
+BR2_LINUX_KERNEL_DEFCONFIG="imx_v7"
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="imx7ulp-evkb"
+BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
+BR2_PACKAGE_FREESCALE_IMX=y
+BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX7ULP=y
+BR2_PACKAGE_IMX_M4_DEMOS=y
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_TARGET_UBOOT=y
+BR2_TARGET_UBOOT_BOARDNAME="mx7ulp_evk"
+BR2_TARGET_UBOOT_CUSTOM_GIT=y
+BR2_TARGET_UBOOT_CUSTOM_REPO_URL="https://source.codeaurora.org/external/imx/uboot-imx.git"
+BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="rel_imx_5.4.24_2.1.0"
+BR2_TARGET_UBOOT_NEEDS_DTC=y
+# BR2_TARGET_UBOOT_FORMAT_BIN is not set
+BR2_TARGET_UBOOT_FORMAT_IMX=y
+BR2_PACKAGE_HOST_DOSFSTOOLS=y
+BR2_PACKAGE_HOST_GENIMAGE=y
+BR2_PACKAGE_HOST_MTOOLS=y
package/freescale-imx/Config.in +7 -1
index b95de54f4c..fbcab8c33d 100644
@@ -38,7 +38,10 @@ config BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX6UL
 	bool "imx6ul/imx6ull"
 
 config BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX7
-	bool "imx7d/imx7ulp"
+	bool "imx7d"
+
+config BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX7ULP
+	bool "imx7ulp"
 
 config BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8
 	bool "imx8"
@@ -68,6 +71,7 @@ config BR2_PACKAGE_FREESCALE_IMX_PLATFORM
 	default "IMX6S" if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX6S
 	default "IMX6UL" if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX6UL
 	default "IMX7" if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX7
+	default "IMX7ULP" if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX7ULP
 	default "IMX8" if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8
 	default "IMX8MQ" if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8M
 	default "IMX8MM" if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8MM
@@ -90,6 +94,7 @@ config BR2_PACKAGE_FREESCALE_IMX_HAS_VIV_GPU
 	default y if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX6Q || \
 		BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX6S || \
 		BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX7 || \
+		BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX7ULP || \
 		BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8 || \
 		BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8M || \
 		BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8MM || \
@@ -99,6 +104,7 @@ config BR2_PACKAGE_FREESCALE_IMX_HAS_VIV_GPU
 config BR2_PACKAGE_FREESCALE_IMX_HAS_M4
 	bool
 	default y if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX7 || \
+		BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX7ULP || \
 		BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8 || \
 		BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8M || \
 		BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8MM || \
Signature · 1 line
2.27.0
#2 lore raw

PATCH 1/2 package/freescale-imx/imx-m4-demos: new package

In reply to Fabrice Goucem

Hi Fabrice,

Thanks for your contribution! I have a few questions below.

Quoted 10 lines · Fabrice Goucem

New package to download and install i.MX Cortex-M4 demos for following SoCs:
* i.MX7D
* i.MX7ULP
* i.MX8M
* i.MX8MM
* i.MX8MN
* i.MX8QM
* i.MX8QXP

Quoted 2 lines

Yocto recipes from where the demos location has been extracted:
https://source.codeaurora.org/external/imx/meta-fsl-bsp-release/tree/imx/meta-sdk/recipes-fsl/m4-demos?h=imx-morty&id=bfb1e26798775f161b14218ac6f1d50069bea8ed

Why using such an old release? Why not latest GA from NXP?
https://source.codeaurora.org/external/imx/meta-imx/tree/meta-sdk/recipes-fsl/m4-demos?h=zeus-5.4.24-2.1.0

Quoted 90 lines
---
 DEVELOPERS                                    |  1 +
 board/freescale/common/imx/post-image.sh      | 14 ++-
 package/freescale-imx/Config.in               | 10 ++
 package/freescale-imx/imx-m4-demos/Config.in  | 11 +++
 .../imx-m4-demos/imx-m4-demos.hash            | 10 ++
 .../imx-m4-demos/imx-m4-demos.mk              | 95 +++++++++++++++++++
 6 files changed, 140 insertions(+), 1 deletion(-)
 create mode 100644 package/freescale-imx/imx-m4-demos/Config.in
 create mode 100644 package/freescale-imx/imx-m4-demos/imx-m4-demos.hash
 create mode 100644 package/freescale-imx/imx-m4-demos/imx-m4-demos.mk
DEVELOPERS +1 -0
index ee840dbb8b..5e24b55167 100644
@@ -908,6 +908,7 @@ F:	package/whois/
 N:	Fabrice Goucem <[email protected]>
 F:	board/freescale/imx6ullevk/
 F:	configs/freescale_imx6ullevk_defconfig
+F:	package/freescale-imx/imx-m4-demos/
 
 N:	Falco Hyfing <[email protected]>
 F:	package/python-pymodbus/
board/freescale/common/imx/post-image.sh +13 -1
index 06ccaac3a4..4ac7ae09f8 100755
@@ -30,6 +30,18 @@ linux_image()
 	fi
 }
 
+#
+# m4_image prints all available M4 demo file names for the genimage
+# configuration file
+#
+m4_image()
+{
+	if grep -Eq "^BR2_PACKAGE_IMX_M4_DEMOS=y$" ${BR2_CONFIG}; then
+		echo -n ", "
+		for f in $(ls ${BINARIES_DIR}/m4_*); do echo -n "$(basename $f), "; done
+	fi
+}
+
 genimage_type()
 {
 	if grep -Eq "^BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8=y$" ${BR2_CONFIG}; then
@@ -79,7 +91,7 @@ uboot_image()
 
 main()
 {
-	local FILES="$(dtb_list) $(linux_image)"
+	local FILES="$(dtb_list) $(linux_image) $(m4_image)"
 	local IMXOFFSET="$(imx_offset)"
 	local UBOOTBIN="$(uboot_image)"
 	local GENIMAGE_CFG="$(mktemp --suffix genimage.cfg)"
package/freescale-imx/Config.in +10 -0
index b0c7de8436..b95de54f4c 100644
@@ -96,10 +96,20 @@ config BR2_PACKAGE_FREESCALE_IMX_HAS_VIV_GPU
 		BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8MN || \
 		BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8X
 
+config BR2_PACKAGE_FREESCALE_IMX_HAS_M4
+	bool
+	default y if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX7 || \
+		BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8 || \
+		BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8M || \
+		BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8MM || \
+		BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8MN || \
+		BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8X
+
 source "package/freescale-imx/imx-alsa-plugins/Config.in"
 source "package/freescale-imx/imx-codec/Config.in"
 source "package/freescale-imx/imx-kobs/Config.in"
 source "package/freescale-imx/imx-lib/Config.in"
+source "package/freescale-imx/imx-m4-demos/Config.in"
 source "package/freescale-imx/imx-m4fwloader/Config.in"
 source "package/freescale-imx/imx-parser/Config.in"
 source "package/freescale-imx/imx-uuc/Config.in"
package/freescale-imx/imx-m4-demos/Config.in new file +0 -0
new file mode 100644
index 0000000000..b1cbebb74f

package/freescale-imx/imx-m4-demos/Config.in line 2

Quoted 2 lines
package/freescale-imx/imx-m4-demos/Config.in new file +2 -0
@@ -0,0 +1,11 @@
+comment "imx-m4-demos needs an i.MX platform with Cortex-M4"
+	depends on !BR2_PACKAGE_FREESCALE_IMX_HAS_M4

Maybe call it mcore like NXP, would be better IMO.

Quoted 15 lines
package/freescale-imx/imx-m4-demos/Config.in new file +9 -0
+
+config BR2_PACKAGE_IMX_M4_DEMOS
+	bool "imx-m4-demos"
+	depends on BR2_PACKAGE_FREESCALE_IMX_HAS_M4
+	help
+	  Cortex-M4 demo blobs for the Freescale i.MX SoCs.
+
+	  This library is provided by Freescale as-is and doesn't have
+	  an upstream.
package/freescale-imx/imx-m4-demos/imx-m4-demos.hash new file +0 -0
new file mode 100644
index 0000000000..feda867952

package/freescale-imx/imx-m4-demos/imx-m4-demos.hash line 8

Quoted 8 lines
package/freescale-imx/imx-m4-demos/imx-m4-demos.hash new file +8 -0
@@ -0,0 +1,10 @@
+# locally computed
+sha256  cc00d3b936d49b2794a2a99e10129437e70caba3fd26b8379b8c50dd22f73254  imx7d-sabresd-m4-freertos-1.0.1.bin
+sha256  a8fbe1180b3d20e933a410cd76e60baac7a9f54e8b2bae8b6b8a3e1af550eca6  imx7ulp-m4-demo-2.8.0.bin
+sha256  4e41e270506870e0fd2d53e3d69afdcf6d613d099b0da5c516a512944c5c12c3  imx8mm-m4-demo-2.5.0.bin
+sha256  e877c7462b6ea87c498563842f42352d204eb28a65f35f7dc1fec643f84abb66  imx8mn-m7-demo-2.8.0.bin
+sha256  fd441e75395b0c6f90626c883ee8a93406b14e7d55adc7925116254394bb7ad8  imx8mq-m4-demo-2.3.0.bin
+sha256  d06a636b84cd559483091cbdb07b5ce9e15a534bca31d4cb756b33b696c2160b  imx8qm-m4-demo-2.8.0.bin
+sha256  7800cdbebe07f426cdac50b0e295d64215164a767e79ca58bd917445c50e345f  imx8qx-m4-demo-2.8.0.bin

I stand corrected, *some* platform use 2.8.0 which is the latest, why not all? IMO they should all be 2.8.0 except for imx7d that stays 1.0.1.

Quoted 90 lines
package/freescale-imx/imx-m4-demos/imx-m4-demos.hash new file +1 -0
+# no hash for license file as it is different for each package listed above
package/freescale-imx/imx-m4-demos/imx-m4-demos.mk new file +83 -0
new file mode 100644
index 0000000000..d331ef9b69
@@ -0,0 +1,95 @@
+################################################################################
+#
+# imx-m4-demos
+#
+################################################################################
+
+IMX_M4_DEMOS_SITE = $(FREESCALE_IMX_SITE)
+
+IMX_M4_DEMOS_LICENSE = NXP Semiconductor Software License Agreement
+IMX_M4_DEMOS_LICENSE_FILES = COPYING
+IMX_M4_DEMOS_REDISTRIBUTE = NO
+
+define IMX_M4_DEMOS_EXTRACT_CMDS
+	$(call FREESCALE_IMX_EXTRACT_HELPER,$(IMX_M4_DEMOS_DL_DIR)/$(IMX_M4_DEMOS_SOURCE))
+endef
+
+# Note: firmware names are copied to binaries directory with an "m4_" prefix, for easier post image scripting
+
+ifeq ($(BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX7),y)
+IMX_M4_DEMOS_VERSION = 1.0.1
+IMX_M4_DEMOS_SOURCE = imx7d-sabresd-m4-freertos-$(IMX_M4_DEMOS_VERSION).bin
+IMX_M4_DEMOS_INSTALL_IMAGES = YES
+define IMX_M4_DEMOS_INSTALL_IMAGES_CMDS
+	cp $(@D)/imx7d_sabresd_m4_TCM_helloworld.bin $(BINARIES_DIR)/m4_imx7d_sabresd_m4_TCM_helloworld.bin
+	cp $(@D)/imx7d_sabresd_m4_TCM_mcctty.bin $(BINARIES_DIR)/m4_imx7d_sabresd_m4_TCM_mcctty.bin
+	cp $(@D)/imx7d_sabresd_m4_TCM_Pingpang.bin $(BINARIES_DIR)/m4_imx7d_sabresd_m4_TCM_Pingpang.bin
+endef
+else ifeq ($(BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX7ULP),y)
+IMX_M4_DEMOS_VERSION = 2.8.0
+IMX_M4_DEMOS_SOURCE = imx7ulp-m4-demo-$(IMX_M4_DEMOS_VERSION).bin
+IMX_M4_DEMOS_INSTALL_IMAGES = YES
+define IMX_M4_DEMOS_INSTALL_IMAGES_CMDS
+	cp $(@D)/imx7ulp_erpc_matrix_multiply_rpmsg_rtos_imxcm4.img $(BINARIES_DIR)/m4_imx7ulp_erpc_matrix_multiply_rpmsg_rtos_imxcm4.img
+	cp $(@D)/imx7ulp_m4_demo.img $(BINARIES_DIR)/m4_imx7ulp_m4_demo.img
+	cp $(@D)/imx7ulp_rpmsg_lite_pingpong_rtos.img $(BINARIES_DIR)/m4_imx7ulp_rpmsg_lite_pingpong_rtos.img
+	cp $(@D)/imx7ulp_rpmsg_lite_str_echo_rtos.img $(BINARIES_DIR)/m4_imx7ulp_rpmsg_lite_str_echo_rtos.img
+	cp $(@D)/imx7ulp_wireless_uart_bridge.img $(BINARIES_DIR)/m4_imx7ulp_wireless_uart_bridge.img
+endef
+else ifeq ($(BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8),y)
+IMX_M4_DEMOS_VERSION = 2.8.0
+IMX_M4_DEMOS_SOURCE = imx8qm-m4-demo-$(IMX_M4_DEMOS_VERSION).bin
+IMX_M4_DEMOS_INSTALL_IMAGES = YES
+define IMX_M4_DEMOS_INSTALL_IMAGES_CMDS
+	cp $(@D)/imx8qm_m4_0_TCM_hello_world_m40.bin $(BINARIES_DIR)/m4_imx8qm_m4_0_TCM_hello_world_m40.bin
+	cp $(@D)/imx8qm_m4_0_TCM_power_mode_switch_m40.bin $(BINARIES_DIR)/m4_imx8qm_m4_0_TCM_power_mode_switch_m40.bin
+	cp $(@D)/imx8qm_m4_0_TCM_rpmsg_lite_pingpong_rtos_linux_remote_m40.bin $(BINARIES_DIR)/m4_imx8qm_m4_0_TCM_rpmsg_lite_pingpong_rtos_linux_remote_m40.bin
+	cp $(@D)/imx8qm_m4_0_TCM_rpmsg_lite_str_echo_rtos_m40.bin $(BINARIES_DIR)/m4_imx8qm_m4_0_TCM_rpmsg_lite_str_echo_rtos_m40.bin
+	cp $(@D)/imx8qm_m4_1_TCM_hello_world_m41.bin $(BINARIES_DIR)/m4_imx8qm_m4_1_TCM_hello_world_m41.bin
+	cp $(@D)/imx8qm_m4_1_TCM_power_mode_switch_m41.bin $(BINARIES_DIR)/m4_imx8qm_m4_1_TCM_power_mode_switch_m41.bin
+	cp $(@D)/imx8qm_m4_1_TCM_rpmsg_lite_pingpong_rtos_linux_remote_m41.bin $(BINARIES_DIR)/m4_imx8qm_m4_1_TCM_rpmsg_lite_pingpong_rtos_linux_remote_m41.bin
+	cp $(@D)/imx8qm_m4_1_TCM_rpmsg_lite_str_echo_rtos_m41.bin $(BINARIES_DIR)/m4_imx8qm_m4_1_TCM_rpmsg_lite_str_echo_rtos_m41.bin
+endef
+else ifeq ($(BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8M),y)
+IMX_M4_DEMOS_VERSION = 2.3.0
+IMX_M4_DEMOS_SOURCE = imx8mq-m4-demo-$(IMX_M4_DEMOS_VERSION).bin
+IMX_M4_DEMOS_INSTALL_IMAGES = YES
+define IMX_M4_DEMOS_INSTALL_IMAGES_CMDS
+	cp $(@D)/imx8mq_m4_TCM_hello_world.bin $(BINARIES_DIR)/m4_imx8mq_m4_TCM_hello_world.bin
+	cp $(@D)/imx8mq_m4_TCM_rpmsg_lite_pingpong_rtos_linux_remote.bin $(BINARIES_DIR)/m4_imx8mq_m4_TCM_rpmsg_lite_pingpong_rtos_linux_remote.bin
+	cp $(@D)/imx8mq_m4_TCM_rpmsg_lite_str_echo_rtos.bin $(BINARIES_DIR)/m4_imx8mq_m4_TCM_rpmsg_lite_str_echo_rtos.bin
+endef
+else ifeq ($(BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8MM),y)
+IMX_M4_DEMOS_VERSION = 2.5.0
+IMX_M4_DEMOS_SOURCE = imx8mm-m4-demo-$(IMX_M4_DEMOS_VERSION).bin
+IMX_M4_DEMOS_INSTALL_IMAGES = YES
+define IMX_M4_DEMOS_INSTALL_IMAGES_CMDS
+	cp $(@D)/imx8mm_m4_TCM_hello_world.bin $(BINARIES_DIR)/m4_imx8mm_m4_TCM_hello_world.bin
+	cp $(@D)/imx8mm_m4_TCM_rpmsg_lite_pingpong_rtos_linux_remote.bin $(BINARIES_DIR)/m4_imx8mm_m4_TCM_rpmsg_lite_pingpong_rtos_linux_remote.bin
+	cp $(@D)/imx8mm_m4_TCM_rpmsg_lite_str_echo_rtos.bin $(BINARIES_DIR)/m4_imx8mm_m4_TCM_rpmsg_lite_str_echo_rtos.bin
+	cp $(@D)/imx8mm_m4_TCM_sai_low_power_audio.bin $(BINARIES_DIR)/m4_imx8mm_m4_TCM_sai_low_power_audio.bin
+endef
+else ifeq ($(BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8MN),y)
+IMX_M4_DEMOS_VERSION = 2.8.0
+IMX_M4_DEMOS_SOURCE = imx8mn-m7-demo-$(IMX_M4_DEMOS_VERSION).bin
+IMX_M4_DEMOS_INSTALL_IMAGES = YES
+define IMX_M4_DEMOS_INSTALL_IMAGES_CMDS
+	cp $(@D)/imx8mn_m7_TCM_rpmsg_lite_str_echo_rtos.bin $(BINARIES_DIR)/m4_imx8mn_m7_TCM_rpmsg_lite_str_echo_rtos.bin
+	cp $(@D)/imx8mn_m7_TCM_hello_world.bin $(BINARIES_DIR)/m4_imx8mn_m7_TCM_hello_world.bin
+	cp $(@D)/imx8mn_m7_TCM_sai_low_power_audio.bin $(BINARIES_DIR)/m4_imx8mn_m7_TCM_sai_low_power_audio.bin
+	cp $(@D)/imx8mn_m7_TCM_rpmsg_lite_pingpong_rtos_linux_remote.bin $(BINARIES_DIR)/m4_imx8mn_m7_TCM_rpmsg_lite_pingpong_rtos_linux_remote.bin
+endef
+else ifeq ($(BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8X),y)
+IMX_M4_DEMOS_VERSION = 2.8.0

package/freescale-imx/imx-m4-demos/imx-m4-demos.mk line 93

Quoted 10 lines
package/freescale-imx/imx-m4-demos/imx-m4-demos.mk new file +10 -0
+IMX_M4_DEMOS_SOURCE = imx8qx-m4-demo-$(IMX_M4_DEMOS_VERSION).bin
+IMX_M4_DEMOS_INSTALL_IMAGES = YES
+define IMX_M4_DEMOS_INSTALL_IMAGES_CMDS
+	cp $(@D)/imx8qx_m4_TCM_hello_world.bin $(BINARIES_DIR)/m4_imx8qx_m4_TCM_hello_world.bin
+	cp $(@D)/imx8qx_m4_TCM_power_mode_switch.bin $(BINARIES_DIR)/m4_imx8qx_m4_TCM_power_mode_switch.bin
+	cp $(@D)/imx8qx_m4_TCM_rpmsg_lite_pingpong_rtos_linux_remote.bin $(BINARIES_DIR)/m4_imx8qx_m4_TCM_rpmsg_lite_pingpong_rtos_linux_remote.bin
+	cp $(@D)/imx8qx_m4_TCM_rpmsg_lite_str_echo_rtos.bin $(BINARIES_DIR)/m4_imx8qx_m4_TCM_rpmsg_lite_str_echo_rtos.bin
+	cp $(@D)/imx8qx_m4_TCM_srtm_demo.bin $(BINARIES_DIR)/m4_imx8qx_m4_TCM_srtm_demo.bin
+endef
+endif

Isn't it possible to factorize the code a little? Feels like there is a lot of duplication for little differences.

Regards,
Gary

#3 lore raw

PATCH 1/2 package/freescale-imx/imx-m4-demos: new package

Hi Gary,

Thanks for your comments!

Quoted 15 lines · gary.bisson at boundarydevices.com

Hi Fabrice,

Thanks for your contribution! I have a few questions below.

Quoted 10 lines · Fabrice Goucem

New package to download and install i.MX Cortex-M4 demos for following SoCs:
* i.MX7D
* i.MX7ULP
* i.MX8M
* i.MX8MM
* i.MX8MN
* i.MX8QM
* i.MX8QXP

Quoted 5 lines
Quoted 2 lines

Yocto recipes from where the demos location has been extracted:
https://source.codeaurora.org/external/imx/meta-fsl-bsp-release/tree/imx/meta-sdk/recipes-fsl/m4-demos?h=imx-morty&id=bfb1e26798775f161b14218ac6f1d50069bea8ed

Why using such an old release? Why not latest GA from NXP?
https://source.codeaurora.org/external/imx/meta-imx/tree/meta-sdk/recipes-fsl/m4-demos?h=zeus-5.4.24-2.1.0

Sorry, out of date link from my previous version which was based on 4.19.35. As you realised later in your review, my recipe has been updated with the newer version of those packages.

Quoted 96 lines
Quoted 96 lines
---
 DEVELOPERS                                    |  1 +
 board/freescale/common/imx/post-image.sh      | 14 ++-
 package/freescale-imx/Config.in               | 10 ++
 package/freescale-imx/imx-m4-demos/Config.in  | 11 +++
 .../imx-m4-demos/imx-m4-demos.hash            | 10 ++
 .../imx-m4-demos/imx-m4-demos.mk              | 95
+++++++++++++++++++
 6 files changed, 140 insertions(+), 1 deletion(-)
 create mode 100644 package/freescale-imx/imx-m4-demos/Config.in
 create mode 100644 package/freescale-imx/imx-m4-demos/imx-m4-
demos.hash
 create mode 100644 package/freescale-imx/imx-m4-demos/imx-m4-

demos.mk

DEVELOPERS +1 -0
index ee840dbb8b..5e24b55167 100644
@@ -908,6 +908,7 @@ F:	package/whois/
 N:	Fabrice Goucem <[email protected]>
 F:	board/freescale/imx6ullevk/
 F:	configs/freescale_imx6ullevk_defconfig
+F:	package/freescale-imx/imx-m4-demos/
 
 N:	Falco Hyfing <[email protected]>
 F:	package/python-pymodbus/
board/freescale/common/imx/post-image.sh +2 -0
index 06ccaac3a4..4ac7ae09f8 100755
@@ -30,6 +30,18 @@ linux_image()
 	fi
 }
 
+#
+# m4_image prints all available M4 demo file names for the

genimage

board/freescale/common/imx/post-image.sh +7 -0
+# configuration file
+#
+m4_image()
+{
+	if grep -Eq "^BR2_PACKAGE_IMX_M4_DEMOS=y$" ${BR2_CONFIG}; then
+		echo -n ", "
+		for f in $(ls ${BINARIES_DIR}/m4_*); do echo -n

"$(basename $f), "; done

board/freescale/common/imx/post-image.sh +3 -0
+	fi
+}
+
 genimage_type()
 {
 	if grep -Eq "^BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8=y$"

${BR2_CONFIG}; then

board/freescale/common/imx/post-image.sh +1 -1
@@ -79,7 +91,7 @@ uboot_image()
 
 main()
 {
-	local FILES="$(dtb_list) $(linux_image)"
+	local FILES="$(dtb_list) $(linux_image) $(m4_image)"
 	local IMXOFFSET="$(imx_offset)"
 	local UBOOTBIN="$(uboot_image)"
 	local GENIMAGE_CFG="$(mktemp --suffix genimage.cfg)"
package/freescale- renamed from package/freescale-imx/Config.in +0 -0

imx/Config.in
index b0c7de8436..b95de54f4c 100644

package/freescale-imx/Config.in +10 -0
@@ -96,10 +96,20 @@ config BR2_PACKAGE_FREESCALE_IMX_HAS_VIV_GPU
 		BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8MN || \
 		BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8X
 
+config BR2_PACKAGE_FREESCALE_IMX_HAS_M4
+	bool
+	default y if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX7 || \
+		BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8 || \
+		BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8M || \
+		BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8MM || \
+		BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8MN || \
+		BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8X
+
 source "package/freescale-imx/imx-alsa-plugins/Config.in"
 source "package/freescale-imx/imx-codec/Config.in"
 source "package/freescale-imx/imx-kobs/Config.in"
 source "package/freescale-imx/imx-lib/Config.in"
+source "package/freescale-imx/imx-m4-demos/Config.in"
 source "package/freescale-imx/imx-m4fwloader/Config.in"
 source "package/freescale-imx/imx-parser/Config.in"
 source "package/freescale-imx/imx-uuc/Config.in"
package/freescale-imx/imx-m4-demos/Config.in new file +0 -0
new file mode 100644
Quoted 8 lines

package/freescale-imx/imx-m4-demos/Config.in line 2

Quoted 6 lines

index 0000000000..b1cbebb74f

package/freescale-imx/imx-m4-demos/Config.in new file +2 -0
@@ -0,0 +1,11 @@
+comment "imx-m4-demos needs an i.MX platform with Cortex-M4"
+	depends on !BR2_PACKAGE_FREESCALE_IMX_HAS_M4

Maybe call it mcore like NXP, would be better IMO.

The package name for NXP Yocto releases is imx-m4-demos. But it is true that with the introduction of i.MX8MN, M4 is no longer accurate. I suppose I can change the package name to imx-mcore-demos and the various flags to use MCORE instead of M4.

Quoted 27 lines
Quoted 27 lines
package/freescale-imx/imx-m4-demos/Config.in new file +9 -0
+
+config BR2_PACKAGE_IMX_M4_DEMOS
+	bool "imx-m4-demos"
+	depends on BR2_PACKAGE_FREESCALE_IMX_HAS_M4
+	help
+	  Cortex-M4 demo blobs for the Freescale i.MX SoCs.
+
+	  This library is provided by Freescale as-is and doesn't have
+	  an upstream.
package/freescale-imx/imx-m4-demos/imx-m4-demos.hash new file +2 -0
new file mode 100644
index 0000000000..feda867952
@@ -0,0 +1,10 @@
+# locally computed
+sha256  cc00d3b936d49b2794a2a99e10129437e70caba3fd26b8379b8c50dd22

f73254 imx7d-sabresd-m4-freertos-1.0.1.bin
+sha256 a8fbe1180b3d20e933a410cd76e60baac7a9f54e8b2bae8b6b8a3e1af5 50eca6 imx7ulp-m4-demo-2.8.0.bin
+sha256 4e41e270506870e0fd2d53e3d69afdcf6d613d099b0da5c516a512944c 5c12c3 imx8mm-m4-demo-2.5.0.bin
+sha256 e877c7462b6ea87c498563842f42352d204eb28a65f35f7dc1fec643f8 4abb66 imx8mn-m7-demo-2.8.0.bin
+sha256 fd441e75395b0c6f90626c883ee8a93406b14e7d55adc7925116254394 bb7ad8 imx8mq-m4-demo-2.3.0.bin

Quoted 8 lines
Quoted 4 lines

+sha256 d06a636b84cd559483091cbdb07b5ce9e15a534bca31d4cb756b33b696 c2160b imx8qm-m4-demo-2.8.0.bin
+sha256 7800cdbebe07f426cdac50b0e295d64215164a767e79ca58bd917445c5 0e345f imx8qx-m4-demo-2.8.0.bin

I stand corrected, *some* platform use 2.8.0 which is the latest, why not all? IMO they should all be 2.8.0 except for imx7d that stays 1.0.1.

I will update i.MX8MM and i.MX8MQ to use 2.8.0 too.

Quoted 151 lines
Quoted 151 lines

+# no hash for license file as it is different for each package listed above

package/freescale-imx/imx-m4-demos/imx-m4-demos.mk new file +1 -0
new file mode 100644
index 0000000000..d331ef9b69
@@ -0,0 +1,95 @@
+##################################################################

##############

package/freescale-imx/imx-m4-demos/imx-m4-demos.mk new file +4 -0
+#
+# imx-m4-demos
+#
+##################################################################

##############

package/freescale-imx/imx-m4-demos/imx-m4-demos.mk new file +4 -0
+
+IMX_M4_DEMOS_SITE = $(FREESCALE_IMX_SITE)
+
+IMX_M4_DEMOS_LICENSE = NXP Semiconductor Software License

Agreement

package/freescale-imx/imx-m4-demos/imx-m4-demos.mk new file +5 -0
+IMX_M4_DEMOS_LICENSE_FILES = COPYING
+IMX_M4_DEMOS_REDISTRIBUTE = NO
+
+define IMX_M4_DEMOS_EXTRACT_CMDS
+	$(call

FREESCALE_IMX_EXTRACT_HELPER,$(IMX_M4_DEMOS_DL_DIR)/$(IMX_M4_DEMOS_ SOURCE))

package/freescale-imx/imx-m4-demos/imx-m4-demos.mk new file +3 -0
+endef
+
+# Note: firmware names are copied to binaries directory with an

"m4_" prefix, for easier post image scripting

package/freescale-imx/imx-m4-demos/imx-m4-demos.mk new file +4 -0
+
+ifeq ($(BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX7),y)
+IMX_M4_DEMOS_VERSION = 1.0.1
+IMX_M4_DEMOS_SOURCE = imx7d-sabresd-m4-freertos-

$(IMX_M4_DEMOS_VERSION).bin

package/freescale-imx/imx-m4-demos/imx-m4-demos.mk new file +3 -0
+IMX_M4_DEMOS_INSTALL_IMAGES = YES
+define IMX_M4_DEMOS_INSTALL_IMAGES_CMDS
+	cp $(@D)/imx7d_sabresd_m4_TCM_helloworld.bin

$(BINARIES_DIR)/m4_imx7d_sabresd_m4_TCM_helloworld.bin

package/freescale-imx/imx-m4-demos/imx-m4-demos.mk new file +1 -0
+	cp $(@D)/imx7d_sabresd_m4_TCM_mcctty.bin

$(BINARIES_DIR)/m4_imx7d_sabresd_m4_TCM_mcctty.bin

package/freescale-imx/imx-m4-demos/imx-m4-demos.mk new file +1 -0
+	cp $(@D)/imx7d_sabresd_m4_TCM_Pingpang.bin

$(BINARIES_DIR)/m4_imx7d_sabresd_m4_TCM_Pingpang.bin

package/freescale-imx/imx-m4-demos/imx-m4-demos.mk new file +7 -0
+endef
+else ifeq ($(BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX7ULP),y)
+IMX_M4_DEMOS_VERSION = 2.8.0
+IMX_M4_DEMOS_SOURCE = imx7ulp-m4-demo-$(IMX_M4_DEMOS_VERSION).bin
+IMX_M4_DEMOS_INSTALL_IMAGES = YES
+define IMX_M4_DEMOS_INSTALL_IMAGES_CMDS
+	cp $(@D)/imx7ulp_erpc_matrix_multiply_rpmsg_rtos_imxcm4.img

$(BINARIES_DIR)/m4_imx7ulp_erpc_matrix_multiply_rpmsg_rtos_imxcm4.i mg

package/freescale-imx/imx-m4-demos/imx-m4-demos.mk new file +1 -0
+	cp $(@D)/imx7ulp_m4_demo.img

$(BINARIES_DIR)/m4_imx7ulp_m4_demo.img

package/freescale-imx/imx-m4-demos/imx-m4-demos.mk new file +1 -0
+	cp $(@D)/imx7ulp_rpmsg_lite_pingpong_rtos.img

$(BINARIES_DIR)/m4_imx7ulp_rpmsg_lite_pingpong_rtos.img

package/freescale-imx/imx-m4-demos/imx-m4-demos.mk new file +1 -0
+	cp $(@D)/imx7ulp_rpmsg_lite_str_echo_rtos.img

$(BINARIES_DIR)/m4_imx7ulp_rpmsg_lite_str_echo_rtos.img

package/freescale-imx/imx-m4-demos/imx-m4-demos.mk new file +1 -0
+	cp $(@D)/imx7ulp_wireless_uart_bridge.img

$(BINARIES_DIR)/m4_imx7ulp_wireless_uart_bridge.img

package/freescale-imx/imx-m4-demos/imx-m4-demos.mk new file +7 -0
+endef
+else ifeq ($(BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8),y)
+IMX_M4_DEMOS_VERSION = 2.8.0
+IMX_M4_DEMOS_SOURCE = imx8qm-m4-demo-$(IMX_M4_DEMOS_VERSION).bin
+IMX_M4_DEMOS_INSTALL_IMAGES = YES
+define IMX_M4_DEMOS_INSTALL_IMAGES_CMDS
+	cp $(@D)/imx8qm_m4_0_TCM_hello_world_m40.bin

$(BINARIES_DIR)/m4_imx8qm_m4_0_TCM_hello_world_m40.bin

package/freescale-imx/imx-m4-demos/imx-m4-demos.mk new file +1 -0
+	cp $(@D)/imx8qm_m4_0_TCM_power_mode_switch_m40.bin

$(BINARIES_DIR)/m4_imx8qm_m4_0_TCM_power_mode_switch_m40.bin

package/freescale-imx/imx-m4-demos/imx-m4-demos.mk new file +1 -0
+	cp

$(@D)/imx8qm_m4_0_TCM_rpmsg_lite_pingpong_rtos_linux_remote_m40.bin $(BINARIES_DIR)/m4_imx8qm_m4_0_TCM_rpmsg_lite_pingpong_rtos_linux_r emote_m40.bin

package/freescale-imx/imx-m4-demos/imx-m4-demos.mk new file +1 -0
+	cp $(@D)/imx8qm_m4_0_TCM_rpmsg_lite_str_echo_rtos_m40.bin

$(BINARIES_DIR)/m4_imx8qm_m4_0_TCM_rpmsg_lite_str_echo_rtos_m40.bin

package/freescale-imx/imx-m4-demos/imx-m4-demos.mk new file +1 -0
+	cp $(@D)/imx8qm_m4_1_TCM_hello_world_m41.bin

$(BINARIES_DIR)/m4_imx8qm_m4_1_TCM_hello_world_m41.bin

package/freescale-imx/imx-m4-demos/imx-m4-demos.mk new file +1 -0
+	cp $(@D)/imx8qm_m4_1_TCM_power_mode_switch_m41.bin

$(BINARIES_DIR)/m4_imx8qm_m4_1_TCM_power_mode_switch_m41.bin

package/freescale-imx/imx-m4-demos/imx-m4-demos.mk new file +1 -0
+	cp

$(@D)/imx8qm_m4_1_TCM_rpmsg_lite_pingpong_rtos_linux_remote_m41.bin $(BINARIES_DIR)/m4_imx8qm_m4_1_TCM_rpmsg_lite_pingpong_rtos_linux_r emote_m41.bin

package/freescale-imx/imx-m4-demos/imx-m4-demos.mk new file +1 -0
+	cp $(@D)/imx8qm_m4_1_TCM_rpmsg_lite_str_echo_rtos_m41.bin

$(BINARIES_DIR)/m4_imx8qm_m4_1_TCM_rpmsg_lite_str_echo_rtos_m41.bin

package/freescale-imx/imx-m4-demos/imx-m4-demos.mk new file +7 -0
+endef
+else ifeq ($(BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8M),y)
+IMX_M4_DEMOS_VERSION = 2.3.0
+IMX_M4_DEMOS_SOURCE = imx8mq-m4-demo-$(IMX_M4_DEMOS_VERSION).bin
+IMX_M4_DEMOS_INSTALL_IMAGES = YES
+define IMX_M4_DEMOS_INSTALL_IMAGES_CMDS
+	cp $(@D)/imx8mq_m4_TCM_hello_world.bin

$(BINARIES_DIR)/m4_imx8mq_m4_TCM_hello_world.bin

package/freescale-imx/imx-m4-demos/imx-m4-demos.mk new file +1 -0
+	cp

$(@D)/imx8mq_m4_TCM_rpmsg_lite_pingpong_rtos_linux_remote.bin $(BINARIES_DIR)/m4_imx8mq_m4_TCM_rpmsg_lite_pingpong_rtos_linux_rem ote.bin

package/freescale-imx/imx-m4-demos/imx-m4-demos.mk new file +1 -0
+	cp $(@D)/imx8mq_m4_TCM_rpmsg_lite_str_echo_rtos.bin

$(BINARIES_DIR)/m4_imx8mq_m4_TCM_rpmsg_lite_str_echo_rtos.bin

package/freescale-imx/imx-m4-demos/imx-m4-demos.mk new file +7 -0
+endef
+else ifeq ($(BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8MM),y)
+IMX_M4_DEMOS_VERSION = 2.5.0
+IMX_M4_DEMOS_SOURCE = imx8mm-m4-demo-$(IMX_M4_DEMOS_VERSION).bin
+IMX_M4_DEMOS_INSTALL_IMAGES = YES
+define IMX_M4_DEMOS_INSTALL_IMAGES_CMDS
+	cp $(@D)/imx8mm_m4_TCM_hello_world.bin

$(BINARIES_DIR)/m4_imx8mm_m4_TCM_hello_world.bin

package/freescale-imx/imx-m4-demos/imx-m4-demos.mk new file +1 -0
+	cp

$(@D)/imx8mm_m4_TCM_rpmsg_lite_pingpong_rtos_linux_remote.bin $(BINARIES_DIR)/m4_imx8mm_m4_TCM_rpmsg_lite_pingpong_rtos_linux_rem ote.bin

package/freescale-imx/imx-m4-demos/imx-m4-demos.mk new file +1 -0
+	cp $(@D)/imx8mm_m4_TCM_rpmsg_lite_str_echo_rtos.bin

$(BINARIES_DIR)/m4_imx8mm_m4_TCM_rpmsg_lite_str_echo_rtos.bin

package/freescale-imx/imx-m4-demos/imx-m4-demos.mk new file +1 -0
+	cp $(@D)/imx8mm_m4_TCM_sai_low_power_audio.bin

$(BINARIES_DIR)/m4_imx8mm_m4_TCM_sai_low_power_audio.bin

package/freescale-imx/imx-m4-demos/imx-m4-demos.mk new file +7 -0
+endef
+else ifeq ($(BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8MN),y)
+IMX_M4_DEMOS_VERSION = 2.8.0
+IMX_M4_DEMOS_SOURCE = imx8mn-m7-demo-$(IMX_M4_DEMOS_VERSION).bin
+IMX_M4_DEMOS_INSTALL_IMAGES = YES
+define IMX_M4_DEMOS_INSTALL_IMAGES_CMDS
+	cp $(@D)/imx8mn_m7_TCM_rpmsg_lite_str_echo_rtos.bin

$(BINARIES_DIR)/m4_imx8mn_m7_TCM_rpmsg_lite_str_echo_rtos.bin

package/freescale-imx/imx-m4-demos/imx-m4-demos.mk new file +1 -0
+	cp $(@D)/imx8mn_m7_TCM_hello_world.bin

$(BINARIES_DIR)/m4_imx8mn_m7_TCM_hello_world.bin

package/freescale-imx/imx-m4-demos/imx-m4-demos.mk new file +1 -0
+	cp $(@D)/imx8mn_m7_TCM_sai_low_power_audio.bin

$(BINARIES_DIR)/m4_imx8mn_m7_TCM_sai_low_power_audio.bin

package/freescale-imx/imx-m4-demos/imx-m4-demos.mk new file +1 -0
+	cp

$(@D)/imx8mn_m7_TCM_rpmsg_lite_pingpong_rtos_linux_remote.bin $(BINARIES_DIR)/m4_imx8mn_m7_TCM_rpmsg_lite_pingpong_rtos_linux_rem ote.bin

package/freescale-imx/imx-m4-demos/imx-m4-demos.mk new file +7 -0
+endef
+else ifeq ($(BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8X),y)
+IMX_M4_DEMOS_VERSION = 2.8.0
+IMX_M4_DEMOS_SOURCE = imx8qx-m4-demo-$(IMX_M4_DEMOS_VERSION).bin
+IMX_M4_DEMOS_INSTALL_IMAGES = YES
+define IMX_M4_DEMOS_INSTALL_IMAGES_CMDS
+	cp $(@D)/imx8qx_m4_TCM_hello_world.bin

$(BINARIES_DIR)/m4_imx8qx_m4_TCM_hello_world.bin

package/freescale-imx/imx-m4-demos/imx-m4-demos.mk new file +1 -0
+	cp $(@D)/imx8qx_m4_TCM_power_mode_switch.bin

$(BINARIES_DIR)/m4_imx8qx_m4_TCM_power_mode_switch.bin

package/freescale-imx/imx-m4-demos/imx-m4-demos.mk new file +1 -0
+	cp

$(@D)/imx8qx_m4_TCM_rpmsg_lite_pingpong_rtos_linux_remote.bin $(BINARIES_DIR)/m4_imx8qx_m4_TCM_rpmsg_lite_pingpong_rtos_linux_rem ote.bin

package/freescale-imx/imx-m4-demos/imx-m4-demos.mk new file +1 -0
+	cp $(@D)/imx8qx_m4_TCM_rpmsg_lite_str_echo_rtos.bin

$(BINARIES_DIR)/m4_imx8qx_m4_TCM_rpmsg_lite_str_echo_rtos.bin

Quoted 8 lines

package/freescale-imx/imx-m4-demos/imx-m4-demos.mk

Quoted 4 lines
package/freescale-imx/imx-m4-demos/imx-m4-demos.mk new file +1 -0
+	cp $(@D)/imx8qx_m4_TCM_srtm_demo.bin

$(BINARIES_DIR)/m4_imx8qx_m4_TCM_srtm_demo.bin

package/freescale-imx/imx-m4-demos/imx-m4-demos.mk new file +2 -0
+endef
+endif

Isn't it possible to factorize the code a little? Feels like there is a
lot of duplication for little differences.

This is correct. My problem was that the fw names are different for all chips, with variable consistency with file extensions (.img vs .bin). This was way (even if tedious) to tie the recipe to a imx-m4-demos pakage version. I can certainly change that to use wildcards.

Quoted 3 lines

Regards,
Gary