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/AM4377: USB issue in U-boot

Part Number: AM4377


Tool/software: Linux

Dear Sir:

          We use AM4377, and SDK is ti-processor-sdk-linux-am437x-evm-04.03.00.05-Linux-x86-Install.bin

If I config the following flags in the am43xx_evm_defconfig, there is a  conflict with the flag "CONFIG_USB_XHCI_HCD".

# CONFIG_USB_XHCI_HCD is not set
CONFIG_USB_XHCI_DWC3=y
CONFIG_USB_DWC3=y
CONFIG_USB_DWC3_GADGET=y
CONFIG_USB_DWC3_OMAP=y
CONFIG_USB_DWC3_PHY_OMAP=y
CONFIG_USB_EHCI=y
CONFIG_USB_EHCI_GENERIC=y
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_OHCI_HCD=y

it will show the following error after with above settings.

starting USB...
No controllers found
USB is stopped. Please issue 'usb start' first.
Booting from nand ...

no devices available

no devices available
=> usb start
starting USB...
No controllers found

if I open the flag "CONFIG_USB_XHCI_HCD", I need to remove the EHCI settings, because it will error when I compile the u-boot.

But it can not detect the usb correctly.

log:

starting USB...
USB0:   Register 2000440 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

USB device 0: unknown device
Booting from nand ...

no devices available

no devices available
=> usb reset
resetting USB...
USB0:   Register 2000440 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
=> usb start
=> 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

device tree setting: (because the USB0_PWR_ON is controlled by this pin, and the pull down is enable.

usb1_pins: usb1_pins {
        pinctrl-single,pins = <
            0x2c0 (PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* usb0_drvvbus.usb0_drvvbus */      
        >;
    };

Please help to analyze the reason about it in the u-boot settings.

Thanks

         

  • Hi kemal:
    The usb interface is USB2.0. Don't support 3.0, but the u-boot default configuration is following 3.0 hub. After I switch to usb EHCI 2.0 support, the source code can not pass, please help to support USB2.0 in the source code.

    Hub, USB Revision 3.0
    - U-Boot XHCI Host Controller
  • rance zhuang said:

    If I config the following flags in the am43xx_evm_defconfig, there is a  conflict with the flag "CONFIG_USB_XHCI_HCD".

    # CONFIG_USB_XHCI_HCD is not set
    ...
    CONFIG_USB_EHCI=y
    CONFIG_USB_EHCI_GENERIC=y
    CONFIG_USB_EHCI_HCD=y

    This configuration is not correct for AM4377, which doesn't have an EHCI controller. You should enable CONFIGU_USB_XHCI_HCD instead.

    rance zhuang said:

    if I open the flag "CONFIG_USB_XHCI_HCD", I need to remove the EHCI settings, because it will error when I compile the u-boot.

    But it can not detect the usb correctly.

    Is this for your custom board? If so, please post the USB portion of the schematics, including all the connections between AM4377 and the USB receptacle.

  • Hi LiuBin:

       This is a connection picture between usb port and CPU4377. USB0_PWR_ON will control a switch to block the over current issue.(TPS2051CDBVR) , USB0_PWRFLT1_N this is a flag pin will be generated when the usb over current and feedback to CPU.

        The USB port is designed as 2.0 interface, If only XHCI support 3.0 controller , Does this controller compatible with USB2.0?

    Thanks

  • CONFIG_USB_XHCI_HCD is the default setting in the u-boot stage, it can find the controller, but it can not recognize the usb device on it.
    please refer to the log which I described on the title.
  • Rance,

    Your schematic shows AM4377 USB0 port is designed for the USB host mode, as the USB0_ID ping is grounded. However U-Boot in Processor SDK only supports AM4377 USB1 port to be host mode, not the USB0 port. U-Boot should be modified to support USB0 in host mode.
  • Do you mean modify the device tree as following? , And I modify so many test, it does work, So please give me a method how to config USB0 to host mode in the u-boot stage.

    &usb1 {
    dr_mode = "host";
    status = "okay";
    };
  • Rance,

    Here is the U-Boot patch to config USB0 to host mode:

    diff --git a/arch/arm/include/asm/arch-am33xx/hardware_am43xx.h b/arch/arm/include/asm/arch-am33xx/hardware_am43xx.h
    index af69ac6f2c6b..54f93648cfdc 100644
    --- a/arch/arm/include/asm/arch-am33xx/hardware_am43xx.h
    +++ b/arch/arm/include/asm/arch-am33xx/hardware_am43xx.h
    @@ -44,7 +44,7 @@
     #define VTP1_CTRL_ADDR                 0x48140E10
     
     /* USB CTRL Base Address */
    -#define USB1_CTRL                      0x44e10628
    +#define USB1_CTRL                      0x44e10620
     #define USB1_CTRL_CM_PWRDN             BIT(0)
     #define USB1_CTRL_OTG_PWRDN            BIT(1)
     
    diff --git a/include/linux/usb/xhci-omap.h b/include/linux/usb/xhci-omap.h
    index f038ddb66932..8bf7ccb5a5b6 100644
    --- a/include/linux/usb/xhci-omap.h
    +++ b/include/linux/usb/xhci-omap.h
    @@ -21,9 +21,9 @@
     #define OMAP_OTG_WRAPPER_BASE 0x48880000
     #endif /* CONFIG_USB_XHCI_DRA7XX_INDEX == 1 */
     #elif defined CONFIG_AM43XX
    -#define OMAP_XHCI_BASE 0x483d0000
    -#define OMAP_OCP1_SCP_BASE 0x483E8000
    -#define OMAP_OTG_WRAPPER_BASE 0x483dc100
    +#define OMAP_XHCI_BASE 0x48390000
    +#define OMAP_OCP1_SCP_BASE 0x483A8000
    +#define OMAP_OTG_WRAPPER_BASE 0x4839c100
     #else
     /* Default to the OMAP5 XHCI defines */
     #define OMAP_XHCI_BASE 0x4a030000
    
  • Thanks very much liu bin, the usb can be recognize correctly now.
  • Rance,

    Glad the issue is solved. Please kindly click the "This resolved my issue" button.