Loading
net: stmmac: dwmac-meson: Manage the "ethernet" clock
Meson6 and Meson8 (both use the same glue registers on top of the DWMAC
IP) have a dedicated Ethernet clock. For RMII mode the SoC has an input
for an external RMII reference clock signal (which can be provided by
either the PHY or an external oscillator). This clock needs to run at
50MHz because the additional glue registers can divide by 2 - to achieve
25MHz for 100Mbit/s line speed, or 20 - to achieve 2.5MHz for 10Mbit/s
line speed.
Set the correct frequency for this clock and enable it during init. Also
enable the ETHMAC_DIV_EN bit which enables the divider in the glue
registers, based on the Ethernet clock input.
Signed-off-by:
Martin Blumenstingl <martin.blumenstingl@googlemail.com>