Skip to content

Commit a219912

Browse files
Russell King (Oracle)kuba-moo
authored andcommitted
net: phy: marvell: implement config_inband() method
Implement the config_inband() method for Marvell 88E1112, 88E1111, and Finisar's 88E1111 variant. Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: Russell King (Oracle) <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 5d58a89 commit a219912

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

drivers/net/phy/marvell.c

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -731,6 +731,34 @@ static unsigned int m88e1111_inband_caps(struct phy_device *phydev,
731731
return 0;
732732
}
733733

734+
static int m88e1111_config_inband(struct phy_device *phydev, unsigned int modes)
735+
{
736+
u16 extsr, bmcr;
737+
int err;
738+
739+
if (phydev->interface != PHY_INTERFACE_MODE_1000BASEX &&
740+
phydev->interface != PHY_INTERFACE_MODE_SGMII)
741+
return -EINVAL;
742+
743+
if (modes == LINK_INBAND_BYPASS)
744+
extsr = MII_M1111_HWCFG_SERIAL_AN_BYPASS;
745+
else
746+
extsr = 0;
747+
748+
if (modes == LINK_INBAND_DISABLE)
749+
bmcr = 0;
750+
else
751+
bmcr = BMCR_ANENABLE;
752+
753+
err = phy_modify(phydev, MII_M1111_PHY_EXT_SR,
754+
MII_M1111_HWCFG_SERIAL_AN_BYPASS, extsr);
755+
if (err < 0)
756+
return extsr;
757+
758+
return phy_modify_paged(phydev, MII_MARVELL_FIBER_PAGE, MII_BMCR,
759+
BMCR_ANENABLE, bmcr);
760+
}
761+
734762
static int m88e1111_config_aneg(struct phy_device *phydev)
735763
{
736764
int extsr = phy_read(phydev, MII_M1111_PHY_EXT_SR);
@@ -3692,6 +3720,7 @@ static struct phy_driver marvell_drivers[] = {
36923720
/* PHY_GBIT_FEATURES */
36933721
.probe = marvell_probe,
36943722
.inband_caps = m88e1111_inband_caps,
3723+
.config_inband = m88e1111_config_inband,
36953724
.config_init = m88e1112_config_init,
36963725
.config_aneg = marvell_config_aneg,
36973726
.config_intr = marvell_config_intr,
@@ -3714,6 +3743,7 @@ static struct phy_driver marvell_drivers[] = {
37143743
.flags = PHY_POLL_CABLE_TEST,
37153744
.probe = marvell_probe,
37163745
.inband_caps = m88e1111_inband_caps,
3746+
.config_inband = m88e1111_config_inband,
37173747
.config_init = m88e1111gbe_config_init,
37183748
.config_aneg = m88e1111_config_aneg,
37193749
.read_status = marvell_read_status,
@@ -3738,6 +3768,7 @@ static struct phy_driver marvell_drivers[] = {
37383768
/* PHY_GBIT_FEATURES */
37393769
.probe = marvell_probe,
37403770
.inband_caps = m88e1111_inband_caps,
3771+
.config_inband = m88e1111_config_inband,
37413772
.config_init = m88e1111gbe_config_init,
37423773
.config_aneg = m88e1111_config_aneg,
37433774
.read_status = marvell_read_status,

0 commit comments

Comments
 (0)