Skip to content

Commit 711a56b

Browse files
committed
rockchip64: Helios64: fix Type-C PHY and TCPM registration
Problem: On Helios64 boot, the Type-C PHY (ff7c0000.phy) gets stuck in "deferred probe" state with unknown reason. This causes: - USB 3.0 SuperSpeed via Type-C port not working - DisplayPort via Type-C (Alt Mode) not working The following messages appear in dmesg: platform ff7c0000.phy: deferred probe pending: (reason unknown) platform fe800000.usb: deferred probe pending: wait for supplier /phy@ff7c0000/usb3-port platform fec00000.dp: deferred probe pending: wait for supplier /phy@ff7c0000/dp-port Along with dependency cycle warnings: /phy@ff7c0000/dp-port: Fixed dependency cycle(s) with /i2c@ff3d0000/typec-portc@22/connector Root cause: The Helios64 DTS uses a legacy Type-C connection method: &tcphy0 { extcon = <&fusb0>; // Expects extcon from fusb302 }; However: 1. The FUSB302 driver with TCPM support (since kernel ~4.14) does NOT create extcon devices 2. Instead, it uses the Type-C connector class (/sys/class/typec/) 3. The phy-rockchip-typec driver calls extcon_get_edev_by_phandle(), fails to find an extcon device at the specified phandle, and returns -EPROBE_DEFER 4. The PHY remains in deferred probe indefinitely The extcon-cables property is present in the DTS, but without a typec_extcon_bridge node it serves no purpose. This bug has existed since Type-C support was added to Helios64 (at least since kernel 6.6). It likely worked with older fusb302 driver versions, but broke after the transition to TCPM. Solution: Use the typec-extcon-bridge driver (Armbian patch from Ondrej Jirman/megi) which translates Type-C connector class events to the extcon interface. The Pinebook Pro patch (board-pbp-add-dp-alt-mode.patch) implements this correctly: it has a typec_extcon_bridge node, and all extcon references point to it rather than directly to fusb0. Changes: 1. Add typec_extcon_bridge node with compatible = "linux,typec-extcon-bridge" 2. Change extcon = <&fusb0> to extcon = <&typec_extcon_bridge> in tcphy0, cdn_dp, u2phy0, usbdrd_dwc3_0 nodes 3. Add usb-role-switch, mode-switch, orientation-switch properties to fusb0 connector for integration with the bridge 4. Update PDO definitions with DUAL_ROLE and DATA_SWAP flags 5. Convert typec-altmodes property to modern altmodes subnode format (required for TCPM port registration) 6. Add extcon,ignore-usb to u2phy0 (following Pinebook Pro pattern) 7. Add snps,usb3-phy-reset-quirk to usbdrd_dwc3_0 After this fix: - Type-C PHY (ff7c0000.phy) no longer stuck in deferred probe - USB 3.0 SuperSpeed via Type-C port should work - DisplayPort via Type-C (Alt Mode) should work - Correct cable orientation detection - USB role switching (host/device) Known remaining issues: - FUSB302 fails to register TCPM port with error: 4-0022 typec_fusb302: cannot register tcpm port This prevents USB Power Delivery negotiation. The root cause appears to be in the connector configuration and requires further investigation.
1 parent 9e7f6dc commit 711a56b

File tree

1 file changed

+28
-9
lines changed

1 file changed

+28
-9
lines changed

patch/kernel/archive/rockchip64-6.18/add-board-helios64.patch

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ index 111111111111..222222222222 100644
252252
vcc12v_dcin: regulator-vcc12v-dcin {
253253
compatible = "regulator-fixed";
254254
regulator-name = "vcc12v_dcin";
255-
@@ -227,36 +375,60 @@ vcc12v_dcin_bkup: regulator-vcc12v-dcin-bkup {
255+
@@ -227,36 +375,68 @@ vcc12v_dcin_bkup: regulator-vcc12v-dcin-bkup {
256256
regulator-max-microvolt = <12000000>;
257257
vin-supply = <&vcc12v_dcin>;
258258
};
@@ -335,6 +335,14 @@ index 111111111111..222222222222 100644
335335
+ compatible = "rockchip,rk3399-hdmi-dp";
336336
+ rockchip,cpu = <&i2s2>;
337337
+ rockchip,codec = <&cdn_dp>;
338+
+ };
339+
+
340+
+ typec_extcon_bridge: typec-extcon {
341+
+ compatible = "linux,typec-extcon-bridge";
342+
+ usb-role-switch;
343+
+ orientation-switch;
344+
+ mode-switch;
345+
+ svid = /bits/ 16 <0xff01>;
338346
+ };
339347
};
340348

@@ -353,7 +361,7 @@ index 111111111111..222222222222 100644
353361
+
354362
+&cdn_dp {
355363
+ status = "okay";
356-
+ extcon = <&fusb0>;
364+
+ extcon = <&typec_extcon_bridge>;
357365
+ phys = <&tcphy0_dp>;
358366
+};
359367
+
@@ -550,7 +558,7 @@ index 111111111111..222222222222 100644
550558
vin-supply = <&vcc5v0_sys>;
551559

552560
regulator-state-mem {
553-
@@ -404,17 +696,101 @@ &i2c2 {
561+
@@ -404,17 +696,108 @@ &i2c2 {
554562
i2c-scl-falling-time-ns = <30>;
555563
status = "okay";
556564

@@ -588,19 +596,26 @@ index 111111111111..222222222222 100644
588596
+ pinctrl-names = "default";
589597
+ pinctrl-0 = <&fusb0_int>;
590598
+ vbus-supply = <&vcc5v0_typec>;
599+
+ usb-role-switch = <&typec_extcon_bridge>;
591600
+
592601
+ connector {
593602
+ compatible = "usb-c-connector";
594603
+ label = "USB-C";
595604
+ power-role = "dual";
596605
+ data-role = "dual";
597606
+ try-power-role = "sink";
598-
+ source-pdos = <PDO_FIXED(5000, 1200, PDO_FIXED_USB_COMM)>;
599-
+ sink-pdos = <PDO_FIXED(5000, 500, PDO_FIXED_USB_COMM)>;
607+
+ source-pdos = <PDO_FIXED(5000, 1200, PDO_FIXED_USB_COMM | PDO_FIXED_DUAL_ROLE | PDO_FIXED_DATA_SWAP)>;
608+
+ sink-pdos = <PDO_FIXED(5000, 500, PDO_FIXED_USB_COMM | PDO_FIXED_DUAL_ROLE | PDO_FIXED_DATA_SWAP)>;
600609
+ op-sink-microwatt = <5000000>;
610+
+ mode-switch = <&typec_extcon_bridge>;
611+
+ orientation-switch = <&typec_extcon_bridge>;
601612
+
602-
+ extcon-cables = <1 2 5 6 9 10 12 44>;
603-
+ typec-altmodes = <0xff01 1 0x001c0000 1>;
613+
+ altmodes {
614+
+ dp {
615+
+ svid = /bits/ 16 <0xff01>;
616+
+ vdo = <0x1c46>;
617+
+ };
618+
+ };
604619
+
605620
+ ports {
606621
+ #address-cells = <1>;
@@ -841,7 +856,7 @@ index 111111111111..222222222222 100644
841856
};
842857

843858
+&tcphy0 {
844-
+ extcon = <&fusb0>;
859+
+ extcon = <&typec_extcon_bridge>;
845860
+ status = "okay";
846861
+};
847862
+
@@ -864,12 +879,14 @@ index 111111111111..222222222222 100644
864879
&tcphy1 {
865880
/* phy for &usbdrd_dwc3_1 */
866881
status = "okay";
867-
@@ -559,61 +1056,118 @@ &tsadc {
882+
@@ -559,61 +1056,122 @@ &tsadc {
868883
status = "okay";
869884
};
870885

871886
-&u2phy1 {
872887
+&u2phy0 {
888+
+ extcon = <&typec_extcon_bridge>;
889+
+ extcon,ignore-usb;
873890
status = "okay";
874891

875892
- otg-port {
@@ -923,6 +940,8 @@ index 111111111111..222222222222 100644
923940
+&usbdrd_dwc3_0 {
924941
+ status = "okay";
925942
+ dr_mode = "otg";
943+
+ extcon = <&typec_extcon_bridge>;
944+
+ snps,usb3-phy-reset-quirk;
926945
+};
927946
+
928947
&usbdrd3_1 {

0 commit comments

Comments
 (0)