Linux-Rockchip Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Christopher Obbard <chris.obbard@collabora.com>
To: Da Xue <da@lessconfused.com>
Cc: Jagan Teki <jagan@amarulasolutions.com>,
	Heiko Stuebner <heiko@sntech.de>,
	 Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	linux-rockchip@lists.infradead.org,
	 linux-arm-kernel@lists.infradead.org,
	devicetree@vger.kernel.org, Corentin Labbe <clabbe@baylibre.com>,
	kernel <kernel@collabora.com>
Subject: Re: [PATCH] arm64: dts: rockchip: Enable TYPE-C PD for ROC-RK3399-PC
Date: Tue, 25 Jul 2023 09:02:21 +0100	[thread overview]
Message-ID: <8ec1c4bb97ba0857275a540590fb302929436ba4.camel@collabora.com> (raw)
In-Reply-To: <CACdvmAia49_YiKpVvT=yeLWF+YGm+2vFK3rdwRB9XOAH5mm=-w@mail.gmail.com>

Hi Da, Jagan,

On Tue, 2023-07-25 at 03:39 -0400, Da Xue wrote:
> On Mon, Jul 24, 2023 at 9:55 AM Christopher Obbard
> <chris.obbard@collabora.com> wrote:
> > 
> > On Wed, 2023-07-19 at 17:51 +0530, Jagan Teki wrote:
> > > The power supply circuit in ROC-RK3399-PC is
> > > 
> > > Power Supply (or PPS) => FUSB => MP8859
> > > 
> > > VUBS pin of FUSB and IN pin of MP8859 is supplied via TYPEC_IN.
> > > 
> > > The MP8859 operated with 2.8V to 22V supply voltage and typical
> > > applications this supply can be 12V.
> > > 
> > > This patch is trying to support the PD by changing the FUSB VBUS supply
> > > to 12V and tune the I2C7 timings from downstream kernel.
> > > 
> > > Tested with PD3.0 PPS with supply voltages of 12V/3A and 20V/5A.
> > 
> > Hi Jagan,
> > 
> > This series works fine with a "dumb" (no PD negotiation) 5.1V Raspberry Pi PSU.
> > 
> > It also works fine with a Dell 45W USB-C Laptop Power Supply (model AA45NM170) which provides 5V@3A,9V@3A,15V@3A,20V@2.25A, where Linux master fails and just tells the USB-PD PSU to power-off.
> 
> I think this depends on the recent Rockchip TCPM changes. FUSB302 has
> been a pain in the USB or else this platform would have launched a lot
> longer ago.

Sorry, I was testing this patch on top of next-20230724 which includes https://patchwork.kernel.org/project/linux-rockchip/list/?series=757752:

 8be558dcffe69b078b34b1fa93b82acaf4ce4957 ("usb: typec: tcpm: add get max power support")
 1e35f074399dece73d5df11847d4a0d7a6f49434 ("usb: typec: tcpm: fix cc role at port reset")

Can you check if I am missing any other patches ?


Thank you

> 
> > 
> > It doesn't work with a Lenovo 65W PSU (model ADLX65YLC3D) which provides 5V@2A,9V@2A,15V@3A,20V@3.25A, after negotiation the driver turns the PD PSU off and on again, resetting the board.
> > So it'd be great to get this fixed, but it seems like the sink-pdos should already support this PSU ?
> 
> Something to note about USB PD that I read in the TI PD 2.0 paper and
> re-spewing based on memory: during transitions, the sink should
> self-limit to 500mA. If that is the case, the transition behavior is
> up to the source.
> 
> > 
> > 
> > As a side note for full transparency, another issue is that with Linux master or with this patch applied, applying power to the DC_12V header without a USB-C PSU connected (e.g. powering from the
> > POE
> > expansion shield), boot hangs and dumps to an initramfs shell with:
> > 
> >   [    7.411798] random: crng init done
> >   [   12.568138] platform fe3a0000.usb: deferred probe pending
> >   [   12.568673] platform sdio-pwrseq: deferred probe pending
> >   [   12.569162] platform fe3e0000.usb: deferred probe pending
> >   [   12.569658] platform adc-keys: deferred probe pending
> >   [   12.570123] i2c 7-0022: deferred probe pending
> >   [   12.570533] i2c 4-0022: deferred probe pending
> >   [   12.570944] platform ff940000.hdmi: deferred probe pending
> >   [   12.571448] platform vcc3v0-sd: deferred probe pending
> >   [   12.572000] platform vcc1v8-s3: deferred probe pending
> >   [   12.572475] platform sys-12v: deferred probe pending
> >   [   12.572933] platform vcc3v3-sys: deferred probe pending
> >   [   12.573412] platform fe320000.mmc: deferred probe pending
> >   [   12.573907] platform vcca-0v9: deferred probe pending
> >   [   12.574371] platform vcc5v0-host-regulator: deferred probe pending
> >   [   12.574935] platform ff770000.syscon:usb2phy@e450: deferred probe pending
> >   [   12.575552] platform vcc-vbus-typec1: deferred probe pending
> >   [   12.576090] platform fe300000.ethernet: deferred probe pending
> >   [   12.576623] platform vcc-sys: deferred probe pending
> >   [   12.577080] platform ff770000.syscon:usb2phy@e460: deferred probe pending
> >   [   12.577697] platform ff320000.syscon:io-domains: deferred probe pending
> >   [   12.578298] platform ff770000.syscon:io-domains: deferred probe pending
> >   [   12.578901] platform fe800000.usb: deferred probe pending
> >   [   12.579395] platform fe900000.usb: deferred probe pending
> >   [   12.579904] platform vdd-log: deferred probe pending
> >   [   12.580362] i2c 0-001b: deferred probe pending
> >   [   12.580772] i2c 0-0040: deferred probe pending
> >   [   12.581182] platform cpufreq-dt: deferred probe pending
> >   [   12.581663] i2c 0-0041: deferred probe pending
> > 
> > 
> > 
> > Thanks,
> > 
> > Chris
> > 
> > > 
> > > Cc: Corentin Labbe <clabbe@baylibre.com>
> > > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
> > > ---
> > >  .../boot/dts/rockchip/rk3399-roc-pc.dtsi      | 19 ++++++++++++++++---
> > >  1 file changed, 16 insertions(+), 3 deletions(-)
> > > 
> > > diff --git a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi
> > > index c32913df93c3..8963b3858eae 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"
> > > 
> > > @@ -524,8 +525,9 @@ &i2c3 {
> > >  };
> > > 
> > >  &i2c4 {
> > > -       i2c-scl-rising-time-ns = <600>;
> > > -       i2c-scl-falling-time-ns = <20>;
> > > +       clock-frequency = <400000>;
> > > +       i2c-scl-rising-time-ns = <345>;
> > > +       i2c-scl-falling-time-ns = <11>;
> > >         status = "okay";
> > > 
> > >         fusb1: usb-typec@22 {
> > > @@ -552,8 +554,19 @@ fusb0: usb-typec@22 {
> > >                 interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
> > >                 pinctrl-names = "default";
> > >                 pinctrl-0 = <&fusb0_int>;
> > > -               vbus-supply = <&vcc_vbus_typec0>;
> > > +               vbus-supply = <&dc_12v>;
> > >                 status = "okay";
> > > +
> > > +               connector {
> > > +                       compatible = "usb-c-connector";
> > > +                       data-role = "dual";
> > > +                       label = "USB-C";
> > > +                       power-role = "sink";
> > > +                       try-power-role = "sink";
> > > +                       op-sink-microwatt = <10000000>;
> > > +                       sink-pdos = <PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)
> > > +                                    PDO_VAR(5000, 20000, 5000)>;
> > > +               };
> > >         };
> > > 
> > >         mp8859: regulator@66 {
> > 
> > --
> > Christopher Obbard BEng (Hons) MIET
> > Senior Engineer
> > 
> > Collabora Ltd
> > Platinum Building, St John's Innovation Park, Cambridge CB4 0DS, UK
> > Registered in England & Wales no 5513718.
> > This message is intended for the use of only the person(s) ("intended
> > recipient") to whom it is addressed.
> > It may contain information that is privileged and confidential.
> > Accordingly, any dissemination, distribution, copying or other use of
> > this message or any of its content by any person other than the
> > intended recipient may constitute a breach of civil or criminal law and
> > is strictly prohibited.
> > 
> > 
> > _______________________________________________
> > 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

  reply	other threads:[~2023-07-25  8:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-19 12:21 [PATCH] arm64: dts: rockchip: Enable TYPE-C PD for ROC-RK3399-PC Jagan Teki
2023-07-24 13:55 ` Christopher Obbard
2023-07-25  7:39   ` Da Xue
2023-07-25  8:02     ` Christopher Obbard [this message]
2023-07-28 18:30       ` Heiko Stuebner
2023-07-28 18:45         ` Jagan Teki
2023-07-29  2:30           ` Frank Wang
2023-08-30 21:07             ` Da Xue
2023-09-22 23:14               ` Da Xue
2023-07-28 18:52   ` Jagan Teki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8ec1c4bb97ba0857275a540590fb302929436ba4.camel@collabora.com \
    --to=chris.obbard@collabora.com \
    --cc=clabbe@baylibre.com \
    --cc=conor+dt@kernel.org \
    --cc=da@lessconfused.com \
    --cc=devicetree@vger.kernel.org \
    --cc=heiko@sntech.de \
    --cc=jagan@amarulasolutions.com \
    --cc=kernel@collabora.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox