Thread (15 messages) flat view 15 messages, 4 authors, 2022-08-29

RE: [PATCH net-next] net: phy: micrel: Adding SQI support for lan8814 phy

From: <hidden>
Date: 2022-08-26 03:50:56
Also in: lkml

Hi,
-----Original Message-----
From: Andrew Lunn <andrew@lunn.ch>
Sent: Friday, August 26, 2022 3:24 AM
To: Divya Koppera - I30481 <redacted>
Cc: hkallweit1@gmail.com; linux@armlinux.org.uk; davem@davemloft.net;
edumazet@google.com; kuba@kernel.org; pabeni@redhat.com;
netdev@vger.kernel.org; linux-kernel@vger.kernel.org; UNGLinuxDriver
[off-list ref]
Subject: Re: [PATCH net-next] net: phy: micrel: Adding SQI support for
lan8814 phy

EXTERNAL EMAIL: Do not click links or open attachments unless you know the
content is safe
quoted
+#define LAN8814_DCQ_CTRL                             0xe6
+#define LAN8814_DCQ_CTRL_READ_CAPTURE_                       BIT(15)
+#define LAN8814_DCQ_CTRL_CHANNEL_MASK                        GENMASK(1,
0)
quoted
+#define LAN8814_DCQ_SQI                                      0xe4
+#define LAN8814_DCQ_SQI_MAX                          7
+#define LAN8814_DCQ_SQI_VAL_MASK                     GENMASK(3, 1)
+
 static int lanphy_read_page_reg(struct phy_device *phydev, int page,
u32 addr)  {
      int data;
@@ -2927,6 +2934,32 @@ static int lan8814_probe(struct phy_device
*phydev)
quoted
      return 0;
 }

+static int lan8814_get_sqi(struct phy_device *phydev) {
+     int rc, val;
+
+     val = lanphy_read_page_reg(phydev, 1, LAN8814_DCQ_CTRL);
+     if (val < 0)
+             return val;
I just took a quick look at the datasheet. It says:
I'm not sure the datasheet you looked into is the right one. Could you please crosscheck if its lan8814 or lan8841.
Lan8814 is quad port phy where register access are of extended page. Lan8841 is 1 port phy where register access are mmd access.
All registers references in this section are in MMD Device Address 1

So you should be using phy_read_mmd(phydev, MDIO_MMD_PMAPMD,
xxx) to read/write these registers. The datasheet i have however is missing
the register map, so i've no idea if it is still 0xe6.
I hope above explanation gives answer.
    Andrew
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help