[PATCH net-next 0/2] net: phy: mscc: support LOS active low

STALE2400d

7 messages, 4 authors, 2020-03-01 · open the first message on its own page

[PATCH net-next 0/2] net: phy: mscc: support LOS active low

From: Antoine Tenart <hidden>
Date: 2020-02-27 15:41:15

Hello,

This series adds a device tree property for the VSC8584 PHY family to
describe the LOS pin connected to the PHY as being active low. This new
property is then used in the MSCC PHY driver.

Thanks!
Antoine

Antoine Tenart (2):
  dt-bindings: net: phy: mscc: document LOS active low property
  net: phy: mscc: support LOS being active low

 Documentation/devicetree/bindings/net/mscc-phy-vsc8531.txt | 1 +
 drivers/net/phy/mscc.c                                     | 7 +++++++
 2 files changed, 8 insertions(+)

-- 
2.24.1

[PATCH net-next 2/2] net: phy: mscc: support LOS being active low

From: Antoine Tenart <hidden>
Date: 2020-02-27 15:41:18

This patch adds support for describing the LOS pin as being active low
when using MSCC PHYs.

Signed-off-by: Antoine Tenart <redacted>
---
 drivers/net/phy/mscc.c | 7 +++++++
 1 file changed, 7 insertions(+)
diff --git a/drivers/net/phy/mscc.c b/drivers/net/phy/mscc.c
index 56d6a45a90c2..3755919b03e8 100644
--- a/drivers/net/phy/mscc.c
+++ b/drivers/net/phy/mscc.c
@@ -172,6 +172,7 @@ enum macsec_bank {
 #define VALID_CRC_CNT_CRC_MASK		  GENMASK(13, 0)
 
 #define MSCC_PHY_EXT_MODE_CNTL		  19
+#define SIGDET_ACTIVE_LOW		  BIT(0)
 #define FORCE_MDI_CROSSOVER_MASK	  0x000C
 #define FORCE_MDI_CROSSOVER_MDIX	  0x000C
 #define FORCE_MDI_CROSSOVER_MDI		  0x0008
@@ -2688,6 +2689,7 @@ static int vsc8584_config_init(struct phy_device *phydev)
 {
 	u32 skew_rx = VSC8584_RGMII_SKEW_0_2, skew_tx = VSC8584_RGMII_SKEW_0_2;
 	struct vsc8531_private *vsc8531 = phydev->priv;
+	struct device *dev = &phydev->mdio.dev;
 	u16 addr, val;
 	int ret, i;
 
@@ -2831,6 +2833,11 @@ static int vsc8584_config_init(struct phy_device *phydev)
 	       (VSC8584_MAC_IF_SELECTION_SGMII << VSC8584_MAC_IF_SELECTION_POS);
 	ret = phy_write(phydev, MSCC_PHY_EXT_PHY_CNTL_1, val);
 
+	if (of_property_read_bool(dev->of_node, "vsc8584,los-active-low"))
+		phy_modify_paged(phydev, MSCC_PHY_PAGE_EXTENDED,
+				 MSCC_PHY_EXT_MODE_CNTL, SIGDET_ACTIVE_LOW,
+				 SIGDET_ACTIVE_LOW);
+
 	ret = genphy_soft_reset(phydev);
 	if (ret)
 		return ret;
-- 
2.24.1

[PATCH net-next 1/2] dt-bindings: net: phy: mscc: document LOS active low property

From: Antoine Tenart <hidden>
Date: 2020-02-27 15:41:19

This patch adds a "vsc8584,los-active-low" property to denote when the
LOS signal connected directly to the PHY is active low.

Signed-off-by: Antoine Tenart <redacted>
---
 Documentation/devicetree/bindings/net/mscc-phy-vsc8531.txt | 1 +
 1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/net/mscc-phy-vsc8531.txt b/Documentation/devicetree/bindings/net/mscc-phy-vsc8531.txt
index c682b6e74b14..24faee3cfebf 100644
--- a/Documentation/devicetree/bindings/net/mscc-phy-vsc8531.txt
+++ b/Documentation/devicetree/bindings/net/mscc-phy-vsc8531.txt
@@ -39,6 +39,7 @@ Optional properties:
 			  Allowed values are defined in
 			  "include/dt-bindings/net/mscc-phy-vsc8531.h".
 			  Default value is VSC8584_RGMII_SKEW_0_2.
+- vsc8584,los-active-low : If set, indicates the LOS pin is active low.
 
 
 Table: 1 - Edge rate change
-- 
2.24.1

Re: [PATCH net-next 0/2] net: phy: mscc: support LOS active low

From: Andrew Lunn <andrew@lunn.ch>
Date: 2020-02-27 15:54:45

On Thu, Feb 27, 2020 at 04:40:31PM +0100, Antoine Tenart wrote:
Hello,

This series adds a device tree property for the VSC8584 PHY family to
describe the LOS pin connected to the PHY as being active low. This new
property is then used in the MSCC PHY driver.
Hi Antoine

I think i'm missing the big picture.

Is this for when an SFP is connected directly to the PHY? The SFP
output LOS, indicating loss of received fibre/copper signal, is active
low?

	Andrew

Re: [PATCH net-next 0/2] net: phy: mscc: support LOS active low

From: Antoine Tenart <hidden>
Date: 2020-02-27 16:10:14

Hello Andrew,

On Thu, Feb 27, 2020 at 04:54:40PM +0100, Andrew Lunn wrote:
On Thu, Feb 27, 2020 at 04:40:31PM +0100, Antoine Tenart wrote:
quoted
This series adds a device tree property for the VSC8584 PHY family to
describe the LOS pin connected to the PHY as being active low. This new
property is then used in the MSCC PHY driver.
I think i'm missing the big picture.

Is this for when an SFP is connected directly to the PHY? The SFP
output LOS, indicating loss of received fibre/copper signal, is active
low?
Yes, the SFP cage can be connected directly to the PHY, and the SFP LOS
signal is active low (there's a pull-up on the LOS line).

Also, I realized I send this series before my other patches adding
support for fibre mode on this PHY, so it may make more sense to send
this one after.

Thanks!
Antoine

-- 
Antoine Ténart, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

Re: [PATCH net-next 0/2] net: phy: mscc: support LOS active low

From: David Miller <davem@davemloft.net>
Date: 2020-03-01 05:24:09

From: Antoine Tenart <redacted>
Date: Thu, 27 Feb 2020 17:10:10 +0100
Hello Andrew,

On Thu, Feb 27, 2020 at 04:54:40PM +0100, Andrew Lunn wrote:
quoted
On Thu, Feb 27, 2020 at 04:40:31PM +0100, Antoine Tenart wrote:
quoted
This series adds a device tree property for the VSC8584 PHY family to
describe the LOS pin connected to the PHY as being active low. This new
property is then used in the MSCC PHY driver.
I think i'm missing the big picture.

Is this for when an SFP is connected directly to the PHY? The SFP
output LOS, indicating loss of received fibre/copper signal, is active
low?
Yes, the SFP cage can be connected directly to the PHY, and the SFP LOS
signal is active low (there's a pull-up on the LOS line).

Also, I realized I send this series before my other patches adding
support for fibre mode on this PHY, so it may make more sense to send
this one after.
Please do so, I'll mark these as deferred in patchwork.

Re: [PATCH net-next 1/2] dt-bindings: net: phy: mscc: document LOS active low property

From: Sergei Shtylyov <hidden>
Date: 2020-03-01 11:36:41

Hello!

On 27.02.2020 18:40, Antoine Tenart wrote:
This patch adds a "vsc8584,los-active-low" property to denote when the
    The part before comma is supposed to be a vendor name, no?
LOS signal connected directly to the PHY is active low.

Signed-off-by: Antoine Tenart <redacted>
[...]

MBR, Sergei
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help