Skip to contentSkip to conversation

usb: misc: onboard-hub: add support for Microchip USB5744

PATCH In review Francesco Dolcini 4 participants 8 messages Nov 13, 2023 – Nov 15, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover usb: misc: onboard-hub: add support for Microchip USB5744

From: Francesco Dolcini <[email protected]>

Add support for the Microchip USB5744 USB3.0 and USB2.0 Hub.

Stefan Eichenberger (2):
dt-bindings: usb: microchip,usb5744: Add second supply
usb: misc: onboard-hub: add support for Microchip USB5744

 .../devicetree/bindings/usb/microchip,usb5744.yaml         | 7 ++++++-
 drivers/usb/misc/onboard_usb_hub.c                         | 2 ++
 drivers/usb/misc/onboard_usb_hub.h                         | 7 +++++++
 3 files changed, 15 insertions(+), 1 deletion(-)
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/2 dt-bindings: usb: microchip,usb5744: Add second supply

From: Stefan Eichenberger <[email protected]>

The USB5744 has two power supplies one for 3V3 and one for 1V2. Add the second supply to the USB5744 DT binding.

---
 .../devicetree/bindings/usb/microchip,usb5744.yaml         | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/usb/microchip,usb5744.yaml +6 -1
index ff3a1707ef57..6d4cfd943f58 100644
@@ -36,7 +36,11 @@ properties:
 
   vdd-supply:
     description:
-      VDD power supply to the hub
+      3V3 power supply to the hub
+
+  vdd2-supply:
+    description:
+      1V2 power supply to the hub
 
   peer-hub:
     $ref: /schemas/types.yaml#/definitions/phandle
@@ -62,6 +66,7 @@ allOf:
       properties:
         reset-gpios: false
         vdd-supply: false
+        vdd2-supply: false
         peer-hub: false
         i2c-bus: false
     else:
Signature · 1 line
2.25.1
#2 lore raw

Re: [PATCH v1 1/2] dt-bindings: usb: microchip,usb5744: Add second supply

Quoted 16 lines · Francesco Dolcini

From: Stefan Eichenberger <[email protected]>

The USB5744 has two power supplies one for 3V3 and one for 1V2. Add the second supply to the USB5744 DT binding.

---
 .../devicetree/bindings/usb/microchip,usb5744.yaml         | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/usb/microchip,usb5744.yaml +0 -0
index ff3a1707ef57..6d4cfd943f58 100644

Documentation/devicetree/bindings/usb/microchip,usb5744.yaml properties: · line 43

Quoted 9 lines
Documentation/devicetree/bindings/usb/microchip,usb5744.yaml +5 -1
@@ -36,7 +36,11 @@ properties:
 
   vdd-supply:
     description:
-      VDD power supply to the hub
+      3V3 power supply to the hub
+
+  vdd2-supply:
+    description:
+      1V2 power supply to the hub

How about v1p2-supply?

Quoted 14 lines
Documentation/devicetree/bindings/usb/microchip,usb5744.yaml +1 -0
   peer-hub:
     $ref: /schemas/types.yaml#/definitions/phandle
@@ -62,6 +66,7 @@ allOf:
       properties:
         reset-gpios: false
         vdd-supply: false
+        vdd2-supply: false
         peer-hub: false
         i2c-bus: false
     else:
Signature · 1 line
2.25.1
#3 lore raw

Re: [PATCH v1 1/2] dt-bindings: usb: microchip,usb5744: Add second supply

Hello Conor,
thanks for the review.

Quoted 18 lines · Conor Dooley
Quoted 17 lines · Francesco Dolcini

From: Stefan Eichenberger <[email protected]>

The USB5744 has two power supplies one for 3V3 and one for 1V2. Add the second supply to the USB5744 DT binding.

---
 .../devicetree/bindings/usb/microchip,usb5744.yaml         | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/usb/microchip,usb5744.yaml +0 -0
index ff3a1707ef57..6d4cfd943f58 100644
@@ -36,7 +36,11 @@ properties:
 
Quoted 10 lines

Documentation/devicetree/bindings/usb/microchip,usb5744.yaml properties: · line 43

Quoted 8 lines
Documentation/devicetree/bindings/usb/microchip,usb5744.yaml +5 -1
   vdd-supply:
     description:
-      VDD power supply to the hub
+      3V3 power supply to the hub
+
+  vdd2-supply:
+    description:
+      1V2 power supply to the hub

How about v1p2-supply?

The reason for vdd2 is this

/*
* Use generic names, as the actual names might differ between hubs. If a new
* hub requires more than the currently supported supplies, add a new one here. */

static const char * const supply_names[] = {
	"vdd",
	"vdd2",
};

from drivers/usb/misc/onboard_usb_hub.c.

Francesco

Acked-by
#4 lore raw

Re: [PATCH v1 1/2] dt-bindings: usb: microchip,usb5744: Add second supply

Quoted 33 lines · Francesco Dolcini

Hello Conor,
thanks for the review.

Quoted 18 lines · Conor Dooley
Quoted 17 lines · Francesco Dolcini

From: Stefan Eichenberger <[email protected]>

The USB5744 has two power supplies one for 3V3 and one for 1V2. Add the second supply to the USB5744 DT binding.

---
 .../devicetree/bindings/usb/microchip,usb5744.yaml         | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/usb/microchip,usb5744.yaml +0 -0
index ff3a1707ef57..6d4cfd943f58 100644
@@ -36,7 +36,11 @@ properties:
 
Quoted 10 lines

Documentation/devicetree/bindings/usb/microchip,usb5744.yaml properties: · line 43

Quoted 8 lines
Documentation/devicetree/bindings/usb/microchip,usb5744.yaml +5 -1
   vdd-supply:
     description:
-      VDD power supply to the hub
+      3V3 power supply to the hub
+
+  vdd2-supply:
+    description:
+      1V2 power supply to the hub

How about v1p2-supply?

Quoted 1 line

The reason for vdd2 is this

I see.

Cheers,
Conor.

#5 lore raw

PATCH 2/2 usb: misc: onboard-hub: add support for Microchip USB5744

In reply to Francesco Dolcini

From: Stefan Eichenberger <[email protected]>

Add support for the Microchip USB5744 USB3.0 and USB2.0 Hub.

The Microchip USB5744 supports two power supplies, one for 1V2 and one for 3V3. According to the datasheet there is no need for a delay between power on and reset, so this value is set to 0.

---
 drivers/usb/misc/onboard_usb_hub.c | 2 ++
 drivers/usb/misc/onboard_usb_hub.h | 7 +++++++
 2 files changed, 9 insertions(+)
drivers/usb/misc/onboard_usb_hub.c +2 -0
index a341b2fbb7b4..2b45404e9732 100644
@@ -432,6 +432,8 @@ static const struct usb_device_id onboard_hub_id_table[] = {
 	{ USB_DEVICE(VENDOR_ID_MICROCHIP, 0x2412) }, /* USB2412 USB 2.0 */
 	{ USB_DEVICE(VENDOR_ID_MICROCHIP, 0x2514) }, /* USB2514B USB 2.0 */
 	{ USB_DEVICE(VENDOR_ID_MICROCHIP, 0x2517) }, /* USB2517 USB 2.0 */
+	{ USB_DEVICE(VENDOR_ID_MICROCHIP, 0x2744) }, /* USB5744 USB 2.0 */
+	{ USB_DEVICE(VENDOR_ID_MICROCHIP, 0x5744) }, /* USB5744 USB 3.0 */
 	{ USB_DEVICE(VENDOR_ID_REALTEK, 0x0411) }, /* RTS5411 USB 3.1 */
 	{ USB_DEVICE(VENDOR_ID_REALTEK, 0x5411) }, /* RTS5411 USB 2.1 */
 	{ USB_DEVICE(VENDOR_ID_REALTEK, 0x0414) }, /* RTS5414 USB 3.2 */
drivers/usb/misc/onboard_usb_hub.h +7 -0
index c4e24a7b9290..292110e64a1d 100644
@@ -16,6 +16,11 @@ static const struct onboard_hub_pdata microchip_usb424_data = {
 	.num_supplies = 1,
 };
 
+static const struct onboard_hub_pdata microchip_usb5744_data = {
+	.reset_us = 0,
+	.num_supplies = 2,
+};
+
 static const struct onboard_hub_pdata realtek_rts5411_data = {
 	.reset_us = 0,
 	.num_supplies = 1,
@@ -50,6 +55,8 @@ static const struct of_device_id onboard_hub_match[] = {
 	{ .compatible = "usb424,2412", .data = &microchip_usb424_data, },
 	{ .compatible = "usb424,2514", .data = &microchip_usb424_data, },
 	{ .compatible = "usb424,2517", .data = &microchip_usb424_data, },
+	{ .compatible = "usb424,2744", .data = &microchip_usb5744_data, },
+	{ .compatible = "usb424,5744", .data = &microchip_usb5744_data, },
 	{ .compatible = "usb451,8140", .data = &ti_tusb8041_data, },
 	{ .compatible = "usb451,8142", .data = &ti_tusb8041_data, },
 	{ .compatible = "usb4b4,6504", .data = &cypress_hx3_data, },
Signature · 1 line
2.25.1
#6 lore raw
Quoted 10 lines · Francesco Dolcini

From: Stefan Eichenberger <[email protected]>

Add support for the Microchip USB5744 USB3.0 and USB2.0 Hub.

The Microchip USB5744 supports two power supplies, one for 1V2 and one for 3V3. According to the datasheet there is no need for a delay between power on and reset, so this value is set to 0.

The patch is correct based on functionality you want to add. Would be good to also add support for initialization over i2c which will change couple of things.

Thanks,
Michal

Acked-by on v1 2/2
#7 lore raw
In reply to Francesco Dolcini
Quoted 10 lines · Francesco Dolcini

From: Stefan Eichenberger <[email protected]>

Add support for the Microchip USB5744 USB3.0 and USB2.0 Hub.

The Microchip USB5744 supports two power supplies, one for 1V2 and one for 3V3. According to the datasheet there is no need for a delay between power on and reset, so this value is set to 0.