OSDN Git Service

net-next: stmmac: dwmac-sun8i: force EPHY clock freq to 24MHz
authorIcenowy Zheng <icenowy@aosc.io>
Sat, 17 Jun 2017 14:07:36 +0000 (22:07 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 20 Jun 2017 17:23:05 +0000 (13:23 -0400)
commit1450ba8a61a96a7f7f9742e149ea6aaf90817e20
tree22cfb74469c9cd74cb46223a521210d7c369e854
parent2b5bdebd00cca9cc5c6159b998b91f2f2a412aa2
net-next: stmmac: dwmac-sun8i: force EPHY clock freq to 24MHz

The EPHY control part of the EMAC syscon register has a bit called
CLK_SEL. On the datasheet it says that if it's 0 the EPHY clock is 25MHz
and if it's 1 the clock is 24MHz.

However, according to the datasheets, no Allwinner SoC with EPHY has any
extra xtal input pins for the EPHY, and the system xtal is 24MHz.

That means the EPHY is not possible to get a 25MHz xtal input, and thus
the frequency can only be 24MHz.

It doesn't matter on H3 as the default value of H3 is 24MHz, however on
V3s the default value is wrongly set to 25MHz, which prevented the EPHY
from working properly.

Force the EPHY clock frequency to 24MHz.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c