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

net: phy: mscc: coma mode disabled for VSC8514

The 'coma mode' (configurable through sw or hw) provides an
optional feature that may be used to control when the PHYs become active.
The typical usage is to synchronize the link-up time across
all PHY instances. This patch releases coma mode if not done by hardware,
otherwise the phys will not link-up.

Fixes: e4f9ba642f0b ("net: phy: mscc: add support for VSC8514 PHY.")
Signed-off-by: Steen Hegelund <steen.hegelund@microchip.com>
Signed-off-by: Bjarni Jonasson <bjarni.jonasson@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Bjarni Jonasson and committed by
David S. Miller
ca0d7fd0 85e97f0b

+20
+4
drivers/net/phy/mscc/mscc.h
··· 140 140 #define MSCC_PHY_PAGE_1588 0x1588 /* PTP (1588) */ 141 141 #define MSCC_PHY_PAGE_TEST 0x2a30 /* Test reg */ 142 142 #define MSCC_PHY_PAGE_TR 0x52b5 /* Token ring registers */ 143 + #define MSCC_PHY_GPIO_CONTROL_2 14 144 + 145 + #define MSCC_PHY_COMA_MODE 0x2000 /* input(1) / output(0) */ 146 + #define MSCC_PHY_COMA_OUTPUT 0x1000 /* value to output */ 143 147 144 148 /* Extended Page 1 Registers */ 145 149 #define MSCC_PHY_CU_MEDIA_CRC_VALID_CNT 18
+16
drivers/net/phy/mscc/mscc_main.c
··· 1516 1516 vsc8531->addr = addr; 1517 1517 } 1518 1518 1519 + static void vsc85xx_coma_mode_release(struct phy_device *phydev) 1520 + { 1521 + /* The coma mode (pin or reg) provides an optional feature that 1522 + * may be used to control when the PHYs become active. 1523 + * Alternatively the COMA_MODE pin may be connected low 1524 + * so that the PHYs are fully active once out of reset. 1525 + */ 1526 + 1527 + /* Enable output (mode=0) and write zero to it */ 1528 + vsc85xx_phy_write_page(phydev, MSCC_PHY_PAGE_EXTENDED_GPIO); 1529 + __phy_modify(phydev, MSCC_PHY_GPIO_CONTROL_2, 1530 + MSCC_PHY_COMA_MODE | MSCC_PHY_COMA_OUTPUT, 0); 1531 + vsc85xx_phy_write_page(phydev, MSCC_PHY_PAGE_STANDARD); 1532 + } 1533 + 1519 1534 static int vsc8584_config_init(struct phy_device *phydev) 1520 1535 { 1521 1536 struct vsc8531_private *vsc8531 = phydev->priv; ··· 1977 1962 ret = vsc8514_config_host_serdes(phydev); 1978 1963 if (ret) 1979 1964 goto err; 1965 + vsc85xx_coma_mode_release(phydev); 1980 1966 } 1981 1967 1982 1968 phy_unlock_mdio_bus(phydev);