public inbox for linux-rockchip@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH v2] arm64: rockchip: dts: sapphire: Fix USB3 Type-C.
@ 2019-06-15  0:31 Vicente Bergas
       [not found] ` <4b759fa0-8fe9-4686-b5a7-b7a4e4564419-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Vicente Bergas @ 2019-06-15  0:31 UTC (permalink / raw)
  To: Heiko Stuebner
  Cc: Enric Balletbo i Serra, William wu,
	linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

Before this patch, the Type-C port on the Sapphire board is dead.
If setting the 'regulator-always-on' property to 'vcc5v0_typec0'
then the port works for about 4 seconds at start-up. This is a
sample trace with a memory stick plugged in:
1.- The memory stick LED lights on and kernel reports:
[    4.782999] scsi 0:0:0:0: Direct-Access USB DISK PMAP PQ: 0 ANSI: 4
[    5.904580] sd 0:0:0:0: [sdb] 3913344 512-byte logical blocks: (2.00 
GB/1.87 GiB)
[    5.906860] sd 0:0:0:0: [sdb] Write Protect is off
[    5.908973] sd 0:0:0:0: [sdb] Mode Sense: 23 00 00 00
[    5.909122] sd 0:0:0:0: [sdb] No Caching mode page found
[    5.911214] sd 0:0:0:0: [sdb] Assuming drive cache: write through
[    5.951585]  sdb: sdb1
[    5.954816] sd 0:0:0:0: [sdb] Attached SCSI removable disk
2.- 4 seconds later the memory stick LED lights off and kernel reports:
[    9.082822] phy phy-ff770000.syscon:usb2-phy@e450.2: charger = 
USB_DCP_CHARGER
3.- After a minute the kernel reports:
[   71.666761] usb 5-1: USB disconnect, device number 2
It has been checked that, although the LED is off, VBUS is present.

If, instead, the dr_mode is changed to host and the phy-supply changed
accordingly, then it works. It has only been tested in host mode.

Signed-off-by: Vicente Bergas <vicencb@gmail.com>
---

Hi Heiko,
before i did test:
 a.- applying only the first part of the patch: reg-always-on
 b.- applying the full patch
but did not test:
 c.- applying only the last part of the patch, as you suggest
Now i have tested (c) and it also works, so, here is v2.

Thanks for reviewing!

Regards,
  Vicenç.

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi 
b/arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi
index 04623e52ac5d..72000a7b666f 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi
@@ -565,12 +566,11 @@
 	status = "okay";
 
 	u2phy0_otg: otg-port {
-		phy-supply = <&vcc5v0_typec0>;
 		status = "okay";
 	};
 
 	u2phy0_host: host-port {
-		phy-supply = <&vcc5v0_host>;
+		phy-supply = <&vcc5v0_typec0>;
 		status = "okay";
 	};
 };
@@ -620,7 +620,7 @@
 
 &usbdrd_dwc3_0 {
 	status = "okay";
-	dr_mode = "otg";
+	dr_mode = "host";
 };
 
 &usbdrd3_1 {
-- 
2.21.0


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-06-27 14:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-15  0:31 [PATCH v2] arm64: rockchip: dts: sapphire: Fix USB3 Type-C Vicente Bergas
     [not found] ` <4b759fa0-8fe9-4686-b5a7-b7a4e4564419-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2019-06-27 12:39   ` Heiko Stuebner
2019-06-27 13:12     ` Vicente Bergas
     [not found]       ` <20190627131228.5223-1-vicencb-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2019-06-27 14:43         ` Heiko Stuebner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox