jdb
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2151
Joined: Thu Jul 11, 2013 2:37 pm

VL805 firmware release 0137ac - improved USB downstream power switching

Wed Dec 04, 2019 8:27 pm

We've received an updated firmware from VLI that allows for port power control, i.e. turning off downstream USB devices.

The attached zip file contains an updated firmware and patch file. Note: rebooting is required after flashing the new firmware.

Step 1: Flash the firmware to the VLI EEPROM:

Code: Select all

# if not already installed, install the rpi-eeprom package:
sudo apt install rpi-eeprom
sudo vl805 -w vl805_fw_0137ac.bin
sudo reboot

Step 2: build uhubctl
uhubctl can be used to manipulate port power - but needs patching to allow switching of ganged port power. Copy the code patch in the zipfile to the uhubctl directory and apply the patch as shown below. Build, patch and install uhubctl with:

Code: Select all

sudo apt install libusb-1.0-0-dev
git clone https://github.com/mvp/uhubctl
cd uhubctl
# copy the attached patchfile from the zip to the uhubctl directory
git apply uhubctl.patch
make
sudo make install

Step 3:
To power off the downstream ports, both the internal USB2 hub and USB3 root hub need to be powered off, as the external power control pin ORs the two hub power controls together.

Power off:

Code: Select all

sudo uhubctl -e -a 0 -l 2
sudo uhubctl -e -a 0 -l 1-1
power on:

Code: Select all

sudo uhubctl -e -a 1 -l 2
sudo uhubctl -e -a 1 -l 1-1
Please test and report back.
Attachments
vl805_fw_0137ac.zip
(41.46 KiB) Downloaded 10 times
Rockets are loud.
https://astro-pi.org

Jochem
Posts: 1
Joined: Wed Dec 04, 2019 9:05 pm

Re: VL805 firmware release 0137ac - improved USB downstream power switching

Wed Dec 04, 2019 9:26 pm

> Please test and report back.

Reporting back:
1. FW install OK:

Code: Select all

pi@R4DNSUnifi:~/uhubctl $ sudo rpi-eeprom-update
BOOTLOADER: up-to-date
CURRENT: ma 18 nov 2019 11:06:55 UTC (1574075215)
 LATEST: ma 18 nov 2019 11:06:55 UTC (1574075215)
VL805: update required
CURRENT: 000137ac
 LATEST: 000137ab
2. patching does not work:

Code: Select all

pi@R4DNSUnifi:~/uhubctl $ git apply uhubctl.patch
error: patch failed: uhubctl.c:413
error: uhubctl.c: patch does not apply
pi@R4DNSUnifi:~/uhubctl $
Fyi:

Code: Select all

pi@R4DNSUnifi:~/uhubctl $ ls -l
totaal 100
-rw-r--r-- 1 pi pi 18092 dec  4 22:02 COPYING
drwxr-xr-x 2 pi pi  4096 dec  4 22:02 Formula
-rw-r--r-- 1 pi pi   706 dec  4 22:02 LICENSE
-rw-r--r-- 1 pi pi  1157 dec  4 22:02 Makefile
-rw-r--r-- 1 pi pi 18294 dec  4 22:02 README.md
-rw-r--r-- 1 pi pi 34771 dec  4 22:02 uhubctl.c
-rw-r--r-- 1 pi pi   543 dec  4 22:02 uhubctl_git.bb
-rw-r--r-- 1 pi pi   916 dec  4 20:35 uhubctl.patch
-rw-r--r-- 1 pi pi    11 dec  4 22:02 VERSION
pi@R4DNSUnifi:~/uhubctl $ cat VERSION
v2.1.0-dev
After patching by hand, make and make install and powering off:

Code: Select all

pi@R4DNSUnifi:~/uhubctl $ sudo uhubctl -e -a 0 -l 2
Current status for hub 2 [1d6b:0003 Linux 4.19.75-v7l+ xhci-hcd xHCI Host Controller 0000:01:00.0, USB 3.00, 4 ports]
  Port 1: 02a0 power 5gbps Rx.Detect
  Port 2: 02a0 power 5gbps Rx.Detect
  Port 3: 02a0 power 5gbps Rx.Detect
  Port 4: 02a0 power 5gbps Rx.Detect
Sent power off request
New status for hub 2 [1d6b:0003 Linux 4.19.75-v7l+ xhci-hcd xHCI Host Controller 0000:01:00.0, USB 3.00, 4 ports]
  Port 1: 0080 off
  Port 2: 0080 off
  Port 3: 0080 off
  Port 4: 0080 off
pi@R4DNSUnifi:~/uhubctl $ sudo uhubctl -e -a 0 -l 1-1
Current status for hub 1-1 [2109:3431 USB2.0 Hub, USB 2.10, 4 ports]
  Port 1: 0100 power
  Port 2: 0100 power
  Port 3: 0100 power
  Port 4: 0100 power
Sent power off request
New status for hub 1-1 [2109:3431 USB2.0 Hub, USB 2.10, 4 ports]
  Port 1: 0000 off
  Port 2: 0000 off
  Port 3: 0000 off
  Port 4: 0000 off
All looks good. But according to my POE port, the same power is delivered before and after, in my case 3,5 watt

trejan
Posts: 853
Joined: Tue Jul 02, 2019 2:28 pm

Re: VL805 firmware release 0137ac - improved USB downstream power switching

Thu Dec 05, 2019 12:03 am

Jochem wrote:
Wed Dec 04, 2019 9:26 pm
All looks good. But according to my POE port, the same power is delivered before and after, in my case 3,5 watt
What do you have plugged into the USB ports?

Return to “Advanced users”