firmware-imx: add support for iMX8M firmware
authorErik Larsson <karl.erik.larsson@gmail.com>
Thu, 12 Apr 2018 12:35:22 +0000 (14:35 +0200)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Thu, 12 Apr 2018 20:03:04 +0000 (22:03 +0200)
Signed-off-by: Erik Larsson <karl.erik.larsson@gmail.com>
Signed-off-by: Christopher Dahlberg <crille.dahlberg@gmail.com>
[Thomas: use an intermediate FIRMWARE_IMX_DDRFW_DIR variable.]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/freescale-imx/firmware-imx/Config.in
package/freescale-imx/firmware-imx/firmware-imx.mk

index fca280a85ac9707a03389f206dc10c64da9f53ef..56d5b80741440f76c94712ad1d3d703259781045 100644 (file)
@@ -1,6 +1,6 @@
 config BR2_PACKAGE_FIRMWARE_IMX
        bool "firmware-imx"
-       depends on BR2_arm # Only relevant for i.MX
+       depends on BR2_arm || BR2_aarch64 # Only relevant for i.MX
        help
          Firmware blobs for the Freescale i.MX SoCs.
 
index d5387b38da61fef21761e751c60c5d409d31d7af..351496a7a7e8bfe811938d45a3314c3687854e14 100644 (file)
@@ -18,6 +18,34 @@ define FIRMWARE_IMX_EXTRACT_CMDS
        $(call FREESCALE_IMX_EXTRACT_HELPER,$(FIRMWARE_IMX_DL_DIR)/$(FIRMWARE_IMX_SOURCE))
 endef
 
+ifeq ($(BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8M),y)
+FIRMWARE_IMX_INSTALL_IMAGES = YES
+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 \
+               $(FIRMWARE_IMX_DDRFW_DIR)/lpddr4_pmu_train_$(1)_imem.bin \
+               $(FIRMWARE_IMX_DDRFW_DIR)/lpddr4_pmu_train_$(1)_imem_pad.bin
+       $(TARGET_OBJCOPY) -I binary -O binary --pad-to 0x4000 --gap-fill=0x0 \
+               $(FIRMWARE_IMX_DDRFW_DIR)/lpddr4_pmu_train_$(1)_dmem.bin \
+               $(FIRMWARE_IMX_DDRFW_DIR)/lpddr4_pmu_train_$(1)_dmem_pad.bin
+       cat $(FIRMWARE_IMX_DDRFW_DIR)/lpddr4_pmu_train_$(1)_imem_pad.bin \
+               $(FIRMWARE_IMX_DDRFW_DIR)/lpddr4_pmu_train_$(1)_dmem_pad.bin > \
+               $(FIRMWARE_IMX_DDRFW_DIR)/lpddr4_pmu_train_$(1)_fw.bin
+endef
+
+define FIRMWARE_IMX_INSTALL_IMAGES_CMDS
+       # Create padded versions of lpddr4_pmu_* and generate lpddr4_pmu_train_fw.bin.
+       # lpddr4_pmu_train_fw.bin isneeded when generating imx-boot-imx8mqevk-sd.bin
+       # which is done in post-image script.
+       $(call FIRMWARE_IMX_PREPARE_LPDDR4_FW,1d)
+       $(call FIRMWARE_IMX_PREPARE_LPDDR4_FW,2d)
+       cat $(FIRMWARE_IMX_DDRFW_DIR)/lpddr4_pmu_train_1d_fw.bin \
+               $(FIRMWARE_IMX_DDRFW_DIR)/lpddr4_pmu_train_2d_fw.bin > \
+               $(BINARIES_DIR)/lpddr4_pmu_train_fw.bin
+       cp $(@D)/firmware/hdmi/cadence/signed_hdmi_imx8m.bin \
+               $(BINARIES_DIR)/signed_hdmi_imx8m.bin
+endef
+else
 define FIRMWARE_IMX_INSTALL_TARGET_CMDS
        mkdir -p $(TARGET_DIR)/lib/firmware/imx
        for blobdir in $(FIRMWARE_IMX_BLOBS); do \
@@ -27,5 +55,6 @@ define FIRMWARE_IMX_INSTALL_TARGET_CMDS
        mv $(TARGET_DIR)/lib/firmware/imx/epdc/epdc_ED060XH2C1.fw.nonrestricted \
                $(TARGET_DIR)/lib/firmware/imx/epdc/epdc_ED060XH2C1.fw
 endef
+endif
 
 $(eval $(generic-package))