Used onboard HUB to reset and add power to hub
Subsystems (3)
cover Used onboard HUB to reset and add power to hub
Amlogic board use gpio-hog to reset the USB hub. so using onboard hub we could reset the USB hub and also enable power to the USB hub.
On Odroid C1, it seem this feature is not working as expected so just included the patch for testing. Maybe we can drop this.
$ lsusb -t /: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=dwc2/1p, 480M
On Odroid C2, C4, N2 is seem to work as expected.
$ lsusb -t
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 5000M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/2p, 480M
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480MAny inputs?
Thanks
-Anand
Anand Moon (11):
dt-bindings: usb: Add device id for Genesys Logic hub controller
ARM: dts: amlogic: Used onboard usb hub reset to enable usb hub
arm64: dts: amlogic: Used onboard usb hub reset on odroid c2
arm64: dts: amlogic: Used onboard usb hub reset on odroid n2
usb: misc: onboard_usb_hub: add Genesys Logic GL852G-OHG hub support
usb: misc: onboard_usb_hub: add Genesys Logic GL3523-QFN76 hub support
vendor-prefixes: Add VIA Labs, Inc.
dt-bindings: usb: Add binding for Via lab VL817Q7 hub controller
arm64: dts: meson-sm1-odroid-c4: Used onboard usb hub reset on odroid
c4
usb: misc: onboard_usb_hub: add VIA LAB VL817Q7 hub support
arm64: defconfig: Enable USB onboard HUB driver
.../bindings/usb/genesys,gl850g.yaml | 2 + .../bindings/usb/vialab,vl817q7.yaml | 47 +++++++++++++++++++ .../devicetree/bindings/vendor-prefixes.yaml | 2 + arch/arm/boot/dts/meson8b-odroidc1.dts | 40 +++++++++++----- .../dts/amlogic/meson-g12b-odroid-n2.dtsi | 26 +++++----- .../boot/dts/amlogic/meson-gxbb-odroidc2.dts | 29 ++++++------ .../boot/dts/amlogic/meson-sm1-odroid-c4.dts | 25 +++++----- arch/arm64/configs/defconfig | 1 + drivers/usb/misc/onboard_usb_hub.c | 4 ++ drivers/usb/misc/onboard_usb_hub.h | 7 +++ 10 files changed, 130 insertions(+), 53 deletions(-) create mode 100644 Documentation/devicetree/bindings/usb/vialab,vl817q7.yaml
Signature · 7 lines
2.38.1 _______________________________________________ linux-amlogic mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-amlogic
PATCH 1/11 dt-bindings: usb: Add device id for Genesys Logic hub controller
Add usb hub device id for Genesys Logic, Inc. GL852G-OHG Hub USB 2.0 root hub and Genesys Logic, Inc. GL3523-QFN76 USB 3.1 root hub.
--- Documentation/devicetree/bindings/usb/genesys,gl850g.yaml | 2 ++ 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/usb/genesys,gl850g.yaml +2 -0
@@ -16,6 +16,8 @@ properties: compatible: enum: - usb5e3,608 + - genesys,usb5e3,610 + - genesys,usb5e3,620 reg: true
Signature · 1 line
2.38.1
Re: [PATCH v1 01/11] dt-bindings: usb: Add device id for Genesys Logic hub controller
Quoted 15 lines · 在 2022-12-28星期三的 10:03 +0000,Anand Moon写道:
Add usb hub device id for Genesys Logic, Inc. GL852G-OHG Hub USB 2.0 root hub and Genesys Logic, Inc. GL3523-QFN76 USB 3.1 root hub.
Signed-off-by Anand Moon <[email protected]>---
Documentation/devicetree/bindings/usb/genesys,gl850g.yaml | 2 ++1 file changed, 2 insertions(+)diff --git
a/Documentation/devicetree/bindings/usb/genesys,gl850g.yamlb/Documentation/devicetree/bindings/usb/genesys,gl850g.yamlindexa9f831448cca..db009f3ef438100644Documentation/devicetree/bindings/usb/genesys,gl850g.yaml +0
-0@@ -16,6 +16,8 @@ properties:
Quoted 5 lines
compatible:
enum:
- usb5e3,608
+ - genesys,usb5e3,610
+ - genesys,usb5e3,620
I don't think genesys, is needed here because usb5e3 means USB VID 0x05e3, which is already linked to Genesys Logic.
In addition, the control logic of these two hubs are needed to be verified.
And what's the status of the companion hub of the USB3 hub? Is it really a USB3-only hub, or is its USB2 part just equal to another USB3 hub?
Quoted 3 lines
reg: true
_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic
Re: [PATCH v1 01/11] dt-bindings: usb: Add device id for Genesys Logic hub controller
Hi Icenowy,
Thanks for the review comments
Quoted 10 lines · Icenowy Zheng
Quoted 8 lines · 在 2022-12-28星期三的 10:03 +0000,Anand Moon写道:
Add usb hub device id for Genesys Logic, Inc. GL852G-OHG Hub USB 2.0 root hub and Genesys Logic, Inc. GL3523-QFN76 USB 3.1 root hub.
Signed-off-by Anand Moon <[email protected]>--- Documentation/devicetree/bindings/usb/genesys,gl850g.yaml | 2 ++ 1 file changed, 2 insertions(+)
Quoted 16 lines
Documentation/devicetree/bindings/usb/genesys,gl850g.yaml properties: · line 20
Quoted 12 lines
diff --git
a/Documentation/devicetree/bindings/usb/genesys,gl850g.yamlb/Documentation/devicetree/bindings/usb/genesys,gl850g.yamlindexa9f831448cca..db009f3ef438100644Documentation/devicetree/bindings/usb/genesys,gl850g.yaml +2
-0@@ -16,6 +16,8 @@ properties: compatible: enum: - usb5e3,608 + - genesys,usb5e3,610 + - genesys,usb5e3,620I don't think genesys, is needed here because usb5e3 means USB VID
0x05e3, which is already linked to Genesys Logic.
Ok, I added this as genesys, is it part of the manufacturer or vendor name which is most commonly used for adding vendor-specific compatible strings.
Quoted 2 lines
In addition, the control logic of these two hubs are needed to be verified.
We were using gpio-hog to reset the USB hub, so now switch to USB onboard hub
Quoted 5 lines
And what's the status of the companion hub of the USB3 hub? Is it really a USB3-only hub, or is its USB2 part just equal to another USB3 hub?
usb5e3,610 is USB 2.0 port hub present on Odroid C1 and Odroid C2 board
usb5e3,620 is USB 3.1 port hub present on Odroid N2.
Quoted 4 lines
Documentation/devicetree/bindings/usb/genesys,gl850g.yaml properties: · line 23
Quoted 3 lines
Documentation/devicetree/bindings/usb/genesys,gl850g.yaml +0
-0reg: true
Thanks
-Anand
Re: [PATCH v1 01/11] dt-bindings: usb: Add device id for Genesys Logic hub controller
Quoted 9 lines · Anand Moon
Hi Icenowy,
Thanks for the review comments
Quoted 4 lines · Icenowy Zheng
Quoted 2 lines · 在 2022-12-28星期三的 10:03 +0000,Anand Moon写道:
Add usb hub device id for Genesys Logic, Inc. GL852G-OHG Hub USB 2.0 root hub and Genesys Logic, Inc. GL3523-QFN76 USB 3.1 root hub.
nit: QFN 76 is one of the package options of the GL3523, I expect this binding to be applicable as well for other GL3523 variants, so I'd suggest to drop the suffix. Not sure what 'OHG' stands for, the Genesys website only lists a GL852G hub with different package types (none of them 'OHG'), so I'd say drop the suffix unless it is known that 'OHG' variant uses a different product id than other GL852G variants
Quoted 23 lines
Quoted 6 lines
Quoted 6 lines
Signed-off-by Anand Moon <[email protected]>--- Documentation/devicetree/bindings/usb/genesys,gl850g.yaml | 2 ++ 1 file changed, 2 insertions(+)Quoted 16 lines
Documentation/devicetree/bindings/usb/genesys,gl850g.yaml properties: · line 20
Quoted 12 lines
diff --git
a/Documentation/devicetree/bindings/usb/genesys,gl850g.yamlb/Documentation/devicetree/bindings/usb/genesys,gl850g.yamlindexa9f831448cca..db009f3ef438100644Documentation/devicetree/bindings/usb/genesys,gl850g.yaml +2
-0@@ -16,6 +16,8 @@ properties: compatible: enum: - usb5e3,608 + - genesys,usb5e3,610 + - genesys,usb5e3,620I don't think genesys, is needed here because usb5e3 means USB VID
0x05e3, which is already linked to Genesys Logic.
Quoted 2 lines
Ok, I added this as genesys, is it part of the manufacturer or vendor name which is most commonly used for adding vendor-specific compatible strings.
That doesn't follow the generic USB binding, please drop 'genesys,'.
Quoted 6 lines
Quoted 2 lines
In addition, the control logic of these two hubs are needed to be verified.
We were using gpio-hog to reset the USB hub, so now switch to USB onboard hub
Quoted 1 line
Quoted 7 lines
Quoted 4 lines
And what's the status of the companion hub of the USB3 hub? Is it really a USB3-only hub, or is its USB2 part just equal to another USB3 hub?
usb5e3,610 is USB 2.0 port hub present on Odroid C1 and Odroid C2 board
usb5e3,620 is USB 3.1 port hub present on Odroid N2.
Like Icenowy I would expect the GL3523 to provide also a 2.0 hub.
What is the output of 'lsusb' on the Odroid N2?
Re: [PATCH v1 01/11] dt-bindings: usb: Add device id for Genesys Logic hub controller
Hi Matthias,
Thanks for the review comments
Quoted 12 lines · Matthias Kaehlcke
Quoted 9 lines · Anand Moon
Hi Icenowy,
Thanks for the review comments
Quoted 4 lines · Icenowy Zheng
Quoted 2 lines · 在 2022-12-28星期三的 10:03 +0000,Anand Moon写道:
Add usb hub device id for Genesys Logic, Inc. GL852G-OHG Hub USB 2.0 root hub and Genesys Logic, Inc. GL3523-QFN76 USB 3.1 root hub.
Quoted 7 lines
nit: QFN 76 is one of the package options of the GL3523, I expect this binding to be applicable as well for other GL3523 variants, so I'd suggest to drop the suffix. Not sure what 'OHG' stands for, the Genesys website only lists a GL852G hub with different package types (none of them 'OHG'), so I'd say drop the suffix unless it is known that 'OHG' variant uses a different product id than other GL852G variants
Yes, I will be sure to do this reference, I just picked these from the board schematics.
Quoted 23 lines
Quoted 23 lines
Quoted 22 lines
Quoted 13 lines
Signed-off-by Anand Moon <[email protected]>--- Documentation/devicetree/bindings/usb/genesys,gl850g.yaml | 2 ++ 1 file changed, 2 insertions(+)diff --git
a/Documentation/devicetree/bindings/usb/genesys,gl850g.yamlb/Documentation/devicetree/bindings/usb/genesys,gl850g.yamlindexa9f831448cca..db009f3ef438100644Documentation/devicetree/bindings/usb/genesys,gl850g.yaml properties: · line 20
Quoted 5 lines
Documentation/devicetree/bindings/usb/genesys,gl850g.yaml +2
-0@@ -16,6 +16,8 @@ properties: compatible: enum: - usb5e3,608 + - genesys,usb5e3,610 + - genesys,usb5e3,620I don't think genesys, is needed here because usb5e3 means USB VID
0x05e3, which is already linked to Genesys Logic.
Quoted 5 lines
Quoted 2 lines
Ok, I added this as genesys, is it part of the manufacturer or vendor name which is most commonly used for adding vendor-specific compatible strings.
That doesn't follow the generic USB binding, please drop 'genesys,'.
Yes, I will drop this in the next version.
Quoted 10 lines
Quoted 10 lines
Quoted 2 lines
In addition, the control logic of these two hubs are needed to be verified.
We were using gpio-hog to reset the USB hub, so now switch to USB onboard hub
Quoted 5 lines
And what's the status of the companion hub of the USB3 hub? Is it really a USB3-only hub, or is its USB2 part just equal to another USB3 hub?
Quoted 7 lines
Quoted 3 lines
usb5e3,610 is USB 2.0 port hub present on Odroid C1 and Odroid C2 board
usb5e3,620 is USB 3.1 port hub present on Odroid N2.
Like Icenowy I would expect the GL3523 to provide also a 2.0 hub.
What is the output of 'lsusb' on the Odroid N2?
alarm@odroid-n2:~$ lsusb -tv
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
ID 1d6b:0003 Linux Foundation 3.0 root hub
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 5000M
ID 05e3:0620 Genesys Logic, Inc. GL3523 Hub
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/2p, 480M
ID 1d6b:0002 Linux Foundation 2.0 root hub
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
ID 05e3:0610 Genesys Logic, Inc. HubThanks
-Anand
Re: [PATCH v1 01/11] dt-bindings: usb: Add device id for Genesys Logic hub controller
Quoted 77 lines · Anand Moon
Hi Matthias,
Thanks for the review comments
Quoted 12 lines · Matthias Kaehlcke
Quoted 9 lines · Anand Moon
Hi Icenowy,
Thanks for the review comments
Quoted 4 lines · Icenowy Zheng
Quoted 2 lines · 在 2022-12-28星期三的 10:03 +0000,Anand Moon写道:
Add usb hub device id for Genesys Logic, Inc. GL852G-OHG Hub USB 2.0 root hub and Genesys Logic, Inc. GL3523-QFN76 USB 3.1 root hub.
Quoted 7 lines
nit: QFN 76 is one of the package options of the GL3523, I expect this binding to be applicable as well for other GL3523 variants, so I'd suggest to drop the suffix. Not sure what 'OHG' stands for, the Genesys website only lists a GL852G hub with different package types (none of them 'OHG'), so I'd say drop the suffix unless it is known that 'OHG' variant uses a different product id than other GL852G variants
Yes, I will be sure to do this reference, I just picked these from the board schematics.
Quoted 23 lines
Quoted 23 lines
Quoted 22 lines
Quoted 13 lines
Signed-off-by Anand Moon <[email protected]>--- Documentation/devicetree/bindings/usb/genesys,gl850g.yaml | 2 ++ 1 file changed, 2 insertions(+)diff --git
a/Documentation/devicetree/bindings/usb/genesys,gl850g.yamlb/Documentation/devicetree/bindings/usb/genesys,gl850g.yamlindexa9f831448cca..db009f3ef438100644Documentation/devicetree/bindings/usb/genesys,gl850g.yaml properties: · line 20
Quoted 5 lines
Documentation/devicetree/bindings/usb/genesys,gl850g.yaml +2
-0@@ -16,6 +16,8 @@ properties: compatible: enum: - usb5e3,608 + - genesys,usb5e3,610 + - genesys,usb5e3,620I don't think genesys, is needed here because usb5e3 means USB VID
0x05e3, which is already linked to Genesys Logic.Quoted 5 lines
Quoted 2 lines
Ok, I added this as genesys, is it part of the manufacturer or vendor name which is most commonly used for adding vendor-specific compatible strings.
That doesn't follow the generic USB binding, please drop 'genesys,'.
Yes, I will drop this in the next version.
Quoted 10 lines
Quoted 10 lines
Quoted 2 lines
In addition, the control logic of these two hubs are needed to be verified.
We were using gpio-hog to reset the USB hub, so now switch to USB onboard hub
Quoted 5 lines
And what's the status of the companion hub of the USB3 hub? Is it really a USB3-only hub, or is its USB2 part just equal to another USB3 hub?
Quoted 7 lines
Quoted 3 lines
usb5e3,610 is USB 2.0 port hub present on Odroid C1 and Odroid C2 board
usb5e3,620 is USB 3.1 port hub present on Odroid N2.
Like Icenowy I would expect the GL3523 to provide also a 2.0 hub.
What is the output of 'lsusb' on the Odroid N2?
Quoted 9 lines
alarm@odroid-n2:~$ lsusb -tv
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
ID 1d6b:0003 Linux Foundation 3.0 root hub
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 5000M
ID 05e3:0620 Genesys Logic, Inc. GL3523 Hub
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/2p, 480M
ID 1d6b:0002 Linux Foundation 2.0 root hub
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
ID 05e3:0610 Genesys Logic, Inc. HubThanks. So it looks like 0x0610 is the product id of the USB 2.0 portion of the GL3523. From this patch it seems the GL852G uses the same product id?
Re: [PATCH v1 01/11] dt-bindings: usb: Add device id for Genesys Logic hub controller
Hi Matthias,
Quoted 89 lines · Matthias Kaehlcke
Quoted 77 lines · Anand Moon
Hi Matthias,
Thanks for the review comments
Quoted 12 lines · Matthias Kaehlcke
Quoted 9 lines · Anand Moon
Hi Icenowy,
Thanks for the review comments
Quoted 4 lines · Icenowy Zheng
Quoted 2 lines · 在 2022-12-28星期三的 10:03 +0000,Anand Moon写道:
Add usb hub device id for Genesys Logic, Inc. GL852G-OHG Hub USB 2.0 root hub and Genesys Logic, Inc. GL3523-QFN76 USB 3.1 root hub.
Quoted 7 lines
nit: QFN 76 is one of the package options of the GL3523, I expect this binding to be applicable as well for other GL3523 variants, so I'd suggest to drop the suffix. Not sure what 'OHG' stands for, the Genesys website only lists a GL852G hub with different package types (none of them 'OHG'), so I'd say drop the suffix unless it is known that 'OHG' variant uses a different product id than other GL852G variants
Yes, I will be sure to do this reference, I just picked these from the board schematics.
Quoted 23 lines
Quoted 23 lines
Quoted 22 lines
Quoted 13 lines
Signed-off-by Anand Moon <[email protected]>--- Documentation/devicetree/bindings/usb/genesys,gl850g.yaml | 2 ++ 1 file changed, 2 insertions(+)diff --git
a/Documentation/devicetree/bindings/usb/genesys,gl850g.yamlb/Documentation/devicetree/bindings/usb/genesys,gl850g.yamlindexa9f831448cca..db009f3ef438100644Documentation/devicetree/bindings/usb/genesys,gl850g.yaml properties: · line 20
Quoted 5 lines
Documentation/devicetree/bindings/usb/genesys,gl850g.yaml +2
-0@@ -16,6 +16,8 @@ properties: compatible: enum: - usb5e3,608 + - genesys,usb5e3,610 + - genesys,usb5e3,620I don't think genesys, is needed here because usb5e3 means USB VID
0x05e3, which is already linked to Genesys Logic.Quoted 5 lines
Quoted 2 lines
Ok, I added this as genesys, is it part of the manufacturer or vendor name which is most commonly used for adding vendor-specific compatible strings.
That doesn't follow the generic USB binding, please drop 'genesys,'.
Yes, I will drop this in the next version.
Quoted 10 lines
Quoted 10 lines
Quoted 2 lines
In addition, the control logic of these two hubs are needed to be verified.
We were using gpio-hog to reset the USB hub, so now switch to USB onboard hub
Quoted 5 lines
And what's the status of the companion hub of the USB3 hub? Is it really a USB3-only hub, or is its USB2 part just equal to another USB3 hub?
Quoted 7 lines
Quoted 3 lines
usb5e3,610 is USB 2.0 port hub present on Odroid C1 and Odroid C2 board
usb5e3,620 is USB 3.1 port hub present on Odroid N2.
Like Icenowy I would expect the GL3523 to provide also a 2.0 hub.
What is the output of 'lsusb' on the Odroid N2?
Quoted 9 lines
alarm@odroid-n2:~$ lsusb -tv /: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M ID 1d6b:0003 Linux Foundation 3.0 root hub |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 5000M ID 05e3:0620 Genesys Logic, Inc. GL3523 Hub /: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/2p, 480M ID 1d6b:0002 Linux Foundation 2.0 root hub |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M ID 05e3:0610 Genesys Logic, Inc. Hub
Quoted 3 lines
Thanks. So it looks like
0x0610is the product id of the USB 2.0 portion of the GL3523. From this patch it seems the GL852G uses the same product id?
Yes, it looks correct as per the lsusb output
Thanks
-Anand
Re: [PATCH v1 01/11] dt-bindings: usb: Add device id for Genesys Logic hub controller
In reply to Anand MoonQuoted 13 lines · Anand Moon
Add usb hub device id for Genesys Logic, Inc. GL852G-OHG Hub USB 2.0 root hub and Genesys Logic, Inc. GL3523-QFN76 USB 3.1 root hub.
Signed-off-by Anand Moon <[email protected]>--- Documentation/devicetree/bindings/usb/genesys,gl850g.yaml | 2 ++ 1 file changed, 2 insertions(+)Documentation/devicetree/bindings/usb/genesys,gl850g.yaml +0
-0
Documentation/devicetree/bindings/usb/genesys,gl850g.yaml properties: · line 20
Quoted 5 lines
Documentation/devicetree/bindings/usb/genesys,gl850g.yaml +2
-0@@ -16,6 +16,8 @@ properties: compatible: enum: - usb5e3,608 + - genesys,usb5e3,610 + - genesys,usb5e3,620
This does not look like correct compatible. Did you test the bindings and DTS? This should fail.
Best regards,
Krzysztof
Re: [PATCH v1 01/11] dt-bindings: usb: Add device id for Genesys Logic hub controller
Hi Krzysztof,
Thanks for your review comments.
Quoted 10 lines · Krzysztof Kozlowski
Quoted 8 lines · Anand Moon
Add usb hub device id for Genesys Logic, Inc. GL852G-OHG Hub USB 2.0 root hub and Genesys Logic, Inc. GL3523-QFN76 USB 3.1 root hub.
Signed-off-by Anand Moon <[email protected]>--- Documentation/devicetree/bindings/usb/genesys,gl850g.yaml | 2 ++ 1 file changed, 2 insertions(+)
Quoted 14 lines
Documentation/devicetree/bindings/usb/genesys,gl850g.yaml properties: · line 20
Quoted 10 lines
Documentation/devicetree/bindings/usb/genesys,gl850g.yaml +2
-0@@ -16,6 +16,8 @@ properties: compatible: enum: - usb5e3,608 + - genesys,usb5e3,610 + - genesys,usb5e3,620This does not look like correct compatible. Did you test the bindings and DTS? This should fail.
Yes, I have done and it did not report any error.
make ARCH=arm64 mrproper
make ARCH=arm64 defconfig
make ARCH=arm64 -j$(nproc) dtbs
make CHECK_DTBS=y amlogic/meson-gxbb-odroidc2.dtb make CHECK_DTBS=y amlogic/meson-g12b-odroid-n2.dtb make CHECK_DTBS=y amlogic/meson-sm1-odroid-c4.dtb
Ok I will update this in the next version for all the patches.
Quoted 3 lines
Best regards,
Krzysztof
Thanks
-Anand
PATCH 2/11 ARM: dts: amlogic: Used onboard usb hub reset to enable usb hub
In reply to Anand MoonOn Odroid c1 previously use gpio-hog to reset the usb hub, switch to used on board usb hub reset to enable the usb hub and enable power to usb hub.
Add usb hub regulator as per the schematic.
--- arch/arm/boot/dts/meson8b-odroidc1.dts | 40 +++++++++++++++++--------- 1 file changed, 27 insertions(+), 13 deletions(-)
arch/arm/boot/dts/meson8b-odroidc1.dts +27 -13
@@ -185,6 +185,33 @@ vdd_rtc: regulator-vdd-rtc { vin-supply = <&vcc_3v3>; }; + + usb_otg_pwr: regulator-usb-pwrs { + compatible = "regulator-fixed"; + regulator-name = "USB_OTG_PWR"; + + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + + /* signal name from schematics: PWREN */ + gpio = <&gpio_ao GPIOAO_5 GPIO_ACTIVE_HIGH>; + enable-active-high; + vin-supply = <&p5v0>; + }; + + usb { + dr_mode = "host"; + #address-cells = <1>; + #size-cells = <0>; + + hub@1 { + /* Genesys Logic GL852G-OHG usb hub */ + compatible = "genesys,usb5e3,610"; + reg = <1>; + vdd-supply = <&usb_otg_pwr>; + reset-gpio = <&gpio_ao GPIOAO_4 GPIO_ACTIVE_LOW>; + }; + }; }; &cpu0 {
@@ -281,19 +308,6 @@ &gpio_ao { "J7 Header Pin 6", "J7 Header Pin 5", "J7 Header Pin 7", "HDMI_CEC", "SYS_LED", "", ""; - - /* - * WARNING: The USB Hub on the Odroid-C1/C1+ needs a reset signal - * to be turned high in order to be detected by the USB Controller. - * This signal should be handled by a USB specific power sequence - * in order to reset the Hub when USB bus is powered down. - */ - usb-hub { - gpio-hog; - gpios = <GPIOAO_4 GPIO_ACTIVE_HIGH>; - output-high; - line-name = "usb-hub-reset"; - }; }; &ir_receiver {
Signature · 7 lines
2.38.1 _______________________________________________ linux-amlogic mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-amlogic
Re: [PATCH v1 02/11] ARM: dts: amlogic: Used onboard usb hub reset to enable usb hub
Quoted 31 lines · Anand Moon
On Odroid c1 previously use gpio-hog to reset the usb hub, switch to used on board usb hub reset to enable the usb hub and enable power to usb hub.
Add usb hub regulator as per the schematic.
Signed-off-by Anand Moon <[email protected]>--- arch/arm/boot/dts/meson8b-odroidc1.dts | 40 +++++++++++++++++--------- 1 file changed, 27 insertions(+), 13 deletions(-)arch/arm/boot/dts/meson8b-odroidc1.dts +12
-0@@ -185,6 +185,33 @@ vdd_rtc: regulator-vdd-rtc { vin-supply = <&vcc_3v3>; }; + + usb_otg_pwr: regulator-usb-pwrs { + compatible = "regulator-fixed"; + regulator-name = "USB_OTG_PWR"; + + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + + /* signal name from schematics: PWREN */ + gpio = <&gpio_ao GPIOAO_5 GPIO_ACTIVE_HIGH>; + enable-active-high; + vin-supply = <&p5v0>;
arch/arm/boot/dts/meson8b-odroidc1.dts vdd_rtc: regulator-vdd-rtc { · line 209
Quoted 10 lines
arch/arm/boot/dts/meson8b-odroidc1.dts +10
-0+ }; + + usb { + dr_mode = "host"; + #address-cells = <1>; + #size-cells = <0>; + + hub@1 { + /* Genesys Logic GL852G-OHG usb hub */ + compatible = "genesys,usb5e3,610";
Wrong compatible. Does not match pattern in usb-device.yaml.
Best regards,
Krzysztof
Re: [PATCH v1 02/11] ARM: dts: amlogic: Used onboard usb hub reset to enable usb hub
Hi Krzysztof,
Quoted 37 lines · Krzysztof Kozlowski
Quoted 35 lines · Anand Moon
On Odroid c1 previously use gpio-hog to reset the usb hub, switch to used on board usb hub reset to enable the usb hub and enable power to usb hub.
Add usb hub regulator as per the schematic.
Signed-off-by Anand Moon <[email protected]>--- arch/arm/boot/dts/meson8b-odroidc1.dts | 40 +++++++++++++++++--------- 1 file changed, 27 insertions(+), 13 deletions(-)arch/arm/boot/dts/meson8b-odroidc1.dts +16
-0@@ -185,6 +185,33 @@ vdd_rtc: regulator-vdd-rtc { vin-supply = <&vcc_3v3>; }; + + usb_otg_pwr: regulator-usb-pwrs { + compatible = "regulator-fixed"; + regulator-name = "USB_OTG_PWR"; + + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + + /* signal name from schematics: PWREN */ + gpio = <&gpio_ao GPIOAO_5 GPIO_ACTIVE_HIGH>; + enable-active-high; + vin-supply = <&p5v0>; + }; + + usb { + dr_mode = "host";
Quoted 9 lines
arch/arm/boot/dts/meson8b-odroidc1.dts vdd_rtc: regulator-vdd-rtc { · line 209
Quoted 6 lines
arch/arm/boot/dts/meson8b-odroidc1.dts +6
-0+ #address-cells = <1>; + #size-cells = <0>; + + hub@1 { + /* Genesys Logic GL852G-OHG usb hub */ + compatible = "genesys,usb5e3,610";Wrong compatible. Does not match pattern in
usb-device.yaml.
ok, will fix this in the next version.
Quoted 4 lines
Best regards,
Krzysztof
Thanks
-Anand
PATCH 3/11 arm64: dts: amlogic: Used onboard usb hub reset on odroid c2
In reply to Anand MoonOn Odroid c2 previously use gpio-hog to reset the usb hub, switch to used on-board usb hub reset to enable the usb hub and enable power to hub.
--- .../boot/dts/amlogic/meson-gxbb-odroidc2.dts | 29 +++++++++---------- 1 file changed, 14 insertions(+), 15 deletions(-)
arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts +14 -15
@@ -208,6 +208,20 @@ codec-0 { }; }; }; + + usb { + dr_mode = "host"; + #address-cells = <1>; + #size-cells = <0>; + + hub@1 { + /* Genesys Logic GL852G-OHG usb hub */ + compatible = "genesys,usb5e3,610"; + reg = <1>; + vdd-supply = <&usb_otg_pwr>; + reset-gpio = <&gpio_ao GPIOAO_4 GPIO_ACTIVE_LOW>; + }; + }; }; &aiu {
@@ -250,21 +264,6 @@ eth_phy0: ethernet-phy@0 { }; }; -&gpio_ao { - /* - * WARNING: The USB Hub on the Odroid-C2 needs a reset signal - * to be turned high in order to be detected by the USB Controller - * This signal should be handled by a USB specific power sequence - * in order to reset the Hub when USB bus is powered down. - */ - hog-0 { - gpio-hog; - gpios = <GPIOAO_4 GPIO_ACTIVE_HIGH>; - output-high; - line-name = "usb-hub-reset"; - }; -}; - &hdmi_tx { status = "okay"; pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>;
Signature · 7 lines
2.38.1 _______________________________________________ linux-amlogic mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-amlogic
Martin Blumenstingl
reviewerRe: [PATCH v1 03/11] arm64: dts: amlogic: Used onboard usb hub reset on odroid c2
Hi Anand,
thank you for working on this topic!
On Wed, Dec 28, 2022 at 11:05 AM Anand Moon <[email protected]> wrote:
[...]
arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts codec-0 { · line 224
Quoted 13 lines
arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts +13
-0+ usb { + dr_mode = "host"; + #address-cells = <1>; + #size-cells = <0>; + + hub@1 { + /* Genesys Logic GL852G-OHG usb hub */ + compatible = "genesys,usb5e3,610"; + reg = <1>; + vdd-supply = <&usb_otg_pwr>; + reset-gpio = <&gpio_ao GPIOAO_4 GPIO_ACTIVE_LOW>; + }; + };
My understanding is that the hub@1 node should be part of the corresponding USB controller node, not a new node.
In this case hub@1 should go into the existing &usb1 node. That way we describe the way the hardware is set up (meaning: hub@1 is connected to &usb1).
In case hub@1 is not detected within &usb1 then you may need something like [0] (not tested for your use-case).
If that helps: feel free to include that patch in your series.
Best regards,
Martin
[0] https://github.com/xdarklight/linux/commit/d8b96e5bc9c20ab2585194e0e59580c3b062c431
Re: [PATCH v1 03/11] arm64: dts: amlogic: Used onboard usb hub reset on odroid c2
Hi Martin,
Quoted 3 lines · Martin Blumenstingl
Hi Anand,
Thanks for your review comments.
Quoted 17 lines
thank you for working on this topic!
On Wed, Dec 28, 2022 at 11:05 AM Anand Moon <[email protected]> wrote:
[...]arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts codec-0 { · line 224
Quoted 13 lines
arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts +13
-0+ usb { + dr_mode = "host"; + #address-cells = <1>; + #size-cells = <0>; + + hub@1 { + /* Genesys Logic GL852G-OHG usb hub */ + compatible = "genesys,usb5e3,610"; + reg = <1>; + vdd-supply = <&usb_otg_pwr>; + reset-gpio = <&gpio_ao GPIOAO_4 GPIO_ACTIVE_LOW>; + }; + };
Quoted 6 lines
My understanding is that the hub@1 node should be part of the corresponding USB controller node, not a new node.
In this case hub@1 should go into the existing &usb1 node. That way we describe the way the hardware is set up (meaning: hub@1 is connected to &usb1).
Ok, I will move this code under &usb0 and &usb1 nodes.
onboard_usb_hub module just assists in usb hub reset. so these changes are meant to replace the gpio-hog.
$ dmesg | grep onboard [ 5.405558] usbcore: registered new device driver onboard-usb-hub [ 6.383428] onboard-usb-hub 1-1: reset high-speed USB device number 2 using dwc2
Here is the boot log of the odroid c2 [0] https://pastebin.com/PFy5waPb
Quoted 4 lines
In case hub@1 is not detected within &usb1 then you may need something like [0] (not tested for your use-case).
If that helps: feel free to include that patch in your series.
Thanks, will check if this is needed in this case. As of now it just reinitializes the hub.
Quoted 6 lines
Best regards,
Martin[0] https://github.com/xdarklight/linux/commit/d8b96e5bc9c20ab2585194e0e59580c3b062c431
Thanks
-Anand
_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic
Re: [PATCH v1 03/11] arm64: dts: amlogic: Used onboard usb hub reset on odroid c2
Hi Martin,
Quoted 39 lines · Anand Moon
Hi Martin,
Quoted 3 lines · Martin Blumenstingl
Hi Anand,
Thanks for your review comments.
Quoted 17 lines
thank you for working on this topic!
On Wed, Dec 28, 2022 at 11:05 AM Anand Moon <[email protected]> wrote:
[...]arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts codec-0 { · line 224
Quoted 13 lines
arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts +13
-0+ usb { + dr_mode = "host"; + #address-cells = <1>; + #size-cells = <0>; + + hub@1 { + /* Genesys Logic GL852G-OHG usb hub */ + compatible = "genesys,usb5e3,610"; + reg = <1>; + vdd-supply = <&usb_otg_pwr>; + reset-gpio = <&gpio_ao GPIOAO_4 GPIO_ACTIVE_LOW>; + }; + };Quoted 6 lines
My understanding is that the hub@1 node should be part of the corresponding USB controller node, not a new node.
In this case hub@1 should go into the existing &usb1 node. That way we describe the way the hardware is set up (meaning: hub@1 is connected to &usb1).Ok, I will move this code under &usb0 and &usb1 nodes.
onboard_usb_hubmodule just assists in usb hub reset. so these changes are meant to replace the gpio-hog.
Quoted 7 lines
$ dmesg | grep onboard [ 5.405558] usbcore: registered new device driver onboard-usb-hub [ 6.383428] onboard-usb-hub 1-1: reset high-speed USB device number 2 using dwc2Here is the boot log of the odroid c2 [0] https://pastebin.com/PFy5waPb
Moving the usb hub into usb subnode usb0 or usb1 does not work on Odroid n2 and c4, we have a combo phys of usb 2.0 and usb 3.0 so the onboard usb hub reset does not get initialized until both the PHY and USB nodes are brought up by the drivers.
# On Odroid n2 has a combo hub
alarm@odroid-n2:~$ lsusb -tv
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
ID 1d6b:0003 Linux Foundation 3.0 root hub
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 5000M
ID 05e3:0620 Genesys Logic, Inc. GL3523 Hub
|__ Port 1: Dev 5, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
ID 174c:5106 ASMedia Technology Inc. ASM1051 SATA 3Gb/s bridge
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/2p, 480M
ID 1d6b:0002 Linux Foundation 2.0 root hub
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
ID 05e3:0610 Genesys Logic, Inc. Hub
|__ Port 2: Dev 4, If 0, Class=Vendor Specific Class,
Driver=ax88179_178a, 480M
ID 0b95:1790 ASIX Electronics Corp. AX88179 Gigabit Ethernet# Odroid C4 also has a combo hub
alarm@odroid-c4:~$ lsusb -tv
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
ID 1d6b:0003 Linux Foundation 3.0 root hub
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 5000M
ID 2109:0817 VIA Labs, Inc.
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/2p, 480M
ID 1d6b:0002 Linux Foundation 2.0 root hub
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
ID 2109:2817 VIA Labs, Inc.So I will continue to work with this usb hub node to do a proper reset of the USB hub.
Quoted 9 lines
Quoted 4 lines
In case hub@1 is not detected within &usb1 then you maym need something like [0] (not tested for your use-case).
If that helps: feel free to include that patch in your series.Thanks, will check if this is needed in this case. As of now it just reinitializes the hub.
Quoted 1 line
Quoted 8 lines
Quoted 5 lines
Best regards,
Martin[0] https://github.com/xdarklight/linux/commit/d8b96e5bc9c20ab2585194e0e59580c3b062c431
Thanks
-Anand
Thanks
-Anand
Neil Armstrong
maintainerRe: [PATCH v1 03/11] arm64: dts: amlogic: Used onboard usb hub reset on odroid c2
Quoted 47 lines · Anand Moon
Hi Martin,
Quoted 44 lines · Anand Moon
Hi Martin,
Quoted 3 lines · Martin Blumenstingl
Hi Anand,
Thanks for your review comments.
Quoted 17 lines
thank you for working on this topic!
On Wed, Dec 28, 2022 at 11:05 AM Anand Moon <[email protected]> wrote:
[...]arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts codec-0 { · line 224
Quoted 13 lines
arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts +13
-0+ usb { + dr_mode = "host"; + #address-cells = <1>; + #size-cells = <0>; + + hub@1 { + /* Genesys Logic GL852G-OHG usb hub */ + compatible = "genesys,usb5e3,610"; + reg = <1>; + vdd-supply = <&usb_otg_pwr>; + reset-gpio = <&gpio_ao GPIOAO_4 GPIO_ACTIVE_LOW>; + }; + };Quoted 6 lines
My understanding is that the hub@1 node should be part of the corresponding USB controller node, not a new node.
In this case hub@1 should go into the existing &usb1 node. That way we describe the way the hardware is set up (meaning: hub@1 is connected to &usb1).Ok, I will move this code under &usb0 and &usb1 nodes.
onboard_usb_hubmodule just assists in usb hub reset. so these changes are meant to replace the gpio-hog.$ dmesg | grep onboard [ 5.405558] usbcore: registered new device driver onboard-usb-hub [ 6.383428] onboard-usb-hub 1-1: reset high-speed USB device number 2 using dwc2
Quoted 7 lines
Quoted 2 lines
Here is the boot log of the odroid c2 [0] https://pastebin.com/PFy5waPb
Moving the usb hub into usb subnode usb0 or usb1 does not work on Odroid n2 and c4, we have a combo phys of usb 2.0 and usb 3.0 so the onboard usb hub reset does not get initialized until both the PHY and USB nodes are brought up by the drivers.
Fine, then add a comment before the usb node explaining that.
Thanks,
Neil
Quoted 52 lines
# On Odroid n2 has a combo hub
alarm@odroid-n2:~$ lsusb -tv /: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M ID 1d6b:0003 Linux Foundation 3.0 root hub |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 5000M ID 05e3:0620 Genesys Logic, Inc. GL3523 Hub |__ Port 1: Dev 5, If 0, Class=Mass Storage, Driver=usb-storage, 5000M ID 174c:5106 ASMedia Technology Inc. ASM1051 SATA 3Gb/s bridge /: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/2p, 480M ID 1d6b:0002 Linux Foundation 2.0 root hub |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M ID 05e3:0610 Genesys Logic, Inc. Hub |__ Port 2: Dev 4, If 0, Class=Vendor Specific Class, Driver=ax88179_178a, 480M ID 0b95:1790 ASIX Electronics Corp. AX88179 Gigabit Ethernet# Odroid C4 also has a combo hub
alarm@odroid-c4:~$ lsusb -tv /: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M ID 1d6b:0003 Linux Foundation 3.0 root hub |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 5000M ID 2109:0817 VIA Labs, Inc. /: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/2p, 480M ID 1d6b:0002 Linux Foundation 2.0 root hub |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M ID 2109:2817 VIA Labs, Inc.So I will continue to work with this usb hub node to do a proper reset of the USB hub.
Quoted 9 lines
Quoted 4 lines
In case hub@1 is not detected within &usb1 then you maym need something like [0] (not tested for your use-case).
If that helps: feel free to include that patch in your series.Thanks, will check if this is needed in this case. As of now it just reinitializes the hub.
Quoted 1 line
Quoted 8 lines
Quoted 5 lines
Best regards,
Martin[0] https://github.com/xdarklight/linux/commit/d8b96e5bc9c20ab2585194e0e59580c3b062c431
Thanks
-AnandThanks
-Anand
Re: [PATCH v1 03/11] arm64: dts: amlogic: Used onboard usb hub reset on odroid c2
Hi Niel,
Quoted 52 lines · Neil Armstrong
Quoted 50 lines · Anand Moon
Hi Martin,
Quoted 46 lines · Anand Moon
Hi Martin,
Quoted 3 lines · Martin Blumenstingl
Hi Anand,
Thanks for your review comments.
Quoted 17 lines
thank you for working on this topic!
On Wed, Dec 28, 2022 at 11:05 AM Anand Moon <[email protected]> wrote:
[...]arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts codec-0 { · line 224
Quoted 13 lines
arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts +13
-0+ usb { + dr_mode = "host"; + #address-cells = <1>; + #size-cells = <0>; + + hub@1 { + /* Genesys Logic GL852G-OHG usb hub */ + compatible = "genesys,usb5e3,610"; + reg = <1>; + vdd-supply = <&usb_otg_pwr>; + reset-gpio = <&gpio_ao GPIOAO_4 GPIO_ACTIVE_LOW>; + }; + };Quoted 6 lines
My understanding is that the hub@1 node should be part of the corresponding USB controller node, not a new node.
In this case hub@1 should go into the existing &usb1 node. That way we describe the way the hardware is set up (meaning: hub@1 is connected to &usb1).Ok, I will move this code under &usb0 and &usb1 nodes.
onboard_usb_hubmodule just assists in usb hub reset. so these changes are meant to replace the gpio-hog.$ dmesg | grep onboard [ 5.405558] usbcore: registered new device driver onboard-usb-hub [ 6.383428] onboard-usb-hub 1-1: reset high-speed USB device number 2 using dwc2Here is the boot log of the odroid c2 [0] https://pastebin.com/PFy5waPb
Quoted 7 lines
Quoted 4 lines
Moving the usb hub into usb subnode usb0 or usb1 does not work on Odroid n2 and c4, we have a combo phys of usb 2.0 and usb 3.0 so the onboard usb hub reset does not get initialized until both the PHY and USB nodes are brought up by the drivers.
Fine, then add a comment before the usb node explaining that.
Sure, thanks.
Quoted 3 lines
Thanks,
Neil
Thanks
-Anand
Re: [PATCH v1 03/11] arm64: dts: amlogic: Used onboard usb hub reset on odroid c2
In reply to Anand MoonAm Mittwoch, 4. Januar 2023, 09:13:21 CET schrieb Anand Moon:
Quoted 97 lines
Hi Martin,
Quoted 41 lines · Anand Moon
Hi Martin,
On Wed, 28 Dec 2022 at 18:21, Martin Blumenstingl
Quoted 1 line · <[email protected]> wrote:
Hi Anand,
Thanks for your review comments.
Quoted 21 lines
thank you for working on this topic!
On Wed, Dec 28, 2022 at 11:05 AM Anand Moon <[email protected]> wrote:
[...]Quoted 12 lines
arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts +11
-0+ usb { + dr_mode = "host"; + #address-cells = <1>; + #size-cells = <0>; + + hub@1 { + /* Genesys Logic GL852G-OHG usb hub */ + compatible = "genesys,usb5e3,610"; + reg = <1>; + vdd-supply = <&usb_otg_pwr>; + reset-gpio = <&gpio_ao GPIOAO_4
GPIO_ACTIVE_LOW>;arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts codec-0 { · line 224
Quoted 2 lines
arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts +2
-0+ }; + };Quoted 5 lines
My understanding is that the hub@1 node should be part of the corresponding USB controller node, not a new node.
In this case hub@1 should go into the existing &usb1 node. That way we describe the way the hardware is set up (meaning: hub@1 is connected to &usb1).Ok, I will move this code under &usb0 and &usb1 nodes.
onboard_usb_hubmodule just assists in usb hub reset. so these changes are meant to replace the gpio-hog.Quoted 6 lines
$ dmesg | grep onboard [ 5.405558] usbcore: registered new device driver onboard-usb-hub [ 6.383428] onboard-usb-hub 1-1: reset high-speed USB device number 2 using dwc2Here is the boot log of the odroid c2 [0] https://pastebin.com/PFy5waPb
Moving the usb hub into usb subnode usb0 or usb1 does not work on Odroid n2 and c4, we have a combo phys of usb 2.0 and usb 3.0 so the onboard usb hub reset does not get initialized until both the PHY and USB nodes are brought up by the drivers.
# On Odroid n2 has a combo hub
alarm@odroid-n2:~$ lsusb -tv /: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M ID 1d6b:0003 Linux Foundation 3.0 root hub|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 5000M ID 05e3:0620 Genesys Logic, Inc. GL3523 Hub |__ Port 1: Dev 5, If 0, Class=Mass Storage, Driver=usb-storage, |5000M ID 174c:5106 ASMedia Technology Inc. ASM1051 SATA 3Gb/s bridge/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/2p, 480M
ID 1d6b:0002 Linux Foundation 2.0 root hub|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
ID 05e3:0610 Genesys Logic, Inc. Hub
|__ Port 2: Dev 4, If 0, Class=Vendor Specific Class,
Driver=ax88179_178a, 480M
ID 0b95:1790 ASIX Electronics Corp. AX88179 Gigabit Ethernet# Odroid C4 also has a combo hub
alarm@odroid-c4:~$ lsusb -tv /: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M ID 1d6b:0003 Linux Foundation 3.0 root hub|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 5000M ID 2109:0817 VIA Labs, Inc. /: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/2p, 480M ID 1d6b:0002 Linux Foundation 2.0 root hub |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M ID 2109:2817 VIA Labs, Inc.
Quoted 2 lines
So I will continue to work with this usb hub node to do a proper reset of the USB hub.
If your USB hub does both USB2.0 and USB3.0 you need to add both devices in DT and reference them using 'peer-hub'property. See ca69b6c78d5d ("arm64: dts:
tqma8mpql: add support for 2nd USB (host) interface") for a reference.
Best regards,
Alexander
Quoted 24 lines
Quoted 11 lines
Quoted 3 lines
In case hub@1 is not detected within &usb1 then you maym need something like [0] (not tested for your use-case).
If that helps: feel free to include that patch in your series.Thanks, will check if this is needed in this case. As of now it just reinitializes the hub.
Quoted 4 lines
Best regards,
MartinQuoted 5 lines
Quoted 3 lines
[0]
https://github.com/xdarklight/linux/commit/d8b96e5bc9c20ab2585194e0e59580c3b062c431>Thanks
-AnandThanks
-Anand_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Re: [PATCH v1 03/11] arm64: dts: amlogic: Used onboard usb hub reset on odroid c2
Hi Alexander,
Thanks for your review comments.
Quoted 97 lines · Alexander Stein
Am Mittwoch, 4. Januar 2023, 09:13:21 CET schrieb Anand Moon:
Quoted 95 lines
Hi Martin,
Quoted 41 lines · Anand Moon
Hi Martin,
On Wed, 28 Dec 2022 at 18:21, Martin Blumenstingl
Quoted 1 line · <[email protected]> wrote:
Hi Anand,
Thanks for your review comments.
Quoted 21 lines
thank you for working on this topic!
On Wed, Dec 28, 2022 at 11:05 AM Anand Moon <[email protected]> wrote:
[...]Quoted 12 lines
arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts +11
-0+ usb { + dr_mode = "host"; + #address-cells = <1>; + #size-cells = <0>; + + hub@1 { + /* Genesys Logic GL852G-OHG usb hub */ + compatible = "genesys,usb5e3,610"; + reg = <1>; + vdd-supply = <&usb_otg_pwr>; + reset-gpio = <&gpio_ao GPIOAO_4
GPIO_ACTIVE_LOW>;arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts codec-0 { · line 224
Quoted 2 lines
arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts +2
-0+ }; + };Quoted 5 lines
My understanding is that the hub@1 node should be part of the corresponding USB controller node, not a new node.
In this case hub@1 should go into the existing &usb1 node. That way we describe the way the hardware is set up (meaning: hub@1 is connected to &usb1).Ok, I will move this code under &usb0 and &usb1 nodes.
onboard_usb_hubmodule just assists in usb hub reset. so these changes are meant to replace the gpio-hog.Quoted 6 lines
$ dmesg | grep onboard [ 5.405558] usbcore: registered new device driver onboard-usb-hub [ 6.383428] onboard-usb-hub 1-1: reset high-speed USB device number 2 using dwc2Here is the boot log of the odroid c2 [0] https://pastebin.com/PFy5waPb
Moving the usb hub into usb subnode usb0 or usb1 does not work on Odroid n2 and c4, we have a combo phys of usb 2.0 and usb 3.0 so the onboard usb hub reset does not get initialized until both the PHY and USB nodes are brought up by the drivers.
# On Odroid n2 has a combo hub
alarm@odroid-n2:~$ lsusb -tv /: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M ID 1d6b:0003 Linux Foundation 3.0 root hub|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 5000M ID 05e3:0620 Genesys Logic, Inc. GL3523 Hub |__ Port 1: Dev 5, If 0, Class=Mass Storage, Driver=usb-storage, |5000M ID 174c:5106 ASMedia Technology Inc. ASM1051 SATA 3Gb/s bridge/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/2p, 480M
ID 1d6b:0002 Linux Foundation 2.0 root hub|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
ID 05e3:0610 Genesys Logic, Inc. Hub
|__ Port 2: Dev 4, If 0, Class=Vendor Specific Class,
Driver=ax88179_178a, 480M
ID 0b95:1790 ASIX Electronics Corp. AX88179 Gigabit Ethernet# Odroid C4 also has a combo hub
alarm@odroid-c4:~$ lsusb -tv /: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M ID 1d6b:0003 Linux Foundation 3.0 root hub|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 5000M ID 2109:0817 VIA Labs, Inc./: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/2p, 480M
ID 1d6b:0002 Linux Foundation 2.0 root hub|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
Quoted 9 lines
Quoted 4 lines
ID 2109:2817 VIA Labs, Inc.So I will continue to work with this usb hub node to do a proper reset of the USB hub.
If your USB hub does both USB2.0 and USB3.0 you need to add both devices in DT and reference them using 'peer-hub'property. See
ca69b6c78d5d("arm64: dts:
tqma8mpql: add support for 2nd USB (host) interface") for a reference.
Yes, I have updated the DTS example for using peer-hub for both devices.
Quoted 3 lines
Best regards,
Alexander
Thanks
-Anand
PATCH 4/11 arm64: dts: amlogic: Used onboard usb hub reset on odroid n2
In reply to Anand MoonOn Odroid n2 previously use gpio-hog to reset the usb hub, switch to used on-board usb hub reset to enable the usb hub and enable power to hub.
--- .../dts/amlogic/meson-g12b-odroid-n2.dtsi | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-)
arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi +14 -12
@@ -347,6 +347,20 @@ codec { }; }; }; + + usb { + dr_mode = "host"; + #address-cells = <1>; + #size-cells = <0>; + + hub: hub@1 { + /* Genesys Logic GL3523-QFN76 usb hub*/ + compatible = "genesys,usb5e3,620"; + reg = <1>; + vdd-supply = <&hub_5v>; + reset-gpios = <&gpio GPIOH_4 GPIO_ACTIVE_LOW>; + }; + }; }; &acodec {
@@ -535,18 +549,6 @@ &gpio { "PIN_3", /* GPIOX_17 */ "PIN_5", /* GPIOX_18 */ "PIN_36"; /* GPIOX_19 */ - /* - * WARNING: The USB Hub on the Odroid-N2 needs a reset signal - * to be turned high in order to be detected by the USB Controller - * This signal should be handled by a USB specific power sequence - * in order to reset the Hub when USB bus is powered down. - */ - hog-0 { - gpio-hog; - gpios = <GPIOH_4 GPIO_ACTIVE_HIGH>; - output-high; - line-name = "usb-hub-reset"; - }; }; &hdmi_tx {
Signature · 7 lines
2.38.1 _______________________________________________ linux-amlogic mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-amlogic
PATCH 5/11 usb: misc: onboard_usb_hub: add Genesys Logic GL852G-OHG hub support
In reply to Anand MoonGenesys Logic GL852G-OHG is a 4-port USB 2.0 STT hub that has a reset pin to toggle and a 5.0V core supply exported though an integrated LDO is available for powering it.
Add the support for this hub, for controlling the reset pin and the core power supply.
--- drivers/usb/misc/onboard_usb_hub.c | 1 + drivers/usb/misc/onboard_usb_hub.h | 1 + 2 files changed, 2 insertions(+)
drivers/usb/misc/onboard_usb_hub.c +1 -0
@@ -409,6 +409,7 @@ static void onboard_hub_usbdev_disconnect(struct usb_device *udev)static const struct usb_device_id onboard_hub_id_table[] = { {USB_DEVICE (VENDOR_ID_GENESYS ,0x0608 ) },/* Genesys Logic GL850G USB 2.0 */ + {USB_DEVICE (VENDOR_ID_GENESYS ,0x0610 ) },/* Genesys Logic GL852G-OHG USB 2.0 */ {USB_DEVICE (VENDOR_ID_MICROCHIP ,0x2514 ) },/* USB2514B USB 2.0 */ {USB_DEVICE (VENDOR_ID_REALTEK ,0x0411 ) },/* RTS5411 USB 3.1 */ {USB_DEVICE (VENDOR_ID_REALTEK ,0x5411 ) },/* RTS5411 USB 2.1 */
drivers/usb/misc/onboard_usb_hub.h +1 -0
@@ -31,6 +31,7 @@ static const struct of_device_id onboard_hub_match[] = { { .compatible = "usb451,8140", .data = &ti_tusb8041_data, }, { .compatible = "usb451,8142", .data = &ti_tusb8041_data, }, { .compatible = "usb5e3,608", .data = &genesys_gl850g_data, }, + { .compatible = "genesys,usb5e3,610", .data = &genesys_gl850g_data, }, { .compatible = "usbbda,411", .data = &realtek_rts5411_data, }, { .compatible = "usbbda,5411", .data = &realtek_rts5411_data, }, { .compatible = "usbbda,414", .data = &realtek_rts5411_data, },
Signature · 1 line
2.38.1
Re: [PATCH v1 05/11] usb: misc: onboard_usb_hub: add Genesys Logic GL852G-OHG hub support
Quoted 30 lines · Anand Moon
Genesys Logic GL852G-OHG is a 4-port USB 2.0 STT hub that has a reset pin to toggle and a 5.0V core supply exported though an integrated LDO is available for powering it.
Add the support for this hub, for controlling the reset pin and the core power supply.
Signed-off-by Anand Moon <[email protected]>--- drivers/usb/misc/onboard_usb_hub.c | 1 + drivers/usb/misc/onboard_usb_hub.h | 1 + 2 files changed, 2 insertions(+)drivers/usb/misc/onboard_usb_hub.c +1
-0@@ -409,6 +409,7 @@ static void onboard_hub_usbdev_disconnect(struct usb_device *udev)static const struct usb_device_id onboard_hub_id_table[] = { {USB_DEVICE (VENDOR_ID_GENESYS ,0x0608 ) },/* Genesys Logic GL850G USB 2.0 */ + {USB_DEVICE (VENDOR_ID_GENESYS ,0x0610 ) },/* Genesys Logic GL852G-OHG USB 2.0 */ {USB_DEVICE (VENDOR_ID_MICROCHIP ,0x2514 ) },/* USB2514B USB 2.0 */ {USB_DEVICE (VENDOR_ID_REALTEK ,0x0411 ) },/* RTS5411 USB 3.1 */ {USB_DEVICE (VENDOR_ID_REALTEK ,0x5411 ) },/* RTS5411 USB 2.1 */ drivers/usb/misc/onboard_usb_hub.h +0
-0
drivers/usb/misc/onboard_usb_hub.h static const struct of_device_id onboard_hub_match[] = { · line 34
Quoted 4 lines
drivers/usb/misc/onboard_usb_hub.h +1
-0@@ -31,6 +31,7 @@ static const struct of_device_id onboard_hub_match[] = { { .compatible = "usb451,8140", .data = &ti_tusb8041_data, }, { .compatible = "usb451,8142", .data = &ti_tusb8041_data, }, { .compatible = "usb5e3,608", .data = &genesys_gl850g_data, }, + { .compatible = "genesys,usb5e3,610", .data = &genesys_gl850g_data, },
s/genesys,//
Quoted 6 lines
drivers/usb/misc/onboard_usb_hub.h +0
-0{ .compatible = "usbbda,411", .data = &realtek_rts5411_data, }, { .compatible = "usbbda,5411", .data = &realtek_rts5411_data, }, { .compatible = "usbbda,414", .data = &realtek_rts5411_data, },Signature · 1 line
2.38.1
_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic
Re: [PATCH v1 05/11] usb: misc: onboard_usb_hub: add Genesys Logic GL852G-OHG hub support
Quoted 20 lines · Matthias Kaehlcke
Quoted 19 lines · Anand Moon
Genesys Logic GL852G-OHG is a 4-port USB 2.0 STT hub that has a reset pin to toggle and a 5.0V core supply exported though an integrated LDO is available for powering it.
Add the support for this hub, for controlling the reset pin and the core power supply.
Signed-off-by Anand Moon <[email protected]>--- drivers/usb/misc/onboard_usb_hub.c | 1 + drivers/usb/misc/onboard_usb_hub.h | 1 + 2 files changed, 2 insertions(+)drivers/usb/misc/onboard_usb_hub.c +0
-0@@ -409,6 +409,7 @@ static void onboard_hub_usbdev_disconnect(struct usb_device *udev)
Quoted 3 lines
drivers/usb/misc/onboard_usb_hub.c static void onboard_hub_usbdev_disconnect(struct usb_device *udev) · line 412
Quoted 3 lines
drivers/usb/misc/onboard_usb_hub.c +1
-0static const struct usb_device_id onboard_hub_id_table[] = { {USB_DEVICE (VENDOR_ID_GENESYS ,0x0608 ) },/* Genesys Logic GL850G USB 2.0 */ + {USB_DEVICE (VENDOR_ID_GENESYS ,0x0610 ) },/* Genesys Logic GL852G-OHG USB 2.0 */
Do you happen to know what '-OHG' stands for? The Genesys website only mentions a GL852G with different package types (none of them 'OHG'). Unless there is an 'OHG' variant with a different product id I'd say let's drop the suffix.
Quoted 6 lines
Quoted 6 lines
drivers/usb/misc/onboard_usb_hub.c +0
-0{ USB_DEVICE(VENDOR_ID_MICROCHIP, 0x2514) }, /* USB2514B USB 2.0 */ { USB_DEVICE(VENDOR_ID_REALTEK, 0x0411) }, /* RTS5411 USB 3.1 */ { USB_DEVICE(VENDOR_ID_REALTEK, 0x5411) }, /* RTS5411 USB 2.1 */drivers/usb/misc/onboard_usb_hub.h +0
-1--- a/drivers/usb/misc/onboard_usb_hub.h
Quoted 15 lines
drivers/usb/misc/onboard_usb_hub.h static const struct of_device_id onboard_hub_match[] = { · line 34
Quoted 6 lines
+++
b/drivers/usb/misc/onboard_usb_hub.hdrivers/usb/misc/onboard_usb_hub.h +1
-0@@ -31,6 +31,7 @@ static const struct of_device_id onboard_hub_match[] = { { .compatible = "usb451,8140", .data = &ti_tusb8041_data, }, { .compatible = "usb451,8142", .data = &ti_tusb8041_data, }, { .compatible = "usb5e3,608", .data = &genesys_gl850g_data, }, + { .compatible = "genesys,usb5e3,610", .data = &genesys_gl850g_data, },s/genesys,//
Quoted 6 lines
drivers/usb/misc/onboard_usb_hub.h +0
-0{ .compatible = "usbbda,411", .data = &realtek_rts5411_data, }, { .compatible = "usbbda,5411", .data = &realtek_rts5411_data, }, { .compatible = "usbbda,414", .data = &realtek_rts5411_data, },Signature · 1 line
2.38.1
_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic
Re: [PATCH v1 05/11] usb: misc: onboard_usb_hub: add Genesys Logic GL852G-OHG hub support
Hi Matthias
Quoted 22 lines · Matthias Kaehlcke
Quoted 20 lines · Matthias Kaehlcke
Quoted 19 lines · Anand Moon
Genesys Logic GL852G-OHG is a 4-port USB 2.0 STT hub that has a reset pin to toggle and a 5.0V core supply exported through an integrated LDO is available for powering it.
Add the support for this hub, for controlling the reset pin and the core power supply.
Signed-off-by Anand Moon <[email protected]>--- drivers/usb/misc/onboard_usb_hub.c | 1 + drivers/usb/misc/onboard_usb_hub.h | 1 + 2 files changed, 2 insertions(+)drivers/usb/misc/onboard_usb_hub.c +0
-0@@ -409,6 +409,7 @@ static void onboard_hub_usbdev_disconnect(struct usb_device *udev)
Quoted 8 lines
Quoted 3 lines
drivers/usb/misc/onboard_usb_hub.c static void onboard_hub_usbdev_disconnect(struct usb_device *udev) · line 412
Quoted 3 lines
drivers/usb/misc/onboard_usb_hub.c +1
-0static const struct usb_device_id onboard_hub_id_table[] = { {USB_DEVICE (VENDOR_ID_GENESYS ,0x0608 ) },/* Genesys Logic GL850G USB 2.0 */ + {USB_DEVICE (VENDOR_ID_GENESYS ,0x0610 ) },/* Genesys Logic GL852G-OHG USB 2.0 */ Do you happen to know what '-OHG' stands for? The Genesys website only mentions a GL852G with different package types (none of them 'OHG'). Unless there is an 'OHG' variant with a different product id I'd say let's drop the suffix.
Ok, done.
Quoted 22 lines
Quoted 22 lines
drivers/usb/misc/onboard_usb_hub.h static const struct of_device_id onboard_hub_match[] = { · line 34
Quoted 13 lines
drivers/usb/misc/onboard_usb_hub.c +0
-0{ USB_DEVICE(VENDOR_ID_MICROCHIP, 0x2514) }, /* USB2514B USB 2.0 */ { USB_DEVICE(VENDOR_ID_REALTEK, 0x0411) }, /* RTS5411 USB 3.1 */ { USB_DEVICE(VENDOR_ID_REALTEK, 0x5411) }, /* RTS5411 USB 2.1 */drivers/usb/misc/onboard_usb_hub.h +1
-0@@ -31,6 +31,7 @@ static const struct of_device_id onboard_hub_match[] = { { .compatible = "usb451,8140", .data = &ti_tusb8041_data, }, { .compatible = "usb451,8142", .data = &ti_tusb8041_data, }, { .compatible = "usb5e3,608", .data = &genesys_gl850g_data, }, + { .compatible = "genesys,usb5e3,610", .data = &genesys_gl850g_data, },s/genesys,//
Quoted 6 lines
drivers/usb/misc/onboard_usb_hub.h +0
-1{ .compatible = "usbbda,411", .data = &realtek_rts5411_data, }, { .compatible = "usbbda,5411", .data = &realtek_rts5411_data, }, { .compatible = "usbbda,414", .data = &realtek_rts5411_data, }, --2.38.1
PATCH 6/11 usb: misc: onboard_usb_hub: add Genesys Logic GL3523-QFN76 hub support
In reply to Anand MoonGenesys Logic GL3523-QFN76 is a 4-port USB 3.1 hub that has a reset pin to toggle and a 5.0V core supply exported though an integrated LDO is available for powering it.
Add the support for this hub, for controlling the reset pin and the core power supply.
--- drivers/usb/misc/onboard_usb_hub.c | 1 + drivers/usb/misc/onboard_usb_hub.h | 1 + 2 files changed, 2 insertions(+)
drivers/usb/misc/onboard_usb_hub.c +1 -0
@@ -410,6 +410,7 @@ static void onboard_hub_usbdev_disconnect(struct usb_device *udev)static const struct usb_device_id onboard_hub_id_table[] = { {USB_DEVICE (VENDOR_ID_GENESYS ,0x0608 ) },/* Genesys Logic GL850G USB 2.0 */ {USB_DEVICE (VENDOR_ID_GENESYS ,0x0610 ) },/* Genesys Logic GL852G-OHG USB 2.0 */ + {USB_DEVICE (VENDOR_ID_GENESYS ,0x0620 ) },/* Genesys Logic GL3523-QFN76 USB 3.1 */ {USB_DEVICE (VENDOR_ID_MICROCHIP ,0x2514 ) },/* USB2514B USB 2.0 */ {USB_DEVICE (VENDOR_ID_REALTEK ,0x0411 ) },/* RTS5411 USB 3.1 */ {USB_DEVICE (VENDOR_ID_REALTEK ,0x5411 ) },/* RTS5411 USB 2.1 */
drivers/usb/misc/onboard_usb_hub.h +1 -0
@@ -32,6 +32,7 @@ static const struct of_device_id onboard_hub_match[] = { { .compatible = "usb451,8142", .data = &ti_tusb8041_data, }, { .compatible = "usb5e3,608", .data = &genesys_gl850g_data, }, { .compatible = "genesys,usb5e3,610", .data = &genesys_gl850g_data, }, + { .compatible = "genesys,usb5e3,620", .data = &genesys_gl850g_data, }, { .compatible = "usbbda,411", .data = &realtek_rts5411_data, }, { .compatible = "usbbda,5411", .data = &realtek_rts5411_data, }, { .compatible = "usbbda,414", .data = &realtek_rts5411_data, },
Signature · 1 line
2.38.1
Re: [PATCH v1 06/11] usb: misc: onboard_usb_hub: add Genesys Logic GL3523-QFN76 hub support
Hi Anand,
Quoted 18 lines · Anand Moon
Genesys Logic GL3523-QFN76 is a 4-port USB 3.1 hub that has a reset pin to toggle and a 5.0V core supply exported though an integrated LDO is available for powering it.
Add the support for this hub, for controlling the reset pin and the core power supply.
Signed-off-by Anand Moon <[email protected]>--- drivers/usb/misc/onboard_usb_hub.c | 1 + drivers/usb/misc/onboard_usb_hub.h | 1 + 2 files changed, 2 insertions(+)drivers/usb/misc/onboard_usb_hub.c +0
-0
drivers/usb/misc/onboard_usb_hub.c static void onboard_hub_usbdev_disconnect(struct usb_device *udev) · line 413
Quoted 4 lines
drivers/usb/misc/onboard_usb_hub.c +1
-0@@ -410,6 +410,7 @@ static void onboard_hub_usbdev_disconnect(struct usb_device *udev)static const struct usb_device_id onboard_hub_id_table[] = { {USB_DEVICE (VENDOR_ID_GENESYS ,0x0608 ) },/* Genesys Logic GL850G USB 2.0 */ {USB_DEVICE (VENDOR_ID_GENESYS ,0x0610 ) },/* Genesys Logic GL852G-OHG USB 2.0 */ + {USB_DEVICE (VENDOR_ID_GENESYS ,0x0620 ) },/* Genesys Logic GL3523-QFN76 USB 3.1 */
Please drop the '-QFN76' suffix. The GL3523 comes in different packages, 'QFN76' is one of them, I'd expect the other packages to use the same product id.
The GL3523 is a single IC, however like the TI USB8041 or the RTS5414 it provides both a USB 3.1 and a USB 2.0 hub. You should also add an entry for the USB 2.0 hub here.
drivers/usb/misc/onboard_usb_hub.h static const struct of_device_id onboard_hub_match[] = { · line 35
Quoted 12 lines
drivers/usb/misc/onboard_usb_hub.c +0
-0{ USB_DEVICE(VENDOR_ID_MICROCHIP, 0x2514) }, /* USB2514B USB 2.0 */ { USB_DEVICE(VENDOR_ID_REALTEK, 0x0411) }, /* RTS5411 USB 3.1 */ { USB_DEVICE(VENDOR_ID_REALTEK, 0x5411) }, /* RTS5411 USB 2.1 */drivers/usb/misc/onboard_usb_hub.h +1
-0@@ -32,6 +32,7 @@ static const struct of_device_id onboard_hub_match[] = { { .compatible = "usb451,8142", .data = &ti_tusb8041_data, }, { .compatible = "usb5e3,608", .data = &genesys_gl850g_data, }, { .compatible = "genesys,usb5e3,610", .data = &genesys_gl850g_data, }, + { .compatible = "genesys,usb5e3,620", .data = &genesys_gl850g_data, },
s/genesys,//
This reuses the settings of the GL850G hub, which doesn't seem correct in this case. For the GL850G a (minimum) reset time of 3us is configured. The data sheet of the GL3523 says:
"The (internal) reset will be released after approximately 40 μS after
power good.
To fully control the reset process of GL3523, we suggest the reset time applied in the external reset circuit should longer than that of the internal reset circuit."
Since it is 'approximately 40 μS' I'd say make the external reset 50 μS to be on the safe side, it's a very short time in any case.
Please also add an entry for the USB 2.0 part of the IC.
Quoted 6 lines
drivers/usb/misc/onboard_usb_hub.h +0
-0{ .compatible = "usbbda,411", .data = &realtek_rts5411_data, }, { .compatible = "usbbda,5411", .data = &realtek_rts5411_data, }, { .compatible = "usbbda,414", .data = &realtek_rts5411_data, },Signature · 1 line
2.38.1
Re: [PATCH v1 06/11] usb: misc: onboard_usb_hub: add Genesys Logic GL3523-QFN76 hub support
Hi Matthias,
Thanks for your review comments,
Quoted 30 lines · Matthias Kaehlcke
Hi Anand,
Quoted 18 lines · Anand Moon
Genesys Logic GL3523-QFN76 is a 4-port USB 3.1 hub that has a reset pin to toggle and a 5.0V core supply exported though an integrated LDO is available for powering it.
Add the support for this hub, for controlling the reset pin and the core power supply.
Signed-off-by Anand Moon <[email protected]>--- drivers/usb/misc/onboard_usb_hub.c | 1 + drivers/usb/misc/onboard_usb_hub.h | 1 + 2 files changed, 2 insertions(+)drivers/usb/misc/onboard_usb_hub.c +0
-0drivers/usb/misc/onboard_usb_hub.c static void onboard_hub_usbdev_disconnect(struct usb_device *udev) · line 413
Quoted 4 lines
drivers/usb/misc/onboard_usb_hub.c +1
-0@@ -410,6 +410,7 @@ static void onboard_hub_usbdev_disconnect(struct usb_device *udev)static const struct usb_device_id onboard_hub_id_table[] = { {USB_DEVICE (VENDOR_ID_GENESYS ,0x0608 ) },/* Genesys Logic GL850G USB 2.0 */ {USB_DEVICE (VENDOR_ID_GENESYS ,0x0610 ) },/* Genesys Logic GL852G-OHG USB 2.0 */ + {USB_DEVICE (VENDOR_ID_GENESYS ,0x0620 ) },/* Genesys Logic GL3523-QFN76 USB 3.1 */ Please drop the '-QFN76' suffix. The GL3523 comes in different packages, 'QFN76' is one of them, I'd expect the other packages to use the same product id.
Quoted 4 lines
The GL3523 is a single IC, however like the TI USB8041 or the RTS5414 it provides both a USB 3.1 and a USB 2.0 hub. You should also add an entry for the USB 2.0 hub here.
Ok,
Quoted 22 lines
drivers/usb/misc/onboard_usb_hub.h static const struct of_device_id onboard_hub_match[] = { · line 35
Quoted 12 lines
drivers/usb/misc/onboard_usb_hub.c +0
-0{ USB_DEVICE(VENDOR_ID_MICROCHIP, 0x2514) }, /* USB2514B USB 2.0 */ { USB_DEVICE(VENDOR_ID_REALTEK, 0x0411) }, /* RTS5411 USB 3.1 */ { USB_DEVICE(VENDOR_ID_REALTEK, 0x5411) }, /* RTS5411 USB 2.1 */drivers/usb/misc/onboard_usb_hub.h +1
-0@@ -32,6 +32,7 @@ static const struct of_device_id onboard_hub_match[] = { { .compatible = "usb451,8142", .data = &ti_tusb8041_data, }, { .compatible = "usb5e3,608", .data = &genesys_gl850g_data, }, { .compatible = "genesys,usb5e3,610", .data = &genesys_gl850g_data, }, + { .compatible = "genesys,usb5e3,620", .data = &genesys_gl850g_data, },s/genesys,//
This reuses the settings of the GL850G hub, which doesn't seem correct in this case. For the GL850G a (minimum) reset time of 3us is configured. The data sheet of the GL3523 says:
"The (internal) reset will be released after approximately 40 μS after
power good.
Quoted 7 lines
To fully control the reset process of GL3523, we suggest the reset time applied in the external reset circuit should longer than that of the internal reset circuit."
Since it is 'approximately 40 μS' I'd say make the external reset 50 μS to be on the safe side, it's a very short time in any case.
Thanks for this input will update this in the next version.
Quoted 1 line
Please also add an entry for the USB 2.0 part of the IC.
alarm@odroid-n2:~$ lsusb -tv
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
ID 1d6b:0003 Linux Foundation 3.0 root hub
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 5000M
ID 05e3:0620 Genesys Logic, Inc. GL3523 Hub
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/2p, 480M
ID 1d6b:0002 Linux Foundation 2.0 root hub
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
ID 05e3:0610 Genesys Logic, Inc. HubSo earlier patch adds support for this device ID.
Quoted 7 lines
Quoted 7 lines
drivers/usb/misc/onboard_usb_hub.h +0
-1{ .compatible = "usbbda,411", .data = &realtek_rts5411_data, }, { .compatible = "usbbda,5411", .data = &realtek_rts5411_data, }, { .compatible = "usbbda,414", .data = &realtek_rts5411_data, }, --2.38.1
_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic
Re: [PATCH v1 06/11] usb: misc: onboard_usb_hub: add Genesys Logic GL3523-QFN76 hub support
Quoted 86 lines · Anand Moon
Hi Matthias,
Thanks for your review comments,
Quoted 30 lines · Matthias Kaehlcke
Hi Anand,
Quoted 18 lines · Anand Moon
Genesys Logic GL3523-QFN76 is a 4-port USB 3.1 hub that has a reset pin to toggle and a 5.0V core supply exported though an integrated LDO is available for powering it.
Add the support for this hub, for controlling the reset pin and the core power supply.
Signed-off-by Anand Moon <[email protected]>--- drivers/usb/misc/onboard_usb_hub.c | 1 + drivers/usb/misc/onboard_usb_hub.h | 1 + 2 files changed, 2 insertions(+)drivers/usb/misc/onboard_usb_hub.c +0
-0drivers/usb/misc/onboard_usb_hub.c static void onboard_hub_usbdev_disconnect(struct usb_device *udev) · line 413
Quoted 4 lines
drivers/usb/misc/onboard_usb_hub.c +1
-0@@ -410,6 +410,7 @@ static void onboard_hub_usbdev_disconnect(struct usb_device *udev)static const struct usb_device_id onboard_hub_id_table[] = { {USB_DEVICE (VENDOR_ID_GENESYS ,0x0608 ) },/* Genesys Logic GL850G USB 2.0 */ {USB_DEVICE (VENDOR_ID_GENESYS ,0x0610 ) },/* Genesys Logic GL852G-OHG USB 2.0 */ + {USB_DEVICE (VENDOR_ID_GENESYS ,0x0620 ) },/* Genesys Logic GL3523-QFN76 USB 3.1 */ Please drop the '-QFN76' suffix. The GL3523 comes in different packages, 'QFN76' is one of them, I'd expect the other packages to use the same product id.
Quoted 4 lines
The GL3523 is a single IC, however like the TI USB8041 or the RTS5414 it provides both a USB 3.1 and a USB 2.0 hub. You should also add an entry for the USB 2.0 hub here.
Ok,
Quoted 22 lines
drivers/usb/misc/onboard_usb_hub.h static const struct of_device_id onboard_hub_match[] = { · line 35
Quoted 12 lines
drivers/usb/misc/onboard_usb_hub.c +0
-0{ USB_DEVICE(VENDOR_ID_MICROCHIP, 0x2514) }, /* USB2514B USB 2.0 */ { USB_DEVICE(VENDOR_ID_REALTEK, 0x0411) }, /* RTS5411 USB 3.1 */ { USB_DEVICE(VENDOR_ID_REALTEK, 0x5411) }, /* RTS5411 USB 2.1 */drivers/usb/misc/onboard_usb_hub.h +1
-0@@ -32,6 +32,7 @@ static const struct of_device_id onboard_hub_match[] = { { .compatible = "usb451,8142", .data = &ti_tusb8041_data, }, { .compatible = "usb5e3,608", .data = &genesys_gl850g_data, }, { .compatible = "genesys,usb5e3,610", .data = &genesys_gl850g_data, }, + { .compatible = "genesys,usb5e3,620", .data = &genesys_gl850g_data, },s/genesys,//
This reuses the settings of the GL850G hub, which doesn't seem correct in this case. For the GL850G a (minimum) reset time of 3us is configured. The data sheet of the GL3523 says:
"The (internal) reset will be released after approximately 40 μS after
power good.Quoted 7 lines
To fully control the reset process of GL3523, we suggest the reset time applied in the external reset circuit should longer than that of the internal reset circuit."
Since it is 'approximately 40 μS' I'd say make the external reset 50 μS to be on the safe side, it's a very short time in any case.
Thanks for this input will update this in the next version.
Quoted 1 line
Please also add an entry for the USB 2.0 part of the IC.
alarm@odroid-n2:~$ lsusb -tv /: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M ID 1d6b:0003 Linux Foundation 3.0 root hub |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 5000M ID 05e3:0620 Genesys Logic, Inc. GL3523 Hub /: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/2p, 480M ID 1d6b:0002 Linux Foundation 2.0 root hub |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M ID 05e3:0610 Genesys Logic, Inc. Hub
Quoted 1 line
So earlier patch adds support for this device ID.
Do I understand correctly that 0x0610 is the product id of both the GL852G [1] and the USB 2 part of the GL3523 (the above 'lsusb' output)?
[1] https://patchwork.kernel.org/project/linux-usb/patch/[email protected]/
_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic
PATCH 7/11 vendor-prefixes: Add VIA Labs, Inc.
In reply to Anand MoonAdd the vendor prefix for VIA Labs, Inc. (VLI) is a leading supplier of USB and USB Power Delivery controllers for multi-functional devices and platforms.
Website: https://www.via-labs.com/
--- Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++ 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
@@ -1398,6 +1398,8 @@ patternProperties: description: Vertexcom Technologies, Inc. "^via,.*": description: VIA Technologies, Inc. + "^vialab,.*": + description: VIA Labs, Inc. "^vicor,.*": description: Vicor Corporation "^videostrong,.*":
Signature · 1 line
2.38.1
Re: [PATCH v1 07/11] vendor-prefixes: Add VIA Labs, Inc.
Quoted 1 line · Anand Moon
Add the vendor prefix for VIA Labs, Inc. (VLI) is a leading supplier
Drop marketing, so without "leading".
Best regards,
Krzysztof
_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic
PATCH 8/11 dt-bindings: usb: Add binding for Via lab VL817Q7 hub controller
In reply to Anand MoonThe VIA Lab VL817-Q7 is a USB 3.1 Gen 1 4-Port hub controller that features 4 downstream ports, an internal 5V regulator and has external reset pin.
Add a device tree binding for its USB protocol part. The internal LDO is not covered by this and can just be modelled as a fixed regulator.
--- .../bindings/usb/vialab,vl817q7.yaml | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/vialab,vl817q7.yaml
Documentation/devicetree/bindings/usb/vialab,vl817q7.yaml new file +47 -0
@@ -0,0 +1,47 @@ +# SPDX-License-Identifier: GPL-2.0-only or BSD-2-Clause +%YAML 1.2 +--- +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Via labs VL817Q7 USB 3.1 hub controller + +maintainers: + - Anand Moon <[email protected]> + +allOf: + - $ref: usb-device.yaml# + +properties: + compatible: + enum: + - vialab,usb2109 + + reg: true + + reset-gpios: + description: GPIO controlling the RESET# pin. + + vdd-supply: + description: + the regulator that provides 5.0V core power to the hub. + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + #include <dt-bindings/gpio/gpio.h> + usb { + dr_mode = "host"; + #address-cells = <1>; + #size-cells = <0>; + + hub: hub@1 { + compatible = "vialab,usb2109" + reg = <1>; + reset-gpios = <&gpio GPIOH_4 GPIO_ACTIVE_LOW>; + }; + };
Signature · 1 line
2.38.1
Re: [PATCH v1 08/11] dt-bindings: usb: Add binding for Via lab VL817Q7 hub controller
Quoted 27 lines · Anand Moon
The VIA Lab VL817-Q7 is a USB 3.1 Gen 1 4-Port hub controller that features 4 downstream ports, an internal 5V regulator and has external reset pin.
Add a device tree binding for its USB protocol part. The internal LDO is not covered by this and can just be modelled as a fixed regulator.
Signed-off-by Anand Moon <[email protected]>--- .../bindings/usb/vialab,vl817q7.yaml | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/vialab,vl817q7.yamlDocumentation/devicetree/bindings/usb/vialab,vl817q7.yaml new file +7
-0@@ -0,0 +1,47 @@ +# SPDX-License-Identifier: GPL-2.0-only or BSD-2-Clause +%YAML 1.2 +--- +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Via labs VL817Q7 USB 3.1 hub controller +
Documentation/devicetree/bindings/usb/vialab,vl817q7.yaml line 17
Quoted 10 lines
Documentation/devicetree/bindings/usb/vialab,vl817q7.yaml new file +10
-0+maintainers: + - Anand Moon <[email protected]> + +allOf: + - $ref: usb-device.yaml# + +properties: + compatible: + enum: + - vialab,usb2109
This isn't a valid compatible string for USB devices (should be "usb<vid>,<pid>").
Same for the other binding.
Also the bindings should go before the driver changes in the series.
Johan
Re: [PATCH v1 08/11] dt-bindings: usb: Add binding for Via lab VL817Q7 hub controller
Hi Johan
Thanks for your review comments.
Quoted 43 lines · Johan Hovold
Quoted 27 lines · Anand Moon
The VIA Lab VL817-Q7 is a USB 3.1 Gen 1 4-Port hub controller that features 4 downstream ports, an internal 5V regulator and has external reset pin.
Add a device tree binding for its USB protocol part. The internal LDO is not covered by this and can just be modelled as a fixed regulator.
Signed-off-by Anand Moon <[email protected]>--- .../bindings/usb/vialab,vl817q7.yaml | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/vialab,vl817q7.yamlDocumentation/devicetree/bindings/usb/vialab,vl817q7.yaml new file +7
-0@@ -0,0 +1,47 @@ +# SPDX-License-Identifier: GPL-2.0-only or BSD-2-Clause +%YAML 1.2 +--- +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Via labs VL817Q7 USB 3.1 hub controller +Documentation/devicetree/bindings/usb/vialab,vl817q7.yaml line 17
Quoted 10 lines
Documentation/devicetree/bindings/usb/vialab,vl817q7.yaml new file +10
-0+maintainers: + - Anand Moon <[email protected]> + +allOf: + - $ref: usb-device.yaml# + +properties: + compatible: + enum: + - vialab,usb2109This isn't a valid compatible string for USB devices (should be "usb<vid>,<pid>").
Quoted 2 lines
Same for the other binding.
ok, I will change this in the next version.
Quoted 3 lines
Also the bindings should go before the driver changes in the series.
Johan
Thanks
-Anand
Rob Herring
maintainerRe: [PATCH v1 08/11] dt-bindings: usb: Add binding for Via lab VL817Q7 hub controller
In reply to Anand MoonQuoted 8 lines · Anand Moon
The VIA Lab VL817-Q7 is a USB 3.1 Gen 1 4-Port hub controller that features 4 downstream ports, an internal 5V regulator and has external reset pin.
Add a device tree binding for its USB protocol part. The internal LDO is not covered by this and can just be modelled as a fixed regulator.
Quoted 6 lines
Signed-off-by Anand Moon <[email protected]>--- .../bindings/usb/vialab,vl817q7.yaml | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/vialab,vl817q7.yaml
My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13):
yamllint warnings/errors:
dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/usb/vialab,vl817q7.yaml: '$id' is a required property
hint: Metaschema for devicetree binding documentation
from schema $id: http://devicetree.org/meta-schemas/base.yaml#
Error: Documentation/devicetree/bindings/usb/vialab,vl817q7.example.dts:26.17-18 syntax error
FATAL ERROR: Unable to parse input tree
make[1]: *** [scripts/Makefile.lib:434: Documentation/devicetree/bindings/usb/vialab,vl817q7.example.dtb] Error 1 make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:1508: dt_binding_check] Error 2
doc reference errors (make refcheckdocs):
See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/[email protected]
The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch.
If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:
pip3 install dtschema --upgrade
Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.
Re: [PATCH v1 08/11] dt-bindings: usb: Add binding for Via lab VL817Q7 hub controller
In reply to Anand MoonQuoted 20 lines · Anand Moon
The VIA Lab VL817-Q7 is a USB 3.1 Gen 1 4-Port hub controller that features 4 downstream ports, an internal 5V regulator and has external reset pin.
Add a device tree binding for its USB protocol part. The internal LDO is not covered by this and can just be modelled as a fixed regulator.
Signed-off-by Anand Moon <[email protected]>--- .../bindings/usb/vialab,vl817q7.yaml | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/vialab,vl817q7.yamlDocumentation/devicetree/bindings/usb/vialab,vl817q7.yaml new file +0
-0
Documentation/devicetree/bindings/usb/vialab,vl817q7.yaml line 6
Quoted 6 lines
Documentation/devicetree/bindings/usb/vialab,vl817q7.yaml new file +6
-0@@ -0,0 +1,47 @@ +# SPDX-License-Identifier: GPL-2.0-only or BSD-2-Clause +%YAML 1.2 +--- +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Via labs VL817Q7 USB 3.1 hub controller
nit: VIA Labs VL817-Q7
Documentation/devicetree/bindings/usb/vialab,vl817q7.yaml line 17
Quoted 11 lines
Documentation/devicetree/bindings/usb/vialab,vl817q7.yaml new file +11
-0+ +maintainers: + - Anand Moon <[email protected]> + +allOf: + - $ref: usb-device.yaml# + +properties: + compatible: + enum: + - vialab,usb2109
This is not a valid compatible string as Johan already noted.
Besides that the VL817-Q7 provides both a 3.1 and a 2.0 USB hub, which are enumerated separately. Please also add a compatible string for the 2.0 hub (assuming 0x2109 is the 3.1 hub).
Quoted 19 lines
Documentation/devicetree/bindings/usb/vialab,vl817q7.yaml new file +19
-0+ + reg: true + + reset-gpios: + description: GPIO controlling the RESET# pin. + + vdd-supply: + description: + the regulator that provides 5.0V core power to the hub. + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + #include <dt-bindings/gpio/gpio.h>
Documentation/devicetree/bindings/usb/vialab,vl817q7.yaml line 46
Quoted 10 lines
Documentation/devicetree/bindings/usb/vialab,vl817q7.yaml new file +10
-0+ usb { + dr_mode = "host"; + #address-cells = <1>; + #size-cells = <0>; + + hub: hub@1 { + compatible = "vialab,usb2109" + reg = <1>; + reset-gpios = <&gpio GPIOH_4 GPIO_ACTIVE_LOW>; + };
Please also add a node for the other hub and link the two nodes with each other through the 'peer-hub' property. See realtek,rts5411.yaml for reference.
Re: [PATCH v1 08/11] dt-bindings: usb: Add binding for Via lab VL817Q7 hub controller
Hi Matthias,
Quoted 16 lines · Matthias Kaehlcke
Quoted 14 lines · Anand Moon
The VIA Lab VL817-Q7 is a USB 3.1 Gen 1 4-Port hub controller that features 4 downstream ports, an internal 5V regulator and has external reset pin.
Add a device tree binding for its USB protocol part. The internal LDO is not covered by this and can just be modelled as a fixed regulator.
Signed-off-by Anand Moon <[email protected]>--- .../bindings/usb/vialab,vl817q7.yaml | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/vialab,vl817q7.yaml
Quoted 15 lines
Documentation/devicetree/bindings/usb/vialab,vl817q7.yaml line 6
Quoted 12 lines
Documentation/devicetree/bindings/usb/vialab,vl817q7.yaml new file +6
-0@@ -0,0 +1,47 @@ +# SPDX-License-Identifier: GPL-2.0-only or BSD-2-Clause +%YAML 1.2 +--- +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Via labs VL817Q7 USB 3.1 hub controllernit: VIA Labs VL817-Q7
Ok
Quoted 14 lines
Documentation/devicetree/bindings/usb/vialab,vl817q7.yaml line 17
Quoted 11 lines
Documentation/devicetree/bindings/usb/vialab,vl817q7.yaml new file +11
-0+ +maintainers: + - Anand Moon <[email protected]> + +allOf: + - $ref: usb-device.yaml# + +properties: + compatible: + enum: + - vialab,usb2109This is not a valid compatible string as Johan already noted.
Quoted 4 lines
Besides that the VL817-Q7 provides both a 3.1 and a 2.0 USB hub, which are enumerated separately. Please also add a compatible string for the 2.0 hub (assuming
0x2109is the 3.1 hub).
Yes, correct,
actually, I would like to rename this file to vialab,vl817.yaml since vialab,vl817-q7 is used for USB 3.1 hub and vialab,vl817-q5 is used for USB 2.0 hub.
[0] https://datasheet.lcsc.com/lcsc/1808111624_VIA-Tech-VL817-Q7-B0_C209756.pdf
Quoted 25 lines
Quoted 25 lines
Documentation/devicetree/bindings/usb/vialab,vl817q7.yaml new file +25
-0+ + reg: true + + reset-gpios: + description: GPIO controlling the RESET# pin. + + vdd-supply: + description: + the regulator that provides 5.0V core power to the hub. + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + #include <dt-bindings/gpio/gpio.h> + usb { + dr_mode = "host"; + #address-cells = <1>; + #size-cells = <0>; + + hub: hub@1 {
Quoted 8 lines
Documentation/devicetree/bindings/usb/vialab,vl817q7.yaml line 46
Quoted 4 lines
Documentation/devicetree/bindings/usb/vialab,vl817q7.yaml new file +4
-0+ compatible = "vialab,usb2109" + reg = <1>; + reset-gpios = <&gpio GPIOH_4 GPIO_ACTIVE_LOW>; + };Please also add a node for the other hub and link the two nodes with each other through the 'peer-hub' property. See realtek,rts5411.yaml for reference.
Ok, I will update the example according,
Thanks
-Anand.
_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic
PATCH 9/11 arm64: dts: meson-sm1-odroid-c4: Used onboard usb hub reset on odroid c4
In reply to Anand MoonOn Odroid c4 previously use gpio-hog to reset the usb hub, switch to used on-board usb hub reset to enable the usb hub and enable power to hub.
--- .../boot/dts/amlogic/meson-sm1-odroid-c4.dts | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-)
arch/arm64/boot/dts/amlogic/meson-sm1-odroid-c4.dts +12 -13
@@ -26,20 +26,19 @@ led-blue { sound { model = "ODROID-C4"; }; -}; -&gpio { - /* - * WARNING: The USB Hub on the Odroid-C4 needs a reset signal - * to be turned high in order to be detected by the USB Controller - * This signal should be handled by a USB specific power sequence - * in order to reset the Hub when USB bus is powered down. - */ - hog-0 { - gpio-hog; - gpios = <GPIOH_4 GPIO_ACTIVE_HIGH>; - output-high; - line-name = "usb-hub-reset"; + usb { + dr_mode = "host"; + #address-cells = <1>; + #size-cells = <0>; + + hub: hub@1 { + /* Via lab VL817-Q7 usb hub */ + compatible = "vialab,usb2109"; + reg = <1>; + vdd-supply = <&usb_pwr_en>; + reset-gpios = <&gpio GPIOH_4 GPIO_ACTIVE_LOW>; + }; }; };
Signature · 1 line
2.38.1
PATCH 10/11 usb: misc: onboard_usb_hub: add VIA LAB VL817Q7 hub support
In reply to Anand MoonVIA LAB VL817Q7 is a 4-port USB 3.1 hub that has a reset pin to toggle and a 5.0V core supply exported though an integrated LDO is available for powering it.
Add the support for this hub, for controlling the reset pin and the core power supply.
--- drivers/usb/misc/onboard_usb_hub.c | 2 ++ drivers/usb/misc/onboard_usb_hub.h | 5 +++++ 2 files changed, 7 insertions(+)
drivers/usb/misc/onboard_usb_hub.c +2 -0
@@ -335,6 +335,7 @@ static struct platform_driver onboard_hub_driver = {#define VENDOR_ID_MICROCHIP 0x0424#define VENDOR_ID_REALTEK 0x0bda#define VENDOR_ID_TI 0x0451 +#define VENDOR_ID_VIA 0x2109/* * Returns the onboard_hub platform device that is associated with the USB
@@ -418,6 +419,7 @@ static const struct usb_device_id onboard_hub_id_table[] = { { USB_DEVICE(VENDOR_ID_REALTEK, 0x5414) }, /* RTS5414 USB 2.1 */ { USB_DEVICE(VENDOR_ID_TI, 0x8140) }, /* TI USB8041 3.0 */ { USB_DEVICE(VENDOR_ID_TI, 0x8142) }, /* TI USB8041 2.0 */ + { USB_DEVICE(VENDOR_ID_VIA, 0x0817) }, /* VIA VL817Q7 3.1 */ {} };MODULE_DEVICE_TABLE (usb, onboard_hub_id_table);
drivers/usb/misc/onboard_usb_hub.h +5 -0
@@ -26,6 +26,10 @@ static const struct onboard_hub_pdata genesys_gl850g_data = { .reset_us = 3, }; +static const struct onboard_hub_pdata vialab_vl817q7_data = { + .reset_us =3 , +}; +static const struct of_device_id onboard_hub_match[] = { { .compatible ="usb424,2514" , .data = µchip_usb424_data, }, { .compatible ="usb451,8140" , .data = &ti_tusb8041_data, },
@@ -37,6 +41,7 @@ static const struct of_device_id onboard_hub_match[] = { { .compatible = "usbbda,5411", .data = &realtek_rts5411_data, }, { .compatible = "usbbda,414", .data = &realtek_rts5411_data, }, { .compatible = "usbbda,5414", .data = &realtek_rts5411_data, }, + { .compatible = "vialab,usb2109", .data = &vialab_vl817q7_data, }, {} };
Signature · 1 line
2.38.1
Re: [PATCH v1 10/11] usb: misc: onboard_usb_hub: add VIA LAB VL817Q7 hub support
Hi Andand,
Quoted 26 lines · Anand Moon
VIA LAB VL817Q7 is a 4-port USB 3.1 hub that has a reset pin to toggle and a 5.0V core supply exported though an integrated LDO is available for powering it.
Add the support for this hub, for controlling the reset pin and the core power supply.
Signed-off-by Anand Moon <[email protected]>--- drivers/usb/misc/onboard_usb_hub.c | 2 ++ drivers/usb/misc/onboard_usb_hub.h | 5 +++++ 2 files changed, 7 insertions(+)drivers/usb/misc/onboard_usb_hub.c +1
-0@@ -335,6 +335,7 @@ static struct platform_driver onboard_hub_driver = {#define VENDOR_ID_MICROCHIP 0x0424#define VENDOR_ID_REALTEK 0x0bda#define VENDOR_ID_TI 0x0451 +#define VENDOR_ID_VIA 0x2109/* * Returns the onboard_hub platform device that is associated with the USB
drivers/usb/misc/onboard_usb_hub.c static const struct usb_device_id onboard_hub_id_table[] = { · line 422
Quoted 4 lines
drivers/usb/misc/onboard_usb_hub.c +1
-0@@ -418,6 +419,7 @@ static const struct usb_device_id onboard_hub_id_table[] = { { USB_DEVICE(VENDOR_ID_REALTEK, 0x5414) }, /* RTS5414 USB 2.1 */ { USB_DEVICE(VENDOR_ID_TI, 0x8140) }, /* TI USB8041 3.0 */ { USB_DEVICE(VENDOR_ID_TI, 0x8142) }, /* TI USB8041 2.0 */ + { USB_DEVICE(VENDOR_ID_VIA, 0x0817) }, /* VIA VL817Q7 3.1 */
The VL817Q7 is a single IC, however like the TI USB8041 or the RTS5414 it provides both a USB 3.1 and a USB 2.0 hub. You should also add an entry for the USB 2.0 hub here.
Quoted 19 lines
drivers/usb/misc/onboard_usb_hub.c +0
-0{} };MODULE_DEVICE_TABLE (usb, onboard_hub_id_table);drivers/usb/misc/onboard_usb_hub.h +4
-0@@ -26,6 +26,10 @@ static const struct onboard_hub_pdata genesys_gl850g_data = { .reset_us = 3, }; +static const struct onboard_hub_pdata vialab_vl817q7_data = { + .reset_us =3 , +}; +static const struct of_device_id onboard_hub_match[] = { { .compatible ="usb424,2514" , .data = µchip_usb424_data, }, { .compatible ="usb451,8140" , .data = &ti_tusb8041_data, },
drivers/usb/misc/onboard_usb_hub.h static const struct of_device_id onboard_hub_match[] = { · line 44
Quoted 4 lines
drivers/usb/misc/onboard_usb_hub.h +1
-0@@ -37,6 +41,7 @@ static const struct of_device_id onboard_hub_match[] = { { .compatible = "usbbda,5411", .data = &realtek_rts5411_data, }, { .compatible = "usbbda,414", .data = &realtek_rts5411_data, }, { .compatible = "usbbda,5414", .data = &realtek_rts5411_data, }, + { .compatible = "vialab,usb2109", .data = &vialab_vl817q7_data, },
ditto
Actually you added the device id entry for the 3.1 hub and a compatible string of the 2.0 hub (or vice versa). Above the device id is 0x0817, here it is 0x2109. Please add both USB 3.1 and 2.0 and make sure the device id and the USB version in the comment for the device id table match.
Re: [PATCH v1 10/11] usb: misc: onboard_usb_hub: add VIA LAB VL817Q7 hub support
Hi Matthias,
Thanks for your review comments.
Quoted 27 lines · Matthias Kaehlcke
Hi Andand,
Quoted 23 lines · Anand Moon
VIA LAB VL817Q7 is a 4-port USB 3.1 hub that has a reset pin to toggle and a 5.0V core supply exported though an integrated LDO is available for powering it.
Add the support for this hub, for controlling the reset pin and the core power supply.
Signed-off-by Anand Moon <[email protected]>--- drivers/usb/misc/onboard_usb_hub.c | 2 ++ drivers/usb/misc/onboard_usb_hub.h | 5 +++++ 2 files changed, 7 insertions(+)drivers/usb/misc/onboard_usb_hub.c +1
-0@@ -335,6 +335,7 @@ static struct platform_driver onboard_hub_driver = {#define VENDOR_ID_MICROCHIP 0x0424#define VENDOR_ID_REALTEK 0x0bda#define VENDOR_ID_TI 0x0451 +#define VENDOR_ID_VIA 0x2109
Quoted 12 lines
drivers/usb/misc/onboard_usb_hub.c static const struct usb_device_id onboard_hub_id_table[] = { · line 422
Quoted 7 lines
drivers/usb/misc/onboard_usb_hub.c +1
-0/* * Returns the onboard_hub platform device that is associated with the USB @@ -418,6 +419,7 @@ static const struct usb_device_id onboard_hub_id_table[] = { { USB_DEVICE(VENDOR_ID_REALTEK, 0x5414) }, /* RTS5414 USB 2.1 */ { USB_DEVICE(VENDOR_ID_TI, 0x8140) }, /* TI USB8041 3.0 */ { USB_DEVICE(VENDOR_ID_TI, 0x8142) }, /* TI USB8041 2.0 */ + { USB_DEVICE(VENDOR_ID_VIA, 0x0817) }, /* VIA VL817Q7 3.1 */The VL817Q7 is a single IC, however like the TI USB8041 or the RTS5414 it provides both a USB 3.1 and a USB 2.0 hub. You should also add an entry for the USB 2.0 hub here.
Ok,
Quoted 27 lines
Quoted 20 lines
drivers/usb/misc/onboard_usb_hub.c +0
-0{} };MODULE_DEVICE_TABLE (usb, onboard_hub_id_table);drivers/usb/misc/onboard_usb_hub.h +4
-0@@ -26,6 +26,10 @@ static const struct onboard_hub_pdata genesys_gl850g_data = { .reset_us = 3, }; +static const struct onboard_hub_pdata vialab_vl817q7_data = { + .reset_us =3 , +}; +static const struct of_device_id onboard_hub_match[] = { { .compatible ="usb424,2514" , .data = µchip_usb424_data, }, { .compatible ="usb451,8140" , .data = &ti_tusb8041_data, },drivers/usb/misc/onboard_usb_hub.h static const struct of_device_id onboard_hub_match[] = { · line 44
Quoted 4 lines
drivers/usb/misc/onboard_usb_hub.h +1
-0@@ -37,6 +41,7 @@ static const struct of_device_id onboard_hub_match[] = { { .compatible = "usbbda,5411", .data = &realtek_rts5411_data, }, { .compatible = "usbbda,414", .data = &realtek_rts5411_data, }, { .compatible = "usbbda,5414", .data = &realtek_rts5411_data, }, + { .compatible = "vialab,usb2109", .data = &vialab_vl817q7_data, },ditto
Quoted 4 lines
Actually you added the device id entry for the 3.1 hub and a compatible string of the 2.0 hub (or vice versa). Above the device id is
0x0817, here it is0x2109. Please add both USB 3.1 and 2.0 and make sure the device id and the USB version in the comment for the device id table match.
Yes I messed up the compatible string
On Odrodi C4
alarm@odroid-c4:~$ lsusb -tv
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
ID 1d6b:0003 Linux Foundation 3.0 root hub
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 5000M
ID 2109:0817 VIA Labs, Inc.
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/2p, 480M
ID 1d6b:0002 Linux Foundation 2.0 root hub
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
ID 2109:2817 VIA Labs, Inc.vendor ID is 0x2109 and the device ID is 0817,
So I have fixed the compatible string as below.
compatible = "usb2109,2817"; /* USB 2.0 hub */
compatible = "usb2109,817"; /* USB 3.1 hub */Thanks
-Anand
PATCH 11/11 arm64: defconfig: Enable USB onboard HUB driver
In reply to Anand MoonEnable the USB onboard HUB driver, used on Amlogic boards.
--- arch/arm64/configs/defconfig | 1 + 1 file changed, 1 insertion(+)
arch/arm64/configs/defconfig +1 -0
@@ -923,6 +923,7 @@ CONFIG_USB_SERIAL_CP210X=m CONFIG_USB_SERIAL_FTDI_SIO=m CONFIG_USB_SERIAL_OPTION=m CONFIG_USB_HSIC_USB3503=y +CONFIG_USB_ONBOARD_HUB=m CONFIG_NOP_USB_XCEIV=y CONFIG_USB_GADGET=y CONFIG_USB_RENESAS_USBHS_UDC=m
Signature · 1 line
2.38.1