08-04-2017, 09:53 AM
(08-04-2017, 07:46 AM)pfeerick Wrote:(08-04-2017, 03:42 AM)gonzo Wrote: Where i can get the Information if it’s possible to power up/down the USB-ports seperately?
Preproduction rock64s appeared to be able to toggle the USB2 ports via GPIO0_A2, and the USB3 port via GPIO0_A0 (but I never got around to testing that), but from the v2 (production release) schematics, it looks like the USB2 port power is still toggleable via GPIO0_A2, but the USB3 port connected is connected to the PWR_LED line on the RK805 PMIC, so unless we can a) talk to the RK805 and b) it allows the PWR_LED to be toggled, the USB3 port power probably can't be toggled.
To toggle the power, to test the functionality, you should, as root (i.e. sudo -i) be able to do the following (where GPIO0_A2 calculates to sysfs 2)
Code:echo 2 > /sys/class/gpio/export #enable use of pin by sysfs
echo out > /sys/class/gpio/gpio2 #set as an output
echo 1 > /sys/class/gpio/gpio2 #take pin high
echo 0 > /sys/class/gpio/gpio2 #take pin low
The application note for that SY6280 current limiter chip (which is what should allow the ports to be turned on and off) says it is enabled when high, so by rights, doing the echo 0 should power down the port... and there is also the possibility that functionality hasn't been enabled in the device tree...
Thank you! Hm so it is still unknown until somebody can test it? The device from preprodution you mean... do you think it was able to power the USB2 ports separately from each other or does gpio2 low mean, that both ports will go down. i was not able to guess is... sorry