Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: phy: micrel: lan8814: Enable in-band auto-negotiation

The lan8814 supports two interfaces towards the host (QSGMII and QUSGMII).
Currently the lan8814 disables the auto-negotiation towards the host
side. So, extend this to allow to configure to use in-band
auto-negotiation.
I have tested this only with the QSGMII interface.

Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Link: https://patch.msgid.link/20251114084224.3268928-1-horatiu.vultur@microchip.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>

authored by

Horatiu Vultur and committed by
Paolo Abeni
19f1d6c7 45a1cd83

+21 -5
+21 -5
drivers/net/phy/micrel.c
··· 2988 2988 #define LAN_EXT_PAGE_ACCESS_ADDRESS_DATA 0x17 2989 2989 #define LAN_EXT_PAGE_ACCESS_CTRL_EP_FUNC 0x4000 2990 2990 2991 + #define LAN8814_QSGMII_TX_CONFIG 0x35 2992 + #define LAN8814_QSGMII_TX_CONFIG_QSGMII BIT(3) 2991 2993 #define LAN8814_QSGMII_SOFT_RESET 0x43 2992 2994 #define LAN8814_QSGMII_SOFT_RESET_BIT BIT(0) 2993 2995 #define LAN8814_QSGMII_PCS1G_ANEG_CONFIG 0x13 ··· 4503 4501 static int lan8814_config_init(struct phy_device *phydev) 4504 4502 { 4505 4503 struct kszphy_priv *lan8814 = phydev->priv; 4504 + int ret; 4506 4505 4507 - /* Disable ANEG with QSGMII PCS Host side */ 4508 - lanphy_modify_page_reg(phydev, LAN8814_PAGE_PORT_REGS, 4509 - LAN8814_QSGMII_PCS1G_ANEG_CONFIG, 4510 - LAN8814_QSGMII_PCS1G_ANEG_CONFIG_ANEG_ENA, 4511 - 0); 4506 + /* Based on the interface type select how the advertise ability is 4507 + * encoded, to set as SGMII or as USGMII. 4508 + */ 4509 + if (phydev->interface == PHY_INTERFACE_MODE_QSGMII) 4510 + ret = lanphy_modify_page_reg(phydev, LAN8814_PAGE_COMMON_REGS, 4511 + LAN8814_QSGMII_TX_CONFIG, 4512 + LAN8814_QSGMII_TX_CONFIG_QSGMII, 4513 + LAN8814_QSGMII_TX_CONFIG_QSGMII); 4514 + else 4515 + ret = lanphy_modify_page_reg(phydev, LAN8814_PAGE_COMMON_REGS, 4516 + LAN8814_QSGMII_TX_CONFIG, 4517 + LAN8814_QSGMII_TX_CONFIG_QSGMII, 4518 + 0); 4519 + 4520 + if (ret < 0) 4521 + return ret; 4512 4522 4513 4523 /* MDI-X setting for swap A,B transmit */ 4514 4524 lanphy_modify_page_reg(phydev, LAN8814_PAGE_PCS_DIGITAL, LAN8814_ALIGN_SWAP, ··· 6654 6640 .suspend = genphy_suspend, 6655 6641 .resume = kszphy_resume, 6656 6642 .config_intr = lan8814_config_intr, 6643 + .inband_caps = lan8842_inband_caps, 6644 + .config_inband = lan8842_config_inband, 6657 6645 .handle_interrupt = lan8814_handle_interrupt, 6658 6646 .cable_test_start = lan8814_cable_test_start, 6659 6647 .cable_test_get_status = ksz886x_cable_test_get_status,