Thread (28 messages) 28 messages, 5 authors, 2025-02-28

Re: [PATCH net-next 01/11] net: stmmac: provide set_clk_tx_rate() hook

From: Andrew Lunn <andrew@lunn.ch>
Date: 2025-02-27 14:02:45
Also in: linux-arm-kernel

On Thu, Feb 27, 2025 at 09:16:23AM +0000, Russell King (Oracle) wrote:
Several stmmac sub-drivers which support RGMII follow the same pattern.
They calculate the transmit clock rate, and then call clk_set_rate().

Analysis of several implementation documents suggests that the platform
is responsible for providing the transmit clock to the DWMAC core's
clk_tx_i. The expected rates are:

	10Mbps	100Mbps	1Gbps
MII	2.5MHz	25MHz
RMII	2.5MHz	25MHz
GMII			125MHz
RGMI	2.5MHz	25MHz	125MHz

It seems some platforms require this clock to be manually configured,
but there are outputs from the MAC core that indicate the speed, so a
platform may use these to automatically configure the clock. Thus, we
can't just provide one solution to configure this clock rate.

Moreover, the clock may need to be derived from one of several sources
depending on the interface mode.

Provide a platform hook that is passed the transmit clock, interface
mode and speed.

Reviewed-by: Thierry Reding <redacted>
Signed-off-by: Russell King (Oracle) <redacted>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help