Skip to contentSkip to conversation

arm64: dts: qcom: shikra: Add CYPD6129/CYPD6229 Type-C controller support

PATCH Superseded Akash Kumar 3 participants 3 messages Oct 12 – Nov 13

Subsystems (4)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 arm64: dts: qcom: shikra: Add CYPD6129/CYPD6229 Type-C controller support

This series adds support for the Cypress cypd6129/cypd6229 dual Type-C PD controllers used on the Shikra CQM/CQS/IQS platforms to handle usb-role-switch, and wires up the corresponding DT nodes.

---
Patch v3 adds the Shikra board-specific Device Tree changes required to connect the CYPD6129/CYPD6229 Type-C PD controllers to the USB controllers.

On the CQM and CQS platforms, enable the CYPD6129 controller on I2C3, configure its GPIO136 interrupt, and connect its Type-C connector to USB2. Both USB controllers are configured in OTG mode to allow role switching.

On the IQS platform, enable the CYPD6229 controller with the CYPD6129 fallback compatible, configure its GPIO50 interrupt, and describe both Type-C connectors. The first connector is connected to USB2, while the second connector is connected to USB1, including its SuperSpeed path.

The changes also add the required pinctrl configuration, wakeup-source property, I2C alias, VBUS boost GPIO hog, and USB endpoint remote-endpoint connections.

Link to v2: Link: https://lore.kernel.org/all/[email protected]/

Link to v1: https://lore.kernel.org/all/[email protected]/

Link to Driver and DT-binding change:
https://lore.kernel.org/all/[email protected]/

base commit Link: https://lore.kernel.org/all/[email protected]/
commit e77b5e2b5816bfb8fab930156a320550ee5a0ffe

---
 arch/arm64/boot/dts/qcom/shikra-cqm-evk.dts |  57 ++++++++++
 arch/arm64/boot/dts/qcom/shikra-cqs-evk.dts |  57 ++++++++++
 arch/arm64/boot/dts/qcom/shikra-iqs-evk.dts | 109 ++++++++++++++++++++
 3 files changed, 223 insertions(+)
arch/arm64/boot/dts/qcom/shikra-cqm-evk.dts +57 -0
index 2d26435b257a..508c24a2ce99 100644
@@ -14,6 +14,7 @@ / {
 	chassis-type = "embedded";
 
 	aliases {
+		i2c3 = &i2c3;
 		mmc0 = &sdhc_1;
 		serial0 = &uart0;
 	};
@@ -23,6 +24,43 @@ chosen {
 	};
 };
 
+&i2c3 {
+	status = "okay";
+
+	typec@40 {
+		compatible = "cypress,cypd6129";
+		reg = <0x40>;
+		interrupts-extended = <&tlmm 136 IRQ_TYPE_LEVEL_LOW>;
+		pinctrl-0 = <&usb0_intr_state>;
+		pinctrl-names = "default";
+		wakeup-source;
+
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		ccg_typec_con0: 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: endpoint {
+						remote-endpoint = <&usb_2_dwc3_hs>;
+					};
+				};
+			};
+		};
+	};
+};
+
 &pm4125_hs_in {
 	remote-endpoint = <&usb_1_dwc3_hs>;
 };
@@ -66,6 +104,15 @@ &sdhc_1 {
 	status = "okay";
 };
 
+&tlmm {
+	usb0_intr_state: usb0-intr-state {
+		pins = "gpio136";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-pull-up;
+	};
+};
+
 &usb_1 {
 	dr_mode = "otg";
 };
@@ -82,6 +129,16 @@ &usb_1_hsphy {
 	status = "okay";
 };
 
+&usb_2 {
+	dr_mode = "otg";
+
+	port {
+		usb_2_dwc3_hs: endpoint {
+			remote-endpoint = <&ucsi_ccg_port>;
+		};
+	};
+};
+
 &usb_2_hsphy {
 	vdd-supply = <&pm4125_l12>;
 	vdda-pll-supply = <&pm4125_l13>;
arch/arm64/boot/dts/qcom/shikra-cqs-evk.dts +57 -0

81 lines not on this page · raw message

arch/arm64/boot/dts/qcom/shikra-iqs-evk.dts +109 -0

136 lines not on this page · raw message

Signature · 1 line
2.43.0
#1 lore raw
Quoted 6 lines · Akash Kumar

This series adds support for the Cypress cypd6129/cypd6229 dual Type-C PD controllers used on the Shikra CQM/CQS/IQS platforms to handle usb-role-switch, and wires up the corresponding DT nodes.

---

[...]

arch/arm64/boot/dts/qcom/shikra-cqm-evk.dts &usb_1_hsphy { · line 140

Quoted 9 lines

+&usb_2 {

arch/arm64/boot/dts/qcom/shikra-cqm-evk.dts +8 -0
+	dr_mode = "otg";
+
+	port {
+		usb_2_dwc3_hs: endpoint {
+			remote-endpoint = <&ucsi_ccg_port>;
+		};
+	};
+};

Do not redefine existing nodes. Do:

&usb_2_dwc3_hs {
remote-endpoint = ..
};

instead.

Konrad

#2 lore raw
In reply to Akash Kumar
Quoted 3 lines · Akash Kumar

This series adds support for the Cypress cypd6129/cypd6229 dual Type-C PD controllers used on the Shikra CQM/CQS/IQS platforms to handle usb-role-switch, and wires up the corresponding DT nodes.

Which series it's a single patch.? Write something useful, e.g. if the USB ports are HS or SS.

Quoted 10 lines

---
Patch v3 adds the Shikra board-specific Device Tree changes required to connect the CYPD6129/CYPD6229 Type-C PD controllers to the USB controllers.

On the CQM and CQS platforms, enable the CYPD6129 controller on I2C3, configure its GPIO136 interrupt, and connect its Type-C connector to USB2. Both USB controllers are configured in OTG mode to allow role switching.

Quoted 6 lines

On the IQS platform, enable the CYPD6229 controller with the CYPD6129 fallback compatible, configure its GPIO50 interrupt, and describe both Type-C connectors. The first connector is connected to USB2, while the second connector is connected to USB1, including its SuperSpeed path.

The changes also add the required pinctrl configuration, wakeup-source

You haven't read Documentation/process/submitting-patches.rst

Quoted 40 lines

property, I2C alias, VBUS boost GPIO hog, and USB endpoint remote-endpoint connections.

Link to v2: Link: https://lore.kernel.org/all/[email protected]/

Link to v1: https://lore.kernel.org/all/[email protected]/

Link to Driver and DT-binding change:
https://lore.kernel.org/all/[email protected]/

base commit Link: https://lore.kernel.org/all/[email protected]/
commit e77b5e2b5816bfb8fab930156a320550ee5a0ffe

---
 arch/arm64/boot/dts/qcom/shikra-cqm-evk.dts |  57 ++++++++++
 arch/arm64/boot/dts/qcom/shikra-cqs-evk.dts |  57 ++++++++++
 arch/arm64/boot/dts/qcom/shikra-iqs-evk.dts | 109 ++++++++++++++++++++
 3 files changed, 223 insertions(+)
arch/arm64/boot/dts/qcom/shikra-cqm-evk.dts +6 -0
index 2d26435b257a..508c24a2ce99 100644
@@ -14,6 +14,7 @@ / {
 	chassis-type = "embedded";
 
 	aliases {
+		i2c3 = &i2c3;
 		mmc0 = &sdhc_1;
 		serial0 = &uart0;
 	};
@@ -23,6 +24,43 @@ chosen {
 	};
 };
 
+&i2c3 {
+	status = "okay";
+
+	typec@40 {
+		compatible = "cypress,cypd6129";

arch/arm64/boot/dts/qcom/shikra-cqm-evk.dts chosen { · line 41

Quoted 10 lines
arch/arm64/boot/dts/qcom/shikra-cqm-evk.dts +10 -0
+		reg = <0x40>;
+		interrupts-extended = <&tlmm 136 IRQ_TYPE_LEVEL_LOW>;
+		pinctrl-0 = <&usb0_intr_state>;
+		pinctrl-names = "default";
+		wakeup-source;
+
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		ccg_typec_con0: connector@0 {

Unused label, drop.

Quoted 5 lines
arch/arm64/boot/dts/qcom/shikra-cqm-evk.dts +5 -0
+			compatible = "usb-c-connector";
+			reg = <0>;
+			label = "USB-C";
+			data-role = "dual";
+			power-role = "dual";

arch/arm64/boot/dts/qcom/shikra-cqm-evk.dts chosen { · line 56

Quoted 10 lines
arch/arm64/boot/dts/qcom/shikra-cqm-evk.dts +10 -0
+
+			ports {
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				port@0 {
+					reg = <0>;
+
+					ucsi_ccg_port: endpoint {
+						remote-endpoint = <&usb_2_dwc3_hs>;

Are SS and SBU lines not wired?

Quoted 27 lines
arch/arm64/boot/dts/qcom/shikra-cqm-evk.dts +16 -0
+					};
+				};
+			};
+		};
+	};
+};
+
 &pm4125_hs_in {
 	remote-endpoint = <&usb_1_dwc3_hs>;
 };
@@ -66,6 +104,15 @@ &sdhc_1 {
 	status = "okay";
 };
 
+&tlmm {
+	usb0_intr_state: usb0-intr-state {
+		pins = "gpio136";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-pull-up;
+	};
+};
+
 &usb_1 {
 	dr_mode = "otg";
 };

arch/arm64/boot/dts/qcom/shikra-cqm-evk.dts &usb_1_hsphy { · line 133

Quoted 5 lines
arch/arm64/boot/dts/qcom/shikra-cqm-evk.dts +2 -0
@@ -82,6 +129,16 @@ &usb_1_hsphy {
 	status = "okay";
 };
 
+&usb_2 {
+	dr_mode = "otg";

It's default and can be dropped.

arch/arm64/boot/dts/qcom/shikra-cqm-evk.dts &usb_1_hsphy { · line 136

Quoted 3 lines
arch/arm64/boot/dts/qcom/shikra-cqm-evk.dts +3 -0
+
+	port {
+		usb_2_dwc3_hs: endpoint {

Move the endpoint definition to shikra.dtsi.

Quoted 29 lines
arch/arm64/boot/dts/qcom/shikra-cqm-evk.dts +5 -0
+			remote-endpoint = <&ucsi_ccg_port>;
+		};
+	};
+};
+
 &usb_2_hsphy {
 	vdd-supply = <&pm4125_l12>;
 	vdda-pll-supply = <&pm4125_l13>;
arch/arm64/boot/dts/qcom/shikra-cqs-evk.dts +6 -0
index fcafd8aa6384..eaa79b2960a9 100644
@@ -14,6 +14,7 @@ / {
 	chassis-type = "embedded";
 
 	aliases {
+		i2c3 = &i2c3;
 		mmc0 = &sdhc_1;
 		serial0 = &uart0;
 	};
@@ -23,6 +24,43 @@ chosen {
 	};
 };
 
+&i2c3 {
+	status = "okay";
+
+	typec@40 {
+		compatible = "cypress,cypd6129";

arch/arm64/boot/dts/qcom/shikra-cqs-evk.dts chosen { · line 41

Quoted 10 lines
arch/arm64/boot/dts/qcom/shikra-cqs-evk.dts +10 -0
+		reg = <0x40>;
+		interrupts-extended = <&tlmm 136 IRQ_TYPE_LEVEL_LOW>;
+		pinctrl-0 = <&usb0_intr_state>;
+		pinctrl-names = "default";
+		wakeup-source;
+
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		ccg_typec_con0: connector@0 {

Drop the label.

Quoted 5 lines
arch/arm64/boot/dts/qcom/shikra-cqs-evk.dts +5 -0
+			compatible = "usb-c-connector";
+			reg = <0>;
+			label = "USB-C";
+			data-role = "dual";
+			power-role = "dual";

arch/arm64/boot/dts/qcom/shikra-cqs-evk.dts chosen { · line 56

Quoted 10 lines
arch/arm64/boot/dts/qcom/shikra-cqs-evk.dts +10 -0
+
+			ports {
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				port@0 {
+					reg = <0>;
+
+					ucsi_ccg_port: endpoint {
+						remote-endpoint = <&usb_2_dwc3_hs>;

Are SS and SBU not wired?

Quoted 27 lines
arch/arm64/boot/dts/qcom/shikra-cqs-evk.dts +16 -0
+					};
+				};
+			};
+		};
+	};
+};
+
 &pm4125_hs_in {
 	remote-endpoint = <&usb_1_dwc3_hs>;
 };
@@ -66,6 +104,15 @@ &sdhc_1 {
 	status = "okay";
 };
 
+&tlmm {
+	usb0_intr_state: usb0-intr-state {
+		pins = "gpio136";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-pull-up;
+	};
+};
+
 &usb_1 {
 	dr_mode = "otg";
 };

arch/arm64/boot/dts/qcom/shikra-cqs-evk.dts &usb_1_hsphy { · line 133

Quoted 5 lines
arch/arm64/boot/dts/qcom/shikra-cqs-evk.dts +2 -0
@@ -82,6 +129,16 @@ &usb_1_hsphy {
 	status = "okay";
 };
 
+&usb_2 {
+	dr_mode = "otg";

Drop

Quoted 32 lines
arch/arm64/boot/dts/qcom/shikra-cqs-evk.dts +8 -0
+
+	port {
+		usb_2_dwc3_hs: endpoint {
+			remote-endpoint = <&ucsi_ccg_port>;
+		};
+	};
+};
+
 &usb_2_hsphy {
 	vdd-supply = <&pm4125_l12>;
 	vdda-pll-supply = <&pm4125_l13>;
arch/arm64/boot/dts/qcom/shikra-iqs-evk.dts +6 -0
index 779b9582c011..f7dc3026d028 100644
@@ -14,6 +14,7 @@ / {
 	chassis-type = "embedded";
 
 	aliases {
+		i2c3 = &i2c3;
 		mmc0 = &sdhc_1;
 		serial0 = &uart0;
 	};
@@ -23,6 +24,72 @@ chosen {
 	};
 };
 
+&i2c3 {
+	status = "okay";
+
+	typec@40 {
+		compatible = "cypress,cypd6229", "cypress,cypd6129";

arch/arm64/boot/dts/qcom/shikra-iqs-evk.dts chosen { · line 41

Quoted 10 lines
arch/arm64/boot/dts/qcom/shikra-iqs-evk.dts +10 -0
+		reg = <0x40>;
+		interrupts-extended = <&tlmm 50 IRQ_TYPE_LEVEL_LOW>;
+		pinctrl-0 = <&usb0_intr_state>;
+		pinctrl-names = "default";
+		wakeup-source;
+
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		ccg_typec_con0: connector@0 {

Drop the label

Quoted 55 lines
arch/arm64/boot/dts/qcom/shikra-iqs-evk.dts +51 -0
+			compatible = "usb-c-connector";
+			reg = <0>;
+			label = "USB2-Type-C";
+			data-role = "dual";
+			power-role = "dual";
+
+			ports {
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				port@0 {
+					reg = <0>;
+
+					ucsi_ccg_port0_hs: endpoint {
+						remote-endpoint = <&usb_2_dwc3_hs>;
+					};
+				};
+			};
+		};
+
+		ccg_typec_con1: connector@1 {
+			compatible = "usb-c-connector";
+			reg = <1>;
+			label = "USB3-Type-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>;
+
+					ucsi_ccg_port_1_ss: endpoint {
+						remote-endpoint = <&usb_qmpphy_out>;
+					};
+				};
+			};
+		};
+	};
+};
+
 &remoteproc_cdsp {
 	firmware-name = "qcom/shikra/cdsp.mbn";
 

arch/arm64/boot/dts/qcom/shikra-iqs-evk.dts &sdhc_1 { · line 134

Quoted 10 lines
arch/arm64/boot/dts/qcom/shikra-iqs-evk.dts +7 -0
@@ -58,6 +125,32 @@ &sdhc_1 {
 	status = "okay";
 };
 
+&tlmm {
+	vbus_boost_5v: vbus-boost-5v-hog {
+		gpio-hog;
+		gpios = <79 GPIO_ACTIVE_HIGH>;
+		output-high;
+		line-name = "vbus-boost-5v";
+	};

Why is it a hog rather than a regulator?

Quoted 52 lines
arch/arm64/boot/dts/qcom/shikra-iqs-evk.dts +35 -0
+
+	usb0_intr_state: usb0-intr-state {
+		pins = "gpio50";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-pull-up;
+	};
+};
+
+&usb_1 {
+	dr_mode = "otg";
+
+	status = "okay";
+};
+
+&usb_1_dwc3_hs {
+	remote-endpoint = <&ucsi_ccg_port_1_hs>;
+};
+
 &usb_1_hsphy {
 	vdd-supply = <&pm8150_l4>;
 	vdda-pll-supply = <&pm8150_l12>;
@@ -66,6 +159,18 @@ &usb_1_hsphy {
 	status = "okay";
 };
 
+&usb_2 {
+	dr_mode = "otg";
+
+	status = "okay";
+
+	port {
+		usb_2_dwc3_hs: endpoint {
+			remote-endpoint = <&ucsi_ccg_port0_hs>;
+		};
+	};
+};
+
 &usb_2_hsphy {
 	vdd-supply = <&pm8150_l4>;
 	vdda-pll-supply = <&pm8150_l12>;
@@ -80,3 +185,7 @@ &usb_qmpphy {
 
 	status = "okay";
 };
+
+&usb_qmpphy_out {
+	remote-endpoint = <&ucsi_ccg_port_1_ss>;
+};
Signature · 1 line
2.43.0
Signature · 2 lines
With best wishes
Dmitry