net: phy: dp83826: Add support for phy-mode configuration
authorJérémie Dautheribes <jeremie.dautheribes@bootlin.com>
Thu, 22 Feb 2024 10:31:16 +0000 (11:31 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 26 Feb 2024 11:38:44 +0000 (11:38 +0000)
commitd2ed0774b6334ce3986c5efb17ab9c4095b8d969
tree1afe756a8abfb45bbb3b20c9eac3d2f5faca799f
parent95f4fa1f459a69827d752bd55205af7c55b76e4e
net: phy: dp83826: Add support for phy-mode configuration

The TI DP83826 PHY can operate in either MII mode or RMII mode.
By default, it is configured by straps.
It can also be configured by writing to the bit 5 of register 0x17 - RMII
and Status Register (RCSR).

When phydev->interface is rmii, rmii mode must be enabled, otherwise
mii mode must be set.
This prevents misconfiguration of hw straps.

Signed-off-by: Jérémie Dautheribes <jeremie.dautheribes@bootlin.com>
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/dp83822.c