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

net: phy: microchip_t1s: add support for Microchip LAN867X Rev.D0 PHY

Add support for the LAN8670/1/2 Rev.D0 10BASE-T1S PHYs from Microchip.
The new Rev.D0 silicon requires a specific set of initialization
settings to be configured for optimal performance and compliance with
OPEN Alliance specifications, as described in Microchip Application Note
AN1699 (Revision G, DS60001699G – October 2025).
https://www.microchip.com/en-us/application-notes/an1699

Signed-off-by: Parthiban Veerasooran <parthiban.veerasooran@microchip.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://patch.msgid.link/20251030102258.180061-2-parthiban.veerasooran@microchip.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Parthiban Veerasooran and committed by
Jakub Kicinski
e7e75677 9b443e58

+47 -2
+1 -1
drivers/net/phy/Kconfig
··· 308 308 config MICROCHIP_T1S_PHY 309 309 tristate "Microchip 10BASE-T1S Ethernet PHYs" 310 310 help 311 - Currently supports the LAN8670/1/2 Rev.B1/C1/C2 and 311 + Currently supports the LAN8670/1/2 Rev.B1/C1/C2/D0 and 312 312 LAN8650/1 Rev.B0/B1 Internal PHYs. 313 313 314 314 config MICROCHIP_PHY
+46 -1
drivers/net/phy/microchip_t1s.c
··· 3 3 * Driver for Microchip 10BASE-T1S PHYs 4 4 * 5 5 * Support: Microchip Phys: 6 - * lan8670/1/2 Rev.B1/C1/C2 6 + * lan8670/1/2 Rev.B1/C1/C2/D0 7 7 * lan8650/1 Rev.B0/B1 Internal PHYs 8 8 */ 9 9 ··· 14 14 #define PHY_ID_LAN867X_REVB1 0x0007C162 15 15 #define PHY_ID_LAN867X_REVC1 0x0007C164 16 16 #define PHY_ID_LAN867X_REVC2 0x0007C165 17 + #define PHY_ID_LAN867X_REVD0 0x0007C166 17 18 /* Both Rev.B0 and B1 clause 22 PHYID's are same due to B1 chip limitation */ 18 19 #define PHY_ID_LAN865X_REVB 0x0007C1B3 19 20 ··· 108 107 109 108 static const u16 lan865x_revb_sqi_fixup_cfg_regs[3] = { 110 109 0x00AD, 0x00AE, 0x00AF, 110 + }; 111 + 112 + /* LAN867x Rev.D0 configuration parameters from AN1699 113 + * As per the Configuration Application Note AN1699 published in the below link, 114 + * https://www.microchip.com/en-us/application-notes/an1699 115 + * Revision G (DS60001699G - October 2025) 116 + */ 117 + static const u16 lan867x_revd0_fixup_regs[8] = { 118 + 0x0037, 0x008A, 0x0118, 0x00D6, 119 + 0x0082, 0x00FD, 0x00FD, 0x0091, 120 + }; 121 + 122 + static const u16 lan867x_revd0_fixup_values[8] = { 123 + 0x0800, 0xBFC0, 0x029C, 0x1001, 124 + 0x001C, 0x0C0B, 0x8C07, 0x9660, 111 125 }; 112 126 113 127 /* Pulled from AN1760 describing 'indirect read' ··· 423 407 COL_DET_CTRL0_ENABLE_BIT_MASK, COL_DET_ENABLE); 424 408 } 425 409 410 + static int lan867x_revd0_config_init(struct phy_device *phydev) 411 + { 412 + int ret; 413 + 414 + ret = lan867x_check_reset_complete(phydev); 415 + if (ret) 416 + return ret; 417 + 418 + for (int i = 0; i < ARRAY_SIZE(lan867x_revd0_fixup_regs); i++) { 419 + ret = phy_write_mmd(phydev, MDIO_MMD_VEND2, 420 + lan867x_revd0_fixup_regs[i], 421 + lan867x_revd0_fixup_values[i]); 422 + if (ret) 423 + return ret; 424 + } 425 + 426 + return 0; 427 + } 428 + 426 429 static int lan86xx_read_status(struct phy_device *phydev) 427 430 { 428 431 /* The phy has some limitations, namely: ··· 517 482 .get_plca_status = genphy_c45_plca_get_status, 518 483 }, 519 484 { 485 + PHY_ID_MATCH_EXACT(PHY_ID_LAN867X_REVD0), 486 + .name = "LAN867X Rev.D0", 487 + .features = PHY_BASIC_T1S_P2MP_FEATURES, 488 + .config_init = lan867x_revd0_config_init, 489 + .get_plca_cfg = genphy_c45_plca_get_cfg, 490 + .set_plca_cfg = lan86xx_plca_set_cfg, 491 + .get_plca_status = genphy_c45_plca_get_status, 492 + }, 493 + { 520 494 PHY_ID_MATCH_EXACT(PHY_ID_LAN865X_REVB), 521 495 .name = "LAN865X Rev.B0/B1 Internal Phy", 522 496 .features = PHY_BASIC_T1S_P2MP_FEATURES, ··· 545 501 { PHY_ID_MATCH_EXACT(PHY_ID_LAN867X_REVB1) }, 546 502 { PHY_ID_MATCH_EXACT(PHY_ID_LAN867X_REVC1) }, 547 503 { PHY_ID_MATCH_EXACT(PHY_ID_LAN867X_REVC2) }, 504 + { PHY_ID_MATCH_EXACT(PHY_ID_LAN867X_REVD0) }, 548 505 { PHY_ID_MATCH_EXACT(PHY_ID_LAN865X_REVB) }, 549 506 { } 550 507 };