USB-port powering & CEC support
#1
Hello everyone! where i can get the Information if it’s possible to power up/down the USB-ports seperately?
I' m not sure if the information under the storage section at http://wiki.pine64.org/index.php/ROCK64_Main_Page :
  • 1 USB3.0 Dedicated Host port
  • 2 USB2.0 Dedicated Host port (one of them is USB-OTG)
mean what i wish they do Huh .
I’m looking forward to buy this board and use it as kind of all-in-one-device (router, wifi ac with USB wifi dongle,
kodi 4k video player, pi-hole-like ad-filter and something like a NAS. For this reason i need to know if i can power
an external USB 2.0 or 3.0 harddrive on demand only for example for a scheduled backup-task. Afterwards i wish to cut the power thus the hard drive don’t has to run all the time unlike the board itself (which should run 24/7). Also it would nice to know which commands are used to enable USB Powering ON/OFF for each USB-port

My 2nd question: Is the rock64 media board fully supported with CEC controls using Linux Distributions?

Thanks in advance Wink
#2
Can't answer your question (someone who can will show up soon I'm sure). I'd just like to ask that you don't post the same thread multiple times - new users posts need to be moderated. Posting multiple times just make the process longer.
Thanks.
You can find me on IRC, Discord and Twitter


#3
(08-04-2017, 03:54 AM)Luke Wrote: Can't answer your question (someone who can will show up soon I'm sure). I'd just like to ask that you don't post the same thread multiple times - new users posts need to be moderated. Posting multiple times just make the process longer.
Thanks.

OK & thank you, just want to sorry, because i wondered why the post didn't came up instantly Huh ... the fordwarding message which tells that any new thread will be checked by moderators was just to fast or not shown long enough but at the 2nd try i was able to take a screenshot and see the information. Big Grin
#4
(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...
#5
(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
#6
Just know that CEC has been implemented on upcoming LibreElec build.
#7
(08-04-2017, 09:53 AM)gonzo Wrote: 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

Well, it didn't work for me when I tried just then, but I haven't tracked it down through the DTS to see if the sysfs IO is even hooked up properly, or is overridden by something else.

The two USB2 ports don't appear to be independently controlled. They have independent current limiters, but the enable pins are tied together, and then hooked up to GPIO0_A2. So when it does work, it'll be a USB2 ports on or USB2 ports off affair. Because the USB3 port is always on, and you mentioned AC wireless, I'd be plugging that into the USB3 port, and then a HDD into one of the USB2 ports (probably the bottom one, I avoid USBOTG ports when any performance is needed as they tend to be slower unless they can be bypassed properly). Then you'd get the on/off functionality you want... unless you need the second USB2 port for something else that you would want to stay on... once somebody works out why it isn't working atm, of course Wink
#8
(08-04-2017, 06:57 PM)pfeerick Wrote:
(08-04-2017, 09:53 AM)gonzo Wrote: 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

Well, it didn't work for me when I tried just then, but I haven't tracked it down through the DTS to see if the sysfs IO is even hooked up properly, or is overridden by something else.

The two USB2 ports don't appear to be independently controlled. They have independent current limiters, but the enable pins are tied together, and then hooked up to GPIO0_A2. So when it does work, it'll be a USB2 ports on or USB2 ports off affair. Because the USB3 port is always on, and you mentioned AC wireless, I'd be plugging that into the USB3 port, and then a HDD into one of the USB2 ports (probably the bottom one, I avoid USBOTG ports when any performance is needed as they tend to be slower unless they can be bypassed properly). Then you'd get the on/off functionality you want... unless you need the second USB2 port for something else that you would want to stay on... once somebody works out why it isn't working atm, of course Wink

Hi pfeerick, at all thats sounds really good and seems to be very close to the things i want to do. In order to achieve filetranser over the air with (n-draft or) ac -wifi the USB 3.0 port is the only option. And as you said always on status of the USB 3.0 is made for this wifi-dongle setup. I would buy either this https://goo.gl/DSyZ8w antenna for n-draft or this https://goo.gl/tFsyhH for ac-wifi because i' ve read that they are well supported with linux distributions on arm architecture, too.
For backup cases i am not in a rush, so there's enough time for doing backups  or download all the stuff via USB 2.0 ports maybe with a transfering rate up to 38-40 MB/s because the rock64 runs 24 hours a day. This speed should be also good enough for watching 4k videos from USB-drive. And for now i have no plans to connect another device to the left USB OTG port, so i don't care if the USB2 ports don't have the ability to get powered indepentently. To sum up and hopefully for my correct understanding (please correct me if i'm wrong): you have successfully tested USB2 power off / power on functionality?
And if i don't care if or when the USB3 powering option will be supported at any time in the future or not, and the same for the USB 2 working independent power off / power on
functionality then i can order the board for my planned usage?  (the on demand access to usb i want to realize with a bunch of scripts depending on the activity: watching videos, starting downloads, back up tasks and as said afterwards i with to power off the hard drive) Regearding the CEC topic...i hope that upcoming libre elec support is connected with support on more "open" linux distributions like debian or arch soon, too.

Again thanks a lot for your support!


Possibly Related Threads…
Thread Author Replies Views Last Post
  Testing USB port(s) clach04 2 3,491 09-29-2021, 07:18 PM
Last Post: Rocklobster
  Trustzone support for Rock64 capablegh 1 2,694 07-17-2021, 10:15 AM
Last Post: capablegh
  Sent support order status , no responses RockPro64Newbie 3 6,638 01-19-2021, 12:09 PM
Last Post: mathygreen
  Rock64 problems with external Hard Drive and powering mjd 1 3,139 12-14-2019, 10:05 AM
Last Post: helsinki92
Photo Has anyone been able to get a signal from the av/composite/cvbs port? bestpc 2 4,223 09-17-2019, 12:51 PM
Last Post: bestpc
  10 bit HEVC support on Rock64? Bowser 3 6,463 01-07-2019, 09:05 AM
Last Post: tllim
  WiringPi support for Rock64 CristianM 1 3,223 12-26-2018, 08:02 AM
Last Post: CristianM
Exclamation Volumio 2 on Rock64 support gkkpch 5 12,127 12-01-2018, 05:05 PM
Last Post: Luke
  Does this support AES-NI instructions? oealias 1 4,503 06-08-2018, 02:56 AM
Last Post: wirr
  [Issue] Can't install the LibreElec Port from Raybuntu k0Lm_ 1 3,122 03-23-2018, 04:31 PM
Last Post: k0Lm_

Forum Jump:


Users browsing this thread: 1 Guest(s)