Tool/software: Linux
Hello,
I am attempting to get USB host working on Linux but have run into some issues that don't seem to be addressed in documentation or the forum. I am using Processor SDK 4.2.0.09. My custom board does not have an oscillator dedicated to USB, instead we hope to use the internal clock distribution network. I checked the clock registers at runtime and it appeared as though everything was set up for the 24 MHz USB Clock to be sourced from the UART PLL / 16, which is the default configuration.
When I plug in a USB device, I see the following output in dmesg:
[ 54.000973] usb 1-1: new low-speed USB device number 2 using xhci-hcd [ 54.141022] usb 1-1: device descriptor read/64, error -71 [ 54.401054] usb 1-1: device descriptor read/64, error -71 [ 54.661017] usb 1-1: new low-speed USB device number 3 using xhci-hcd [ 54.801027] usb 1-1: device descriptor read/64, error -71 [ 55.061014] usb 1-1: device descriptor read/64, error -71 [ 55.321061] usb 1-1: new low-speed USB device number 4 using xhci-hcd [ 55.328985] usb 1-1: Device not responding to setup address. [ 55.571349] usb 1-1: Device not responding to setup address. [ 55.790980] usb 1-1: device not accepting address 4, error -71 [ 55.931144] usb 1-1: new low-speed USB device number 5 using xhci-hcd [ 55.952436] usb 1-1: Device not responding to setup address. [ 56.201350] usb 1-1: Device not responding to setup address. [ 56.420973] usb 1-1: device not accepting address 5, error -71 [ 56.427250] usb usb1-port1: unable to enumerate USB device
This happens with at least two different flash drives and one usb keyboard. Several places I looked online said that this error (Protocol Error, -71) is usually a hardware problem. This led me to check VBUS and the data waveforms. When the device is attached, a short (~60ns of ringing) transient with pk-pk amplitude of 1.4V at its max can be observed at the VBUS pin on the connector. While this transient is relatively large, it is also very fast, so we aren't sure that it is an issue. The data waveform looks pretty clean with a rise time of 140ns and an amplitude of 3.16V (looking at D+ relative to GND). It almost looks like the PHY is stepping the voltage to limit the slew rate. Because of these observations, it does not seem like it is a signal integrity issue or a power supply issue. The datta lines have 30 mils of length skew and pass through two vias on each leg. These vias have gnd vias on either side of them, and the ground planes are continuous underneath the traces. The traces are about 5.7 inches long.
On the software side of things, here is a list of loaded modules:
sha512_arm 12252 0 sha256_generic 10178 0 sha1_generic 2864 0 sha1_arm_neon 6261 0 sha1_arm 3862 1 sha1_arm_neon md5 2219 0 des_generic 17608 0 cbc 2388 0 xfrm_user 22909 2 xfrm4_tunnel 2040 0 ipcomp 2473 0 xfrm_ipcomp 4567 1 ipcomp ah4 5665 0 af_key 27996 0 xhci_plat_hcd 6347 0 xhci_hcd 108653 1 xhci_plat_hcd usbcore 201157 2 xhci_plat_hcd,xhci_hcd pru_rproc 10520 0 pruss_intc 7227 1 pru_rproc dwc3 27562 0 usb_common 4737 2 usbcore,dwc3 pruss 9774 1 pru_rproc phy_generic 5372 2 keystone_dsp_mem 4318 1 dwc3_keystone 2458 0 davinci_wdt 3001 0 keystone_remoteproc 10828 3 pruss_soc_bus 4207 0 sch_fq_codel 8911 1 uio_module_drv 7417 0 uio 9201 4 keystone_remoteproc,uio_module_drv rpmsg_proto 6870 0 virtio_rpmsg_bus 9418 1 rpmsg_proto rpmsg_core 7124 2 rpmsg_proto,virtio_rpmsg_bus remoteproc 28325 3 pru_rproc,keystone_remoteproc,rpmsg_proto ipsecmgr_mod 17822 0 xfrm_algo 6989 5 xfrm_user,ipsecmgr_mod,ah4,af_key,xfrm_ipcomp hplibmod 6093 0 cryptodev 37775 1 cmemk 35419 4
And here is the portion of the kernel config relating to USB:
CONFIG_USB_OHCI_LITTLE_ENDIAN=y CONFIG_USB_SUPPORT=y CONFIG_USB_COMMON=m CONFIG_USB_ARCH_HAS_HCD=y CONFIG_USB=m CONFIG_USB_ANNOUNCE_NEW_DEVICES=y # # Miscellaneous USB options # CONFIG_USB_DEFAULT_PERSIST=y # CONFIG_USB_DYNAMIC_MINORS is not set # CONFIG_USB_OTG is not set # CONFIG_USB_OTG_WHITELIST is not set # CONFIG_USB_OTG_BLACKLIST_HUB is not set # CONFIG_USB_LEDS_TRIGGER_USBPORT is not set CONFIG_USB_MON=m # CONFIG_USB_WUSB_CBAF is not set # # USB Host Controller Drivers # # CONFIG_USB_C67X00_HCD is not set CONFIG_USB_XHCI_HCD=m CONFIG_USB_XHCI_PCI=m CONFIG_USB_XHCI_PLATFORM=m CONFIG_USB_EHCI_HCD=m # CONFIG_USB_EHCI_ROOT_HUB_TT is not set CONFIG_USB_EHCI_TT_NEWSCHED=y CONFIG_USB_EHCI_PCI=m CONFIG_USB_EHCI_HCD_PLATFORM=m # CONFIG_USB_OXU210HP_HCD is not set # CONFIG_USB_ISP116X_HCD is not set # CONFIG_USB_ISP1362_HCD is not set # CONFIG_USB_FOTG210_HCD is not set # CONFIG_USB_MAX3421_HCD is not set CONFIG_USB_OHCI_HCD=m CONFIG_USB_OHCI_HCD_PCI=m CONFIG_USB_OHCI_HCD_PLATFORM=m CONFIG_USB_UHCI_HCD=m # CONFIG_USB_SL811_HCD is not set CONFIG_USB_R8A66597_HCD=m # CONFIG_USB_HCD_TEST_MODE is not set # # USB Device Class drivers # # CONFIG_USB_ACM is not set # CONFIG_USB_PRINTER is not set # CONFIG_USB_WDM is not set # CONFIG_USB_TMC is not set # # NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may # # # also be needed; see USB_STORAGE Help for more info # CONFIG_USB_STORAGE=m CONFIG_USB_STORAGE_DEBUG=y # CONFIG_USB_STORAGE_REALTEK is not set # CONFIG_USB_STORAGE_DATAFAB is not set # CONFIG_USB_STORAGE_FREECOM is not set # CONFIG_USB_STORAGE_ISD200 is not set # CONFIG_USB_STORAGE_USBAT is not set # CONFIG_USB_STORAGE_SDDR09 is not set # CONFIG_USB_STORAGE_SDDR55 is not set # CONFIG_USB_STORAGE_JUMPSHOT is not set # CONFIG_USB_STORAGE_ALAUDA is not set # CONFIG_USB_STORAGE_ONETOUCH is not set # CONFIG_USB_STORAGE_KARMA is not set # CONFIG_USB_STORAGE_CYPRESS_ATACB is not set # CONFIG_USB_STORAGE_ENE_UB6250 is not set CONFIG_USB_UAS=m # # USB Imaging devices # # CONFIG_USB_MDC800 is not set # CONFIG_USB_MICROTEK is not set # CONFIG_USBIP_CORE is not set CONFIG_USB_MUSB_HDRC=m CONFIG_USB_MUSB_HOST=y # CONFIG_USB_MUSB_GADGET is not set # CONFIG_USB_MUSB_DUAL_ROLE is not set # # Platform Glue Layer # # # MUSB DMA mode # # CONFIG_MUSB_PIO_ONLY is not set CONFIG_USB_DWC3=m CONFIG_USB_DWC3_HOST=y # CONFIG_USB_DWC3_GADGET is not set # CONFIG_USB_DWC3_DUAL_ROLE is not set # # Platform Glue Driver Support # # CONFIG_USB_DWC3_PCI is not set CONFIG_USB_DWC3_KEYSTONE=m CONFIG_USB_DWC3_OF_SIMPLE=m # CONFIG_USB_DWC2 is not set # CONFIG_USB_CHIPIDEA is not set # CONFIG_USB_ISP1760 is not set # # USB port drivers # # CONFIG_USB_SERIAL is not set # # USB Miscellaneous drivers # # CONFIG_USB_EMI62 is not set # CONFIG_USB_EMI26 is not set # CONFIG_USB_ADUTUX is not set # CONFIG_USB_SEVSEG is not set # CONFIG_USB_RIO500 is not set # CONFIG_USB_LEGOTOWER is not set # CONFIG_USB_LCD is not set # CONFIG_USB_CYPRESS_CY7C63 is not set # CONFIG_USB_CYTHERM is not set # CONFIG_USB_IDMOUSE is not set # CONFIG_USB_FTDI_ELAN is not set # CONFIG_USB_APPLEDISPLAY is not set # CONFIG_USB_SISUSBVGA is not set # CONFIG_USB_LD is not set # CONFIG_USB_TRANCEVIBRATOR is not set # CONFIG_USB_IOWARRIOR is not set CONFIG_USB_TEST=m # CONFIG_USB_EHSET_TEST_FIXTURE is not set # CONFIG_USB_ISIGHTFW is not set # CONFIG_USB_YUREX is not set # CONFIG_USB_EZUSB_FX2 is not set # CONFIG_USB_HSIC_USB3503 is not set # CONFIG_USB_HSIC_USB4604 is not set # CONFIG_USB_LINK_LAYER_TEST is not set # CONFIG_USB_CHAOSKEY is not set # # USB Physical Layer drivers # CONFIG_USB_PHY=y CONFIG_KEYSTONE_USB_PHY=m CONFIG_NOP_USB_XCEIV=m CONFIG_AM335X_CONTROL_USB=m CONFIG_AM335X_PHY_USB=m CONFIG_USB_GPIO_VBUS=m CONFIG_USB_ISP1301=m # CONFIG_USB_ULPI is not set CONFIG_USB_GADGET=m # CONFIG_USB_GADGET_DEBUG is not set # CONFIG_USB_GADGET_DEBUG_FILES is not set # CONFIG_USB_GADGET_DEBUG_FS is not set CONFIG_USB_GADGET_VBUS_DRAW=2 CONFIG_USB_GADGET_STORAGE_NUM_BUFFERS=2 # # USB Peripheral Controller # # CONFIG_USB_FOTG210_UDC is not set # CONFIG_USB_GR_UDC is not set # CONFIG_USB_R8A66597 is not set # CONFIG_USB_PXA27X is not set # CONFIG_USB_MV_UDC is not set # CONFIG_USB_MV_U3D is not set # CONFIG_USB_M66592 is not set # CONFIG_USB_BDC_UDC is not set # CONFIG_USB_AMD5536UDC is not set # CONFIG_USB_NET2272 is not set # CONFIG_USB_NET2280 is not set # CONFIG_USB_GOKU is not set # CONFIG_USB_EG20T is not set # CONFIG_USB_GADGET_XILINX is not set # CONFIG_USB_DUMMY_HCD is not set # CONFIG_USB_CONFIGFS is not set # CONFIG_USB_LED_TRIG is not set # CONFIG_USB_ULPI_BUS is not set # CONFIG_UWB is not set CONFIG_MMC=y # CONFIG_MMC_DEBUG is not set CONFIG_PWRSEQ_EMMC=y CONFIG_PWRSEQ_SIMPLE=y
Here is the DTB Snippet relating to USB (dtsi is unchanged from evm):
&keystone_usb0 {
status = "okay";
};
&usb0_phy {
status = "okay";
};
&usb0 {
dr_mode = "host";
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&usb0_pins>;
};
And lastly, here is the output of dmesg | grep usb:
[ 34.639102] usb_phy_generic soc:usb-phy@0: GPIO lookup for consumer reset [ 34.639122] usb_phy_generic soc:usb-phy@0: using device tree for GPIO lookup [ 34.639138] of_get_named_gpiod_flags: can't parse 'reset-gpios' property of node '/soc/usb-phy@0[0]' [ 34.639150] of_get_named_gpiod_flags: can't parse 'reset-gpio' property of node '/soc/usb-phy@0[0]' [ 34.639162] usb_phy_generic soc:usb-phy@0: using lookup tables for GPIO lookup [ 34.639175] usb_phy_generic soc:usb-phy@0: lookup for GPIO reset failed [ 34.639187] usb_phy_generic soc:usb-phy@0: GPIO lookup for consumer vbus-detect [ 34.639196] usb_phy_generic soc:usb-phy@0: using device tree for GPIO lookup [ 34.639208] of_get_named_gpiod_flags: can't parse 'vbus-detect-gpios' property of node '/soc/usb-phy@0[0]' [ 34.639219] of_get_named_gpiod_flags: can't parse 'vbus-detect-gpio' property of node '/soc/usb-phy@0[0]' [ 34.639229] usb_phy_generic soc:usb-phy@0: using lookup tables for GPIO lookup [ 34.639240] usb_phy_generic soc:usb-phy@0: lookup for GPIO vbus-detect failed [ 34.639270] soc:usb-phy@0 supply vcc not found, using dummy regulator [ 52.909384] usbcore: registered new interface driver usbfs [ 52.955831] usbcore: registered new interface driver hub [ 52.967450] usbcore: registered new device driver usb [ 53.589029] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002 [ 53.602100] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1 [ 53.609670] usb usb1: Product: xHCI Host Controller [ 53.618926] usb usb1: Manufacturer: Linux 4.9.59-ga75d8e9305 xhci-hcd [ 53.628338] usb usb1: SerialNumber: xhci-hcd.0.auto [ 53.675070] usb usb2: We don't know the algorithms for LPM for this host, disabling LPM. [ 53.686549] usb usb2: New USB device found, idVendor=1d6b, idProduct=0003 [ 53.696367] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1 [ 53.706512] usb usb2: Product: xHCI Host Controller [ 53.714181] usb usb2: Manufacturer: Linux 4.9.59-ga75d8e9305 xhci-hcd [ 53.723444] usb usb2: SerialNumber: xhci-hcd.0.auto
I have tried a few software changes that people had luck with on Higher-level operating systems( i.e. Ubuntu) with no success. Most of these pertain to disabling usbcore autosuspend. I have also been unsuccessful in getting USB to work in U-Boot, though this is not necessary for our implementation.
Any help or guidance that can be provided is appreciated.
Jeff

