diff options
author | Tommaso Merciai <tommaso.merciai@amarulasolutions.com> | 2022-05-21 02:58:46 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-05-22 23:46:30 +0300 |
commit | 621427fbdada788f18f77238e1c36f463c2cb9d1 (patch) | |
tree | d192af9257f0461727468c4e87260bd65bd96ca7 /drivers/net/phy/dp83822.c | |
parent | a3f7404c0befe336108094b3141169abd1fb1561 (diff) | |
download | linux-621427fbdada788f18f77238e1c36f463c2cb9d1.tar.xz |
net: phy: DP83822: enable rgmii mode if phy_interface_is_rgmii
RGMII mode can be enable from dp83822 straps, and also writing bit 9
of register 0x17 - RMII and Status Register (RCSR).
When phy_interface_is_rgmii rgmii mode must be enabled, same for
contrary, this prevents malconfigurations of hw straps
References:
- https://www.ti.com/lit/gpn/dp83822i p66
Signed-off-by: Tommaso Merciai <tommaso.merciai@amarulasolutions.com>
Co-developed-by: Michael Trimarchi <michael@amarulasolutions.com>
Suggested-by: Alberto Bianchi <alberto.bianchi@amarulasolutions.com>
Tested-by: Tommaso Merciai <tommaso.merciai@amarulasolutions.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy/dp83822.c')
-rw-r--r-- | drivers/net/phy/dp83822.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/net/phy/dp83822.c b/drivers/net/phy/dp83822.c index ce17b2af3218..e6ad3a494d32 100644 --- a/drivers/net/phy/dp83822.c +++ b/drivers/net/phy/dp83822.c @@ -94,7 +94,8 @@ #define DP83822_WOL_INDICATION_SEL BIT(8) #define DP83822_WOL_CLR_INDICATION BIT(11) -/* RSCR bits */ +/* RCSR bits */ +#define DP83822_RGMII_MODE_EN BIT(9) #define DP83822_RX_CLK_SHIFT BIT(12) #define DP83822_TX_CLK_SHIFT BIT(11) @@ -408,6 +409,12 @@ static int dp83822_config_init(struct phy_device *phydev) if (err) return err; } + + phy_set_bits_mmd(phydev, DP83822_DEVADDR, + MII_DP83822_RCSR, DP83822_RGMII_MODE_EN); + } else { + phy_clear_bits_mmd(phydev, DP83822_DEVADDR, + MII_DP83822_RCSR, DP83822_RGMII_MODE_EN); } if (dp83822->fx_enabled) { |