]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit57ffe65c2bbb4772c15041f60138e115b1f4fbb2
tree22cfb74469c9cd74cb46223a521210d7c369e854
parent2c39f3fa02c1de7aaa836bfde75d18a588981a87
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