package/freescale-imx/firmware-imx: custom padding
PATCH 1/1 package/freescale-imx/firmware-imx: custom padding
From: Tibault Damman <[email protected]>
Some derivatives (such as Variscite imx8mm) require the training data to be padded to a different loading address.
--- package/freescale-imx/firmware-imx/Config.in | 12 ++++++++++++ package/freescale-imx/firmware-imx/firmware-imx.mk | 6 ++++-- 2 files changed, 16 insertions(+), 2 deletions(-)
package/freescale-imx/firmware-imx/Config.in +12 -0
@@ -69,6 +69,18 @@ config BR2_PACKAGE_FIRMWARE_IMX_DDR4 endchoice # DDR training FW +config BR2_PACKAGE_FIRMWARE_IMX_IMEM_ADDR + hex "(lp)ddr imem load address" + default 0x8000 + help + The training FW will be padded to start at this load address + +config BR2_PACKAGE_FIRMWARE_IMX_DMEM_ADDR + hex "(lp)ddr dmem load address" + default 0x4000 + help + The training FW will be padded to start at this load address + endif # BR2_PACKAGE_FIRMWARE_IMX_NEEDS_DDR_FW endif # BR2_PACKAGE_FIRMWARE_IMX
package/freescale-imx/firmware-imx/firmware-imx.mk +4 -2
@@ -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_ADDR) --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_ADDR) --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 \
Signature · 1 line
2.25.1
PATCH 1/1 package/freescale-imx/firmware-imx: custom padding
Quoted 8 lines
________________________________________
From: buildroot <[email protected]> on behalf of Pieter De Gendt <[email protected]>
Sent: Thursday, September 10, 2020 2:18 PM
To: buildroot at buildroot.org
Cc: Refik Tuzakli; Pieter De Gendt; Tibault Damman; Gary Bisson
Subject: [Buildroot] [PATCH 1/1] package/freescale-imx/firmware-imx: custom padding
Quoted 7 lines
From: Tibault Damman <[email protected]>
Some derivatives (such as Variscite imx8mm) require the training data to be padded to a different loading address.
Signed-off-by Tibault Damman <[email protected]>Signed-off-by Pieter De Gendt <[email protected]>
Quoted 55 lines
---
package/freescale-imx/firmware-imx/Config.in | 12 ++++++++++++package/freescale-imx/firmware-imx/firmware-imx.mk| 6 ++++--2 files changed, 16 insertions(+), 2 deletions(-)package/freescale-imx/firmware-imx/Config.in +0
-0@@ -69,6 +69,18 @@ config BR2_PACKAGE_FIRMWARE_IMX_DDR4endchoice # DDR training FW
package/freescale-imx/firmware-imx/Config.in +12
-0+config BR2_PACKAGE_FIRMWARE_IMX_IMEM_ADDR + hex "(lp)ddr imem load address" + default 0x8000 + help + The training FW will be padded to start at this load address + +config BR2_PACKAGE_FIRMWARE_IMX_DMEM_ADDR + hex "(lp)ddr dmem load address" + default 0x4000 + help + The training FW will be padded to start at this load address +endif #
BR2_PACKAGE_FIRMWARE_IMX_NEEDS_DDR_FWendif #
BR2_PACKAGE_FIRMWARE_IMXpackage/freescale-imx/firmware-imx/firmware-imx.mk +0
-0@@ -23,10 +23,12 @@ endef #define
FIRMWARE_IMX_PREPARE_DDR_FWpackage/freescale-imx/firmware-imx/firmware-imx.mk +4
-3- $(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_ADDR) --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_ADDR) --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 \ --2.25.1
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
PATCH 1/1 package/freescale-imx/firmware-imx: custom padding
In reply to Pieter De GendtHi,
Overall the patch is good, below are some small comments about the log and the variable naming.
Quoted 4 lines · Pieter De Gendt
From: Tibault Damman <[email protected]>
Some derivatives (such as Variscite imx8mm) require the training data to be padded to a different loading address.
On IRC you pointed to the varigit commit were that change is made, might be good to include it here for reference.
https://github.com/varigit/uboot-imx/commit/5f8d814f
That also explains the motivation behind that change.
Quoted 12 lines
Signed-off-by Tibault Damman <[email protected]>Signed-off-by Pieter De Gendt <[email protected]>--- package/freescale-imx/firmware-imx/Config.in | 12 ++++++++++++ package/freescale-imx/firmware-imx/firmware-imx.mk | 6 ++++-- 2 files changed, 16 insertions(+), 2 deletions(-)package/freescale-imx/firmware-imx/Config.in +0
-0
package/freescale-imx/firmware-imx/Config.in config BR2_PACKAGE_FIRMWARE_IMX_DDR4 · line 76
Quoted 8 lines
package/freescale-imx/firmware-imx/Config.in +5
-0@@ -69,6 +69,18 @@ config BR2_PACKAGE_FIRMWARE_IMX_DDR4 endchoice # DDR training FW +config BR2_PACKAGE_FIRMWARE_IMX_IMEM_ADDR + hex "(lp)ddr imem load address" + default 0x8000 + help + The training FW will be padded to start at this load address
Not sure the description matches my understanding of that value. Isn't that value what the binary will be padded to (--pad-to). So I wouldn't say the training FW will be padded to start at the load address but instead to end at this address.
Maybe the variable should be renamed to IMEM_LEN (matching U-Boot naming) or IMEM_PAD_ADDR.
Quoted 18 lines
package/freescale-imx/firmware-imx/Config.in +6
-0+config BR2_PACKAGE_FIRMWARE_IMX_DMEM_ADDR + hex "(lp)ddr dmem load address" + default 0x4000 + help + The training FW will be padded to start at this load address + endif # BR2_PACKAGE_FIRMWARE_IMX_NEEDS_DDR_FW endif # BR2_PACKAGE_FIRMWARE_IMXpackage/freescale-imx/firmware-imx/firmware-imx.mk +0
-1@@ -23,10 +23,12 @@ endef # define FIRMWARE_IMX_PREPARE_DDR_FW - $(TARGET_OBJCOPY) -I binary -O binary --pad-to 0x8000 --gap-fill=0x0 \
package/freescale-imx/firmware-imx/firmware-imx.mk endef · line 34
Quoted 10 lines
package/freescale-imx/firmware-imx/firmware-imx.mk +4
-1+ $(TARGET_OBJCOPY) -I binary -O binary \ + --pad-to $(BR2_PACKAGE_FIRMWARE_IMX_IMEM_ADDR) --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_ADDR) --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 \
Other than that I'm okay with the patch.
Regards,
Gary
PATCH v2 1/1 package/freescale-imx/firmware-imx: custom padding
In reply to Pieter De GendtFrom: Tibault Damman <[email protected]>
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.
---
Changes v1 -> v2:
- improved description
- renamed variables to match U-Boot (suggested by Gary Bisson)
--- package/freescale-imx/firmware-imx/Config.in | 12 ++++++++++++ package/freescale-imx/firmware-imx/firmware-imx.mk | 6 ++++-- 2 files changed, 16 insertions(+), 2 deletions(-)
package/freescale-imx/firmware-imx/Config.in +12 -0
@@ -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
package/freescale-imx/firmware-imx/firmware-imx.mk +4 -2
@@ -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 \
Signature · 1 line
2.25.1
PATCH v2 1/1 package/freescale-imx/firmware-imx: custom padding
Hi Pieter,
Quoted 12 lines · Pieter De Gendt
From: Tibault Damman <[email protected]>
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 <[email protected]>Signed-off-by Pieter De Gendt <[email protected]>
Quoted 6 lines
---
Changes v1 -> v2:
- improved description
- renamed variables to match U-Boot (suggested by Gary Bisson)Signed-off-by Pieter De Gendt <[email protected]>
Thanks for your contribution!
Regards,
Gary
PATCH v2 1/1 package/freescale-imx/firmware-imx: custom padding
Hi Pieter, Gary and all,
Quoted 16 lines
Hi Pieter,
Quoted 12 lines · Pieter De Gendt
From: Tibault Damman <[email protected]>
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 <[email protected]>Signed-off-by Pieter De Gendt <[email protected]>
Quoted 8 lines
Quoted 6 lines
---
Changes v1 -> v2:
- improved description
- renamed variables to match U-Boot (suggested by Gary Bisson)Signed-off-by Pieter De Gendt <[email protected]>Reviewed-by Gary Bisson <[email protected]>
Quoted 10 lines
Thanks for your contribution!
Regards,
Gary
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Thomas Petazzoni
AppliedPATCH v2 1/1 package/freescale-imx/firmware-imx: custom padding
In reply to Pieter De GendtQuoted 9 lines · On Tue, 15 Sep 2020 15:04:14 +0200 Pieter De Gendt <[email protected]>…
From: Tibault Damman <[email protected]>
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.
Quoted 7 lines
Signed-off-by Tibault Damman <[email protected]>Signed-off-by Pieter De Gendt <[email protected]>---
Changes v1 -> v2:
- improved description
- renamed variables to match U-Boot (suggested by Gary Bisson)
Applied to master, thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com