imx6ull USB_OTG1 host sometimes can not detect a inserted usb device

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

imx6ull USB_OTG1 host sometimes can not detect a inserted usb device

2,906 Views
changbaoma
Contributor III

In our custom imx6ull board, we use USB_OTG2 as usb host connect to 4G modem, and  USB_OTG1 as usb host connect to a USB typeA interface.

In most case USB_OTG1 can success recognize a inserted Udisk, and there is a 3% probability that cannot  recognize. when in that abnormal situation, we try a lot unplug and insert, but the Udisk was not successfully recognized even once, we also try other usb device,eg. USB mouse, other brand Udisk is the same. And in that abnormal situation,USB_OTG2 can success to recognize unplug and insert 4G modem.

root@Router:/etc# lsusb
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

So in the beginning we think this mybe a hardware issue, because there is only 5% probability custom imx6ull board exist this issue,but in that abnormal situation if we try  "rmmod ci_hdrc_imx" and then "modprobe ci_hdrc_imx"  (sometime need try twice),USB_OTG1 can success to recognize the Udisk. So now i  think there may be also a "ci_hdrc_imx" driver bug.

root@Router:~# lsmod
Module Size Used by
ci_hdrc_imx 16384 0
ci_hdrc 57344 1 ci_hdrc_imx
ehci_hcd 53248 1 ci_hdrc
usbmisc_imx 20480 1 ci_hdrc_imx
evbug 16384 0
root@Router:~# rmmod ci_hdrc_imx
[ 122.118951] ci_hdrc ci_hdrc.1: remove, state 4
[ 122.123437] usb usb2: USB disconnect, device number 1
[ 122.140736] ci_hdrc ci_hdrc.1: USB bus 2 deregistered
[ 122.161250] ci_hdrc ci_hdrc.0: remove, state 1
[ 122.236537] hub 1-0:1.0: activate --> -108
[ 122.240753] usb usb1: USB disconnect, device number 1
[ 122.274650] ci_hdrc ci_hdrc.0: USB bus 1 deregistered
root@Router:~#
root@Router:~#
root@Router:~#
root@Router:~#
root@Router:~# modprobe ci_hdrc_imx
[ 133.404398] imx_usb 2184000.usb: No over current polarity defined
[ 133.416681] imx_usb 2184000.usb: 2184000.usb supply vbus not found, using dummy regulator
[ 133.466688] ci_hdrc ci_hdrc.0: EHCI Host Controller
[ 133.471663] ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 1
[ 133.506583] ci_hdrc ci_hdrc.0: USB 2.0 started, EHCI 1.00
[ 133.513254] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.04
[ 133.532438] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 133.543649] usb usb1: Product: EHCI Host Controller
[ 133.550679] usb usb1: Manufacturer: Linux 5.4.24 ehci_hcd
[ 133.558568] usb usb1: SerialNumber: ci_hdrc.0
[ 133.581312] hub 1-0:1.0: USB hub found
[ 133.585190] hub 1-0:1.0: 1 port detected
[ 133.615430] imx_usb 2184200.usb: 2184200.usb supply vbus not found, using dummy regulator
[ 133.652481] ci_hdrc ci_hdrc.1: EHCI Host Controller
[ 133.666850] ci_hdrc ci_hdrc.1: new USB bus registered, assigned bus number 2
[ 133.716535] ci_hdrc ci_hdrc.1: USB 2.0 started, EHCI 1.00
[ 133.729739] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.04
[ 133.746536] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 133.753787] usb usb2: Product: EHCI Host Controller
[ 133.776502] usb usb2: Manufacturer: Linux 5.4.24 ehci_hcd
[ 133.781954] usb usb2: SerialNumber: ci_hdrc.1
[ 133.818004] hub 2-0:1.0: USB hub found
[ 133.821877] hub 2-0:1.0: 1 port detected
root@Router:~# [ 133.966498] usb 1-1: new high-speed USB device number 2 using ci_hdrc
[ 134.018888] usb 1-1: New USB device found, idVendor=14cd, idProduct=2536, bcdDevice= 3.00
[ 134.036431] usb 1-1: New USB device strings: Mfr=1, Product=3, SerialNumber=2
[ 134.043593] usb 1-1: Product: Mass Storage Device
[ 134.066523] usb 1-1: Manufacturer: Generic USB Device
[ 134.072036] usb 1-1: SerialNumber: 2536201609180000
[ 134.089037] usb-storage 1-1:1.0: USB Mass Storage device detected
[ 134.117513] scsi host0: usb-storage 1-1:1.0
[ 135.207983] scsi 0:0:0:0: Direct-Access Mass Storage Device 1.00 PQ: 0 ANSI: 0 CCS
[ 135.240656] sd 0:0:0:0: [sda] 31105024 512-byte logical blocks: (15.9 GB/14.8 GiB)
[ 135.267407] sd 0:0:0:0: [sda] Write Protect is off
[ 135.284889] sd 0:0:0:0: [sda] No Caching mode page found
[ 135.306656] sd 0:0:0:0: [sda] Assuming drive cache: write through
[ 135.346777] sda: sda1
[ 135.359644] sd 0:0:0:0: [sda] Attached SCSI removable disk
[ 138.063436] FAT-fs (sda1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.

 

Here is

our Dts

 pinctrl_usb_otg1: usbotg1grp {
fsl,pins = <
MX6UL_PAD_GPIO1_IO00__ANATOP_OTG1_ID 0x17059
MX6UL_PAD_GPIO1_IO01__USB_OTG1_OC 0x17059
>;
};

&usbotg1 {
dr_mode = "otg";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_usb_otg1>;
status = "okay";
};

our hareware sch:

5555.png4444.png

aaa.pngbbb.png

Our kernel:

https://source.codeaurora.org/external/imx/linux-imx

banch remotes/origin/imx_5.4.24_2.1.0

 

Any suggestions are appreciated,thanks

 

 

 

 

 

0 Kudos
Reply
4 Replies

2,887 Views
weidong_sun
NXP TechSupport
NXP TechSupport

See the node, please!

&usbotg1 {
dr_mode = "otg";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_usb_otg1>;
status = "okay";
};

dr_mode should be host for your LTE module.

 

 

0 Kudos
Reply

2,878 Views
changbaoma
Contributor III

Hi, @weidong_sun 

We tryed your advise, and force dr_mode = host in dts, but do not make any difference.

And i  think the "dr_mode = otg" in usbotg mode will auto switch dr_mode every USB driver install by detect USB1_OTG_ID gpio level.  (In our design USB1_OTG_ID alway pull-down with 10K )

0 Kudos
Reply

2,895 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hi,

See suggestions below, please!

1. Your USB OTG1 should be configured as HOST mode.

--USB OTG1 ID PIN should be pulled down to LOW via a resistor(such as 2.2K)

--5V on board should be conencted to USB OTG1 VBUS and VBUS PIN On USB TYPE-AF connector.

2. More detailed on USB OTG working as device mode an Host mode, see the link, please!

https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/iMX6UL-LL-LZ-USB-OTG-Switch-Between-Devi...


Hope this information is helpful to you.

Have a nice day!

B.R,

Weidong

0 Kudos
Reply

2,892 Views
changbaoma
Contributor III

Thank you for your reply, @weidong_sun 

Sorry for our incomplete information.

1、indeed USB OTG1 ID PIN was allready low at that time(SW1.6 is off ),

4444.png

and we also sew the USB OTG1 root hub at that time.

root@Router:/etc# lsusb
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

2、"+5V" on board is directly conencted to USB_OTG1_VBUS pin, and indirectly conencted to USB TYPE-AF connector's VBUS pin through a current limiting IC. we checked no voltage drop with “+5V” at that time.

5555.png

So @weidong_sun we don't really think this problem is a fully hardware issue, beacuse  if we try uninstall and then install driver ci_hdrc_imx("rmmod ci_hdrc_imx" and then "modprobe ci_hdrc_imx"), USB OTG1 became work well. 

Any one have suggestions ?

 

 

 

 

 

 

 

0 Kudos
Reply