Skip to contentSkip to conversation

J7200/J721E: Fix USB DFU Boot mode

PATCH In review Aswath Govindraju 2 participants 7 messages Aug 26, 2021 – Sep 11, 2021 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

v2 cover J7200/J721E: Fix USB DFU Boot mode

The following series of patches fix USB DFU Boot mode in J7200 and J721E SoC's.

changes since v1:
- synced up the size allocated for tispl.bin and u-boot.img in dfu ram env variable with that of OSPI and eMMC dfu env variables

Aswath Govindraju (3):
arm: dts: k3-j721e-r5-*.dts: Fix clock-names property in the usb0
instance
environment: ti: k3_dfu: Increase the size allocated for bootloader
images in dfu_alt_info_ram
configs: j72*_evm: Define the buffer sizes for dfu

 arch/arm/dts/k3-j721e-r5-common-proc-board.dts | 2 +-
 configs/j7200_evm_a72_defconfig                | 2 ++
 configs/j7200_evm_r5_defconfig                 | 1 +
 configs/j721e_evm_a72_defconfig                | 2 ++
 configs/j721e_evm_r5_defconfig                 | 1 +
 include/configs/j721e_evm.h                    | 2 --
 include/environment/ti/k3_dfu.h                | 4 ++--
 7 files changed, 9 insertions(+), 5 deletions(-)
Signature · 1 line
2.17.1
#1 lore raw

PATCH v2 1/3 arm: dts: k3-j721e-r5-*.dts: Fix clock-names property in the usb0 instance

In the cdns3 usb driver, the clock name looked for is ref. Therefore, fix the clock-names property in usb0 instance for proper initialization of cdns3 usb gadget driver.

---
 arch/arm/dts/k3-j721e-r5-common-proc-board.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/dts/k3-j721e-r5-common-proc-board.dts +1 -1
index a12607dc2f75..4b2362a5dd05 100644
@@ -280,7 +280,7 @@
 	/delete-property/ assigned-clocks;
 	/delete-property/ assigned-clock-parents;
 	clocks = <&clk_19_2mhz>;
-	clock-names = "usb2_refclk";
+	clock-names = "ref";
 	pinctrl-names = "default";
 	pinctrl-0 = <&main_usbss0_pins_default>;
 	ti,vbus-divider;
Signature · 1 line
2.17.1
#2 lore raw

Re: [PATCH v2 1/3] arm: dts: k3-j721e-r5-*.dts: Fix clock-names property in the usb0 instance

Quoted 5 lines · Aswath Govindraju

In the cdns3 usb driver, the clock name looked for is ref. Therefore, fix the clock-names property in usb0 instance for proper initialization of cdns3 usb gadget driver.

Applied to u-boot/master, thanks!

Signature · 1 line
Tom
#3 lore raw

PATCH v2 2/3 environment: ti: k3_dfu: Increase the size allocated for bootloader images in dfu_alt_info_ram

In reply to Aswath Govindraju

The size of u-boot.img is above 1MB and that of tispl.bin is close to 1MB, in case of j721e. Therefore, increase the sizes allocated for tispl.bin and u-boot.img to 2 MB and 4 MB respectively, in dfu_alt_info_ram environment variable.

---
 include/environment/ti/k3_dfu.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/environment/ti/k3_dfu.h +2 -2
index 2f503b8de880..a16a3adecaf9 100644
@@ -40,7 +40,7 @@
 
 #define DFU_ALT_INFO_RAM \
 	"dfu_alt_info_ram=" \
-	"tispl.bin ram 0x80080000 0x100000;" \
-	"u-boot.img ram 0x81000000 0x100000\0" \
+	"tispl.bin ram 0x80080000 0x200000;" \
+	"u-boot.img ram 0x81000000 0x400000\0" \
 
 #endif /* __TI_DFU_H */
Signature · 1 line
2.17.1
#4 lore raw

Re: [PATCH v2 2/3] environment: ti: k3_dfu: Increase the size allocated for bootloader images in dfu_alt_info_ram

Quoted 6 lines · Aswath Govindraju

The size of u-boot.img is above 1MB and that of tispl.bin is close to 1MB, in case of j721e. Therefore, increase the sizes allocated for tispl.bin and u-boot.img to 2 MB and 4 MB respectively, in dfu_alt_info_ram environment variable.

Applied to u-boot/master, thanks!

Signature · 1 line
Tom
#5 lore raw

PATCH v2 3/3 configs: j72*_evm: Define the buffer sizes for dfu

In reply to Aswath Govindraju

On J721e R5 SPL, dfu buffer for loading sysfw.itb image gets allocated before DRAM gets initialized. So, the buffer gets allocated in MCU L3 RAM. The current buffer size to be allocated is 256KB and the available total heap memory is 0x70000 (448KB). This leads to NOMEM errors during allocation.

In other cases when constraints such as above are not present fix the size of buffers to the sector size in OSPI for proper functioning.

Also, if CONFIG_SYS_DFU_DATA_BUF_SIZE is defined and CONFIG_SYS_DFU_MAX_FILE_SIZE is not defined then the max file size for dfu transfer is defined as CONFIG_SYS_DFU_DATA_BUF_SIZE.

Fix these by setting appropriate buffer sizes in their respective defconfig files and defining the max file size as 8 MB which is the default dfu buffer size.

---
 configs/j7200_evm_a72_defconfig | 2 ++
 configs/j7200_evm_r5_defconfig  | 1 +
 configs/j721e_evm_a72_defconfig | 2 ++
 configs/j721e_evm_r5_defconfig  | 1 +
 include/configs/j721e_evm.h     | 2 --
 5 files changed, 6 insertions(+), 2 deletions(-)
configs/j7200_evm_a72_defconfig +2 -0
index 6fc7cabd6035..a449705a4055 100644
@@ -97,6 +97,8 @@ CONFIG_CLK=y
 CONFIG_SPL_CLK=y
 CONFIG_CLK_CCF=y
 CONFIG_CLK_TI_SCI=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x40000
+CONFIG_SYS_DFU_MAX_FILE_SIZE=0x800000
 CONFIG_DFU_MMC=y
 CONFIG_DFU_RAM=y
 CONFIG_DFU_SF=y
configs/j7200_evm_r5_defconfig +1 -0
index f9fe41a434ab..b12a6414ce0e 100644
@@ -53,6 +53,7 @@ CONFIG_SPL_SPI_LOAD=y
 CONFIG_SYS_SPI_U_BOOT_OFFS=0x80000
 CONFIG_SPL_USB_GADGET=y
 CONFIG_SPL_DFU=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x40000
 CONFIG_SPL_YMODEM_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_DFU=y
configs/j721e_evm_a72_defconfig +2 -0
index d01bacdea19f..ea83fec69f1c 100644
@@ -96,6 +96,8 @@ CONFIG_CLK_TI_SCI=y
 CONFIG_DFU_MMC=y
 CONFIG_DFU_RAM=y
 CONFIG_DFU_SF=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x20000
+CONFIG_SYS_DFU_MAX_FILE_SIZE=0x800000
 CONFIG_DMA_CHANNELS=y
 CONFIG_TI_K3_NAVSS_UDMA=y
 CONFIG_USB_FUNCTION_FASTBOOT=y
configs/j721e_evm_r5_defconfig +1 -0
index e8841ba953cc..cd72d27b6392 100644
@@ -51,6 +51,7 @@ CONFIG_SPL_SPI_LOAD=y
 CONFIG_SYS_SPI_U_BOOT_OFFS=0x80000
 CONFIG_SPL_USB_GADGET=y
 CONFIG_SPL_DFU=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x5000
 CONFIG_SPL_YMODEM_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_DFU=y
include/configs/j721e_evm.h +0 -2
index 18b80ef8ce7d..10555d1a6ca7 100644
@@ -155,9 +155,7 @@
 #define EXTRA_ENV_CONFIG_MAIN_CPSW0_QSGMII_PHY
 #endif
 
-/* set default dfu_bufsiz to 128KB (sector size of OSPI) */
 #define EXTRA_ENV_DFUARGS \
-	"dfu_bufsiz=0x20000\0" \
 	DFU_ALT_INFO_MMC \
 	DFU_ALT_INFO_EMMC \
 	DFU_ALT_INFO_RAM \
Signature · 1 line
2.17.1
#6 lore raw

Re: [PATCH v2 3/3] configs: j72*_evm: Define the buffer sizes for dfu

Quoted 13 lines · Aswath Govindraju

On J721e R5 SPL, dfu buffer for loading sysfw.itb image gets allocated before DRAM gets initialized. So, the buffer gets allocated in MCU L3 RAM. The current buffer size to be allocated is 256KB and the available total heap memory is 0x70000 (448KB). This leads to NOMEM errors during allocation.

In other cases when constraints such as above are not present fix the size of buffers to the sector size in OSPI for proper functioning.

Also, if CONFIG_SYS_DFU_DATA_BUF_SIZE is defined and CONFIG_SYS_DFU_MAX_FILE_SIZE is not defined then the max file size for dfu transfer is defined as CONFIG_SYS_DFU_DATA_BUF_SIZE.

Quoted 5 lines

Fix these by setting appropriate buffer sizes in their respective defconfig files and defining the max file size as 8 MB which is the default dfu buffer size.

Applied to u-boot/master, thanks!

Signature · 1 line
Tom