[PATCH v2] arm64: dts: qcom: monaco-evk: Enable primary USB controller in host mode

Swati Agarwal posted 1 patch 1 month, 2 weeks ago
.../boot/dts/qcom/monaco-evk-common.dtsi      | 166 +++++++++++++++++-
1 file changed, 165 insertions(+), 1 deletion(-)
[PATCH v2] arm64: dts: qcom: monaco-evk: Enable primary USB controller in host mode
Posted by Swati Agarwal 1 month, 2 weeks ago
Enable primary USB controller in host mode on monaco EVK Platform.

Primary USB controller is connected to a Genesys Logic USB HUB GL3590
having 4 ports. The ports of hub that are present on lemans EVK standalone
board are used as follows:-
1) port-1 is connected to HD3SS3220 Type-C port controller.
2) port-4 is used for the M.2 E key on corekit. Standard core kit uses UART
for Bluetooth. This port is to be used only if user optionally replaces the
WiFi card with the NFA765 chip which uses USB for Bluetooth.

Remaining 2 ports will become functional when the interface plus mezzanine
board is stacked on top of corekit:

3) port-2 is connected to another hub which is present on the mezz through
which 4 type-A ports are connected.
4) port-3 is used for the M.2 B key for a 5G card when the mezz is
connected.

Primary USB Controller
          ↓
GL3590 USB Hub (4 ports)
    |
    |-- Port 1 → HD3SS3220 Type‑C Port Controller → USB‑C Connector
    |
    |-- Port 2 → Mezzanine USB Hub (when mezz attached)
    |
    |-- Port 3 → M.2 B‑Key Slot (when mezz attached)
    |
    |-- Port 4 → M.2 E‑Key Slot
                         (Default: BT via UART;
                          USB only if NFA765 module is installed)

Mark the primary USB controller as host only capable and add the HD3SS3220
Type-C port controller along with Type-c connector for controlling vbus
supply.

In hardware, DIP switches are present to select between USB0 and USB1 ports
for the primary Type‑C USB controller. By default, the switches are in
the OFF state, selecting the USB0 port. Add software support for both HS
and SS switches to eliminate the need for manually changing the DIP switch
position for USB1 operation. Add a USB1 hub reset pin to reset and activate
the hub after boot, ensuring proper detection from its pre‑boot inactive
state.

Signed-off-by: Swati Agarwal <swati.agarwal@oss.qualcomm.com>
---
Changes in v2:
Split DT binding and DT patch.
Use gpio hog instead of pinctrl for usb hub reset and HS switch sel.

Link to v1:
https://lore.kernel.org/all/20260417152014.3000797-1-swati.agarwal@oss.qualcomm.com/

This patch depends on:
https://lore.kernel.org/all/20260427170505.1494703-1-umang.chheda@oss.qualcomm.com/
---
 .../boot/dts/qcom/monaco-evk-common.dtsi      | 166 +++++++++++++++++-
 1 file changed, 165 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/monaco-evk-common.dtsi b/arch/arm64/boot/dts/qcom/monaco-evk-common.dtsi
index 12c847c03757..2d4ef8666822 100644
--- a/arch/arm64/boot/dts/qcom/monaco-evk-common.dtsi
+++ b/arch/arm64/boot/dts/qcom/monaco-evk-common.dtsi
@@ -23,6 +23,37 @@ chosen {
 		stdout-path = "serial0:115200n8";
 	};
 
+	connector-1 {
+		compatible = "usb-c-connector";
+		label = "USB1-Type-C";
+		data-role = "host";
+		power-role = "source";
+
+		vbus-supply = <&usb1_vbus>;
+
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			port@0 {
+				reg = <0>;
+
+				usb1_con_hs_ep: endpoint {
+					remote-endpoint = <&usb_hub_2_1>;
+				};
+			};
+
+			port@1 {
+				reg = <1>;
+
+				usb1_con_ss_ep: endpoint {
+					remote-endpoint = <&hd3ss3220_1_in_ep>;
+				};
+
+			};
+		};
+	};
+
 	connector-2 {
 		compatible = "gpio-usb-b-connector", "usb-b-connector";
 		label = "micro-USB";
@@ -77,6 +108,15 @@ dp1_connector_in: endpoint {
 		};
 	};
 
+	usb1_vbus: regulator-usb1-vbus {
+		compatible = "regulator-fixed";
+		regulator-name = "usb1_vbus";
+		gpio = <&expander1 3 GPIO_ACTIVE_HIGH>;
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		enable-active-high;
+	};
+
 	usb2_vbus: regulator-usb2-vbus {
 		compatible = "regulator-fixed";
 		regulator-name = "usb2_vbus";
@@ -445,6 +485,39 @@ lt8713sx_dp1_out: endpoint {
 			};
 		};
 	};
+
+	usb-typec@47 {
+		compatible = "ti,hd3ss3220";
+		reg = <0x47>;
+
+		interrupts-extended = <&tlmm 45 IRQ_TYPE_EDGE_FALLING>;
+
+		id-gpios = <&tlmm 13 GPIO_ACTIVE_HIGH>;
+
+		pinctrl-0 = <&usb1_id>, <&usb1_intr>;
+		pinctrl-names = "default";
+
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			port@0 {
+				reg = <0>;
+
+				hd3ss3220_1_in_ep: endpoint {
+					remote-endpoint = <&usb1_con_ss_ep>;
+				};
+			};
+
+			port@1 {
+				reg = <1>;
+
+				hd3ss3220_1_out_ep: endpoint {
+					remote-endpoint = <&usb_hub_3_1>;
+				};
+			};
+		};
+	};
 };
 
 &i2c1 {
@@ -556,6 +629,12 @@ expander5: gpio@3d {
 		interrupts-extended = <&tlmm 3 IRQ_TYPE_LEVEL_LOW>;
 		pinctrl-0 = <&expander5_int>;
 		pinctrl-names = "default";
+
+		usb1_ss_sel_switch_hog: usb1-ss-sel-switch-hog {
+			gpio-hog;
+			gpios = <5 GPIO_ACTIVE_HIGH>;
+			output-high;
+		};
 	};
 
 	expander6: gpio@3e {
@@ -742,6 +821,24 @@ expander5_int: expander5-int-state {
 		bias-pull-up;
 	};
 
+	usb1_hub_reset_hog: usb1-hub-reset-hog {
+		gpio-hog;
+		gpios = <7 GPIO_ACTIVE_HIGH>;
+		output-high;
+	};
+
+	usb1_id: usb1-id-state {
+		pins = "gpio13";
+		function = "gpio";
+		bias-pull-up;
+	};
+
+	usb1_hs_sel_switch_hog: usb1-hs-sel-switch-hog {
+		gpio-hog;
+		gpios = <14 GPIO_ACTIVE_HIGH>;
+		output-high;
+	};
+
 	expander1_int: expander1-int-state {
 		pins = "gpio16";
 		function = "gpio";
@@ -784,6 +881,13 @@ expander3_int: expander3-int-state {
 		bias-pull-up;
 	};
 
+	usb1_intr: usb1-intr-state {
+		pins = "gpio45";
+		function = "gpio";
+		bias-pull-up;
+		drive-strength = <2>;
+	};
+
 	expander6_int:  expander6-int-state {
 		pins = "gpio52";
 		function = "gpio";
@@ -863,9 +967,69 @@ &ufs_mem_phy {
 };
 
 &usb_1 {
-	dr_mode = "peripheral";
+	dr_mode = "host";
+
+	#address-cells = <1>;
+	#size-cells = <0>;
 
 	status = "okay";
+
+	usb_hub_2_x: hub@1 {
+		compatible = "usb5e3,610";
+		reg = <1>;
+
+		peer-hub = <&usb_hub_3_x>;
+
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			port@1 {
+				reg = <1>;
+
+				usb_hub_2_1: endpoint {
+					remote-endpoint = <&usb1_con_hs_ep>;
+				};
+			};
+
+			/*
+			 * Port-4 is connected to M.2 E key connector on corekit.
+			 */
+			port@4 {
+				reg = <4>;
+
+				usb_hub_2_4: endpoint {
+				};
+			};
+		};
+	};
+
+	usb_hub_3_x: hub@2 {
+		compatible = "usb5e3,625";
+		reg = <2>;
+
+		peer-hub = <&usb_hub_2_x>;
+
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			port@1 {
+				reg = <1>;
+
+				usb_hub_3_1: endpoint {
+					remote-endpoint = <&hd3ss3220_1_out_ep>;
+				};
+			};
+
+			port@4 {
+				reg = <4>;
+
+				usb_hub_3_4: endpoint {
+				};
+			};
+		};
+	};
 };
 
 &usb_1_hsphy {
-- 
2.34.1

Re: [PATCH v2] arm64: dts: qcom: monaco-evk: Enable primary USB controller in host mode
Posted by Swati Agarwal 1 month, 1 week ago
On Thu, Apr 30, 2026 at 7:50 PM Swati Agarwal
<swati.agarwal@oss.qualcomm.com> wrote:
>
> Enable primary USB controller in host mode on monaco EVK Platform.
>
> Primary USB controller is connected to a Genesys Logic USB HUB GL3590
> having 4 ports. The ports of hub that are present on lemans EVK standalone
> board are used as follows:-
> 1) port-1 is connected to HD3SS3220 Type-C port controller.
> 2) port-4 is used for the M.2 E key on corekit. Standard core kit uses UART
> for Bluetooth. This port is to be used only if user optionally replaces the
> WiFi card with the NFA765 chip which uses USB for Bluetooth.
>
> Remaining 2 ports will become functional when the interface plus mezzanine
> board is stacked on top of corekit:
>
> 3) port-2 is connected to another hub which is present on the mezz through
> which 4 type-A ports are connected.
> 4) port-3 is used for the M.2 B key for a 5G card when the mezz is
> connected.
>
> Primary USB Controller
>           ↓
> GL3590 USB Hub (4 ports)
>     |
>     |-- Port 1 → HD3SS3220 Type‑C Port Controller → USB‑C Connector
>     |
>     |-- Port 2 → Mezzanine USB Hub (when mezz attached)
>     |
>     |-- Port 3 → M.2 B‑Key Slot (when mezz attached)
>     |
>     |-- Port 4 → M.2 E‑Key Slot
>                          (Default: BT via UART;
>                           USB only if NFA765 module is installed)
>
> Mark the primary USB controller as host only capable and add the HD3SS3220
> Type-C port controller along with Type-c connector for controlling vbus
> supply.
>
> In hardware, DIP switches are present to select between USB0 and USB1 ports
> for the primary Type‑C USB controller. By default, the switches are in
> the OFF state, selecting the USB0 port. Add software support for both HS
> and SS switches to eliminate the need for manually changing the DIP switch
> position for USB1 operation. Add a USB1 hub reset pin to reset and activate
> the hub after boot, ensuring proper detection from its pre‑boot inactive
> state.
>
> Signed-off-by: Swati Agarwal <swati.agarwal@oss.qualcomm.com>
> ---
> Changes in v2:
> Split DT binding and DT patch.
> Use gpio hog instead of pinctrl for usb hub reset and HS switch sel.
Link to binding patch :-
https://lore.kernel.org/all/20260504064936.2754570-1-swati.agarwal@oss.qualcomm.com/

Regards,
Swati
>
> Link to v1:
> https://lore.kernel.org/all/20260417152014.3000797-1-swati.agarwal@oss.qualcomm.com/
>
> This patch depends on:
> https://lore.kernel.org/all/20260427170505.1494703-1-umang.chheda@oss.qualcomm.com/
> ---
>  .../boot/dts/qcom/monaco-evk-common.dtsi      | 166 +++++++++++++++++-
>  1 file changed, 165 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm64/boot/dts/qcom/monaco-evk-common.dtsi b/arch/arm64/boot/dts/qcom/monaco-evk-common.dtsi
> index 12c847c03757..2d4ef8666822 100644
> --- a/arch/arm64/boot/dts/qcom/monaco-evk-common.dtsi
> +++ b/arch/arm64/boot/dts/qcom/monaco-evk-common.dtsi
> @@ -23,6 +23,37 @@ chosen {
>                 stdout-path = "serial0:115200n8";
>         };
>
> +       connector-1 {
> +               compatible = "usb-c-connector";
> +               label = "USB1-Type-C";
> +               data-role = "host";
> +               power-role = "source";
> +
> +               vbus-supply = <&usb1_vbus>;
> +
> +               ports {
> +                       #address-cells = <1>;
> +                       #size-cells = <0>;
> +
> +                       port@0 {
> +                               reg = <0>;
> +
> +                               usb1_con_hs_ep: endpoint {
> +                                       remote-endpoint = <&usb_hub_2_1>;
> +                               };
> +                       };
> +
> +                       port@1 {
> +                               reg = <1>;
> +
> +                               usb1_con_ss_ep: endpoint {
> +                                       remote-endpoint = <&hd3ss3220_1_in_ep>;
> +                               };
> +
> +                       };
> +               };
> +       };
> +
>         connector-2 {
>                 compatible = "gpio-usb-b-connector", "usb-b-connector";
>                 label = "micro-USB";
> @@ -77,6 +108,15 @@ dp1_connector_in: endpoint {
>                 };
>         };
>
> +       usb1_vbus: regulator-usb1-vbus {
> +               compatible = "regulator-fixed";
> +               regulator-name = "usb1_vbus";
> +               gpio = <&expander1 3 GPIO_ACTIVE_HIGH>;
> +               regulator-min-microvolt = <5000000>;
> +               regulator-max-microvolt = <5000000>;
> +               enable-active-high;
> +       };
> +
>         usb2_vbus: regulator-usb2-vbus {
>                 compatible = "regulator-fixed";
>                 regulator-name = "usb2_vbus";
> @@ -445,6 +485,39 @@ lt8713sx_dp1_out: endpoint {
>                         };
>                 };
>         };
> +
> +       usb-typec@47 {
> +               compatible = "ti,hd3ss3220";
> +               reg = <0x47>;
> +
> +               interrupts-extended = <&tlmm 45 IRQ_TYPE_EDGE_FALLING>;
> +
> +               id-gpios = <&tlmm 13 GPIO_ACTIVE_HIGH>;
> +
> +               pinctrl-0 = <&usb1_id>, <&usb1_intr>;
> +               pinctrl-names = "default";
> +
> +               ports {
> +                       #address-cells = <1>;
> +                       #size-cells = <0>;
> +
> +                       port@0 {
> +                               reg = <0>;
> +
> +                               hd3ss3220_1_in_ep: endpoint {
> +                                       remote-endpoint = <&usb1_con_ss_ep>;
> +                               };
> +                       };
> +
> +                       port@1 {
> +                               reg = <1>;
> +
> +                               hd3ss3220_1_out_ep: endpoint {
> +                                       remote-endpoint = <&usb_hub_3_1>;
> +                               };
> +                       };
> +               };
> +       };
>  };
>
>  &i2c1 {
> @@ -556,6 +629,12 @@ expander5: gpio@3d {
>                 interrupts-extended = <&tlmm 3 IRQ_TYPE_LEVEL_LOW>;
>                 pinctrl-0 = <&expander5_int>;
>                 pinctrl-names = "default";
> +
> +               usb1_ss_sel_switch_hog: usb1-ss-sel-switch-hog {
> +                       gpio-hog;
> +                       gpios = <5 GPIO_ACTIVE_HIGH>;
> +                       output-high;
> +               };
>         };
>
>         expander6: gpio@3e {
> @@ -742,6 +821,24 @@ expander5_int: expander5-int-state {
>                 bias-pull-up;
>         };
>
> +       usb1_hub_reset_hog: usb1-hub-reset-hog {
> +               gpio-hog;
> +               gpios = <7 GPIO_ACTIVE_HIGH>;
> +               output-high;
> +       };
> +
> +       usb1_id: usb1-id-state {
> +               pins = "gpio13";
> +               function = "gpio";
> +               bias-pull-up;
> +       };
> +
> +       usb1_hs_sel_switch_hog: usb1-hs-sel-switch-hog {
> +               gpio-hog;
> +               gpios = <14 GPIO_ACTIVE_HIGH>;
> +               output-high;
> +       };
> +
>         expander1_int: expander1-int-state {
>                 pins = "gpio16";
>                 function = "gpio";
> @@ -784,6 +881,13 @@ expander3_int: expander3-int-state {
>                 bias-pull-up;
>         };
>
> +       usb1_intr: usb1-intr-state {
> +               pins = "gpio45";
> +               function = "gpio";
> +               bias-pull-up;
> +               drive-strength = <2>;
> +       };
> +
>         expander6_int:  expander6-int-state {
>                 pins = "gpio52";
>                 function = "gpio";
> @@ -863,9 +967,69 @@ &ufs_mem_phy {
>  };
>
>  &usb_1 {
> -       dr_mode = "peripheral";
> +       dr_mode = "host";
> +
> +       #address-cells = <1>;
> +       #size-cells = <0>;
>
>         status = "okay";
> +
> +       usb_hub_2_x: hub@1 {
> +               compatible = "usb5e3,610";
> +               reg = <1>;
> +
> +               peer-hub = <&usb_hub_3_x>;
> +
> +               ports {
> +                       #address-cells = <1>;
> +                       #size-cells = <0>;
> +
> +                       port@1 {
> +                               reg = <1>;
> +
> +                               usb_hub_2_1: endpoint {
> +                                       remote-endpoint = <&usb1_con_hs_ep>;
> +                               };
> +                       };
> +
> +                       /*
> +                        * Port-4 is connected to M.2 E key connector on corekit.
> +                        */
> +                       port@4 {
> +                               reg = <4>;
> +
> +                               usb_hub_2_4: endpoint {
> +                               };
> +                       };
> +               };
> +       };
> +
> +       usb_hub_3_x: hub@2 {
> +               compatible = "usb5e3,625";
> +               reg = <2>;
> +
> +               peer-hub = <&usb_hub_2_x>;
> +
> +               ports {
> +                       #address-cells = <1>;
> +                       #size-cells = <0>;
> +
> +                       port@1 {
> +                               reg = <1>;
> +
> +                               usb_hub_3_1: endpoint {
> +                                       remote-endpoint = <&hd3ss3220_1_out_ep>;
> +                               };
> +                       };
> +
> +                       port@4 {
> +                               reg = <4>;
> +
> +                               usb_hub_3_4: endpoint {
> +                               };
> +                       };
> +               };
> +       };
>  };
>
>  &usb_1_hsphy {
> --
> 2.34.1
>