Commit a779a55a authored by David S. Miller's avatar David S. Miller

Merge branch 'net-phy-Better-support-for-BCM54810'

Florian Fainelli says:

====================
net: phy: Better support for BCM54810

This patch series updates the broadcom PHY driver to better support the
BCM54810 and allow it to make use of the exiting
bcm54xx_adjust_rxrefclk() as well as fix suspend/resume for it.

Changes in v2:

- added Reviewed-by tags from Andrew for patches #1 and #3
- expanded commit message in #2 to explain the change
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 1cb237d7 fe26821f
...@@ -194,7 +194,8 @@ static void bcm54xx_adjust_rxrefclk(struct phy_device *phydev) ...@@ -194,7 +194,8 @@ static void bcm54xx_adjust_rxrefclk(struct phy_device *phydev)
/* Abort if we are using an untested phy. */ /* Abort if we are using an untested phy. */
if (BRCM_PHY_MODEL(phydev) != PHY_ID_BCM57780 && if (BRCM_PHY_MODEL(phydev) != PHY_ID_BCM57780 &&
BRCM_PHY_MODEL(phydev) != PHY_ID_BCM50610 && BRCM_PHY_MODEL(phydev) != PHY_ID_BCM50610 &&
BRCM_PHY_MODEL(phydev) != PHY_ID_BCM50610M) BRCM_PHY_MODEL(phydev) != PHY_ID_BCM50610M &&
BRCM_PHY_MODEL(phydev) != PHY_ID_BCM54810)
return; return;
val = bcm_phy_read_shadow(phydev, BCM54XX_SHD_SCR3); val = bcm_phy_read_shadow(phydev, BCM54XX_SHD_SCR3);
...@@ -272,10 +273,7 @@ static int bcm54xx_config_init(struct phy_device *phydev) ...@@ -272,10 +273,7 @@ static int bcm54xx_config_init(struct phy_device *phydev)
(phydev->dev_flags & PHY_BRCM_CLEAR_RGMII_MODE)) (phydev->dev_flags & PHY_BRCM_CLEAR_RGMII_MODE))
bcm_phy_write_shadow(phydev, BCM54XX_SHD_RGMII_MODE, 0); bcm_phy_write_shadow(phydev, BCM54XX_SHD_RGMII_MODE, 0);
if ((phydev->dev_flags & PHY_BRCM_RX_REFCLK_UNUSED) || bcm54xx_adjust_rxrefclk(phydev);
(phydev->dev_flags & PHY_BRCM_DIS_TXCRXC_NOENRGY) ||
(phydev->dev_flags & PHY_BRCM_AUTO_PWRDWN_ENABLE))
bcm54xx_adjust_rxrefclk(phydev);
if (BRCM_PHY_MODEL(phydev) == PHY_ID_BCM54210E) { if (BRCM_PHY_MODEL(phydev) == PHY_ID_BCM54210E) {
err = bcm54210e_config_init(phydev); err = bcm54210e_config_init(phydev);
...@@ -315,6 +313,20 @@ static int bcm54xx_config_init(struct phy_device *phydev) ...@@ -315,6 +313,20 @@ static int bcm54xx_config_init(struct phy_device *phydev)
return 0; return 0;
} }
static int bcm54xx_resume(struct phy_device *phydev)
{
int ret;
/* Writes to register other than BMCR would be ignored
* unless we clear the PDOWN bit first
*/
ret = genphy_resume(phydev);
if (ret < 0)
return ret;
return bcm54xx_config_init(phydev);
}
static int bcm5482_config_init(struct phy_device *phydev) static int bcm5482_config_init(struct phy_device *phydev)
{ {
int err, reg; int err, reg;
...@@ -708,6 +720,8 @@ static struct phy_driver broadcom_drivers[] = { ...@@ -708,6 +720,8 @@ static struct phy_driver broadcom_drivers[] = {
.config_aneg = bcm5481_config_aneg, .config_aneg = bcm5481_config_aneg,
.ack_interrupt = bcm_phy_ack_intr, .ack_interrupt = bcm_phy_ack_intr,
.config_intr = bcm_phy_config_intr, .config_intr = bcm_phy_config_intr,
.suspend = genphy_suspend,
.resume = bcm54xx_resume,
}, { }, {
.phy_id = PHY_ID_BCM5482, .phy_id = PHY_ID_BCM5482,
.phy_id_mask = 0xfffffff0, .phy_id_mask = 0xfffffff0,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment