2017-04-07 11:58:27 +00:00
|
|
|
From: Marko Ratkaj <marko.ratkaj@sartura.hr>
|
|
|
|
Date: Fri, 7 Apr 2017 13:30:30 +0200
|
|
|
|
Subject: [PATCH] fix marvell phy initialization issues
|
|
|
|
|
|
|
|
Fix Marvell PHYs initialization issues and optimize
|
|
|
|
logic for page changing during init
|
|
|
|
|
|
|
|
Board affected with initialization bug:
|
|
|
|
SolidRun ClearFog Base
|
|
|
|
|
|
|
|
Signed-off-by: Marko Ratkaj <marko.ratkaj@sartura.hr>
|
|
|
|
---
|
|
|
|
drivers/net/phy/marvell.c | 9 ++++-----
|
|
|
|
1 file changed, 4 insertions(+), 5 deletions(-)
|
|
|
|
|
|
|
|
--- a/drivers/net/phy/marvell.c
|
|
|
|
+++ b/drivers/net/phy/marvell.c
|
2017-06-07 22:24:27 +00:00
|
|
|
@@ -369,7 +369,7 @@ static int m88e1111_config_aneg(struct p
|
2017-04-07 11:58:27 +00:00
|
|
|
static int marvell_of_reg_init(struct phy_device *phydev)
|
|
|
|
{
|
|
|
|
const __be32 *paddr;
|
|
|
|
- int len, i, saved_page, current_page, page_changed, ret;
|
|
|
|
+ int len, i, saved_page, current_page, ret;
|
|
|
|
|
|
|
|
if (!phydev->mdio.dev.of_node)
|
|
|
|
return 0;
|
2017-06-07 22:24:27 +00:00
|
|
|
@@ -382,7 +382,6 @@ static int marvell_of_reg_init(struct ph
|
2017-04-07 11:58:27 +00:00
|
|
|
saved_page = phy_read(phydev, MII_MARVELL_PHY_PAGE);
|
|
|
|
if (saved_page < 0)
|
|
|
|
return saved_page;
|
|
|
|
- page_changed = 0;
|
|
|
|
current_page = saved_page;
|
|
|
|
|
|
|
|
ret = 0;
|
2017-06-07 22:24:27 +00:00
|
|
|
@@ -396,7 +395,6 @@ static int marvell_of_reg_init(struct ph
|
2017-04-07 11:58:27 +00:00
|
|
|
|
|
|
|
if (reg_page != current_page) {
|
|
|
|
current_page = reg_page;
|
|
|
|
- page_changed = 1;
|
|
|
|
ret = phy_write(phydev, MII_MARVELL_PHY_PAGE, reg_page);
|
|
|
|
if (ret < 0)
|
|
|
|
goto err;
|
2017-06-07 22:24:27 +00:00
|
|
|
@@ -419,7 +417,7 @@ static int marvell_of_reg_init(struct ph
|
2017-04-07 11:58:27 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
err:
|
|
|
|
- if (page_changed) {
|
|
|
|
+ if (current_page != saved_page) {
|
|
|
|
i = phy_write(phydev, MII_MARVELL_PHY_PAGE, saved_page);
|
|
|
|
if (ret == 0)
|
|
|
|
ret = i;
|