Skip to contentSkip to conversation

dt-bindings: usb: Add the binding example for the Genesys Logic GL3523 hub

PATCH Superseded Anand Moon 2 participants 8 messages Nov 19, 2023 – Nov 22, 2023 1 message not in the archive

Subsystems (3)

v3 of 7 Superseded Latest is v7 →

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Anand Moon

author
#1 lore raw

PATCH v3 1/2 dt-bindings: usb: Add the binding example for the Genesys Logic GL3523 hub

Add the binding example for the USB3.1 Genesys Logic GL3523 integrates with USB 3.1 Gen 1 Super Speed and USB 2.0 High-Speed hub.

---
V3: fix the dt_binding_check error, added new example for Genesys GL3523
v2: added Genesys GL3523 binding
v1: none

---
 .../bindings/usb/genesys,gl850g.yaml          | 63 +++++++++++++++++--
 1 file changed, 59 insertions(+), 4 deletions(-)
Documentation/devicetree/bindings/usb/genesys,gl850g.yaml +59 -4
index ee08b9c3721f..f8e88477fa11 100644
@@ -9,9 +9,6 @@ title: Genesys Logic USB hub controller
 maintainers:
   - Icenowy Zheng <[email protected]>
 
-allOf:
-  - $ref: usb-device.yaml#
-
 properties:
   compatible:
     enum:
@@ -27,12 +24,44 @@ properties:
 
   vdd-supply:
     description:
-      the regulator that provides 3.3V core power to the hub.
+      phandle to the regulator that provides power to the hub.
+
+  peer-hub:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description:
+      phandle to the peer hub on the controller.
 
 required:
   - compatible
   - reg
 
+allOf:
+  - $ref: usb-device.yaml#
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - usb5e3,608
+    then:
+      properties:
+        peer-hub: false
+        vdd-supply: false
+        reset-gpios: true
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - usb5e3,610
+              - usb5e3,620
+    then:
+      properties:
+        peer-hub: true
+        vdd-supply: true
+        reset-gpios: true
+
 additionalProperties: false
 
 examples:
@@ -49,3 +78,29 @@ examples:
             reset-gpios = <&pio 7 2 GPIO_ACTIVE_LOW>;
         };
     };
+
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+    usb {
+        dr_mode = "host";
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        /* 2.0 hub on port 1 */
+        hub_2_0: hub@1 {
+            compatible = "usb5e3,610";
+            reg = <1>;
+            peer-hub = <&hub_3_0>;
+            reset-gpios = <&gpio 20 GPIO_ACTIVE_LOW>;
+            vdd-supply = <&vcc_5v>;
+        };
+
+        /* 3.1 hub on port 4 */
+        hub_3_0: hub@2 {
+            compatible = "usb5e3,620";
+            reg = <2>;
+            peer-hub = <&hub_2_0>;
+            reset-gpios = <&gpio 20 GPIO_ACTIVE_LOW>;
+            vdd-supply = <&vcc_5v>;
+        };
+    };
Signature · 1 line
2.42.0
#2 lore raw
Quoted 3 lines · Anand Moon

Add the binding example for the USB3.1 Genesys Logic GL3523 integrates with USB 3.1 Gen 1 Super Speed and USB 2.0 High-Speed hub.

But no comment in the commit message about the new property for the "peer hub". $subject saying "dt-bindings: usb: Add the binding example for the Genesys Logic GL3523 hub" is misleading when the meaningful parts of the patch are unrelated to the example.

Quoted 25 lines

---
V3: fix the dt_binding_check error, added new example for Genesys GL3523
v2: added Genesys GL3523 binding
v1: none

---
 .../bindings/usb/genesys,gl850g.yaml          | 63 +++++++++++++++++--
 1 file changed, 59 insertions(+), 4 deletions(-)
Documentation/devicetree/bindings/usb/genesys,gl850g.yaml +0 -3
index ee08b9c3721f..f8e88477fa11 100644
@@ -9,9 +9,6 @@ title: Genesys Logic USB hub controller
 maintainers:
   - Icenowy Zheng <[email protected]>
 
-allOf:
-  - $ref: usb-device.yaml#
-
 properties:
   compatible:
     enum:

Documentation/devicetree/bindings/usb/genesys,gl850g.yaml properties: · line 32

Quoted 10 lines
Documentation/devicetree/bindings/usb/genesys,gl850g.yaml +6 -1
@@ -27,12 +24,44 @@ properties:
 
   vdd-supply:
     description:
-      the regulator that provides 3.3V core power to the hub.
+      phandle to the regulator that provides power to the hub.
+
+  peer-hub:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description:
+      phandle to the peer hub on the controller.

What is this, why is it needed? Please explain it in your commit message.

Thanks,
Conor.

Quoted 68 lines
Documentation/devicetree/bindings/usb/genesys,gl850g.yaml +53 -0
 required:
   - compatible
   - reg
 
+allOf:
+  - $ref: usb-device.yaml#
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - usb5e3,608
+    then:
+      properties:
+        peer-hub: false
+        vdd-supply: false
+        reset-gpios: true
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - usb5e3,610
+              - usb5e3,620
+    then:
+      properties:
+        peer-hub: true
+        vdd-supply: true
+        reset-gpios: true
+
 additionalProperties: false
 
 examples:
@@ -49,3 +78,29 @@ examples:
             reset-gpios = <&pio 7 2 GPIO_ACTIVE_LOW>;
         };
     };
+
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+    usb {
+        dr_mode = "host";
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        /* 2.0 hub on port 1 */
+        hub_2_0: hub@1 {
+            compatible = "usb5e3,610";
+            reg = <1>;
+            peer-hub = <&hub_3_0>;
+            reset-gpios = <&gpio 20 GPIO_ACTIVE_LOW>;
+            vdd-supply = <&vcc_5v>;
+        };
+
+        /* 3.1 hub on port 4 */
+        hub_3_0: hub@2 {
+            compatible = "usb5e3,620";
+            reg = <2>;
+            peer-hub = <&hub_2_0>;
+            reset-gpios = <&gpio 20 GPIO_ACTIVE_LOW>;
+            vdd-supply = <&vcc_5v>;
+        };
+    };
Signature · 1 line
2.42.0
author
#3 lore raw

Hi Conor,

Quoted 37 lines · Conor Dooley
Quoted 3 lines · Anand Moon

Add the binding example for the USB3.1 Genesys Logic GL3523 integrates with USB 3.1 Gen 1 Super Speed and USB 2.0 High-Speed hub.

But no comment in the commit message about the new property for the "peer hub". $subject saying "dt-bindings: usb: Add the binding example for the Genesys Logic GL3523 hub" is misleading when the meaningful parts of the patch are unrelated to the example.

Quoted 26 lines

---
V3: fix the dt_binding_check error, added new example for Genesys GL3523
v2: added Genesys GL3523 binding
v1: none

---
 .../bindings/usb/genesys,gl850g.yaml          | 63 +++++++++++++++++--
 1 file changed, 59 insertions(+), 4 deletions(-)
Documentation/devicetree/bindings/usb/genesys,gl850g.yaml +0 -3
index ee08b9c3721f..f8e88477fa11 100644
@@ -9,9 +9,6 @@ title: Genesys Logic USB hub controller
 maintainers:
   - Icenowy Zheng <[email protected]>
 
-allOf:
-  - $ref: usb-device.yaml#
-
 properties:
   compatible:
     enum:
@@ -27,12 +24,44 @@ properties:
 
Quoted 13 lines

Documentation/devicetree/bindings/usb/genesys,gl850g.yaml properties: · line 32

Quoted 9 lines
Documentation/devicetree/bindings/usb/genesys,gl850g.yaml +6 -1
   vdd-supply:
     description:
-      the regulator that provides 3.3V core power to the hub.
+      phandle to the regulator that provides power to the hub.
+
+  peer-hub:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description:
+      phandle to the peer hub on the controller.

What is this, why is it needed? Please explain it in your commit message.

Ok, GL3523 integrates Genesys Logic self-developed USB 3.1 Gen 1 Super Speed transmitter/receiver physical layer (PHY) and USB 2.0 High-Speed PHY

peer-hub is used to cross-connect those phy nodes so that it can help hub power on/off simultaneously.

/: Bus 001.Port 001: Dev 001, Class=root_hub, Driver=xhci-hcd/2p, 480M

    ID 1d6b:0002 Linux Foundation 2.0 root hub
    |__ Port 001: Dev 002, If 0, Class=Hub, Driver=hub/4p, 480M
        ID 05e3:0610 Genesys Logic, Inc. Hub
        |__ Port 003: Dev 004, If 0, Class=Vendor Specific Class,
Driver=cp210x, 12M
            ID 10c4:ea60 Silicon Labs CP210x UART Bridge
/:  Bus 002.Port 001: Dev 001, Class=root_hub, Driver=xhci-hcd/1p, 5000M
    ID 1d6b:0003 Linux Foundation 3.0 root hub
    |__ Port 001: Dev 002, If 0, Class=Hub, Driver=hub/4p, 5000M
        ID 05e3:0620 Genesys Logic, Inc. GL3523 Hub
        |__ Port 001: Dev 003, If 0, Class=Mass Storage,

Driver=usb-storage, 5000M
ID 174c:55aa ASMedia Technology Inc. ASM1051E SATA 6Gb/s
bridge, ASM1053E SATA 6Gb/s bridge, ASM1153 SATA 3Gb/s bridge, ASM1153E SATA 6Gb/s bridge

Thanks
-Anand

Quoted 71 lines

Thanks,
Conor.

Quoted 68 lines
Documentation/devicetree/bindings/usb/genesys,gl850g.yaml +53 -1
 required:
   - compatible
   - reg
 
+allOf:
+  - $ref: usb-device.yaml#
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - usb5e3,608
+    then:
+      properties:
+        peer-hub: false
+        vdd-supply: false
+        reset-gpios: true
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - usb5e3,610
+              - usb5e3,620
+    then:
+      properties:
+        peer-hub: true
+        vdd-supply: true
+        reset-gpios: true
+
 additionalProperties: false
 
 examples:
@@ -49,3 +78,29 @@ examples:
             reset-gpios = <&pio 7 2 GPIO_ACTIVE_LOW>;
         };
     };
+
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+    usb {
+        dr_mode = "host";
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        /* 2.0 hub on port 1 */
+        hub_2_0: hub@1 {
+            compatible = "usb5e3,610";
+            reg = <1>;
+            peer-hub = <&hub_3_0>;
+            reset-gpios = <&gpio 20 GPIO_ACTIVE_LOW>;
+            vdd-supply = <&vcc_5v>;
+        };
+
+        /* 3.1 hub on port 4 */
+        hub_3_0: hub@2 {
+            compatible = "usb5e3,620";
+            reg = <2>;
+            peer-hub = <&hub_2_0>;
+            reset-gpios = <&gpio 20 GPIO_ACTIVE_LOW>;
+            vdd-supply = <&vcc_5v>;
+        };
+    };
--

2.42.0

#4 lore raw
Quoted 53 lines · Anand Moon

Hi Conor,

Quoted 37 lines · Conor Dooley
Quoted 3 lines · Anand Moon

Add the binding example for the USB3.1 Genesys Logic GL3523 integrates with USB 3.1 Gen 1 Super Speed and USB 2.0 High-Speed hub.

But no comment in the commit message about the new property for the "peer hub". $subject saying "dt-bindings: usb: Add the binding example for the Genesys Logic GL3523 hub" is misleading when the meaningful parts of the patch are unrelated to the example.

Quoted 26 lines

---
V3: fix the dt_binding_check error, added new example for Genesys GL3523
v2: added Genesys GL3523 binding
v1: none

---
 .../bindings/usb/genesys,gl850g.yaml          | 63 +++++++++++++++++--
 1 file changed, 59 insertions(+), 4 deletions(-)
Documentation/devicetree/bindings/usb/genesys,gl850g.yaml +0 -3
index ee08b9c3721f..f8e88477fa11 100644
@@ -9,9 +9,6 @@ title: Genesys Logic USB hub controller
 maintainers:
   - Icenowy Zheng <[email protected]>
 
-allOf:
-  - $ref: usb-device.yaml#
-
 properties:
   compatible:
     enum:
@@ -27,12 +24,44 @@ properties:
 
Quoted 13 lines

Documentation/devicetree/bindings/usb/genesys,gl850g.yaml properties: · line 32

Quoted 9 lines
Documentation/devicetree/bindings/usb/genesys,gl850g.yaml +6 -1
   vdd-supply:
     description:
-      the regulator that provides 3.3V core power to the hub.
+      phandle to the regulator that provides power to the hub.
+
+  peer-hub:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description:
+      phandle to the peer hub on the controller.

What is this, why is it needed? Please explain it in your commit message.

Quoted 6 lines

Ok, GL3523 integrates Genesys Logic self-developed USB 3.1 Gen 1 Super Speed transmitter/receiver physical layer (PHY) and USB 2.0 High-Speed PHY

peer-hub is used to cross-connect those phy nodes so that it can help hub power on/off simultaneously.

I said please explain it in your commit message, but on reflection I think that would be insufficient. Extending the description to explain what the peer-hub is would be great too. "peer hub on the controller" doesn't seem to make sense to me either, as the peer hub phandle is to another phy, not to the controller. I think that would probably also be resolved by explaining what the peer hub is in a more detailed manner.

If this is purely a genesys thing, the property should grow a genesys, prefix also.

Cheers,
Conor.

author
#5 lore raw

Hi Conor,

Quoted 69 lines · Conor Dooley
Quoted 53 lines · Anand Moon

Hi Conor,

Quoted 37 lines · Conor Dooley
Quoted 3 lines · Anand Moon

Add the binding example for the USB3.1 Genesys Logic GL3523 integrates with USB 3.1 Gen 1 Super Speed and USB 2.0 High-Speed hub.

But no comment in the commit message about the new property for the "peer hub". $subject saying "dt-bindings: usb: Add the binding example for the Genesys Logic GL3523 hub" is misleading when the meaningful parts of the patch are unrelated to the example.

Quoted 26 lines

---
V3: fix the dt_binding_check error, added new example for Genesys GL3523
v2: added Genesys GL3523 binding
v1: none

---
 .../bindings/usb/genesys,gl850g.yaml          | 63 +++++++++++++++++--
 1 file changed, 59 insertions(+), 4 deletions(-)
Documentation/devicetree/bindings/usb/genesys,gl850g.yaml +0 -3
index ee08b9c3721f..f8e88477fa11 100644
@@ -9,9 +9,6 @@ title: Genesys Logic USB hub controller
 maintainers:
   - Icenowy Zheng <[email protected]>
 
-allOf:
-  - $ref: usb-device.yaml#
-
 properties:
   compatible:
     enum:
@@ -27,12 +24,44 @@ properties:
 
Quoted 13 lines

Documentation/devicetree/bindings/usb/genesys,gl850g.yaml properties: · line 32

Quoted 9 lines
Documentation/devicetree/bindings/usb/genesys,gl850g.yaml +6 -1
   vdd-supply:
     description:
-      the regulator that provides 3.3V core power to the hub.
+      phandle to the regulator that provides power to the hub.
+
+  peer-hub:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description:
+      phandle to the peer hub on the controller.

What is this, why is it needed? Please explain it in your commit message.

Quoted 6 lines

Ok, GL3523 integrates Genesys Logic self-developed USB 3.1 Gen 1 Super Speed transmitter/receiver physical layer (PHY) and USB 2.0 High-Speed PHY

peer-hub is used to cross-connect those phy nodes so that it can help hub power on/off simultaneously.

I said please explain it in your commit message, but on reflection I think that would be insufficient. Extending the description to explain what the peer-hub is would be great too. "peer hub on the controller" doesn't seem to make sense to me either, as the peer hub phandle is to another phy, not to the controller. I think that would probably also be resolved by explaining what the peer hub is in a more detailed manner.

Quoted 3 lines

If this is purely a genesys thing, the property should grow a genesys, prefix also.

No, some USB Hub have combined phy for USB 3.x and USB 2.0 and have common reset-gpios and power supply, peer-hub node helps connect the USB controller and bring up the USB hub.

I was waiting for more feedback on these changes.
Once it's ok I will update with proper the commit message in v4.

Thanks
-Anand

Quoted 2 lines

Cheers,
Conor.

#6 lore raw
Quoted 36 lines · Anand Moon
Quoted 35 lines · Conor Dooley
Quoted 20 lines · Anand Moon
Quoted 11 lines · Conor Dooley
Quoted 3 lines · Anand Moon

Add the binding example for the USB3.1 Genesys Logic GL3523 integrates with USB 3.1 Gen 1 Super Speed and USB 2.0 High-Speed hub.

But no comment in the commit message about the new property for the "peer hub". $subject saying "dt-bindings: usb: Add the binding example for the Genesys Logic GL3523 hub" is misleading when the meaningful parts of the patch are unrelated to the example.

Quoted 8 lines

Documentation/devicetree/bindings/usb/genesys,gl850g.yaml properties: · line 32

Quoted 4 lines
Documentation/devicetree/bindings/usb/genesys,gl850g.yaml +4 -0
+  peer-hub:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description:
+      phandle to the peer hub on the controller.

What is this, why is it needed? Please explain it in your commit message.

Quoted 6 lines

Ok, GL3523 integrates Genesys Logic self-developed USB 3.1 Gen 1 Super Speed transmitter/receiver physical layer (PHY) and USB 2.0 High-Speed PHY

peer-hub is used to cross-connect those phy nodes so that it can help hub power on/off simultaneously.

I said please explain it in your commit message, but on reflection I think that would be insufficient. Extending the description to explain what the peer-hub is would be great too. "peer hub on the controller" doesn't seem to make sense to me either, as the peer hub phandle is to another phy, not to the controller. I think that would probably also be resolved by explaining what the peer hub is in a more detailed manner.

Quoted 6 lines
Quoted 3 lines

If this is purely a genesys thing, the property should grow a genesys, prefix also.

No, some USB Hub have combined phy for USB 3.x and USB 2.0 and have common reset-gpios and power supply, peer-hub node helps connect the USB controller and bring up the USB hub.

I don't know what this is a response to.

Quoted 2 lines

I was waiting for more feedback on these changes.
Once it's ok I will update with proper the commit message in v4.

And the property description too, so that a reader can understand how to implement it.

Cheers,
Conor.

author
#7 lore raw

Hi Conor

Quoted 38 lines · Conor Dooley
Quoted 36 lines · Anand Moon
Quoted 35 lines · Conor Dooley
Quoted 20 lines · Anand Moon
Quoted 11 lines · Conor Dooley
Quoted 3 lines · Anand Moon

Add the binding example for the USB3.1 Genesys Logic GL3523 integrates with USB 3.1 Gen 1 Super Speed and USB 2.0 High-Speed hub.

But no comment in the commit message about the new property for the "peer hub". $subject saying "dt-bindings: usb: Add the binding example for the Genesys Logic GL3523 hub" is misleading when the meaningful parts of the patch are unrelated to the example.

Quoted 8 lines

Documentation/devicetree/bindings/usb/genesys,gl850g.yaml properties: · line 32

Quoted 4 lines
Documentation/devicetree/bindings/usb/genesys,gl850g.yaml +4 -0
+  peer-hub:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description:
+      phandle to the peer hub on the controller.

What is this, why is it needed? Please explain it in your commit message.

Quoted 6 lines

Ok, GL3523 integrates Genesys Logic self-developed USB 3.1 Gen 1 Super Speed transmitter/receiver physical layer (PHY) and USB 2.0 High-Speed PHY

peer-hub is used to cross-connect those phy nodes so that it can help hub power on/off simultaneously.

I said please explain it in your commit message, but on reflection I think that would be insufficient. Extending the description to explain what the peer-hub is would be great too. "peer hub on the controller" doesn't seem to make sense to me either, as the peer hub phandle is to another phy, not to the controller. I think that would probably also be resolved by explaining what the peer hub is in a more detailed manner.

Quoted 9 lines
Quoted 6 lines
Quoted 3 lines

If this is purely a genesys thing, the property should grow a genesys, prefix also.

No, some USB Hub have combined phy for USB 3.x and USB 2.0 and have common reset-gpios and power supply, peer-hub node helps connect the USB controller and bring up the USB hub.

I don't know what this is a response to.

This was the response to your comment, it is a generic property "If this is purely a genesys thing, the property should grow a genesys,"

Please find the link to the schematic of the board which shares the details of the binding example. USB_HUB_GL3523.

https://dn.odroid.com/S922X/ODROID-N2/Schematic/odroid-n2_rev0.6_20210121.pdf

Quoted 5 lines
Quoted 2 lines

I was waiting for more feedback on these changes.
Once it's ok I will update with proper the commit message in v4.

And the property description too, so that a reader can understand how to implement it.

Yes, I will do that.

Quoted 3 lines

Cheers,
Conor.

Thanks
-Anand

author
#8 lore raw

PATCH v3 2/2 arm64: dts: amlogic: Used onboard usb hub reset on odroid n2

In reply to a message not in the archive

On Odroid n2/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.

---
v3: none
v2: none
v1: none

---
 .../dts/amlogic/meson-g12b-odroid-n2.dtsi     | 36 ++++++++++++-------
 1 file changed, 24 insertions(+), 12 deletions(-)
arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi +24 -12
index 91c9769fda20..9e671444eca6 100644
@@ -31,6 +31,30 @@ hub_5v: regulator-hub_5v {
 		enable-active-high;
 	};
 
+	/* USB hub supports both USB 2.0 and USB 3.0 root hub */
+	usb-hub {
+		dr_mode = "host";
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		/* 2.0 hub on port 1 */
+		hub_2_0: hub@1 {
+			compatible = "usb5e3,610";
+			reg = <1>;
+			peer-hub = <&hub_3_0>;
+			vdd-supply = <&usb_pwr_en>;
+		};
+
+		/* 3.0 hub on port 4 */
+		hub_3_0: hub@2 {
+			compatible = "usb5e3,620";
+			reg = <2>;
+			peer-hub = <&hub_2_0>;
+			reset-gpios = <&gpio GPIOH_4 GPIO_ACTIVE_LOW>;
+			vdd-supply = <&vcc_5v>;
+		};
+	};
+
 	sound {
 		compatible = "amlogic,axg-sound-card";
 		model = "ODROID-N2";
@@ -234,18 +258,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.
-	 */
-	usb-hub-hog {
-		gpio-hog;
-		gpios = <GPIOH_4 GPIO_ACTIVE_HIGH>;
-		output-high;
-		line-name = "usb-hub-reset";
-	};
 };
 
 &i2c3 {
Signature · 1 line
2.42.0