linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Andersson <andersson@kernel.org>
To: Johan Hovold <johan@kernel.org>
Cc: Shazad Hussain <quic_shazhuss@quicinc.com>,
	Stephen Boyd <sboyd@kernel.org>,
	bmasney@redhat.com, Andy Gross <agross@kernel.org>,
	Konrad Dybcio <konrad.dybcio@somainline.org>,
	Michael Turquette <mturquette@baylibre.com>,
	linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1] clk: qcom: gcc-sc8280xp: add cxo as parent for gcc_ufs_ref_clkref_clk
Date: Thu, 3 Nov 2022 10:23:55 -0500	[thread overview]
Message-ID: <20221103152355.5sfbkpsfvjzgeixi@builder.lan> (raw)
In-Reply-To: <Y2OEjNAPXg5BfOxH@hovoldconsulting.com>

On Thu, Nov 03, 2022 at 10:06:20AM +0100, Johan Hovold wrote:
> On Wed, Nov 02, 2022 at 09:49:49PM -0500, Bjorn Andersson wrote:
> > On Wed, Nov 02, 2022 at 10:26:13AM +0100, Johan Hovold wrote:
> > > On Wed, Nov 02, 2022 at 02:15:26PM +0530, Shazad Hussain wrote:
> > > > On 11/2/2022 1:43 PM, Johan Hovold wrote:
> > > 
> > > > > Right, but if the PHYs really requires CX and it is not an ancestor of
> > > > > the refclk then this should be described by the binding (and not be
> > > > > hidden away in the clock driver).
> > > 
> > > > This makes sense, will be posting v2 post for the same.
> > > > I assume this should use the Fixes tag then !
> > > 
> > > Yeah, I guess to you can add a fixes tag for the commits adding support
> > > for sc8280xp to the UFS PHY binding and driver.
> > > 
> > > But please do check with the hardware documentation first so we get this
> > > right this time.
> > > 
> > > I've already asked Bjorn to see what he can dig out as it is still not
> > > clear how the two "card" refclocks (GCC_UFS_CARD_CLKREF_CLK and
> > > GCC_UFS_1_CARD_CLKREF_CLK) are supposed to be used.
> > > 
> > 
> > We've come full circle and Shazad's patch came from that discussion :)
> 
> Ah, good. :)
> 
> > In line with the downstream dts, we have GCC_UFS{,_1}_CARD_CLKREF_CLK
> > providing a reference clock to the two phys. Then GCC_UFS_REF_CLKREF_CLK
> > feeds the UFS refclock pads (both of them), which connect to the memory
> > device(s).
> > 
> > In other words, GCC_UFS{,_1}_CARD_CLKREF_CLK should be "ref" in
> > respective phy.
> > 
> > GCC_UFS_REF_CLKREF_CLK is the clock to the devices, but as we don't
> > represent the memory device explicitly it seems suitable to use as
> > "ref_clk" in the ufshc nodes - which would then match the special
> > handling of the "link clock" in the UFS driver.
> 
> Thanks for clearing that up. Using GCC_UFS_REF_CLKREF_CLK as ref_clk for
> the controller sounds reasonable.
> 
> I guess the only missing piece is which "card" ref clock is used by
> which PHY.
> 
> The ADP dts uses:
> 
> 	phy			ref clock
> 
> 	phy@1d87000 (UFS_PHY)	GCC_UFS_CARD_CLKREF_CLK
> 	phy@1da7000 (UFS_CARD)	GCC_UFS_1_CARD_CLKREF_CLK
> 

This matches the documentation.

Regards,
Bjorn

> but that is not what the firmware on ADP and CRD seem to enable.
> 
> Both the ADP and CRD fw leaves GCC_UFS_1_CARD_CLKREF_CLK enabled, while
> GCC_UFS_CARD_CLKREF_CLK is only enabled on ADP (which unlike the CRD
> also uses the UFS_CARD controller).
> 
> Does the ADP dts have these clocks switched or is the firmware confused?
> 
> (Also note that experiments suggest that neither refclock appears to
> has to be explicitly enabled for the controllers to function.)
> 
> > All three clocks are sourced off the CXO pad, so I would like this patch
> > to cover at least all of these. And
> > 
> > Fixes: d65d005f9a6c ("clk: qcom: add sc8280xp GCC driver")
> > 
> > seems to be in order for such patch.
> > 
> > 
> > @Johan, would you mind writing a dts patch flipping the clocks around
> > and Shazad can update this patch?
> 
> I'll do so, but I'll wait with posting until you can confirm which
> clkref is which.
> 
> Johan

  reply	other threads:[~2022-11-03 15:24 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-30 14:23 [PATCH v1] clk: qcom: gcc-sc8280xp: add cxo as parent for gcc_ufs_ref_clkref_clk Shazad Hussain
2022-10-31 11:22 ` Brian Masney
2022-11-01 18:23 ` Stephen Boyd
2022-11-02  7:16   ` Johan Hovold
2022-11-02  7:58     ` Shazad Hussain
2022-11-02  8:13       ` Johan Hovold
2022-11-02  8:45         ` Shazad Hussain
2022-11-02  9:26           ` Johan Hovold
2022-11-03  2:49             ` Bjorn Andersson
2022-11-03  9:06               ` Johan Hovold
2022-11-03 15:23                 ` Bjorn Andersson [this message]
2022-11-04  9:29                   ` Johan Hovold
2022-11-03  2:54 ` Bjorn Andersson

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=20221103152355.5sfbkpsfvjzgeixi@builder.lan \
    --to=andersson@kernel.org \
    --cc=agross@kernel.org \
    --cc=bmasney@redhat.com \
    --cc=johan@kernel.org \
    --cc=konrad.dybcio@somainline.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=quic_shazhuss@quicinc.com \
    --cc=sboyd@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;
as well as URLs for NNTP newsgroup(s).