[PATCH RFC net-next 1/7] net: stmmac: provide generic transmit clock configuration hook
Thierry Reding
thierry.reding at gmail.com
Tue Feb 25 12:33:10 PST 2025
On Tue, Feb 18, 2025 at 11:14:39AM +0000, Russell King (Oracle) wrote:
> Several stmmac sub-drivers which support RGMII follow the same pattern.
> They calculate the transmit clock, and then call the clk API to set a
> clock to that rate.
>
> Analysis of documentation suggests that the platform is responsible for
> providing the transmit clock to the DWMAC core (clk_tx_i). The expected
> rates are:
>
> 10Mbps 100Mbps 1Gbps
> MII 2.5MHz 25MHz
> GMII 125MHz
> RGMI 2.5MHz 25MHz 125MHz
> RMII 2.5MHz 25MHz
>
> 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 configuring the clock.
>
> 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 interface mode, speed, and
> transmit clock.
>
> Signed-off-by: Russell King (Oracle) <rmk+kernel at armlinux.org.uk>
> ---
> drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 11 +++++++++++
> include/linux/stmmac.h | 4 ++++
> 2 files changed, 15 insertions(+)
Reviewed-by: Thierry Reding <treding at nvidia.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20250225/5ada4185/attachment.sig>
More information about the linux-arm-kernel
mailing list