Re: [PATCH net-next v4 4/4] net: phy: micrel: Add support for lan8842

From: Russell King (Oracle)
Date: Thu Aug 14 2025 - 05:21:37 EST


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?

> +
> + /* 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.

If this changes whether host-side "negotiation" is used, then please
consider implementing the two phy driver inbnad operations as well.

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

Thanks.

--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!