diff mbox series

[3/3] arm64: dts: qcom: qcs6490-rb3gen2: describe secondary USB port

Message ID 20240904-b4-rb3gen2-usb2-v1-3-b858e681195e@linaro.org (mailing list archive)
State New
Headers show
Series arm64: dts: qcom: rb3gen2: add second USB port | expand

Commit Message

Caleb Connolly Sept. 4, 2024, 11:16 a.m. UTC
The secondary USB controller on the rb3gen2 is routed directly to a
mico-USB port where it can be used for EUD debugging or in OTG mode.

Configure the controller to prefer peripheral mode (as this is almost
always more useful) and describe the connector, vbus supply, and ID pin.

OTG/Host mode is untested as I don't have micro-USB OTG cables to hand.

Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
---
 arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts | 69 ++++++++++++++++++++++++++++
 1 file changed, 69 insertions(+)

Comments

Konrad Dybcio Sept. 5, 2024, 12:05 p.m. UTC | #1
On 4.09.2024 1:16 PM, Caleb Connolly wrote:
> The secondary USB controller on the rb3gen2 is routed directly to a
> mico-USB port where it can be used for EUD debugging or in OTG mode.
> 
> Configure the controller to prefer peripheral mode (as this is almost
> always more useful) and describe the connector, vbus supply, and ID pin.
> 
> OTG/Host mode is untested as I don't have micro-USB OTG cables to hand.
> 
> Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
> ---
>  arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts | 69 ++++++++++++++++++++++++++++
>  1 file changed, 69 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts b/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts
> index 513d5265bb13..fe66f589cb5b 100644
> --- a/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts
> +++ b/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts
> @@ -62,8 +62,30 @@ hdmi_con: endpoint {
>  			};
>  		};
>  	};
>  
> +	connector-usb2 {
> +		compatible = "gpio-usb-b-connector";
> +		vbus-gpio = <&pm7325_gpios 9 GPIO_ACTIVE_HIGH>;
> +		id-gpio = <&tlmm 61 GPIO_ACTIVE_HIGH>;

I don't think this is right, what's the revision of the board you have?

Konrad
Krzysztof Kozlowski Sept. 5, 2024, 12:11 p.m. UTC | #2
On 05/09/2024 14:05, Konrad Dybcio wrote:
> On 4.09.2024 1:16 PM, Caleb Connolly wrote:
>> The secondary USB controller on the rb3gen2 is routed directly to a
>> mico-USB port where it can be used for EUD debugging or in OTG mode.
>>
>> Configure the controller to prefer peripheral mode (as this is almost
>> always more useful) and describe the connector, vbus supply, and ID pin.
>>
>> OTG/Host mode is untested as I don't have micro-USB OTG cables to hand.
>>
>> Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
>> ---
>>  arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts | 69 ++++++++++++++++++++++++++++
>>  1 file changed, 69 insertions(+)
>>
>> diff --git a/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts b/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts
>> index 513d5265bb13..fe66f589cb5b 100644
>> --- a/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts
>> +++ b/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts
>> @@ -62,8 +62,30 @@ hdmi_con: endpoint {
>>  			};
>>  		};
>>  	};
>>  
>> +	connector-usb2 {
>> +		compatible = "gpio-usb-b-connector";
>> +		vbus-gpio = <&pm7325_gpios 9 GPIO_ACTIVE_HIGH>;
>> +		id-gpio = <&tlmm 61 GPIO_ACTIVE_HIGH>;
> 
> I don't think this is right, what's the revision of the board you have?

For sure any 'gpio' property is NAK and there is no way this passed
checks...

Best regards,
Krzysztof
Caleb Connolly Sept. 9, 2024, 11 a.m. UTC | #3
On 05/09/2024 14:11, Krzysztof Kozlowski wrote:
> On 05/09/2024 14:05, Konrad Dybcio wrote:
>> On 4.09.2024 1:16 PM, Caleb Connolly wrote:
>>> The secondary USB controller on the rb3gen2 is routed directly to a
>>> mico-USB port where it can be used for EUD debugging or in OTG mode.
>>>
>>> Configure the controller to prefer peripheral mode (as this is almost
>>> always more useful) and describe the connector, vbus supply, and ID pin.
>>>
>>> OTG/Host mode is untested as I don't have micro-USB OTG cables to hand.
>>>
>>> Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
>>> ---
>>>  arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts | 69 ++++++++++++++++++++++++++++
>>>  1 file changed, 69 insertions(+)
>>>
>>> diff --git a/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts b/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts
>>> index 513d5265bb13..fe66f589cb5b 100644
>>> --- a/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts
>>> +++ b/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts
>>> @@ -62,8 +62,30 @@ hdmi_con: endpoint {
>>>  			};
>>>  		};
>>>  	};
>>>  
>>> +	connector-usb2 {
>>> +		compatible = "gpio-usb-b-connector";
>>> +		vbus-gpio = <&pm7325_gpios 9 GPIO_ACTIVE_HIGH>;
>>> +		id-gpio = <&tlmm 61 GPIO_ACTIVE_HIGH>;
>>
>> I don't think this is right, what's the revision of the board you have?

Still don't have schematics, this is based on downstream Qualcomm Linux.
> 
> For sure any 'gpio' property is NAK and there is no way this passed
> checks...

ahh, gpios not gpio right?

sorry, should have caught this.
> 
> Best regards,
> Krzysztof
>
Krzysztof Kozlowski Sept. 9, 2024, 4:54 p.m. UTC | #4
On 09/09/2024 13:00, Caleb Connolly wrote:
>>>>  
>>>> +	connector-usb2 {
>>>> +		compatible = "gpio-usb-b-connector";
>>>> +		vbus-gpio = <&pm7325_gpios 9 GPIO_ACTIVE_HIGH>;
>>>> +		id-gpio = <&tlmm 61 GPIO_ACTIVE_HIGH>;
>>>
>>> I don't think this is right, what's the revision of the board you have?
> 
> Still don't have schematics, this is based on downstream Qualcomm Linux.
>>
>> For sure any 'gpio' property is NAK and there is no way this passed
>> checks...
> 
> ahh, gpios not gpio right?

Yes.

> 
> sorry, should have caught this.

dtbs_check :)

Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts b/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts
index 513d5265bb13..fe66f589cb5b 100644
--- a/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts
+++ b/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts
@@ -62,8 +62,30 @@  hdmi_con: endpoint {
 			};
 		};
 	};
 
+	connector-usb2 {
+		compatible = "gpio-usb-b-connector";
+		vbus-gpio = <&pm7325_gpios 9 GPIO_ACTIVE_HIGH>;
+		id-gpio = <&tlmm 61 GPIO_ACTIVE_HIGH>;
+		vbus-supply = <&vbus_usb2>;
+
+		pinctrl-names = "default";
+		pinctrl-0 = <&usb2_vbus_detect_pin>,
+			     <&usb2_id_detect_pin>;
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			port@0 {
+				reg = <0>;
+				usb2_port_connector: endpoint {
+					remote-endpoint = <&usb_2_dwc3_hs>;
+				};
+			};
+		};
+	};
+
 	lt9611_1v2: lt9611-vdd12-regulator {
 		compatible = "regulator-fixed";
 		regulator-name = "LT9611_1V2";
 
@@ -195,8 +217,18 @@  pmic_glink_sbu_in: endpoint {
 			};
 		};
 	};
 
+	vbus_usb2: regulator-usb2-vbus {
+		compatible = "regulator-fixed";
+		regulator-name = "vbus_supply";
+		gpio = <&tlmm 63 GPIO_ACTIVE_HIGH>;
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		regulator-boot-on;
+		enable-active-high;
+	};
+
 	vph_pwr: regulator-vph-pwr {
 		compatible = "regulator-fixed";
 		regulator-name = "vph_pwr";
 		regulator-min-microvolt = <3700000>;
@@ -683,8 +715,18 @@  &mdss_edp_out {
 &mdss_edp_phy {
 	status = "okay";
 };
 
+&pm7325_gpios {
+	usb2_vbus_detect_pin: usb2-vbus-detect-state {
+		pins = "gpio9";
+		function = "normal";
+		bias-pull-down;
+		input-enable;
+		power-source = <0>;
+	};
+};
+
 &pmk8350_rtc {
 	status = "okay";
 };
 
@@ -718,8 +760,15 @@  &remoteproc_wpss {
 
 &tlmm {
 	gpio-reserved-ranges = <32 2>, /* ADSP */
 			       <48 4>; /* NFC */
+
+	usb2_id_detect_pin: usb2-id-detect-state {
+		pins = "gpio61";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-pull-up;
+	};
 };
 
 &uart5 {
 	status = "okay";
@@ -758,8 +807,28 @@  &usb_1_qmpphy {
 
 	status = "okay";
 };
 
+&usb_2 {
+	status = "okay";
+};
+
+&usb_2_dwc3 {
+	role-switch-default-mode = "peripheral";
+};
+
+&usb_2_dwc3_hs {
+	remote-endpoint = <&usb2_port_connector>;
+};
+
+&usb_2_hsphy {
+	vdda-pll-supply = <&vreg_l10c_0p88>;
+	vdda18-supply = <&vreg_l1c_1p8>;
+	vdda33-supply = <&vreg_l2b_3p072>;
+
+	status = "okay";
+};
+
 &usb_dp_qmpphy_out {
 	remote-endpoint = <&redriver_phy_con_ss>;
 };