[source] mvebu: ClearFog Base fix phy init
LEDE Commits
lede-commits at lists.infradead.org
Sat May 13 15:37:13 PDT 2017
luka pushed a commit to source.git, branch master:
https://git.lede-project.org/1c7b86d57ee6628dd0d447934be4b8e08853b112
commit 1c7b86d57ee6628dd0d447934be4b8e08853b112
Author: Marko Ratkaj <marko.ratkaj at sartura.hr>
AuthorDate: Fri Apr 7 13:58:27 2017 +0200
mvebu: ClearFog Base fix phy init
Fix Marvell PHYs initialization issues and optimize
logic for page changing during init
Signed-off-by: Marko Ratkaj <marko.ratkaj at sartura.hr>
---
...473-fix-marvell-phy-initialization-issues.patch | 61 ++++++++++++++++++++++
1 file changed, 61 insertions(+)
diff --git a/target/linux/mvebu/patches-4.9/473-fix-marvell-phy-initialization-issues.patch b/target/linux/mvebu/patches-4.9/473-fix-marvell-phy-initialization-issues.patch
new file mode 100644
index 0000000..8c3089a
--- /dev/null
+++ b/target/linux/mvebu/patches-4.9/473-fix-marvell-phy-initialization-issues.patch
@@ -0,0 +1,61 @@
+From: Marko Ratkaj <marko.ratkaj at 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 at 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
+@@ -361,7 +361,7 @@ static int m88e1111_config_aneg(struct p
+ 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;
+@@ -374,7 +374,6 @@ static int marvell_of_reg_init(struct ph
+ 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;
+@@ -388,7 +387,6 @@ static int marvell_of_reg_init(struct ph
+
+ 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;
+@@ -411,7 +409,7 @@ static int marvell_of_reg_init(struct ph
+
+ }
+ err:
+- if (page_changed) {
++ if (current_page != saved_page) {
+ i = phy_write(phydev, MII_MARVELL_PHY_PAGE, saved_page);
+ if (ret == 0)
+ ret = i;
+@@ -1192,7 +1190,8 @@ static int marvell_read_status(struct ph
+ int err;
+
+ /* Check the fiber mode first */
+- if (phydev->supported & SUPPORTED_FIBRE) {
++ if (phydev->supported & SUPPORTED_FIBRE &&
++ phydev->interface != PHY_INTERFACE_MODE_SGMII) {
+ err = phy_write(phydev, MII_MARVELL_PHY_PAGE, MII_M1111_FIBER);
+ if (err < 0)
+ goto error;
More information about the lede-commits
mailing list