net: sun8i-emac: Always clear syscon EPHY register
authorAndre Przywara <andre.przywara@arm.com>
Mon, 11 Jan 2021 20:11:45 +0000 (21:11 +0100)
committerAndre Przywara <andre.przywara@arm.com>
Sun, 31 Jan 2021 23:55:56 +0000 (23:55 +0000)
commitb14e520517cc0f5bdababfb1cc2909f228437d53
tree875219abe4b0329f4e8737ad013ffde5d51d837e
parent76404f86a24aa28efc26a296bf6ab9d697c60b9f
net: sun8i-emac: Always clear syscon EPHY register

At the moment we only consider the EPHY register for those SoCs were
we actually have an internal PHY to configure. However even other SoCs
have this register, an expect the EPHY select bit to be cleared for
proper operation with an external PHY.

Rework sun8i_emac_set_syscon_ephy() to be called regardless of the EMAC
model, and clear the H3_EPHY_SELECT bit if no internal PHY is used.

We get away without it so far because SoCs like the A64 clear this bit
on reset, but we need to explicitly clear it on the H616, for instance.
The Linux driver does so as well.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Tested-by: Jernej Skrabec <jernej.skrabec@siol.net>
Reviewed-by: Jernej Skrabec <jernej.skrabec@siol.net>
drivers/net/sun8i_emac.c