Reset Revolution Pi Core USB ports

Topics about the Software of Revolution Pi
Post Reply
FrankPi
Posts: 1
Joined: 06 Aug 2018, 11:48

Reset Revolution Pi Core USB ports

Post by FrankPi »

Does anyone know of a method to reset the power of the Revolution Pi Core USB ports.

For debugging, I need to power down / reset a USB peripherial attached to my Revolution Pi Core. So far I have tried: "echo 0x0 > /sys/devices/.../buspower" and "ioctl(file_handler(usb_dev), USB_RESET_CMD, 0)". Neigther of teh two worked due to missing permissions (even with sudo) or unability to open the device file.
User avatar
dirk
KUNBUS
Posts: 2174
Joined: 15 Dec 2016, 13:19

Re: Reset Revolution Pi Core USB ports

Post by dirk »

In the schematics of the RevPi Core you can see that the USB channels are connected to the chip LAN9512. This is a combined USB hub plus Ethernet bridge. Therefore shutting down USB would also shutdown the Ethernet connection. This would result in the need to reboot the device. There is the AP2553 which can be disabled by two LAN9514 pins. Actually I have no idea if this can be done by a Linux function. I'll ask our Linux expert if there is a possibility to do this.

Nevertheless if you want to you can shutdown the USB hub power. I am not sure if this is the best way but I have proven that it works:

There is a nice tool called "hubpower" available on GitHub.

1) Download the file
https://github.com/heiher/hubpower/blob ... hubpower.c

2) Compile it on the RevPi, ignore the warnings

Code: Select all

gcc -o hubpower hubpower.c
3) Run it

Code: Select all

sudo ./hubpower 1:1 status
Port  1 status: 0503  High-Speed Power-On Enabled Connected

4) This command will switch USB completely off - BUT BE CAREFUL:
You will lock yourself out of the system as there will be no LAN interface and no USB Keyboard...

Code: Select all

sudo ./hubpower 1:1 power 1 off
You may play with the options using the list of USB devices.
For example this is an output from the new RevPi Connect:

Code: Select all

lsusb -t
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=dwc_otg/1p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/5p, 480M
        |__ Port 1: Dev 3, If 0, Class=Vendor Specific Class, Driver=smsc95xx, 480M
        |__ Port 5: Dev 4, If 0, Class=Hub, Driver=hub/3p, 480M
            |__ Port 1: Dev 5, If 0, Class=Vendor Specific Class, Driver=smsc95xx, 480M
            |__ Port 2: Dev 6, If 0, Class=Vendor Specific Class, Driver=ftdi_sio, 12M
            |__ Port 3: Dev 7, If 0, Class=Vendor Specific Class, Driver=ftdi_sio, 12M
Post Reply