linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/2] net: phy: mscc: support LOS active low
@ 2020-02-27 15:40 Antoine Tenart
  2020-02-27 15:40 ` [PATCH net-next 1/2] dt-bindings: net: phy: mscc: document LOS active low property Antoine Tenart
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Antoine Tenart @ 2020-02-27 15:40 UTC (permalink / raw)
  To: davem, andrew, f.fainelli, hkallweit1
  Cc: Antoine Tenart, netdev, linux-kernel

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH net-next 1/2] dt-bindings: net: phy: mscc: document LOS active low property
  2020-02-27 15:40 [PATCH net-next 0/2] net: phy: mscc: support LOS active low Antoine Tenart
@ 2020-02-27 15:40 ` Antoine Tenart
  2020-03-01 11:36   ` Sergei Shtylyov
  2020-02-27 15:40 ` [PATCH net-next 2/2] net: phy: mscc: support LOS being active low Antoine Tenart
  2020-02-27 15:54 ` [PATCH net-next 0/2] net: phy: mscc: support LOS " Andrew Lunn
  2 siblings, 1 reply; 7+ messages in thread
From: Antoine Tenart @ 2020-02-27 15:40 UTC (permalink / raw)
  To: davem, andrew, f.fainelli, hkallweit1
  Cc: Antoine Tenart, netdev, linux-kernel

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 <antoine.tenart@bootlin.com>
---
 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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH net-next 2/2] net: phy: mscc: support LOS being active low
  2020-02-27 15:40 [PATCH net-next 0/2] net: phy: mscc: support LOS active low Antoine Tenart
  2020-02-27 15:40 ` [PATCH net-next 1/2] dt-bindings: net: phy: mscc: document LOS active low property Antoine Tenart
@ 2020-02-27 15:40 ` Antoine Tenart
  2020-02-27 15:54 ` [PATCH net-next 0/2] net: phy: mscc: support LOS " Andrew Lunn
  2 siblings, 0 replies; 7+ messages in thread
From: Antoine Tenart @ 2020-02-27 15:40 UTC (permalink / raw)
  To: davem, andrew, f.fainelli, hkallweit1
  Cc: Antoine Tenart, netdev, linux-kernel

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

Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>
---
 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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH net-next 0/2] net: phy: mscc: support LOS active low
  2020-02-27 15:40 [PATCH net-next 0/2] net: phy: mscc: support LOS active low Antoine Tenart
  2020-02-27 15:40 ` [PATCH net-next 1/2] dt-bindings: net: phy: mscc: document LOS active low property Antoine Tenart
  2020-02-27 15:40 ` [PATCH net-next 2/2] net: phy: mscc: support LOS being active low Antoine Tenart
@ 2020-02-27 15:54 ` Andrew Lunn
  2020-02-27 16:10   ` Antoine Tenart
  2 siblings, 1 reply; 7+ messages in thread
From: Andrew Lunn @ 2020-02-27 15:54 UTC (permalink / raw)
  To: Antoine Tenart; +Cc: davem, f.fainelli, hkallweit1, netdev, linux-kernel

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH net-next 0/2] net: phy: mscc: support LOS active low
  2020-02-27 15:54 ` [PATCH net-next 0/2] net: phy: mscc: support LOS " Andrew Lunn
@ 2020-02-27 16:10   ` Antoine Tenart
  2020-03-01  5:24     ` David Miller
  0 siblings, 1 reply; 7+ messages in thread
From: Antoine Tenart @ 2020-02-27 16:10 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: Antoine Tenart, davem, f.fainelli, hkallweit1, netdev, linux-kernel

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:
> > 
> > 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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH net-next 0/2] net: phy: mscc: support LOS active low
  2020-02-27 16:10   ` Antoine Tenart
@ 2020-03-01  5:24     ` David Miller
  0 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2020-03-01  5:24 UTC (permalink / raw)
  To: antoine.tenart; +Cc: andrew, f.fainelli, hkallweit1, netdev, linux-kernel

From: Antoine Tenart <antoine.tenart@bootlin.com>
Date: Thu, 27 Feb 2020 17:10:10 +0100

> 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:
>> > 
>> > 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.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH net-next 1/2] dt-bindings: net: phy: mscc: document LOS active low property
  2020-02-27 15:40 ` [PATCH net-next 1/2] dt-bindings: net: phy: mscc: document LOS active low property Antoine Tenart
@ 2020-03-01 11:36   ` Sergei Shtylyov
  0 siblings, 0 replies; 7+ messages in thread
From: Sergei Shtylyov @ 2020-03-01 11:36 UTC (permalink / raw)
  To: Antoine Tenart, davem, andrew, f.fainelli, hkallweit1
  Cc: netdev, linux-kernel

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 <antoine.tenart@bootlin.com>
[...]

MBR, Sergei

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-03-01 11:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-27 15:40 [PATCH net-next 0/2] net: phy: mscc: support LOS active low Antoine Tenart
2020-02-27 15:40 ` [PATCH net-next 1/2] dt-bindings: net: phy: mscc: document LOS active low property Antoine Tenart
2020-03-01 11:36   ` Sergei Shtylyov
2020-02-27 15:40 ` [PATCH net-next 2/2] net: phy: mscc: support LOS being active low Antoine Tenart
2020-02-27 15:54 ` [PATCH net-next 0/2] net: phy: mscc: support LOS " Andrew Lunn
2020-02-27 16:10   ` Antoine Tenart
2020-03-01  5:24     ` David Miller

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).