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.

DM814x/AM3874 USB host mode

Other Parts Discussed in Thread: AM3874

Hi,

I'm trying to configure USB1 controller on our AM3874 based device in host mode.

As recommended in TRM we use USB1_DRVVBUS to control external power source. According to TRM "The control on the USB_DRVVBUS is automatic and is handled by the USB controller. The control should be transparent to the user so long as the proper hardware connection and software initialization are in place."

So, kernel (ti-ezsdk_dm814x-evm_5_04_00_11) is configured according to .

PINCNTL14 register (for L5 pin) is configured for USB1_DRVVBUS mode.

I can see that TI81XX usb platform glue layer in ti81xx_musb_set_mode() function sets USB1MODE register to 0x0, that matches host mode.

However USB1_DEVCTL register value is 0x80, that doesn't match host mode and also USB1_DRVVBUS pin (L5) is not driven high, hence, no power is supplied from external source.

Here is partial kernel boot log:

usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
USBSS revision 4ea2080b
registerd cppi-dma Intr @ IRQ 17
Cppi41 Init Done
Bluetooth: Core ver 2.15
NET: Registered protocol family 31
Bluetooth: HCI device and connection manager initialized
Bluetooth: HCI socket layer initialized
Switching to clocksource gp timer
musb-hdrc: version 6.0, host, debug=0
musb-hdrc musb-hdrc.0: dma type: dma-cppi41
MUSB controller-0 revision 4ea20800
musb-hdrc musb-hdrc.0: MUSB HDRC host driver
musb-hdrc musb-hdrc.0: new USB bus registered, assigned bus number 1
usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb1: Product: MUSB HDRC host driver
usb usb1: Manufacturer: Linux 2.6.37 musb-hcd
usb usb1: SerialNumber: musb-hdrc.0
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
musb-hdrc musb-hdrc.0: USB Host mode controller at cb81e000 using DMA, IRQ 18
musb-hdrc musb-hdrc.1: dma type: dma-cppi41
MUSB controller-1 revision 4ea20800
musb-hdrc musb-hdrc.1: MUSB HDRC host driver
musb-hdrc musb-hdrc.1: new USB bus registered, assigned bus number 2
usb usb2: New USB device found, idVendor=1d6b, idProduct=0002
usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb2: Product: MUSB HDRC host driver
usb usb2: Manufacturer: Linux 2.6.37 musb-hcd
usb usb2: SerialNumber: musb-hdrc.1
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 1 port detected
musb-hdrc musb-hdrc.1: USB Host mode controller at cb828800 using DMA, IRQ 19

In attachment there is also a partial schematics of our USB circuit. USB0 is not in use, we are interested only in USB1.

What do we do wrong?

Thanks

  • Hi, Pavel.

    I already reviewed these wikis lats week as well as different forum threads related to USB host mode, like 

    At first sight we are working according to the wiki and to TRM. Probably we made some mistake, but I just can't understand what it is.

    Thanks,

    Anatoly

  • Anatoly,

    See also if the below e2e threads will help:

    e2e.ti.com/.../196053
    e2e.ti.com/.../223771
    e2e.ti.com/.../214063
    e2e.ti.com/.../357610

    You can also run the USB1 HW diagnostic test:

    This CCS test application validates the MUSB for its ability to perform device connect/disconnect. It also validates the speed and VBUS level post device connect.

    load "BB_018_USB1_HOST_Test.out" file and run.

    The test is declared a PASS if the device is connected/disconnected gets displayed in the console and the device speed/VBUS levels are detected correctly.

    BR
    Pavel
  • Anatoly,

    I made a test on the DM814x/AM387x TI EVM. I can detect USB flash drive on the USB1 host, below are the messages I have when I plug the USB flash drive (plug it before power on the board, not hot plug):

    usb 2-1: new high speed USB device using musb-hdrc and address 2
    usb 2-1: New USB device found, idVendor=0424, idProduct=2640
    usb 2-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
    hub 2-1:1.0: USB hub found
    hub 2-1:1.0: 3 ports detected

    usb 2-1.1: new high speed USB device using musb-hdrc and address 3
    usb 2-1.1: New USB device found, idVendor=0424, idProduct=4040
    usb 2-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    usb 2-1.1: Product: Ultra Fast Media Reader
    usb 2-1.1: Manufacturer: Generic
    usb 2-1.1: SerialNumber: 000008264001
    scsi1 : usb-storage 2-1.1:1.0
    usb 2-1.2: new high speed USB device using musb-hdrc and address 4

    usb 2-1.2: New USB device found, idVendor=0930, idProduct=6545
    usb 2-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    usb 2-1.2: Product: DataTraveler 2.0
    usb 2-1.2: Manufacturer: Kingston
    usb 2-1.2: SerialNumber: 1C6F654E41D7EF6039F130E0

    I am using the latest linux kernel code base, available at the below link:
    http://arago-project.org/git/projects/?p=linux-omap3.git;a=shortlog;h=refs/heads/ti81xx-master

    TI814x linux kernel is configured for USB mass storage with below instructions:
    processors.wiki.ti.com/.../Usbgeneralpage

    TI814x linux kernel is configured for host mode with below instructions:
    processors.wiki.ti.com/.../Usbgeneralpage
    (from usb connector) --->

    On DM814x EVM, J23 is shortened (jumper is placed), J26 not.

    BR
    Pavel

  • Pavel,

    Pavel Botev said:

    e2e.ti.com/.../196053

    e2e.ti.com/.../223771

    e2e.ti.com/.../214063

    e2e.ti.com/.../357610

    I've read all these threads, but couldn't find an answer for my problem

    Pavel Botev said:

    You can also run the USB1 HW diagnostic test:

    I've loaded and run BB_018_USB1_HOST_Test.out, but I havn't got any response in CCS console.

    As far as I remember for DDR3 test there was a need to load GEL file and run a couple of configuration scripts prior running a test. Is it required for USB test too?

    I've tried to load GEL file and run USB related scripts but without any success. What is the correct procedure for USB test?

    Pavel Botev said:

    I made a test on the DM814x/AM387x TI EVM. I can detect USB flash drive on the USB1 host

    Unfortunately I do not have DM814x/AM387x TI EVM, I work only with our custom board. In my case USB devices are not detected because USB1_DRVVBUS pin is not driven high and 5V from external source is not supplied.

    We do not use the latest linux code, but I believe it shouldn't make a difference for USB controller initialization.

    Pavel Botev said:

    TI814x linux kernel is configured for USB mass storage with below instructions:

    processors.wiki.ti.com/.../Usbgeneralpage

    TI814x linux kernel is configured for host mode with below instructions:

    processors.wiki.ti.com/.../Usbgeneralpage

    (from usb connector) --->

    I configured the kernel with exactly the same settings (with addition of debug messages),

    USB1_ID pin is shorted to ground as required by TRM, I also have correct pin mux of USB1_DRVVBUS

    /usr/bin # devmem 0x48140834

    0x000C0080

    but for some reason USB controller refuses to switch to Host mode and doesn't drive USB1_DRVVBUS high.

    Thanks,

    Anatoly

  • Pavel,

    Here is some additional info.

    If I try to force USB controller to host mode by writing 0x80 to USB1_TESTMODE register,

    then USB1_DEVCTL register changes from 0x81 to 0x01, meaning that the controller switched from 'B' device to 'A' device.

    HOSTMODE bit remains '0' and USB1_DRVVBUS remains low.

    Anatoly

  • Anatoly Goldstein said:

    I've loaded and run BB_018_USB1_HOST_Test.out, but I havn't got any response in CCS console.

    As far as I remember for DDR3 test there was a need to load GEL file and run a couple of configuration scripts prior running a test. Is it required for USB test too?

    I've tried to load GEL file and run USB related scripts but without any success. What is the correct procedure for USB test?

    Introduction
    -------------
    This text document accompanies the MUSB CCS test case for DM814X EVM. It 
    provides a brief of the methodology of the test and the procedure for executing 
    the same.
    
    Overview
    ---------
    This CCS test application validates the MUSB for its ability to perform device connect/disconnect.
    It also validates the speed and VBUS level post device connect.
    
    board setting:
    -------------
    PINS 1 and 2 of jumper J23 must be shorted on baseboard.
    
    Procudure
    ----------
    This test application assumes the MUSB controller initialization as well as all
    the PLL initialization already carried out by the GEL scripts. At the minimum
    the following GEL scripts are to be executed.
    	1. PG 2.x DM814X --> ALL_ADPLL_CLOCKS_ENABLE_API
    	2. PG 2.x DM814X --> USB_CLOCK_ENABLE
    
    load "BB_018_USB1_HOST_Test.out" file and run.
     
    The test is declared a PASS if the device is connected/disconnected gets displayed
    in the console and the device speed/VBUS levels are detected correctly.
    

    Refer to the attached read me file.

    BR
    Pavel

  • Anatoly Goldstein said:
    but for some reason USB controller refuses to switch to Host mode and doesn't drive USB1_DRVVBUS high.

    Looks to me like HW design issue, as the same configuration is working on the TI EVM board. You can check the TI EVM schematics, AM387x datasheet (section USB) and below wiki page:

    BR
    Pavel

  • Hi, Pavel.

    I've been busy for a while with a different task.

    I compared our schematics with a reference design of TI EVM and didn't find significant differences in USB1 circuitry.

    We also have X-ray images of our board, so I could check USB1_ID pin soldering and it looks to be ok. According to TRM and USB drivers this pin serves as the only condition for USB controller to decide about its mode and to drive USB1_DRVVBUS pin high/low.

    So we have USB1_ID pulled down, but USB1_DRVVBUS is not driven high.

    Its clear that I'm missing something but I can't understand what is it.

    Anatoly

  • Anatoly,

    Have you check AM387x Silicon errata, advisories 3.0.9 and 3.0.70? You might find s.th. there.

    BR
    Pavel
  • Pavel,

    I've checked the errata, but advisories you've mentioned doesn't look to be related to our case.
    As I mentioned earlier in this thread, for some reason test application is not working with our board, but I replicated USB initialization procedure manually and got the same results as with Linux driver.
    Currently we are rechecking HW again. Maybe you can give some additional tips what could be wrong except USB_ID pin?

    Thanks,
    Anatoly