arm64: dts: qcom: talos-lyra-evk: Wire up CYPD6129 USB Type-C ports
v3 cover arm64: dts: qcom: talos-lyra-evk: Wire up CYPD6129 USB Type-C ports
From: Akash Kumar <[email protected]>
This series wires up the CYPD6129 UCSI PD controller on the Talos Lyra EVK carrier board, enabling USB Type-C role switching and SuperSpeed/HS muxing on both USB-C connectors.
v1 was posted as a single patch [1]. v2 [2] split the change in two and addressed review from Dmitry Baryshkov, but went out without a "v2" tag on the patch subjects (only the cover letter carried it), which caused confusion with v1. This v3 resends the same two patches, correctly tagged, with no code changes from v2:
- Drop the VBUS-boost regulator's resistor-divider math from the commit message; describe it as a plain fixed regulator instead.
- Replace the verbose HS-routing explanation with a short "/* HS only */" comment above &usb_2_dwc3_hs.
- Drop the redundant dr_mode = "otg" on usb_1/usb_2 (it is already the dwc3 driver's default).
- Move usb-role-switch out of the board file and into the shared talos.dtsi, as its own patch (patch 1) alongside the graph port placeholders it depends on.
[1] Link: https://lore.kernel.org/r/[email protected]
[2] Link: https://lore.kernel.org/r/[email protected]
Akash Kumar (2):
arm64: dts: qcom: talos: Add graph port placeholders for USB Type-C
muxing
arm64: dts: qcom: talos-lyra-evk: Wire up CYPD6129 USB Type-C ports
.../boot/dts/qcom/talos-lyra-evk-som.dtsi | 121 ++++++++++++++++++ arch/arm64/boot/dts/qcom/talos-lyra-evk.dts | 42 ++++-- arch/arm64/boot/dts/qcom/talos.dtsi | 35 +++++ 3 files changed, 187 insertions(+), 11 deletions(-)
Signature · 1 line
2.43.0
PATCH v3 1/2 arm64: dts: qcom: talos: Add graph port placeholders for USB Type-C muxing
From: Akash Kumar <[email protected]>
Add empty port/endpoint nodes on the primary USB QMP PHY (usb_qmpphy) and the usb_1/usb_2 dwc3 controllers, along with orientation-switch on the PHY. These placeholders let board files wire up a USB-C PD controller's HS/SS endpoints directly via
&label { remote-endpoint = <...>; }; instead of redeclaring the port/ports structure on the shared nodes.
--- arch/arm64/boot/dts/qcom/talos.dtsi | 35 +++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+)
arch/arm64/boot/dts/qcom/talos.dtsi +35 -0
@@ -5078,7 +5078,21 @@ usb_qmpphy: phy@88e6000 { #phy-cells = <0>; + orientation-switch; + status = "disabled"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + usb_qmpphy_out: endpoint { + }; + }; + }; }; usb_qmpphy_2: phy@88e8000 {
@@ -5163,7 +5177,21 @@ usb_1: usb@a600000 { wakeup-source; dma-coherent; + usb-role-switch; + status = "disabled"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + usb_1_dwc3_hs: endpoint { + }; + }; + }; }; usb_2: usb@a800000 {
@@ -5220,7 +5248,14 @@ usb_2: usb@a800000 { wakeup-source; dma-coherent; + usb-role-switch; + status = "disabled"; + + port { + usb_2_dwc3_hs: endpoint { + }; + }; }; tsens0: thermal-sensor@c263000 {
Signature · 1 line
2.43.0
Re: [PATCH v3 1/2] arm64: dts: qcom: talos: Add graph port placeholders for USB Type-C muxing
Quoted 47 lines · Akash Kumar
From: Akash Kumar <[email protected]>
Add empty port/endpoint nodes on the primary USB QMP PHY (
usb_qmpphy) and the usb_1/usb_2 dwc3 controllers, along with orientation-switch on the PHY. These placeholders let board files wire up a USB-C PD controller's HS/SS endpoints directly via
&label { remote-endpoint = <...>; }; instead of redeclaring the port/ports structure on the shared nodes.Signed-off-by Akash Kumar <[email protected]>--- arch/arm64/boot/dts/qcom/talos.dtsi | 35 +++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+)arch/arm64/boot/dts/qcom/talos.dtsi +16
-0@@ -5078,7 +5078,21 @@ usb_qmpphy: phy@88e6000 { #phy-cells = <0>; + orientation-switch; + status = "disabled"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + usb_qmpphy_out: endpoint { + }; + }; + }; }; usb_qmpphy_2: phy@88e8000 {@@ -5163,7 +5177,21 @@ usb_1: usb@a600000 { wakeup-source; dma-coherent; + usb-role-switch; + status = "disabled";
arch/arm64/boot/dts/qcom/talos.dtsi usb_1: usb@a600000 { · line 5192
Quoted 10 lines
arch/arm64/boot/dts/qcom/talos.dtsi +10
-0+ + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + usb_1_dwc3_hs: endpoint { + };
Missing SS port.
Quoted 23 lines
arch/arm64/boot/dts/qcom/talos.dtsi +9
-0+ }; + }; }; usb_2: usb@a800000 {@@ -5220,7 +5248,14 @@ usb_2: usb@a800000 { wakeup-source; dma-coherent; + usb-role-switch; + status = "disabled"; + + port { + usb_2_dwc3_hs: endpoint { + }; + }; }; tsens0: thermal-sensor@c263000 {Signature · 1 line
2.43.0
Signature · 2 lines
With best wishes Dmitry
PATCH v3 2/2 arm64: dts: qcom: talos-lyra-evk: Wire up CYPD6129 USB Type-C ports
In reply to Akash KumarFrom: Akash Kumar <[email protected]>
Add the CYPD6129 UCSI PD controller (typec@40) on i2c5 with its two USB-C connectors, and route their HS/SS endpoints to usb_1/usb_2's dwc3 controllers and the USB QMP PHY. The PD controller, its GPIO86 interrupt line, and the PM8150 GPIO10 VBUS-enable control are on the SoC/SoM card, so they are added to talos-lyra-evk-som.dtsi.
connector@1 additionally routes its SBU lines through a GPIO-controlled SBU mux (onnn,fsusb43l10x) selected by expander0, since connector@1's physical Type-C port carries SuperSpeed and SBU while connector@0's port is USB-HS-only by hardware design. The SBU mux and its GPIO expanders live on the carrier board, so they are added to talos-lyra-evk.dts along with the TLMM GPIO64 VBUS boost enable fixed regulator that supplies the USB daughter-card connector's VBUS.
Switch usb_1/usb_2 to dr_mode = "otg" with usb-role-switch so role switching is driven by the PD controller, and add the supporting USB1_VBUS regulator and pinctrl entries needed by this routing.
--- .../boot/dts/qcom/talos-lyra-evk-som.dtsi | 121 ++++++++++++++++++ arch/arm64/boot/dts/qcom/talos-lyra-evk.dts | 42 ++++-- 2 files changed, 152 insertions(+), 11 deletions(-)
arch/arm64/boot/dts/qcom/talos-lyra-evk-som.dtsi +121 -0
@@ -31,6 +31,16 @@ xo_board_clk: xo-board-clk { #clock-cells = <0>; }; }; + + regulator-usb1-vbus { + compatible = "regulator-fixed"; + regulator-name = "USB1_VBUS"; + gpio = <&pm8150_gpios 10 GPIO_ACTIVE_HIGH>; + pinctrl-0 = <&usb1_en>; + pinctrl-names = "default"; + enable-active-high; + regulator-always-on; + }; }; &apps_rsc {
@@ -179,6 +189,87 @@ &gpu_zap_shader { firmware-name = "qcom/qcs615/a612_zap.mbn"; }; +&i2c5 { + typec@40 { + compatible = "cypress,cypd6129"; + reg = <0x40>; + interrupts-extended = <&tlmm 86 IRQ_TYPE_LEVEL_LOW>; + pinctrl-0 = <&usb0_intr_state>; + pinctrl-names = "default"; + wakeup-source; + + #address-cells = <1>; + #size-cells = <0>; + + connector@0 { + compatible = "usb-c-connector"; + reg = <0>; + label = "USB-C"; + data-role = "dual"; + power-role = "dual"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + ucsi_ccg_port_0_hs: endpoint { + remote-endpoint = <&usb_2_dwc3_hs>; + }; + }; + }; + }; + + connector@1 { + compatible = "usb-c-connector"; + reg = <1>; + label = "USB-C"; + data-role = "dual"; + power-role = "dual"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + ucsi_ccg_port_1_hs: endpoint { + remote-endpoint = <&usb_1_dwc3_hs>; + }; + }; + + port@1 { + reg = <1>; + + ccg_typec_con1_ss: endpoint { + remote-endpoint = <&usb_qmpphy_out>; + }; + }; + + port@2 { + reg = <2>; + + ccg_typec_con1_sbu: endpoint { + remote-endpoint = <&sbu_mux_in>; + }; + }; + }; + }; + }; +}; + +&pm8150_gpios { + usb1_en: usb1-en-state { + pins = "gpio10"; + function = "normal"; + output-enable; + power-source = <0>; + }; +}; + &qupv3_id_0 { status = "okay"; };
@@ -229,6 +320,15 @@ &sdhc_2 { status = "okay"; }; +&tlmm { + usb0_intr_state: usb0-intr-state { + pins = "gpio86"; + function = "gpio"; + drive-strength = <2>; + bias-pull-up; + }; +}; + &uart0 { status = "okay"; };
@@ -250,6 +350,14 @@ &ufs_mem_phy { status = "okay"; }; +&usb_1 { + status = "okay"; +}; + +&usb_1_dwc3_hs { + remote-endpoint = <&ucsi_ccg_port_1_hs>; +}; + &usb_1_hsphy { vdd-supply = <&vreg_l5a>; vdda-pll-supply = <&vreg_l12a>;
@@ -258,6 +366,15 @@ &usb_1_hsphy { status = "okay"; }; +&usb_2 { + status = "okay"; +}; + +/* HS only */ +&usb_2_dwc3_hs { + remote-endpoint = <&ucsi_ccg_port_0_hs>; +}; + &usb_2_hsphy { vdd-supply = <&vreg_l5a>; vdda-pll-supply = <&vreg_l12a>;
@@ -279,3 +396,7 @@ &usb_qmpphy_2 { status = "okay"; }; + +&usb_qmpphy_out { + remote-endpoint = <&ccg_typec_con1_ss>; +};
arch/arm64/boot/dts/qcom/talos-lyra-evk.dts +31 -11
59 lines not on this page · raw message
Signature · 1 line
2.43.0
Quoted 8 lines · Akash Kumar
From: Akash Kumar <[email protected]>
Add the CYPD6129 UCSI PD controller (typec@40) on i2c5 with its two USB-C connectors, and route their HS/SS endpoints to usb_1/usb_2's dwc3 controllers and the USB QMP PHY. The PD controller, its GPIO86 interrupt line, and the PM8150 GPIO10 VBUS-enable control are on the SoC/SoM card, so they are added to
talos-lyra-evk-som.dtsi.
Quoted 7 lines
connector@1 additionally routes its SBU lines through a GPIO-controlled SBU mux (onnn,fsusb43l10x) selected by expander0, since connector@1's physical Type-C port carries SuperSpeed and SBU while connector@0's port is USB-HS-only by hardware design. The SBU mux and its GPIO expanders live on the carrier board, so they are added to
talos-lyra-evk.dtsalong with the TLMM GPIO64 VBUS boost enable fixed regulator that supplies the USB daughter-card connector's VBUS.
Thanks!
Quoted 39 lines
Switch usb_1/usb_2 to
dr_mode= "otg" with usb-role-switch so role switching is driven by the PD controller, and add the supportingUSB1_VBUSregulator and pinctrl entries needed by this routing.Signed-off-by Akash Kumar <[email protected]>--- .../boot/dts/qcom/talos-lyra-evk-som.dtsi | 121 ++++++++++++++++++ arch/arm64/boot/dts/qcom/talos-lyra-evk.dts | 42 ++++-- 2 files changed, 152 insertions(+), 11 deletions(-)arch/arm64/boot/dts/qcom/talos-lyra-evk-som.dtsi +13
-0@@ -31,6 +31,16 @@ xo_board_clk: xo-board-clk { #clock-cells = <0>; }; }; + + regulator-usb1-vbus { + compatible = "regulator-fixed"; + regulator-name = "USB1_VBUS"; + gpio = <&pm8150_gpios 10 GPIO_ACTIVE_HIGH>; + pinctrl-0 = <&usb1_en>; + pinctrl-names = "default"; + enable-active-high; + regulator-always-on; + }; }; &apps_rsc {@@ -179,6 +189,87 @@ &gpu_zap_shader { firmware-name = "qcom/qcs615/a612_zap.mbn"; }; +&i2c5 { + typec@40 { + compatible = "cypress,cypd6129";
arch/arm64/boot/dts/qcom/talos-lyra-evk-som.dtsi &gpu_zap_shader { · line 204
Quoted 10 lines
arch/arm64/boot/dts/qcom/talos-lyra-evk-som.dtsi +10
-0+ reg = <0x40>; + interrupts-extended = <&tlmm 86 IRQ_TYPE_LEVEL_LOW>; + pinctrl-0 = <&usb0_intr_state>; + pinctrl-names = "default"; + wakeup-source; + + #address-cells = <1>; + #size-cells = <0>; + + connector@0 {
Does it mean that the connector is present on the SoM? The CYPD might be a part of the SoM, but I guess that connectors are a part of the carrier board (and might differ on other carrier boards).
Quoted 43 lines
arch/arm64/boot/dts/qcom/talos-lyra-evk-som.dtsi +43
-0+ compatible = "usb-c-connector"; + reg = <0>; + label = "USB-C"; + data-role = "dual"; + power-role = "dual"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + ucsi_ccg_port_0_hs: endpoint { + remote-endpoint = <&usb_2_dwc3_hs>; + }; + }; + }; + }; + + connector@1 { + compatible = "usb-c-connector"; + reg = <1>; + label = "USB-C"; + data-role = "dual"; + power-role = "dual"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + ucsi_ccg_port_1_hs: endpoint { + remote-endpoint = <&usb_1_dwc3_hs>; + }; + }; + + port@1 { + reg = <1>; + + ccg_typec_con1_ss: endpoint {
arch/arm64/boot/dts/qcom/talos-lyra-evk-som.dtsi &gpu_zap_shader { · line 257
Quoted 10 lines
arch/arm64/boot/dts/qcom/talos-lyra-evk-som.dtsi +10
-0+ remote-endpoint = <&usb_qmpphy_out>; + }; + }; + + port@2 { + reg = <2>; + + ccg_typec_con1_sbu: endpoint { + remote-endpoint = <&sbu_mux_in>; + };
This line confirms, please move connector nodes to the carrier board DTS.
Quoted 35 lines
arch/arm64/boot/dts/qcom/talos-lyra-evk-som.dtsi +24
-0+ }; + }; + }; + }; +}; + +&pm8150_gpios { + usb1_en: usb1-en-state { + pins = "gpio10"; + function = "normal"; + output-enable; + power-source = <0>; + }; +}; + &qupv3_id_0 { status = "okay"; };@@ -229,6 +320,15 @@ &sdhc_2 { status = "okay"; }; +&tlmm { + usb0_intr_state: usb0-intr-state { + pins = "gpio86"; + function = "gpio"; + drive-strength = <2>; + bias-pull-up; + }; +}; + &uart0 { status = "okay"; };
arch/arm64/boot/dts/qcom/talos-lyra-evk-som.dtsi &ufs_mem_phy { · line 359
Quoted 10 lines
arch/arm64/boot/dts/qcom/talos-lyra-evk-som.dtsi +7
-0@@ -250,6 +350,14 @@ &ufs_mem_phy { status = "okay"; }; +&usb_1 { + status = "okay"; +}; + +&usb_1_dwc3_hs { + remote-endpoint = <&ucsi_ccg_port_1_hs>; +};
These endpoint wiring must go to the EVK DTSI.
Quoted 50 lines
arch/arm64/boot/dts/qcom/talos-lyra-evk-som.dtsi +14
-0+ &usb_1_hsphy { vdd-supply = <&vreg_l5a>; vdda-pll-supply = <&vreg_l12a>;@@ -258,6 +366,15 @@ &usb_1_hsphy { status = "okay"; }; +&usb_2 { + status = "okay"; +}; + +/* HS only */ +&usb_2_dwc3_hs { + remote-endpoint = <&ucsi_ccg_port_0_hs>; +}; + &usb_2_hsphy { vdd-supply = <&vreg_l5a>; vdda-pll-supply = <&vreg_l12a>;@@ -279,3 +396,7 @@ &usb_qmpphy_2 { status = "okay"; }; + +&usb_qmpphy_out { + remote-endpoint = <&ccg_typec_con1_ss>; +};arch/arm64/boot/dts/qcom/talos-lyra-evk.dts +7
-0@@ -4,6 +4,7 @@ */ /dts-v1/; +#include <dt-bindings/gpio/gpio.h> #include "talos-lyra-evk-som.dtsi" / {@@ -22,6 +23,30 @@ dp0_connector_in: endpoint { }; }; }; + + regulator-vbus-boost-5v { + compatible = "regulator-fixed"; + regulator-name = "vreg_vbus_boost_5v"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>;
arch/arm64/boot/dts/qcom/talos-lyra-evk.dts dp0_connector_in: endpoint { · line 41
Quoted 10 lines
arch/arm64/boot/dts/qcom/talos-lyra-evk.dts +10
-0+ gpio = <&tlmm 64 GPIO_ACTIVE_HIGH>; + pinctrl-0 = <&vbus_boost_en>; + pinctrl-names = "default"; + enable-active-high; + regulator-always-on; + }; + + sbu-mux { + compatible = "onnn,fsusb43l10x", "gpio-sbu-mux"; + select-gpios = <&expander0 12 GPIO_ACTIVE_LOW>;
Missing pinctrl.
Quoted 37 lines
arch/arm64/boot/dts/qcom/talos-lyra-evk.dts +14
-11+ orientation-switch; + + port { + sbu_mux_in: endpoint { + remote-endpoint = <&ccg_typec_con1_sbu>; + }; + }; + }; }; &i2c5 {@@ -100,16 +125,11 @@ dp_hot_plug_det: dp-hot-plug-det-state { function = "dp_hot"; bias-disable; }; -}; -&usb_1 { - dr_mode = "peripheral"; - - status = "okay"; -}; - -&usb_2 { - dr_mode = "host"; - - status = "okay"; + vbus_boost_en: vbus-boost-en-state { + pins = "gpio64"; + function = "gpio"; + drive-strength = <2>; + bias-disable; + }; };Signature · 1 line
2.43.0
Signature · 2 lines
With best wishes Dmitry
Quoted 6 lines · Akash Kumar
From: Akash Kumar <[email protected]>
This series wires up the CYPD6129 UCSI PD controller on the Talos Lyra EVK carrier board, enabling USB Type-C role switching and SuperSpeed/HS muxing on both USB-C connectors.
Three versions per day is way too much. Even the base of this was not applied.
Best regards,
Krzysztof