Hi everyone.
I want to be able to do two things from userland:
1) Turn off power to the EHCI port
2) Reset the EHCI USB port PHY chip
After reading through the docs and kernel code, I know it's possible to do
both from the kernel. For those interested: the power can be turned off through
the nEN_USB_PWR signal from the TPS65950 (through the I2C interface), and the
PHY chip can be reset by toggling it's enable pin (connected to GPIO147).
These things are done in arch/arm/mach-omap2/board-omap3beagle.c and
drivers/usb/host/ehci-omap.c.
However, I don't know how to do this from userland. I can't to it through the
sysfs gpio interface because it won't let me export 147 (presumedly because
it's already been requested by some other part of the kernel).
I'm using a 2.6.31 kernel, and it's a RevC3 beagle.
Is this currently possible? Is there a sysfs interface somewhere?
I'd also like to be able to do the same to the OTG port, but let's start with
the EHCI, and yes, I'm using external power ;-).
Thanks,
Cameron.
Anyone got any ideas where to look?
Docs? Email list posts? Crop circles?
That's seems to be pretty much it. If you're following this, the usbreset
program *does* still work with a 2.6.31 kernel, and the usb suspend stuff is
about right, except that you need to echo "suspend" or "on" to power/level,
instead of 0/2 to power/state.
I'll report back on whether suspending the ehci root hub actually drops turns
off the 5V rail (to save power), and whether the usbreset can bring a crashed
EHCI port back to life.
Cameron.
Forgot to say: "Thanks, Quist"!
Bad news. Once the EHCI chip has crashed, usbreset won't work with it anymore:
root@beagleboard:~# ./usbreset /dev/usbdev2.1
Resetting USB device /dev/usbdev2.1
Error in ioctl: Is a directory
But /dev/usb2.1 is not a directory:
root@beagleboard:~# ls -l /dev/usbdev*
crw-rw---- 1 root root 189, 0 2009-11-10 01:43 /dev/usbdev1.1
crw-rw---- 1 root root 189, 1 2009-11-10 01:43 /dev/usbdev1.2
crw-rw---- 1 root root 189, 128 2009-11-10 01:43 /dev/usbdev2.1
I guess it's back to reading kernel source....
Cameron.
Also, suspending the high speed root hub does *not* disable the 5V power
rail.
Can anyone recommend an introduction to adding sysfs features to a kernel
driver?
Cameron.
Cameron:
You've probably already moved (way) beyond this point, but does
adding "gpio_export(147, 0);" to the init function in board-
omap3beagle.c cause gpio147 to be available by default in the /sys/
class/gpio directory? This worked for me when I could no longer
successfully do "echo 170 > export" in that directory (for the DVI-
Framer).
-Bill Bock
DFT