OpenCloudOS-Kernel/drivers/net/ethernet/stmicro/stmmac
Jesper Nilsson 08dad2f4d5 net: stmmac: allow CSR clock of 300MHz
The Synopsys Ethernet IP uses the CSR clock as a base clock for MDC.
The divisor used is set in the MAC_MDIO_Address register field CR
(Clock Rate)

The divisor is there to change the CSR clock into a clock that falls
below the IEEE 802.3 specified max frequency of 2.5MHz.

If the CSR clock is 300MHz, the code falls back to using the reset
value in the MAC_MDIO_Address register, as described in the comment
above this code.

However, 300MHz is actually an allowed value and the proper divider
can be estimated quite easily (it's just 1Hz difference!)

A CSR frequency of 300MHz with the maximum clock rate value of 0x5
(STMMAC_CSR_250_300M, a divisor of 124) gives somewhere around
~2.42MHz which is below the IEEE 802.3 specified maximum.

For the ARTPEC-8 SoC, the CSR clock is this problematic 300MHz,
and unfortunately, the reset-value of the MAC_MDIO_Address CR field
is 0x0.

This leads to a clock rate of zero and a divisor of 42, and gives an
MDC frequency of ~7.14MHz.

Allow CSR clock of 300MHz by making the comparison inclusive.

Signed-off-by: Jesper Nilsson <jesper.nilsson@axis.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-09-11 10:19:51 +01:00
..
Kconfig ethernet: fix PTP_1588_CLOCK dependencies 2021-08-13 17:49:05 -07:00
Makefile stmmac: pci: Add dwmac support for Loongson 2021-06-18 11:48:34 -07:00
altr_tse_pcs.c
altr_tse_pcs.h
chain_mode.c net: stmmac: Add support to Ethtool get/set ring parameters 2020-09-16 15:22:52 -07:00
common.h net: stmmac: add ethtool per-queue irq statistic support 2021-08-16 11:36:04 +01:00
descs.h net: stmmac: Initial support for TBS 2020-01-13 18:31:48 -08:00
descs_com.h
dwmac-anarion.c of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
dwmac-dwc-qos-eth.c of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
dwmac-generic.c of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
dwmac-imx.c of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
dwmac-ingenic.c net: stmmac: Fix error return code in ingenic_mac_probe() 2021-06-16 12:02:38 -07:00
dwmac-intel-plat.c of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
dwmac-intel.c stmmac: intel: set PCI_D3hot in suspend 2021-06-29 11:34:48 -07:00
dwmac-intel.h stmmac: intel: move definitions to dwmac-intel header file 2021-06-12 13:10:52 -07:00
dwmac-ipq806x.c net: ethernet: stmmac: Do not use unreachable() in ipq806x_gmac_probe() 2021-08-07 09:45:46 +01:00
dwmac-loongson.c stmmac: dwmac-loongson:Fix missing return value 2021-09-06 12:52:52 +01:00
dwmac-lpc18xx.c of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
dwmac-mediatek.c of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
dwmac-meson.c of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
dwmac-meson8b.c of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
dwmac-oxnas.c of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
dwmac-qcom-ethqos.c net: stmmac: Use devm_platform_ioremap_resource_byname() 2021-06-09 15:24:43 -07:00
dwmac-rk.c net: stmmac: dwmac-rk: fix unbalanced pm_runtime_enable warnings 2021-08-25 10:37:17 +01:00
dwmac-socfpga.c of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
dwmac-sti.c of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
dwmac-stm32.c of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
dwmac-sun8i.c of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
dwmac-sunxi.c net: stmicro: handle clk_prepare() failure during init 2021-05-13 17:33:18 +02:00
dwmac-visconti.c of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
dwmac4.h net: stmmac: Add hardware supported cross-timestamp 2021-03-24 15:12:36 -07:00
dwmac4_core.c net: stmmac: add est_irq_status callback function for GMAC 4.10 and 5.10 2021-07-26 12:29:44 +01:00
dwmac4_descs.c net: stmmac: fix wrongly set buffer2 valid when sph unsupport 2021-02-26 15:17:11 -08:00
dwmac4_descs.h net: stmmac: gmac4+: Add TBS support 2020-01-13 18:31:48 -08:00
dwmac4_dma.c net: stmmac: Do not enable RX FIFO overflow interrupts 2021-05-07 15:53:57 -07:00
dwmac4_dma.h net: stmmac: Add HW descriptor prefetch setting for DWMAC Core 5.20 onwards 2021-04-22 15:02:40 -07:00
dwmac4_lib.c net: stmmac: add ethtool per-queue irq statistic support 2021-08-16 11:36:04 +01:00
dwmac5.c net: stmmac: enable platform specific safety features 2021-06-01 16:59:50 -07:00
dwmac5.h net: stmmac: enable platform specific safety features 2021-06-01 16:59:50 -07:00
dwmac100.h
dwmac100_core.c
dwmac100_dma.c
dwmac1000.h net: stmmac: dwmac1000: Fix extended MAC address registers definition 2021-06-11 13:05:55 -07:00
dwmac1000_core.c net: stmmac: dwmac1000: provide multicast filter fallback 2020-08-12 13:12:52 -07:00
dwmac1000_dma.c net: stmmac: add per-queue TX & RX coalesce ethtool support 2021-03-17 14:36:24 -07:00
dwmac_dma.h net: stmmac: introduce DMA interrupt status masking per traffic direction 2021-03-25 17:37:30 -07:00
dwmac_lib.c net: stmmac: introduce DMA interrupt status masking per traffic direction 2021-03-25 17:37:30 -07:00
dwxgmac2.h net: stmmac: introduce DMA interrupt status masking per traffic direction 2021-03-25 17:37:30 -07:00
dwxgmac2_core.c net: stmmac: enable platform specific safety features 2021-06-01 16:59:50 -07:00
dwxgmac2_descs.c net: stmmac: fix wrongly set buffer2 valid when sph unsupport 2021-02-26 15:17:11 -08:00
dwxgmac2_dma.c net: stmmac: introduce DMA interrupt status masking per traffic direction 2021-03-25 17:37:30 -07:00
dwxlgmac2.h net: stmmac: Add support for Enterprise MAC version 2020-03-17 21:37:25 -07:00
enh_desc.c net: stmmac: fix dma physical address of descriptor when display ring 2021-02-26 15:17:11 -08:00
hwif.c net: stmmac: Add support for Enterprise MAC version 2020-03-17 21:37:25 -07:00
hwif.h net: pcs: xpcs: convert to phylink_pcs_ops 2021-06-03 13:30:43 -07:00
mmc.h
mmc_core.c
norm_desc.c net: stmmac: fix dma physical address of descriptor when display ring 2021-02-26 15:17:11 -08:00
ring_mode.c net: stmmac: Add support to Ethtool get/set ring parameters 2020-09-16 15:22:52 -07:00
stmmac.h stmmac: Revert "stmmac: align RX buffers" 2021-08-20 14:44:49 -07:00
stmmac_ethtool.c ethtool: extend coalesce setting uAPI with CQE mode 2021-08-24 07:38:29 -07:00
stmmac_hwtstamp.c net: stmmac: Add support for external trigger timestamping 2021-04-14 12:57:45 -07:00
stmmac_main.c net: stmmac: allow CSR clock of 300MHz 2021-09-11 10:19:51 +01:00
stmmac_mdio.c net: stmmac: reverse Christmas tree notation in stmmac_xpcs_setup 2021-06-11 13:43:55 -07:00
stmmac_pci.c net: stmmac: enable platform specific safety features 2021-06-01 16:59:50 -07:00
stmmac_pcs.h
stmmac_platform.c net: stmmac: platform: fix build warning when with !CONFIG_PM_SLEEP 2021-09-09 11:14:07 +01:00
stmmac_platform.h of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
stmmac_ptp.c net: stmmac: ptp: update tas basetime after ptp adjust 2021-07-05 10:16:17 -07:00
stmmac_ptp.h net: stmmac: Add support for external trigger timestamping 2021-04-14 12:57:45 -07:00
stmmac_selftests.c net: stmmac: Add support to Ethtool get/set ring parameters 2020-09-16 15:22:52 -07:00
stmmac_tc.c net: stmmac: fix kernel panic due to NULL pointer dereference of plat->est 2021-08-23 11:49:34 +01:00
stmmac_xdp.c net: stmmac: fix kernel panic due to NULL pointer dereference of xsk_pool 2021-08-25 10:59:39 +01:00
stmmac_xdp.h net: stmmac: Enable RX via AF_XDP zero-copy 2021-04-13 15:06:51 -07:00