All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v5 0/3] i.MX91 and i.MX93 support
@ 2024-02-08 12:54 Sébastien Szymanski
  2024-02-08 12:54 ` [Buildroot] [PATCH v5 1/3] package/freescale-imx: add i.MX91 and i.MX93 SoC support Sébastien Szymanski
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Sébastien Szymanski @ 2024-02-08 12:54 UTC (permalink / raw)
  To: buildroot
  Cc: Gary Bisson, Fabio Estevam, Refik Tuzakli, Thomas Petazzoni,
	Giulio Benetti

This series adds i.MX91, i.MX93 and i.MX93 11x11 EVK to Buildroot.

---
Changes for v5:
- follow BR coding style for the genimage.cfg.template_imx9 file
  (Giulio Benetti)

Changes for v4:
 - "i.MX platform asic version" -> "i.MX Silicon Revision" (Gary Bisson)
 - move i.MX Silicon Revision changes into first patch (Gary Bisson)
 - BR2_PACKAGE_FIRMWARE_IMX_DDR_VERSION default to "v202201" instead of
   just "202201" (Gary Bisson)
 - Copy all DDR files to $(BINARIES_DIR) as U-Boot can now create a
   bootable image:
   https://source.denx.de/u-boot/u-boot/-/commit/f637dfe8c468229c9fb313d13c46d51cdbb88824
 - remove "pmu_train" from generated _pad binary file names

Changes for v3:
 - rename package firmware-sentinel to firmware-ele-imx
 - add a note about the debug UART in the readme.txt file (Julien Olivain)
 - add BR2_TARGET_UBOOT_NEEDS_OPENSSL=y and
   BR2_TARGET_UBOOT_NEEDS_GNUTLS=y to the defconfig file (Julien Olivain)
 - bump ATF, U-Boot and Linux to latest NXP release lf-6.1.55-2.2.0
   (Julien Olivain)

Changes for v2:
 - patch 1 of v1 has been applied
 - move SoC asic version selection to package/freescale-imx/Config.in
 - minor fixes in latest patch

---
Sébastien Szymanski (3):
      package/freescale-imx: add i.MX91 and i.MX93 SoC support
      package/freescale-imx/firmware-ele-imx: new package
      configs/freescale_imx93evk: new defconfig

 .../common/imx/genimage.cfg.template_imx9          | 42 ++++++++++++
 .../common/imx/imx9-bootloader-prepare.sh          | 34 ++++++++++
 board/freescale/common/imx/post-image.sh           |  4 ++
 board/freescale/imx93evk/readme.txt                | 77 ++++++++++++++++++++++
 configs/freescale_imx93evk_defconfig               | 39 +++++++++++
 package/freescale-imx/Config.in                    | 38 +++++++++++
 package/freescale-imx/firmware-ele-imx/Config.in   | 21 ++++++
 .../firmware-ele-imx/firmware-ele-imx.hash         |  4 ++
 .../firmware-ele-imx/firmware-ele-imx.mk           | 27 ++++++++
 package/freescale-imx/firmware-imx/Config.in       |  9 +++
 package/freescale-imx/firmware-imx/firmware-imx.mk | 25 +++++++
 11 files changed, 320 insertions(+)
---
base-commit: ae5274dd545eb011f18cae24331300d944b8be0f
change-id: 20240115-imx93-support-16671b5b7f12

Best regards,
-- 
Sébastien Szymanski <sebastien.szymanski@armadeus.com>
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Buildroot] [PATCH v5 1/3] package/freescale-imx: add i.MX91 and i.MX93 SoC support
  2024-02-08 12:54 [Buildroot] [PATCH v5 0/3] i.MX91 and i.MX93 support Sébastien Szymanski
@ 2024-02-08 12:54 ` Sébastien Szymanski
  2024-02-08 22:36   ` Arnout Vandecappelle via buildroot
  2024-02-12 21:46   ` Arnout Vandecappelle via buildroot
  2024-02-08 12:54 ` [Buildroot] [PATCH v5 2/3] package/freescale-imx/firmware-ele-imx: new package Sébastien Szymanski
  2024-02-08 12:54 ` [Buildroot] [PATCH v5 3/3] configs/freescale_imx93evk: new defconfig Sébastien Szymanski
  2 siblings, 2 replies; 14+ messages in thread
From: Sébastien Szymanski @ 2024-02-08 12:54 UTC (permalink / raw)
  To: buildroot
  Cc: Gary Bisson, Fabio Estevam, Refik Tuzakli, Thomas Petazzoni,
	Giulio Benetti

This commit adds i.MX91 and i.MX93 support to Buildroot.
https://www.nxp.com/products/processors-and-microcontrollers/arm-processors/i-mx-applications-processors/i-mx-9-processors:IMX9-PROCESSORS

There is no i.MX95 software provided by NXP at the moment that's why
i.MX95 is left behind.

Adapt package firmware-imx for the LPPDR4 firwmares binaries.

Reviewed-by: Gary Bisson <bisson.gary@gmail.com>
Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
---
Changes for v5:
 - none

Changes for v4
 - move i.MX Silicon Revision changes into this patch (Gary Bisson)
 - BR2_PACKAGE_FIRMWARE_IMX_DDR_VERSION default to "v202201" instead of
   just "202201" (Gary Bisson)
 - Copy all DDR files to $(BINARIES_DIR) as U-Boot can now create a
   bootable image:
   https://source.denx.de/u-boot/u-boot/-/commit/f637dfe8c468229c9fb313d13c46d51cdbb88824
 - remove "pmu_train" from generated _pad binary file names

Changes for v3:
 - none

Changes for v2:
 - none
---
 package/freescale-imx/Config.in                    | 37 ++++++++++++++++++++++
 package/freescale-imx/firmware-imx/Config.in       |  9 ++++++
 package/freescale-imx/firmware-imx/firmware-imx.mk | 25 +++++++++++++++
 3 files changed, 71 insertions(+)

diff --git a/package/freescale-imx/Config.in b/package/freescale-imx/Config.in
index 1c26b3cc6f4c..ba169ead18cb 100644
--- a/package/freescale-imx/Config.in
+++ b/package/freescale-imx/Config.in
@@ -61,6 +61,41 @@ config BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8X
 config BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8DXL
 	bool "imx8dxl"
 
+config BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91
+	bool "imx91"
+
+config BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93
+	bool "imx93"
+
+endchoice
+
+choice
+	prompt "i.MX Silicon Revision"
+	default BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91A1 \
+		if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91
+	default BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93A1 \
+		if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93
+	depends on BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91 || \
+		BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93
+	help
+	  Some packages related to the selected i.MX platform need to know the
+	  silicon revision of the platform they will run on.
+	  If you don't know, leave the default value.
+
+	  Note - mismatches may result in a failure to boot!
+
+config BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91A1
+	bool "imx91a1"
+	depends on BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91
+
+config BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93A0
+	bool "imx93a0"
+	depends on BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93
+
+config BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93A1
+	bool "imx93a1"
+	depends on BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93
+
 endchoice
 
 config BR2_PACKAGE_FREESCALE_IMX_PLATFORM
@@ -80,6 +115,8 @@ config BR2_PACKAGE_FREESCALE_IMX_PLATFORM
 	default "IMX8MM" if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8MM
 	default "IMX8MN" if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8MN
 	default "IMX8MP" if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8MP
+	default "IMX91" if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91
+	default "IMX93" if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93
 
 config BR2_PACKAGE_FREESCALE_IMX_HAS_VPU
 	bool
diff --git a/package/freescale-imx/firmware-imx/Config.in b/package/freescale-imx/firmware-imx/Config.in
index 087ddef8771b..d83b5e129a9f 100644
--- a/package/freescale-imx/firmware-imx/Config.in
+++ b/package/freescale-imx/firmware-imx/Config.in
@@ -55,6 +55,8 @@ config BR2_PACKAGE_FIRMWARE_IMX_NEEDS_DDR_FW
 	default y if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8MM
 	default y if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8MN
 	default y if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8MP
+	default y if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91
+	default y if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93
 
 if BR2_PACKAGE_FIRMWARE_IMX_NEEDS_DDR_FW
 
@@ -73,11 +75,15 @@ config BR2_PACKAGE_FIRMWARE_IMX_LPDDR4
 
 config BR2_PACKAGE_FIRMWARE_IMX_DDR4
 	bool "DDR4"
+	depends on !BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91
+	depends on !BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93
 	help
 	  Use DDR4 binaries (i.e.: ddr4_*_201810.bin).
 
 config BR2_PACKAGE_FIRMWARE_IMX_DDR3
 	bool "DDR3"
+	depends on !BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91
+	depends on !BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93
 	help
 	  Use DDR3 binaries (i.e.: ddr3_*_201810.bin).
 
@@ -89,6 +95,9 @@ config BR2_PACKAGE_FIRMWARE_IMX_DDR_VERSION
 	# unconditionally use HW version 201810 when DDR3/DDR4 was
 	# selected
 	default "201810" if BR2_PACKAGE_FIRMWARE_IMX_DDR3 || BR2_PACKAGE_FIRMWARE_IMX_DDR4
+	default "v202201" if \
+		BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91 || \
+		BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93
 	help
 	  Use a specific version of the imx ddr binaries. Leaving this
 	  field empty will select the default version.
diff --git a/package/freescale-imx/firmware-imx/firmware-imx.mk b/package/freescale-imx/firmware-imx/firmware-imx.mk
index 66ef8c3930be..1f36f917cdc8 100644
--- a/package/freescale-imx/firmware-imx/firmware-imx.mk
+++ b/package/freescale-imx/firmware-imx/firmware-imx.mk
@@ -48,6 +48,30 @@ endif
 ifeq ($(BR2_PACKAGE_FIRMWARE_IMX_LPDDR4),y)
 FIRMWARE_IMX_DDRFW_DIR = $(@D)/firmware/ddr/synopsys
 
+ifeq ($(BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91)$(BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93),y)
+define FIRMWARE_IMX_INSTALL_IMAGE_DDR_FW
+	# Create padded versions of lpddr4_{d,i}mem_{1,2}d_* and generate lpddr4_fw.bin.
+	# lpddr4_fw.bin is needed when generating imx9-boot-sd.bin
+	# which is done in post-image script.
+	$(call FIRMWARE_IMX_PREPARE_DDR_FW, \
+		lpddr4_imem_1d$(FIRMWARE_IMX_DDR_VERSION_SUFFIX),
+		lpddr4_dmem_1d$(FIRMWARE_IMX_DDR_VERSION_SUFFIX),
+		lpddr4_1d_fw)
+	$(call FIRMWARE_IMX_PREPARE_DDR_FW, \
+		lpddr4_imem_2d$(FIRMWARE_IMX_DDR_VERSION_SUFFIX),
+		lpddr4_dmem_2d$(FIRMWARE_IMX_DDR_VERSION_SUFFIX),
+		lpddr4_2d_fw)
+	cat $(FIRMWARE_IMX_DDRFW_DIR)/lpddr4_1d_fw.bin \
+		$(FIRMWARE_IMX_DDRFW_DIR)/lpddr4_2d_fw.bin > \
+		$(BINARIES_DIR)/lpddr4_fw.bin
+	ln -sf $(BINARIES_DIR)/lpddr4_fw.bin $(BINARIES_DIR)/ddr_fw.bin
+
+	# U-Boot supports creation of the combined flash.bin image. To make
+	# sure that U-Boot can access all available files copy them to
+	# the binary dir.
+	cp $(FIRMWARE_IMX_DDRFW_DIR)/lpddr4*.bin $(BINARIES_DIR)/
+endef
+else
 define FIRMWARE_IMX_INSTALL_IMAGE_DDR_FW
 	# Create padded versions of lpddr4_pmu_* and generate lpddr4_pmu_train_fw.bin.
 	# lpddr4_pmu_train_fw.bin is needed when generating imx8-boot-sd.bin
@@ -71,6 +95,7 @@ define FIRMWARE_IMX_INSTALL_IMAGE_DDR_FW
 	cp $(FIRMWARE_IMX_DDRFW_DIR)/lpddr4*.bin $(BINARIES_DIR)/
 endef
 endif
+endif
 
 ifeq ($(BR2_PACKAGE_FIRMWARE_IMX_DDR4),y)
 FIRMWARE_IMX_DDRFW_DIR = $(@D)/firmware/ddr/synopsys

-- 
2.43.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [Buildroot] [PATCH v5 2/3] package/freescale-imx/firmware-ele-imx: new package
  2024-02-08 12:54 [Buildroot] [PATCH v5 0/3] i.MX91 and i.MX93 support Sébastien Szymanski
  2024-02-08 12:54 ` [Buildroot] [PATCH v5 1/3] package/freescale-imx: add i.MX91 and i.MX93 SoC support Sébastien Szymanski
@ 2024-02-08 12:54 ` Sébastien Szymanski
  2024-02-08 22:43   ` Arnout Vandecappelle via buildroot
  2024-02-12 21:46   ` Arnout Vandecappelle via buildroot
  2024-02-08 12:54 ` [Buildroot] [PATCH v5 3/3] configs/freescale_imx93evk: new defconfig Sébastien Szymanski
  2 siblings, 2 replies; 14+ messages in thread
From: Sébastien Szymanski @ 2024-02-08 12:54 UTC (permalink / raw)
  To: buildroot
  Cc: Gary Bisson, Fabio Estevam, Refik Tuzakli, Thomas Petazzoni,
	Giulio Benetti

This package provides firmware blobs for the Edgelock Secure
Enclave (ELE) [1] present on i.MX8ULP and i.MX9 Socs.
This version comes from the 6.1.55-2.2.0 release.

[1] https://www.nxp.com/products/nxp-product-information/nxp-product-programs/edgelock-secure-enclave:EDGELOCK-SECURE-ENCLAVE

Reviewed-by: Gary Bisson <bisson.gary@gmail.com>
Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
---
Changes for v5:
 - none

Changes for v4:
 - move i.MX Silicon Revision changes into first patch (Gary Bisson)

Changes for v3:
 - rename package from firmware-sentinel to package firmware-ele-imx

Changes for v2:
 - none
---
 package/freescale-imx/Config.in                    |  1 +
 package/freescale-imx/firmware-ele-imx/Config.in   | 21 +++++++++++++++++
 .../firmware-ele-imx/firmware-ele-imx.hash         |  4 ++++
 .../firmware-ele-imx/firmware-ele-imx.mk           | 27 ++++++++++++++++++++++
 4 files changed, 53 insertions(+)

diff --git a/package/freescale-imx/Config.in b/package/freescale-imx/Config.in
index ba169ead18cb..f12acc3bd024 100644
--- a/package/freescale-imx/Config.in
+++ b/package/freescale-imx/Config.in
@@ -154,6 +154,7 @@ source "package/freescale-imx/imx-uuc/Config.in"
 source "package/freescale-imx/imx-vpu/Config.in"
 source "package/freescale-imx/imx-vpu-hantro/Config.in"
 source "package/freescale-imx/imx-vpuwrap/Config.in"
+source "package/freescale-imx/firmware-ele-imx/Config.in"
 source "package/freescale-imx/firmware-imx/Config.in"
 source "package/freescale-imx/imx-sc-firmware/Config.in"
 source "package/freescale-imx/imx-seco/Config.in"
diff --git a/package/freescale-imx/firmware-ele-imx/Config.in b/package/freescale-imx/firmware-ele-imx/Config.in
new file mode 100644
index 000000000000..7867c3712c9c
--- /dev/null
+++ b/package/freescale-imx/firmware-ele-imx/Config.in
@@ -0,0 +1,21 @@
+config BR2_PACKAGE_FIRMWARE_ELE_IMX
+	bool "firmware-ele-imx"
+	depends on BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91 || \
+		BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93
+	help
+	  Firmware blobs for the Edgelock Secure Enclave (ELE)
+	  present on i.MX8ULP and i.MX9 SoCs.
+
+	  This library is provided by NXP as-is and doesn't have an
+	  upstream.
+
+if BR2_PACKAGE_FIRMWARE_ELE_IMX
+
+config BR2_PACKAGE_FIRMWARE_ELE_IMX_AHAB_CONTAINER_IMAGE
+	string
+	default "mx93a0-ahab-container.img" if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93A0
+	default "mx93a1-ahab-container.img" if \
+		BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91A1 || \
+		BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93A1
+
+endif # BR2_PACKAGE_FIRMWARE_ELE_IMX
diff --git a/package/freescale-imx/firmware-ele-imx/firmware-ele-imx.hash b/package/freescale-imx/firmware-ele-imx/firmware-ele-imx.hash
new file mode 100644
index 000000000000..58565cef43e9
--- /dev/null
+++ b/package/freescale-imx/firmware-ele-imx/firmware-ele-imx.hash
@@ -0,0 +1,4 @@
+# Locally calculated
+sha256  4a0440168d8dfb95989a17be8fafb149589e110e7d4518e5e8a33463dfb5e5ca  firmware-ele-imx-0.1.0.bin
+sha256  24d7cb3a7e51011466a149bd99acf89387b832be2d0890ce2e183dfbc9d7cb84  COPYING
+sha256  c800aaca3a7e9f470d99d7cde0a48c95982ed601d4c306f7b8f43f3710054f28  SCR.txt
diff --git a/package/freescale-imx/firmware-ele-imx/firmware-ele-imx.mk b/package/freescale-imx/firmware-ele-imx/firmware-ele-imx.mk
new file mode 100644
index 000000000000..600b50c5b456
--- /dev/null
+++ b/package/freescale-imx/firmware-ele-imx/firmware-ele-imx.mk
@@ -0,0 +1,27 @@
+################################################################################
+#
+# firmware-ele-imx
+#
+################################################################################
+
+FIRMWARE_ELE_IMX_VERSION = 0.1.0
+FIRMWARE_ELE_IMX_SITE = $(FREESCALE_IMX_SITE)
+FIRMWARE_ELE_IMX_SOURCE = firmware-ele-imx-$(FIRMWARE_ELE_IMX_VERSION).bin
+
+FIRMWARE_ELE_IMX_LICENSE = NXP Semiconductor Software License Agreement
+FIRMWARE_ELE_IMX_LICENSE_FILES = COPYING SCR.txt
+FIRMWARE_ELE_IMX_REDISTRIBUTE = NO
+
+FIRMWARE_ELE_IMX_INSTALL_IMAGES = YES
+
+define FIRMWARE_ELE_IMX_EXTRACT_CMDS
+	$(call NXP_EXTRACT_HELPER,$(FIRMWARE_ELE_IMX_DL_DIR)/$(FIRMWARE_ELE_IMX_SOURCE))
+endef
+
+FIRMWARE_ELE_IMX_AHAB_CONTAINER_IMAGE = $(call qstrip,$(BR2_PACKAGE_FIRMWARE_ELE_IMX_AHAB_CONTAINER_IMAGE))
+
+define FIRMWARE_ELE_IMX_INSTALL_IMAGES_CMDS
+	cp $(@D)/$(FIRMWARE_ELE_IMX_AHAB_CONTAINER_IMAGE) $(BINARIES_DIR)/ahab-container.img
+endef
+
+$(eval $(generic-package))

-- 
2.43.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [Buildroot] [PATCH v5 3/3] configs/freescale_imx93evk: new defconfig
  2024-02-08 12:54 [Buildroot] [PATCH v5 0/3] i.MX91 and i.MX93 support Sébastien Szymanski
  2024-02-08 12:54 ` [Buildroot] [PATCH v5 1/3] package/freescale-imx: add i.MX91 and i.MX93 SoC support Sébastien Szymanski
  2024-02-08 12:54 ` [Buildroot] [PATCH v5 2/3] package/freescale-imx/firmware-ele-imx: new package Sébastien Szymanski
@ 2024-02-08 12:54 ` Sébastien Szymanski
  2024-02-12 21:49   ` Arnout Vandecappelle via buildroot
  2 siblings, 1 reply; 14+ messages in thread
From: Sébastien Szymanski @ 2024-02-08 12:54 UTC (permalink / raw)
  To: buildroot
  Cc: Gary Bisson, Fabio Estevam, Refik Tuzakli, Julien Olivain,
	Thomas Petazzoni, Giulio Benetti

This patch adds support for the NXP i.MX 93 11x11 EVK board [1].

[1] https://www.nxp.com/design/development-boards/i-mx-evaluation-and-development-boards/i-mx-93-evaluation-kit:i.MX93EVK

Reviewed-by: Julien Olivain <ju.o@free.fr>
Tested-by: Julien Olivain <ju.o@free.fr>
[Julien: tested on NXP board i.MX93EVK, cpu rev A1, board rev B]
Reviewed-by: Gary Bisson <bisson.gary@gmail.com>
Reviewed-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
---
Changes for v5:
 - follow BR coding style for the genimage.cfg.template_imx9 file
   (Giulio Benetti)

Changes for v4:
 - None

Changes for v3:
 - BR2_PACKAGE_FIRMWARE_SENTINEL=y -> BR2_PACKAGE_FIRMWARE_ELE_IMX=y
 - add a note about the debug UART in the readme.txt file (Julien Olivain)
 - add BR2_TARGET_UBOOT_NEEDS_OPENSSL=y and
   BR2_TARGET_UBOOT_NEEDS_GNUTLS=y to the defconfig file (Julien Olivain)
 - bump ATF, U-Boot and Linux to latest NXP release lf-6.1.55-2.2.0
   (Julien Olivain)

Changes for v2:
 - none
---
 .../common/imx/genimage.cfg.template_imx9          | 42 ++++++++++++
 .../common/imx/imx9-bootloader-prepare.sh          | 34 ++++++++++
 board/freescale/common/imx/post-image.sh           |  4 ++
 board/freescale/imx93evk/readme.txt                | 77 ++++++++++++++++++++++
 configs/freescale_imx93evk_defconfig               | 39 +++++++++++
 5 files changed, 196 insertions(+)

diff --git a/board/freescale/common/imx/genimage.cfg.template_imx9 b/board/freescale/common/imx/genimage.cfg.template_imx9
new file mode 100644
index 000000000000..df7ddc25b73e
--- /dev/null
+++ b/board/freescale/common/imx/genimage.cfg.template_imx9
@@ -0,0 +1,42 @@
+# Minimal SD card image for the NXP i.MX9 boards
+#
+# We mimic the .sdcard NXP's image format:
+# * the SD card must have 32 kB free space at the beginning,
+# * U-Boot is integrated into imx9-boot-sd.bin and is dumped as is,
+# * a FAT partition at offset 8MB is containing Image and DTB files
+# * a single root filesystem partition is required (ext2, ext3 or ext4)
+#
+
+image boot.vfat {
+	vfat {
+		label = "boot"
+		files = {
+			%FILES%
+		}
+	}
+
+	size = 64M
+}
+
+image sdcard.img {
+	hdimage {
+	}
+
+	partition imx-boot {
+		in-partition-table = "no"
+		image = "imx9-boot-sd.bin"
+		offset = %IMXOFFSET%
+	}
+
+	partition boot {
+		partition-type = 0xC
+		bootable = "true"
+		image = "boot.vfat"
+		offset = 8M
+	}
+
+	partition rootfs {
+		partition-type = 0x83
+		image = "rootfs.ext2"
+	}
+}
diff --git a/board/freescale/common/imx/imx9-bootloader-prepare.sh b/board/freescale/common/imx/imx9-bootloader-prepare.sh
new file mode 100755
index 000000000000..4ff92fa4cd23
--- /dev/null
+++ b/board/freescale/common/imx/imx9-bootloader-prepare.sh
@@ -0,0 +1,34 @@
+#!/usr/bin/env bash
+
+main ()
+{
+	SPL_LOAD_ADDR=0x2049A000
+	ATF_LOAD_ADDR=0x204E0000
+	if grep -Eq "^BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91=y$" ${BR2_CONFIG}; then
+		SPL_LOAD_ADDR=0x204A0000
+		ATF_LOAD_ADDR=0x204C0000
+	fi
+
+	dd if=${BINARIES_DIR}/u-boot-spl.bin of=${BINARIES_DIR}/u-boot-spl-padded.bin bs=4 conv=sync
+	cat ${BINARIES_DIR}/u-boot-spl-padded.bin ${BINARIES_DIR}/ddr_fw.bin > ${BINARIES_DIR}/u-boot-spl-ddr.bin
+
+	${HOST_DIR}/bin/mkimage_imx8 -commit > ${BINARIES_DIR}/mkimg.commit
+        cat ${BINARIES_DIR}/u-boot.bin ${BINARIES_DIR}/mkimg.commit > ${BINARIES_DIR}/u-boot-hash.bin
+	rm -f ${BINARIES_DIR}/mkimg.commit
+
+	if grep -Eq "^BR2_TARGET_OPTEE_OS=y$" ${BR2_CONFIG}; then
+		${HOST_DIR}/bin/mkimage_imx8 -soc IMX9 -c -ap ${BINARIES_DIR}/bl31.bin a35 ${ATF_LOAD_ADDR} -ap ${BINARIES_DIR}/u-boot-hash.bin a35 0x80200000 -ap ${BINARIES_DIR}/tee.bin a35 0x96000000 -out ${BINARIES_DIR}/u-boot-atf-container.img
+	else
+		${HOST_DIR}/bin/mkimage_imx8 -soc IMX9 -c -ap ${BINARIES_DIR}/bl31.bin a35 ${ATF_LOAD_ADDR} -ap ${BINARIES_DIR}/u-boot-hash.bin a35 0x80200000 -out ${BINARIES_DIR}/u-boot-atf-container.img
+	fi
+
+	${HOST_DIR}/bin/mkimage_imx8 -soc IMX9 -append ${BINARIES_DIR}/ahab-container.img -c -ap ${BINARIES_DIR}/u-boot-spl-ddr.bin a35 ${SPL_LOAD_ADDR} -out ${BINARIES_DIR}/imx9-boot-sd.bin
+
+	flashbin_size=$(wc -c ${BINARIES_DIR}/imx9-boot-sd.bin | awk '{print $1}')
+	pad_cnt=$(($((flashbin_size + 0x400 - 1)) / 0x400))
+	dd if=${BINARIES_DIR}/u-boot-atf-container.img of=${BINARIES_DIR}/imx9-boot-sd.bin bs=1K seek=${pad_cnt}
+
+	exit $?
+}
+
+main $@
diff --git a/board/freescale/common/imx/post-image.sh b/board/freescale/common/imx/post-image.sh
index c359ef6032a6..3df7e820938b 100755
--- a/board/freescale/common/imx/post-image.sh
+++ b/board/freescale/common/imx/post-image.sh
@@ -48,6 +48,10 @@ genimage_type()
 		echo "genimage.cfg.template_imx8"
 	elif grep -Eq "^BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8DXL=y$" ${BR2_CONFIG}; then
 		echo "genimage.cfg.template_imx8"
+	elif grep -Eq "^BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91=y$" ${BR2_CONFIG}; then
+		echo "genimage.cfg.template_imx9"
+	elif grep -Eq "^BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93=y$" ${BR2_CONFIG}; then
+		echo "genimage.cfg.template_imx9"
 	elif grep -Eq "^BR2_LINUX_KERNEL_INSTALL_TARGET=y$" ${BR2_CONFIG}; then
 		if grep -Eq "^BR2_TARGET_UBOOT_SPL=y$" ${BR2_CONFIG}; then
 		    echo "genimage.cfg.template_no_boot_part_spl"
diff --git a/board/freescale/imx93evk/readme.txt b/board/freescale/imx93evk/readme.txt
new file mode 100644
index 000000000000..1173de39dbb1
--- /dev/null
+++ b/board/freescale/imx93evk/readme.txt
@@ -0,0 +1,77 @@
+*********************
+NXP i.MX93 EVK board
+*********************
+
+This file documents the Buildroot support for the i.MX 93 EVK board.
+
+Build
+=====
+
+First, configure Buildroot for the i.MX 93 EVK board:
+
+  make freescale_imx93evk_defconfig
+
+Build all components:
+
+  make
+
+You will find in output/images/ the following files:
+  - ahab-container.img
+  - bl31.bin
+  - boot.vfat
+  - ddr_fw.bin
+  - Image
+  - imx93-11x11-evk.dtb
+  - imx9-boot-sd.bin
+  - lpddr4_pmu_train_fw.bin
+  - rootfs.ext2
+  - rootfs.ext4
+  - rootfs.tar
+  - sdcard.img
+  - u-boot-atf-container.img
+  - u-boot.bin
+  - u-boot-hash.bin
+  - u-boot-spl.bin
+  - u-boot-spl-ddr.bin
+  - u-boot-spl-padded.bin
+
+Create a bootable SD card
+=========================
+
+To determine the device associated to the SD card have a look in the
+/proc/partitions file:
+
+  cat /proc/partitions
+
+Buildroot prepares a bootable "sdcard.img" image in the output/images/
+directory, ready to be dumped on a SD card. Launch the following
+command as root:
+
+  dd if=output/images/sdcard.img of=/dev/<your-sd-device>
+
+*** WARNING! This will destroy all the card content. Use with care! ***
+
+For details about the medium image layout, see the definition in
+board/freescale/common/imx/genimage.cfg.template_imx9.
+
+Boot the i.MX 93 EVK board
+===============================
+
+To boot your newly created system (refer to the i.MX 93 EVK Documentation
+[1] for guidance):
+- insert the SD card in the SD slot of the board;
+- Configure the switches as follows:
+SW1301: 0100 SW1301[1-4]
+- put a micro USB cable into the Debug USB Port and connect using a terminal
+  emulator at 115200 bps, 8n1;
+- power on the board.
+
+Note: the debug USB connector presents 4 UARTs (for example /dev/ttyUSB[0-3]),
+the Cortex-A55 UART should be the 3rd one (in the previous example, /dev/ttyUSB2).
+Refer to the documentation [1] for more details.
+
+Enjoy!
+
+References
+==========
+[1] https://www.nxp.com/document/guide/getting-started-with-the-i-mx93-evk:GS-IMX93EVK
diff --git a/configs/freescale_imx93evk_defconfig b/configs/freescale_imx93evk_defconfig
new file mode 100644
index 000000000000..34baf04c88db
--- /dev/null
+++ b/configs/freescale_imx93evk_defconfig
@@ -0,0 +1,39 @@
+BR2_aarch64=y
+BR2_cortex_a55=y
+BR2_ARM_FPU_VFPV4D16=y
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_1=y
+BR2_TARGET_GENERIC_GETTY_PORT="ttyLP0"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/imx/imx9-bootloader-prepare.sh board/freescale/common/imx/post-image.sh"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
+BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,nxp-imx,linux-imx,lf-6.1.55-2.2.0)/linux-imx-lf-6.1.55-2.2.0.tar.gz"
+BR2_LINUX_KERNEL_DEFCONFIG="imx_v8"
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="freescale/imx93-11x11-evk"
+BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
+BR2_PACKAGE_FREESCALE_IMX=y
+BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93=y
+BR2_PACKAGE_FIRMWARE_ELE_IMX=y
+BR2_PACKAGE_FIRMWARE_IMX=y
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_TARGET_ROOTFS_EXT2_SIZE="120M"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE=y
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_TARBALL=y
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_TARBALL_LOCATION="$(call github,nxp-imx,imx-atf,lf-6.1.55-2.2.0)/imx-atf-lf-6.1.55-2.2.0.tar.gz"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="imx93"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL31=y
+BR2_TARGET_UBOOT=y
+BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
+BR2_TARGET_UBOOT_CUSTOM_TARBALL=y
+BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="$(call github,nxp-imx,uboot-imx,lf-6.1.55-2.2.0)/uboot-imx-lf-6.1.55-2.2.0.tar.gz"
+BR2_TARGET_UBOOT_BOARD_DEFCONFIG="imx93_11x11_evk"
+BR2_TARGET_UBOOT_NEEDS_DTC=y
+BR2_TARGET_UBOOT_NEEDS_OPENSSL=y
+BR2_TARGET_UBOOT_NEEDS_GNUTLS=y
+BR2_TARGET_UBOOT_SPL=y
+BR2_PACKAGE_HOST_DOSFSTOOLS=y
+BR2_PACKAGE_HOST_GENIMAGE=y
+BR2_PACKAGE_HOST_IMX_MKIMAGE=y
+BR2_PACKAGE_HOST_MTOOLS=y
+BR2_PACKAGE_HOST_UBOOT_TOOLS=y

-- 
2.43.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [Buildroot] [PATCH v5 1/3] package/freescale-imx: add i.MX91 and i.MX93 SoC support
  2024-02-08 12:54 ` [Buildroot] [PATCH v5 1/3] package/freescale-imx: add i.MX91 and i.MX93 SoC support Sébastien Szymanski
@ 2024-02-08 22:36   ` Arnout Vandecappelle via buildroot
  2024-02-08 22:39     ` Arnout Vandecappelle via buildroot
  2024-02-09  9:29     ` Sébastien Szymanski
  2024-02-12 21:46   ` Arnout Vandecappelle via buildroot
  1 sibling, 2 replies; 14+ messages in thread
From: Arnout Vandecappelle via buildroot @ 2024-02-08 22:36 UTC (permalink / raw)
  To: Sébastien Szymanski, buildroot
  Cc: Refik Tuzakli, Giulio Benetti, Fabio Estevam, Thomas Petazzoni,
	Gary Bisson

  Hi Sébastien,

  It's no fun that I still have questions on v5, but unfortunately...

On 08/02/2024 13:54, Sébastien Szymanski wrote:
> This commit adds i.MX91 and i.MX93 support to Buildroot.
> https://www.nxp.com/products/processors-and-microcontrollers/arm-processors/i-mx-applications-processors/i-mx-9-processors:IMX9-PROCESSORS
> 
> There is no i.MX95 software provided by NXP at the moment that's why
> i.MX95 is left behind.
> 
> Adapt package firmware-imx for the LPPDR4 firwmares binaries.
> 
> Reviewed-by: Gary Bisson <bisson.gary@gmail.com>
> Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com>

[snip]
> +config BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91
> +	bool "imx91"
> +
> +config BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93
> +	bool "imx93"
> +
> +endchoice
> +
> +choice
> +	prompt "i.MX Silicon Revision"
> +	default BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91A1 \
> +		if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91
> +	default BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93A1 \
> +		if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93
> +	depends on BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91 || \
> +		BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93
> +	help
> +	  Some packages related to the selected i.MX platform need to know the
> +	  silicon revision of the platform they will run on.
> +	  If you don't know, leave the default value.
> +
> +	  Note - mismatches may result in a failure to boot!

  This sentence conflicts with "If you don't know, leave the default value"... 
So I think that "If you don't know" sentence should be dropped.

> +
> +config BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91A1
> +	bool "imx91a1"
> +	depends on BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91

  Since for IMX91 there is only one option, I think it makes more sense to not 
offer a choice for this. Just always use this one for the IMX91. We can still 
add it back if there ever turns out to be an imx91a2.

> +
> +config BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93A0
> +	bool "imx93a0"
> +	depends on BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93
> +
> +config BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93A1
> +	bool "imx93a1"
> +	depends on BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93
> +
>   endchoice
>   

[snip]
> @@ -89,6 +95,9 @@ config BR2_PACKAGE_FIRMWARE_IMX_DDR_VERSION
>   	# unconditionally use HW version 201810 when DDR3/DDR4 was
>   	# selected
>   	default "201810" if BR2_PACKAGE_FIRMWARE_IMX_DDR3 || BR2_PACKAGE_FIRMWARE_IMX_DDR4
> +	default "v202201" if \

  For the time being, there is only one version for the IMX91/3. So it makes no 
sense to give an option for it. (In fact, this really should have been a choice 
instead of a string option because there are only a fixed set of options... But 
that's a separate topic.)

  By the way, do these SoCs use the plain 202006 version for DDR4 like the other 
SoCs? And do they also support DDR3?

> +		BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91 || \
> +		BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93
>   	help
>   	  Use a specific version of the imx ddr binaries. Leaving this
>   	  field empty will select the default version.
> diff --git a/package/freescale-imx/firmware-imx/firmware-imx.mk b/package/freescale-imx/firmware-imx/firmware-imx.mk
> index 66ef8c3930be..1f36f917cdc8 100644
> --- a/package/freescale-imx/firmware-imx/firmware-imx.mk
> +++ b/package/freescale-imx/firmware-imx/firmware-imx.mk
> @@ -48,6 +48,30 @@ endif
>   ifeq ($(BR2_PACKAGE_FIRMWARE_IMX_LPDDR4),y)
>   FIRMWARE_IMX_DDRFW_DIR = $(@D)/firmware/ddr/synopsys
>   
> +ifeq ($(BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91)$(BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93),y)

  To make the conditions more symmetrical/regular, perhaps it's better to create 
a new BR2_PACKAGE_FIRMWARE_IMX_LPDDR4_IMX9X option and encode the platform 
conditions there. The prompt would be the same for 
BR2_PACKAGE_FIRMWARE_IMX_LPDDR4 and for BR2_PACKAGE_FIRMWARE_IMX_LPDDR4_IMX9X 
("lpddr4" for both).  But perhaps I'm overthinking things.

> +define FIRMWARE_IMX_INSTALL_IMAGE_DDR_FW
> +	# Create padded versions of lpddr4_{d,i}mem_{1,2}d_* and generate lpddr4_fw.bin.
> +	# lpddr4_fw.bin is needed when generating imx9-boot-sd.bin
> +	# which is done in post-image script.
> +	$(call FIRMWARE_IMX_PREPARE_DDR_FW, \
> +		lpddr4_imem_1d$(FIRMWARE_IMX_DDR_VERSION_SUFFIX),
> +		lpddr4_dmem_1d$(FIRMWARE_IMX_DDR_VERSION_SUFFIX),

  So the v202201 could be hardcoded here.

> +		lpddr4_1d_fw)
> +	$(call FIRMWARE_IMX_PREPARE_DDR_FW, \
> +		lpddr4_imem_2d$(FIRMWARE_IMX_DDR_VERSION_SUFFIX),
> +		lpddr4_dmem_2d$(FIRMWARE_IMX_DDR_VERSION_SUFFIX),
> +		lpddr4_2d_fw)
> +	cat $(FIRMWARE_IMX_DDRFW_DIR)/lpddr4_1d_fw.bin \
> +		$(FIRMWARE_IMX_DDRFW_DIR)/lpddr4_2d_fw.bin > \
> +		$(BINARIES_DIR)/lpddr4_fw.bin
> +	ln -sf $(BINARIES_DIR)/lpddr4_fw.bin $(BINARIES_DIR)/ddr_fw.bin
> +
> +	# U-Boot supports creation of the combined flash.bin image. To make
> +	# sure that U-Boot can access all available files copy them to
> +	# the binary dir.
> +	cp $(FIRMWARE_IMX_DDRFW_DIR)/lpddr4*.bin $(BINARIES_DIR)/

  We now have 3 instances of this exact same code block with only the file names 
that differ, so perhaps it's time to factor this into a second helper function. 
Or better, define a few auxiliary variables FIRMWARE_IMX_DDRFW_IMEM_1D, 
FIRMWARE_IMX_DDRFW_DMEM_1D etc that are set for each variant, and then one 
definition of FIRMWARE_IMX_INSTALL_IMAGE_DDR_FW that uses those variables.

  If that sounds too complex, don't worry, it's just a "niceification" so not 
really necessary to do.

  In fact, the only of my comments above that is really important is dropping 
BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91A1.

  Regards,
  Arnout

> +endef
> +else
>   define FIRMWARE_IMX_INSTALL_IMAGE_DDR_FW
>   	# Create padded versions of lpddr4_pmu_* and generate lpddr4_pmu_train_fw.bin.
>   	# lpddr4_pmu_train_fw.bin is needed when generating imx8-boot-sd.bin
> @@ -71,6 +95,7 @@ define FIRMWARE_IMX_INSTALL_IMAGE_DDR_FW
>   	cp $(FIRMWARE_IMX_DDRFW_DIR)/lpddr4*.bin $(BINARIES_DIR)/
>   endef
>   endif
> +endif
>   
>   ifeq ($(BR2_PACKAGE_FIRMWARE_IMX_DDR4),y)
>   FIRMWARE_IMX_DDRFW_DIR = $(@D)/firmware/ddr/synopsys
> 
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Buildroot] [PATCH v5 1/3] package/freescale-imx: add i.MX91 and i.MX93 SoC support
  2024-02-08 22:36   ` Arnout Vandecappelle via buildroot
@ 2024-02-08 22:39     ` Arnout Vandecappelle via buildroot
  2024-02-09  9:29     ` Sébastien Szymanski
  1 sibling, 0 replies; 14+ messages in thread
From: Arnout Vandecappelle via buildroot @ 2024-02-08 22:39 UTC (permalink / raw)
  To: Sébastien Szymanski, buildroot
  Cc: Refik Tuzakli, Giulio Benetti, Fabio Estevam, Thomas Petazzoni,
	Gary Bisson


On 08/02/2024 23:36, Arnout Vandecappelle wrote:
>  To make the conditions more symmetrical/regular, perhaps it's better to 
> create a new BR2_PACKAGE_FIRMWARE_IMX_LPDDR4_IMX9X option and encode the 
> platform conditions there. The prompt would be the same for 
> BR2_PACKAGE_FIRMWARE_IMX_LPDDR4 and for BR2_PACKAGE_FIRMWARE_IMX_LPDDR4_IMX9X 
> ("lpddr4" for both).  But perhaps I'm overthinking things. 

  That would be BR2_PACKAGE_FIRMWARE_IMX_LPDDR4_IMX9, not IMX9X.


  Regards,
  Arnout


_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Buildroot] [PATCH v5 2/3] package/freescale-imx/firmware-ele-imx: new package
  2024-02-08 12:54 ` [Buildroot] [PATCH v5 2/3] package/freescale-imx/firmware-ele-imx: new package Sébastien Szymanski
@ 2024-02-08 22:43   ` Arnout Vandecappelle via buildroot
  2024-02-09  9:34     ` Sébastien Szymanski
  2024-02-12 21:46   ` Arnout Vandecappelle via buildroot
  1 sibling, 1 reply; 14+ messages in thread
From: Arnout Vandecappelle via buildroot @ 2024-02-08 22:43 UTC (permalink / raw)
  To: Sébastien Szymanski, buildroot
  Cc: Refik Tuzakli, Giulio Benetti, Fabio Estevam, Thomas Petazzoni,
	Gary Bisson



On 08/02/2024 13:54, Sébastien Szymanski wrote:
> This package provides firmware blobs for the Edgelock Secure
> Enclave (ELE) [1] present on i.MX8ULP and i.MX9 Socs.
> This version comes from the 6.1.55-2.2.0 release.
> 
> [1] https://www.nxp.com/products/nxp-product-information/nxp-product-programs/edgelock-secure-enclave:EDGELOCK-SECURE-ENCLAVE
> 
> Reviewed-by: Gary Bisson <bisson.gary@gmail.com>
> Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
> ---
> Changes for v5:
>   - none
> 
> Changes for v4:
>   - move i.MX Silicon Revision changes into first patch (Gary Bisson)
> 
> Changes for v3:
>   - rename package from firmware-sentinel to package firmware-ele-imx
> 
> Changes for v2:
>   - none
> ---
>   package/freescale-imx/Config.in                    |  1 +
>   package/freescale-imx/firmware-ele-imx/Config.in   | 21 +++++++++++++++++
>   .../firmware-ele-imx/firmware-ele-imx.hash         |  4 ++++
>   .../firmware-ele-imx/firmware-ele-imx.mk           | 27 ++++++++++++++++++++++
>   4 files changed, 53 insertions(+)
> 
> diff --git a/package/freescale-imx/Config.in b/package/freescale-imx/Config.in
> index ba169ead18cb..f12acc3bd024 100644
> --- a/package/freescale-imx/Config.in
> +++ b/package/freescale-imx/Config.in
> @@ -154,6 +154,7 @@ source "package/freescale-imx/imx-uuc/Config.in"
>   source "package/freescale-imx/imx-vpu/Config.in"
>   source "package/freescale-imx/imx-vpu-hantro/Config.in"
>   source "package/freescale-imx/imx-vpuwrap/Config.in"
> +source "package/freescale-imx/firmware-ele-imx/Config.in"
>   source "package/freescale-imx/firmware-imx/Config.in"
>   source "package/freescale-imx/imx-sc-firmware/Config.in"
>   source "package/freescale-imx/imx-seco/Config.in"
> diff --git a/package/freescale-imx/firmware-ele-imx/Config.in b/package/freescale-imx/firmware-ele-imx/Config.in
> new file mode 100644
> index 000000000000..7867c3712c9c
> --- /dev/null
> +++ b/package/freescale-imx/firmware-ele-imx/Config.in
> @@ -0,0 +1,21 @@
> +config BR2_PACKAGE_FIRMWARE_ELE_IMX
> +	bool "firmware-ele-imx"
> +	depends on BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91 || \
> +		BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93
> +	help
> +	  Firmware blobs for the Edgelock Secure Enclave (ELE)

  ELE, not ELSE? Weird...

> +	  present on i.MX8ULP and i.MX9 SoCs.

  I guess we simply don't have support for i.MX8ULP yet in Buildroot?

  Perhaps it's better to create a BR2_PACKAGE_FREESCALE_IMX_HAS_ELE option in 
freescale-imx/Config.in

> +
> +	  This library is provided by NXP as-is and doesn't have an
> +	  upstream.
> +
> +if BR2_PACKAGE_FIRMWARE_ELE_IMX
> +
> +config BR2_PACKAGE_FIRMWARE_ELE_IMX_AHAB_CONTAINER_IMAGE
> +	string
> +	default "mx93a0-ahab-container.img" if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93A0
> +	default "mx93a1-ahab-container.img" if \
> +		BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91A1 || \

  So i.MX91 uses the mx93 image? Weird...

  Regards,
  Arnout


> +		BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93A1
> +
> +endif # BR2_PACKAGE_FIRMWARE_ELE_IMX
> diff --git a/package/freescale-imx/firmware-ele-imx/firmware-ele-imx.hash b/package/freescale-imx/firmware-ele-imx/firmware-ele-imx.hash
> new file mode 100644
> index 000000000000..58565cef43e9
> --- /dev/null
> +++ b/package/freescale-imx/firmware-ele-imx/firmware-ele-imx.hash
> @@ -0,0 +1,4 @@
> +# Locally calculated
> +sha256  4a0440168d8dfb95989a17be8fafb149589e110e7d4518e5e8a33463dfb5e5ca  firmware-ele-imx-0.1.0.bin
> +sha256  24d7cb3a7e51011466a149bd99acf89387b832be2d0890ce2e183dfbc9d7cb84  COPYING
> +sha256  c800aaca3a7e9f470d99d7cde0a48c95982ed601d4c306f7b8f43f3710054f28  SCR.txt
> diff --git a/package/freescale-imx/firmware-ele-imx/firmware-ele-imx.mk b/package/freescale-imx/firmware-ele-imx/firmware-ele-imx.mk
> new file mode 100644
> index 000000000000..600b50c5b456
> --- /dev/null
> +++ b/package/freescale-imx/firmware-ele-imx/firmware-ele-imx.mk
> @@ -0,0 +1,27 @@
> +################################################################################
> +#
> +# firmware-ele-imx
> +#
> +################################################################################
> +
> +FIRMWARE_ELE_IMX_VERSION = 0.1.0
> +FIRMWARE_ELE_IMX_SITE = $(FREESCALE_IMX_SITE)
> +FIRMWARE_ELE_IMX_SOURCE = firmware-ele-imx-$(FIRMWARE_ELE_IMX_VERSION).bin
> +
> +FIRMWARE_ELE_IMX_LICENSE = NXP Semiconductor Software License Agreement
> +FIRMWARE_ELE_IMX_LICENSE_FILES = COPYING SCR.txt
> +FIRMWARE_ELE_IMX_REDISTRIBUTE = NO
> +
> +FIRMWARE_ELE_IMX_INSTALL_IMAGES = YES
> +
> +define FIRMWARE_ELE_IMX_EXTRACT_CMDS
> +	$(call NXP_EXTRACT_HELPER,$(FIRMWARE_ELE_IMX_DL_DIR)/$(FIRMWARE_ELE_IMX_SOURCE))
> +endef
> +
> +FIRMWARE_ELE_IMX_AHAB_CONTAINER_IMAGE = $(call qstrip,$(BR2_PACKAGE_FIRMWARE_ELE_IMX_AHAB_CONTAINER_IMAGE))
> +
> +define FIRMWARE_ELE_IMX_INSTALL_IMAGES_CMDS
> +	cp $(@D)/$(FIRMWARE_ELE_IMX_AHAB_CONTAINER_IMAGE) $(BINARIES_DIR)/ahab-container.img
> +endef
> +
> +$(eval $(generic-package))
> 
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Buildroot] [PATCH v5 1/3] package/freescale-imx: add i.MX91 and i.MX93 SoC support
  2024-02-08 22:36   ` Arnout Vandecappelle via buildroot
  2024-02-08 22:39     ` Arnout Vandecappelle via buildroot
@ 2024-02-09  9:29     ` Sébastien Szymanski
  2024-02-09 10:25       ` Arnout Vandecappelle via buildroot
  1 sibling, 1 reply; 14+ messages in thread
From: Sébastien Szymanski @ 2024-02-09  9:29 UTC (permalink / raw)
  To: Arnout Vandecappelle, buildroot
  Cc: Refik Tuzakli, Giulio Benetti, Fabio Estevam, Thomas Petazzoni,
	Gary Bisson

Hi Arnout,

On 2/8/24 23:36, Arnout Vandecappelle wrote:
>   Hi Sébastien,
> 
>   It's no fun that I still have questions on v5, but unfortunately...
> 
> On 08/02/2024 13:54, Sébastien Szymanski wrote:
>> This commit adds i.MX91 and i.MX93 support to Buildroot.
>> https://www.nxp.com/products/processors-and-microcontrollers/arm-processors/i-mx-applications-processors/i-mx-9-processors:IMX9-PROCESSORS
>>
>> There is no i.MX95 software provided by NXP at the moment that's why
>> i.MX95 is left behind.
>>
>> Adapt package firmware-imx for the LPPDR4 firwmares binaries.
>>
>> Reviewed-by: Gary Bisson <bisson.gary@gmail.com>
>> Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
> 
> [snip]
>> +config BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91
>> +    bool "imx91"
>> +
>> +config BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93
>> +    bool "imx93"
>> +
>> +endchoice
>> +
>> +choice
>> +    prompt "i.MX Silicon Revision"
>> +    default BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91A1 \
>> +        if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91
>> +    default BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93A1 \
>> +        if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93
>> +    depends on BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91 || \
>> +        BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93
>> +    help
>> +      Some packages related to the selected i.MX platform need to 
>> know the
>> +      silicon revision of the platform they will run on.
>> +      If you don't know, leave the default value.
>> +
>> +      Note - mismatches may result in a failure to boot!
> 
>   This sentence conflicts with "If you don't know, leave the default 
> value"... So I think that "If you don't know" sentence should be dropped.
> 

ok.

>> +
>> +config BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91A1
>> +    bool "imx91a1"
>> +    depends on BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91
> 
>   Since for IMX91 there is only one option, I think it makes more sense 
> to not offer a choice for this. Just always use this one for the IMX91. 
> We can still add it back if there ever turns out to be an imx91a2.
> 
>> +
>> +config BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93A0
>> +    bool "imx93a0"
>> +    depends on BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93
>> +
>> +config BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93A1
>> +    bool "imx93a1"
>> +    depends on BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93
>> +
>>   endchoice
> 
> [snip]
>> @@ -89,6 +95,9 @@ config BR2_PACKAGE_FIRMWARE_IMX_DDR_VERSION
>>       # unconditionally use HW version 201810 when DDR3/DDR4 was
>>       # selected
>>       default "201810" if BR2_PACKAGE_FIRMWARE_IMX_DDR3 || 
>> BR2_PACKAGE_FIRMWARE_IMX_DDR4
>> +    default "v202201" if \
> 
>   For the time being, there is only one version for the IMX91/3. So it 
> makes no sense to give an option for it. (In fact, this really should 
> have been a choice instead of a string option because there are only a 
> fixed set of options... But that's a separate topic.)
> 
>   By the way, do these SoCs use the plain 202006 version for DDR4 like 
> the other SoCs? And do they also support DDR3?

The i.MX9{1,3} SoCs don't support DDR4 and DDR3... Only LPDDR4 or 
LPDDR4X, hence my changes below BR2_PACKAGE_FIRMWARE_IMX_DDR{3,4} options.

> 
>> +        BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91 || \
>> +        BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93
>>       help
>>         Use a specific version of the imx ddr binaries. Leaving this
>>         field empty will select the default version.
>> diff --git a/package/freescale-imx/firmware-imx/firmware-imx.mk 
>> b/package/freescale-imx/firmware-imx/firmware-imx.mk
>> index 66ef8c3930be..1f36f917cdc8 100644
>> --- a/package/freescale-imx/firmware-imx/firmware-imx.mk
>> +++ b/package/freescale-imx/firmware-imx/firmware-imx.mk
>> @@ -48,6 +48,30 @@ endif
>>   ifeq ($(BR2_PACKAGE_FIRMWARE_IMX_LPDDR4),y)
>>   FIRMWARE_IMX_DDRFW_DIR = $(@D)/firmware/ddr/synopsys
>> +ifeq 
>> ($(BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91)$(BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93),y)
> 
>   To make the conditions more symmetrical/regular, perhaps it's better 
> to create a new BR2_PACKAGE_FIRMWARE_IMX_LPDDR4_IMX9X option and encode 
> the platform conditions there. The prompt would be the same for 
> BR2_PACKAGE_FIRMWARE_IMX_LPDDR4 and for 
> BR2_PACKAGE_FIRMWARE_IMX_LPDDR4_IMX9X ("lpddr4" for both).  But perhaps 
> I'm overthinking things.

I don't see the benefits to do so. Also, i.MX95 supports LPPDR5.

> 
>> +define FIRMWARE_IMX_INSTALL_IMAGE_DDR_FW
>> +    # Create padded versions of lpddr4_{d,i}mem_{1,2}d_* and generate 
>> lpddr4_fw.bin.
>> +    # lpddr4_fw.bin is needed when generating imx9-boot-sd.bin
>> +    # which is done in post-image script.
>> +    $(call FIRMWARE_IMX_PREPARE_DDR_FW, \
>> +        lpddr4_imem_1d$(FIRMWARE_IMX_DDR_VERSION_SUFFIX),
>> +        lpddr4_dmem_1d$(FIRMWARE_IMX_DDR_VERSION_SUFFIX),
> 
>   So the v202201 could be hardcoded here.
> 
>> +        lpddr4_1d_fw)
>> +    $(call FIRMWARE_IMX_PREPARE_DDR_FW, \
>> +        lpddr4_imem_2d$(FIRMWARE_IMX_DDR_VERSION_SUFFIX),
>> +        lpddr4_dmem_2d$(FIRMWARE_IMX_DDR_VERSION_SUFFIX),
>> +        lpddr4_2d_fw)
>> +    cat $(FIRMWARE_IMX_DDRFW_DIR)/lpddr4_1d_fw.bin \
>> +        $(FIRMWARE_IMX_DDRFW_DIR)/lpddr4_2d_fw.bin > \
>> +        $(BINARIES_DIR)/lpddr4_fw.bin
>> +    ln -sf $(BINARIES_DIR)/lpddr4_fw.bin $(BINARIES_DIR)/ddr_fw.bin
>> +
>> +    # U-Boot supports creation of the combined flash.bin image. To make
>> +    # sure that U-Boot can access all available files copy them to
>> +    # the binary dir.
>> +    cp $(FIRMWARE_IMX_DDRFW_DIR)/lpddr4*.bin $(BINARIES_DIR)/
> 
>   We now have 3 instances of this exact same code block with only the 
> file names that differ, so perhaps it's time to factor this into a 
> second helper function. Or better, define a few auxiliary variables 
> FIRMWARE_IMX_DDRFW_IMEM_1D, FIRMWARE_IMX_DDRFW_DMEM_1D etc that are set 
> for each variant, and then one definition of 
> FIRMWARE_IMX_INSTALL_IMAGE_DDR_FW that uses those variables.
> 
>   If that sounds too complex, don't worry, it's just a "niceification" 
> so not really necessary to do.

This should done be in a separated patch, right ?

> 
>   In fact, the only of my comments above that is really important is 
> dropping BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91A1.

ok !

Regards,

> 
>   Regards,
>   Arnout
> 
>> +endef
>> +else
>>   define FIRMWARE_IMX_INSTALL_IMAGE_DDR_FW
>>       # Create padded versions of lpddr4_pmu_* and generate 
>> lpddr4_pmu_train_fw.bin.
>>       # lpddr4_pmu_train_fw.bin is needed when generating 
>> imx8-boot-sd.bin
>> @@ -71,6 +95,7 @@ define FIRMWARE_IMX_INSTALL_IMAGE_DDR_FW
>>       cp $(FIRMWARE_IMX_DDRFW_DIR)/lpddr4*.bin $(BINARIES_DIR)/
>>   endef
>>   endif
>> +endif
>>   ifeq ($(BR2_PACKAGE_FIRMWARE_IMX_DDR4),y)
>>   FIRMWARE_IMX_DDRFW_DIR = $(@D)/firmware/ddr/synopsys
>>

-- 
Sébastien Szymanski, Armadeus Systems
Software engineer

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Buildroot] [PATCH v5 2/3] package/freescale-imx/firmware-ele-imx: new package
  2024-02-08 22:43   ` Arnout Vandecappelle via buildroot
@ 2024-02-09  9:34     ` Sébastien Szymanski
  0 siblings, 0 replies; 14+ messages in thread
From: Sébastien Szymanski @ 2024-02-09  9:34 UTC (permalink / raw)
  To: Arnout Vandecappelle, buildroot
  Cc: Refik Tuzakli, Giulio Benetti, Fabio Estevam, Thomas Petazzoni,
	Gary Bisson

Hi Arnout,

On 2/8/24 23:43, Arnout Vandecappelle wrote:
> 
> 
> On 08/02/2024 13:54, Sébastien Szymanski wrote:
>> This package provides firmware blobs for the Edgelock Secure
>> Enclave (ELE) [1] present on i.MX8ULP and i.MX9 Socs.
>> This version comes from the 6.1.55-2.2.0 release.
>>
>> [1] 
>> https://www.nxp.com/products/nxp-product-information/nxp-product-programs/edgelock-secure-enclave:EDGELOCK-SECURE-ENCLAVE
>>
>> Reviewed-by: Gary Bisson <bisson.gary@gmail.com>
>> Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
>> ---
>> Changes for v5:
>>   - none
>>
>> Changes for v4:
>>   - move i.MX Silicon Revision changes into first patch (Gary Bisson)
>>
>> Changes for v3:
>>   - rename package from firmware-sentinel to package firmware-ele-imx
>>
>> Changes for v2:
>>   - none
>> ---
>>   package/freescale-imx/Config.in                    |  1 +
>>   package/freescale-imx/firmware-ele-imx/Config.in   | 21 
>> +++++++++++++++++
>>   .../firmware-ele-imx/firmware-ele-imx.hash         |  4 ++++
>>   .../firmware-ele-imx/firmware-ele-imx.mk           | 27 
>> ++++++++++++++++++++++
>>   4 files changed, 53 insertions(+)
>>
>> diff --git a/package/freescale-imx/Config.in 
>> b/package/freescale-imx/Config.in
>> index ba169ead18cb..f12acc3bd024 100644
>> --- a/package/freescale-imx/Config.in
>> +++ b/package/freescale-imx/Config.in
>> @@ -154,6 +154,7 @@ source "package/freescale-imx/imx-uuc/Config.in"
>>   source "package/freescale-imx/imx-vpu/Config.in"
>>   source "package/freescale-imx/imx-vpu-hantro/Config.in"
>>   source "package/freescale-imx/imx-vpuwrap/Config.in"
>> +source "package/freescale-imx/firmware-ele-imx/Config.in"
>>   source "package/freescale-imx/firmware-imx/Config.in"
>>   source "package/freescale-imx/imx-sc-firmware/Config.in"
>>   source "package/freescale-imx/imx-seco/Config.in"
>> diff --git a/package/freescale-imx/firmware-ele-imx/Config.in 
>> b/package/freescale-imx/firmware-ele-imx/Config.in
>> new file mode 100644
>> index 000000000000..7867c3712c9c
>> --- /dev/null
>> +++ b/package/freescale-imx/firmware-ele-imx/Config.in
>> @@ -0,0 +1,21 @@
>> +config BR2_PACKAGE_FIRMWARE_ELE_IMX
>> +    bool "firmware-ele-imx"
>> +    depends on BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91 || \
>> +        BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93
>> +    help
>> +      Firmware blobs for the Edgelock Secure Enclave (ELE)
> 
>   ELE, not ELSE? Weird...

Following NXP here...

> 
>> +      present on i.MX8ULP and i.MX9 SoCs.
> 
>   I guess we simply don't have support for i.MX8ULP yet in Buildroot?

Nope, not yet.

> 
>   Perhaps it's better to create a BR2_PACKAGE_FREESCALE_IMX_HAS_ELE 
> option in freescale-imx/Config.in
> 
>> +
>> +      This library is provided by NXP as-is and doesn't have an
>> +      upstream.
>> +
>> +if BR2_PACKAGE_FIRMWARE_ELE_IMX
>> +
>> +config BR2_PACKAGE_FIRMWARE_ELE_IMX_AHAB_CONTAINER_IMAGE
>> +    string
>> +    default "mx93a0-ahab-container.img" if 
>> BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93A0
>> +    default "mx93a1-ahab-container.img" if \
>> +        BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91A1 || \
> 
>   So i.MX91 uses the mx93 image? Weird...

Yes, there is no specific files for i.MX91 in the package.

Regards,

> 
>   Regards,
>   Arnout
> 
> 
>> +        BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93A1
>> +
>> +endif # BR2_PACKAGE_FIRMWARE_ELE_IMX
>> diff --git 
>> a/package/freescale-imx/firmware-ele-imx/firmware-ele-imx.hash 
>> b/package/freescale-imx/firmware-ele-imx/firmware-ele-imx.hash
>> new file mode 100644
>> index 000000000000..58565cef43e9
>> --- /dev/null
>> +++ b/package/freescale-imx/firmware-ele-imx/firmware-ele-imx.hash
>> @@ -0,0 +1,4 @@
>> +# Locally calculated
>> +sha256  
>> 4a0440168d8dfb95989a17be8fafb149589e110e7d4518e5e8a33463dfb5e5ca  
>> firmware-ele-imx-0.1.0.bin
>> +sha256  
>> 24d7cb3a7e51011466a149bd99acf89387b832be2d0890ce2e183dfbc9d7cb84  COPYING
>> +sha256  
>> c800aaca3a7e9f470d99d7cde0a48c95982ed601d4c306f7b8f43f3710054f28  SCR.txt
>> diff --git 
>> a/package/freescale-imx/firmware-ele-imx/firmware-ele-imx.mk 
>> b/package/freescale-imx/firmware-ele-imx/firmware-ele-imx.mk
>> new file mode 100644
>> index 000000000000..600b50c5b456
>> --- /dev/null
>> +++ b/package/freescale-imx/firmware-ele-imx/firmware-ele-imx.mk
>> @@ -0,0 +1,27 @@
>> +################################################################################
>> +#
>> +# firmware-ele-imx
>> +#
>> +################################################################################
>> +
>> +FIRMWARE_ELE_IMX_VERSION = 0.1.0
>> +FIRMWARE_ELE_IMX_SITE = $(FREESCALE_IMX_SITE)
>> +FIRMWARE_ELE_IMX_SOURCE = 
>> firmware-ele-imx-$(FIRMWARE_ELE_IMX_VERSION).bin
>> +
>> +FIRMWARE_ELE_IMX_LICENSE = NXP Semiconductor Software License Agreement
>> +FIRMWARE_ELE_IMX_LICENSE_FILES = COPYING SCR.txt
>> +FIRMWARE_ELE_IMX_REDISTRIBUTE = NO
>> +
>> +FIRMWARE_ELE_IMX_INSTALL_IMAGES = YES
>> +
>> +define FIRMWARE_ELE_IMX_EXTRACT_CMDS
>> +    $(call 
>> NXP_EXTRACT_HELPER,$(FIRMWARE_ELE_IMX_DL_DIR)/$(FIRMWARE_ELE_IMX_SOURCE))
>> +endef
>> +
>> +FIRMWARE_ELE_IMX_AHAB_CONTAINER_IMAGE = $(call 
>> qstrip,$(BR2_PACKAGE_FIRMWARE_ELE_IMX_AHAB_CONTAINER_IMAGE))
>> +
>> +define FIRMWARE_ELE_IMX_INSTALL_IMAGES_CMDS
>> +    cp $(@D)/$(FIRMWARE_ELE_IMX_AHAB_CONTAINER_IMAGE) 
>> $(BINARIES_DIR)/ahab-container.img
>> +endef
>> +
>> +$(eval $(generic-package))
>>

-- 
Sébastien Szymanski, Armadeus Systems
Software engineer

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Buildroot] [PATCH v5 1/3] package/freescale-imx: add i.MX91 and i.MX93 SoC support
  2024-02-09  9:29     ` Sébastien Szymanski
@ 2024-02-09 10:25       ` Arnout Vandecappelle via buildroot
  2024-02-09 11:09         ` Sébastien Szymanski
  0 siblings, 1 reply; 14+ messages in thread
From: Arnout Vandecappelle via buildroot @ 2024-02-09 10:25 UTC (permalink / raw)
  To: Sébastien Szymanski, buildroot
  Cc: Refik Tuzakli, Giulio Benetti, Fabio Estevam, Thomas Petazzoni,
	Gary Bisson



On 09/02/2024 10:29, Sébastien Szymanski wrote:
> Hi Arnout,
> 
> On 2/8/24 23:36, Arnout Vandecappelle wrote:
>>   Hi Sébastien,
>>
>>   It's no fun that I still have questions on v5, but unfortunately...

  I'll see this weekend if I can merge v5 with the feedback you give below. 
Unless you send a v6 before that of course!

[snip]
>>> +
>>> +config BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91A1
>>> +    bool "imx91a1"
>>> +    depends on BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91
>>
>>   Since for IMX91 there is only one option, I think it makes more sense to not 
>> offer a choice for this. Just always use this one for the IMX91. We can still 
>> add it back if there ever turns out to be an imx91a2.

  This is actually the main thing I wanted confirmation about from you... Do you 
agree that we only need the revision option for IMX93, not for IMX91?

>>
>>> +
>>> +config BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93A0
>>> +    bool "imx93a0"
>>> +    depends on BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93
>>> +
>>> +config BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93A1
>>> +    bool "imx93a1"
>>> +    depends on BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93
>>> +
>>>   endchoice
>>
>> [snip]
>>> @@ -89,6 +95,9 @@ config BR2_PACKAGE_FIRMWARE_IMX_DDR_VERSION
>>>       # unconditionally use HW version 201810 when DDR3/DDR4 was
>>>       # selected
>>>       default "201810" if BR2_PACKAGE_FIRMWARE_IMX_DDR3 || 
>>> BR2_PACKAGE_FIRMWARE_IMX_DDR4
>>> +    default "v202201" if \
>>
>>   For the time being, there is only one version for the IMX91/3. So it makes 
>> no sense to give an option for it. (In fact, this really should have been a 
>> choice instead of a string option because there are only a fixed set of 
>> options... But that's a separate topic.)
>>
>>   By the way, do these SoCs use the plain 202006 version for DDR4 like the 
>> other SoCs? And do they also support DDR3?
> 
> The i.MX9{1,3} SoCs don't support DDR4 and DDR3... Only LPDDR4 or LPDDR4X, hence 
> my changes below BR2_PACKAGE_FIRMWARE_IMX_DDR{3,4} options.

  Oh, I missed that. So for IMX9 there is no actual choice, it's always LPDDR4 
(because we have no LPDDR4X option at the moment, and there also doesn't seem to 
be any firmware for it...)?


>>> +        BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91 || \
>>> +        BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93
>>>       help
>>>         Use a specific version of the imx ddr binaries. Leaving this
>>>         field empty will select the default version.
>>> diff --git a/package/freescale-imx/firmware-imx/firmware-imx.mk 
>>> b/package/freescale-imx/firmware-imx/firmware-imx.mk
>>> index 66ef8c3930be..1f36f917cdc8 100644
>>> --- a/package/freescale-imx/firmware-imx/firmware-imx.mk
>>> +++ b/package/freescale-imx/firmware-imx/firmware-imx.mk
>>> @@ -48,6 +48,30 @@ endif
>>>   ifeq ($(BR2_PACKAGE_FIRMWARE_IMX_LPDDR4),y)
>>>   FIRMWARE_IMX_DDRFW_DIR = $(@D)/firmware/ddr/synopsys
>>> +ifeq 
>>> ($(BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91)$(BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93),y)
>>
>>   To make the conditions more symmetrical/regular, perhaps it's better to 
>> create a new BR2_PACKAGE_FIRMWARE_IMX_LPDDR4_IMX9X option and encode the 
>> platform conditions there. The prompt would be the same for 
>> BR2_PACKAGE_FIRMWARE_IMX_LPDDR4 and for BR2_PACKAGE_FIRMWARE_IMX_LPDDR4_IMX9X 
>> ("lpddr4" for both).  But perhaps I'm overthinking things.
> 
> I don't see the benefits to do so. Also, i.MX95 supports LPPDR5.

  But there also doesn't seem to be firmware for LPDDR5?

>>> +define FIRMWARE_IMX_INSTALL_IMAGE_DDR_FW
>>> +    # Create padded versions of lpddr4_{d,i}mem_{1,2}d_* and generate 
>>> lpddr4_fw.bin.
>>> +    # lpddr4_fw.bin is needed when generating imx9-boot-sd.bin
>>> +    # which is done in post-image script.
>>> +    $(call FIRMWARE_IMX_PREPARE_DDR_FW, \
>>> +        lpddr4_imem_1d$(FIRMWARE_IMX_DDR_VERSION_SUFFIX),
>>> +        lpddr4_dmem_1d$(FIRMWARE_IMX_DDR_VERSION_SUFFIX),
>>
>>   So the v202201 could be hardcoded here.
>>
>>> +        lpddr4_1d_fw)
>>> +    $(call FIRMWARE_IMX_PREPARE_DDR_FW, \
>>> +        lpddr4_imem_2d$(FIRMWARE_IMX_DDR_VERSION_SUFFIX),
>>> +        lpddr4_dmem_2d$(FIRMWARE_IMX_DDR_VERSION_SUFFIX),
>>> +        lpddr4_2d_fw)
>>> +    cat $(FIRMWARE_IMX_DDRFW_DIR)/lpddr4_1d_fw.bin \
>>> +        $(FIRMWARE_IMX_DDRFW_DIR)/lpddr4_2d_fw.bin > \
>>> +        $(BINARIES_DIR)/lpddr4_fw.bin
>>> +    ln -sf $(BINARIES_DIR)/lpddr4_fw.bin $(BINARIES_DIR)/ddr_fw.bin
>>> +
>>> +    # U-Boot supports creation of the combined flash.bin image. To make
>>> +    # sure that U-Boot can access all available files copy them to
>>> +    # the binary dir.
>>> +    cp $(FIRMWARE_IMX_DDRFW_DIR)/lpddr4*.bin $(BINARIES_DIR)/
>>
>>   We now have 3 instances of this exact same code block with only the file 
>> names that differ, so perhaps it's time to factor this into a second helper 
>> function. Or better, define a few auxiliary variables 
>> FIRMWARE_IMX_DDRFW_IMEM_1D, FIRMWARE_IMX_DDRFW_DMEM_1D etc that are set for 
>> each variant, and then one definition of FIRMWARE_IMX_INSTALL_IMAGE_DDR_FW 
>> that uses those variables.
>>
>>   If that sounds too complex, don't worry, it's just a "niceification" so not 
>> really necessary to do.
> 
> This should done be in a separated patch, right ?

  Yes, I think it's better to merge this series pretty much as is (except for 
dropping IMX91A1), and then do a refactoring patch seperately.

  I actually have a bunch more refactoring ideas, so perhaps it's better if I 
make a PoC patch of my ideas and you fix up all the mistakes I make in it?


  Regards,
  Arnout


> 
>>
>>   In fact, the only of my comments above that is really important is dropping 
>> BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91A1.
> 
> ok !
> 
> Regards,
> 
>>
>>   Regards,
>>   Arnout
>>
>>> +endef
>>> +else
>>>   define FIRMWARE_IMX_INSTALL_IMAGE_DDR_FW
>>>       # Create padded versions of lpddr4_pmu_* and generate 
>>> lpddr4_pmu_train_fw.bin.
>>>       # lpddr4_pmu_train_fw.bin is needed when generating imx8-boot-sd.bin
>>> @@ -71,6 +95,7 @@ define FIRMWARE_IMX_INSTALL_IMAGE_DDR_FW
>>>       cp $(FIRMWARE_IMX_DDRFW_DIR)/lpddr4*.bin $(BINARIES_DIR)/
>>>   endef
>>>   endif
>>> +endif
>>>   ifeq ($(BR2_PACKAGE_FIRMWARE_IMX_DDR4),y)
>>>   FIRMWARE_IMX_DDRFW_DIR = $(@D)/firmware/ddr/synopsys
>>>
> 
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Buildroot] [PATCH v5 1/3] package/freescale-imx: add i.MX91 and i.MX93 SoC support
  2024-02-09 10:25       ` Arnout Vandecappelle via buildroot
@ 2024-02-09 11:09         ` Sébastien Szymanski
  0 siblings, 0 replies; 14+ messages in thread
From: Sébastien Szymanski @ 2024-02-09 11:09 UTC (permalink / raw)
  To: Arnout Vandecappelle, buildroot
  Cc: Refik Tuzakli, Giulio Benetti, Fabio Estevam, Thomas Petazzoni,
	Gary Bisson

Hi Arnout,

On 2/9/24 11:25, Arnout Vandecappelle wrote:
> 
> 
> On 09/02/2024 10:29, Sébastien Szymanski wrote:
>> Hi Arnout,
>>
>> On 2/8/24 23:36, Arnout Vandecappelle wrote:
>>>   Hi Sébastien,
>>>
>>>   It's no fun that I still have questions on v5, but unfortunately...
> 
>   I'll see this weekend if I can merge v5 with the feedback you give 
> below. Unless you send a v6 before that of course!
> 
> [snip]
>>>> +
>>>> +config BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91A1
>>>> +    bool "imx91a1"
>>>> +    depends on BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91
>>>
>>>   Since for IMX91 there is only one option, I think it makes more 
>>> sense to not offer a choice for this. Just always use this one for 
>>> the IMX91. We can still add it back if there ever turns out to be an 
>>> imx91a2.
> 
>   This is actually the main thing I wanted confirmation about from 
> you... Do you agree that we only need the revision option for IMX93, not 
> for IMX91?

I don't know :-)
I guess there probably are i.MX91A0 out there. Maybe I should add an 
option for i.MX91A0 ?

> 
>>>
>>>> +
>>>> +config BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93A0
>>>> +    bool "imx93a0"
>>>> +    depends on BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93
>>>> +
>>>> +config BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93A1
>>>> +    bool "imx93a1"
>>>> +    depends on BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93
>>>> +
>>>>   endchoice
>>>
>>> [snip]
>>>> @@ -89,6 +95,9 @@ config BR2_PACKAGE_FIRMWARE_IMX_DDR_VERSION
>>>>       # unconditionally use HW version 201810 when DDR3/DDR4 was
>>>>       # selected
>>>>       default "201810" if BR2_PACKAGE_FIRMWARE_IMX_DDR3 || 
>>>> BR2_PACKAGE_FIRMWARE_IMX_DDR4
>>>> +    default "v202201" if \
>>>
>>>   For the time being, there is only one version for the IMX91/3. So 
>>> it makes no sense to give an option for it. (In fact, this really 
>>> should have been a choice instead of a string option because there 
>>> are only a fixed set of options... But that's a separate topic.)
>>>
>>>   By the way, do these SoCs use the plain 202006 version for DDR4 
>>> like the other SoCs? And do they also support DDR3?
>>
>> The i.MX9{1,3} SoCs don't support DDR4 and DDR3... Only LPDDR4 or 
>> LPDDR4X, hence my changes below BR2_PACKAGE_FIRMWARE_IMX_DDR{3,4} 
>> options.
> 
>   Oh, I missed that. So for IMX9 there is no actual choice, it's always 
> LPDDR4 (because we have no LPDDR4X option at the moment, and there also 
> doesn't seem to be any firmware for it...)?

I don't think LPDDR4X needs a specific firmware.

> 
> 
>>>> +        BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91 || \
>>>> +        BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93
>>>>       help
>>>>         Use a specific version of the imx ddr binaries. Leaving this
>>>>         field empty will select the default version.
>>>> diff --git a/package/freescale-imx/firmware-imx/firmware-imx.mk 
>>>> b/package/freescale-imx/firmware-imx/firmware-imx.mk
>>>> index 66ef8c3930be..1f36f917cdc8 100644
>>>> --- a/package/freescale-imx/firmware-imx/firmware-imx.mk
>>>> +++ b/package/freescale-imx/firmware-imx/firmware-imx.mk
>>>> @@ -48,6 +48,30 @@ endif
>>>>   ifeq ($(BR2_PACKAGE_FIRMWARE_IMX_LPDDR4),y)
>>>>   FIRMWARE_IMX_DDRFW_DIR = $(@D)/firmware/ddr/synopsys
>>>> +ifeq 
>>>> ($(BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91)$(BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93),y)
>>>
>>>   To make the conditions more symmetrical/regular, perhaps it's 
>>> better to create a new BR2_PACKAGE_FIRMWARE_IMX_LPDDR4_IMX9X option 
>>> and encode the platform conditions there. The prompt would be the 
>>> same for BR2_PACKAGE_FIRMWARE_IMX_LPDDR4 and for 
>>> BR2_PACKAGE_FIRMWARE_IMX_LPDDR4_IMX9X ("lpddr4" for both).  But 
>>> perhaps I'm overthinking things.
>>
>> I don't see the benefits to do so. Also, i.MX95 supports LPPDR5.
> 
>   But there also doesn't seem to be firmware for LPDDR5?

There is no support for i.MX95 in the latest release from NXP yet.
However, I just found out there are two lpddr5*.bin files here:

https://github.com/nxp-imx/imx-mkimage/tree/lf-6.1.55_2.2.0/iMX9

:-)

> 
>>>> +define FIRMWARE_IMX_INSTALL_IMAGE_DDR_FW
>>>> +    # Create padded versions of lpddr4_{d,i}mem_{1,2}d_* and 
>>>> generate lpddr4_fw.bin.
>>>> +    # lpddr4_fw.bin is needed when generating imx9-boot-sd.bin
>>>> +    # which is done in post-image script.
>>>> +    $(call FIRMWARE_IMX_PREPARE_DDR_FW, \
>>>> +        lpddr4_imem_1d$(FIRMWARE_IMX_DDR_VERSION_SUFFIX),
>>>> +        lpddr4_dmem_1d$(FIRMWARE_IMX_DDR_VERSION_SUFFIX),
>>>
>>>   So the v202201 could be hardcoded here.
>>>
>>>> +        lpddr4_1d_fw)
>>>> +    $(call FIRMWARE_IMX_PREPARE_DDR_FW, \
>>>> +        lpddr4_imem_2d$(FIRMWARE_IMX_DDR_VERSION_SUFFIX),
>>>> +        lpddr4_dmem_2d$(FIRMWARE_IMX_DDR_VERSION_SUFFIX),
>>>> +        lpddr4_2d_fw)
>>>> +    cat $(FIRMWARE_IMX_DDRFW_DIR)/lpddr4_1d_fw.bin \
>>>> +        $(FIRMWARE_IMX_DDRFW_DIR)/lpddr4_2d_fw.bin > \
>>>> +        $(BINARIES_DIR)/lpddr4_fw.bin
>>>> +    ln -sf $(BINARIES_DIR)/lpddr4_fw.bin $(BINARIES_DIR)/ddr_fw.bin
>>>> +
>>>> +    # U-Boot supports creation of the combined flash.bin image. To 
>>>> make
>>>> +    # sure that U-Boot can access all available files copy them to
>>>> +    # the binary dir.
>>>> +    cp $(FIRMWARE_IMX_DDRFW_DIR)/lpddr4*.bin $(BINARIES_DIR)/
>>>
>>>   We now have 3 instances of this exact same code block with only the 
>>> file names that differ, so perhaps it's time to factor this into a 
>>> second helper function. Or better, define a few auxiliary variables 
>>> FIRMWARE_IMX_DDRFW_IMEM_1D, FIRMWARE_IMX_DDRFW_DMEM_1D etc that are 
>>> set for each variant, and then one definition of 
>>> FIRMWARE_IMX_INSTALL_IMAGE_DDR_FW that uses those variables.
>>>
>>>   If that sounds too complex, don't worry, it's just a 
>>> "niceification" so not really necessary to do.
>>
>> This should done be in a separated patch, right ?
> 
>   Yes, I think it's better to merge this series pretty much as is 
> (except for dropping IMX91A1), and then do a refactoring patch seperately.
> 
>   I actually have a bunch more refactoring ideas, so perhaps it's better 
> if I make a PoC patch of my ideas and you fix up all the mistakes I make 
> in it?

Sure :)

Regards,

> 
> 
>   Regards,
>   Arnout
> 
> 
>>
>>>
>>>   In fact, the only of my comments above that is really important is 
>>> dropping BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91A1.
>>
>> ok !
>>
>> Regards,
>>
>>>
>>>   Regards,
>>>   Arnout
>>>
>>>> +endef
>>>> +else
>>>>   define FIRMWARE_IMX_INSTALL_IMAGE_DDR_FW
>>>>       # Create padded versions of lpddr4_pmu_* and generate 
>>>> lpddr4_pmu_train_fw.bin.
>>>>       # lpddr4_pmu_train_fw.bin is needed when generating 
>>>> imx8-boot-sd.bin
>>>> @@ -71,6 +95,7 @@ define FIRMWARE_IMX_INSTALL_IMAGE_DDR_FW
>>>>       cp $(FIRMWARE_IMX_DDRFW_DIR)/lpddr4*.bin $(BINARIES_DIR)/
>>>>   endef
>>>>   endif
>>>> +endif
>>>>   ifeq ($(BR2_PACKAGE_FIRMWARE_IMX_DDR4),y)
>>>>   FIRMWARE_IMX_DDRFW_DIR = $(@D)/firmware/ddr/synopsys
>>>>
>>

-- 
Sébastien Szymanski, Armadeus Systems
Software engineer

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Buildroot] [PATCH v5 1/3] package/freescale-imx: add i.MX91 and i.MX93 SoC support
  2024-02-08 12:54 ` [Buildroot] [PATCH v5 1/3] package/freescale-imx: add i.MX91 and i.MX93 SoC support Sébastien Szymanski
  2024-02-08 22:36   ` Arnout Vandecappelle via buildroot
@ 2024-02-12 21:46   ` Arnout Vandecappelle via buildroot
  1 sibling, 0 replies; 14+ messages in thread
From: Arnout Vandecappelle via buildroot @ 2024-02-12 21:46 UTC (permalink / raw)
  To: Sébastien Szymanski, buildroot
  Cc: Refik Tuzakli, Giulio Benetti, Fabio Estevam, Thomas Petazzoni,
	Gary Bisson



On 08/02/2024 13:54, Sébastien Szymanski wrote:
> This commit adds i.MX91 and i.MX93 support to Buildroot.
> https://www.nxp.com/products/processors-and-microcontrollers/arm-processors/i-mx-applications-processors/i-mx-9-processors:IMX9-PROCESSORS
> 
> There is no i.MX95 software provided by NXP at the moment that's why
> i.MX95 is left behind.
> 
> Adapt package firmware-imx for the LPPDR4 firwmares binaries.
> 
> Reviewed-by: Gary Bisson <bisson.gary@gmail.com>
> Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com>

  Applied to master, with changes as already mentioned in my review:

      - Remove BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91A1 option.
      - Re-wrap help text.
      - Introduce BR2_PACKAGE_FIRMWARE_IMX_NEEDS_DDR_FW_IMX9 instead of
        reusing BR2_PACKAGE_FIRMWARE_IMX_NEEDS_DDR_FW.
      - Create completely separate instance of
        FIRMWARE_IMX_INSTALL_IMAGE_DDR_FW for
        BR2_PACKAGE_FIRMWARE_IMX_NEEDS_DDR_FW_IMX9.
      - Drop the training binaries choice for IMX9.
      - Drop the firmware version option for IMX9.
      - Keep options for IMEM and DMEM padding.

  Regards,
  Arnout

> ---
> Changes for v5:
>   - none
> 
> Changes for v4
>   - move i.MX Silicon Revision changes into this patch (Gary Bisson)
>   - BR2_PACKAGE_FIRMWARE_IMX_DDR_VERSION default to "v202201" instead of
>     just "202201" (Gary Bisson)
>   - Copy all DDR files to $(BINARIES_DIR) as U-Boot can now create a
>     bootable image:
>     https://source.denx.de/u-boot/u-boot/-/commit/f637dfe8c468229c9fb313d13c46d51cdbb88824
>   - remove "pmu_train" from generated _pad binary file names
> 
> Changes for v3:
>   - none
> 
> Changes for v2:
>   - none
> ---
>   package/freescale-imx/Config.in                    | 37 ++++++++++++++++++++++
>   package/freescale-imx/firmware-imx/Config.in       |  9 ++++++
>   package/freescale-imx/firmware-imx/firmware-imx.mk | 25 +++++++++++++++
>   3 files changed, 71 insertions(+)
> 
> diff --git a/package/freescale-imx/Config.in b/package/freescale-imx/Config.in
> index 1c26b3cc6f4c..ba169ead18cb 100644
> --- a/package/freescale-imx/Config.in
> +++ b/package/freescale-imx/Config.in
> @@ -61,6 +61,41 @@ config BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8X
>   config BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8DXL
>   	bool "imx8dxl"
>   
> +config BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91
> +	bool "imx91"
> +
> +config BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93
> +	bool "imx93"
> +
> +endchoice
> +
> +choice
> +	prompt "i.MX Silicon Revision"
> +	default BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91A1 \
> +		if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91
> +	default BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93A1 \
> +		if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93
> +	depends on BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91 || \
> +		BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93
> +	help
> +	  Some packages related to the selected i.MX platform need to know the
> +	  silicon revision of the platform they will run on.
> +	  If you don't know, leave the default value.
> +
> +	  Note - mismatches may result in a failure to boot!
> +
> +config BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91A1
> +	bool "imx91a1"
> +	depends on BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91
> +
> +config BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93A0
> +	bool "imx93a0"
> +	depends on BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93
> +
> +config BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93A1
> +	bool "imx93a1"
> +	depends on BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93
> +
>   endchoice
>   
>   config BR2_PACKAGE_FREESCALE_IMX_PLATFORM
> @@ -80,6 +115,8 @@ config BR2_PACKAGE_FREESCALE_IMX_PLATFORM
>   	default "IMX8MM" if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8MM
>   	default "IMX8MN" if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8MN
>   	default "IMX8MP" if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8MP
> +	default "IMX91" if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91
> +	default "IMX93" if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93
>   
>   config BR2_PACKAGE_FREESCALE_IMX_HAS_VPU
>   	bool
> diff --git a/package/freescale-imx/firmware-imx/Config.in b/package/freescale-imx/firmware-imx/Config.in
> index 087ddef8771b..d83b5e129a9f 100644
> --- a/package/freescale-imx/firmware-imx/Config.in
> +++ b/package/freescale-imx/firmware-imx/Config.in
> @@ -55,6 +55,8 @@ config BR2_PACKAGE_FIRMWARE_IMX_NEEDS_DDR_FW
>   	default y if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8MM
>   	default y if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8MN
>   	default y if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8MP
> +	default y if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91
> +	default y if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93
>   
>   if BR2_PACKAGE_FIRMWARE_IMX_NEEDS_DDR_FW
>   
> @@ -73,11 +75,15 @@ config BR2_PACKAGE_FIRMWARE_IMX_LPDDR4
>   
>   config BR2_PACKAGE_FIRMWARE_IMX_DDR4
>   	bool "DDR4"
> +	depends on !BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91
> +	depends on !BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93
>   	help
>   	  Use DDR4 binaries (i.e.: ddr4_*_201810.bin).
>   
>   config BR2_PACKAGE_FIRMWARE_IMX_DDR3
>   	bool "DDR3"
> +	depends on !BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91
> +	depends on !BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93
>   	help
>   	  Use DDR3 binaries (i.e.: ddr3_*_201810.bin).
>   
> @@ -89,6 +95,9 @@ config BR2_PACKAGE_FIRMWARE_IMX_DDR_VERSION
>   	# unconditionally use HW version 201810 when DDR3/DDR4 was
>   	# selected
>   	default "201810" if BR2_PACKAGE_FIRMWARE_IMX_DDR3 || BR2_PACKAGE_FIRMWARE_IMX_DDR4
> +	default "v202201" if \
> +		BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91 || \
> +		BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93
>   	help
>   	  Use a specific version of the imx ddr binaries. Leaving this
>   	  field empty will select the default version.
> diff --git a/package/freescale-imx/firmware-imx/firmware-imx.mk b/package/freescale-imx/firmware-imx/firmware-imx.mk
> index 66ef8c3930be..1f36f917cdc8 100644
> --- a/package/freescale-imx/firmware-imx/firmware-imx.mk
> +++ b/package/freescale-imx/firmware-imx/firmware-imx.mk
> @@ -48,6 +48,30 @@ endif
>   ifeq ($(BR2_PACKAGE_FIRMWARE_IMX_LPDDR4),y)
>   FIRMWARE_IMX_DDRFW_DIR = $(@D)/firmware/ddr/synopsys
>   
> +ifeq ($(BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91)$(BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93),y)
> +define FIRMWARE_IMX_INSTALL_IMAGE_DDR_FW
> +	# Create padded versions of lpddr4_{d,i}mem_{1,2}d_* and generate lpddr4_fw.bin.
> +	# lpddr4_fw.bin is needed when generating imx9-boot-sd.bin
> +	# which is done in post-image script.
> +	$(call FIRMWARE_IMX_PREPARE_DDR_FW, \
> +		lpddr4_imem_1d$(FIRMWARE_IMX_DDR_VERSION_SUFFIX),
> +		lpddr4_dmem_1d$(FIRMWARE_IMX_DDR_VERSION_SUFFIX),
> +		lpddr4_1d_fw)
> +	$(call FIRMWARE_IMX_PREPARE_DDR_FW, \
> +		lpddr4_imem_2d$(FIRMWARE_IMX_DDR_VERSION_SUFFIX),
> +		lpddr4_dmem_2d$(FIRMWARE_IMX_DDR_VERSION_SUFFIX),
> +		lpddr4_2d_fw)
> +	cat $(FIRMWARE_IMX_DDRFW_DIR)/lpddr4_1d_fw.bin \
> +		$(FIRMWARE_IMX_DDRFW_DIR)/lpddr4_2d_fw.bin > \
> +		$(BINARIES_DIR)/lpddr4_fw.bin
> +	ln -sf $(BINARIES_DIR)/lpddr4_fw.bin $(BINARIES_DIR)/ddr_fw.bin
> +
> +	# U-Boot supports creation of the combined flash.bin image. To make
> +	# sure that U-Boot can access all available files copy them to
> +	# the binary dir.
> +	cp $(FIRMWARE_IMX_DDRFW_DIR)/lpddr4*.bin $(BINARIES_DIR)/
> +endef
> +else
>   define FIRMWARE_IMX_INSTALL_IMAGE_DDR_FW
>   	# Create padded versions of lpddr4_pmu_* and generate lpddr4_pmu_train_fw.bin.
>   	# lpddr4_pmu_train_fw.bin is needed when generating imx8-boot-sd.bin
> @@ -71,6 +95,7 @@ define FIRMWARE_IMX_INSTALL_IMAGE_DDR_FW
>   	cp $(FIRMWARE_IMX_DDRFW_DIR)/lpddr4*.bin $(BINARIES_DIR)/
>   endef
>   endif
> +endif
>   
>   ifeq ($(BR2_PACKAGE_FIRMWARE_IMX_DDR4),y)
>   FIRMWARE_IMX_DDRFW_DIR = $(@D)/firmware/ddr/synopsys
> 
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Buildroot] [PATCH v5 2/3] package/freescale-imx/firmware-ele-imx: new package
  2024-02-08 12:54 ` [Buildroot] [PATCH v5 2/3] package/freescale-imx/firmware-ele-imx: new package Sébastien Szymanski
  2024-02-08 22:43   ` Arnout Vandecappelle via buildroot
@ 2024-02-12 21:46   ` Arnout Vandecappelle via buildroot
  1 sibling, 0 replies; 14+ messages in thread
From: Arnout Vandecappelle via buildroot @ 2024-02-12 21:46 UTC (permalink / raw)
  To: Sébastien Szymanski, buildroot
  Cc: Refik Tuzakli, Giulio Benetti, Fabio Estevam, Thomas Petazzoni,
	Gary Bisson



On 08/02/2024 13:54, Sébastien Szymanski wrote:
> This package provides firmware blobs for the Edgelock Secure
> Enclave (ELE) [1] present on i.MX8ULP and i.MX9 Socs.
> This version comes from the 6.1.55-2.2.0 release.
> 
> [1] https://www.nxp.com/products/nxp-product-information/nxp-product-programs/edgelock-secure-enclave:EDGELOCK-SECURE-ENCLAVE
> 
> Reviewed-by: Gary Bisson <bisson.gary@gmail.com>
> Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com>

  Applied to master, thanks, with some changes:

      - Introduce BR2_PACKAGE_FREESCALE_IMX_HAS_ELE instead of specific
        dependencies.
      - Drop BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91A1, use
        BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91 instead.
      - Don't use SCR.txt as license file (it's just an index file); instead,
        use EULA.

  Regards,
  Arnout

> ---
> Changes for v5:
>   - none
> 
> Changes for v4:
>   - move i.MX Silicon Revision changes into first patch (Gary Bisson)
> 
> Changes for v3:
>   - rename package from firmware-sentinel to package firmware-ele-imx
> 
> Changes for v2:
>   - none
> ---
>   package/freescale-imx/Config.in                    |  1 +
>   package/freescale-imx/firmware-ele-imx/Config.in   | 21 +++++++++++++++++
>   .../firmware-ele-imx/firmware-ele-imx.hash         |  4 ++++
>   .../firmware-ele-imx/firmware-ele-imx.mk           | 27 ++++++++++++++++++++++
>   4 files changed, 53 insertions(+)
> 
> diff --git a/package/freescale-imx/Config.in b/package/freescale-imx/Config.in
> index ba169ead18cb..f12acc3bd024 100644
> --- a/package/freescale-imx/Config.in
> +++ b/package/freescale-imx/Config.in
> @@ -154,6 +154,7 @@ source "package/freescale-imx/imx-uuc/Config.in"
>   source "package/freescale-imx/imx-vpu/Config.in"
>   source "package/freescale-imx/imx-vpu-hantro/Config.in"
>   source "package/freescale-imx/imx-vpuwrap/Config.in"
> +source "package/freescale-imx/firmware-ele-imx/Config.in"
>   source "package/freescale-imx/firmware-imx/Config.in"
>   source "package/freescale-imx/imx-sc-firmware/Config.in"
>   source "package/freescale-imx/imx-seco/Config.in"
> diff --git a/package/freescale-imx/firmware-ele-imx/Config.in b/package/freescale-imx/firmware-ele-imx/Config.in
> new file mode 100644
> index 000000000000..7867c3712c9c
> --- /dev/null
> +++ b/package/freescale-imx/firmware-ele-imx/Config.in
> @@ -0,0 +1,21 @@
> +config BR2_PACKAGE_FIRMWARE_ELE_IMX
> +	bool "firmware-ele-imx"
> +	depends on BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91 || \
> +		BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93
> +	help
> +	  Firmware blobs for the Edgelock Secure Enclave (ELE)
> +	  present on i.MX8ULP and i.MX9 SoCs.
> +
> +	  This library is provided by NXP as-is and doesn't have an
> +	  upstream.
> +
> +if BR2_PACKAGE_FIRMWARE_ELE_IMX
> +
> +config BR2_PACKAGE_FIRMWARE_ELE_IMX_AHAB_CONTAINER_IMAGE
> +	string
> +	default "mx93a0-ahab-container.img" if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93A0
> +	default "mx93a1-ahab-container.img" if \
> +		BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91A1 || \
> +		BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93A1
> +
> +endif # BR2_PACKAGE_FIRMWARE_ELE_IMX
> diff --git a/package/freescale-imx/firmware-ele-imx/firmware-ele-imx.hash b/package/freescale-imx/firmware-ele-imx/firmware-ele-imx.hash
> new file mode 100644
> index 000000000000..58565cef43e9
> --- /dev/null
> +++ b/package/freescale-imx/firmware-ele-imx/firmware-ele-imx.hash
> @@ -0,0 +1,4 @@
> +# Locally calculated
> +sha256  4a0440168d8dfb95989a17be8fafb149589e110e7d4518e5e8a33463dfb5e5ca  firmware-ele-imx-0.1.0.bin
> +sha256  24d7cb3a7e51011466a149bd99acf89387b832be2d0890ce2e183dfbc9d7cb84  COPYING
> +sha256  c800aaca3a7e9f470d99d7cde0a48c95982ed601d4c306f7b8f43f3710054f28  SCR.txt
> diff --git a/package/freescale-imx/firmware-ele-imx/firmware-ele-imx.mk b/package/freescale-imx/firmware-ele-imx/firmware-ele-imx.mk
> new file mode 100644
> index 000000000000..600b50c5b456
> --- /dev/null
> +++ b/package/freescale-imx/firmware-ele-imx/firmware-ele-imx.mk
> @@ -0,0 +1,27 @@
> +################################################################################
> +#
> +# firmware-ele-imx
> +#
> +################################################################################
> +
> +FIRMWARE_ELE_IMX_VERSION = 0.1.0
> +FIRMWARE_ELE_IMX_SITE = $(FREESCALE_IMX_SITE)
> +FIRMWARE_ELE_IMX_SOURCE = firmware-ele-imx-$(FIRMWARE_ELE_IMX_VERSION).bin
> +
> +FIRMWARE_ELE_IMX_LICENSE = NXP Semiconductor Software License Agreement
> +FIRMWARE_ELE_IMX_LICENSE_FILES = COPYING SCR.txt
> +FIRMWARE_ELE_IMX_REDISTRIBUTE = NO
> +
> +FIRMWARE_ELE_IMX_INSTALL_IMAGES = YES
> +
> +define FIRMWARE_ELE_IMX_EXTRACT_CMDS
> +	$(call NXP_EXTRACT_HELPER,$(FIRMWARE_ELE_IMX_DL_DIR)/$(FIRMWARE_ELE_IMX_SOURCE))
> +endef
> +
> +FIRMWARE_ELE_IMX_AHAB_CONTAINER_IMAGE = $(call qstrip,$(BR2_PACKAGE_FIRMWARE_ELE_IMX_AHAB_CONTAINER_IMAGE))
> +
> +define FIRMWARE_ELE_IMX_INSTALL_IMAGES_CMDS
> +	cp $(@D)/$(FIRMWARE_ELE_IMX_AHAB_CONTAINER_IMAGE) $(BINARIES_DIR)/ahab-container.img
> +endef
> +
> +$(eval $(generic-package))
> 
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Buildroot] [PATCH v5 3/3] configs/freescale_imx93evk: new defconfig
  2024-02-08 12:54 ` [Buildroot] [PATCH v5 3/3] configs/freescale_imx93evk: new defconfig Sébastien Szymanski
@ 2024-02-12 21:49   ` Arnout Vandecappelle via buildroot
  0 siblings, 0 replies; 14+ messages in thread
From: Arnout Vandecappelle via buildroot @ 2024-02-12 21:49 UTC (permalink / raw)
  To: Sébastien Szymanski, buildroot
  Cc: Gary Bisson, Refik Tuzakli, Julien Olivain, Thomas Petazzoni,
	Giulio Benetti, Fabio Estevam



On 08/02/2024 13:54, Sébastien Szymanski wrote:
> This patch adds support for the NXP i.MX 93 11x11 EVK board [1].
> 
> [1] https://www.nxp.com/design/development-boards/i-mx-evaluation-and-development-boards/i-mx-93-evaluation-kit:i.MX93EVK
> 
> Reviewed-by: Julien Olivain <ju.o@free.fr>
> Tested-by: Julien Olivain <ju.o@free.fr>
> [Julien: tested on NXP board i.MX93EVK, cpu rev A1, board rev B]
> Reviewed-by: Gary Bisson <bisson.gary@gmail.com>
> Reviewed-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
> Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
> ---
> Changes for v5:
>   - follow BR coding style for the genimage.cfg.template_imx9 file
>     (Giulio Benetti)
> 
> Changes for v4:
>   - None
> 
> Changes for v3:
>   - BR2_PACKAGE_FIRMWARE_SENTINEL=y -> BR2_PACKAGE_FIRMWARE_ELE_IMX=y
>   - add a note about the debug UART in the readme.txt file (Julien Olivain)
>   - add BR2_TARGET_UBOOT_NEEDS_OPENSSL=y and
>     BR2_TARGET_UBOOT_NEEDS_GNUTLS=y to the defconfig file (Julien Olivain)
>   - bump ATF, U-Boot and Linux to latest NXP release lf-6.1.55-2.2.0
>     (Julien Olivain)
> 
> Changes for v2:
>   - none
> ---
>   .../common/imx/genimage.cfg.template_imx9          | 42 ++++++++++++
>   .../common/imx/imx9-bootloader-prepare.sh          | 34 ++++++++++

  This new script had some shellcheck errors.

>   board/freescale/common/imx/post-image.sh           |  4 ++

  This one introduced some new shellcheck errors.

  I pushed an extra commit that fixes all the shellcheck errors before this patch.

>   board/freescale/imx93evk/readme.txt                | 77 ++++++++++++++++++++++
>   configs/freescale_imx93evk_defconfig               | 39 +++++++++++
>   5 files changed, 196 insertions(+)

  We now support hash files for the custom kernel etc. - they are only used if 
BR2_DOWNLOAD_FORCE_CHECK_HASHES=y, but it's still good to have them. So I added 
those.


  Applied to master with those changes, thanks.


  Could you re-test the series just to be sure that I didn't do anything stupid?

  Regards,
  Arnout

[snip]
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2024-02-12 21:49 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-08 12:54 [Buildroot] [PATCH v5 0/3] i.MX91 and i.MX93 support Sébastien Szymanski
2024-02-08 12:54 ` [Buildroot] [PATCH v5 1/3] package/freescale-imx: add i.MX91 and i.MX93 SoC support Sébastien Szymanski
2024-02-08 22:36   ` Arnout Vandecappelle via buildroot
2024-02-08 22:39     ` Arnout Vandecappelle via buildroot
2024-02-09  9:29     ` Sébastien Szymanski
2024-02-09 10:25       ` Arnout Vandecappelle via buildroot
2024-02-09 11:09         ` Sébastien Szymanski
2024-02-12 21:46   ` Arnout Vandecappelle via buildroot
2024-02-08 12:54 ` [Buildroot] [PATCH v5 2/3] package/freescale-imx/firmware-ele-imx: new package Sébastien Szymanski
2024-02-08 22:43   ` Arnout Vandecappelle via buildroot
2024-02-09  9:34     ` Sébastien Szymanski
2024-02-12 21:46   ` Arnout Vandecappelle via buildroot
2024-02-08 12:54 ` [Buildroot] [PATCH v5 3/3] configs/freescale_imx93evk: new defconfig Sébastien Szymanski
2024-02-12 21:49   ` Arnout Vandecappelle via buildroot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.