net: stmmac: sun8i: force select external PHY when no internal one
authorIcenowy Zheng <icenowy@aosc.io>
Thu, 20 Jun 2019 13:47:44 +0000 (15:47 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 26 Jul 2019 07:14:11 +0000 (09:14 +0200)
commit41864adfee2e8aebf695b053a0738bb08aee4b31
tree7244eb159605aaa561787b5ea3a0fa63b5456465
parentbce037abc29f37c88f78be8f893976a7145b4fc3
net: stmmac: sun8i: force select external PHY when no internal one

[ Upstream commit 0fec7e72ae1391bb2d7527efb54fe6ae88acabce ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c