I have two usb ports, a usb-standard A port and a usb-mini port, on my custom board, neither of which are working properly. My custom board has an IMX6Q and is based on the sabresd platform.
When I plug a usb stick into the usb-standard port I get the following output on dmesg:
ehci_fsl_bus_resume begins, Host 1
ehci_fsl_bus_resume ends, Host 1
usb 2-1: new high speed USB device number 10 using fsl-ehci
usb 2-1: device descriptor read/64, error -71
usb 2-1: device descriptor read/64, error -71
usb 2-1: new high speed USB device number 11 using fsl-ehci
usb 2-1: device descriptor read/64, error -71
usb 2-1: device descriptor read/64, error -71
usb 2-1: new high speed USB device number 12 using fsl-ehci
usb 2-1: device not accepting address 12, error -71
usb 2-1: new high speed USB device number 13 using fsl-ehci
usb 2-1: device not accepting address 13, error -71
hub 2-0:1.0: unable to enumerate USB device on port 1
ehci_fsl_bus_suspend begins, Host 1
ehci_fsl_bus_suspend ends, Host 1
Plugging a host device, like a computer, into the OTG usb mini port. I get no response at all.
---------------------------------------------------------------------------------------------------------------------------------------------------
Here is my initialization code:
I've defined these pads for driving the usb-standard A port:
MX6Q_PAD_GPIO_0__GPIO_1_0 /*USB_H1_PWR*/
MX6Q_PAD_GPIO_3__USBOH3_USBH1_OC /*USB_H1_OC*/
I've defined these pads for driving the usb-mini port:
MX6Q_PAD_GPIO_1__USBOTG_ID /*USB_OTG_ID*/
MX6Q_PAD_KEY_COL4__USBOH3_USBOTG_OC /*USB_OTG_OC*/
MX6Q_PAD_KEY_ROW4__GPIO_4_15 /*USB_OTG_PWR*/
Here is my usb initialization function:
#define USB_OTG_PWR IMX_GPIO_NR(4, 15)
#define USB_H1_PWR IMX_GPIO_NR(1, 0)
static void imx6q_dtra3_usbotg_vbus(bool on) {
if (on)
gpio_set_value(USB_OTG_PWR, 1);
else
gpio_set_value(USB_OTG_PWR, 0);
}
static void imx6q_dtra3_host1_vbus(bool on) {
if (on)
gpio_set_value(USB_H1_PWR, 1);
else
gpio_set_value(USB_H1_PWR, 0);
}
static void __init imx6q_dtra3_init_usb(void) {
int ret = 0;
imx_otg_base = MX6_IO_ADDRESS(MX6Q_USB_OTG_BASE_ADDR);
ret = gpio_request(USB_OTG_PWR, "usb-pwr");
if (ret) {
pr_err("failed to get GPIO USB_OTG_PWR: %d\n", ret);
return;
}
gpio_direction_output(USB_OTG_PWR, 0);
/* keep USB host1 VBUS always on */
ret = gpio_request(USB_H1_PWR, "usb-h1-pwr");
if (ret) {
pr_err("failed to get GPIO USB_H1_PWR: %d\n", ret);
return;
}
gpio_direction_output(USB_H1_PWR, 1);
mxc_iomux_set_gpr_register(1, 13, 1, 1);
mx6_set_otghost_vbus_func(imx6q_dtra3_usbotg_vbus);
mx6_set_host1_vbus_func(imx6q_dtra3_host1_vbus);
}
--------------------------------------------------------------------------------------------------------------------------------------
Here is the output of cat /proc/driver/isp1504_otg
Freescale USB OTG Driver
fsl_usb2_otg version: $Revision: 1.55 $
OTGSC reg: 01042120
PORTSC reg: 1cd01000
USBMODE reg: 00000013
USBCMD reg: 00010004
USBSTS reg: 00001088
OTG state: UNDEFINED
a_bus_req: 1
b_bus_req: 0
a_bus_resume: 0
a_bus_suspend: 0
a_conn: 0
a_sess_vld: 0
a_srp_det: 0
a_vbus_vld: 0
b_bus_resume: 0
b_bus_suspend: 0
b_conn: 0
b_se0_srp: 0
b_sess_end: 0
b_sess_vld: 0
id: 1
-------------------------------------------------------------------------------------------------------------------------------------------
Here is my kernel start-up log:
U-Boot 2009.08 (Jul 30 2014 - 08:50:28)
CPU: Freescale i.MX6 family TO1.2 at 792 MHz
Thermal sensor with ratio = 185
Temperature: 31 C, calibration data 0x5954e57d
mx6q pll1: 792MHz
mx6q pll2: 528MHz
mx6q pll3: 480MHz
mx6q pll8: 50MHz
ipg clock : 66000000Hz
ipg per clock : 66000000Hz
uart clock : 80000000Hz
cspi clock : 60000000Hz
ahb clock : 132000000Hz
axi clock : 264000000Hz
emi_slow clock: 132000000Hz
ddr clock : 528000000Hz
usdhc1 clock : 198000000Hz
usdhc2 clock : 198000000Hz
usdhc3 clock : 198000000Hz
usdhc4 clock : 198000000Hz
nfc clock : 24000000Hz
Board: i.MX6Q-DTRA-3: DTRA3 Board: 0x63e12 [WDOG]
Boot Device: SD (2)
I2C: ready
DRAM: 1 GB
MMC: FSL_USDHC: 0,FSL_USDHC: 1,FSL_USDHC: 2,FSL_USDHC: 3
In: serial
Out: serial
Err: serial
i2c: I2C3 SDA is low, start i2c recovery...
I2C3 Recovery failed, I2C1 SDA still low!!!
Net: got MAC address from IIM: 00:00:00:00:00:00
enet_board_init: reset phy
FEC0 [PRIME]
Hit any key to stop autoboot: 0
mmc1 is current device
MMC read: dev # 1, block # 2048, count 8192 ... 8192 blocks read: OK
## Booting kernel from Legacy Image at 10800000 ...
Image Name: Linux-3.0.35-2508-g54750ff
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 3952880 Bytes = 3.8 MB
Load Address: 10008000
Entry Point: 10008000
Verifying Checksum ... OK
Loading Kernel Image ... OK
OK
Starting kernel ...
Linux version 3.0.35-2508-g54750ff (jbert@claws) (gcc version 4.6.2 20110630 (prerelease) (Freescale MAD -- Linaro 2011.07 -- Built at 2011/08/10 09:20) ) #55 SMP PREEMPT Fri Aug 1 15:37:56 PDT 2014
CPU: ARMv7 Processor [412fc09a] revision 10 (ARMv7), cr=10c53c7d
CPU: VIPT nonaliasing data cache, VIPT aliasing instruction cache
Machine: PARC DTRA3 based on 6Quad Sabre-SD Board
Ignoring unrecognised tag 0x54410008
Memory policy: ECC disabled, Data cache writealloc
CPU identified as i.MX6Q, silicon rev 1.2
PERCPU: Embedded 7 pages/cpu @8c008000 s5440 r8192 d15040 u32768
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 194560
Kernel command line: maxcpus=1 console=ttymxc0,115200 root=/dev/mmcblk1p1 rw rootwait
PID hash table entries: 4096 (order: 2, 16384 bytes)
Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
Memory: 512MB 256MB = 768MB total
Memory: 765572k/765572k available, 283004k reserved, 0K highmem
Virtual kernel memory layout:
vector : 0xffff0000 - 0xffff1000 ( 4 kB)
fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)
DMA : 0xf4600000 - 0xffe00000 ( 184 MB)
vmalloc : 0xc0800000 - 0xf2000000 ( 792 MB)
lowmem : 0x80000000 - 0xc0000000 (1024 MB)
pkmap : 0x7fe00000 - 0x80000000 ( 2 MB)
modules : 0x7f000000 - 0x7fe00000 ( 14 MB)
.init : 0x80008000 - 0x8003e000 ( 216 kB)
.text : 0x8003e000 - 0x80abca18 (10747 kB)
.data : 0x80abe000 - 0x80b23280 ( 405 kB)
.bss : 0x80b232a4 - 0x80b7184c ( 314 kB)
SLUB: Genslabs=13, HWalign=32, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
Preemptible hierarchical RCU implementation.
NR_IRQS:624
MXC GPIO hardware
sched_clock: 32 bits at 3000kHz, resolution 333ns, wraps every 1431655ms
arm_max_freq=1GHz
MXC_Early serial console at MMIO 0x2020000 (options '115200')
bootconsole [ttymxc0] enabled
Console: colour dummy device 80x30
Calibrating delay loop... 1581.05 BogoMIPS (lpj=7905280)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
hw perfevents: enabled with ARMv7 Cortex-A9 PMU driver, 7 counters available
Brought up 1 CPUs
SMP: Total of 1 processors activated (1581.05 BogoMIPS).
print_constraints: dummy:
NET: Registered protocol family 16
print_constraints: vddpu: 725 <--> 1300 mV at 700 mV fast normal
print_constraints: vddcore: 725 <--> 1300 mV at 1150 mV fast normal
print_constraints: vddsoc: 725 <--> 1300 mV at 1200 mV fast normal
print_constraints: vdd2p5: 2000 <--> 2775 mV at 2400 mV fast normal
print_constraints: vdd1p1: 800 <--> 1400 mV at 1100 mV fast normal
print_constraints: vdd3p0: 2625 <--> 3400 mV at 3000 mV fast normal
***********************INIT USB********************
Power down KEY_ROW4: USB_OTG_PWR
Power up GPIO_0: USB_H1_PWR
hw-breakpoint: found 6 breakpoint and 1 watchpoint registers.
hw-breakpoint: 1 breakpoint(s) reserved for watchpoint single-step.
hw-breakpoint: maximum watchpoint size is 4 bytes.
L310 cache controller enabled
l2x0: 16 ways, CACHE_ID 0x410000c7, AUX_CTRL 0x02070000, Cache size: 1048576 B
bio: create slab <bio-0> at 0
mxs-dma mxs-dma-apbh: initialized
print_constraints: vmmc: 3300 mV
vgaarb: loaded
SCSI subsystem initialized
spi_imx imx6q-ecspi.0: probed
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
Freescale USB OTG Driver loaded, $Revision: 1.55 $
MIPI CSI2 driver module loaded
Advanced Linux Sound Architecture Driver Version 1.0.24.
Bluetooth: Core ver 2.16
NET: Registered protocol family 31
Bluetooth: HCI device and connection manager initialized
Bluetooth: HCI socket layer initialized
Bluetooth: L2CAP socket layer initialized
Bluetooth: SCO socket layer initialized
i2c-core: driver [max17135] using legacy suspend method
i2c-core: driver [max17135] using legacy resume method
Switching to clocksource mxc_timer1
cfg80211: Calling CRDA to update world regulatory domain
NET: Registered protocol family 2
IP route cache hash table entries: 32768 (order: 5, 131072 bytes)
TCP established hash table entries: 131072 (order: 8, 1048576 bytes)
TCP bind hash table entries: 65536 (order: 7, 786432 bytes)
TCP: Hash tables configured (established 131072 bind 65536)
TCP reno registered
UDP hash table entries: 512 (order: 2, 16384 bytes)
UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
PMU: registered new PMU device of type 0
Static Power Management for Freescale i.MX6
wait mode is enabled for i.MX6
cpaddr = c0880000 suspend_iram_base=c0828000
PM driver module loaded
IMX usb wakeup probe
add wake up source irq 75
IMX usb wakeup probe
cpu regulator mode:ldo_enable
i.MXC CPU frequency driver
JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
msgmni has been set to 1495
alg: No test for stdrng (krng)
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
MIPI DSI driver module loaded
imx-sdma imx-sdma: loaded firmware 1.1
imx-sdma imx-sdma: initialized
Serial: IMX driver
imx-uart.0: ttymxc0 at MMIO 0x2020000 (irq = 58) is a IMX
console [ttymxc0] enabled, bootconsole disabled
console [ttymxc0] enabled, bootconsole disabled
loop: module loaded
m25p80 spi0.0: found m25p32, expected sst25vf016b
m25p80 spi0.0: m25p32 (4096 Kbytes)
Creating 2 MTD partitions on "m25p80":
0x000000000000-0x000000100000 : "bootloader"
0x000000100000-0x000000400000 : "kernel"
GPMI NAND driver registered. (IMX)
vcan: Virtual CAN interface driver
CAN device driver interface
flexcan netdevice driver
FEC Ethernet Driver
fec_enet_mii_bus: probed
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
fsl-ehci fsl-ehci.0: Freescale On-Chip EHCI Host Controller
fsl-ehci fsl-ehci.0: new USB bus registered, assigned bus number 1
fsl-ehci fsl-ehci.0: irq 75, io base 0x02184000
fsl-ehci fsl-ehci.0: USB 2.0 started, EHCI 1.00
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
add wake up source irq 72
Power up GPIO_0: USB_H1_PWR
fsl-ehci fsl-ehci.1: Freescale On-Chip EHCI Host Controller
fsl-ehci fsl-ehci.1: new USB bus registered, assigned bus number 2
fsl-ehci fsl-ehci.1: irq 72, io base 0x02184200
fsl-ehci fsl-ehci.1: USB 2.0 started, EHCI 1.00
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 1 port detected
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
ARC USBOTG Device Controller driver (1 August 2005)
mousedev: PS/2 mouse device common for all mice
i2c-core: driver [isl29023] using legacy suspend method
i2c-core: driver [isl29023] using legacy resume method
snvs_rtc snvs_rtc.0: rtc core: registered snvs_rtc as rtc0
i2c /dev entries driver
Linux video capture interface: v2.00
i2c-core: driver [mag3110] using legacy suspend method
i2c-core: driver [mag3110] using legacy resume method
imx2-wdt imx2-wdt.0: IMX2+ Watchdog Timer enabled. timeout=60s (nowayout=1)
Bluetooth: Virtual HCI driver ver 1.3
Bluetooth: HCI UART driver ver 2.2
Bluetooth: HCIATH3K protocol initialized
Bluetooth: Generic Bluetooth USB driver ver 0.6
usbcore: registered new interface driver btusb
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
mmc0: SDHCI controller on platform [sdhci-esdhc-imx.3] using DMA
mmc1: SDHCI controller on platform [sdhci-esdhc-imx.1] using DMA
mmc2: SDHCI controller on platform [sdhci-esdhc-imx.2] using DMA
mxc_vdoa mxc_vdoa: i.MX Video Data Order Adapter(VDOA) driver probed
VPU initialized
Thermal calibration data is 0x5954e57d
Thermal sensor with ratio = 185
Anatop Thermal registered as thermal_zone0
anatop_thermal_probe: default cooling device is cpufreq!
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
usbcore: registered new interface driver snd-usb-audio
Cirrus Logic CS42888 ALSA SoC Codec Driver
i2c-core: driver [cs42888] using legacy suspend method
i2c-core: driver [cs42888] using legacy resume method
imx_3stack asoc driver
Initialize HDMI-audio failed. Load HDMI-video first!
ALSA device list:
No soundcards found.
NET: Registered protocol family 26
TCP cubic registered
NET: Registered protocol family 17
can: controller area network core (rev 20090105 abi 8)
NET: Registered protocol family 29
can: raw protocol (rev 20090105)
can: broadcast manager protocol (rev 20090105 t)
Bluetooth: RFCOMM TTY layer initialized
Bluetooth: RFCOMM socket layer initialized
Bluetooth: RFCOMM ver 1.11
Bluetooth: BNEP (Ethernet Emulation) ver 1.3
Bluetooth: BNEP filters: protocol multicast
Bluetooth: HIDP (Human Interface Emulation) ver 1.2
lib80211: common routines for IEEE802.11 drivers
VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
Bus freq driver module loaded
Bus freq driver Enabled
mxc_dvfs_core_probe
DVFS driver module loaded
snvs_rtc snvs_rtc.0: setting system clock to 1970-01-01 00:00:00 UTC (0)
Waiting for root device /dev/mmcblk1p1...
mmc0: new high speed DDR MMC card at address 0001
mmcblk0: mmc0:0001 MMC64G 30.2 GiB
mmcblk0boot0: mmc0:0001 MMC64G partition 1 2.00 MiB
mmcblk0boot1: mmc0:0001 MMC64G partition 2 2.00 MiB
mmcblk0: p1
mmcblk0boot1: unknown partition table
mmcblk0boot0: unknown partition table
mmc1: new high speed SDHC card at address 0007
mmcblk1: mmc1:0007 SD08G 7.42 GiB
mmcblk1: p1
EXT3-fs: barriers not enabled
kjournald starting. Commit interval 5 seconds
EXT3-fs (mmcblk1p1): using internal journal
EXT3-fs (mmcblk1p1): mounted filesystem with writeback data mode
VFS: Mounted root (ext3 filesystem) on device 179:25.
Power down KEY_ROW4: USB_OTG_PWR
Freeing init memory: 216K
starting pid 1304, tty '': '/etc/rc.d/rcS'
Mounting /proc and /sys
Starting the hotplug events dispatcher udevd
Synthesizing initial hotplug evenudevd (1313): /proc/1313/oom_adj is deprecated, please use /proc/1313/oom_score_adj instead.
ts
Setting the hostname to dtra_3
Mounting filesystems
mount: sysfs already mounted or /sys busy
mount: according to mtab, /sys is already mounted on /sys
mount: mount point /proc/bus/usb does not exist
Starting syslogd and klogd
Running sysctl
Setting up networking on loopback device:
Setting up networking on eth0:
udhcpc (v1.20.2) started
eth0: Freescale FEC PHY driver [Generic PHY] (mii_bus:phy_addr=1:01, irq=-1)
Sending discover...
Sending discover...
Sending discover...
No lease, forking to background
starting pid 2343, tty '': '/etc/rc.d/rc_gpu.S'
/etc/rc.d/rc_gpu.S: line 6: /sys/module/galcore/parameters/gpu3DMinClock: No such file or directory
starting pid 2349, tty '': '/etc/rc.d/rc_mxc.S'
arm-none-linux-gnueabi-gcc (Freescale MAD -- Linaro 2011.07 -- Built at 2011/08/10 09:20) 4.6.2 20110630 (prerelease)
root filesystem built on Wed, 02 Jul 2014 14:39:19 -0700
Freescale Semiconductor, Inc.
Solved! Go to Solution.
I never did figure out what was wrong with my host and OTG port. Fortunately, on my board I included an alternate wiring to the OTG port. That port works, so it looks like my original problem is related to my custom hardware and not my kernel configurations.
I also figured out why my OTG port did not work in device mode. The answer is in this post: imx6q USB OTG does not work in device mode
I never did figure out what was wrong with my host and OTG port. Fortunately, on my board I included an alternate wiring to the OTG port. That port works, so it looks like my original problem is related to my custom hardware and not my kernel configurations.
I also figured out why my OTG port did not work in device mode. The answer is in this post: imx6q USB OTG does not work in device mode
One interesting observation is that if I use a different usb storage device (a usb sdcard reader) instead of a usb stick plugging into the OTG port with a host cable I get a different set of error messages.
ID int (ID is 0)
ehci_fsl_bus_resume begins, DR
Power up KEY_ROW4: USB_OTG_PWR
ehci fsl drv resume begins: DR
will resume roothub and its children
ehci_fsl_bus_resume ends, DR
hub 1-0:1.0: activate --> -22
ehci fsl drv resume ends: DR
usb 1-1: new high speed USB device number 2 using
fsl-ehci usb 1-1: device v05e3 p0727 is not supported
scsi0 : usb-storage 1-1:1.0
scsi 0:0:0:0: Direct-Access Generic STORAGE DEVICE 0207 PQ: 0 ANSI: 0
usb 1-1: USB disconnect, device number 2
sd 0:0:0:0: [sda] READ CAPACITY failed
sd 0:0:0:0: [sda] Result: hostbyte=0x01 driverbyte=0x00
sd 0:0:0:0: [sda] Sense not available.
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Mode Sense: 00 00 00 00
sd 0:0:0:0: [sda] Asking for cache data failed
sd 0:0:0:0: [sda] Assuming drive cache: write through
sd 0:0:0:0: [sda] Attached SCSI removable disk
usb 1-1: new high speed USB device number 3 using
fsl-ehci usb 1-1: device descriptor read/all, error -71
usb 1-1: new full speed USB device number 4 using
fsl-ehci hub 1-0:1.0: unable to enumerate USB device on port 1
ehci_fsl_bus_suspend begins, DR
ehci_fsl_bus_suspend ends, DR
However, if I plug this same device into the host port I get a different error message
ehci_fsl_bus_resume begins, Host 1
ehci_fsl_bus_resume ends, Host 1
usb 2-1: new high speed USB device number 4 using
fsl-ehci usb 2-1: device descriptor read/64, error -71
usb 2-1: device descriptor read/64, error -71
usb 2-1: new full speed USB device number 5 using
fsl-ehci hub 2-0:1.0: unable to enumerate
USB device on port 1 ehci_fsl_bus_suspend begins, Host 1
ehci_fsl_bus_suspend ends, Host 1
This is suggesting my usb port can read some of the time but not always. Any help is appreciated.
One more piece of information. Using the OTG port with the MFG TOOL does not work. My PC does not recognize the USB device. How does the MFG TOOL work? Could this be a driver problem or does this mean I have a hardware problem?
Hi,
Your pin configurations seem correct. I wonder if you can share your schematics to see if there is something wrong with the connections.
Best Regards,
Alejandro
Here is my schematic. I've made a few blue wire changes to the board. Those are noted in purple.
I've tried this both ways. With H1_PWR_EN set to a gpio pin controlled by mx6_set_host1_vbus_func(imx6q_dtra3_host1_vbus); function, and with H1_PWR_EN eliminated and the H1_VBUS tied high. The results are the same.
When I made the blue wire changes I removed the mx6_set_host1_vbus_func(imx6q_dtra3_host1_vbus); function definition. It's not necessary if the host is always powered.