linux-rockchip.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/3] arm64: dts: rockchip: Enable PD for USB-C-Port on rk3399-roc-pc.
@ 2019-12-10 12:45 Markus Reichl
       [not found] ` <678df227-38be-47af-7ee3-741a391a196c-SRyzfwRm/0rPTwkrwQOX7A@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Markus Reichl @ 2019-12-10 12:45 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Heiko Stuebner, Jagan Teki,
	Markus Reichl, devicetree, linux-arm-kernel, linux-rockchip,
	linux-kernel

USB-C-Port 0 on rk3399-roc-pc is designed to supply the board.
To meet the power requirements of up to 45W a power delivery (PD)
compatible supply is needed. To configure the PD the node of the
fusb302 needs a connector property with desired PD description.

Signed-off-by: Markus Reichl <m.reichl@fivetechno.de>
---
Presently the board in mainline has to be powered from a 12V supply,
connected to two pins on the expansion header as the standard 5V
delivered by the unconfigured USB-C plug is not enough for higher
loads or peripherals on USB or M.2.

With this patch the board requests 15V from the PD and runs fine
on high loads with NVME SSD, Ethernet, SDIO WLAN and USB peripherals.
During boot the 12V supply is still needed for some seconds,
as the fusb302 shuts down or resets the PD shortly when initializing (BUG?).

The board's 12V line is running presently on 5V, the default output
voltage of the MP8859 on I2C-7, for wich no mainline kernel driver exists yet.
---
  arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi | 16 ++++++++++++++--
  1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi
index 8e01b04144b7..90783b2b1d1f 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi
@@ -6,6 +6,7 @@
  /dts-v1/;
  #include <dt-bindings/input/linux-event-codes.h>
  #include <dt-bindings/pwm/pwm.h>
+#include <dt-bindings/usb/pd.h>
  #include "rk3399.dtsi"
  #include "rk3399-opp.dtsi"
  
@@ -540,11 +541,22 @@ fusb0: usb-typec@22 {
  		compatible = "fcs,fusb302";
  		reg = <0x22>;
  		interrupt-parent = <&gpio1>;
-		interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
+		interrupts = <RK_PA2 IRQ_TYPE_LEVEL_LOW>;
  		pinctrl-names = "default";
  		pinctrl-0 = <&fusb0_int>;
  		vbus-supply = <&vcc_vbus_typec0>;
-		status = "okay";
+
+		usb_con: connector {
+			compatible = "usb-c-connector";
+			label = "USB-C-0";
+			power-role = "dual";
+			try-power-role = "sink";
+			source-pdos = <PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)>;
+			sink-pdos = <PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)
+				     PDO_VAR(5000, 15000, 3000)
+				     PDO_PPS_APDO(5000, 15000, 3000)>;
+			op-sink-microwatt = <45000000>;
+		};
  	};
  };
  
-- 
2.24.0

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

* Re: [PATCH 2/3] arm64: dts: rockchip: Enable PD for USB-C-Port on rk3399-roc-pc.
       [not found] ` <678df227-38be-47af-7ee3-741a391a196c-SRyzfwRm/0rPTwkrwQOX7A@public.gmane.org>
@ 2019-12-12 15:46   ` Thomas McKahan
  2019-12-21 12:57     ` Heiko Stuebner
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas McKahan @ 2019-12-12 15:46 UTC (permalink / raw)
  To: Markus Reichl
  Cc: Mark Rutland, devicetree-u79uwXL29TY76Z2rM5mHXA, Heiko Stuebner,
	narmstrong-rdvid1DuHRBWk0Htik3J/w,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Rob Herring,
	Jagan Teki, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

Hello Markus,

    I have been working with this as well, came across it on Armbian. I was also trying to eliminate the warning concerning the lack of port with limited success.  I also missed the interrupt pin definition I see.  I will test this later today.  

   I've added Neil Armstrong for information in case any boards on the Amlogic side are similarly configured, I think a few other Rockchip ones at least are missing connector nodes, it appears to be a consistent issue presumably due to driver changes.

-Tony


⁣

On Dec 10, 2019, 7:45 AM, at 7:45 AM, Markus Reichl <m.reichl@fivetechno.de> wrote:
>USB-C-Port 0 on rk3399-roc-pc is designed to supply the board.
>To meet the power requirements of up to 45W a power delivery (PD)
>compatible supply is needed. To configure the PD the node of the
>fusb302 needs a connector property with desired PD description.
>
>Signed-off-by: Markus Reichl <m.reichl@fivetechno.de>
>---
>Presently the board in mainline has to be powered from a 12V supply,
>connected to two pins on the expansion header as the standard 5V
>delivered by the unconfigured USB-C plug is not enough for higher
>loads or peripherals on USB or M.2.
>
>With this patch the board requests 15V from the PD and runs fine
>on high loads with NVME SSD, Ethernet, SDIO WLAN and USB peripherals.
>During boot the 12V supply is still needed for some seconds,
>as the fusb302 shuts down or resets the PD shortly when initializing
>(BUG?).
>
>The board's 12V line is running presently on 5V, the default output
>voltage of the MP8859 on I2C-7, for wich no mainline kernel driver
>exists yet.
>---
>  arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi | 16 ++++++++++++++--
>  1 file changed, 14 insertions(+), 2 deletions(-)
>
>diff --git a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi
>b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi
>index 8e01b04144b7..90783b2b1d1f 100644
>--- a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi
>+++ b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi
>@@ -6,6 +6,7 @@
>  /dts-v1/;
>  #include <dt-bindings/input/linux-event-codes.h>
>  #include <dt-bindings/pwm/pwm.h>
>+#include <dt-bindings/usb/pd.h>
>  #include "rk3399.dtsi"
>  #include "rk3399-opp.dtsi"
>  
>@@ -540,11 +541,22 @@ fusb0: usb-typec@22 {
>  		compatible = "fcs,fusb302";
>  		reg = <0x22>;
>  		interrupt-parent = <&gpio1>;
>-		interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
>+		interrupts = <RK_PA2 IRQ_TYPE_LEVEL_LOW>;
>  		pinctrl-names = "default";
>  		pinctrl-0 = <&fusb0_int>;
>  		vbus-supply = <&vcc_vbus_typec0>;
>-		status = "okay";
>+
>+		usb_con: connector {
>+			compatible = "usb-c-connector";
>+			label = "USB-C-0";
>+			power-role = "dual";
>+			try-power-role = "sink";
>+			source-pdos = <PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)>;
>+			sink-pdos = <PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)
>+				     PDO_VAR(5000, 15000, 3000)
>+				     PDO_PPS_APDO(5000, 15000, 3000)>;
>+			op-sink-microwatt = <45000000>;
>+		};
>  	};
>  };
>  
>-- 
>2.24.0
>
>
>_______________________________________________
>Linux-rockchip mailing list
>Linux-rockchip@lists.infradead.org
>http://lists.infradead.org/mailman/listinfo/linux-rockchip


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

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

* Re: [PATCH 2/3] arm64: dts: rockchip: Enable PD for USB-C-Port on rk3399-roc-pc.
  2019-12-12 15:46   ` Thomas McKahan
@ 2019-12-21 12:57     ` Heiko Stuebner
  0 siblings, 0 replies; 3+ messages in thread
From: Heiko Stuebner @ 2019-12-21 12:57 UTC (permalink / raw)
  To: Thomas McKahan
  Cc: Mark Rutland, devicetree, narmstrong, linux-kernel,
	Markus Reichl, linux-rockchip, Rob Herring, Jagan Teki,
	linux-arm-kernel

Hi Thomas,

Am Donnerstag, 12. Dezember 2019, 16:46:09 CET schrieb Thomas McKahan:
> Hello Markus,
> 
>     I have been working with this as well, came across it on Armbian. I was also trying to eliminate the warning concerning the lack of port with limited success.  I also missed the interrupt pin definition I see.  I will test this later today.  

Where you successful in your testing? My type-c exposure is somewhat
limited so it would be nice to get another opinion ;-)

>    I've added Neil Armstrong for information in case any boards on the Amlogic side are similarly configured, I think a few other Rockchip ones at least are missing connector nodes, it appears to be a consistent issue presumably due to driver changes.

The whole type-c topic is a somewhat undiscovered country on rk3399, due to
the cross-ec hooking rk3399's type-c components. (see the cros-ec-pd extcon
going to the rockchip type-c phy etc).

This is presently worked on so that also everything can at some point use the
kernel-internal type-c framework.

But of course this doesn't hinder configuring the power-develivery in the
fusb302 ICs already :-D .


Heiko

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

end of thread, other threads:[~2019-12-21 12:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-10 12:45 [PATCH 2/3] arm64: dts: rockchip: Enable PD for USB-C-Port on rk3399-roc-pc Markus Reichl
     [not found] ` <678df227-38be-47af-7ee3-741a391a196c-SRyzfwRm/0rPTwkrwQOX7A@public.gmane.org>
2019-12-12 15:46   ` Thomas McKahan
2019-12-21 12:57     ` 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).