netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Andrew Lunn <andrew@lunn.ch>
Cc: "Lad, Prabhakar" <prabhakar.csengg@gmail.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Giuseppe Cavallaro <peppe.cavallaro@st.com>,
	Jose Abreu <joabreu@synopsys.com>,
	netdev <netdev@vger.kernel.org>
Subject: Re: [QUERY] : STMMAC Clocks
Date: Sat, 1 Mar 2025 10:41:01 +0000	[thread overview]
Message-ID: <Z8LkPQ-w_jyXriFp@shell.armlinux.org.uk> (raw)
In-Reply-To: <84b9c6b7-46b1-444f-b8db-d1f6d4fc5d1c@lunn.ch>

On Sat, Mar 01, 2025 at 12:38:04AM +0100, Andrew Lunn wrote:
> On Fri, Feb 28, 2025 at 09:51:15PM +0000, Lad, Prabhakar wrote:
> > Hi All,
> > 
> > I am bit confused related clocks naming in with respect to STMMAC driver,
> > 
> > We have the below clocks in the binding doc:
> > - stmmaceth
> > - pclk
> > - ptp_ref
> > 
> > But there isn't any description for this. Based on this patch [0]
> > which isn't in mainline we have,
> > - stmmaceth - system clock
> > - pclk - CSR clock
> > - ptp_ref - PTP reference clock.
> > 
> > [0] https://patches.linaro.org/project/netdev/patch/20210208135609.7685-23-Sergey.Semin@baikalelectronics.ru/
> > 
> > Can somebody please clarify on the above as I am planning to add a
> > platform which supports the below clocks:
> > - CSR clock
> > - AXI system clock
> > - Tx & Tx-180
> > - Rx & Rx-180
> 
> Please take a look at the recent patches to stmmac for clock handling,
> in particular the clocks used for RGMII
> 
> For the meaning of the clocks, you need to look at the vendors binding
> document. Vendors tend to call the clocks whatever they want, rather
> than have one consistent naming between vendors. The IP might be
> licensed, but each vendor integrates it differently, inventing their
> own clock names. It might of helped if Synopsis had requested in there
> databook what each clock was called, so there was some consistency,
> but this does not appear to of happened.

Part of the problem is that vendors can place clock muxes and gates
and divisors around the Synopsys block, where some muxes/divisors can
be controlled by signals output by the Synopsys block (and thus are
hidden from software). This is especially true of the pair of clk_tx_i
and pair of clk_rx_i clocks.

Thus, the clocks that are visible may be functionally different from
the Synopsys defined clocks.

However, I think that we should push to standardise on the Synopsys
named clock names where they exist (essentially optional) and then
allow platform specific clocks where they're buried out of view in
the way I describe above.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!

  reply	other threads:[~2025-03-01 10:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-28 21:51 [QUERY] : STMMAC Clocks Lad, Prabhakar
2025-02-28 23:38 ` Andrew Lunn
2025-03-01 10:41   ` Russell King (Oracle) [this message]
2025-03-01 15:15     ` Andrew Lunn
2025-03-01 15:51       ` Russell King (Oracle)
2025-03-02 16:51   ` Lad, Prabhakar
2025-03-01 10:35 ` Russell King (Oracle)
2025-03-02 17:37   ` Lad, Prabhakar
2025-03-02 19:06     ` Russell King (Oracle)

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=Z8LkPQ-w_jyXriFp@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=alexandre.torgue@foss.st.com \
    --cc=andrew@lunn.ch \
    --cc=joabreu@synopsys.com \
    --cc=netdev@vger.kernel.org \
    --cc=peppe.cavallaro@st.com \
    --cc=prabhakar.csengg@gmail.com \
    /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).