* [Patch net-next 0/3] add ethtool SQI support for LAN87xx T1 Phy
@ 2022-04-12 6:33 Arun Ramadoss
2022-04-12 6:33 ` [Patch net-next 1/3] net: phy: LAN937x: added PHY_POLL_CABLE_TEST flag Arun Ramadoss
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Arun Ramadoss @ 2022-04-12 6:33 UTC (permalink / raw)
To: netdev, linux-kernel
Cc: Paolo Abeni, Jakub Kicinski, David S. Miller, Russell King,
Heiner Kallweit, Andrew Lunn, UNGLinuxDriver
This patch series add the Signal Quality Index measurement for the LAN87xx and
LAN937x T1 phy. Added the PHY_POLL_CABLE_TEST flag for LAN937x phy. Updated the
maintainers file for microchip_t1.c.
Arun Ramadoss (3):
net: phy: LAN937x: added PHY_POLL_CABLE_TEST flag
net: phy: LAN87xx: add ethtool SQI support
MAINTAINERS: Add maintainers for Microchip T1 Phy driver
MAINTAINERS | 6 +++++
drivers/net/phy/microchip_t1.c | 49 ++++++++++++++++++++++++++++++++++
2 files changed, 55 insertions(+)
base-commit: b66bfc131c69bd9a5ed3ae90be4cf47ec46c1526
--
2.33.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Patch net-next 1/3] net: phy: LAN937x: added PHY_POLL_CABLE_TEST flag
2022-04-12 6:33 [Patch net-next 0/3] add ethtool SQI support for LAN87xx T1 Phy Arun Ramadoss
@ 2022-04-12 6:33 ` Arun Ramadoss
2022-04-12 16:55 ` Andrew Lunn
2022-04-12 17:01 ` Andrew Lunn
2022-04-12 6:33 ` [Patch net-next 2/3] net: phy: LAN87xx: add ethtool SQI support Arun Ramadoss
2022-04-12 6:33 ` [Patch net-next 3/3] MAINTAINERS: Add maintainers for Microchip T1 Phy driver Arun Ramadoss
2 siblings, 2 replies; 8+ messages in thread
From: Arun Ramadoss @ 2022-04-12 6:33 UTC (permalink / raw)
To: netdev, linux-kernel
Cc: Paolo Abeni, Jakub Kicinski, David S. Miller, Russell King,
Heiner Kallweit, Andrew Lunn, UNGLinuxDriver
Added the phy_poll_cable_test flag for the lan937x phy driver.
Tested using command - ethtool --cable-test <dev>
Signed-off-by: Arun Ramadoss <arun.ramadoss@microchip.com>
---
drivers/net/phy/microchip_t1.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/phy/microchip_t1.c b/drivers/net/phy/microchip_t1.c
index 389df3f4293c..363bfbfa182b 100644
--- a/drivers/net/phy/microchip_t1.c
+++ b/drivers/net/phy/microchip_t1.c
@@ -748,6 +748,7 @@ static struct phy_driver microchip_t1_phy_driver[] = {
{
PHY_ID_MATCH_MODEL(PHY_ID_LAN937X),
.name = "Microchip LAN937x T1",
+ .flags = PHY_POLL_CABLE_TEST,
.features = PHY_BASIC_T1_FEATURES,
.config_init = lan87xx_config_init,
.suspend = genphy_suspend,
--
2.33.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Patch net-next 2/3] net: phy: LAN87xx: add ethtool SQI support
2022-04-12 6:33 [Patch net-next 0/3] add ethtool SQI support for LAN87xx T1 Phy Arun Ramadoss
2022-04-12 6:33 ` [Patch net-next 1/3] net: phy: LAN937x: added PHY_POLL_CABLE_TEST flag Arun Ramadoss
@ 2022-04-12 6:33 ` Arun Ramadoss
2022-04-12 16:57 ` Andrew Lunn
2022-04-12 6:33 ` [Patch net-next 3/3] MAINTAINERS: Add maintainers for Microchip T1 Phy driver Arun Ramadoss
2 siblings, 1 reply; 8+ messages in thread
From: Arun Ramadoss @ 2022-04-12 6:33 UTC (permalink / raw)
To: netdev, linux-kernel
Cc: Paolo Abeni, Jakub Kicinski, David S. Miller, Russell King,
Heiner Kallweit, Andrew Lunn, UNGLinuxDriver
This patch add the support for measuring Signal Quality Index for
LAN87xx and LAN937x T1 Phy. It uses the SQI Method 5 for obtaining the
values.
Signed-off-by: Arun Ramadoss <arun.ramadoss@microchip.com>
---
drivers/net/phy/microchip_t1.c | 48 ++++++++++++++++++++++++++++++++++
1 file changed, 48 insertions(+)
diff --git a/drivers/net/phy/microchip_t1.c b/drivers/net/phy/microchip_t1.c
index 363bfbfa182b..509aa78fef85 100644
--- a/drivers/net/phy/microchip_t1.c
+++ b/drivers/net/phy/microchip_t1.c
@@ -68,7 +68,12 @@
#define T1_POST_LCK_MUFACT_CFG_REG 0x1C
#define T1_TX_RX_FIFO_CFG_REG 0x02
#define T1_TX_LPF_FIR_CFG_REG 0x55
+#define T1_COEF_CLK_PWR_DN_CFG 0x04
+#define T1_COEF_RW_CTL_CFG 0x0D
#define T1_SQI_CONFIG_REG 0x2E
+#define T1_SQI_CONFIG2_REG 0x4A
+#define T1_DCQ_SQI_REG 0xC3
+#define T1_DCQ_SQI_MSK GENMASK(3, 1)
#define T1_MDIO_CONTROL2_REG 0x10
#define T1_INTERRUPT_SOURCE_REG 0x18
#define T1_INTERRUPT2_SOURCE_REG 0x08
@@ -82,6 +87,9 @@
#define T1_MODE_STAT_REG 0x11
#define T1_LINK_UP_MSK BIT(0)
+/* SQI defines */
+#define LAN87XX_MAX_SQI 0x07
+
#define DRIVER_AUTHOR "Nisar Sayed <nisar.sayed@microchip.com>"
#define DRIVER_DESC "Microchip LAN87XX/LAN937x T1 PHY driver"
@@ -346,9 +354,20 @@ static int lan87xx_phy_init(struct phy_device *phydev)
T1_TX_LPF_FIR_CFG_REG, 0x1011, 0 },
{ PHYACC_ATTR_MODE_WRITE, PHYACC_ATTR_BANK_DSP,
T1_TX_LPF_FIR_CFG_REG, 0x1000, 0 },
+ /* Setup SQI measurement */
+ { PHYACC_ATTR_MODE_WRITE, PHYACC_ATTR_BANK_DSP,
+ T1_COEF_CLK_PWR_DN_CFG, 0x16d6, 0 },
/* SQI enable */
{ PHYACC_ATTR_MODE_WRITE, PHYACC_ATTR_BANK_DSP,
T1_SQI_CONFIG_REG, 0x9572, 0 },
+ /* SQI select mode 5 */
+ { PHYACC_ATTR_MODE_WRITE, PHYACC_ATTR_BANK_DSP,
+ T1_SQI_CONFIG2_REG, 0x0001, 0 },
+ /* Throws the first SQI reading */
+ { PHYACC_ATTR_MODE_WRITE, PHYACC_ATTR_BANK_DSP,
+ T1_COEF_RW_CTL_CFG, 0x0301, 0 },
+ { PHYACC_ATTR_MODE_READ, PHYACC_ATTR_BANK_DSP,
+ T1_DCQ_SQI_REG, 0, 0 },
/* Flag LPS and WUR as idle errors */
{ PHYACC_ATTR_MODE_WRITE, PHYACC_ATTR_BANK_SMI,
T1_MDIO_CONTROL2_REG, 0x0014, 0 },
@@ -729,6 +748,31 @@ static int lan87xx_config_aneg(struct phy_device *phydev)
return rc;
}
+static int lan87xx_get_sqi(struct phy_device *phydev)
+{
+ u8 sqi_value = 0;
+ int rc;
+
+ rc = access_ereg(phydev, PHYACC_ATTR_MODE_WRITE,
+ PHYACC_ATTR_BANK_DSP, T1_COEF_RW_CTL_CFG, 0x0301);
+ if (rc < 0)
+ return rc;
+
+ rc = access_ereg(phydev, PHYACC_ATTR_MODE_READ,
+ PHYACC_ATTR_BANK_DSP, T1_DCQ_SQI_REG, 0x0);
+ if (rc < 0)
+ return rc;
+
+ sqi_value = FIELD_GET(T1_DCQ_SQI_MSK, rc);
+
+ return sqi_value;
+}
+
+static int lan87xx_get_sqi_max(struct phy_device *phydev)
+{
+ return LAN87XX_MAX_SQI;
+}
+
static struct phy_driver microchip_t1_phy_driver[] = {
{
PHY_ID_MATCH_MODEL(PHY_ID_LAN87XX),
@@ -742,6 +786,8 @@ static struct phy_driver microchip_t1_phy_driver[] = {
.resume = genphy_resume,
.config_aneg = lan87xx_config_aneg,
.read_status = lan87xx_read_status,
+ .get_sqi = lan87xx_get_sqi,
+ .get_sqi_max = lan87xx_get_sqi_max,
.cable_test_start = lan87xx_cable_test_start,
.cable_test_get_status = lan87xx_cable_test_get_status,
},
@@ -755,6 +801,8 @@ static struct phy_driver microchip_t1_phy_driver[] = {
.resume = genphy_resume,
.config_aneg = lan87xx_config_aneg,
.read_status = lan87xx_read_status,
+ .get_sqi = lan87xx_get_sqi,
+ .get_sqi_max = lan87xx_get_sqi_max,
.cable_test_start = lan87xx_cable_test_start,
.cable_test_get_status = lan87xx_cable_test_get_status,
}
--
2.33.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Patch net-next 3/3] MAINTAINERS: Add maintainers for Microchip T1 Phy driver
2022-04-12 6:33 [Patch net-next 0/3] add ethtool SQI support for LAN87xx T1 Phy Arun Ramadoss
2022-04-12 6:33 ` [Patch net-next 1/3] net: phy: LAN937x: added PHY_POLL_CABLE_TEST flag Arun Ramadoss
2022-04-12 6:33 ` [Patch net-next 2/3] net: phy: LAN87xx: add ethtool SQI support Arun Ramadoss
@ 2022-04-12 6:33 ` Arun Ramadoss
2022-04-12 14:58 ` Joe Perches
2 siblings, 1 reply; 8+ messages in thread
From: Arun Ramadoss @ 2022-04-12 6:33 UTC (permalink / raw)
To: netdev, linux-kernel
Cc: Paolo Abeni, Jakub Kicinski, David S. Miller, Russell King,
Heiner Kallweit, Andrew Lunn, UNGLinuxDriver
Signed-off-by: Arun Ramadoss <arun.ramadoss@microchip.com>
---
MAINTAINERS | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/MAINTAINERS b/MAINTAINERS
index fd768d43e048..cede8ccf19b2 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -12903,6 +12903,12 @@ F: drivers/net/dsa/microchip/*
F: include/linux/platform_data/microchip-ksz.h
F: net/dsa/tag_ksz.c
+MICROCHIP LAN87xx/LAN937x T1 PHY DRIVER
+M: UNGLinuxDriver@microchip.com
+L: netdev@vger.kernel.org
+S: Maintained
+F: drivers/net/phy/microchip_t1.c
+
MICROCHIP LAN743X ETHERNET DRIVER
M: Bryan Whitehead <bryan.whitehead@microchip.com>
M: UNGLinuxDriver@microchip.com
--
2.33.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [Patch net-next 3/3] MAINTAINERS: Add maintainers for Microchip T1 Phy driver
2022-04-12 6:33 ` [Patch net-next 3/3] MAINTAINERS: Add maintainers for Microchip T1 Phy driver Arun Ramadoss
@ 2022-04-12 14:58 ` Joe Perches
0 siblings, 0 replies; 8+ messages in thread
From: Joe Perches @ 2022-04-12 14:58 UTC (permalink / raw)
To: Arun Ramadoss, netdev, linux-kernel
Cc: Paolo Abeni, Jakub Kicinski, David S. Miller, Russell King,
Heiner Kallweit, Andrew Lunn, UNGLinuxDriver
On Tue, 2022-04-12 at 12:03 +0530, Arun Ramadoss wrote:
> Signed-off-by: Arun Ramadoss <arun.ramadoss@microchip.com>
> ---
> MAINTAINERS | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index fd768d43e048..cede8ccf19b2 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -12903,6 +12903,12 @@ F: drivers/net/dsa/microchip/*
> F: include/linux/platform_data/microchip-ksz.h
> F: net/dsa/tag_ksz.c
>
> +MICROCHIP LAN87xx/LAN937x T1 PHY DRIVER
> +M: UNGLinuxDriver@microchip.com
Individual people are maintainers.
Random exploder addresses are not maintainers.
Please use an actual person and maybe add something like
M: Actual name <actual_email@domain.tld>
R: UNGLinuxDriver@microchip.com
instead
> +L: netdev@vger.kernel.org
> +S: Maintained
> +F: drivers/net/phy/microchip_t1.c
> +
> MICROCHIP LAN743X ETHERNET DRIVER
> M: Bryan Whitehead <bryan.whitehead@microchip.com>
> M: UNGLinuxDriver@microchip.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Patch net-next 1/3] net: phy: LAN937x: added PHY_POLL_CABLE_TEST flag
2022-04-12 6:33 ` [Patch net-next 1/3] net: phy: LAN937x: added PHY_POLL_CABLE_TEST flag Arun Ramadoss
@ 2022-04-12 16:55 ` Andrew Lunn
2022-04-12 17:01 ` Andrew Lunn
1 sibling, 0 replies; 8+ messages in thread
From: Andrew Lunn @ 2022-04-12 16:55 UTC (permalink / raw)
To: Arun Ramadoss
Cc: netdev, linux-kernel, Paolo Abeni, Jakub Kicinski,
David S. Miller, Russell King, Heiner Kallweit, UNGLinuxDriver
On Tue, Apr 12, 2022 at 12:03:15PM +0530, Arun Ramadoss wrote:
> Added the phy_poll_cable_test flag for the lan937x phy driver.
> Tested using command - ethtool --cable-test <dev>
>
> Signed-off-by: Arun Ramadoss <arun.ramadoss@microchip.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Patch net-next 2/3] net: phy: LAN87xx: add ethtool SQI support
2022-04-12 6:33 ` [Patch net-next 2/3] net: phy: LAN87xx: add ethtool SQI support Arun Ramadoss
@ 2022-04-12 16:57 ` Andrew Lunn
0 siblings, 0 replies; 8+ messages in thread
From: Andrew Lunn @ 2022-04-12 16:57 UTC (permalink / raw)
To: Arun Ramadoss
Cc: netdev, linux-kernel, Paolo Abeni, Jakub Kicinski,
David S. Miller, Russell King, Heiner Kallweit, UNGLinuxDriver
On Tue, Apr 12, 2022 at 12:03:16PM +0530, Arun Ramadoss wrote:
> This patch add the support for measuring Signal Quality Index for
> LAN87xx and LAN937x T1 Phy. It uses the SQI Method 5 for obtaining the
> values.
>
> Signed-off-by: Arun Ramadoss <arun.ramadoss@microchip.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Patch net-next 1/3] net: phy: LAN937x: added PHY_POLL_CABLE_TEST flag
2022-04-12 6:33 ` [Patch net-next 1/3] net: phy: LAN937x: added PHY_POLL_CABLE_TEST flag Arun Ramadoss
2022-04-12 16:55 ` Andrew Lunn
@ 2022-04-12 17:01 ` Andrew Lunn
1 sibling, 0 replies; 8+ messages in thread
From: Andrew Lunn @ 2022-04-12 17:01 UTC (permalink / raw)
To: Arun Ramadoss
Cc: netdev, linux-kernel, Paolo Abeni, Jakub Kicinski,
David S. Miller, Russell King, Heiner Kallweit, UNGLinuxDriver
On Tue, Apr 12, 2022 at 12:03:15PM +0530, Arun Ramadoss wrote:
> Added the phy_poll_cable_test flag for the lan937x phy driver.
> Tested using command - ethtool --cable-test <dev>
Does this need back porting? Cable test has been in this driver for a
while. If so, please separate it out, and submit it for net, not
next-next.
Fixes: 788050256c41 ("net: phy: microchip_t1: add cable test support for lan87xx phy")
Andrew
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2022-04-12 17:01 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-12 6:33 [Patch net-next 0/3] add ethtool SQI support for LAN87xx T1 Phy Arun Ramadoss
2022-04-12 6:33 ` [Patch net-next 1/3] net: phy: LAN937x: added PHY_POLL_CABLE_TEST flag Arun Ramadoss
2022-04-12 16:55 ` Andrew Lunn
2022-04-12 17:01 ` Andrew Lunn
2022-04-12 6:33 ` [Patch net-next 2/3] net: phy: LAN87xx: add ethtool SQI support Arun Ramadoss
2022-04-12 16:57 ` Andrew Lunn
2022-04-12 6:33 ` [Patch net-next 3/3] MAINTAINERS: Add maintainers for Microchip T1 Phy driver Arun Ramadoss
2022-04-12 14:58 ` Joe Perches
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).