433c6cab9d
Meson8b only supports MPLL2 as clock input. The rate of the MPLL2 clock
set by Odroid-C1's u-boot is close to (but not exactly) 500MHz. The
exact rate is 500002394Hz, which is calculated in
drivers/clk/meson/clk-mpll.c using the following formula:
DIV_ROUND_UP_ULL((u64)parent_rate * SDM_DEN, (SDM_DEN * n2) + sdm)
Odroid-C1's u-boot configures MPLL2 with the following values:
- SDM_DEN = 16384
- SDM = 1638
- N2 = 5
The 250MHz clock (m250_div) inside dwmac-meson8b driver is derived from
the MPLL2 clock. Due to MPLL2 running slightly faster than 500MHz the
common clock framework chooses a divider which is too big to generate
the 250MHz clock (a divider of 2 would be needed, but this is rounded up
to a divider of 3). This breaks the RTL8211F RGMII PHY on Odroid-C1
because it requires a (close to) 125MHz RGMII TX clock (on Gbit speeds,
the IP block internally divides that down to 25MHz on 100Mbit/s
connections and 2.5MHz on 10Mbit/s connections - we don't need any
special configuration for that).
Round the divider to the closest value to prevent this issue on Meson8b.
This means we'll now end up with a clock rate for the RGMII TX clock of
125001197Hz (= 125MHz plus 1197Hz), which is close-enough to 125MHz.
This has no effect on the Meson GX SoCs since there fclk_div2 is used as
input clock, which has a rate of 1000MHz (and thus is divisible cleanly
to 250MHz and 125MHz).
Fixes:
|
||
---|---|---|
.. | ||
altr_tse_pcs.c | ||
altr_tse_pcs.h | ||
chain_mode.c | ||
common.h | ||
descs_com.h | ||
descs.h | ||
dwmac4_core.c | ||
dwmac4_descs.c | ||
dwmac4_descs.h | ||
dwmac4_dma.c | ||
dwmac4_dma.h | ||
dwmac4_lib.c | ||
dwmac4.h | ||
dwmac100_core.c | ||
dwmac100_dma.c | ||
dwmac100.h | ||
dwmac1000_core.c | ||
dwmac1000_dma.c | ||
dwmac1000.h | ||
dwmac_dma.h | ||
dwmac_lib.c | ||
dwmac-anarion.c | ||
dwmac-dwc-qos-eth.c | ||
dwmac-generic.c | ||
dwmac-ipq806x.c | ||
dwmac-lpc18xx.c | ||
dwmac-meson8b.c | ||
dwmac-meson.c | ||
dwmac-oxnas.c | ||
dwmac-rk.c | ||
dwmac-socfpga.c | ||
dwmac-sti.c | ||
dwmac-stm32.c | ||
dwmac-sun8i.c | ||
dwmac-sunxi.c | ||
enh_desc.c | ||
Kconfig | ||
Makefile | ||
mmc_core.c | ||
mmc.h | ||
norm_desc.c | ||
ring_mode.c | ||
stmmac_ethtool.c | ||
stmmac_hwtstamp.c | ||
stmmac_main.c | ||
stmmac_mdio.c | ||
stmmac_pci.c | ||
stmmac_pcs.h | ||
stmmac_platform.c | ||
stmmac_platform.h | ||
stmmac_ptp.c | ||
stmmac_ptp.h | ||
stmmac.h |