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.

DRA72XEVM: USB Role Switch is not working

Part Number: DRA72XEVM

Hi,

I am trying to perform USB role switch but writing to the debugfs but it fails.

Role switch happens on connect/disconnect of cables.

But it fails to happen while writing to the debugfs on GLSDK 6.00.00.03. The same had worked on GLSDK 03_00_00_03.

Any help would be appreciated.

Thanks,

Keerthana K

  • Hi Keerthana,

    Can you please share the detailed steps that you followed for the USB role switch including the commands used? Please include the kernel log as well.

    Also pls mention the USB instance use and the USB device/host connected to the DRA72XEVM for this testing.

    Thanks.

  • Hi Praveen,

    Please find the details below:

    After booting the board

    root@dra7xx-evm:~# cat /sys/kernel/debug/488d0000.usb/mode
    device

    Loading NCM gadget driver:

    root@dra7xx-evm:~# modprobe g_ncm
    [  105.339114] using random self ethernet address
    [  105.343580] using random host ethernet address
    [  105.356189] usb0: HOST MAC 56:74:19:23:cb:e6
    [  105.365473] usb0: MAC 4a:c7:94:2e:0e:ee
    [  105.369346] g_ncm gadget: NCM Gadget
    [  105.372935] g_ncm gadget: g_ncm ready
    [  105.432114] IPv6: ADDRCONF(NETDEV_UP): usb0: link is not ready

    Now connecting iPhone to USB2:

    root@dra7xx-evm:~# [  145.368692] xhci-hcd xhci-hcd.2.auto: xHCI Host Controller
    [  145.374221] xhci-hcd xhci-hcd.2.auto: new USB bus registered, assigned bus number 3
    [  145.400943] xhci-hcd xhci-hcd.2.auto: hcc params 0x0220f04c hci version 0x100 quirks 0x0000000002010010
    [  145.421754] xhci-hcd xhci-hcd.2.auto: irq 185, io mem 0x488d0000
    [  145.428731] usb usb3: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 4.19
    [  145.437346] usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1
    [  145.445260] usb usb3: Product: xHCI Host Controller
    [  145.450159] usb usb3: Manufacturer: Linux 4.19.73-g31275c05a1 xhci-hcd
    [  145.457176] usb usb3: SerialNumber: xhci-hcd.2.auto
    [  145.464082] hub 3-0:1.0: USB hub found
    [  145.474365] hub 3-0:1.0: 1 port detected
    [  145.485993] xhci-hcd xhci-hcd.2.auto: xHCI Host Controller
    [  145.491513] xhci-hcd xhci-hcd.2.auto: new USB bus registered, assigned bus number 4
    [  145.507339] xhci-hcd xhci-hcd.2.auto: Host supports USB 3.0 SuperSpeed
    [  145.528642] usb usb4: We don't know the algorithms for LPM for this host, disabling LPM.
    [  145.538253] usb usb4: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 4.19
    [  145.547228] usb usb4: New USB device strings: Mfr=3, Product=2, SerialNumber=1
    [  145.554807] usb usb4: Product: xHCI Host Controller
    [  145.559705] usb usb4: Manufacturer: Linux 4.19.73-g31275c05a1 xhci-hcd
    [  145.566686] usb usb4: SerialNumber: xhci-hcd.2.auto
    [  145.573518] hub 4-0:1.0: USB hub found
    [  145.584358] hub 4-0:1.0: 1 port detected
    [  146.434241] usb 3-1: new high-speed USB device number 2 using xhci-hcd
    [  146.616021] usb 3-1: New USB device found, idVendor=05ac, idProduct=12a8, bcdDevice= 7.02
    [  146.624262] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    [  146.631431] usb 3-1: Product: iPhone
    [  146.635957] usb 3-1: Manufacturer: Apple Inc.
    [  146.640338] usb 3-1: SerialNumber: 2f4fcc5140aaacf42d51c10e82ed9630abd9f3ef

    Mode is set automatically to host mode:

    root@dra7xx-evm:~# cat /sys/kernel/debug/488d0000.usb/mode
    host

    Now performing role switch on USB2:

    Send role switch command to iPhone:

    [  183.792280] usb 3-1: USB disconnect, device number 2

    Then setting the J6 to device mode:

    root@dra7xx-evm:~# echo device > /sys/kernel/debug/488d0000.usb/mode                                                                                   
    root@dra7xx-evm:~# [  249.843135] xhci-hcd xhci-hcd.2.auto: remove, state 4
    [  249.849758] usb usb4: USB disconnect, device number 1
    [  249.860543] xhci-hcd xhci-hcd.2.auto: USB bus 4 deregistered
    [  249.872764] xhci-hcd xhci-hcd.2.auto: remove, state 4
    [  249.877867] usb usb3: USB disconnect, device number 1
    [  249.891780] xhci-hcd xhci-hcd.2.auto: USB bus 3 deregistered
    [  249.909156] using random self ethernet address
    [  249.919276] using random host ethernet address
    [  249.927575] usb0: HOST MAC 02:38:aa:3d:b7:59
    [  249.935662] usb0: MAC 8a:f5:e7:22:3b:d1
    [  249.939536] g_ncm gadget: NCM Gadget
    [  249.952751] g_ncm gadget: g_ncm ready
    [  250.000596] IPv6: ADDRCONF(NETDEV_UP): usb0: link is not ready

    root@dra7xx-evm:~# cat /sys/kernel/debug/488d0000.usb/mode
    device

    If I disconnect iPhone and connect it to PC:

    [  316.273697] g_ncm gadget: high-speed config #1: CDC Ethernet (NCM)
    [  316.280747] IPv6: ADDRCONF(NETDEV_CHANGE): usb0: link becomes ready

    Kindly let me know why the usb0 link does not becomes ready with iPhone.

  • Hi Keerthana,

    There looks to be an issue with the USB role switch with the GLSDK 6.00.00.03. There is limited support that can be provided on this release at this time.

    Since it is working on the previous SDK release, we suspect there could be a missing patch. We suggest you cross-checking the USB driver between these two releases to identify the missing code/patch.

    Thanks.