Skip to contentSkip to conversation

verdin-am62: fix FASTBOOT_BUF_ADDR and FASTBOOT_BUF_SIZE

PATCH Superseded Hiago De Franco 2 participants 3 messages Nov 29, 2024 – Dec 2, 2024

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 verdin-am62: fix FASTBOOT_BUF_ADDR and FASTBOOT_BUF_SIZE

From: Hiago De Franco <[email protected]>

The current value of CONFIG_FASTBOOT_BUF_ADDR is incorrect for hardware with 512MB and 1GB of RAM. The RAM address ranges for these devices are:

- 512MB:
- Start: 0x80000000
- End: 0xA0000000
- 1GB:
- Start: 0x80000000
- End: 0xC0000000

The current buffer address makes fastboot downloads work only on hardware with 2GB of RAM.

To fix this issue:
1. Lower CONFIG_FASTBOOT_BUF_ADDR to 0x80080000. This places the buffer near the beginning of RAM with a 512KB offset, as starting at exactly 0x80000000 conflicts with the ATF load address. Following K3_ATF_LOAD_ADDR configuration, ATF is loaded at 0x80000000:

config K3_ATF_LOAD_ADDR
hex "Load address of ATF image"
default 0x80000000 if (SOC_K3_AM625 || SOC_K3_AM62A7 || SOC_K3_AM62P5 || SOC_K3_J722S) default 0x70000000
help
The load address for the ATF image. This value is used to build the FIT image header that places ATF in memory where it will run.

2. Reduce the size of the download buffer to 128MB, avoiding overlaps with RAMDISK_ADDR_R. This is a good enough value for individual downloads.

Theses changes make fastboot downloads work with 512MB and 1GB devices.

Fixes defe30a78b76 ("verdin-am62: add DFU, USB and UUU fastboot support")
---
 configs/verdin-am62_a53_defconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
configs/verdin-am62_a53_defconfig +2 -2
index 49fb9790e295..6fa1a9d2c552 100644
@@ -122,8 +122,8 @@ CONFIG_SYS_DFU_MAX_FILE_SIZE=0x800000
 CONFIG_DMA_CHANNELS=y
 CONFIG_TI_K3_NAVSS_UDMA=y
 CONFIG_USB_FUNCTION_FASTBOOT=y
-CONFIG_FASTBOOT_BUF_ADDR=0xC0000000
-CONFIG_FASTBOOT_BUF_SIZE=0x2F000000
+CONFIG_FASTBOOT_BUF_ADDR=0x80080000
+CONFIG_FASTBOOT_BUF_SIZE=0x8000000
 CONFIG_FASTBOOT_UUU_SUPPORT=y
 CONFIG_TI_SCI_PROTOCOL=y
 CONFIG_GPIO_HOG=y
Signature · 1 line
2.39.5
#1 lore raw
Quoted 46 lines · Hiago De Franco

From: Hiago De Franco <[email protected]>

The current value of CONFIG_FASTBOOT_BUF_ADDR is incorrect for hardware with 512MB and 1GB of RAM. The RAM address ranges for these devices are:

- 512MB:
- Start: 0x80000000
- End: 0xA0000000
- 1GB:
- Start: 0x80000000
- End: 0xC0000000

The current buffer address makes fastboot downloads work only on hardware with 2GB of RAM.

To fix this issue:
1. Lower CONFIG_FASTBOOT_BUF_ADDR to 0x80080000. This places the buffer near the beginning of RAM with a 512KB offset, as starting at exactly 0x80000000 conflicts with the ATF load address. Following K3_ATF_LOAD_ADDR configuration, ATF is loaded at 0x80000000:

config K3_ATF_LOAD_ADDR
hex "Load address of ATF image"
default 0x80000000 if (SOC_K3_AM625 || SOC_K3_AM62A7 || SOC_K3_AM62P5 || SOC_K3_J722S) default 0x70000000
help
The load address for the ATF image. This value is used to build the FIT image header that places ATF in memory where it will run.

2. Reduce the size of the download buffer to 128MB, avoiding overlaps with RAMDISK_ADDR_R. This is a good enough value for individual downloads.

Theses changes make fastboot downloads work with 512MB and 1GB devices.

Fixes defe30a78b76 ("verdin-am62: add DFU, USB and UUU fastboot support")
---
 configs/verdin-am62_a53_defconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
configs/verdin-am62_a53_defconfig +0 -0
index 49fb9790e295..6fa1a9d2c552 100644

configs/verdin-am62_a53_defconfig CONFIG_SYS_DFU_MAX_FILE_SIZE=0x800000 · line 129

Quoted 10 lines
configs/verdin-am62_a53_defconfig +2 -2
@@ -122,8 +122,8 @@ CONFIG_SYS_DFU_MAX_FILE_SIZE=0x800000
 CONFIG_DMA_CHANNELS=y
 CONFIG_TI_K3_NAVSS_UDMA=y
 CONFIG_USB_FUNCTION_FASTBOOT=y
-CONFIG_FASTBOOT_BUF_ADDR=0xC0000000
-CONFIG_FASTBOOT_BUF_SIZE=0x2F000000
+CONFIG_FASTBOOT_BUF_ADDR=0x80080000
+CONFIG_FASTBOOT_BUF_SIZE=0x8000000
 CONFIG_FASTBOOT_UUU_SUPPORT=y
 CONFIG_TI_SCI_PROTOCOL=y
 CONFIG_GPIO_HOG=y

Why not 0x88200000 which is what CONFIG_SYS_LOAD_ADDR is?

Signature · 1 line
Tom
#2 lore raw
Quoted 52 lines · Tom Rini
Quoted 50 lines · Hiago De Franco

From: Hiago De Franco <[email protected]>

The current value of CONFIG_FASTBOOT_BUF_ADDR is incorrect for hardware with 512MB and 1GB of RAM. The RAM address ranges for these devices are:

- 512MB:
- Start: 0x80000000
- End: 0xA0000000
- 1GB:
- Start: 0x80000000
- End: 0xC0000000

The current buffer address makes fastboot downloads work only on hardware with 2GB of RAM.

To fix this issue:
1. Lower CONFIG_FASTBOOT_BUF_ADDR to 0x80080000. This places the buffer near the beginning of RAM with a 512KB offset, as starting at exactly 0x80000000 conflicts with the ATF load address. Following K3_ATF_LOAD_ADDR configuration, ATF is loaded at 0x80000000:

config K3_ATF_LOAD_ADDR
hex "Load address of ATF image"
default 0x80000000 if (SOC_K3_AM625 || SOC_K3_AM62A7 || SOC_K3_AM62P5 || SOC_K3_J722S) default 0x70000000
help
The load address for the ATF image. This value is used to build the FIT image header that places ATF in memory where it will run.

2. Reduce the size of the download buffer to 128MB, avoiding overlaps with RAMDISK_ADDR_R. This is a good enough value for individual downloads.

Theses changes make fastboot downloads work with 512MB and 1GB devices.

Fixes defe30a78b76 ("verdin-am62: add DFU, USB and UUU fastboot support")
---
 configs/verdin-am62_a53_defconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
configs/verdin-am62_a53_defconfig +0 -1
index 49fb9790e295..6fa1a9d2c552 100644
@@ -122,8 +122,8 @@ CONFIG_SYS_DFU_MAX_FILE_SIZE=0x800000
 CONFIG_DMA_CHANNELS=y
 CONFIG_TI_K3_NAVSS_UDMA=y
 CONFIG_USB_FUNCTION_FASTBOOT=y
-CONFIG_FASTBOOT_BUF_ADDR=0xC0000000
Quoted 8 lines

configs/verdin-am62_a53_defconfig CONFIG_SYS_DFU_MAX_FILE_SIZE=0x800000 · line 129

Quoted 6 lines
configs/verdin-am62_a53_defconfig +2 -1
-CONFIG_FASTBOOT_BUF_SIZE=0x2F000000
+CONFIG_FASTBOOT_BUF_ADDR=0x80080000
+CONFIG_FASTBOOT_BUF_SIZE=0x8000000
 CONFIG_FASTBOOT_UUU_SUPPORT=y
 CONFIG_TI_SCI_PROTOCOL=y
 CONFIG_GPIO_HOG=y

Why not 0x88200000 which is what CONFIG_SYS_LOAD_ADDR is?

We were downloading a file at this address, that is why we decided to not use it. However it is better to use SYS_LOAD_ADDR and then download this file to a different value.

Thanks Tom, I will send a v2.

Quoted 3 lines
Signature · 2 lines
-- 
Tom

Cheers,

Hiago.