Skip to content

Commit 0fec7e7

Browse files
Icenowydavem330
authored andcommitted
net: stmmac: sun8i: force select external PHY when no internal one
The PHY selection bit also exists on SoCs without an internal PHY; if it's set to 1 (internal PHY, default value) then the MAC will not make use of any PHY on such SoCs. This problem appears when adapting for H6, which has no real internal PHY (the "internal PHY" on H6 is not on-die, but on a co-packaged AC200 chip, connected via RMII interface at GPIO bank A). Force the PHY selection bit to 0 when the SOC doesn't have an internal PHY, to address the problem of a wrong default value. Signed-off-by: Icenowy Zheng <icenowy@aosc.io> Signed-off-by: Ondrej Jirman <megous@megous.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent adadd38 commit 0fec7e7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -898,6 +898,11 @@ static int sun8i_dwmac_set_syscon(struct stmmac_priv *priv)
898898
* address. No need to mask it again.
899899
*/
900900
reg |= 1 << H3_EPHY_ADDR_SHIFT;
901+
} else {
902+
/* For SoCs without internal PHY the PHY selection bit should be
903+
* set to 0 (external PHY).
904+
*/
905+
reg &= ~H3_EPHY_SELECT;
901906
}
902907

903908
if (!of_property_read_u32(node, "allwinner,tx-delay-ps", &val)) {

0 commit comments

Comments
 (0)