linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/6] phy: rockchip-typec: fix boards that does not report cable-state.
@ 2018-03-01 15:25 Enric Balletbo i Serra
  2018-03-01 15:25 ` [PATCH v2 1/6] phy: rockchip-typec: fall back to working in host-mode if extcon is missing Enric Balletbo i Serra
                   ` (5 more replies)
  0 siblings, 6 replies; 18+ messages in thread
From: Enric Balletbo i Serra @ 2018-03-01 15:25 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, Jacob Chen, Kever Yang,
	linux-rockchip, Will Deacon, devicetree, linux-arm-kernel,
	Jianqun Xu, Klaus Goger, linux-kernel, Mark Rutland,
	Chen-Yu Tsai, Maxime Ripard

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

Changes in v2:
- [1/6] Keep the error handling of extcon (Heiko Stubner)
- [2/6] Rewrite the justification as suggested by Heiko Stuebner.

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.

 .../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                   | 13 ++++++++++---
 6 files changed, 36 insertions(+), 3 deletions(-)

-- 
2.16.1

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

* [PATCH v2 1/6] phy: rockchip-typec: fall back to working in host-mode if extcon is missing.
  2018-03-01 15:25 [PATCH v2 0/6] phy: rockchip-typec: fix boards that does not report cable-state Enric Balletbo i Serra
@ 2018-03-01 15:25 ` Enric Balletbo i Serra
  2018-03-14  8:14   ` Heiko Stübner
  2018-03-01 15:25 ` [PATCH v2 2/6] dt-bindings: phy-rockchip-typec: move extcon property to be optional Enric Balletbo i Serra
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 18+ messages in thread
From: Enric Balletbo i Serra @ 2018-03-01 15:25 UTC (permalink / raw)
  To: kishon, heiko
  Cc: groeck, gwendal, kernel, vicencb, linux-rockchip, linux-kernel,
	linux-arm-kernel

Right now the rockchip type-c phy does fail probing when no extcon is
detected. Some boards get the cable-state via the extcon interface and
have this supported, other boards seem to use the fusb302 chip or
another but the driver currently does not seem to utilize the extcon
interface to report the cable-state. And, other, just connect the type-c
to a standard USB-A port so use no controller at all. A missing extcon
shouldn't fail to probe, instead, should just fall back to working in
host-mode if it cannot get the extcon.

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>
---

Changes in v2:
- [1/6] Keep the error handling of extcon (Heiko Stubner)

 drivers/phy/rockchip/phy-rockchip-typec.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/drivers/phy/rockchip/phy-rockchip-typec.c b/drivers/phy/rockchip/phy-rockchip-typec.c
index 7492c8978217..e260067d2c98 100644
--- a/drivers/phy/rockchip/phy-rockchip-typec.c
+++ b/drivers/phy/rockchip/phy-rockchip-typec.c
@@ -782,6 +782,9 @@ static int tcphy_get_mode(struct rockchip_typec_phy *tcphy)
 	u8 mode;
 	int ret;
 
+	if (!edev)
+		return MODE_DFP_USB;
+
 	ufp = extcon_get_state(edev, EXTCON_USB);
 	dp = extcon_get_state(edev, EXTCON_DISP_DP);
 
@@ -1115,9 +1118,13 @@ static int rockchip_typec_phy_probe(struct platform_device *pdev)
 
 	tcphy->extcon = extcon_get_edev_by_phandle(dev, 0);
 	if (IS_ERR(tcphy->extcon)) {
-		if (PTR_ERR(tcphy->extcon) != -EPROBE_DEFER)
-			dev_err(dev, "Invalid or missing extcon\n");
-		return PTR_ERR(tcphy->extcon);
+		if (PTR_ERR(tcphy->extcon) == -ENODEV) {
+			tcphy->extcon = NULL;
+		} else {
+			if (PTR_ERR(tcphy->extcon) != -EPROBE_DEFER)
+				dev_err(dev, "Invalid or missing extcon\n");
+			return PTR_ERR(tcphy->extcon);
+		}
 	}
 
 	pm_runtime_enable(dev);
-- 
2.16.1

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

* [PATCH v2 2/6] dt-bindings: phy-rockchip-typec: move extcon property to be optional.
  2018-03-01 15:25 [PATCH v2 0/6] phy: rockchip-typec: fix boards that does not report cable-state Enric Balletbo i Serra
  2018-03-01 15:25 ` [PATCH v2 1/6] phy: rockchip-typec: fall back to working in host-mode if extcon is missing Enric Balletbo i Serra
@ 2018-03-01 15:25 ` Enric Balletbo i Serra
  2018-03-07 19:34   ` Rob Herring
  2018-03-01 15:25 ` [PATCH v2 3/6] arm64: dts: rockchip: enable typec-phy for rk3399-sapphire Enric Balletbo i Serra
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 18+ messages in thread
From: Enric Balletbo i Serra @ 2018-03-01 15:25 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
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.

Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
---

Changes in v2:
- [2/6] Rewrite the justification as suggested by Heiko Stuebner.

 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] 18+ messages in thread

* [PATCH v2 3/6] arm64: dts: rockchip: enable typec-phy for rk3399-sapphire.
  2018-03-01 15:25 [PATCH v2 0/6] phy: rockchip-typec: fix boards that does not report cable-state Enric Balletbo i Serra
  2018-03-01 15:25 ` [PATCH v2 1/6] phy: rockchip-typec: fall back to working in host-mode if extcon is missing Enric Balletbo i Serra
  2018-03-01 15:25 ` [PATCH v2 2/6] dt-bindings: phy-rockchip-typec: move extcon property to be optional Enric Balletbo i Serra
@ 2018-03-01 15:25 ` Enric Balletbo i Serra
  2018-03-03 11:17   ` Vicente Bergas
  2018-03-16 10:38   ` Heiko Stuebner
  2018-03-01 15:25 ` [PATCH v2 4/6] arm64: dts: rockchip: enable typec-phy for rk3399-firefly Enric Balletbo i Serra
                   ` (2 subsequent siblings)
  5 siblings, 2 replies; 18+ messages in thread
From: Enric Balletbo i Serra @ 2018-03-01 15:25 UTC (permalink / raw)
  To: kishon, heiko
  Cc: groeck, gwendal, kernel, vicencb, devicetree, Jianqun Xu,
	Jacob Chen, 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 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>
---

Changes in v2: None

 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] 18+ messages in thread

* [PATCH v2 4/6] arm64: dts: rockchip: enable typec-phy for rk3399-firefly.
  2018-03-01 15:25 [PATCH v2 0/6] phy: rockchip-typec: fix boards that does not report cable-state Enric Balletbo i Serra
                   ` (2 preceding siblings ...)
  2018-03-01 15:25 ` [PATCH v2 3/6] arm64: dts: rockchip: enable typec-phy for rk3399-sapphire Enric Balletbo i Serra
@ 2018-03-01 15:25 ` Enric Balletbo i Serra
  2018-03-16 10:38   ` Heiko Stuebner
  2018-03-01 15:25 ` [PATCH v2 5/6] arm64: dts: rockchip: enable typec-phy1 for rk3399-puma Enric Balletbo i Serra
  2018-03-01 15:25 ` [PATCH v2 6/6] arm64: dts: rockchip: enable typec-phy0 for rk3399-puma-haikou Enric Balletbo i Serra
  5 siblings, 1 reply; 18+ messages in thread
From: Enric Balletbo i Serra @ 2018-03-01 15:25 UTC (permalink / raw)
  To: kishon, heiko
  Cc: groeck, gwendal, kernel, vicencb, devicetree,
	Pierre-Hugues Husson, Jianqun Xu, Kever Yang, 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>
---

Changes in v2: None

 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] 18+ messages in thread

* [PATCH v2 5/6] arm64: dts: rockchip: enable typec-phy1 for rk3399-puma.
  2018-03-01 15:25 [PATCH v2 0/6] phy: rockchip-typec: fix boards that does not report cable-state Enric Balletbo i Serra
                   ` (3 preceding siblings ...)
  2018-03-01 15:25 ` [PATCH v2 4/6] arm64: dts: rockchip: enable typec-phy for rk3399-firefly Enric Balletbo i Serra
@ 2018-03-01 15:25 ` Enric Balletbo i Serra
  2018-03-02 19:49   ` klaus.goger
  2018-03-16 10:39   ` Heiko Stuebner
  2018-03-01 15:25 ` [PATCH v2 6/6] arm64: dts: rockchip: enable typec-phy0 for rk3399-puma-haikou Enric Balletbo i Serra
  5 siblings, 2 replies; 18+ messages in thread
From: Enric Balletbo i Serra @ 2018-03-01 15:25 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>
---

Changes in v2: None

 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] 18+ messages in thread

* [PATCH v2 6/6] arm64: dts: rockchip: enable typec-phy0 for rk3399-puma-haikou.
  2018-03-01 15:25 [PATCH v2 0/6] phy: rockchip-typec: fix boards that does not report cable-state Enric Balletbo i Serra
                   ` (4 preceding siblings ...)
  2018-03-01 15:25 ` [PATCH v2 5/6] arm64: dts: rockchip: enable typec-phy1 for rk3399-puma Enric Balletbo i Serra
@ 2018-03-01 15:25 ` Enric Balletbo i Serra
  2018-03-02 19:49   ` klaus.goger
  2018-03-16 10:39   ` Heiko Stuebner
  5 siblings, 2 replies; 18+ messages in thread
From: Enric Balletbo i Serra @ 2018-03-01 15:25 UTC (permalink / raw)
  To: kishon, heiko
  Cc: groeck, gwendal, kernel, vicencb, devicetree, 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>
---

Changes in v2: None

 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] 18+ messages in thread

* Re: [PATCH v2 5/6] arm64: dts: rockchip: enable typec-phy1 for rk3399-puma.
  2018-03-01 15:25 ` [PATCH v2 5/6] arm64: dts: rockchip: enable typec-phy1 for rk3399-puma Enric Balletbo i Serra
@ 2018-03-02 19:49   ` klaus.goger
  2018-03-16 10:39   ` Heiko Stuebner
  1 sibling, 0 replies; 18+ messages in thread
From: klaus.goger @ 2018-03-02 19:49 UTC (permalink / raw)
  To: Enric Balletbo i Serra
  Cc: kishon, Heiko Stübner, groeck, gwendal, kernel, vicencb,
	devicetree, Jianqun Xu, Jacob Chen, linux-kernel, linux-rockchip,
	Shawn Lin, Rob Herring, Will Deacon, Mark Rutland,
	Catalin Marinas, linux-arm-kernel

> On 01.03.2018, at 16:25, Enric Balletbo i Serra <enric.balletbo@collabora.com> wrote:
> 
> 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>
> ---
> 
> Changes in v2: None
> 
> 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


Tested-by: Klaus Goger <klaus.goger@theobroma-systems.com>

Looks good. With your patch,the onboard USB hub on tcphy1 is found 
at bootup.

# lsusb  -t
/:  Bus 06.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 5000M
        |__ Port 2: Dev 3, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
/:  Bus 05.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
        |__ Port 4: Dev 4, If 0, Class=, Driver=, 12M
/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=ohci-platform/1p, 12M
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=ohci-platform/1p, 12M
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ehci-platform/1p, 480M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-platform/1p, 480M

— 
Klaus

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

* Re: [PATCH v2 6/6] arm64: dts: rockchip: enable typec-phy0 for rk3399-puma-haikou.
  2018-03-01 15:25 ` [PATCH v2 6/6] arm64: dts: rockchip: enable typec-phy0 for rk3399-puma-haikou Enric Balletbo i Serra
@ 2018-03-02 19:49   ` klaus.goger
  2018-03-16 10:39   ` Heiko Stuebner
  1 sibling, 0 replies; 18+ messages in thread
From: klaus.goger @ 2018-03-02 19:49 UTC (permalink / raw)
  To: Enric Balletbo i Serra
  Cc: kishon, Heiko Stübner, groeck, gwendal, kernel, vicencb,
	devicetree, Andre Przywara, 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



> On 01.03.2018, at 16:25, Enric Balletbo i Serra <enric.balletbo@collabora.com> wrote:
> 
> 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>
> ---
> 
> Changes in v2: None
> 
> 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


Tested-by: Klaus Goger <klaus.goger@theobroma-systems.com>

With usbdrd_dwc3_0 changed to dr_mode = "host"

[   37.176540] usb 6-1: new SuperSpeed USB device number 2 using xhci-hcd
[   37.203962] usb-storage 6-1:1.0: USB Mass Storage device detected
[   37.211837] scsi host1: usb-storage 6-1:1.0
[   38.249378] scsi 1:0:0:0: Direct-Access     SanDisk  Ultra            1.00 PQ: 0 ANSI: 6
[   38.259097] sd 1:0:0:0: [sdb] 122421248 512-byte logical blocks: (62.7 GB/58.4 GiB)
[   38.268890] sd 1:0:0:0: [sdb] Write Protect is off
[   38.274269] sd 1:0:0:0: [sdb] Mode Sense: 43 00 00 00
[   38.274582] sd 1:0:0:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[   38.295967]  sdb: sdb1
[   38.300787] sd 1:0:0:0: [sdb] Attached SCSI removable disk
< detaching>
[   45.192248] usb 6-1: USB disconnect, device number 2

— 
Klaus

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

* Re: [PATCH v2 3/6] arm64: dts: rockchip: enable typec-phy for rk3399-sapphire.
  2018-03-01 15:25 ` [PATCH v2 3/6] arm64: dts: rockchip: enable typec-phy for rk3399-sapphire Enric Balletbo i Serra
@ 2018-03-03 11:17   ` Vicente Bergas
  2018-03-16 10:38   ` Heiko Stuebner
  1 sibling, 0 replies; 18+ messages in thread
From: Vicente Bergas @ 2018-03-03 11:17 UTC (permalink / raw)
  To: Enric Balletbo i Serra
  Cc: kishon, Heiko Stübner, groeck, gwendal, kernel, devicetree,
	Jianqun Xu, Jacob Chen, linux-kernel, linux-rockchip, Shawn Lin,
	Rob Herring, Will Deacon, Mark Rutland, Catalin Marinas,
	linux-arm-kernel

On Thu, Mar 1, 2018 at 4:25 PM, Enric Balletbo i Serra
<enric.balletbo@collabora.com> wrote:
> 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>
> ---
>
> Changes in v2: None
>
>  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

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

Thank you,
  Vicente.

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

* Re: [PATCH v2 2/6] dt-bindings: phy-rockchip-typec: move extcon property to be optional.
  2018-03-01 15:25 ` [PATCH v2 2/6] dt-bindings: phy-rockchip-typec: move extcon property to be optional Enric Balletbo i Serra
@ 2018-03-07 19:34   ` Rob Herring
  2018-03-07 19:42     ` Alexandru Stan
  0 siblings, 1 reply; 18+ messages in thread
From: Rob Herring @ 2018-03-07 19:34 UTC (permalink / raw)
  To: Enric Balletbo i Serra
  Cc: kishon, heiko, groeck, gwendal, kernel, vicencb, devicetree,
	linux-kernel, linux-rockchip, Mark Rutland, linux-arm-kernel

On Thu, Mar 01, 2018 at 04:25:11PM +0100, Enric Balletbo i Serra wrote:
> 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.
> 
> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
> Reviewed-by: Heiko Stuebner <heiko@sntech.de>
> ---
> 
> Changes in v2:
> - [2/6] Rewrite the justification as suggested by Heiko Stuebner.
> 
>  Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt | 2 ++
>  1 file changed, 2 insertions(+)

And extcon should be deprecated IMO.

Reviewed-by: Rob Herring <robh@kernel.org>

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

* Re: [PATCH v2 2/6] dt-bindings: phy-rockchip-typec: move extcon property to be optional.
  2018-03-07 19:34   ` Rob Herring
@ 2018-03-07 19:42     ` Alexandru Stan
  0 siblings, 0 replies; 18+ messages in thread
From: Alexandru Stan @ 2018-03-07 19:42 UTC (permalink / raw)
  To: Rob Herring
  Cc: Enric Balletbo i Serra, Mark Rutland, devicetree,
	Gwendal Grignou, Heiko Stuebner, linux-kernel, vicencb, kishon,
	open list:ARM/Rockchip SoC...,
	groeck, kernel, linux-arm-kernel, Benson Leung

On Wed, Mar 7, 2018 at 11:34 AM, Rob Herring <robh@kernel.org> wrote:
> On Thu, Mar 01, 2018 at 04:25:11PM +0100, Enric Balletbo i Serra wrote:
>> 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.
>>
>> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
>> Reviewed-by: Heiko Stuebner <heiko@sntech.de>
>> ---
>>
>> Changes in v2:
>> - [2/6] Rewrite the justification as suggested by Heiko Stuebner.
>>
>>  Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt | 2 ++
>>  1 file changed, 2 insertions(+)
>
> And extcon should be deprecated IMO.
>
> Reviewed-by: Rob Herring <robh@kernel.org>

Hello Rob,

I'm currently learning a bit about USB and extcon.

Could you provide some background on why you think extcon should be
deprecated? What do you propose we replace it with?

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

* Re: [PATCH v2 1/6] phy: rockchip-typec: fall back to working in host-mode if extcon is missing.
  2018-03-01 15:25 ` [PATCH v2 1/6] phy: rockchip-typec: fall back to working in host-mode if extcon is missing Enric Balletbo i Serra
@ 2018-03-14  8:14   ` Heiko Stübner
  2018-03-16  5:59     ` Kishon Vijay Abraham I
  0 siblings, 1 reply; 18+ messages in thread
From: Heiko Stübner @ 2018-03-14  8:14 UTC (permalink / raw)
  To: Enric Balletbo i Serra, kishon
  Cc: groeck, gwendal, kernel, vicencb, linux-rockchip, linux-kernel,
	linux-arm-kernel

Hi Kishon,

Am Donnerstag, 1. März 2018, 16:25:10 CET schrieb Enric Balletbo i Serra:
> Right now the rockchip type-c phy does fail probing when no extcon is
> detected. Some boards get the cable-state via the extcon interface and
> have this supported, other boards seem to use the fusb302 chip or
> another but the driver currently does not seem to utilize the extcon
> interface to report the cable-state. And, other, just connect the type-c
> to a standard USB-A port so use no controller at all. A missing extcon
> shouldn't fail to probe, instead, should just fall back to working in
> host-mode if it cannot get the extcon.
> 
> 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>

Reviewed-by: Heiko Stuebner <heiko@sntech.de>

I did revert the original commit mentioned in the fixes tag for 4.16-rc
but it would nevertheless be really cool if these 2 patches (code + binding)
could make it into your tree for 4.17 :-)

And ideally also with the other 5 patches from Enric starting at
	[PATCH v3 1/6] phy: rockchip-typec: deprecate some DT properties for various register fields.

from 2018-02-16.


Thanks
Heiko

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

* Re: [PATCH v2 1/6] phy: rockchip-typec: fall back to working in host-mode if extcon is missing.
  2018-03-14  8:14   ` Heiko Stübner
@ 2018-03-16  5:59     ` Kishon Vijay Abraham I
  0 siblings, 0 replies; 18+ messages in thread
From: Kishon Vijay Abraham I @ 2018-03-16  5:59 UTC (permalink / raw)
  To: Heiko Stübner, Enric Balletbo i Serra
  Cc: groeck, gwendal, kernel, vicencb, linux-rockchip, linux-kernel,
	linux-arm-kernel



On Wednesday 14 March 2018 01:44 PM, Heiko Stübner wrote:
> Hi Kishon,
> 
> Am Donnerstag, 1. März 2018, 16:25:10 CET schrieb Enric Balletbo i Serra:
>> Right now the rockchip type-c phy does fail probing when no extcon is
>> detected. Some boards get the cable-state via the extcon interface and
>> have this supported, other boards seem to use the fusb302 chip or
>> another but the driver currently does not seem to utilize the extcon
>> interface to report the cable-state. And, other, just connect the type-c
>> to a standard USB-A port so use no controller at all. A missing extcon
>> shouldn't fail to probe, instead, should just fall back to working in
>> host-mode if it cannot get the extcon.
>>
>> 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>
> 
> Reviewed-by: Heiko Stuebner <heiko@sntech.de>
> 
> I did revert the original commit mentioned in the fixes tag for 4.16-rc
> but it would nevertheless be really cool if these 2 patches (code + binding)
> could make it into your tree for 4.17 :-)
> 
> And ideally also with the other 5 patches from Enric starting at
> 	[PATCH v3 1/6] phy: rockchip-typec: deprecate some DT properties for various register fields.
> 
> from 2018-02-16.

merged now, thanks!

-Kishon

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

* Re: [PATCH v2 3/6] arm64: dts: rockchip: enable typec-phy for rk3399-sapphire.
  2018-03-01 15:25 ` [PATCH v2 3/6] arm64: dts: rockchip: enable typec-phy for rk3399-sapphire Enric Balletbo i Serra
  2018-03-03 11:17   ` Vicente Bergas
@ 2018-03-16 10:38   ` Heiko Stuebner
  1 sibling, 0 replies; 18+ messages in thread
From: Heiko Stuebner @ 2018-03-16 10:38 UTC (permalink / raw)
  To: Enric Balletbo i Serra
  Cc: kishon, groeck, gwendal, kernel, vicencb, devicetree, Jianqun Xu,
	Jacob Chen, linux-kernel, linux-rockchip, Shawn Lin, Rob Herring,
	Will Deacon, Mark Rutland, Catalin Marinas, linux-arm-kernel

Am Donnerstag, 1. März 2018, 16:25:12 CET schrieb Enric Balletbo i Serra:
> 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>

I've amended the message a bit to clarify that the offending commit
has been reverted for now and this change is needed for reenabling it
and also dropped the Fixes tag.

I've also moved the node to a better place - if in doubt please sort
the "&foo {" things alphabetically.

I've applied the result in my 4.17 branch, but may move that to 4.18
depending on timing. The reenablement of the otg-port will be in
4.18 only anyway.


Heiko

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

* Re: [PATCH v2 4/6] arm64: dts: rockchip: enable typec-phy for rk3399-firefly.
  2018-03-01 15:25 ` [PATCH v2 4/6] arm64: dts: rockchip: enable typec-phy for rk3399-firefly Enric Balletbo i Serra
@ 2018-03-16 10:38   ` Heiko Stuebner
  0 siblings, 0 replies; 18+ messages in thread
From: Heiko Stuebner @ 2018-03-16 10:38 UTC (permalink / raw)
  To: Enric Balletbo i Serra
  Cc: kishon, groeck, gwendal, kernel, vicencb, devicetree,
	Pierre-Hugues Husson, Jianqun Xu, Kever Yang, linux-kernel,
	linux-rockchip, Shawn Lin, Rob Herring, Will Deacon,
	Mark Rutland, Catalin Marinas, linux-arm-kernel

Am Donnerstag, 1. März 2018, 16:25:13 CET schrieb Enric Balletbo i Serra:
> 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>

[Same blurb as in patch 3/6]
I've amended the message a bit to clarify that the offending commit
has been reverted for now and this change is needed for reenabling it
and also dropped the Fixes tag.

I've also moved the node to a better place - if in doubt please sort
the "&foo {" things alphabetically.

I've applied the result in my 4.17 branch, but may move that to 4.18
depending on timing. The reenablement of the otg-port will be in
4.18 only anyway.


Heiko

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

* Re: [PATCH v2 5/6] arm64: dts: rockchip: enable typec-phy1 for rk3399-puma.
  2018-03-01 15:25 ` [PATCH v2 5/6] arm64: dts: rockchip: enable typec-phy1 for rk3399-puma Enric Balletbo i Serra
  2018-03-02 19:49   ` klaus.goger
@ 2018-03-16 10:39   ` Heiko Stuebner
  1 sibling, 0 replies; 18+ messages in thread
From: Heiko Stuebner @ 2018-03-16 10:39 UTC (permalink / raw)
  To: Enric Balletbo i Serra
  Cc: kishon, 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

Am Donnerstag, 1. März 2018, 16:25:14 CET schrieb Enric Balletbo i Serra:
> 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>

[Same blurb as in patch 3/6]
I've amended the message a bit to clarify that the offending commit
has been reverted for now and this change is needed for reenabling it
and also dropped the Fixes tag.

I've also moved the node to a better place - if in doubt please sort
the "&foo {" things alphabetically.

I've applied the result in my 4.17 branch, but may move that to 4.18
depending on timing. The reenablement of the otg-port will be in
4.18 only anyway.


Heiko

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

* Re: [PATCH v2 6/6] arm64: dts: rockchip: enable typec-phy0 for rk3399-puma-haikou.
  2018-03-01 15:25 ` [PATCH v2 6/6] arm64: dts: rockchip: enable typec-phy0 for rk3399-puma-haikou Enric Balletbo i Serra
  2018-03-02 19:49   ` klaus.goger
@ 2018-03-16 10:39   ` Heiko Stuebner
  1 sibling, 0 replies; 18+ messages in thread
From: Heiko Stuebner @ 2018-03-16 10:39 UTC (permalink / raw)
  To: Enric Balletbo i Serra
  Cc: kishon, groeck, gwendal, kernel, vicencb, devicetree,
	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

Am Donnerstag, 1. März 2018, 16:25:15 CET schrieb Enric Balletbo i Serra:
> 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>

I've amended the message a bit to clarify that the offending commit
has been reverted for now and this change is needed for reenabling it
and also dropped the Fixes tag.

I've applied the result in my 4.17 branch, but may move that to 4.18
depending on timing. The reenablement of the otg-port will be in
4.18 only anyway.


Heiko

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

end of thread, other threads:[~2018-03-16 10:39 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-01 15:25 [PATCH v2 0/6] phy: rockchip-typec: fix boards that does not report cable-state Enric Balletbo i Serra
2018-03-01 15:25 ` [PATCH v2 1/6] phy: rockchip-typec: fall back to working in host-mode if extcon is missing Enric Balletbo i Serra
2018-03-14  8:14   ` Heiko Stübner
2018-03-16  5:59     ` Kishon Vijay Abraham I
2018-03-01 15:25 ` [PATCH v2 2/6] dt-bindings: phy-rockchip-typec: move extcon property to be optional Enric Balletbo i Serra
2018-03-07 19:34   ` Rob Herring
2018-03-07 19:42     ` Alexandru Stan
2018-03-01 15:25 ` [PATCH v2 3/6] arm64: dts: rockchip: enable typec-phy for rk3399-sapphire Enric Balletbo i Serra
2018-03-03 11:17   ` Vicente Bergas
2018-03-16 10:38   ` Heiko Stuebner
2018-03-01 15:25 ` [PATCH v2 4/6] arm64: dts: rockchip: enable typec-phy for rk3399-firefly Enric Balletbo i Serra
2018-03-16 10:38   ` Heiko Stuebner
2018-03-01 15:25 ` [PATCH v2 5/6] arm64: dts: rockchip: enable typec-phy1 for rk3399-puma Enric Balletbo i Serra
2018-03-02 19:49   ` klaus.goger
2018-03-16 10:39   ` Heiko Stuebner
2018-03-01 15:25 ` [PATCH v2 6/6] arm64: dts: rockchip: enable typec-phy0 for rk3399-puma-haikou Enric Balletbo i Serra
2018-03-02 19:49   ` klaus.goger
2018-03-16 10:39   ` Heiko Stuebner

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).