devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] phy: rockchip-typec: fix boards that does not report cable-state.
@ 2018-03-01  9:24 Enric Balletbo i Serra
  2018-03-01  9:24 ` [PATCH 2/6] dt-bindings: phy-rockchip-typec: move extcon property to be optional Enric Balletbo i Serra
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Enric Balletbo i Serra @ 2018-03-01  9:24 UTC (permalink / raw)
  To: kishon, heiko
  Cc: groeck, gwendal, kernel, vicencb, Andre Przywara, Rob Herring,
	Icenowy Zheng, Shawn Lin, Rask Ingemann Lambertsen,
	Catalin Marinas, Pierre-Hugues Husson, Corentin Labbe,
	Jacob Chen, Kever Yang, linux-rockchip, Will Deacon, devicetree,
	linux-arm-kernel, Jianqun Xu, Klaus Goger, linux-kernel,
	Heinrich Schuchardt

Hi,

Commit c301b327aea898af ("arm64: dts: rockchip: add usb3-phy otg-port
support for rk3399") introduced a regression on some rk3399 boards,
and break USB. While some boards have support to report cable-state via
extcon interface, other boards does not support. This patch series
tries to fix this.

First and second patch makes extcon optional, the following patches
enables the typec phyter for others rk3399 boards. It has been tested on
Samsung Chromebook Plus and Sapphire but not on the other boards, so I'll
appreciate if someone can test it.

Best regards,
 Enric

Enric Balletbo i Serra (6):
  phy: rockchip-typec: fall back to working in host-mode if extcon is
    missing.
  dt-bindings: phy-rockchip-typec: move extcon property to be optional.
  arm64: dts: rockchip: enable typec-phy for rk3399-sapphire.
  arm64: dts: rockchip: enable typec-phy for rk3399-firefly.
  arm64: dts: rockchip: enable typec-phy1 for rk3399-puma.
  arm64: dts: rockchip: enable typec-phy0 for rk3399-puma-haikou.

 Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt | 2 ++
 arch/arm64/boot/dts/rockchip/rk3399-firefly.dts              | 8 ++++++++
 arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts          | 4 ++++
 arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi                | 4 ++++
 arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi            | 8 ++++++++
 drivers/phy/rockchip/phy-rockchip-typec.c                    | 9 ++++++---
 6 files changed, 32 insertions(+), 3 deletions(-)

-- 
2.16.1

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

* [PATCH 2/6] dt-bindings: phy-rockchip-typec: move extcon property to be optional.
  2018-03-01  9:24 [PATCH 0/6] phy: rockchip-typec: fix boards that does not report cable-state Enric Balletbo i Serra
@ 2018-03-01  9:24 ` Enric Balletbo i Serra
       [not found]   ` <20180301092420.1191-3-enric.balletbo-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
  2018-03-01  9:24 ` [PATCH 3/6] arm64: dts: rockchip: enable typec-phy for rk3399-sapphire Enric Balletbo i Serra
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 7+ messages in thread
From: Enric Balletbo i Serra @ 2018-03-01  9:24 UTC (permalink / raw)
  To: kishon, heiko
  Cc: groeck, gwendal, kernel, vicencb, devicetree, linux-kernel,
	linux-rockchip, Rob Herring, Mark Rutland, linux-arm-kernel

The extcon property is used to detect the cable-state but some boards,
like Sapphire, currently does not seem to support, others might just not
need, as are supposed to work in host-mode only. So, extcon property is
not really a required property, move to be optional instead.

Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
---

 Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt b/Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt
index 6ea867e3176f..a66f23a01129 100644
--- a/Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt
+++ b/Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt
@@ -14,6 +14,8 @@ Required properties:
  - resets : a list of phandle + reset specifier pairs
  - reset-names : string reset name, must be:
 		 "uphy", "uphy-pipe", "uphy-tcphy"
+
+Optional properties:
  - extcon : extcon specifier for the Power Delivery
 
 Note, there are 2 type-c phys for RK3399, and they are almost identical, except
-- 
2.16.1

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

* [PATCH 3/6] arm64: dts: rockchip: enable typec-phy for rk3399-sapphire.
  2018-03-01  9:24 [PATCH 0/6] phy: rockchip-typec: fix boards that does not report cable-state Enric Balletbo i Serra
  2018-03-01  9:24 ` [PATCH 2/6] dt-bindings: phy-rockchip-typec: move extcon property to be optional Enric Balletbo i Serra
@ 2018-03-01  9:24 ` Enric Balletbo i Serra
  2018-03-01  9:24 ` [PATCH 4/6] arm64: dts: rockchip: enable typec-phy for rk3399-firefly Enric Balletbo i Serra
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Enric Balletbo i Serra @ 2018-03-01  9:24 UTC (permalink / raw)
  To: kishon, heiko
  Cc: Mark Rutland, devicetree, gwendal, Rob Herring, Catalin Marinas,
	Shawn Lin, Will Deacon, Kever Yang, vicencb, linux-kernel,
	linux-rockchip, Jacob Chen, groeck, kernel, Jianqun Xu,
	linux-arm-kernel

Commit c301b327aea898af ("arm64: dts: rockchip: add usb3-phy otg-port
support for rk3399") caused a regression regarding the USB3 type-A port.
During boot, the following message appears a few times:

  dwc3: failed to initialize core

The driver is deferred waiting for the typec-phy, but this never happens
bceause is disabled. So, enable it.

Fixes: c301b327aea898af ("arm64: dts: rockchip: add usb3-phy otg-port support for rk3399")
Reported-by: Vicente Bergas <vicencb@gmail.com>
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
---

 arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi
index ce592a4c0c4c..9c685eab4748 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi
@@ -557,6 +557,14 @@
 	status = "okay";
 };
 
+&tcphy0 {
+	status = "okay";
+};
+
+&tcphy1 {
+	status = "okay";
+};
+
 &u2phy0 {
 	status = "okay";
 
-- 
2.16.1

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

* [PATCH 4/6] arm64: dts: rockchip: enable typec-phy for rk3399-firefly.
  2018-03-01  9:24 [PATCH 0/6] phy: rockchip-typec: fix boards that does not report cable-state Enric Balletbo i Serra
  2018-03-01  9:24 ` [PATCH 2/6] dt-bindings: phy-rockchip-typec: move extcon property to be optional Enric Balletbo i Serra
  2018-03-01  9:24 ` [PATCH 3/6] arm64: dts: rockchip: enable typec-phy for rk3399-sapphire Enric Balletbo i Serra
@ 2018-03-01  9:24 ` Enric Balletbo i Serra
  2018-03-01  9:24 ` [PATCH 5/6] arm64: dts: rockchip: enable typec-phy1 for rk3399-puma Enric Balletbo i Serra
  2018-03-01  9:24 ` [PATCH 6/6] arm64: dts: rockchip: enable typec-phy0 for rk3399-puma-haikou Enric Balletbo i Serra
  4 siblings, 0 replies; 7+ messages in thread
From: Enric Balletbo i Serra @ 2018-03-01  9:24 UTC (permalink / raw)
  To: kishon, heiko
  Cc: groeck, gwendal, kernel, vicencb, devicetree,
	Pierre-Hugues Husson, Jianqun Xu, Kever Yang, linux-kernel,
	Heinrich Schuchardt, linux-rockchip, Shawn Lin, Rob Herring,
	Will Deacon, Mark Rutland, Catalin Marinas, linux-arm-kernel

Commit c301b327aea898af ("arm64: dts: rockchip: add usb3-phy otg-port
support for rk3399") caused a regression regarding the USB3. During boot,
the following message appears a few times:

      dwc3: failed to initialize core

The driver is deferred waiting for the typec-phy, but this never happens
beause is disabled. So, enable it.

Fixes: c301b327aea898af ("arm64: dts: rockchip: add usb3-phy otg-port support for rk3399")
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
---

 arch/arm64/boot/dts/rockchip/rk3399-firefly.dts | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts b/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts
index 4f28628aa091..0e3a9ab4a297 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts
@@ -670,6 +670,14 @@
 	status = "okay";
 };
 
+&tcphy0 {
+	status = "okay";
+};
+
+&tcphy1 {
+	status = "okay";
+};
+
 &u2phy0 {
 	status = "okay";
 
-- 
2.16.1

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

* [PATCH 5/6] arm64: dts: rockchip: enable typec-phy1 for rk3399-puma.
  2018-03-01  9:24 [PATCH 0/6] phy: rockchip-typec: fix boards that does not report cable-state Enric Balletbo i Serra
                   ` (2 preceding siblings ...)
  2018-03-01  9:24 ` [PATCH 4/6] arm64: dts: rockchip: enable typec-phy for rk3399-firefly Enric Balletbo i Serra
@ 2018-03-01  9:24 ` Enric Balletbo i Serra
  2018-03-01  9:24 ` [PATCH 6/6] arm64: dts: rockchip: enable typec-phy0 for rk3399-puma-haikou Enric Balletbo i Serra
  4 siblings, 0 replies; 7+ messages in thread
From: Enric Balletbo i Serra @ 2018-03-01  9:24 UTC (permalink / raw)
  To: kishon, heiko
  Cc: groeck, gwendal, kernel, vicencb, devicetree, Jianqun Xu,
	Jacob Chen, Klaus Goger, linux-kernel, linux-rockchip, Shawn Lin,
	Rob Herring, Will Deacon, Mark Rutland, Catalin Marinas,
	linux-arm-kernel

Commit c301b327aea898af ("arm64: dts: rockchip: add usb3-phy otg-port
support for rk3399") caused a regression regarding the USB3. During boot,
the following message appears a few times:

      dwc3: failed to initialize core

The driver is deferred waiting for the typec-phy, but this never happens
beause is disabled. So, enable it.

Fixes: c301b327aea898af ("arm64: dts: rockchip: add usb3-phy otg-port support for rk3399")
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
---

 arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi
index 1fc5060d7027..3a3b24383482 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi
@@ -505,6 +505,10 @@
 	};
 };
 
+&tcphy1 {
+	status = "okay";
+};
+
 &u2phy1 {
 	status = "okay";
 
-- 
2.16.1

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

* [PATCH 6/6] arm64: dts: rockchip: enable typec-phy0 for rk3399-puma-haikou.
  2018-03-01  9:24 [PATCH 0/6] phy: rockchip-typec: fix boards that does not report cable-state Enric Balletbo i Serra
                   ` (3 preceding siblings ...)
  2018-03-01  9:24 ` [PATCH 5/6] arm64: dts: rockchip: enable typec-phy1 for rk3399-puma Enric Balletbo i Serra
@ 2018-03-01  9:24 ` Enric Balletbo i Serra
  4 siblings, 0 replies; 7+ messages in thread
From: Enric Balletbo i Serra @ 2018-03-01  9:24 UTC (permalink / raw)
  To: kishon, heiko
  Cc: groeck, gwendal, kernel, vicencb, devicetree, Corentin Labbe,
	Andre Przywara, Klaus Goger, linux-kernel, Maxime Ripard,
	linux-rockchip, Rob Herring, Icenowy Zheng, Will Deacon,
	Rask Ingemann Lambertsen, Catalin Marinas, Chen-Yu Tsai,
	Mark Rutland, linux-arm-kernel

Commit c301b327aea898af ("arm64: dts: rockchip: add usb3-phy otg-port
support for rk3399") caused a regression regarding the USB3. During
boot, the following message appears a few times:

    dwc3: failed to initialize core

The driver is deferred waiting for the typec-phy, but this never
happens beause is disabled. So, enable it.

Fixes: c301b327aea898af ("arm64: dts: rockchip: add usb3-phy otg-port support for rk3399")
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
---

 arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts b/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts
index 9a7486058455..2c9c696d1383 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts
@@ -191,6 +191,10 @@
 	status = "okay";
 };
 
+&tcphy0 {
+	status = "okay";
+};
+
 &u2phy0 {
 	status = "okay";
 };
-- 
2.16.1

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

* Re: [PATCH 2/6] dt-bindings: phy-rockchip-typec: move extcon property to be optional.
       [not found]   ` <20180301092420.1191-3-enric.balletbo-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
@ 2018-03-01  9:49     ` Heiko Stübner
  0 siblings, 0 replies; 7+ messages in thread
From: Heiko Stübner @ 2018-03-01  9:49 UTC (permalink / raw)
  To: Enric Balletbo i Serra
  Cc: Mark Rutland, devicetree-u79uwXL29TY76Z2rM5mHXA,
	gwendal-F7+t8E8rja9g9hUCZPvPmw,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	vicencb-Re5JQEeQqe8AvxtiuMwx3w, kishon-l0cyMroinI0,
	linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Rob Herring,
	groeck-F7+t8E8rja9g9hUCZPvPmw, kernel-ZGY8ohtN/8qB+jHODAdFcQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

Hi Enric,

Am Donnerstag, 1. März 2018, 10:24:16 CET schrieb Enric Balletbo i Serra:
> The extcon property is used to detect the cable-state but some boards,
> like Sapphire, currently does not seem to support, others might just not
> need, as are supposed to work in host-mode only. So, extcon property is
> not really a required property, move to be optional instead.

The change itself is justified, the "justification" in the message might
need some rework, as this sounds more like a kernel-side issue,
while the extcon should always be optional.

Something like:

The extcon property is used to detect the cable-state but some boards
just connect the type-c phy to a regular USB-A connector without any
power-delivery and thus no controller reporting the cable-state.
So the extcon property is not really a required property, move it to be 
optional instead.


For the change itself:
Reviewed-by: Heiko Stuebner <heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>

> Signed-off-by: Enric Balletbo i Serra <enric.balletbo-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
> ---
> 
>  Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt
> b/Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt index
> 6ea867e3176f..a66f23a01129 100644
> --- a/Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt
> +++ b/Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt
> @@ -14,6 +14,8 @@ Required properties:
>   - resets : a list of phandle + reset specifier pairs
>   - reset-names : string reset name, must be:
>  		 "uphy", "uphy-pipe", "uphy-tcphy"
> +
> +Optional properties:
>   - extcon : extcon specifier for the Power Delivery
> 
>  Note, there are 2 type-c phys for RK3399, and they are almost identical,
> except

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

end of thread, other threads:[~2018-03-01  9:49 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-01  9:24 [PATCH 0/6] phy: rockchip-typec: fix boards that does not report cable-state Enric Balletbo i Serra
2018-03-01  9:24 ` [PATCH 2/6] dt-bindings: phy-rockchip-typec: move extcon property to be optional Enric Balletbo i Serra
     [not found]   ` <20180301092420.1191-3-enric.balletbo-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
2018-03-01  9:49     ` Heiko Stübner
2018-03-01  9:24 ` [PATCH 3/6] arm64: dts: rockchip: enable typec-phy for rk3399-sapphire Enric Balletbo i Serra
2018-03-01  9:24 ` [PATCH 4/6] arm64: dts: rockchip: enable typec-phy for rk3399-firefly Enric Balletbo i Serra
2018-03-01  9:24 ` [PATCH 5/6] arm64: dts: rockchip: enable typec-phy1 for rk3399-puma Enric Balletbo i Serra
2018-03-01  9:24 ` [PATCH 6/6] arm64: dts: rockchip: enable typec-phy0 for rk3399-puma-haikou Enric Balletbo i Serra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).