Skip to content

Commit

Permalink
net: stmmac: sun8i: force select external PHY when no internal one
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Ondrej Jirman <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Icenowy authored and davem330 committed Jun 24, 2019
1 parent adadd38 commit 0fec7e7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
Original file line number Diff line number Diff line change
Expand Up @@ -898,6 +898,11 @@ static int sun8i_dwmac_set_syscon(struct stmmac_priv *priv)
* address. No need to mask it again.
*/
reg |= 1 << H3_EPHY_ADDR_SHIFT;
} else {
/* For SoCs without internal PHY the PHY selection bit should be
* set to 0 (external PHY).
*/
reg &= ~H3_EPHY_SELECT;
}

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

0 comments on commit 0fec7e7

Please sign in to comment.