[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250814095526.v3ft2d55piohvhby@DEN-DL-M31836.microchip.com>
Date: Thu, 14 Aug 2025 11:55:26 +0200
From: Horatiu Vultur <horatiu.vultur@...rochip.com>
To: "Russell King (Oracle)" <linux@...linux.org.uk>
CC: <andrew@...n.ch>, <hkallweit1@...il.com>, <davem@...emloft.net>,
<edumazet@...gle.com>, <kuba@...nel.org>, <pabeni@...hat.com>,
<richardcochran@...il.com>, <o.rempel@...gutronix.de>,
<alok.a.tiwari@...cle.com>, <netdev@...r.kernel.org>,
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH net-next v4 4/4] net: phy: micrel: Add support for lan8842
The 08/14/2025 10:20, Russell King (Oracle) wrote:
Hi Russell,
> On Thu, Aug 14, 2025 at 10:26:24AM +0200, Horatiu Vultur wrote:
> > +static int lan8842_config_init(struct phy_device *phydev)
> > +{
> > + int ret;
> > +
> > + /* Reset the PHY */
> > + ret = lanphy_modify_page_reg(phydev, LAN8814_PAGE_COMMON_REGS,
> > + LAN8814_QSGMII_SOFT_RESET,
> > + LAN8814_QSGMII_SOFT_RESET_BIT,
> > + LAN8814_QSGMII_SOFT_RESET_BIT);
> > + if (ret < 0)
> > + return ret;
> > +
> > + /* Disable ANEG with QSGMII PCS Host side
> > + * It has the same address as lan8814
> > + */
> > + ret = lanphy_modify_page_reg(phydev, LAN8814_PAGE_PORT_REGS,
> > + LAN8814_QSGMII_PCS1G_ANEG_CONFIG,
> > + LAN8814_QSGMII_PCS1G_ANEG_CONFIG_ANEG_ENA,
> > + 0);
> > + if (ret < 0)
> > + return ret;
>
> Could you explain exactly what effect this has please?
The effect of this and the next write is to disable the auto-negotiation
between the PHY and the MAC.
>
> > +
> > + /* Disable also the SGMII_AUTO_ANEG_ENA, this will determine what is the
> > + * PHY autoneg with the other end and then will update the host side
> > + */
> > + ret = lanphy_write_page_reg(phydev, LAN8814_PAGE_COMMON_REGS,
> > + LAN8842_SGMII_AUTO_ANEG_ENA, 0);
> > + if (ret < 0)
> > + return ret;
>
> Also please explain this a bit more.
This write disables the PHY to update the host side advertise abilities
with what it autonegotiate on the link side. I will need to double check
but I think this is not needed if the autonegotiation on the host side
is already disabled.
>
> If this changes whether host-side "negotiation" is used, then please
> consider implementing the two phy driver inbnad operations as well.
Yes, I will implement the functions: config_inband and inband_caps.
>
> > +static u64 lan8842_get_stat(struct phy_device *phydev, int count, int *regs)
> > +{
> > + int val;
> i> + u64 ret = 0;
>
> Please remember... reverse Christmas tree for variable declarations.
Argh.. goot catch!
>
> Thanks.
>
> --
> RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
> FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
--
/Horatiu
Powered by blists - more mailing lists