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@xxxxxxxxxx> --- 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>; + 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>; }; -- 2.46.0