package/freescale-imx/firmware-imx: custom padding
authorTibault Damman <tibault.damman@basalte.be>
Tue, 15 Sep 2020 13:04:14 +0000 (15:04 +0200)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Tue, 3 Nov 2020 21:53:34 +0000 (22:53 +0100)
Some derivatives (such as Variscite imx8mm) expect the (LP)DDR4
training data to be padded to a different length.

eg: https://github.com/varigit/uboot-imx/commit/5f8d814f

This patch makes the padding length configurable.

Signed-off-by: Tibault Damman <tibault.damman@basalte.be>
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
Reviewed-by: Gary Bisson <gary.bisson@boundarydevices.com>
Tested-by: Stephane Viau <stephane.viau@oss.nxp.com>
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 5becf8b6a92c14d787d4deb4850813def0e42c60..587f402426950368066cd373b60d15f6a8cfd5a0 100644 (file)
@@ -69,6 +69,18 @@ config BR2_PACKAGE_FIRMWARE_IMX_DDR4
 
 endchoice # DDR training FW
 
+config BR2_PACKAGE_FIRMWARE_IMX_IMEM_LEN
+       hex "(LP)DDR IMEM padding length"
+       default 0x8000
+       help
+         The IMEM firmware will be padded to this length
+
+config BR2_PACKAGE_FIRMWARE_IMX_DMEM_LEN
+       hex "(LP)DDR DMEM padding length"
+       default 0x4000
+       help
+         The DMEM firmware will be padded to this length
+
 endif # BR2_PACKAGE_FIRMWARE_IMX_NEEDS_DDR_FW
 
 endif # BR2_PACKAGE_FIRMWARE_IMX
index eb8595f0229ec1d1e792d88b56314f451197bc9f..fb3cfe640b36629cc9aa5b59e261e780a0e6ced6 100644 (file)
@@ -23,10 +23,12 @@ endef
 #
 
 define FIRMWARE_IMX_PREPARE_DDR_FW
-       $(TARGET_OBJCOPY) -I binary -O binary --pad-to 0x8000 --gap-fill=0x0 \
+       $(TARGET_OBJCOPY) -I binary -O binary \
+               --pad-to $(BR2_PACKAGE_FIRMWARE_IMX_IMEM_LEN) --gap-fill=0x0 \
                $(FIRMWARE_IMX_DDRFW_DIR)/$(strip $(1)).bin \
                $(FIRMWARE_IMX_DDRFW_DIR)/$(strip $(1))_pad.bin
-       $(TARGET_OBJCOPY) -I binary -O binary --pad-to 0x4000 --gap-fill=0x0 \
+       $(TARGET_OBJCOPY) -I binary -O binary \
+               --pad-to $(BR2_PACKAGE_FIRMWARE_IMX_DMEM_LEN) --gap-fill=0x0 \
                $(FIRMWARE_IMX_DDRFW_DIR)/$(strip $(2)).bin \
                $(FIRMWARE_IMX_DDRFW_DIR)/$(strip $(2))_pad.bin
        cat $(FIRMWARE_IMX_DDRFW_DIR)/$(strip $(1))_pad.bin \