[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <E1vo47h-00000007l0I-3rzN@rmk-PC.armlinux.org.uk>
Date: Thu, 05 Feb 2026 18:30:37 +0000
From: "Russell King (Oracle)" <rmk+kernel@...linux.org.uk>
To: Andrew Lunn <andrew@...n.ch>
Cc: Alexandre Torgue <alexandre.torgue@...s.st.com>,
linux-arm-kernel@...ts.infradead.org,
linux-stm32@...md-mailman.stormreply.com,
netdev@...r.kernel.org
Subject: [PATCH RFC net-next] net: stmmac: add documentation about clocks
Add documentation covering stmmac_clk, pclk, clk_ptp_ref and clk_tx_i
in the hope that this will help understand what each of these clocks
are for.
There is confusion around stmmac_clk and pclk which can't be easily
resolved today as the Imagination Technologies Pistachio board that
pclk was introduced for has no public documentation and is likely now
obsolete. So the origins of pclk are lost to the winds of time.
Signed-off-by: Russell King (Oracle) <rmk+kernel@...linux.org.uk>
---
Is this worth documenting, despite the vagueness of stmmac_clk vs pclk?
Too verbose? Or not sufficient information? What do people think?
include/linux/stmmac.h | 33 ++++++++++++++++++++++++++++++++-
1 file changed, 32 insertions(+), 1 deletion(-)
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
index a7d73b40041e..2367238e587c 100644
--- a/include/linux/stmmac.h
+++ b/include/linux/stmmac.h
@@ -282,10 +282,41 @@ struct plat_stmmacenet_data {
struct phylink_pcs *(*select_pcs)(struct stmmac_priv *priv,
phy_interface_t interface);
void *bsp_priv;
+
+ /* stmmac clocks:
+ * stmmac_clk: CSR clock (which can be hclk_i, clk_csr_i, aclk_i,
+ * or clk_app_i depending on GMAC configuration). This clock
+ * generates the MDC clock.
+ *
+ * pclk: introduced for Imagination Technologies Pistachio board -
+ * see 5f9755d26fbf ("stmmac: Add an optional register interface
+ * clock"). This is probably used for cases where separate clocks
+ * are provided for the host interface and register interface. In
+ * this case, as the MDC clock is derived from stmmac_clk, pclk
+ * can only really be the "application clock" for the "host
+ * interface" and not the "register interface" aka CSR clock as
+ * it is never used when determining the divider for the MDC
+ * clock.
+ *
+ * clk_ptp_ref: optional PTP reference clock (clk_ptp_ref_i). When
+ * present, this clock increments the timestamp value. Otherwise,
+ * the rate of stmmac_clk will be used.
+ *
+ * clk_tx_i: MAC transmit clock, which will be 2.5MHz for 10M,
+ * 25MHz for 100M, or 125MHz for 1G irrespective of the interface
+ * mode. For the DWMAC PHY interface modes:
+ *
+ * GMII/MII PHY's transmit clock for 10M (2.5MHz) or 100M (25MHz),
+ * or 125MHz local clock for 1G mode
+ * RMII 50MHz RMII clock divided by 2 or 20.
+ * RGMII 125MHz local clock divided by 1, 5, or 50.
+ * SGMII 125MHz SerDes clock divided by 1, 5, or 50.
+ * TBI/RTBI 125MHz SerDes clock
+ */
struct clk *stmmac_clk;
struct clk *pclk;
struct clk *clk_ptp_ref;
- struct clk *clk_tx_i; /* clk_tx_i to MAC core */
+ struct clk *clk_tx_i;
unsigned long clk_ptp_rate;
unsigned long clk_ref_rate;
struct clk_bulk_data *clks;
--
2.47.3
Powered by blists - more mailing lists