All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/freescale-imx/firmware-imx: custom padding
@ 2020-09-10 14:18 Pieter De Gendt
  2020-09-11 13:29 ` Stephane Viau
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Pieter De Gendt @ 2020-09-10 14:18 UTC (permalink / raw)
  To: buildroot

From: Tibault Damman <tibault.damman@basalte.be>

Some derivatives (such as Variscite imx8mm) require the training data to
be padded to a different loading address.

Signed-off-by: Tibault Damman <tibault.damman@basalte.be>
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
---
 package/freescale-imx/firmware-imx/Config.in       | 12 ++++++++++++
 package/freescale-imx/firmware-imx/firmware-imx.mk |  6 ++++--
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/package/freescale-imx/firmware-imx/Config.in b/package/freescale-imx/firmware-imx/Config.in
index 5becf8b6a9..c947248ee1 100644
--- a/package/freescale-imx/firmware-imx/Config.in
+++ b/package/freescale-imx/firmware-imx/Config.in
@@ -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
diff --git a/package/freescale-imx/firmware-imx/firmware-imx.mk b/package/freescale-imx/firmware-imx/firmware-imx.mk
index eb8595f022..1ace002d5b 100644
--- a/package/freescale-imx/firmware-imx/firmware-imx.mk
+++ b/package/freescale-imx/firmware-imx/firmware-imx.mk
@@ -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 \
-- 
2.25.1

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

* [Buildroot] [PATCH 1/1] package/freescale-imx/firmware-imx: custom padding
  2020-09-10 14:18 [Buildroot] [PATCH 1/1] package/freescale-imx/firmware-imx: custom padding Pieter De Gendt
@ 2020-09-11 13:29 ` Stephane Viau
  2020-09-11 13:41 ` Gary Bisson
  2020-09-15 13:04 ` [Buildroot] [PATCH v2 " Pieter De Gendt
  2 siblings, 0 replies; 7+ messages in thread
From: Stephane Viau @ 2020-09-11 13:29 UTC (permalink / raw)
  To: buildroot

>
>________________________________________
>From: buildroot <buildroot-bounces@busybox.net> on behalf of Pieter De Gendt <pieter.degendt@gmail.com>
>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
>
>From: Tibault Damman <tibault.damman@basalte.be>
>
>Some derivatives (such as Variscite imx8mm) require the training data to
>be padded to a different loading address.
>
>Signed-off-by: Tibault Damman <tibault.damman@basalte.be>
>Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>

Tested-by: Stephane Viau stephane.viau at oss.nxp.com
[Stephane: tested on i.MX8MNano EVK with DDR4]


>---
> package/freescale-imx/firmware-imx/Config.in       | 12 ++++++++++++
> package/freescale-imx/firmware-imx/firmware-imx.mk |  6 ++++--
> 2 files changed, 16 insertions(+), 2 deletions(-)
>
>diff --git a/package/freescale-imx/firmware-imx/Config.in b/package/freescale-imx/firmware-imx/Config.in
>index 5becf8b6a9..c947248ee1 100644
>--- a/package/freescale-imx/firmware-imx/Config.in
>+++ b/package/freescale-imx/firmware-imx/Config.in
>@@ -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
>diff --git a/package/freescale-imx/firmware-imx/firmware-imx.mk b/package/freescale-imx/firmware-imx/firmware-imx.mk
>index eb8595f022..1ace002d5b 100644
>--- a/package/freescale-imx/firmware-imx/firmware-imx.mk
>+++ b/package/freescale-imx/firmware-imx/firmware-imx.mk
>@@ -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 \
>--
>2.25.1
>
>_______________________________________________
>buildroot mailing list
>buildroot at busybox.net
>http://lists.busybox.net/mailman/listinfo/buildroot
>

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

* [Buildroot] [PATCH 1/1] package/freescale-imx/firmware-imx: custom padding
  2020-09-10 14:18 [Buildroot] [PATCH 1/1] package/freescale-imx/firmware-imx: custom padding Pieter De Gendt
  2020-09-11 13:29 ` Stephane Viau
@ 2020-09-11 13:41 ` Gary Bisson
  2020-09-15 13:04 ` [Buildroot] [PATCH v2 " Pieter De Gendt
  2 siblings, 0 replies; 7+ messages in thread
From: Gary Bisson @ 2020-09-11 13:41 UTC (permalink / raw)
  To: buildroot

Hi,

Overall the patch is good, below are some small comments about the log
and the variable naming.

On Thu, Sep 10, 2020 at 04:18:43PM +0200, Pieter De Gendt wrote:
> From: Tibault Damman <tibault.damman@basalte.be>
> 
> 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.

> Signed-off-by: Tibault Damman <tibault.damman@basalte.be>
> Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
> ---
>  package/freescale-imx/firmware-imx/Config.in       | 12 ++++++++++++
>  package/freescale-imx/firmware-imx/firmware-imx.mk |  6 ++++--
>  2 files changed, 16 insertions(+), 2 deletions(-)
> 
> diff --git a/package/freescale-imx/firmware-imx/Config.in b/package/freescale-imx/firmware-imx/Config.in
> index 5becf8b6a9..c947248ee1 100644
> --- a/package/freescale-imx/firmware-imx/Config.in
> +++ b/package/freescale-imx/firmware-imx/Config.in
> @@ -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.

> +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
> diff --git a/package/freescale-imx/firmware-imx/firmware-imx.mk b/package/freescale-imx/firmware-imx/firmware-imx.mk
> index eb8595f022..1ace002d5b 100644
> --- a/package/freescale-imx/firmware-imx/firmware-imx.mk
> +++ b/package/freescale-imx/firmware-imx/firmware-imx.mk
> @@ -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 \

Other than that I'm okay with the patch.

Regards,
Gary

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

* [Buildroot] [PATCH v2 1/1] package/freescale-imx/firmware-imx: custom padding
  2020-09-10 14:18 [Buildroot] [PATCH 1/1] package/freescale-imx/firmware-imx: custom padding Pieter De Gendt
  2020-09-11 13:29 ` Stephane Viau
  2020-09-11 13:41 ` Gary Bisson
@ 2020-09-15 13:04 ` Pieter De Gendt
  2020-09-15 13:19   ` Gary Bisson
  2020-11-03 21:54   ` Thomas Petazzoni
  2 siblings, 2 replies; 7+ messages in thread
From: Pieter De Gendt @ 2020-09-15 13:04 UTC (permalink / raw)
  To: buildroot

From: Tibault Damman <tibault.damman@basalte.be>

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>

---
Changes v1 -> v2:
  - improved description
  - renamed variables to match U-Boot (suggested by Gary Bisson)

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
---
 package/freescale-imx/firmware-imx/Config.in       | 12 ++++++++++++
 package/freescale-imx/firmware-imx/firmware-imx.mk |  6 ++++--
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/package/freescale-imx/firmware-imx/Config.in b/package/freescale-imx/firmware-imx/Config.in
index 5becf8b6a9..587f402426 100644
--- a/package/freescale-imx/firmware-imx/Config.in
+++ b/package/freescale-imx/firmware-imx/Config.in
@@ -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
diff --git a/package/freescale-imx/firmware-imx/firmware-imx.mk b/package/freescale-imx/firmware-imx/firmware-imx.mk
index eb8595f022..fb3cfe640b 100644
--- a/package/freescale-imx/firmware-imx/firmware-imx.mk
+++ b/package/freescale-imx/firmware-imx/firmware-imx.mk
@@ -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 \
-- 
2.25.1

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

* [Buildroot] [PATCH v2 1/1] package/freescale-imx/firmware-imx: custom padding
  2020-09-15 13:04 ` [Buildroot] [PATCH v2 " Pieter De Gendt
@ 2020-09-15 13:19   ` Gary Bisson
  2020-09-16  6:30     ` Stephane Viau
  2020-11-03 21:54   ` Thomas Petazzoni
  1 sibling, 1 reply; 7+ messages in thread
From: Gary Bisson @ 2020-09-15 13:19 UTC (permalink / raw)
  To: buildroot

Hi Pieter,

On Tue, Sep 15, 2020 at 03:04:14PM +0200, Pieter De Gendt wrote:
> From: Tibault Damman <tibault.damman@basalte.be>
> 
> 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>
> 
> ---
> Changes v1 -> v2:
>   - improved description
>   - renamed variables to match U-Boot (suggested by Gary Bisson)
> 
> Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>

Reviewed-by: Gary Bisson <gary.bisson@boundarydevices.com>

Thanks for your contribution!

Regards,
Gary

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

* [Buildroot] [PATCH v2 1/1] package/freescale-imx/firmware-imx: custom padding
  2020-09-15 13:19   ` Gary Bisson
@ 2020-09-16  6:30     ` Stephane Viau
  0 siblings, 0 replies; 7+ messages in thread
From: Stephane Viau @ 2020-09-16  6:30 UTC (permalink / raw)
  To: buildroot

Hi Pieter, Gary and all,

>
>Hi Pieter,
>
>On Tue, Sep 15, 2020 at 03:04:14PM +0200, Pieter De Gendt wrote:
>> From: Tibault Damman <tibault.damman@basalte.be>
>>
>> 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>
>>
>> ---
>> Changes v1 -> v2:
>>   - improved description
>>   - renamed variables to match U-Boot (suggested by Gary Bisson)
>>
>> 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>
[Stephane: tested on i.MX8MM, i.MX8MN(ddr4) and i.MX8MQ EVK]
  
>
>Thanks for your contribution!
>
>Regards,
>Gary
>_______________________________________________
>buildroot mailing list
>buildroot at busybox.net
>http://lists.busybox.net/mailman/listinfo/buildroot
>

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

* [Buildroot] [PATCH v2 1/1] package/freescale-imx/firmware-imx: custom padding
  2020-09-15 13:04 ` [Buildroot] [PATCH v2 " Pieter De Gendt
  2020-09-15 13:19   ` Gary Bisson
@ 2020-11-03 21:54   ` Thomas Petazzoni
  1 sibling, 0 replies; 7+ messages in thread
From: Thomas Petazzoni @ 2020-11-03 21:54 UTC (permalink / raw)
  To: buildroot

On Tue, 15 Sep 2020 15:04:14 +0200
Pieter De Gendt <pieter.degendt@gmail.com> wrote:

> From: Tibault Damman <tibault.damman@basalte.be>
> 
> 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>
> 
> ---
> Changes v1 -> v2:
>   - improved description
>   - renamed variables to match U-Boot (suggested by Gary Bisson)

Applied to master, thanks!

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

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

end of thread, other threads:[~2020-11-03 21:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-10 14:18 [Buildroot] [PATCH 1/1] package/freescale-imx/firmware-imx: custom padding Pieter De Gendt
2020-09-11 13:29 ` Stephane Viau
2020-09-11 13:41 ` Gary Bisson
2020-09-15 13:04 ` [Buildroot] [PATCH v2 " Pieter De Gendt
2020-09-15 13:19   ` Gary Bisson
2020-09-16  6:30     ` Stephane Viau
2020-11-03 21:54   ` 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.