lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <4a3728d1-86ed-bf1b-81cd-bdd2f274609d@sord.co.jp>
Date: Wed, 31 May 2023 22:58:08 +0900
From: Atsushi Nemoto <atsushi.nemoto@...d.co.jp>
To: netdev@...r.kernel.org, devicetree@...r.kernel.org
Cc: Michael Hennerich <michael.hennerich@...log.com>,
 Alexandru Tachici <alexandru.tachici@...log.com>,
 Andrew Lunn <andrew@...n.ch>, Heiner Kallweit <hkallweit1@...il.com>,
 Russell King <linux@...linux.org.uk>, "David S. Miller"
 <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
 Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
 Horatiu Vultur <horatiu.vultur@...rochip.com>
Subject: [PATCH net-next v2 2/2] net: phy: adin: add support for inverting the
 link status output signal

The ADIN1200/ADIN1300 supports inverting the link status output signal
on the LINK_ST pin.

Add support for selecting this feature via device-tree properties.

Signed-off-by: Atsushi Nemoto <atsushi.nemoto@...d.co.jp>
Reviewed-by: Horatiu Vultur <horatiu.vultur@...rochip.com>
---
 drivers/net/phy/adin.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/net/phy/adin.c b/drivers/net/phy/adin.c
index 134637584a83..331f9574328f 100644
--- a/drivers/net/phy/adin.c
+++ b/drivers/net/phy/adin.c
@@ -140,6 +140,9 @@
 #define ADIN1300_RMII_20_BITS			0x0004
 #define ADIN1300_RMII_24_BITS			0x0005
 
+#define ADIN1300_GE_LNK_STAT_INV_REG		0xff3c
+#define   ADIN1300_GE_LNK_STAT_INV_EN		BIT(0)
+
 /**
  * struct adin_cfg_reg_map - map a config value to aregister value
  * @cfg:	value in device configuration
@@ -495,6 +498,15 @@ static int adin_config_init(struct phy_device *phydev)
 	if (rc < 0)
 		return rc;
 
+	if (device_property_read_bool(&phydev->mdio.dev,
+				      "adi,link-stat-inv")) {
+		rc = phy_set_bits_mmd(phydev, MDIO_MMD_VEND1,
+				      ADIN1300_GE_LNK_STAT_INV_REG,
+				      ADIN1300_GE_LNK_STAT_INV_EN);
+		if (rc < 0)
+			return rc;
+	}
+
 	phydev_dbg(phydev, "PHY is using mode '%s'\n",
 		   phy_modes(phydev->interface));
 
-- 
2.30.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ