linux_dsm_epyc7002/drivers/net/ethernet/stmicro/stmmac
Martin Blumenstingl 433c6cab9d net: stmmac: dwmac-meson8b: fix setting the RGMII TX clock on Meson8b
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: 566e825162 ("net: stmmac: add a glue driver for the Amlogic Meson 8b / GXBB DWMAC")
Reported-by: Emiliano Ingrassia <ingrassia@epigenesys.com>
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Reviewed-by: Jerome Brunet <jbrunet@baylibre.com>
Tested-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-17 14:41:05 -05:00
..
altr_tse_pcs.c net: ethernet: stmmac: Convert timers to use timer_setup() 2017-10-18 12:39:37 +01:00
altr_tse_pcs.h
chain_mode.c net: stmmac: set total length of the packet to be transmitted in TDES3 2017-04-13 12:40:09 -04:00
common.h net: stmmac: Fix bad RX timestamp extraction 2017-12-19 14:12:15 -05:00
descs_com.h net: stmmac: remove freesoftware address 2017-02-08 15:11:23 -05:00
descs.h net: stmmac: remove freesoftware address 2017-02-08 15:11:23 -05:00
dwmac4_core.c net: stmmac: fix LPI transitioning for dwmac4 2017-11-14 22:04:56 +09:00
dwmac4_descs.c net: stmmac: Pad ring number with zeroes in display_ring() 2018-01-02 21:54:56 -05:00
dwmac4_descs.h stmmac: fix PTP support for GMAC4 2016-11-15 19:56:17 -05:00
dwmac4_dma.c net: stmmac: Disable flow ctrl for RX AVB queues and really enable TX AVB queues 2017-10-14 11:12:08 -07:00
dwmac4_dma.h net: stmmac: rx and tx ring length prepared for multiple queues 2017-03-15 14:44:32 -07:00
dwmac4_lib.c net: stmmac: prepare rx/tx set tail function for multiple queues 2017-03-15 14:44:32 -07:00
dwmac4.h net: stmmac: fix LPI transitioning for dwmac4 2017-11-14 22:04:56 +09:00
dwmac100_core.c net-next: stmmac: rework the speed selection 2017-05-25 13:08:35 -04:00
dwmac100_dma.c net: stmmac: Adjust dump offset of DMA registers for ethtool 2017-07-24 16:19:10 -07:00
dwmac100.h net: stmmac: remove freesoftware address 2017-02-08 15:11:23 -05:00
dwmac1000_core.c net-next: stmmac: rework the speed selection 2017-05-25 13:08:35 -04:00
dwmac1000_dma.c net: stmmac: Adjust dump offset of DMA registers for ethtool 2017-07-24 16:19:10 -07:00
dwmac1000.h net: stmmac: remove freesoftware address 2017-02-08 15:11:23 -05:00
dwmac_dma.h net: stmmac: Adjust dump offset of DMA registers for ethtool 2017-07-24 16:19:10 -07:00
dwmac_lib.c net: stmmac: dwmac_lib: fix interchanged sleep/timeout values in DMA reset function 2017-10-13 10:19:52 -07:00
dwmac-anarion.c net: stmmac: Add Adaptrum Anarion GMAC glue layer 2017-08-06 21:31:32 -07:00
dwmac-dwc-qos-eth.c net: stmmac: dwc-qos-eth: Fix typo in DT bindings parsing 2017-10-27 23:23:19 +09:00
dwmac-generic.c net: stmmac: dwmac-generic: add missing compatible strings 2016-12-08 11:35:37 -05:00
dwmac-ipq806x.c net: ethernet: stmmac: Clean up dead code 2017-10-08 21:19:07 -07:00
dwmac-lpc18xx.c net: ethernet: stmmac: fix of-node and fixed-link-phydev leaks 2016-12-02 10:42:47 -05:00
dwmac-meson8b.c net: stmmac: dwmac-meson8b: fix setting the RGMII TX clock on Meson8b 2018-01-17 14:41:05 -05:00
dwmac-meson.c net: ethernet: stmmac: fix of-node and fixed-link-phydev leaks 2016-12-02 10:42:47 -05:00
dwmac-oxnas.c net: stmmac: dwmac-oxnas: use generic pm implementation 2017-01-03 09:33:00 -05:00
dwmac-rk.c net: stmmac: dwmac-rk: Add RK3128 GMAC support 2017-10-03 15:39:56 -07:00
dwmac-socfpga.c net: stmmac: socfgpa: Ensure emac bit set in sys manager for MII/GMII/SGMII. 2017-08-23 20:26:58 -07:00
dwmac-sti.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-12-03 12:29:53 -05:00
dwmac-stm32.c ethernet: dwmac-stm32: Fix copyright 2017-11-29 10:08:09 -05:00
dwmac-sun8i.c net: stmmac: dwmac-sun8i: fix allwinner,leds-active-low handling 2017-11-30 09:44:56 -05:00
dwmac-sunxi.c net: ethernet: stmmac: fix of-node and fixed-link-phydev leaks 2016-12-02 10:42:47 -05:00
enh_desc.c net: stmmac: Pad ring number with zeroes in display_ring() 2018-01-02 21:54:56 -05:00
Kconfig net: stmmac: dwmac-sun8i: Handle integrated/external MDIOs 2017-10-27 11:58:49 +09:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mmc_core.c net: stmmac: remove freesoftware address 2017-02-08 15:11:23 -05:00
mmc.h net: stmmac: remove freesoftware address 2017-02-08 15:11:23 -05:00
norm_desc.c net: stmmac: Pad ring number with zeroes in display_ring() 2018-01-02 21:54:56 -05:00
ring_mode.c net: stmmac: set total length of the packet to be transmitted in TDES3 2017-04-13 12:40:09 -04:00
stmmac_ethtool.c net: stmmac: Adjust dump offset of DMA registers for ethtool 2017-07-24 16:19:10 -07:00
stmmac_hwtstamp.c net: stmmac: Fix TX timestamp calculation 2017-12-19 14:12:14 -05:00
stmmac_main.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2018-01-09 10:37:00 -05:00
stmmac_mdio.c net: stmmac: Delete dead code for MDIO registration 2017-09-05 14:36:18 -07:00
stmmac_pci.c stmmac: pci: Use dmi_system_id table for retrieving PHY addresses 2017-06-22 13:39:57 -04:00
stmmac_pcs.h
stmmac_platform.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-11-04 09:26:51 +09:00
stmmac_platform.h net: ethernet: stmmac: fix of-node and fixed-link-phydev leaks 2016-12-02 10:42:47 -05:00
stmmac_ptp.c net: ethernet: make ptp_clock_info const 2017-08-22 11:04:51 -07:00
stmmac_ptp.h stmmac: fix ptp header for GMAC3 hw timestamp 2017-06-09 12:39:25 -04:00
stmmac.h net-next: stmmac: Convert old_link to bool 2017-05-25 13:08:35 -04:00