All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: netdev@vger.kernel.org
Cc: Florian Fainelli <f.fainelli@gmail.com>
Subject: [PATCH net-next 5/7] net: bcmgenet: implement GPHY power down sequence
Date: Mon, 23 Mar 2015 15:03:49 -0700	[thread overview]
Message-ID: <1427148231-18902-6-git-send-email-f.fainelli@gmail.com> (raw)
In-Reply-To: <1427148231-18902-1-git-send-email-f.fainelli@gmail.com>

Implement the GPHY power down sequence by setting all power down bits, putting
the GPHY in reset, and finally cutting the 25Mhz reference clock.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/net/ethernet/broadcom/genet/bcmmii.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/broadcom/genet/bcmmii.c b/drivers/net/ethernet/broadcom/genet/bcmmii.c
index c26c0757d755..77d6a18707c3 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmmii.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmmii.c
@@ -177,6 +177,7 @@ static void bcmgenet_phy_power_set(struct net_device *dev, bool enable)
 	if (!GENET_IS_V4(priv))
 		return;
 
+	reg = bcmgenet_ext_readl(priv, EXT_GPHY_CTRL);
 	if (enable) {
 		reg = bcmgenet_ext_readl(priv, EXT_GPHY_CTRL);
 		reg &= ~EXT_CK25_DIS;
@@ -189,9 +190,14 @@ static void bcmgenet_phy_power_set(struct net_device *dev, bool enable)
 		mdelay(1);
 
 		reg &= ~EXT_GPHY_RESET;
+	} else {
+		reg |= EXT_CFG_IDDQ_BIAS | EXT_CFG_PWR_DOWN | EXT_GPHY_RESET;
 		bcmgenet_ext_writel(priv, reg, EXT_GPHY_CTRL);
-		udelay(60);
+		mdelay(1);
+		reg |= EXT_CK25_DIS;
 	}
+	bcmgenet_ext_writel(priv, reg, EXT_GPHY_CTRL);
+	udelay(60);
 }
 
 static void bcmgenet_internal_phy_setup(struct net_device *dev)
-- 
2.1.0

  parent reply	other threads:[~2015-03-23 22:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-23 22:03 [PATCH net-next 0/7] net: bcmgenet: integrated GPHY power up/down Florian Fainelli
2015-03-23 22:03 ` [PATCH net-next 1/7] net: bcmgenet: propagate errors from bcmgenet_power_down Florian Fainelli
2015-03-23 22:03 ` [PATCH net-next 2/7] net: bcmgenet: update bcmgenet_ephy_power_up to clear CK25_DIS bit Florian Fainelli
2015-03-23 22:03 ` [PATCH net-next 3/7] net: bcmgenet: rename bcmgenet_ephy_power_up Florian Fainelli
2015-03-23 22:03 ` [PATCH net-next 4/7] net: bcmgenet: fix GPHY power-up sequence Florian Fainelli
2015-03-23 22:03 ` Florian Fainelli [this message]
2015-03-23 22:03 ` [PATCH net-next 6/7] net: bcmgenet: power up and down integrated GPHY when unused Florian Fainelli
2015-03-23 22:03 ` [PATCH net-next 7/7] net: bcmgenet: power down and up GPHY during suspend/resume Florian Fainelli
2015-03-23 22:06 ` [PATCH net-next 0/7] net: bcmgenet: integrated GPHY power up/down Florian Fainelli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1427148231-18902-6-git-send-email-f.fainelli@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.