Skip to contentSkip to conversation

arm64: rockchip: rk3399-roc-pc: prevent fusb302 powering off the board during boot

PATCH In review Corentin Labbe 1 participant 2 messages Jun 20, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm64: rockchip: rk3399-roc-pc: prevent fusb302 powering off the board during boot

The rk3399-roc-pc never finish booting because it is powered off when probing fusb302.

The type c port is disabled because not present in DT as can seen in dmesg:
OF: graph: no port node found in /i2c@ff3d0000/usb-typec@22

So adding the port in DT (as needed by the device tree schema of fusb302), permits the board to survive and finish booting.

Fixes 8bb878cf20ae ("arm64: dts: rockchip: add support for ROC-RK3399-PC board")

---
This patch is tested on 5.10.123, 5.15.48 and next-20220614

 arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi +16 -0
index 0e45cc2d195b..60c400ca4034 100644
@@ -552,6 +552,22 @@ fusb0: usb-typec@22 {
 		pinctrl-0 = <&fusb0_int>;
 		vbus-supply = <&vcc_vbus_typec0>;
 		status = "okay";
+
+		connector {
+			compatible = "usb-c-connector";
+			data-role = "host";
+			label = "USB-C";
+			power-role = "dual";
+
+			ports {
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				port@0 {
+					reg = <0>;
+				};
+			};
+		};
 	};
 
 	mp8859: regulator@66 {
Signature · 1 line
2.35.1
#1 lore raw
Quoted 6 lines · Corentin Labbe

The rk3399-roc-pc never finish booting because it is powered off when probing fusb302.

The type c port is disabled because not present in DT as can seen in dmesg:
OF: graph: no port node found in /i2c@ff3d0000/usb-typec@22

Quoted 9 lines

So adding the port in DT (as needed by the device tree schema of fusb302), permits the board to survive and finish booting.

Fixes 8bb878cf20ae ("arm64: dts: rockchip: add support for ROC-RK3399-PC board")

---
This patch is tested on 5.10.123, 5.15.48 and next-20220614

Please ignore this for now, it fixes the issue but

[   31.653778] typec_fusb302 7-0022: cannot register tcpm port, ret=-22
[   31.659415] typec_fusb302: probe of 7-0022 failed with error -22

So while having a board which boot fine is better, having everything well probed will be better.

For fixing the probe error, adding the following is sufficiant:

@@ -558,6 +559,9 @@ connector {
                        data-role = "host";
                        label = "USB-C";
                        power-role = "dual";
+                       op-sink-microwatt = <1000000>;
+                       sink-pdos = <PDO_FIXED(5000, 2500, PDO_FIXED_USB_COMM)>;
+                       source-pdos = <PDO_FIXED(5000, 1400, PDO_FIXED_USB_COMM)>;
                        ports {
                                #address-cells = <1>;

But this bring the initial issue, the board is still dont booting...