How to configure USB 3.0 OTG function

Hello,
I tried to pair USB2 P0 and SS P0 to have USB3.0 OTG function on developer kit.
After reading TRM page 1283, I think we may need send USB2 P0 and SS P0 signals to XUSB controller.
My questions are below:

  1. How to configure MUX for USB2 P0 signal to XUSB controller instead of to USB2 controller#1 (OTG)?
  2. If USB 3.0 OTG works, how to force set TX1 as a device. Can we control USB_ID_PIN to enable this function?

Thanks for any help.

Hi yenyu,

Did you ever check this topic https://devtalk.nvidia.com/default/topic/933330/jetson-tx1/jetson-tx1-usb3-0-otg/ ? Hope it can help you.

Hi Trumany,
Thank you for your help.

I have followed below topics to configure our device and kernel menuconfig to pair USB2 P0 and SS P1

https://devtalk.nvidia.com/default/topic/933330/jetson-tx1/jetson-tx1-usb3-0-otg
https://devtalk.nvidia.com/default/topic/925646/tx1-usb3-0-design/

In host mode, it seems OK.
[ 124.054848] extcon-gpio-states 1.extcon: Cable state 2
[ 124.054995] tegra-xotg xotg.26: extcon_id_notifications():219: USB_ID pin grounded
[ 124.055087] tegra-xhci tegra-xhci: received otg event 2
[ 124.055192] tegra-xudc tegra-xudc: extcon_notifications():609: device is not ready, ignore this event
[ 124.055741] tegra-xhci tegra-xhci: received otg event 5
[ 124.055816] tegra-xhci tegra-xhci: otg port pp on
[ 124.056474] tegra-xotg xotg.26: xotg_work():857: state b_idle -> a_idle
[ 124.056592] tegra-xotg xotg.26: xotg_work():1228: state a_idle -> a_wait_vrise
[ 124.056749] tegra-xotg xotg.26: xotg_enable_vbus():471: id gnd to vbus on :0 ms
[ 124.060400] tegra-xotg xotg.26: xotg_work():1278: state a_wait_vrise -> a_wait_bcon
[ 124.081061] tegra-xotg xotg.26: xotg_work():1387: state a_wait_bcon -> a_host
[ 124.081165] tegra-xotg xotg.26: otg->gadget or gadget->dev.parent null
[ 124.224262] extcon-gpio-states 1.extcon: Cable state 2
[ 124.355194] usb 2-2: new SuperSpeed USB device number 3 using tegra-xhci
[ 124.383714] usb 2-2: device v05e3 p0616 is not supported
[ 124.389214] usb 2-2: New USB device found, idVendor=05e3, idProduct=0616
[ 124.389316] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 124.389405] usb 2-2: Product: USB3.0 Hub
[ 124.389486] usb 2-2: Manufacturer: GenesysLogic
[ 124.398736] hub 2-2:1.0: USB hub found
[ 124.399713] hub 2-2:1.0: 4 ports detected
[ 124.533718] usb 1-1: new high-speed USB device number 3 using tegra-xhci
[ 124.567194] usb 1-1: device v05e3 p0610 is not supported
[ 124.572694] usb 1-1: New USB device found, idVendor=05e3, idProduct=0610
[ 124.572795] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 124.572885] usb 1-1: Product: USB2.0 Hub
[ 124.572966] usb 1-1: Manufacturer: GenesysLogic
[ 124.583877] hub 1-1:1.0: USB hub found
[ 124.584887] hub 1-1:1.0: 4 ports detected
[ 124.689190] usb 2-2.1: new SuperSpeed USB device number 4 using tegra-xhci
[ 124.708208] usb 2-2.1: Parent hub missing LPM exit latency info. Power management will be impacted.
[ 124.716309] usb 2-2.1: device v8564 p1000 is not supported
[ 124.721983] usb 2-2.1: New USB device found, idVendor=8564, idProduct=1000
[ 124.722091] usb 2-2.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 124.722177] usb 2-2.1: Product: Mass Storage Device
[ 124.722257] usb 2-2.1: Manufacturer: JetFlash
[ 124.722338] usb 2-2.1: SerialNumber: 05Q0TMFDLSRL0RKA
[ 124.727080] usb-storage 2-2.1:1.0: USB Mass Storage device detected
[ 124.728582] scsi0 : usb-storage 2-2.1:1.0
[ 124.884995] usb 1-1.2: new high-speed USB device number 4 using tegra-xhci
[ 124.914353] usb 1-1.2: device v1005 pb113 is not supported
[ 124.920031] usb 1-1.2: New USB device found, idVendor=1005, idProduct=b113
[ 124.920132] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 124.920223] usb 1-1.2: Product: USB FLASH DRIVE
[ 124.920306] usb 1-1.2: Manufacturer:
[ 124.920387] usb 1-1.2: SerialNumber: 07085B470F944E45
[ 124.926519] usb-storage 1-1.2:1.0: USB Mass Storage device detected

and “lsusb -t” information, I plugged in two USB disk (3.0 and 2.0)
ubuntu@tegra-ubuntu:~$ lsusb -t
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=tegra-xhci/4p, 5000M
|__ Port 1: Dev 2, If 0, Class=Vendor Specific Class, Driver=r8152, 5000M
|__ Port 2: Dev 3, If 0, Class=Hub, Driver=hub/4p, 5000M
|__ Port 1: Dev 4, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=tegra-xhci/5p, 480M
|__ Port 1: Dev 3, If 0, Class=Hub, Driver=hub/4p, 480M
|__ Port 2: Dev 4, If 0, Class=Mass Storage, Driver=usb-storage, 480M

When I tried to set TX1 as device mode by controlling USB_ID, I got below kernel log.

[ 649.730187] extcon-gpio-states 1.extcon: Cable state 0
[ 649.730333] tegra-xotg xotg.26: extcon_id_notifications():222: USB_ID pin floating
[ 649.730422] tegra-xhci tegra-xhci: received otg event 6
[ 649.730521] tegra-xudc tegra-xudc: extcon_notifications():609: device is not ready, ignore this event
[ 649.738485] tegra-xotg xotg.26: xotg_work():1207: state a_idle -> b_idle
[ 651.329825] tegra-xotg xotg.26: xotg_work():906: state b_idle -> b_srp_init
[ 651.429756] tegra-xotg xotg.26: xotg_work():969: state b_srp_init -> b_idle
[ 651.438542] tegra-xudc tegra-xudc: IRQ event for host controller as well

Then I tried to set TX1 as mass_storage by below commands

  1. sudo insmod libcomposite.ko
  2. sudo insmod g_mass_storage.ko file=/dev/mmcblk1p1

I got below error messages:
[ 927.017502] g_mass_storage gadget: Mass Storage Function, version: 2009/09/11
[ 927.017514] g_mass_storage gadget: Number of LUNs=1
[ 927.017526] lun0: LUN: file: /dev/mmcblk1p1
[ 927.017538] g_mass_storage gadget: unable to autoconfigure all endpoints
[ 927.024778] g_mass_storage tegra-xudc: failed to start g_mass_storage: -524

Could you give me some ideals to fix this issue?

And I also tried another method to set TX1 as device mode.
https://devtalk.nvidia.com/default/topic/952472/jtx1_usb_as-device/?offset=4
But if I enable CONFIG_USB_G_ANDROID=y in kernel config, TX1 was crashed when booting.

Could you also give me some ideals of this issue?

Thank you very much.

Hi yenyu,
I see you make progress in
https://devtalk.nvidia.com/default/topic/952472/jetson-tx1/jtx1_usb_as-device/post/5033515/#5033515

So now you have get USB 2.0 otg work but USB 3.0 otg still fails?

Hi DaneLLL,

We was able to set TX1 as an USB 3.0 device successfully.

Thanks.