Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1596523

[PATCH net 6/8] net: bcmgenet: Power up the internal PHY before probing the MII

From Doug Berger <opendmb@gmail.com>
Newsgroups linux.kernel
Subject [PATCH net 6/8] net: bcmgenet: Power up the internal PHY before probing the MII
Date 2017-03-10 02:00 +0100
Message-ID <tjh4u-4qP-23@gated-at.bofh.it> (permalink)
References <tjh4t-4qP-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Doug Berger <doug.berger@broadcom.com>

When using the internal PHY it must be powered up when the MII is probed
or the PHY will not be detected.  Since the PHY is powered up at reset
this has not been a problem.  However, when the kernel is restarted with
kexec the PHY will likely be powered down when the kernel starts so it
will not be detected and the Ethernet link will not be established.

This commit explicitly powers up the internal PHY when the GENET driver
is probed to correct this behavior.

refs #SWLINUX-4311

Fixes: 1c1008c793fa ("net: bcmgenet: add main driver file")
Signed-off-by: Doug Berger <doug.berger@broadcom.com>
---
 drivers/net/ethernet/broadcom/genet/bcmgenet.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
index 527cecaf12c1..f93098840775 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
@@ -3289,6 +3289,7 @@ static int bcmgenet_probe(struct platform_device *pdev)
 	const void *macaddr;
 	struct resource *r;
 	int err = -EIO;
+	const char *phy_mode_str;
 
 	/* Up to GENET_MAX_MQ_CNT + 1 TX queues and RX queues */
 	dev = alloc_etherdev_mqs(sizeof(*priv), GENET_MAX_MQ_CNT + 1,
@@ -3396,6 +3397,13 @@ static int bcmgenet_probe(struct platform_device *pdev)
 		priv->clk_eee = NULL;
 	}
 
+	/* If this is an internal GPHY, power it on now, before UniMAC is
+	 * brought out of reset as absolutely no UniMAC activity is allowed
+	 */
+	if (dn && !of_property_read_string(dn, "phy-mode", &phy_mode_str) &&
+	    !strcasecmp(phy_mode_str, "internal"))
+		bcmgenet_power_up(priv, GENET_POWER_PASSIVE);
+
 	err = reset_umac(priv);
 	if (err)
 		goto err_clk_disable;
-- 
2.11.1

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH net 0/8] net: bcmgenet: minor bug fixes Doug Berger <opendmb@gmail.com> - 2017-03-10 02:00 +0100
  [PATCH net 5/8] net: bcmgenet: synchronize irq0 status between the isr and task Doug Berger <opendmb@gmail.com> - 2017-03-10 02:00 +0100
  [PATCH net 8/8] net: bcmgenet: decouple flow control from bcmgenet_tx_reclaim Doug Berger <opendmb@gmail.com> - 2017-03-10 02:00 +0100
  [PATCH net 6/8] net: bcmgenet: Power up the internal PHY before probing the MII Doug Berger <opendmb@gmail.com> - 2017-03-10 02:00 +0100
  [PATCH net 7/8] net: bcmgenet: add begin/complete ethtool ops Doug Berger <opendmb@gmail.com> - 2017-03-10 02:00 +0100
  [PATCH net 1/8] net: bcmgenet: correct the RBUF_OVFL_CNT and RBUF_ERR_CNT MIB values Doug Berger <opendmb@gmail.com> - 2017-03-10 02:00 +0100
  [PATCH net 3/8] net: bcmgenet: reserved phy revisions must be checked first Doug Berger <opendmb@gmail.com> - 2017-03-10 02:00 +0100
  [PATCH net 2/8] net: bcmgenet: correct MIB access of UniMAC RUNT counters Doug Berger <opendmb@gmail.com> - 2017-03-10 02:00 +0100

csiph-web