This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM625: Enable USB0 in UBOOT

Part Number: AM625

Tool/software:

How to enable USB0 in UBOOT?

no matter with default .dts, or copy usb0 configuration from Kernel to UBOOT dts. same result as below I got on AM62-SK-P1

Customer target to use USB0 in UBOOT as Host to support USB-MSC.

https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/791/0042.k3_2D00_am625_2D00_sk.dts

https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/791/0042.k3_2D00_am62_2D00_main.dtsi

U-Boot SPL 2023.04-dirty (Jun 05 2024 - 12:41:56 +0800)
SYSFW ABI: 3.1 (firmware rev 0x0009 '9.2.7--v09.02.07 (Kool Koala)')
SPL initial stack usage: 13408 bytes
Trying to boot from MMC2
Authentication passed
Authentication passed
Authentication passed
Authentication passed
Authentication passed
Starting ATF on ARM64 core...

NOTICE: BL31: v2.10.0(release):v2.10.0-367-g00f1ec6b87-dirty
NOTICE: BL31: Built : 16:09:05, Feb 9 2024

U-Boot SPL 2023.04-ti-gf9b966c67473 (Mar 19 2024 - 20:31:40 +0000)
SYSFW ABI: 3.1 (firmware rev 0x0009 '9.2.7--v09.02.07 (Kool Koala)')
SPL initial stack usage: 1856 bytes
Trying to boot from MMC2
Authentication passed
Authentication passed


U-Boot 2023.04-dirty (Jun 05 2024 - 12:42:42 +0800)

SoC: AM62X SR1.0 HS-FS
Model: Texas Instruments AM625 SK
EEPROM not available at 80, trying to read at 81
Board: AM62B-SKEVM-P1 rev A
DRAM: 2 GiB
Core: 72 devices, 32 uclasses, devicetree: separate
MMC: mmc@fa10000: 0, mmc@fa00000: 1
Loading Environment from nowhere... OK
In: serial
Out: serial
Err: serial
Net: eth0: ethernet@8000000port@1

=>
=> usb start
starting USB...
Bus usb@31100000: generic_phy_get_bulk : no phys property
Register 1000840 NbrPorts 1
Starting the controller
USB XHCI 1.10

#2. UBOOT dts did not update USB configuration, but it is updated in Kernel dts.

usbss0: dwc3-usb@f900000 {
    compatible = "ti,am62-usb";
     reg = <0x00 0x0f900000 0x00 0x800>,
+   <0x00 0x0f908000 0x00 0x400>;

#3. Insert U flash and power again, found 2 USB devices on usb@31100000, why have 2 on USB1?

=> usb start
starting USB...
Bus usb@31100000: Register 1000840 NbrPorts 1
Starting the controller
USB XHCI 1.10
scanning bus usb@31100000 for devices... 2 USB Device(s) found
scanning usb for storage devices... 1 Storage Device(s) found
=>

  • Hi Tony,

    usbss0: dwc3-usb@f900000 {
        compatible = "ti,am62-usb";
         reg = <0x00 0x0f900000 0x00 0x800>,
    +   <0x00 0x0f908000 0x00 0x400>;

    No, please don't touch k3-am62-main.dtsi file.

    why have 2 on USB1?

    '2' means virtual root hub and the usb device.

    Here is the SDK9.2 U-Boot device tree patch for USB0 to be in host mode.

    diff --git a/arch/arm/dts/k3-am625-sk.dts b/arch/arm/dts/k3-am625-sk.dts
    index 823e4320c3c4..4f559dbc2f4d 100644
    --- a/arch/arm/dts/k3-am625-sk.dts
    +++ b/arch/arm/dts/k3-am625-sk.dts
    @@ -569,7 +569,7 @@
     };
     
     &usb0 {
    -       dr_mode = "peripheral";
    +       dr_mode = "host";
     };
     
     &usb1 {
    diff --git a/arch/arm/dts/k3-am62x-sk-common-u-boot.dtsi b/arch/arm/dts/k3-am62x-sk-common-u-boot.dtsi
    index 4265b434168b..9db329975f06 100644
    --- a/arch/arm/dts/k3-am62x-sk-common-u-boot.dtsi
    +++ b/arch/arm/dts/k3-am62x-sk-common-u-boot.dtsi
    @@ -122,7 +122,7 @@
     };
     
     &usb0 {
    -       dr_mode = "peripheral";
    +       dr_mode = "host";
            /* Since role switching is not supported in U-Boot */
            /delete-property/ extcon;
            bootph-pre-ram;

    Here is the U-Boot boot log in USB MSC boot.

    U-Boot SPL 2023.04-00001-g0f287d63fb2d-dirty (Jun 05 2024 - 11:13:00 -0500)
    SYSFW ABI: 3.1 (firmware rev 0x0009 '9.2.7--v09.02.07 (Kool Koala)')
    SPL initial stack usage: 13408 bytes
    Trying to boot from USB
    Bus usb@31000000: Register 1000840 NbrPorts 1
    Starting the controller
    USB XHCI 1.10
    Bus usb@31100000: Register 1000840 NbrPorts 1
    Starting the controller
    USB XHCI 1.10
    scanning bus usb@31000000 for devices... 2 USB Device(s) found
    scanning bus usb@31100000 for devices... 1 USB Device(s) found
           scanning usb for storage devices... 1 Storage Device(s) found
    Authentication passed
    Authentication passed
    Authentication passed
    Authentication passed
    Authentication passed
    Starting ATF on ARM64 core...
    
    NOTICE:  BL31: v2.10.0(release):v2.10.0-367-g00f1ec6b87-dirty
    NOTICE:  BL31: Built : 16:09:05, Feb  9 2024
    
    U-Boot SPL 2023.04-00001-g0f287d63fb2d-dirty (Jun 05 2024 - 11:13:06 -0500)
    SYSFW ABI: 3.1 (firmware rev 0x0009 '9.2.7--v09.02.07 (Kool Koala)')
    SPL initial stack usage: 1856 bytes
    MMC: no card present
    ** Bad device specification mmc 1 **
    Couldn't find partition mmc 1:1
    Error: could not access storage.
    Trying to boot from USB
    Bus usb@31000000: Register 1000840 NbrPorts 1
    Starting the controller
    USB XHCI 1.10
    Bus usb@31100000: Register 1000840 NbrPorts 1
    Starting the controller
    USB XHCI 1.10
    scanning bus usb@31000000 for devices... 2 USB Device(s) found
    scanning bus usb@31100000 for devices... 1 USB Device(s) found
           scanning usb for storage devices... 1 Storage Device(s) found
    Authentication passed
    Authentication passed
    
    
    U-Boot 2023.04-00001-g0f287d63fb2d-dirty (Jun 05 2024 - 11:13:06 -0500)
    
    SoC:   AM62X SR1.0 HS-FS
    Model: Texas Instruments AM625 SK
    EEPROM not available at 80, trying to read at 81
    Board: AM62B-SKEVM rev A
    DRAM:  no bloblist found!2 GiB
    Core:  72 devices, 31 uclasses, devicetree: separate
    MMC:   mmc@fa10000: 0, mmc@fa00000: 1
    Loading Environment from nowhere... OK
    In:    serial
    Out:   serial
    Err:   serial
    Net:   eth0: ethernet@8000000port@1
    Hit any key to stop autoboot:  0
    =>

  • Bin,

    we don't use USB-MSC boot, just want to use USB-MSC in UBOOT.

    With the patch, same result

    U-Boot 2023.04-dirty (Jun 06 2024 - 11:33:01 +0800)
    
    SoC:   AM62X SR1.0 HS-FS
    Model: Texas Instruments AM625 SK
    EEPROM not available at 80, trying to read at 81
    Board: AM62B-SKEVM-P1 rev A
    DRAM:  2 GiB
    Core:  72 devices, 32 uclasses, devicetree: separate
    MMC:   mmc@fa10000: 0, mmc@fa00000: 1
    Loading Environment from nowhere... OK
    In:    serial
    Out:   serial
    Err:   serial
    Net:   eth0: ethernet@8000000port@1
    =>
    => usb start
    starting USB...
    Bus usb@31100000: generic_phy_get_bulk : no phys property
    Register 1000840 NbrPorts 1
    Starting the controller
    USB XHCI 1.10
    scanning bus usb@31100000 for devices... 1 USB Device(s) found
           scanning usb for storage devices... 0 Storage Device(s) found
    =>

  • Tony,

    This U-Boot patch makes USB0 in host mode for SD card boot too:

    U-Boot SPL 2023.04-00001-g0f287d63fb2d-dirty (Jun 06 2024 - 10:49:43 -0500)
    SYSFW ABI: 3.1 (firmware rev 0x0009 '9.2.7--v09.02.07 (Kool Koala)')
    SPL initial stack usage: 13408 bytes
    Trying to boot from MMC2
    Authentication passed
    Authentication passed
    Authentication passed
    Authentication passed
    Authentication passed
    Starting ATF on ARM64 core...
    
    NOTICE:  BL31: v2.10.0(release):v2.10.0-367-g00f1ec6b87-dirty
    NOTICE:  BL31: Built : 16:09:05, Feb  9 2024
    
    U-Boot SPL 2023.04-00001-g0f287d63fb2d-dirty (Jun 06 2024 - 10:49:49 -0500)
    SYSFW ABI: 3.1 (firmware rev 0x0009 '9.2.7--v09.02.07 (Kool Koala)')
    SPL initial stack usage: 1856 bytes
    Trying to boot from MMC2
    Authentication passed
    Authentication passed
    
    
    U-Boot 2023.04-00001-g0f287d63fb2d-dirty (Jun 06 2024 - 10:49:49 -0500)
    
    SoC:   AM62X SR1.0 HS-FS
    Model: Texas Instruments AM625 SK
    EEPROM not available at 80, trying to read at 81
    Board: AM62B-SKEVM rev A
    DRAM:  2 GiB
    Core:  72 devices, 31 uclasses, devicetree: separate
    MMC:   mmc@fa10000: 0, mmc@fa00000: 1
    Loading Environment from nowhere... OK
    In:    serial
    Out:   serial
    Err:   serial
    Net:   eth0: ethernet@8000000port@1
    Hit any key to stop autoboot:  0 
    => 
    => usb start
    starting USB...
    Bus usb@31000000: generic_phy_get_bulk : no phys property
    Register 1000840 NbrPorts 1
    Starting the controller
    USB XHCI 1.10
    Bus usb@31100000: generic_phy_get_bulk : no phys property
    Register 1000840 NbrPorts 1
    Starting the controller
    USB XHCI 1.10
    scanning bus usb@31000000 for devices... 2 USB Device(s) found
    scanning bus usb@31100000 for devices... 1 USB Device(s) found
           scanning usb for storage devices... 1 Storage Device(s) found
    => 
    => usb storage
      Device 0: Vendor: SanDisk  Rev: 1.10 Prod: Cruzer          
                Type: Removable Hard Disk
                Capacity: 7633.5 MB = 7.4 GB (15633408 x 512)
    =>

    The following commands show USB0 device tree configures it to host mode:

    => fdt addr $fdtcontroladdr
    Working FDT set to fd5e7840
    => fdt print usb0
    usb@31000000 {
            compatible = "snps,dwc3";
            reg = <0x00000000 0x31000000 0x00000000 0x00050000>;
            interrupts = <0x00000000 0x000000bc 0x00000004 0x00000000 0x000000bc 0x00000004>;
            interrupt-names = "host", "peripheral";
            maximum-speed = "high-speed";
            dr_mode = "host";
            bootph-pre-ram;
            phandle = <0x00000071>;
    };

  • Hi Bin,

    My mistake, I modified the k3-am62x-sk-common.dtsi other than k3-am62x-sk-common-u-boot.dtsi file, it works now.

    But I did not find where included the k3-am62x-sk-common-u-boot.dtsi to k3-am625-sk.dts