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.

Linux/AM5718: USB configuration in U-boot on IDK

Part Number: AM5718

Tool/software: Linux

Hi

I am working on usb enumeration (usb boot) as storage device at u boot level of AM571x idk.
To enable the usb as host the dts file dr_mod has been changed from "otg" to "host".
Also configured the usb2_drvbus and usb2_id pin as follows

DRA7XX_CORE_IOPAD(0x3684, PIN_OUTPUT_PULLUP | MUX_MODE0) /* usb2_drvvbus */
DRA7XX_CORE_IOPAD(0x36c8, PIN_INPUT | MUX_MODE0) /* USB2_ID */

But at u-boot level, when the micro usb is connected with USB Pendrive (FAT and EXT4 partition)


=> usb start
starting USB...
USB0:   Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.00
scanning bus 0 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found

It is not detecting the mass storage usb.

no power is drawing at the micro usb connected USB pendrive.

When probed at U94(TPS2051BD, AM571X Industrial Development Kit (IDK) EVM schematic), pin 4, the pin is not going HIGH as set in the dts file.
At pmic (TPS6590377ZWSR), pin VUSB_VBUS2 is not getting the voltage.
Can you please help on this is there a dependecy on this usb2_drvbus to make it to HIGH?
Also how to drive the pmic (TPS6590377ZWSR) GPIO_1 to high at u-boot level? So that GPIO_USB2_VBUS_DET can get the voltage to drive the usb.

But, the above same (usb as storage) is detecting once the kernel and file system comes up properly (root prompt) on am571x idk.

Trying the above on ti sdk ti-processor-sdk-linux-am57xx-evm-04.01.00.06-Linux-x86-Install.bin



Thanks
Mahesh Muni J

  • Mahesh,

    U-Boot in Processor SDK only enables host mode on USB1, but not on USB2. Please give me some time to check what changes in U-Boot are required to enable host mode on USB2.
  • Mahesh,

    The following U-Boot patch is what you need to enable USB2 host mode on AM57x. You don't have to change anything else in U-Boot, such as DTS or pinmux. Please let me know if the patch solves your issue.

    diff --git a/include/configs/am57xx_evm.h b/include/configs/am57xx_evm.h
    index 37eb50809180..560783d2ea25 100644
    --- a/include/configs/am57xx_evm.h
    +++ b/include/configs/am57xx_evm.h
    @@ -93,7 +93,7 @@
     #define CONFIG_SYS_USB_XHCI_MAX_ROOT_PORTS 2
     
     #define CONFIG_OMAP_USB_PHY
    -#define CONFIG_OMAP_USB3PHY1_HOST
    +#define CONFIG_OMAP_USB2PHY2_HOST
     
     /* SATA */
     #define CONFIG_BOARD_LATE_INIT
    diff --git a/include/linux/usb/xhci-omap.h b/include/linux/usb/xhci-omap.h
    index 9de80d738ecd..9a099d0b58c2 100644
    --- a/include/linux/usb/xhci-omap.h
    +++ b/include/linux/usb/xhci-omap.h
    @@ -10,7 +10,7 @@
     #ifndef _ASM_ARCH_XHCI_OMAP_H_
     #define _ASM_ARCH_XHCI_OMAP_H_
     
    -#ifdef CONFIG_TARGET_DRA7XX_EVM
    +#if defined CONFIG_TARGET_DRA7XX_EVM || defined CONFIG_TARGET_AM57XX_EVM
     #define OMAP_XHCI_BASE 0x488d0000
     #define OMAP_OCP1_SCP_BASE 0x4A081000
     #define OMAP_OTG_WRAPPER_BASE 0x488c0000
    
  • Hi Bin Liu

    The above patch solved the issue, usb2 detection as host mode at u-boot level in am571x idk.
    Now the power is drawing at the micro usb connected USB pen drive as well as a storage device detection.

    The u boot shows now,

    => usb start
    starting USB...
    USB0: Register 2000140 NbrPorts 2
    Starting the controller
    USB XHCI 1.00
    scanning bus 0 for devices... 2 USB Device(s) found
    scanning usb for storage devices... 1 Storage Device(s) found
    => usb info
    1: Hub, USB Revision 3.0
    - U-Boot XHCI Host Controller
    - Class: Hub
    - PacketSize: 9 Configurations: 1
    - Vendor: 0x0000 Product 0x0000 Version 1.0
    Configuration: 1
    - Interfaces: 1 Self Powered 0mA
    Interface: 0
    - Alternate Setting 0, Endpoints: 1
    - Class Hub
    - Endpoint 1 In Interrupt MaxPacket 8 Interval 255ms

    2: Mass Storage, USB Revision 2.0
    - Generic Mass Storage Device 125C20100726
    - Class: (from Interface) Mass Storage
    - PacketSize: 64 Configurations: 1
    - Vendor: 0x14cd Product 0x125c Version 3.0
    Configuration: 1
    - Interfaces: 1 Bus Powered 248mA
    Interface: 0
    - Alternate Setting 0, Endpoints: 2
    - Class Mass Storage, Transp. SCSI, Bulk only
    - Endpoint 1 In Bulk MaxPacket 512
    - Endpoint 2 Out Bulk MaxPacket 512


    Thank you for the patch and Excellent Understanding of the issue and Great Speed of Response.

    Mahesh Muni J
  • Mahesh,

    Thanks for the quick update. Glad the issue is solved.