lkml.org 
[lkml]   [2020]   [Feb]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH net-next 2/2] net: phy: mscc: support LOS being active low
Date
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
\
 
 \ /
  Last update: 2020-02-27 16:42    [W:0.058 / U:1.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site