net: phy: DP83TC811: Introduce support for the DP83TC811 phy
Subsystems (3)
PATCH v2 1/1 net: phy: DP83TC811: Introduce support for the DP83TC811 phy
Add support for the DP83811 phy.
The DP83811 supports both rgmii and sgmii interfaces. There are 2 part numbers for this the DP83TC811R does not reliably support the SGMII interface but the DP83TC811S will.
There is not a way to differentiate these parts from the hardware or register set. So this is controlled via the DT to indicate which phy mode is required. Or the part can be strapped to a certain interface.
Data sheet can be found here:
http://www.ti.com/product/DP83TC811S-Q1/description
http://www.ti.com/product/DP83TC811R-Q1/description
---
v2 - Remove extra config_init in reset, update config_init call back function
fix a checkpatch alignment issue, add SGMII check in autoneg api - https://patchwork.kernel.org/patch/10389323/
drivers/net/phy/Kconfig | 5 + drivers/net/phy/Makefile | 1 + drivers/net/phy/dp83tc811.c | 350 ++++++++++++++++++++++++++++++++++++ 3 files changed, 356 insertions(+) create mode 100644 drivers/net/phy/dp83tc811.c
drivers/net/phy/Kconfig +5 -0
@@ -285,6 +285,11 @@ config DP83822_PHY ---help--- Supports the DP83822 PHY. +config DP83TC811_PHY + tristate "Texas Instruments DP83TC822 PHY" + ---help--- + Supports the DP83TC822 PHY. + config DP83848_PHY tristate "Texas Instruments DP83848 PHY" ---help---
drivers/net/phy/Makefile +1 -0
@@ -57,6 +57,7 @@ obj-$(CONFIG_CORTINA_PHY) += cortina.o obj-$(CONFIG_DAVICOM_PHY) += davicom.o obj-$(CONFIG_DP83640_PHY) += dp83640.o obj-$(CONFIG_DP83822_PHY) += dp83822.o +obj-$(CONFIG_DP83TC811_PHY) += dp83tc811.o obj-$(CONFIG_DP83848_PHY) += dp83848.o obj-$(CONFIG_DP83867_PHY) += dp83867.o obj-$(CONFIG_FIXED_PHY) += fixed_phy.o
drivers/net/phy/dp83tc811.c new file +350 -0
350 lines not on this page · raw message
Signature · 1 line
2.17.0.582.gccdcbd54c
David Miller
maintainerFrom: Dan Murphy <[email protected]>
Date: Wed, 9 May 2018 09:09:02 -0500
Quoted 15 lines
Add support for the DP83811 phy.
The DP83811 supports both rgmii and sgmii interfaces. There are 2 part numbers for this the DP83TC811R does not reliably support the SGMII interface but the DP83TC811S will.
There is not a way to differentiate these parts from the hardware or register set. So this is controlled via the DT to indicate which phy mode is required. Or the part can be strapped to a certain interface.
Data sheet can be found here:
http://www.ti.com/product/DP83TC811S-Q1/description
http://www.ti.com/product/DP83TC811R-Q1/description
Quoted 5 lines
Signed-off-by Dan Murphy <[email protected]>---
v2 - Remove extra
config_initin reset, updateconfig_initcall back function
fix a checkpatch alignment issue, add SGMII check in autoneg api - https://patchwork.kernel.org/patch/10389323/
Hello Dan, just a few coding style fixes:
drivers/net/phy/dp83tc811.c line 92
Quoted 6 lines
drivers/net/phy/dp83tc811.c new file +6
-0+static int dp83811_set_wol (struct phy_device *phydev, +struct ethtool_wolinfo *wol) +{ +struct net_device *ndev = phydev->attached_dev; +u16 value; +const u8 *mac;
Please order local variables longest to shortest line.
drivers/net/phy/dp83tc811.c line 151
Quoted 5 lines
drivers/net/phy/dp83tc811.c new file +5
-0+static void dp83811_get_wol (struct phy_device *phydev, +struct ethtool_wolinfo *wol) +{ +int value; +u16 sopass_val;
Likewise.
drivers/net/phy/dp83tc811.c line 235
Quoted 4 lines
drivers/net/phy/dp83tc811.c new file +4
-0+static int dp83811_config_aneg (struct phy_device *phydev) +{ +int err; +int value;
Likewise.
However, I would recommend that in these functions having two integer local variables that you just declare them both on the same line like:
int err, value;
drivers/net/phy/dp83tc811.c line 258
Quoted 4 lines
drivers/net/phy/dp83tc811.c new file +4
-0+static int dp83811_config_init (struct phy_device *phydev) +{ +int err; +int value;
Likewise.
Thank you.