public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH] configs: am62x_evm_*: Set DFU buffer size to 256k
@ 2024-12-20 21:53 Jonathan Humphreys
  2025-01-04 17:05 ` Roger Quadros
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jonathan Humphreys @ 2024-12-20 21:53 UTC (permalink / raw)
  To: Mattijs Korpershoek, Roger Quadros, Jonathan Humphreys,
	Martyn Welch, Siddharth Vadapalli, Sjoerd Simons, Tom Rini,
	vigneshr
  Cc: u-boot

OSPI flash writing was broken on am62x SKs as the OSPI flash device has a
256k sector size but was set to 20k. This breaks OSPI flash writes because
the current implementation of the SF DFU backend requires that the DFU data
buffer size be the same as the sector erase size, and the USB DFU config
fragment (for both A53 and R5) reduced the size of the DFU data buffer,
presumably so that it can fit into SPL's much smaller heap.

Change the SYS_DFU_DATA_BUF_SIZE to the erase sector size, which still fits
within the post-relocation heap size in SPL.

Fixes: dfc2dff5a844 ("configs: am62x_evm_*: Enable USB and DFU support")

Signed-off-by: Jonathan Humphreys <j-humphreys@ti.com>
---
 configs/am62x_a53_usbdfu.config | 2 +-
 configs/am62x_r5_usbdfu.config  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/configs/am62x_a53_usbdfu.config b/configs/am62x_a53_usbdfu.config
index 0d3c6df1e73..812f99ee70b 100644
--- a/configs/am62x_a53_usbdfu.config
+++ b/configs/am62x_a53_usbdfu.config
@@ -10,7 +10,7 @@ CONFIG_SYSCON=y
 CONFIG_SPL_SYSCON=y
 CONFIG_DFU_MMC=y
 CONFIG_DFU_RAM=y
-CONFIG_SYS_DFU_DATA_BUF_SIZE=0x5000
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x40000
 CONFIG_SYS_DFU_MAX_FILE_SIZE=0x800000
 CONFIG_USB=y
 CONFIG_DM_USB_GADGET=y
diff --git a/configs/am62x_r5_usbdfu.config b/configs/am62x_r5_usbdfu.config
index 772bb2ab935..efaae504c1a 100644
--- a/configs/am62x_r5_usbdfu.config
+++ b/configs/am62x_r5_usbdfu.config
@@ -1,7 +1,7 @@
 CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SYSCON=y
 CONFIG_SPL_SYSCON=y
-CONFIG_SYS_DFU_DATA_BUF_SIZE=0x5000
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x40000
 CONFIG_MISC=y
 CONFIG_USB=y
 CONFIG_DM_USB_GADGET=y
-- 
2.34.1


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

* Re: [PATCH] configs: am62x_evm_*: Set DFU buffer size to 256k
  2024-12-20 21:53 [PATCH] configs: am62x_evm_*: Set DFU buffer size to 256k Jonathan Humphreys
@ 2025-01-04 17:05 ` Roger Quadros
  2025-01-16  8:38 ` Mattijs Korpershoek
  2025-01-21 17:34 ` Tom Rini
  2 siblings, 0 replies; 4+ messages in thread
From: Roger Quadros @ 2025-01-04 17:05 UTC (permalink / raw)
  To: Jonathan Humphreys, Mattijs Korpershoek, Martyn Welch,
	Siddharth Vadapalli, Sjoerd Simons, Tom Rini, vigneshr
  Cc: u-boot



On 20/12/2024 23:53, Jonathan Humphreys wrote:
> OSPI flash writing was broken on am62x SKs as the OSPI flash device has a
> 256k sector size but was set to 20k. This breaks OSPI flash writes because
> the current implementation of the SF DFU backend requires that the DFU data
> buffer size be the same as the sector erase size, and the USB DFU config
> fragment (for both A53 and R5) reduced the size of the DFU data buffer,
> presumably so that it can fit into SPL's much smaller heap.
> 
> Change the SYS_DFU_DATA_BUF_SIZE to the erase sector size, which still fits
> within the post-relocation heap size in SPL.
> 
> Fixes: dfc2dff5a844 ("configs: am62x_evm_*: Enable USB and DFU support")
> 
> Signed-off-by: Jonathan Humphreys <j-humphreys@ti.com>

Reviewed-by: Roger Quadros <rogerq@kernel.org>


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

* Re: [PATCH] configs: am62x_evm_*: Set DFU buffer size to 256k
  2024-12-20 21:53 [PATCH] configs: am62x_evm_*: Set DFU buffer size to 256k Jonathan Humphreys
  2025-01-04 17:05 ` Roger Quadros
@ 2025-01-16  8:38 ` Mattijs Korpershoek
  2025-01-21 17:34 ` Tom Rini
  2 siblings, 0 replies; 4+ messages in thread
From: Mattijs Korpershoek @ 2025-01-16  8:38 UTC (permalink / raw)
  To: Jonathan Humphreys, Roger Quadros, Jonathan Humphreys,
	Martyn Welch, Siddharth Vadapalli, Sjoerd Simons, Tom Rini,
	vigneshr
  Cc: u-boot

Hi John,

Thank you for the patch.

On ven., déc. 20, 2024 at 15:53, Jonathan Humphreys <j-humphreys@ti.com> wrote:

> OSPI flash writing was broken on am62x SKs as the OSPI flash device has a
> 256k sector size but was set to 20k. This breaks OSPI flash writes because
> the current implementation of the SF DFU backend requires that the DFU data
> buffer size be the same as the sector erase size, and the USB DFU config
> fragment (for both A53 and R5) reduced the size of the DFU data buffer,
> presumably so that it can fit into SPL's much smaller heap.
>
> Change the SYS_DFU_DATA_BUF_SIZE to the erase sector size, which still fits
> within the post-relocation heap size in SPL.
>
> Fixes: dfc2dff5a844 ("configs: am62x_evm_*: Enable USB and DFU support")
>
> Signed-off-by: Jonathan Humphreys <j-humphreys@ti.com>

Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>

> ---
>  configs/am62x_a53_usbdfu.config | 2 +-
>  configs/am62x_r5_usbdfu.config  | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/configs/am62x_a53_usbdfu.config b/configs/am62x_a53_usbdfu.config
> index 0d3c6df1e73..812f99ee70b 100644
> --- a/configs/am62x_a53_usbdfu.config
> +++ b/configs/am62x_a53_usbdfu.config
> @@ -10,7 +10,7 @@ CONFIG_SYSCON=y
>  CONFIG_SPL_SYSCON=y
>  CONFIG_DFU_MMC=y
>  CONFIG_DFU_RAM=y
> -CONFIG_SYS_DFU_DATA_BUF_SIZE=0x5000
> +CONFIG_SYS_DFU_DATA_BUF_SIZE=0x40000
>  CONFIG_SYS_DFU_MAX_FILE_SIZE=0x800000
>  CONFIG_USB=y
>  CONFIG_DM_USB_GADGET=y
> diff --git a/configs/am62x_r5_usbdfu.config b/configs/am62x_r5_usbdfu.config
> index 772bb2ab935..efaae504c1a 100644
> --- a/configs/am62x_r5_usbdfu.config
> +++ b/configs/am62x_r5_usbdfu.config
> @@ -1,7 +1,7 @@
>  CONFIG_SPL_ENV_SUPPORT=y
>  CONFIG_SYSCON=y
>  CONFIG_SPL_SYSCON=y
> -CONFIG_SYS_DFU_DATA_BUF_SIZE=0x5000
> +CONFIG_SYS_DFU_DATA_BUF_SIZE=0x40000
>  CONFIG_MISC=y
>  CONFIG_USB=y
>  CONFIG_DM_USB_GADGET=y
> -- 
> 2.34.1

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

* Re: [PATCH] configs: am62x_evm_*: Set DFU buffer size to 256k
  2024-12-20 21:53 [PATCH] configs: am62x_evm_*: Set DFU buffer size to 256k Jonathan Humphreys
  2025-01-04 17:05 ` Roger Quadros
  2025-01-16  8:38 ` Mattijs Korpershoek
@ 2025-01-21 17:34 ` Tom Rini
  2 siblings, 0 replies; 4+ messages in thread
From: Tom Rini @ 2025-01-21 17:34 UTC (permalink / raw)
  To: Mattijs Korpershoek, Roger Quadros, Martyn Welch,
	Siddharth Vadapalli, Sjoerd Simons, vigneshr, Jonathan Humphreys
  Cc: u-boot

On Fri, 20 Dec 2024 15:53:34 -0600, Jonathan Humphreys wrote:

> OSPI flash writing was broken on am62x SKs as the OSPI flash device has a
> 256k sector size but was set to 20k. This breaks OSPI flash writes because
> the current implementation of the SF DFU backend requires that the DFU data
> buffer size be the same as the sector erase size, and the USB DFU config
> fragment (for both A53 and R5) reduced the size of the DFU data buffer,
> presumably so that it can fit into SPL's much smaller heap.
> 
> [...]

Applied to u-boot/master, thanks!

-- 
Tom



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

end of thread, other threads:[~2025-01-21 17:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-20 21:53 [PATCH] configs: am62x_evm_*: Set DFU buffer size to 256k Jonathan Humphreys
2025-01-04 17:05 ` Roger Quadros
2025-01-16  8:38 ` Mattijs Korpershoek
2025-01-21 17:34 ` Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox