rogers0/OpenLinkstation

How to turn on the USB power?

glzjin opened this issue · 6 comments

Hi:
I have installed the OpenLinkstation and it works on my LS-WXL,but when I try to plug a usb device i found that it only a usb root hub in there.

root@LS-Jessie:/mnt# lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

and I saw that in kernel log:
[ 12.828386] usbcore: registered new device driver usb
[ 12.993131] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 13.062781] ehci-orion: EHCI orion driver
[ 13.089164] orion-ehci f1050000.ehci: EHCI Host Controller
[ 13.152680] orion-ehci f1050000.ehci: new USB bus registered, assigned bus number 1
[ 13.171350] orion-ehci f1050000.ehci: irq 19, io mem 0xf1050000
[ 13.239562] orion-ehci f1050000.ehci: USB 2.0 started, EHCI 1.00
[ 13.295808] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[ 13.302863] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 13.310147] usb usb1: Product: EHCI Host Controller
[ 13.315077] usb usb1: Manufacturer: Linux 3.16.0-4-kirkwood ehci_hcd
[ 13.321470] usb usb1: SerialNumber: f1050000.ehci
[ 13.400762] hub 1-0:1.0: USB hub found
[ 13.456355] hub 1-0:1.0: 1 port detected

I have tried to turn on usb power in /sys/class,but it doesn't make sense,So please tell me how to turn on the USB power,thanks!

Sorry for the late reply. Please try:

echo 37 >/sys/class/gpio/export
echo out > /sys/class/gpio/gpio37/direction
echo 1 > /sys/class/gpio/gpio37/value

You can even put those lines into /etc/rc.local, it's a dirty hack though.

Hi I have LS-WSXL and your suggested command returns write error: Device or resource busy.
I have same issue with wheezy back port and Jessie.
How to troubleshoot???

root@LS-WSXLE12:# uname -a
Linux LS-WSXLE12 3.16.0-0.bpo.4-kirkwood #1 Debian 3.16.7-ckt11-1+deb8u3
bpo70+1 (2015-08-08) armv5tel GNU/Linux
root@LS-WSXLE12:~# echo 37 >/sys/class/gpio/export
-bash: echo: write error: Device or resource busy

root@LS-WSXLE12:~# ls -l /sys/class/gpio/
total 0
--w------- 1 root root 4096 Jul 6 10:36 export
lrwxrwxrwx 1 root root 0 Jul 6 10:41 gpiochip0 -> ../../devices/ocp@f1000000/f1010100.gpio/gpio/gpiochip0
lrwxrwxrwx 1 root root 0 Jul 6 10:41 gpiochip32 -> ../../devices/ocp@f1000000/f1010140.gpio/gpio/gpiochip32
--w------- 1 root root 4096 Jul 6 10:41 unexport

I reproduced this issue, and find it was OK on linux-image 3.16.7-ckt4-3 (Feb. 2015) but started to fail from 3.16.7-ckt7-1 (Mar. 2015).
I'll investigate it more later.

I run Jessie on my LS-WXL. But I find the following kernel can gpio export without error:

  • 4.4rc8-1exp1 (in experimental apt repo)
  • 4.3.3-5~bpo8+1 (in jessie-backports apt repo)
  • 4.2.6-3~bpo8+2 (in jessie-backports apt repo)

So the simplest solution currently is to choose jessie-backports kernel.

Thanks Rogers0,
I also confirmed with the kernel to 4.3.3-5~bpo8+1, It worked!.

With updated DTB, which is already committed, you don't have to export gpio pin anymore.
USB gets working from very beginning.

Updated DTB/DTS can be downloaded from: https://github.com/rogers0/OpenLinkstation/tree/master/1_debootstrap/dtb