[PATCH 0/3] AM65: Fix USB boot modes

The following series of patches along with [1], fix usb boot modes on AM654 IDK board.
[1] - https://patchwork.ozlabs.org/project/uboot/list/?series=300845
Aswath Govindraju (3): arm: dts: k3-am654-r5-base-board: Fix the dt properties in usb0 instance arm: mach-k3: am6_init: Fix the path and value's length in the fixup performed for usb boot configs: am65_evm_r5_usb*_defconfig: Sync the checks for size of image and stack from generic r5 defconfig
arch/arm/dts/k3-am654-r5-base-board-u-boot.dtsi | 2 +- arch/arm/dts/k3-am654-r5-base-board.dts | 1 + arch/arm/mach-k3/am6_init.c | 4 ++-- configs/am65x_evm_r5_usbdfu_defconfig | 5 +++++ configs/am65x_evm_r5_usbmsc_defconfig | 5 +++++ 5 files changed, 14 insertions(+), 3 deletions(-)

For dfu boot mode, the clocks property needs to be deleted and dr_mode needs to be set to peripheral. Therefore, add the required fixes for the same.
Signed-off-by: Aswath Govindraju a-govindraju@ti.com --- arch/arm/dts/k3-am654-r5-base-board-u-boot.dtsi | 2 +- arch/arm/dts/k3-am654-r5-base-board.dts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/arm/dts/k3-am654-r5-base-board-u-boot.dtsi b/arch/arm/dts/k3-am654-r5-base-board-u-boot.dtsi index 26567f4167ff..1d0659ea8fff 100644 --- a/arch/arm/dts/k3-am654-r5-base-board-u-boot.dtsi +++ b/arch/arm/dts/k3-am654-r5-base-board-u-boot.dtsi @@ -198,7 +198,7 @@ &usb0 { pinctrl-names = "default"; pinctrl-0 = <&usb0_pins_default>; - dr_mode = "host"; + dr_mode = "peripheral"; u-boot,dm-spl; };
diff --git a/arch/arm/dts/k3-am654-r5-base-board.dts b/arch/arm/dts/k3-am654-r5-base-board.dts index 24881c86f2a8..455698a93630 100644 --- a/arch/arm/dts/k3-am654-r5-base-board.dts +++ b/arch/arm/dts/k3-am654-r5-base-board.dts @@ -309,6 +309,7 @@ &dwc3_0 { status = "okay"; u-boot,dm-spl; + /delete-property/ clocks; /delete-property/ power-domains; /delete-property/ assigned-clocks; /delete-property/ assigned-clock-parents;

On Wed, May 18, 2022 at 04:49:12PM +0530, Aswath Govindraju wrote:
For dfu boot mode, the clocks property needs to be deleted and dr_mode needs to be set to peripheral. Therefore, add the required fixes for the same.
Signed-off-by: Aswath Govindraju a-govindraju@ti.com
Applied to u-boot/next, thanks!

The node name of the bus in the device tree has changed. Also, the length argument to be passed should be the length of new value. Therefore, fix the path to usb device tree node as well as the length argument passed.
Signed-off-by: Aswath Govindraju a-govindraju@ti.com --- arch/arm/mach-k3/am6_init.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-k3/am6_init.c b/arch/arm/mach-k3/am6_init.c index 86c1a349f1fc..7992918adcdc 100644 --- a/arch/arm/mach-k3/am6_init.c +++ b/arch/arm/mach-k3/am6_init.c @@ -127,8 +127,8 @@ static int fixup_usb_boot(void) * before the dwc3 bind takes place */ ret = fdt_find_and_setprop((void *)gd->fdt_blob, - "/interconnect@100000/dwc3@4000000/usb@10000", - "dr_mode", "host", 11, 0); + "/bus@100000/dwc3@4000000/usb@10000", + "dr_mode", "host", 5, 0); if (ret) printf("%s: fdt_find_and_setprop() failed:%d\n", __func__, ret);

On Wed, May 18, 2022 at 04:49:13PM +0530, Aswath Govindraju wrote:
The node name of the bus in the device tree has changed. Also, the length argument to be passed should be the length of new value. Therefore, fix the path to usb device tree node as well as the length argument passed.
Signed-off-by: Aswath Govindraju a-govindraju@ti.com
Applied to u-boot/next, thanks!

Sync the configs required for enabling checks for size of image and stack from generic r5 defconfig file.
Signed-off-by: Aswath Govindraju a-govindraju@ti.com --- configs/am65x_evm_r5_usbdfu_defconfig | 5 +++++ configs/am65x_evm_r5_usbmsc_defconfig | 5 +++++ 2 files changed, 10 insertions(+)
diff --git a/configs/am65x_evm_r5_usbdfu_defconfig b/configs/am65x_evm_r5_usbdfu_defconfig index 57cd0f35a56f..20e32373bbfe 100644 --- a/configs/am65x_evm_r5_usbdfu_defconfig +++ b/configs/am65x_evm_r5_usbdfu_defconfig @@ -16,6 +16,8 @@ CONFIG_SPL_TEXT_BASE=0x41c00000 CONFIG_SPL_SERIAL=y CONFIG_SPL_DRIVERS_MISC=y CONFIG_SPL_STACK_R_ADDR=0x82000000 +CONFIG_SPL_SIZE_LIMIT=0x7ec00 +CONFIG_SPL_SIZE_LIMIT_PROVIDE_STACK=0x2000 CONFIG_SPL_FS_FAT=y CONFIG_SPL_LIBDISK_SUPPORT=y # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set @@ -23,6 +25,9 @@ CONFIG_SPL_LOAD_FIT=y CONFIG_SPL_LOAD_FIT_ADDRESS=0x80080000 CONFIG_USE_BOOTCOMMAND=y # CONFIG_DISPLAY_CPUINFO is not set +CONFIG_SPL_SIZE_LIMIT_SUBTRACT_GD=y +CONFIG_SPL_SIZE_LIMIT_SUBTRACT_MALLOC=y +CONFIG_SPL_SYS_REPORT_STACK_F_USAGE=y CONFIG_SPL_STACK_R=y CONFIG_SPL_SEPARATE_BSS=y CONFIG_SPL_EARLY_BSS=y diff --git a/configs/am65x_evm_r5_usbmsc_defconfig b/configs/am65x_evm_r5_usbmsc_defconfig index e6147d1be36d..c4b0ff0b6775 100644 --- a/configs/am65x_evm_r5_usbmsc_defconfig +++ b/configs/am65x_evm_r5_usbmsc_defconfig @@ -16,12 +16,17 @@ CONFIG_SPL_TEXT_BASE=0x41c00000 CONFIG_SPL_SERIAL=y CONFIG_SPL_DRIVERS_MISC=y CONFIG_SPL_STACK_R_ADDR=0x82000000 +CONFIG_SPL_SIZE_LIMIT=0x7ec00 +CONFIG_SPL_SIZE_LIMIT_PROVIDE_STACK=0x2000 CONFIG_SPL_FS_FAT=y CONFIG_SPL_LIBDISK_SUPPORT=y # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set CONFIG_SPL_LOAD_FIT=y CONFIG_USE_BOOTCOMMAND=y # CONFIG_DISPLAY_CPUINFO is not set +CONFIG_SPL_SIZE_LIMIT_SUBTRACT_GD=y +CONFIG_SPL_SIZE_LIMIT_SUBTRACT_MALLOC=y +CONFIG_SPL_SYS_REPORT_STACK_F_USAGE=y CONFIG_SPL_STACK_R=y CONFIG_SPL_SEPARATE_BSS=y CONFIG_SPL_EARLY_BSS=y

On Wed, May 18, 2022 at 04:49:14PM +0530, Aswath Govindraju wrote:
Sync the configs required for enabling checks for size of image and stack from generic r5 defconfig file.
Signed-off-by: Aswath Govindraju a-govindraju@ti.com
Applied to u-boot/next, thanks!
participants (2)
-
Aswath Govindraju
-
Tom Rini