Skip to contentSkip to conversation

arm64: dts: qcom: PS8830 retimer clock fixes and typec0 enablement

PATCH Applied Xin Liu 4 participants 11 messages Sep 14 – Sep 29

Subsystems (3)
lore
Share & tools
lore

Xin Liu

author
#0 lore raw

v3 cover arm64: dts: qcom: PS8830 retimer clock fixes and typec0 enablement

The Hamoa IoT EVK hardware design uses a Parade PS8830 retimer on I2C3 for USB Type-C port 0. Describe the retimer and route typec0 through it to enable USB 3.0 SuperSpeed and DisplayPort Alt Mode.

Compared with v2, two new patches (1/3 and 2/3) are added. During the v2 review [1], Konrad pointed out a suspicious clock reference. Further checking confirmed that every PS8830 retimer on both Purwa and Hamoa has its own on-board 25 MHz crystal wired to its XI/XO pins, so the existing clock properties in the DTS are wrong and should be fixed.

[1] https://lore.kernel.org/all/[email protected]/

Patch 1/3: Purwa, switch the three PS8830 nodes to on-board crystals (Fixes). Patch 2/3: Hamoa, same for the two existing PS8830 nodes (Fixes). Patch 3/3: Hamoa, add the typec0 PS8830 on I2C3 and drop the unused FSUSB42.

Tested on the Hamoa IoT EVK:
- USB 3.0 SuperSpeed at 5 Gbps on typec0
- DisplayPort Alt Mode on typec0

This series is based on the qcom tree's for-next branch
(git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux.git for-next).

BR,
Xin Liu

Changes in v3:
- Add purwa-iot-evk clock fix patch (1/3): replace RPMH RF clocks with per-retimer fixed-clock nodes inside a new clocks {} container node
- Add hamoa-iot-evk clock fix patch (2/3): same fix for the two existing PS8830 retimers on hamoa
- Replace RPMH RF clock in hamoa typec0 patch (3/3) with fixed-clock node inside the existing clocks {} container node
- Split previous single hamoa patch into a clock fix (2/3) and the typec0 feature patch (3/3)
- Link to v2: https://lore.kernel.org/all/[email protected]/

Changes in v2:
- Updated the commit message to clarify that FSUSB42 is present on PCB but with all signal lines unconnected (NC), rather than "won't be populated"

Note: Changes in v2 and the Link above apply to patch 3/3 only.

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

Xin Liu (3):
arm64: dts: qcom: purwa-iot-evk: use on-board crystal for PS8830
retimers
arm64: dts: qcom: hamoa-iot-evk: use on-board crystal for PS8830
retimers
arm64: dts: qcom: hamoa-iot-evk: switch typec0 to PS8830 retimer

 arch/arm64/boot/dts/qcom/hamoa-iot-evk.dts | 130 +++++++++++++--------
 arch/arm64/boot/dts/qcom/purwa-iot-evk.dts |  27 ++++-
 2 files changed, 103 insertions(+), 54 deletions(-)

--
2.43.0

base-commit: a9d7ced84989ec05be09b4b8428759ef60450a0f

author
#1 lore raw

PATCH v3 1/3 arm64: dts: qcom: purwa-iot-evk: use on-board crystal for PS8830 retimers

On the Purwa IoT EVK, each PS8830 retimer has its own 25 MHz crystal wired to the retimer's XI/XO pins. The reference clock does not come from the PMIC, so the RPMH_RF_CLK4/5 references in the retimer nodes are wrong: they keep those RF clocks enabled for nothing and describe a connection that does not exist on the board.

Remove the stale "Left unused" annotation from the vreg_rtmr0 regulators as the retimer is actively used.

Fixes 9ed20e877239 ("arm64: dts: qcom: Add base PURWA-IOT-EVK board")

---
v3: New patch.

---
 arch/arm64/boot/dts/qcom/purwa-iot-evk.dts | 27 ++++++++++++++++++----
 1 file changed, 23 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/qcom/purwa-iot-evk.dts +23 -4
index 6fc6fe7c0899..4380a46b33b2 100644
@@ -60,6 +60,26 @@ chosen {
 		stdout-path = "serial0:115200n8";
 	};
 
+	clocks {
+		clk_rtmr0_xo: clock-rtmr0-xo {
+			compatible = "fixed-clock";
+			clock-frequency = <25000000>;
+			#clock-cells = <0>;
+		};
+
+		clk_rtmr1_xo: clock-rtmr1-xo {
+			compatible = "fixed-clock";
+			clock-frequency = <25000000>;
+			#clock-cells = <0>;
+		};
+
+		clk_rtmr2_xo: clock-rtmr2-xo {
+			compatible = "fixed-clock";
+			clock-frequency = <25000000>;
+			#clock-cells = <0>;
+		};
+	};
+
 	connector3 {
 		compatible = "usb-a-connector";
 		label = "USB-3-Type-A";
@@ -295,7 +315,6 @@ vreg_pcie_3v3_aux: regulator-pcie-3v3-aux {
 		pinctrl-names = "default";
 	};
 
-	/* Left unused as the retimer is not used on this board. */
 	vreg_rtmr0_1p15: regulator-rtmr0-1p15 {
 		compatible = "regulator-fixed";
 
@@ -639,7 +658,7 @@ typec-mux@8 {
 		compatible = "parade,ps8830";
 		reg = <0x08>;
 
-		clocks = <&rpmhcc RPMH_RF_CLK5>;
+		clocks = <&clk_rtmr2_xo>;
 
 		vdd-supply = <&vreg_rtmr2_1p15>;
 		vdd33-supply = <&vreg_rtmr2_3p3>;
@@ -696,7 +715,7 @@ typec-mux@8 {
 		compatible = "parade,ps8830";
 		reg = <0x8>;
 
-		clocks = <&rpmhcc RPMH_RF_CLK4>;
+		clocks = <&clk_rtmr0_xo>;
 
 		vdd-supply = <&vreg_rtmr0_1p15>;
 		vdd33-supply = <&vreg_rtmr0_3p3>;
@@ -801,7 +820,7 @@ typec-mux@8 {
 		compatible = "parade,ps8830";
 		reg = <0x8>;
 
-		clocks = <&rpmhcc RPMH_RF_CLK4>;
+		clocks = <&clk_rtmr1_xo>;
 
 		vdd-supply = <&vreg_rtmr1_1p15>;
 		vdd33-supply = <&vreg_rtmr1_3p3>;
Signature · 1 line
2.43.0
Reviewed-by on v3 1/3
#2 lore raw

Re: [PATCH v3 1/3] arm64: dts: qcom: purwa-iot-evk: use on-board crystal for PS8830 retimers

Quoted 6 lines · Xin Liu

On the Purwa IoT EVK, each PS8830 retimer has its own 25 MHz crystal wired to the retimer's XI/XO pins. The reference clock does not come from the PMIC, so the RPMH_RF_CLK4/5 references in the retimer nodes are wrong: they keep those RF clocks enabled for nothing and describe a connection that does not exist on the board.

Quoted 6 lines

Remove the stale "Left unused" annotation from the vreg_rtmr0 regulators as the retimer is actively used.

Fixes 9ed20e877239 ("arm64: dts: qcom: Add base PURWA-IOT-EVK board")

---

Konrad

Reviewed-by on v3 1/3
#3 lore raw

Re: [PATCH v3 1/3] arm64: dts: qcom: purwa-iot-evk: use on-board crystal for PS8830 retimers

In reply to Xin Liu
Quoted 11 lines · Xin Liu

On the Purwa IoT EVK, each PS8830 retimer has its own 25 MHz crystal wired to the retimer's XI/XO pins. The reference clock does not come from the PMIC, so the RPMH_RF_CLK4/5 references in the retimer nodes are wrong: they keep those RF clocks enabled for nothing and describe a connection that does not exist on the board.

Remove the stale "Left unused" annotation from the vreg_rtmr0 regulators as the retimer is actively used.

Fixes 9ed20e877239 ("arm64: dts: qcom: Add base PURWA-IOT-EVK board")
author
#4 lore raw

PATCH v3 2/3 arm64: dts: qcom: hamoa-iot-evk: use on-board crystal for PS8830 retimers

In reply to Xin Liu

On the Hamoa IoT EVK, each of the two existing PS8830 retimers has its own 25 MHz crystal wired to the retimer's XI/XO pins. The reference clock does not come from the PMIC, so the RPMH_RF_CLK4/5 references in the retimer nodes are wrong: they keep those RF clocks enabled for nothing and describe a connection that does not exist on the board.

Fixes c11645afb0e2 ("arm64: dts: qcom: Add base HAMOA-IOT-EVK board")

---
v3: New patch.

---
 arch/arm64/boot/dts/qcom/hamoa-iot-evk.dts | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/qcom/hamoa-iot-evk.dts +14 -2
index 776bded3a312..57c8ae2e7d4c 100644
@@ -35,6 +35,18 @@ mcp2518fd_osc: clock-40000000 {
 			clock-frequency = <40000000>;
 			#clock-cells = <0>;
 		};
+
+		clk_rtmr1_xo: clock-rtmr1-xo {
+			compatible = "fixed-clock";
+			clock-frequency = <25000000>;
+			#clock-cells = <0>;
+		};
+
+		clk_rtmr2_xo: clock-rtmr2-xo {
+			compatible = "fixed-clock";
+			clock-frequency = <25000000>;
+			#clock-cells = <0>;
+		};
 	};
 
 	wcd938x: audio-codec {
@@ -699,7 +711,7 @@ typec-mux@8 {
 		compatible = "parade,ps8830";
 		reg = <0x08>;
 
-		clocks = <&rpmhcc RPMH_RF_CLK5>;
+		clocks = <&clk_rtmr2_xo>;
 
 		vdd-supply = <&vreg_rtmr2_1p15>;
 		vdd33-supply = <&vreg_rtmr2_3p3>;
@@ -814,7 +826,7 @@ typec-mux@8 {
 		compatible = "parade,ps8830";
 		reg = <0x8>;
 
-		clocks = <&rpmhcc RPMH_RF_CLK4>;
+		clocks = <&clk_rtmr1_xo>;
 
 		vdd-supply = <&vreg_rtmr1_1p15>;
 		vdd33-supply = <&vreg_rtmr1_3p3>;
Signature · 1 line
2.43.0
Reviewed-by on v3 2/3
#5 lore raw

Re: [PATCH v3 2/3] arm64: dts: qcom: hamoa-iot-evk: use on-board crystal for PS8830 retimers

Quoted 9 lines · Xin Liu

On the Hamoa IoT EVK, each of the two existing PS8830 retimers has its own 25 MHz crystal wired to the retimer's XI/XO pins. The reference clock does not come from the PMIC, so the RPMH_RF_CLK4/5 references in the retimer nodes are wrong: they keep those RF clocks enabled for nothing and describe a connection that does not exist on the board.

Fixes c11645afb0e2 ("arm64: dts: qcom: Add base HAMOA-IOT-EVK board")

---

Konrad

Reviewed-by on v3 2/3
#6 lore raw

Re: [PATCH v3 2/3] arm64: dts: qcom: hamoa-iot-evk: use on-board crystal for PS8830 retimers

In reply to Xin Liu
Quoted 8 lines · Xin Liu

On the Hamoa IoT EVK, each of the two existing PS8830 retimers has its own 25 MHz crystal wired to the retimer's XI/XO pins. The reference clock does not come from the PMIC, so the RPMH_RF_CLK4/5 references in the retimer nodes are wrong: they keep those RF clocks enabled for nothing and describe a connection that does not exist on the board.

Fixes c11645afb0e2 ("arm64: dts: qcom: Add base HAMOA-IOT-EVK board")
author
#7 lore raw

PATCH v3 3/3 arm64: dts: qcom: hamoa-iot-evk: switch typec0 to PS8830 retimer

In reply to Xin Liu

The Hamoa IoT EVK hardware design uses a Parade PS8830 retimer on I2C3 for USB Type-C port 0. Describe the retimer and route typec0 through it to enable USB 3.0 SuperSpeed and DisplayPort Alt Mode.

Supply the PS8830 from the existing vreg_rtmr0_* rails and remove their stale "Left unused" annotation.

The FSUSB42 SBU mux chip is present on the PCB but with all signal lines unconnected (NC), so remove the fsusb42 node and its pinctrl group. The chip is retained as a hardware fallback: should the PS8830's SBU path encounter issues, the FSUSB42 can be activated with a simple rework, avoiding a full board respin.

---
v3: Replace RPMH_RF_CLK4 reference with a fixed-clock node; split off
clock fix into a separate patch (2/3).
v2: Updated the commit message to clarify that FSUSB42 is present on
PCB but with all signal lines unconnected (NC).

---
 arch/arm64/boot/dts/qcom/hamoa-iot-evk.dts | 114 ++++++++++++---------
 1 file changed, 66 insertions(+), 48 deletions(-)
arch/arm64/boot/dts/qcom/hamoa-iot-evk.dts +66 -48
index 57c8ae2e7d4c..a4a2a1fccf11 100644
@@ -36,6 +36,12 @@ mcp2518fd_osc: clock-40000000 {
 			#clock-cells = <0>;
 		};
 
+		clk_rtmr0_xo: clock-rtmr0-xo {
+			compatible = "fixed-clock";
+			clock-frequency = <25000000>;
+			#clock-cells = <0>;
+		};
+
 		clk_rtmr1_xo: clock-rtmr1-xo {
 			compatible = "fixed-clock";
 			clock-frequency = <25000000>;
@@ -138,15 +144,15 @@ port@1 {
 					reg = <1>;
 
 					pmic_glink_ss0_ss_in: endpoint {
-						remote-endpoint = <&usb_1_ss0_qmpphy_out>;
+						remote-endpoint = <&retimer_ss0_ss_out>;
 					};
 				};
 
 				port@2 {
 					reg = <2>;
 
-					pmic_glink_ss0_sbu: endpoint {
-						remote-endpoint = <&usb_1_ss0_sbu_mux>;
+					pmic_glink_ss0_con_sbu_in: endpoint {
+						remote-endpoint = <&retimer_ss0_con_sbu_out>;
 					};
 				};
 			};
@@ -315,7 +321,6 @@ vreg_pcie_3v3_aux: regulator-pcie-3v3-aux {
 		pinctrl-names = "default";
 	};
 
-	/* Left unused as the retimer is not used on this board. */
 	vreg_rtmr0_1p15: regulator-rtmr0-1p15 {
 		compatible = "regulator-fixed";
 
@@ -644,25 +649,6 @@ platform {
 		};
 	};
 
-	usb-1-ss0-sbu-mux {
-		compatible = "onnn,fsusb42", "gpio-sbu-mux";
-
-		enable-gpios = <&tlmm 168 GPIO_ACTIVE_LOW>;
-		select-gpios = <&tlmm 167 GPIO_ACTIVE_HIGH>;
-
-		pinctrl-0 = <&usb_1_ss0_sbu_default>;
-		pinctrl-names = "default";
-
-		mode-switch;
-		orientation-switch;
-
-		port {
-			usb_1_ss0_sbu_mux: endpoint {
-				remote-endpoint = <&pmic_glink_ss0_sbu>;
-			};
-		};
-	};
-
 	wifi-bt-connector {
 		compatible = "pcie-m2-e-connector";
 		vpcie3v3-supply = <&vreg_wcn_3p3>;
@@ -759,6 +745,62 @@ retimer_ss2_con_sbu_out: endpoint {
 	};
 };
 
+&i2c3 {
+	clock-frequency = <400000>;
+	status = "okay";
+
+	typec-mux@8 {
+		compatible = "parade,ps8830";
+		reg = <0x08>;
+
+		clocks = <&clk_rtmr0_xo>;
+
+		vdd-supply = <&vreg_rtmr0_1p15>;
+		vdd33-supply = <&vreg_rtmr0_3p3>;
+		vdd33-cap-supply = <&vreg_rtmr0_3p3>;
+		vddar-supply = <&vreg_rtmr0_1p15>;
+		vddat-supply = <&vreg_rtmr0_1p15>;
+		vddio-supply = <&vreg_rtmr0_1p8>;
+
+		reset-gpios = <&pm8550_gpios 10 GPIO_ACTIVE_LOW>;
+
+		pinctrl-0 = <&rtmr0_default>;
+		pinctrl-names = "default";
+
+		orientation-switch;
+		retimer-switch;
+
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			port@0 {
+				reg = <0>;
+
+				retimer_ss0_ss_out: endpoint {
+					remote-endpoint = <&pmic_glink_ss0_ss_in>;
+				};
+			};
+
+			port@1 {
+				reg = <1>;
+
+				retimer_ss0_ss_in: endpoint {
+					remote-endpoint = <&usb_1_ss0_qmpphy_out>;
+				};
+			};
+
+			port@2 {
+				reg = <2>;
+
+				retimer_ss0_con_sbu_out: endpoint {
+					remote-endpoint = <&pmic_glink_ss0_con_sbu_in>;
+				};
+			};
+		};
+	};
+};
+
 &i2c5 {
 	clock-frequency = <400000>;
 
@@ -1413,30 +1455,6 @@ usb2_pwr_3p3_reg_en: usb2-pwr-3p3-reg-en-state {
 		bias-disable;
 	};
 
-	usb_1_ss0_sbu_default: usb-1-ss0-sbu-state {
-		mode-pins {
-			pins = "gpio166";
-			function = "gpio";
-			bias-disable;
-			drive-strength = <2>;
-			output-high;
-		};
-
-		oe-n-pins {
-			pins = "gpio168";
-			function = "gpio";
-			bias-disable;
-			drive-strength = <2>;
-		};
-
-		sel-pins {
-			pins = "gpio167";
-			function = "gpio";
-			bias-disable;
-			drive-strength = <2>;
-		};
-	};
-
 	wcd_default: wcd-reset-n-active-state {
 		pins = "gpio191";
 		function = "gpio";
@@ -1524,7 +1542,7 @@ &usb_1_ss0_hsphy {
 };
 
 &usb_1_ss0_qmpphy_out {
-	remote-endpoint = <&pmic_glink_ss0_ss_in>;
+	remote-endpoint = <&retimer_ss0_ss_in>;
 };
 
 &usb_1_ss1_dwc3_hs {
Signature · 1 line
2.43.0
Reviewed-by on v3 3/3
#8 lore raw

Re: [PATCH v3 3/3] arm64: dts: qcom: hamoa-iot-evk: switch typec0 to PS8830 retimer

Quoted 18 lines · Xin Liu

The Hamoa IoT EVK hardware design uses a Parade PS8830 retimer on I2C3 for USB Type-C port 0. Describe the retimer and route typec0 through it to enable USB 3.0 SuperSpeed and DisplayPort Alt Mode.

Supply the PS8830 from the existing vreg_rtmr0_* rails and remove their stale "Left unused" annotation.

The FSUSB42 SBU mux chip is present on the PCB but with all signal lines unconnected (NC), so remove the fsusb42 node and its pinctrl group. The chip is retained as a hardware fallback: should the PS8830's SBU path encounter issues, the FSUSB42 can be activated with a simple rework, avoiding a full board respin.

---

[...]

arch/arm64/boot/dts/qcom/hamoa-iot-evk.dts retimer_ss2_con_sbu_out: endpoint { · line 750

Quoted 3 lines

+&i2c3 {

arch/arm64/boot/dts/qcom/hamoa-iot-evk.dts +2 -0
+	clock-frequency = <400000>;
+	status = "okay";

In case you need to resend, please add a \n before 'status'

Konrad

Reviewed-by on v3 3/3
#9 lore raw

Re: [PATCH v3 3/3] arm64: dts: qcom: hamoa-iot-evk: switch typec0 to PS8830 retimer

In reply to Xin Liu
Quoted 13 lines · Xin Liu

The Hamoa IoT EVK hardware design uses a Parade PS8830 retimer on I2C3 for USB Type-C port 0. Describe the retimer and route typec0 through it to enable USB 3.0 SuperSpeed and DisplayPort Alt Mode.

Supply the PS8830 from the existing vreg_rtmr0_* rails and remove their stale "Left unused" annotation.

The FSUSB42 SBU mux chip is present on the PCB but with all signal lines unconnected (NC), so remove the fsusb42 node and its pinctrl group. The chip is retained as a hardware fallback: should the PS8830's SBU path encounter issues, the FSUSB42 can be activated with a simple rework, avoiding a full board respin.

Quoted 4 lines
maintainer Applied
#10 lore raw
In reply to Xin Liu
Quoted 11 lines · Xin Liu

The Hamoa IoT EVK hardware design uses a Parade PS8830 retimer on I2C3 for USB Type-C port 0. Describe the retimer and route typec0 through it to enable USB 3.0 SuperSpeed and DisplayPort Alt Mode.

Compared with v2, two new patches (1/3 and 2/3) are added. During the v2 review [1], Konrad pointed out a suspicious clock reference. Further checking confirmed that every PS8830 retimer on both Purwa and Hamoa has its own on-board 25 MHz crystal wired to its XI/XO pins, so the existing clock properties in the DTS are wrong and should be fixed.

[...]

Applied, thanks!

[1/3] arm64: dts: qcom: purwa-iot-evk: use on-board crystal for PS8830 retimers

      commit: bda6d233a6ea408817fa5fb5727d11fa2349d9a5
[2/3] arm64: dts: qcom: hamoa-iot-evk: use on-board crystal for PS8830 retimers
      commit: 723ce02feb131a81224a281872028d584b69b0ca
[3/3] arm64: dts: qcom: hamoa-iot-evk: switch typec0 to PS8830 retimer
      commit: b33a372231750a87fc2d1e5c5cba228c0ad19db5

Best regards,

Signature · 1 line
Bjorn Andersson <[email protected]>