All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v3 0/4] package/freescale-imx: clean-up proposal
@ 2020-07-10 12:00 Stephane Viau
  2020-07-10 12:00 ` [Buildroot] [PATCH v3 1/4] package/freescale-imx: Move DDR FW choice down to firmware-imx package Stephane Viau
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Stephane Viau @ 2020-07-10 12:00 UTC (permalink / raw)
  To: buildroot

Here is the third version of this patch set whose aim is to clean up the
firmware-imx package. Thank you all for the feedback in the previous version.

BR,
Stephane.

Stephane Viau (4):
  package/freescale-imx: Move DDR FW choice down to firmware-imx package
  package/freescale-imx/firmware-imx: Fix sdma/vpu firmware install path
  package/freescale-imx/firmware-imx: Add option for all i.MX FW needs
  package/freescale-imx/firmware-imx: Clean up the image/target semantic

 configs/freescale_imx8mnevk_defconfig              |  2 +-
 package/freescale-imx/Config.in                    |  6 --
 package/freescale-imx/firmware-imx/Config.in       | 52 +++++++++++++++--
 package/freescale-imx/firmware-imx/firmware-imx.mk | 67 ++++++++++++++++------
 4 files changed, 96 insertions(+), 31 deletions(-)

-- 
2.7.4

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

* [Buildroot] [PATCH v3 1/4] package/freescale-imx: Move DDR FW choice down to firmware-imx package
  2020-07-10 12:00 [Buildroot] [PATCH v3 0/4] package/freescale-imx: clean-up proposal Stephane Viau
@ 2020-07-10 12:00 ` Stephane Viau
  2020-07-11 20:48   ` Thomas Petazzoni
  2020-07-10 12:00 ` [Buildroot] [PATCH v3 2/4] package/freescale-imx/firmware-imx: Fix sdma/vpu firmware install path Stephane Viau
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 11+ messages in thread
From: Stephane Viau @ 2020-07-10 12:00 UTC (permalink / raw)
  To: buildroot

The DDR FW along with all other FW code that need to be used in
bootloader or installed on target are related to the firmware-imx package.

This patch does this job as well as fixing the conjugation of NEED*s* in
the symbol name. Also take advantage of this patch to make the DDR FW
dependant on BR2_PACKAGE_FIRMWARE_IMX.

Note that BR2_PACKAGE_FIRMWARE_IMX_xxx is the preferred naming
convention for the upcoming couple of patches.

Suggested-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Stephane Viau <stephane.viau@oss.nxp.com>
--
v2:
- Fix attributes order (make check-package)

Signed-off-by: Stephane Viau <stephane.viau@oss.nxp.com>
---
 configs/freescale_imx8mnevk_defconfig              |  2 +-
 package/freescale-imx/Config.in                    |  6 ------
 package/freescale-imx/firmware-imx/Config.in       | 15 +++++++++++----
 package/freescale-imx/firmware-imx/firmware-imx.mk |  6 +++---
 4 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/configs/freescale_imx8mnevk_defconfig b/configs/freescale_imx8mnevk_defconfig
index a859d1c..6d91e3a 100644
--- a/configs/freescale_imx8mnevk_defconfig
+++ b/configs/freescale_imx8mnevk_defconfig
@@ -15,7 +15,7 @@ BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
 BR2_PACKAGE_FREESCALE_IMX=y
 BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8MN=y
 BR2_PACKAGE_FIRMWARE_IMX=y
-BR2_PACKAGE_FIRMWARE_DDRFW_DDR4=y
+BR2_PACKAGE_FIRMWARE_IMX_DDR4=y
 BR2_TARGET_ROOTFS_EXT2=y
 BR2_TARGET_ROOTFS_EXT2_4=y
 BR2_TARGET_ROOTFS_EXT2_SIZE="120M"
diff --git a/package/freescale-imx/Config.in b/package/freescale-imx/Config.in
index 0be37ce..b0c7de8 100644
--- a/package/freescale-imx/Config.in
+++ b/package/freescale-imx/Config.in
@@ -45,15 +45,12 @@ config BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8
 
 config BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8M
 	bool "imx8m"
-	select BR2_PACKAGE_FREESCALE_IMX_NEED_DDR_FW
 
 config BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8MM
 	bool "imx8mm"
-	select BR2_PACKAGE_FREESCALE_IMX_NEED_DDR_FW
 
 config BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8MN
 	bool "imx8mn"
-	select BR2_PACKAGE_FREESCALE_IMX_NEED_DDR_FW
 
 config BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8X
 	bool "imx8x"
@@ -99,9 +96,6 @@ 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_NEED_DDR_FW
-	bool
-
 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"
diff --git a/package/freescale-imx/firmware-imx/Config.in b/package/freescale-imx/firmware-imx/Config.in
index 4962992..7ff37ed 100644
--- a/package/freescale-imx/firmware-imx/Config.in
+++ b/package/freescale-imx/firmware-imx/Config.in
@@ -9,22 +9,29 @@ config BR2_PACKAGE_FIRMWARE_IMX
 	  This library is provided by Freescale as-is and doesn't have
 	  an upstream.
 
-if BR2_PACKAGE_FREESCALE_IMX_NEED_DDR_FW
+config BR2_PACKAGE_FIRMWARE_IMX_NEEDS_DDR_FW
+	bool
+	default y if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8M
+	default y if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8MM
+	default y if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8MN
+	depends on BR2_PACKAGE_FIRMWARE_IMX
+
+if BR2_PACKAGE_FIRMWARE_IMX_NEEDS_DDR_FW
 
 choice
 	bool "DDR training binaries"
-	default BR2_PACKAGE_FIRMWARE_DDRFW_LPDDR4
+	default BR2_PACKAGE_FIRMWARE_IMX_LPDDR4
 	help
 	  Choose the DDR training binaries to be used depending on the
 	  kind of memory that is available on the target board (DDR4,
 	  LPDDR4, etc...).
 
-config BR2_PACKAGE_FIRMWARE_DDRFW_LPDDR4
+config BR2_PACKAGE_FIRMWARE_IMX_LPDDR4
 	bool "lpddr4"
 	help
 	  Use LPDDR4 binaries (i.e.: lpddr4_pmu_train_*.bin)
 
-config BR2_PACKAGE_FIRMWARE_DDRFW_DDR4
+config BR2_PACKAGE_FIRMWARE_IMX_DDR4
 	bool "DDR4"
 	help
 	  Use DDR4 binaries (i.e.: ddr4_*_201810.bin).
diff --git a/package/freescale-imx/firmware-imx/firmware-imx.mk b/package/freescale-imx/firmware-imx/firmware-imx.mk
index 6beacc0..55ca6fc 100644
--- a/package/freescale-imx/firmware-imx/firmware-imx.mk
+++ b/package/freescale-imx/firmware-imx/firmware-imx.mk
@@ -18,10 +18,10 @@ define FIRMWARE_IMX_EXTRACT_CMDS
 	$(call FREESCALE_IMX_EXTRACT_HELPER,$(FIRMWARE_IMX_DL_DIR)/$(FIRMWARE_IMX_SOURCE))
 endef
 
-ifeq ($(BR2_PACKAGE_FREESCALE_IMX_NEED_DDR_FW),y)
+ifeq ($(BR2_PACKAGE_FIRMWARE_IMX_NEEDS_DDR_FW),y)
 FIRMWARE_IMX_INSTALL_IMAGES = YES
 
-ifeq ($(BR2_PACKAGE_FIRMWARE_DDRFW_LPDDR4),y)
+ifeq ($(BR2_PACKAGE_FIRMWARE_IMX_LPDDR4),y)
 FIRMWARE_IMX_DDRFW_DIR = $(@D)/firmware/ddr/synopsys
 define FIRMWARE_IMX_PREPARE_LPDDR4_FW
 	$(TARGET_OBJCOPY) -I binary -O binary --pad-to 0x8000 --gap-fill=0x0 \
@@ -46,7 +46,7 @@ define FIRMWARE_IMX_PREPARE_DDR_FW
 		$(BINARIES_DIR)/lpddr4_pmu_train_fw.bin
 	ln -sf $(BINARIES_DIR)/lpddr4_pmu_train_fw.bin $(BINARIES_DIR)/ddr_fw.bin
 endef
-else ifeq ($(BR2_PACKAGE_FIRMWARE_DDRFW_DDR4),y)
+else ifeq ($(BR2_PACKAGE_FIRMWARE_IMX_DDR4),y)
 FIRMWARE_IMX_DDRFW_DIR = $(@D)/firmware/ddr/synopsys
 define FIRMWARE_IMX_PREPARE_DDR4_FW
 	$(TARGET_OBJCOPY) -I binary -O binary --pad-to 0x8000 --gap-fill=0x0 \
-- 
2.7.4

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

* [Buildroot] [PATCH v3 2/4] package/freescale-imx/firmware-imx: Fix sdma/vpu firmware install path
  2020-07-10 12:00 [Buildroot] [PATCH v3 0/4] package/freescale-imx: clean-up proposal Stephane Viau
  2020-07-10 12:00 ` [Buildroot] [PATCH v3 1/4] package/freescale-imx: Move DDR FW choice down to firmware-imx package Stephane Viau
@ 2020-07-10 12:00 ` Stephane Viau
  2020-07-11 14:11   ` Thomas Petazzoni
  2020-07-10 12:00 ` [Buildroot] [PATCH v3 3/4] package/freescale-imx/firmware-imx: Add option for all i.MX FW needs Stephane Viau
  2020-07-10 12:00 ` [Buildroot] [PATCH v3 4/4] package/freescale-imx/firmware-imx: Clean up the image/target semantic Stephane Viau
  3 siblings, 1 reply; 11+ messages in thread
From: Stephane Viau @ 2020-07-10 12:00 UTC (permalink / raw)
  To: buildroot

In a patch set that did not get in for other reasons, Sebastien proposed
to fix the install path directory of the sdma and vpu firmware code [1]:

	"Mainline and NXP kernels expect the sdma firmware to be in
	/lib/firmware/imx/sdma so fix the install path [...]"

By looking at the code, I believe this is correct even though I have no
means to test it.

[1] http://lists.busybox.net/pipermail/buildroot/2020-June/284875.html

Suggested-by: S?bastien Szymanski <sebastien.szymanski@armadeus.com>
Signed-off-by: Stephane Viau <stephane.viau@oss.nxp.com>
---
 package/freescale-imx/firmware-imx/firmware-imx.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/freescale-imx/firmware-imx/firmware-imx.mk b/package/freescale-imx/firmware-imx/firmware-imx.mk
index 55ca6fc..c4ac5f7 100644
--- a/package/freescale-imx/firmware-imx/firmware-imx.mk
+++ b/package/freescale-imx/firmware-imx/firmware-imx.mk
@@ -95,7 +95,7 @@ else
 define FIRMWARE_IMX_INSTALL_TARGET_CMDS
 	mkdir -p $(TARGET_DIR)/lib/firmware/imx
 	for blobdir in $(FIRMWARE_IMX_BLOBS); do \
-		cp -r $(@D)/firmware/$${blobdir} $(TARGET_DIR)/lib/firmware; \
+		cp -r $(@D)/firmware/$${blobdir} $(TARGET_DIR)/lib/firmware/imx; \
 	done
 	cp -r $(@D)/firmware/epdc $(TARGET_DIR)/lib/firmware/imx
 	mv $(TARGET_DIR)/lib/firmware/imx/epdc/epdc_ED060XH2C1.fw.nonrestricted \
-- 
2.7.4

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

* [Buildroot] [PATCH v3 3/4] package/freescale-imx/firmware-imx: Add option for all i.MX FW needs
  2020-07-10 12:00 [Buildroot] [PATCH v3 0/4] package/freescale-imx: clean-up proposal Stephane Viau
  2020-07-10 12:00 ` [Buildroot] [PATCH v3 1/4] package/freescale-imx: Move DDR FW choice down to firmware-imx package Stephane Viau
  2020-07-10 12:00 ` [Buildroot] [PATCH v3 2/4] package/freescale-imx/firmware-imx: Fix sdma/vpu firmware install path Stephane Viau
@ 2020-07-10 12:00 ` Stephane Viau
  2020-07-11 20:51   ` Thomas Petazzoni
  2020-07-10 12:00 ` [Buildroot] [PATCH v3 4/4] package/freescale-imx/firmware-imx: Clean up the image/target semantic Stephane Viau
  3 siblings, 1 reply; 11+ messages in thread
From: Stephane Viau @ 2020-07-10 12:00 UTC (permalink / raw)
  To: buildroot

Some SoC need a HDMI FW for their bootloader, some other require EPDC,
SDMA and/or VPU.
Instead of trying to "guess" what firmware images need to be installed
in firmware-imx.mk, let the Config framework do the job and allow each
SoC to pick what firmware they need.

Note that this patch should also help introducing an eventual DP FW, as
Gary mentioned in a separate thread [1].

[1] http://lists.busybox.net/pipermail/buildroot/2020-May/283181.html

Suggested-by: Yann E. MORIN <yann.morin.1998@free.fr>
Suggested-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Stephane Viau <stephane.viau@oss.nxp.com>
---
v3:
- only copy the VPU (and SDMA) blob associated to the platform selected (Gary)
- Fix attributes order (make check-package)

v2:
- Do not embed VPU FW for i.MX 6S/6UL/7 (Fabio)
- Name VPU FW after IP name (Fabio)
- Rename symbols using the "_NEED_" in their name (Thomas)

Signed-off-by: Stephane Viau <stephane.viau@oss.nxp.com>
---
 package/freescale-imx/firmware-imx/Config.in | 37 +++++++++++++++++++++++++++-
 1 file changed, 36 insertions(+), 1 deletion(-)

diff --git a/package/freescale-imx/firmware-imx/Config.in b/package/freescale-imx/firmware-imx/Config.in
index 7ff37ed..2c00ee1 100644
--- a/package/freescale-imx/firmware-imx/Config.in
+++ b/package/freescale-imx/firmware-imx/Config.in
@@ -4,11 +4,46 @@ config BR2_PACKAGE_FIRMWARE_IMX
 	help
 	  Firmware blobs for the Freescale i.MX SoCs.
 
-	  It contains blobs for SDMA and VPU.
+	  It contains blobs for SDMA, VPU, etc...
 
 	  This library is provided by Freescale as-is and doesn't have
 	  an upstream.
 
+config BR2_PACKAGE_FIRMWARE_IMX_SDMA
+	bool
+	default y if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX25_3STACK
+	default y if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX27ADS
+	default y if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX37_3STACK
+	default y if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX50
+	default y if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX51
+	default y if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX53
+	default y if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX6Q
+	default y if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX6S
+	default y if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX6UL
+	default y if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX7
+	depends on BR2_PACKAGE_FIRMWARE_IMX
+
+config BR2_PACKAGE_FIRMWARE_IMX_VPU
+	bool
+	default y if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX27ADS
+	default y if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX51
+	default y if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX53
+	default y if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX6Q
+	default y if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8
+	default y if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8X
+	depends on BR2_PACKAGE_FIRMWARE_IMX
+
+config BR2_PACKAGE_FIRMWARE_IMX_HDMI
+	bool
+	default y if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8M
+	depends on BR2_PACKAGE_FIRMWARE_IMX
+
+config BR2_PACKAGE_FIRMWARE_IMX_EPDC
+	bool
+	default y if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX6Q
+	default y if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX6S
+	depends on BR2_PACKAGE_FIRMWARE_IMX
+
 config BR2_PACKAGE_FIRMWARE_IMX_NEEDS_DDR_FW
 	bool
 	default y if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8M
-- 
2.7.4

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

* [Buildroot] [PATCH v3 4/4] package/freescale-imx/firmware-imx: Clean up the image/target semantic
  2020-07-10 12:00 [Buildroot] [PATCH v3 0/4] package/freescale-imx: clean-up proposal Stephane Viau
                   ` (2 preceding siblings ...)
  2020-07-10 12:00 ` [Buildroot] [PATCH v3 3/4] package/freescale-imx/firmware-imx: Add option for all i.MX FW needs Stephane Viau
@ 2020-07-10 12:00 ` Stephane Viau
  2020-07-11 20:53   ` Thomas Petazzoni
  3 siblings, 1 reply; 11+ messages in thread
From: Stephane Viau @ 2020-07-10 12:00 UTC (permalink / raw)
  To: buildroot

The newly introduced BR2_PACKAGE_FIRMWARE_IMX_xxx symbols shall be
used in lieue of the SoC type when installing images or binaries on
target.

These new symbols let us define FIRMWARE_IMX_INSTALL_IMAGES_CMDS and
FIRMWARE_IMX_INSTALL_TARGET_CMDS based on platform needs rather than
SoC type.

Suggested-by: Yann E. MORIN <yann.morin.1998@free.fr>
Signed-off-by: Stephane Viau <stephane.viau@oss.nxp.com>
---
v3:
- Only copy the VPU (and SDMA) blob associated to the platform selected (Gary)
- Set FIRMWARE_IMX_INSTALL_IMAGES_CMDS to YES at the beginning (Gary)
- Remove FIRMWARE_IMX_INSTALL_TARGET useless default value (make check-package)

v2:
- Name VPU FW after IP name (Fabio)
- Rename symbols using the "_NEED_" in their name (Thomas)
- Remove unnecessary comments & move INSTALL_IMAGES down (Thomas)

Signed-off-by: Stephane Viau <stephane.viau@oss.nxp.com>
---
 package/freescale-imx/firmware-imx/firmware-imx.mk | 61 ++++++++++++++++------
 1 file changed, 45 insertions(+), 16 deletions(-)

diff --git a/package/freescale-imx/firmware-imx/firmware-imx.mk b/package/freescale-imx/firmware-imx/firmware-imx.mk
index c4ac5f7..ef2923e 100644
--- a/package/freescale-imx/firmware-imx/firmware-imx.mk
+++ b/package/freescale-imx/firmware-imx/firmware-imx.mk
@@ -12,14 +12,15 @@ FIRMWARE_IMX_LICENSE = NXP Semiconductor Software License Agreement
 FIRMWARE_IMX_LICENSE_FILES = EULA COPYING
 FIRMWARE_IMX_REDISTRIBUTE = NO
 
-FIRMWARE_IMX_BLOBS = sdma vpu
+FIRMWARE_IMX_INSTALL_IMAGES = YES
+
+FIRMWARE_IMX_PLATFORM_LOWER = $(shell echo $(BR2_PACKAGE_FREESCALE_IMX_PLATFORM) | tr A-Z a-z | head -c 5)
 
 define FIRMWARE_IMX_EXTRACT_CMDS
 	$(call FREESCALE_IMX_EXTRACT_HELPER,$(FIRMWARE_IMX_DL_DIR)/$(FIRMWARE_IMX_SOURCE))
 endef
 
 ifeq ($(BR2_PACKAGE_FIRMWARE_IMX_NEEDS_DDR_FW),y)
-FIRMWARE_IMX_INSTALL_IMAGES = YES
 
 ifeq ($(BR2_PACKAGE_FIRMWARE_IMX_LPDDR4),y)
 FIRMWARE_IMX_DDRFW_DIR = $(@D)/firmware/ddr/synopsys
@@ -72,35 +73,63 @@ define FIRMWARE_IMX_PREPARE_DDR_FW
 	ln -sf $(BINARIES_DIR)/ddr4_201810_fw.bin $(BINARIES_DIR)/ddr_fw.bin
 endef
 endif
+endif # IMX_NEEDS_DDR_FW
+
+ifeq ($(BR2_PACKAGE_FIRMWARE_IMX_HDMI),y)
 
-ifeq ($(BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8M),y)
 define FIRMWARE_IMX_PREPARE_HDMI_FW
 	cp $(@D)/firmware/hdmi/cadence/signed_hdmi_imx8m.bin \
 		$(BINARIES_DIR)/signed_hdmi_imx8m.bin
 endef
 endif
 
-define FIRMWARE_IMX_INSTALL_IMAGES_CMDS
-	$(FIRMWARE_IMX_PREPARE_DDR_FW)
-	$(FIRMWARE_IMX_PREPARE_HDMI_FW)
+ifeq ($(BR2_PACKAGE_FIRMWARE_IMX_EPDC),y)
+
+define FIRMWARE_IMX_INSTALL_TARGET_EPDC_FW
+	mkdir -p $(TARGET_DIR)/lib/firmware/imx
+	cp -r $(@D)/firmware/epdc $(TARGET_DIR)/lib/firmware/imx
+	mv $(TARGET_DIR)/lib/firmware/imx/epdc/epdc_ED060XH2C1.fw.nonrestricted \
+		$(TARGET_DIR)/lib/firmware/imx/epdc/epdc_ED060XH2C1.fw
 endef
-else ifeq ($(BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8X),y)
-define FIRMWARE_IMX_INSTALL_TARGET_CMDS
+endif
+
+ifeq ($(BR2_PACKAGE_FIRMWARE_IMX_SDMA),y)
+
+define FIRMWARE_IMX_INSTALL_TARGET_SDMA_FW
+	mkdir -p $(TARGET_DIR)/lib/firmware/imx/sdma
+	cp -r $(@D)/firmware/sdma/sdma-$(FIRMWARE_IMX_PLATFORM_LOWER)*.bin \
+	       $(TARGET_DIR)/lib/firmware/imx/sdma/
+endef
+endif
+
+ifeq ($(BR2_PACKAGE_FIRMWARE_IMX_VPU),y)
+
+ifeq ($(BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8X),y)
+define FIRMWARE_IMX_INSTALL_TARGET_VPU_FW
 	$(INSTALL) -D -m 0644 $(@D)/firmware/vpu/vpu_fw_imx8_dec.bin \
 		$(TARGET_DIR)/lib/firmware/vpu/vpu_fw_imx8_dec.bin
 	$(INSTALL) -D -m 0644 $(@D)/firmware/vpu/vpu_fw_imx8_enc.bin \
 		$(TARGET_DIR)/lib/firmware/vpu/vpu_fw_imx8_enc.bin
 endef
+
 else
-define FIRMWARE_IMX_INSTALL_TARGET_CMDS
-	mkdir -p $(TARGET_DIR)/lib/firmware/imx
-	for blobdir in $(FIRMWARE_IMX_BLOBS); do \
-		cp -r $(@D)/firmware/$${blobdir} $(TARGET_DIR)/lib/firmware/imx; \
-	done
-	cp -r $(@D)/firmware/epdc $(TARGET_DIR)/lib/firmware/imx
-	mv $(TARGET_DIR)/lib/firmware/imx/epdc/epdc_ED060XH2C1.fw.nonrestricted \
-		$(TARGET_DIR)/lib/firmware/imx/epdc/epdc_ED060XH2C1.fw
+define FIRMWARE_IMX_INSTALL_TARGET_VPU_FW
+	mkdir -p $(TARGET_DIR)/lib/firmware/imx/vpu
+	cp $(@D)/firmware/vpu/vpu_fw_$(FIRMWARE_IMX_PLATFORM_LOWER)*.bin \
+		$(TARGET_DIR)/lib/firmware/imx/vpu/
 endef
 endif
+endif
+
+define FIRMWARE_IMX_INSTALL_IMAGES_CMDS
+	$(FIRMWARE_IMX_PREPARE_DDR_FW)
+	$(FIRMWARE_IMX_PREPARE_HDMI_FW)
+endef
+
+define FIRMWARE_IMX_INSTALL_TARGET_CMDS
+	$(FIRMWARE_IMX_INSTALL_TARGET_EPDC_FW)
+	$(FIRMWARE_IMX_INSTALL_TARGET_SDMA_FW)
+	$(FIRMWARE_IMX_INSTALL_TARGET_VPU_FW)
+endef
 
 $(eval $(generic-package))
-- 
2.7.4

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

* [Buildroot] [PATCH v3 2/4] package/freescale-imx/firmware-imx: Fix sdma/vpu firmware install path
  2020-07-10 12:00 ` [Buildroot] [PATCH v3 2/4] package/freescale-imx/firmware-imx: Fix sdma/vpu firmware install path Stephane Viau
@ 2020-07-11 14:11   ` Thomas Petazzoni
  0 siblings, 0 replies; 11+ messages in thread
From: Thomas Petazzoni @ 2020-07-11 14:11 UTC (permalink / raw)
  To: buildroot

On Fri, 10 Jul 2020 14:00:43 +0200
Stephane Viau <stephane.viau@oss.nxp.com> wrote:

> In a patch set that did not get in for other reasons, Sebastien proposed
> to fix the install path directory of the sdma and vpu firmware code [1]:
> 
> 	"Mainline and NXP kernels expect the sdma firmware to be in
> 	/lib/firmware/imx/sdma so fix the install path [...]"
> 
> By looking at the code, I believe this is correct even though I have no
> means to test it.
> 
> [1] http://lists.busybox.net/pipermail/buildroot/2020-June/284875.html
> 
> Suggested-by: S?bastien Szymanski <sebastien.szymanski@armadeus.com>
> Signed-off-by: Stephane Viau <stephane.viau@oss.nxp.com>
> ---
>  package/freescale-imx/firmware-imx/firmware-imx.mk | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* [Buildroot] [PATCH v3 1/4] package/freescale-imx: Move DDR FW choice down to firmware-imx package
  2020-07-10 12:00 ` [Buildroot] [PATCH v3 1/4] package/freescale-imx: Move DDR FW choice down to firmware-imx package Stephane Viau
@ 2020-07-11 20:48   ` Thomas Petazzoni
  2020-07-12  6:10     ` Yann E. MORIN
  0 siblings, 1 reply; 11+ messages in thread
From: Thomas Petazzoni @ 2020-07-11 20:48 UTC (permalink / raw)
  To: buildroot

Hello,

On Fri, 10 Jul 2020 14:00:42 +0200
Stephane Viau <stephane.viau@oss.nxp.com> wrote:

> The DDR FW along with all other FW code that need to be used in
> bootloader or installed on target are related to the firmware-imx package.
> 
> This patch does this job as well as fixing the conjugation of NEED*s* in
> the symbol name. Also take advantage of this patch to make the DDR FW
> dependant on BR2_PACKAGE_FIRMWARE_IMX.
> 
> Note that BR2_PACKAGE_FIRMWARE_IMX_xxx is the preferred naming
> convention for the upcoming couple of patches.
> 
> Suggested-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> Signed-off-by: Stephane Viau <stephane.viau@oss.nxp.com>

I have applied, with some changes. See below.

>  choice
>  	bool "DDR training binaries"
> -	default BR2_PACKAGE_FIRMWARE_DDRFW_LPDDR4
> +	default BR2_PACKAGE_FIRMWARE_IMX_LPDDR4
>  	help
>  	  Choose the DDR training binaries to be used depending on the
>  	  kind of memory that is available on the target board (DDR4,
>  	  LPDDR4, etc...).
>  
> -config BR2_PACKAGE_FIRMWARE_DDRFW_LPDDR4
> +config BR2_PACKAGE_FIRMWARE_IMX_LPDDR4

When renaming options, we need to keep the old option name in
Config.in.legacy so that it doesn't get silently dropped when users
update to a newer Buildroot version.

>  	bool "lpddr4"
>  	help
>  	  Use LPDDR4 binaries (i.e.: lpddr4_pmu_train_*.bin)
>  
> -config BR2_PACKAGE_FIRMWARE_DDRFW_DDR4
> +config BR2_PACKAGE_FIRMWARE_IMX_DDR4

Same here.

I fixed that when applying.

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* [Buildroot] [PATCH v3 3/4] package/freescale-imx/firmware-imx: Add option for all i.MX FW needs
  2020-07-10 12:00 ` [Buildroot] [PATCH v3 3/4] package/freescale-imx/firmware-imx: Add option for all i.MX FW needs Stephane Viau
@ 2020-07-11 20:51   ` Thomas Petazzoni
  0 siblings, 0 replies; 11+ messages in thread
From: Thomas Petazzoni @ 2020-07-11 20:51 UTC (permalink / raw)
  To: buildroot

On Fri, 10 Jul 2020 14:00:44 +0200
Stephane Viau <stephane.viau@oss.nxp.com> wrote:

> Some SoC need a HDMI FW for their bootloader, some other require EPDC,
> SDMA and/or VPU.
> Instead of trying to "guess" what firmware images need to be installed
> in firmware-imx.mk, let the Config framework do the job and allow each
> SoC to pick what firmware they need.
> 
> Note that this patch should also help introducing an eventual DP FW, as
> Gary mentioned in a separate thread [1].
> 
> [1] http://lists.busybox.net/pipermail/buildroot/2020-May/283181.html
> 
> Suggested-by: Yann E. MORIN <yann.morin.1998@free.fr>
> Suggested-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> Signed-off-by: Stephane Viau <stephane.viau@oss.nxp.com>

I have applied with some changes. See below.

> -	  It contains blobs for SDMA and VPU.
> +	  It contains blobs for SDMA, VPU, etc...

I've improved this with a complete list of the firmware that it can
potentially install.

>  
>  	  This library is provided by Freescale as-is and doesn't have
>  	  an upstream.
>  
> +config BR2_PACKAGE_FIRMWARE_IMX_SDMA

Renamed to:

	BR2_PACKAGE_FIRMWARE_IMX_NEEDS_SDMA_FW

to match the naming of the DDR firmware option.

> +	bool
> +	default y if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX25_3STACK
> +	default y if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX27ADS
> +	default y if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX37_3STACK
> +	default y if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX50
> +	default y if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX51
> +	default y if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX53
> +	default y if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX6Q
> +	default y if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX6S
> +	default y if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX6UL
> +	default y if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX7

When you look at the sdma folder, it contains:

sdma-imx25-to1.bin
sdma-imx31-to1.bin
sdma-imx31-to2.bin
sdma-imx35-to1.bin
sdma-imx35-to2.bin
sdma-imx51-to3.bin
sdma-imx53-to1.bin
sdma-imx6q.bin
sdma-imx7d.bin

So there is no firmware for i.MX37, i.MX50, i.MX6S and i.MX6UL, so I
dropped these from the supported platform.

> +	depends on BR2_PACKAGE_FIRMWARE_IMX

Instead of repeating this, I've enclosed all options in a "if
BR2_PACKAGE_FIRMWARE_IMX ... endif" block.

> +
> +config BR2_PACKAGE_FIRMWARE_IMX_VPU

Ditto naming.

> +	bool
> +	default y if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX27ADS
> +	default y if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX51
> +	default y if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX53
> +	default y if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX6Q
> +	default y if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8
> +	default y if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8X
> +	depends on BR2_PACKAGE_FIRMWARE_IMX

Ditto dependency.

And same for the other options as well.

I fixed these issues when applying.

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* [Buildroot] [PATCH v3 4/4] package/freescale-imx/firmware-imx: Clean up the image/target semantic
  2020-07-10 12:00 ` [Buildroot] [PATCH v3 4/4] package/freescale-imx/firmware-imx: Clean up the image/target semantic Stephane Viau
@ 2020-07-11 20:53   ` Thomas Petazzoni
  0 siblings, 0 replies; 11+ messages in thread
From: Thomas Petazzoni @ 2020-07-11 20:53 UTC (permalink / raw)
  To: buildroot

On Fri, 10 Jul 2020 14:00:45 +0200
Stephane Viau <stephane.viau@oss.nxp.com> wrote:

> The newly introduced BR2_PACKAGE_FIRMWARE_IMX_xxx symbols shall be
> used in lieue of the SoC type when installing images or binaries on
> target.
> 
> These new symbols let us define FIRMWARE_IMX_INSTALL_IMAGES_CMDS and
> FIRMWARE_IMX_INSTALL_TARGET_CMDS based on platform needs rather than
> SoC type.
> 
> Suggested-by: Yann E. MORIN <yann.morin.1998@free.fr>
> Signed-off-by: Stephane Viau <stephane.viau@oss.nxp.com>

I've applied, with some changes:

- I dropped the BR2_PACKAGE_FIRMWARE_IMX_NEEDS_DDR_FW conditional, and
  instead just use conditions on BR2_PACKAGE_FIRMWARE_IMX_LPDDR4 and
  BR2_PACKAGE_FIRMWARE_IMX_DDR4

- I renamed FIRMWARE_IMX_PREPARE_DDR_FW to
  FIRMWARE_IMX_INSTALL_IMAGE_DDR_FW, because what it does is really
  install the firmware.

- I've used the correct option names after my changes on PATCH 3/4.

- I simplified the VPU installation tweak for i.MX8X.

I've done a few tests, but if you can have a second look at what I
committed, it would be useful.

Thanks a lot!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* [Buildroot] [PATCH v3 1/4] package/freescale-imx: Move DDR FW choice down to firmware-imx package
  2020-07-11 20:48   ` Thomas Petazzoni
@ 2020-07-12  6:10     ` Yann E. MORIN
  2020-07-12  8:28       ` Thomas Petazzoni
  0 siblings, 1 reply; 11+ messages in thread
From: Yann E. MORIN @ 2020-07-12  6:10 UTC (permalink / raw)
  To: buildroot

Thomas, All,

On 2020-07-11 22:48 +0200, Thomas Petazzoni spake thusly:
> On Fri, 10 Jul 2020 14:00:42 +0200
> Stephane Viau <stephane.viau@oss.nxp.com> wrote:
[--SNIP--]
> > -config BR2_PACKAGE_FIRMWARE_DDRFW_LPDDR4
> > +config BR2_PACKAGE_FIRMWARE_IMX_LPDDR4
> 
> When renaming options, we need to keep the old option name in
> Config.in.legacy so that it doesn't get silently dropped when users
> update to a newer Buildroot version.

That was not necessary, because BR2_PACKAGE_FIRMWARE_DDRFW_LPDDR4 was
only introduced after 2020.05, so we have no release with the symbol.

> >  	bool "lpddr4"
> >  	help
> >  	  Use LPDDR4 binaries (i.e.: lpddr4_pmu_train_*.bin)
> >  
> > -config BR2_PACKAGE_FIRMWARE_DDRFW_DDR4
> > +config BR2_PACKAGE_FIRMWARE_IMX_DDR4
> 
> Same here.

Ditto.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

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

* [Buildroot] [PATCH v3 1/4] package/freescale-imx: Move DDR FW choice down to firmware-imx package
  2020-07-12  6:10     ` Yann E. MORIN
@ 2020-07-12  8:28       ` Thomas Petazzoni
  0 siblings, 0 replies; 11+ messages in thread
From: Thomas Petazzoni @ 2020-07-12  8:28 UTC (permalink / raw)
  To: buildroot

On Sun, 12 Jul 2020 08:10:11 +0200
"Yann E. MORIN" <yann.morin.1998@free.fr> wrote:

> > When renaming options, we need to keep the old option name in
> > Config.in.legacy so that it doesn't get silently dropped when users
> > update to a newer Buildroot version.  
> 
> That was not necessary, because BR2_PACKAGE_FIRMWARE_DDRFW_LPDDR4 was
> only introduced after 2020.05, so we have no release with the symbol.

Gah, indeed, I missed that. I fixed it up in a follow-up commit. Thanks
for noticing!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

end of thread, other threads:[~2020-07-12  8:28 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-10 12:00 [Buildroot] [PATCH v3 0/4] package/freescale-imx: clean-up proposal Stephane Viau
2020-07-10 12:00 ` [Buildroot] [PATCH v3 1/4] package/freescale-imx: Move DDR FW choice down to firmware-imx package Stephane Viau
2020-07-11 20:48   ` Thomas Petazzoni
2020-07-12  6:10     ` Yann E. MORIN
2020-07-12  8:28       ` Thomas Petazzoni
2020-07-10 12:00 ` [Buildroot] [PATCH v3 2/4] package/freescale-imx/firmware-imx: Fix sdma/vpu firmware install path Stephane Viau
2020-07-11 14:11   ` Thomas Petazzoni
2020-07-10 12:00 ` [Buildroot] [PATCH v3 3/4] package/freescale-imx/firmware-imx: Add option for all i.MX FW needs Stephane Viau
2020-07-11 20:51   ` Thomas Petazzoni
2020-07-10 12:00 ` [Buildroot] [PATCH v3 4/4] package/freescale-imx/firmware-imx: Clean up the image/target semantic Stephane Viau
2020-07-11 20:53   ` Thomas Petazzoni

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.