[source] bcm53xx: backport MDIO bus clock initialization fix
LEDE Commits
lede-commits at lists.infradead.org
Thu May 11 07:12:19 PDT 2017
rmilecki pushed a commit to source.git, branch master:
https://git.lede-project.org/8adeb4e5d0a8c15e37625469bb602de5702f27d5
commit 8adeb4e5d0a8c15e37625469bb602de5702f27d5
Author: Rafał Miłecki <rafal at milecki.pl>
AuthorDate: Thu May 11 16:02:47 2017 +0200
bcm53xx: backport MDIO bus clock initialization fix
Signed-off-by: Rafał Miłecki <rafal at milecki.pl>
---
...y-Initialize-mdio-clock-at-probe-function.patch | 48 ++++++++++++++++++++++
...y-Initialize-mdio-clock-at-probe-function.patch | 48 ++++++++++++++++++++++
2 files changed, 96 insertions(+)
diff --git a/target/linux/bcm53xx/patches-4.4/060-0001-net-phy-Initialize-mdio-clock-at-probe-function.patch b/target/linux/bcm53xx/patches-4.4/060-0001-net-phy-Initialize-mdio-clock-at-probe-function.patch
new file mode 100644
index 0000000..7678a70
--- /dev/null
+++ b/target/linux/bcm53xx/patches-4.4/060-0001-net-phy-Initialize-mdio-clock-at-probe-function.patch
@@ -0,0 +1,48 @@
+From bb1a619735b4660f21bce3e728b937640024b4ad Mon Sep 17 00:00:00 2001
+From: Yendapally Reddy Dhananjaya Reddy <yendapally.reddy at broadcom.com>
+Date: Wed, 8 Feb 2017 17:14:26 -0500
+Subject: [PATCH] net: phy: Initialize mdio clock at probe function
+
+USB PHYs need the MDIO clock divisor enabled earlier to work.
+Initialize mdio clock divisor in probe function. The ext bus
+bit available in the same register will be used by mdio mux
+to enable external mdio.
+
+Signed-off-by: Yendapally Reddy Dhananjaya Reddy <yendapally.reddy at broadcom.com>
+Fixes: ddc24ae1 ("net: phy: Broadcom iProc MDIO bus driver")
+Reviewed-by: Florian Fainelli <f.fainelli at gmail.com>
+Signed-off-by: Jon Mason <jon.mason at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/phy/mdio-bcm-iproc.c | 6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+--- a/drivers/net/phy/mdio-bcm-iproc.c
++++ b/drivers/net/phy/mdio-bcm-iproc.c
+@@ -81,8 +81,6 @@ static int iproc_mdio_read(struct mii_bu
+ if (rc)
+ return rc;
+
+- iproc_mdio_config_clk(priv->base);
+-
+ /* Prepare the read operation */
+ cmd = (MII_DATA_TA_VAL << MII_DATA_TA_SHIFT) |
+ (reg << MII_DATA_RA_SHIFT) |
+@@ -112,8 +110,6 @@ static int iproc_mdio_write(struct mii_b
+ if (rc)
+ return rc;
+
+- iproc_mdio_config_clk(priv->base);
+-
+ /* Prepare the write operation */
+ cmd = (MII_DATA_TA_VAL << MII_DATA_TA_SHIFT) |
+ (reg << MII_DATA_RA_SHIFT) |
+@@ -163,6 +159,8 @@ static int iproc_mdio_probe(struct platf
+ bus->read = iproc_mdio_read;
+ bus->write = iproc_mdio_write;
+
++ iproc_mdio_config_clk(priv->base);
++
+ rc = of_mdiobus_register(bus, pdev->dev.of_node);
+ if (rc) {
+ dev_err(&pdev->dev, "MDIO bus registration failed\n");
diff --git a/target/linux/bcm53xx/patches-4.9/060-0001-net-phy-Initialize-mdio-clock-at-probe-function.patch b/target/linux/bcm53xx/patches-4.9/060-0001-net-phy-Initialize-mdio-clock-at-probe-function.patch
new file mode 100644
index 0000000..7678a70
--- /dev/null
+++ b/target/linux/bcm53xx/patches-4.9/060-0001-net-phy-Initialize-mdio-clock-at-probe-function.patch
@@ -0,0 +1,48 @@
+From bb1a619735b4660f21bce3e728b937640024b4ad Mon Sep 17 00:00:00 2001
+From: Yendapally Reddy Dhananjaya Reddy <yendapally.reddy at broadcom.com>
+Date: Wed, 8 Feb 2017 17:14:26 -0500
+Subject: [PATCH] net: phy: Initialize mdio clock at probe function
+
+USB PHYs need the MDIO clock divisor enabled earlier to work.
+Initialize mdio clock divisor in probe function. The ext bus
+bit available in the same register will be used by mdio mux
+to enable external mdio.
+
+Signed-off-by: Yendapally Reddy Dhananjaya Reddy <yendapally.reddy at broadcom.com>
+Fixes: ddc24ae1 ("net: phy: Broadcom iProc MDIO bus driver")
+Reviewed-by: Florian Fainelli <f.fainelli at gmail.com>
+Signed-off-by: Jon Mason <jon.mason at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/phy/mdio-bcm-iproc.c | 6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+--- a/drivers/net/phy/mdio-bcm-iproc.c
++++ b/drivers/net/phy/mdio-bcm-iproc.c
+@@ -81,8 +81,6 @@ static int iproc_mdio_read(struct mii_bu
+ if (rc)
+ return rc;
+
+- iproc_mdio_config_clk(priv->base);
+-
+ /* Prepare the read operation */
+ cmd = (MII_DATA_TA_VAL << MII_DATA_TA_SHIFT) |
+ (reg << MII_DATA_RA_SHIFT) |
+@@ -112,8 +110,6 @@ static int iproc_mdio_write(struct mii_b
+ if (rc)
+ return rc;
+
+- iproc_mdio_config_clk(priv->base);
+-
+ /* Prepare the write operation */
+ cmd = (MII_DATA_TA_VAL << MII_DATA_TA_SHIFT) |
+ (reg << MII_DATA_RA_SHIFT) |
+@@ -163,6 +159,8 @@ static int iproc_mdio_probe(struct platf
+ bus->read = iproc_mdio_read;
+ bus->write = iproc_mdio_write;
+
++ iproc_mdio_config_clk(priv->base);
++
+ rc = of_mdiobus_register(bus, pdev->dev.of_node);
+ if (rc) {
+ dev_err(&pdev->dev, "MDIO bus registration failed\n");
More information about the lede-commits
mailing list