linux_dsm_epyc7002/drivers/net
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
..
appletalk
arcnet
bonding net: bonding: Replace mac address parsing 2017-12-20 12:47:29 -05:00
caif treewide: setup_timer() -> timer_setup() 2017-11-21 15:57:07 -08:00
can linux-can-next-for-4.16-20180105 2018-01-15 16:13:34 -05:00
cris drivers/net: cris: Convert timers to use timer_setup() 2017-11-21 15:46:44 -08:00
dsa net: dsa: lan9303: check error value from devm_gpiod_get_optional() 2018-01-15 13:18:02 -05:00
ethernet net: stmmac: dwmac-meson8b: fix setting the RGMII TX clock on Meson8b 2018-01-17 14:41:05 -05:00
fddi
fjes
hamradio treewide: Remove TIMER_FUNC_TYPE and TIMER_DATA_TYPE casts 2017-11-21 16:35:54 -08:00
hippi hippi: Fix a Fix a possible sleep-in-atomic bug in rr_close 2017-12-13 14:52:57 -05:00
hyperv hv_netvsc: empty current transmit aggregation if flow blocked 2017-12-13 15:57:39 -05:00
ieee802154 net: ieee802154: adf7242: Rework IRQ and packet handling 2017-11-29 16:49:41 +01:00
ipvlan ipvlan: remove excessive packet scrubbing 2017-12-15 11:36:53 -05:00
netdevsim bpf: offload: allow netdev to disappear while verifier is running 2017-12-31 16:12:23 +01:00
phy phy: realtek: use new helpers for paged register access 2018-01-16 13:56:33 -05:00
plip
ppp ppp: unlock all_ppp_mutex before registering device 2018-01-15 13:22:03 -05:00
slip slip: sl_alloc(): remove unused parameter "dev_t line" 2017-12-08 14:41:02 -05:00
team
usb Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2018-01-17 00:10:42 -05:00
vmxnet3 vmxnet3: increase default rx ring sizes 2017-11-30 14:06:58 -05:00
wan Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-11-29 13:10:25 -08:00
wimax
wireless Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2018-01-17 00:10:42 -05:00
xen-netback xen-netback: Fix logging message with spurious period after newline 2017-12-06 15:10:32 -05:00
dummy.c net: dummy: remove fake SR-IOV functionality 2017-12-03 00:27:58 +01:00
eql.c treewide: setup_timer() -> timer_setup() 2017-11-21 15:57:07 -08:00
geneve.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2018-01-09 10:37:00 -05:00
gtp.c
ifb.c
Kconfig netdevsim: add software driver for testing offloads 2017-12-03 00:27:57 +01:00
LICENSE.SRC
loopback.c
macsec.c macsec: Add support for GCM-AES-256 cipher suite 2018-01-09 11:34:18 -05:00
macvlan.c macvlan: Fix one possible double free 2018-01-02 13:30:14 -05:00
macvtap.c
Makefile netdevsim: add software driver for testing offloads 2017-12-03 00:27:57 +01:00
mdio.c
mii.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
Space.c
sungem_phy.c
tap.c tun/tap: use ptr_ring instead of skb_array 2018-01-09 10:56:10 -05:00
thunderbolt.c net: thunderbolt: Stop using zero to mean no valid DMA mapping 2017-11-25 23:56:02 +09:00
tun.c tuntap: XDP transmission 2018-01-09 10:57:08 -05:00
veth.c veth: set peer GSO values 2017-12-08 14:22:59 -05:00
virtio_net.c virtio_net: propagate linkspeed/duplex settings from the hypervisor 2018-01-09 11:37:56 -05:00
vrf.c
vsockmon.c
vxlan.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-12-22 11:16:31 -05:00
xen-netfront.c xen-netfront: enable device after manual module load 2018-01-08 14:17:03 -05:00