net: phy: tja11xx: Add TJA11xx PHY driver
Subsystems (4)
PATCH v6 1/1 net: phy: tja11xx: Add TJA11xx PHY driver
Add driver for the NXP TJA1100 and TJA1101 PHYs. These PHYs are special BroadRReach 100BaseT1 PHYs used in automotive.
---
V2: - Use phy_modify(), phy_{set,clear}_bits()
- Drop enable argument of tja11xx_enable_link_control()
- Use PHY_BASIC_T1_FEATURES and dont modify supported/advertised features in config_init callback
- Use genphy_soft_reset() instead of opencoding the reset sequence.
- Drop the aneg parts, since the PHY datasheet claims it does not support aneg
V3: - Replace clr with mask
- Add hwmon support
- Check commstat in tja11xx_read_status() only if link is up
- Use PHY_ID_MATCH_MODEL()
V4: - Use correct bit in tja11xx_hwmon_read() hwmon_temp_crit_alarm
- Use ENOMEM if devm_kstrdup() fails
- Check $type in tja11xx_hwmon_read() in addition to $attr
V5: - Drop assignment of phydev->irq,pause,asym_pause
V6: - Add R-B from Florian.
--- drivers/net/phy/Kconfig | 6 + drivers/net/phy/Makefile | 1 + drivers/net/phy/nxp-tja11xx.c | 423 ++++++++++++++++++++++++++++++++++ 3 files changed, 430 insertions(+) create mode 100644 drivers/net/phy/nxp-tja11xx.c
drivers/net/phy/Kconfig +6 -0
@@ -416,6 +416,12 @@ config NATIONAL_PHY ---help--- Currently supports the DP83865 PHY. +config NXP_TJA11XX_PHY + tristate "NXP TJA11xx PHYs support" + depends on HWMON + ---help--- + Currently supports the NXP TJA1100 and TJA1101 PHY. + config QSEMI_PHY tristate "Quality Semiconductor PHYs" ---help---
drivers/net/phy/Makefile +1 -0
@@ -82,6 +82,7 @@ obj-$(CONFIG_MICROCHIP_PHY) += microchip.o obj-$(CONFIG_MICROCHIP_T1_PHY) += microchip_t1.o obj-$(CONFIG_MICROSEMI_PHY) += mscc.o obj-$(CONFIG_NATIONAL_PHY) += national.o +obj-$(CONFIG_NXP_TJA11XX_PHY) += nxp-tja11xx.o obj-$(CONFIG_QSEMI_PHY) += qsemi.o obj-$(CONFIG_REALTEK_PHY) += realtek.o obj-$(CONFIG_RENESAS_PHY) += uPD60620.o
drivers/net/phy/nxp-tja11xx.c new file +423 -0
423 lines not on this page · raw message
Signature · 1 line
2.20.1
Quoted 11 lines · Marek Vasut
Add driver for the NXP TJA1100 and TJA1101 PHYs. These PHYs are special BroadRReach 100BaseT1 PHYs used in automotive.
Signed-off-by Marek Vasut <[email protected]>Cc Andrew Lunn <[email protected]>Cc Florian Fainelli <[email protected]>Cc Guenter Roeck <[email protected]>Cc Heiner Kallweit <[email protected]>Cc Jean Delvare <[email protected]>Reviewed-by Florian Fainelli <[email protected]>
drivers/net/phy/nxp-tja11xx.c line 71
Quoted 8 lines
drivers/net/phy/nxp-tja11xx.c new file +8
-0+static struct tja11xx_phy_stats tja11xx_hw_stats[] = { + {"phy_symbol_error_count" ,20 ,0 ,GENMASK (15 ,0 ) }, + {"phy_polarity_detect" ,25 ,6 ,BIT (6 ) }, + {"phy_open_detect" ,25 ,7 ,BIT (7 ) }, + {"phy_short_detect" ,25 ,8 ,BIT (8 ) }, + {"phy_rem_rcvr_count" ,26 ,0 ,GENMASK (7 ,0 ) }, + {"phy_loc_rcvr_count" ,26 ,8 ,GENMASK (15 ,8 ) }, +};
I don't like phy_polarity_detect, phy_open_detect and phy_short_detect since they are not actually counters. But we don't have cable test support yet. That is coming soon, but it is hard to say when, if it will get merged this cycle. So lets keep them, but don't be too surprised if they get removed later.
Andrew
From: Marek Vasut <[email protected]>
Date: Fri, 24 May 2019 16:22:28 +0200
Quoted 11 lines
Add driver for the NXP TJA1100 and TJA1101 PHYs. These PHYs are special BroadRReach 100BaseT1 PHYs used in automotive.
Signed-off-by Marek Vasut <[email protected]>Cc Andrew Lunn <[email protected]>Cc Florian Fainelli <[email protected]>Cc Guenter Roeck <[email protected]>Cc Heiner Kallweit <[email protected]>Cc Jean Delvare <[email protected]>Reviewed-by Florian Fainelli <[email protected]>
Applied, thank you.