From 83202c83352be6054973cfa9e862b7bdf39bb1a1 Mon Sep 17 00:00:00 2001 From: Siddharth Vadapalli Date: Mon, 10 Feb 2025 16:52:24 +0530 Subject: [PATCH 1/7] configs: am62ax_evm_a53_defconfig: enable USB DFU support The config fragment "am62x_a53_usbdfu.config" which adds USB DFU support for AM62x SoC is applicable to the AM62Ax SoC as well. Hence, include it in "am62ax_evm_a53_defconfig" in order to enable support for USB DFU flash and boot. Signed-off-by: Siddharth Vadapalli --- configs/am62ax_evm_a53_defconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configs/am62ax_evm_a53_defconfig b/configs/am62ax_evm_a53_defconfig index ad448feafeb..3063e7f6170 100644 --- a/configs/am62ax_evm_a53_defconfig +++ b/configs/am62ax_evm_a53_defconfig @@ -108,3 +108,5 @@ CONFIG_SYSRESET=y CONFIG_SPL_SYSRESET=y CONFIG_SYSRESET_TI_SCI=y CONFIG_FS_FAT_MAX_CLUSTSIZE=16384 + +#include From e3016930453ff544462dfadac7fb6bb1b41ab9ae Mon Sep 17 00:00:00 2001 From: Siddharth Vadapalli Date: Mon, 10 Feb 2025 16:52:25 +0530 Subject: [PATCH 2/7] board: ti: am62px: env: include environment for DFU Boot Include the TI K3 DFU environment to support DFU Boot and DFU Flash. Also add "usb" to the list of "boot_targets". While at it, add a newline at the end of the file. Signed-off-by: Siddharth Vadapalli Reviewed-by: Mattijs Korpershoek Reviewed-by: Roger Quadros --- board/ti/am62px/am62px.env | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/board/ti/am62px/am62px.env b/board/ti/am62px/am62px.env index 7ef54079aa8..e0838196e3a 100644 --- a/board/ti/am62px/am62px.env +++ b/board/ti/am62px/am62px.env @@ -1,5 +1,6 @@ #include #include +#include name_kern=Image console=ttyS2,115200n8 @@ -7,7 +8,7 @@ args_all=setenv optargs ${optargs} earlycon=ns16550a,mmio32,0x02800000 ${mtdparts} run_kern=booti ${loadaddr} ${rd_spec} ${fdtaddr} -boot_targets=mmc1 mmc0 pxe dhcp +boot_targets=mmc1 mmc0 usb pxe dhcp boot=mmc mmcdev=1 bootpart=1:2 @@ -17,4 +18,4 @@ rd_spec=- #if CONFIG_BOOTMETH_ANDROID #include adtb_idx=3 -#endif \ No newline at end of file +#endif From 8d1c65fce8bb47f749d23c2b5a3faf29885ee2bf Mon Sep 17 00:00:00 2001 From: Siddharth Vadapalli Date: Mon, 10 Feb 2025 16:52:26 +0530 Subject: [PATCH 3/7] configs: am62x_r5_usbdfu: extend for AM62Px Disable configs which are not required for USB DFU functionality, in order to allow reusing this fragment for AM62Px SoC. Signed-off-by: Siddharth Vadapalli Reviewed-by: Mattijs Korpershoek Reviewed-by: Roger Quadros --- configs/am62x_r5_usbdfu.config | 3 +++ 1 file changed, 3 insertions(+) diff --git a/configs/am62x_r5_usbdfu.config b/configs/am62x_r5_usbdfu.config index 772bb2ab935..f094ed127e6 100644 --- a/configs/am62x_r5_usbdfu.config +++ b/configs/am62x_r5_usbdfu.config @@ -26,3 +26,6 @@ CONFIG_SPL_DFU=y # CONFIG_CMD_MMC is not set # CONFIG_CMD_FAT is not set # CONFIG_MMC_SDHCI is not set +# CONFIG_SPL_MTD is not set +# CONFIG_DMA_CHANNELS is not set +# CONFIG_TI_K3_NAVSS_UDMA is not set From df7244134497f3daa535e60382019937f4df8504 Mon Sep 17 00:00:00 2001 From: Siddharth Vadapalli Date: Mon, 10 Feb 2025 16:52:27 +0530 Subject: [PATCH 4/7] configs: am62px_evm_a53_defconfig: enable USB DFU support The config fragment "am62x_a53_usbdfu.config" which adds USB DFU support for AM62x SoC is applicable to the AM62Px SoC as well. Hence, include it in "am62px_evm_a53_defconfig" in order to enable support for USB DFU flash and boot. Remove those configs from "am62px_evm_a53_defconfig" which are present in the "am62x_a53_usbdfu.config" config fragment that is being included. Signed-off-by: Siddharth Vadapalli Reviewed-by: Mattijs Korpershoek Reviewed-by: Roger Quadros --- configs/am62px_evm_a53_defconfig | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/configs/am62px_evm_a53_defconfig b/configs/am62px_evm_a53_defconfig index 9635beb1b27..9862b1f9a16 100644 --- a/configs/am62px_evm_a53_defconfig +++ b/configs/am62px_evm_a53_defconfig @@ -41,14 +41,11 @@ CONFIG_SPL_SYS_MMCSD_RAW_MODE=y CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x1400 CONFIG_SPL_DMA=y -CONFIG_SPL_ENV_SUPPORT=y CONFIG_SPL_FS_LOAD_PAYLOAD_NAME="u-boot.img" CONFIG_SPL_I2C=y CONFIG_SPL_DM_MAILBOX=y CONFIG_SPL_DM_SPI_FLASH=y CONFIG_SPL_POWER_DOMAIN=y -CONFIG_SPL_RAM_SUPPORT=y -CONFIG_SPL_RAM_DEVICE=y # CONFIG_SPL_SPI_FLASH_TINY is not set CONFIG_SPL_SPI_FLASH_SFDP_SUPPORT=y CONFIG_SPL_SPI_LOAD=y @@ -58,14 +55,12 @@ CONFIG_SPL_YMODEM_SUPPORT=y CONFIG_CMD_BOOTEFI_SELFTEST=y CONFIG_CMD_NVEDIT_EFI=y CONFIG_CMD_CLK=y -CONFIG_CMD_DFU=y CONFIG_CMD_GPIO=y CONFIG_CMD_GPT=y CONFIG_CMD_I2C=y CONFIG_CMD_MMC=y CONFIG_CMD_MTD=y CONFIG_CMD_REMOTEPROC=y -CONFIG_CMD_USB=y CONFIG_CMD_USB_MASS_STORAGE=y CONFIG_CMD_EFIDEBUG=y CONFIG_CMD_TIME=y @@ -85,17 +80,12 @@ CONFIG_SPL_DM_DEVICE_REMOVE=y CONFIG_SPL_DM_SEQ_ALIAS=y CONFIG_REGMAP=y CONFIG_SPL_REGMAP=y -CONFIG_SPL_SYSCON=y CONFIG_SPL_OF_TRANSLATE=y CONFIG_CLK=y CONFIG_SPL_CLK=y CONFIG_CLK_TI_SCI=y -CONFIG_DFU_MMC=y CONFIG_DFU_MTD=y -CONFIG_DFU_RAM=y CONFIG_DFU_SF=y -CONFIG_SYS_DFU_DATA_BUF_SIZE=0x40000 -CONFIG_SYS_DFU_MAX_FILE_SIZE=0x800000 CONFIG_DMA_CHANNELS=y CONFIG_TI_K3_NAVSS_UDMA=y CONFIG_USB_FUNCTION_FASTBOOT=y @@ -164,22 +154,10 @@ CONFIG_SYSRESET=y CONFIG_SPL_SYSRESET=y CONFIG_SYSRESET_TI_SCI=y CONFIG_DM_THERMAL=y -CONFIG_USB=y -CONFIG_DM_USB_GADGET=y -CONFIG_SPL_DM_USB_GADGET=y CONFIG_SPL_USB_HOST=y -CONFIG_USB_XHCI_HCD=y -CONFIG_USB_DWC3=y -CONFIG_USB_DWC3_GENERIC=y -CONFIG_SPL_USB_DWC3_GENERIC=y CONFIG_SPL_USB_STORAGE=y -CONFIG_USB_GADGET=y -CONFIG_SPL_USB_GADGET=y -CONFIG_USB_GADGET_MANUFACTURER="Texas Instruments" -CONFIG_USB_GADGET_VENDOR_NUM=0x0451 -CONFIG_USB_GADGET_PRODUCT_NUM=0x6165 -CONFIG_SPL_DFU=y CONFIG_FS_FAT_MAX_CLUSTSIZE=16384 CONFIG_EFI_SET_TIME=y #include +#include From c89229e0325b685be8dc36d9162c37ba958d489a Mon Sep 17 00:00:00 2001 From: Siddharth Vadapalli Date: Mon, 10 Feb 2025 16:52:28 +0530 Subject: [PATCH 5/7] board: ti: j722s: env: include environment for DFU Include the TI K3 DFU environment to support DFU Boot and DFU Flash. Signed-off-by: Siddharth Vadapalli --- board/ti/j722s/j722s.env | 1 + 1 file changed, 1 insertion(+) diff --git a/board/ti/j722s/j722s.env b/board/ti/j722s/j722s.env index f8b6aff2c2f..853526bc667 100644 --- a/board/ti/j722s/j722s.env +++ b/board/ti/j722s/j722s.env @@ -1,5 +1,6 @@ #include #include +#include name_kern=Image console=ttyS2,115200n8 From 646f23e5a648da00b99ddb24df00aec0727d063e Mon Sep 17 00:00:00 2001 From: Siddharth Vadapalli Date: Mon, 10 Feb 2025 16:52:29 +0530 Subject: [PATCH 6/7] configs: j722s_evm_a53_defconfig: enable USB DFU support The USB0 instance of USB on J722S SoC is a Designware USB Controller with the same glue layer (wrapper) as AM62 SoC. In order to support USB DFU boot and USB DFU flash with USB0, enable the corresponding glue layer driver. While at it, sync with savedefconfig. Signed-off-by: Siddharth Vadapalli --- configs/j722s_evm_a53_defconfig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/configs/j722s_evm_a53_defconfig b/configs/j722s_evm_a53_defconfig index 81eb934ed6e..b53dc3054f4 100644 --- a/configs/j722s_evm_a53_defconfig +++ b/configs/j722s_evm_a53_defconfig @@ -1,6 +1,7 @@ CONFIG_ARM=y CONFIG_ARCH_K3=y CONFIG_SYS_MALLOC_F_LEN=0x8000 +CONFIG_TI_COMMON_CMD_OPTIONS=y CONFIG_SPL_GPIO=y CONFIG_SPL_LIBCOMMON_SUPPORT=y CONFIG_SPL_LIBGENERIC_SUPPORT=y @@ -54,7 +55,6 @@ CONFIG_SYS_SPI_U_BOOT_OFFS=0x280000 CONFIG_SPL_THERMAL=y CONFIG_SPL_YMODEM_SUPPORT=y CONFIG_CMD_CLK=y -CONFIG_CMD_DFU=y CONFIG_CMD_MTD=y CONFIG_CMD_REMOTEPROC=y CONFIG_CMD_USB_MASS_STORAGE=y @@ -155,6 +155,8 @@ CONFIG_USB_XHCI_HCD=y CONFIG_USB_DWC3=y CONFIG_USB_DWC3_GENERIC=y CONFIG_SPL_USB_DWC3_GENERIC=y +CONFIG_SPL_USB_DWC3_AM62=y +CONFIG_USB_DWC3_AM62=y CONFIG_SPL_USB_STORAGE=y CONFIG_USB_GADGET=y CONFIG_SPL_USB_GADGET=y @@ -163,4 +165,3 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x0451 CONFIG_USB_GADGET_PRODUCT_NUM=0x6165 CONFIG_SPL_DFU=y CONFIG_FS_FAT_MAX_CLUSTSIZE=16384 -CONFIG_TI_COMMON_CMD_OPTIONS=y From b64241da1db3942da0d87a828c80ff5de6a297e6 Mon Sep 17 00:00:00 2001 From: Siddharth Vadapalli Date: Mon, 10 Feb 2025 16:52:30 +0530 Subject: [PATCH 7/7] configs: am62x_a53_usbdfu: enable USB MASS Storage command The USB0 instance of USB on AM62 SoC when configured to operate in the Gadget mode of operation can be used to mount an MMC/SD card on the USB Host. Hence, enable support for the USB Mass Storage (ums) command. Since this config fragment corresponds to USB DFU functionality which configures the USB Controller in Gadget mode of operation, other SoCs which include this fragment for DFU functionality can make use of the USB MASS Storage functionality as well. Signed-off-by: Siddharth Vadapalli --- configs/am62x_a53_usbdfu.config | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/am62x_a53_usbdfu.config b/configs/am62x_a53_usbdfu.config index 0d3c6df1e73..630845d80b4 100644 --- a/configs/am62x_a53_usbdfu.config +++ b/configs/am62x_a53_usbdfu.config @@ -6,6 +6,7 @@ CONFIG_SPL_USB_GADGET=y CONFIG_SPL_DFU=y CONFIG_CMD_DFU=y CONFIG_CMD_USB=y +CONFIG_CMD_USB_MASS_STORAGE=y CONFIG_SYSCON=y CONFIG_SPL_SYSCON=y CONFIG_DFU_MMC=y