devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Frank Li <Frank.Li@freescale.com>
To: b38611@freescale.com, davem@davemloft.net,
	netdev@vger.kernel.org, lznuaa@gmail.com
Cc: shawn.guo@linaro.org, linux-arm-kernel@lists.infradead.org,
	devicetree@vger.kernel.org, linux@arm.linux.org.uk,
	Fugang Duan <B38611@freescale.com>,
	Frank Li <Frank.Li@freescale.com>
Subject: [Patch v3 net-next 06/12] net:fec: Disable enet-avb MAC instead of reset MAC
Date: Thu, 11 Sep 2014 02:30:39 +0800	[thread overview]
Message-ID: <1410373845-5801-7-git-send-email-Frank.Li@freescale.com> (raw)
In-Reply-To: <1410373845-5801-1-git-send-email-Frank.Li@freescale.com>

From: Fugang Duan <B38611@freescale.com>

For i.MX6SX enet use AXI bus, reset MAC will make system bus dead
if ENET-AXI bus has pending access (AHB bus should not have such issue).
So, disable enet with AVB MAC instead of reset MAC itself.

Signed-off-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Frank Li <Frank.Li@freescale.com>
---
 drivers/net/ethernet/freescale/fec_main.c | 26 ++++++++++++++++++++------
 1 file changed, 20 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index 03972f7..5f8e997 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -945,9 +945,16 @@ fec_restart(struct net_device *ndev)
 	u32 rcntl = OPT_FRAME_SIZE | 0x04;
 	u32 ecntl = 0x2; /* ETHEREN */
 
-	/* Whack a reset.  We should wait for this. */
-	writel(1, fep->hwp + FEC_ECNTRL);
-	udelay(10);
+	/* Whack a reset.  We should wait for this.
+	 * For i.MX6SX SOC, enet use AXI bus, we use disable MAC
+	 * instead of reset MAC itself.
+	 */
+	if (id_entry && id_entry->driver_data & FEC_QUIRK_HAS_AVB) {
+		writel(0, fep->hwp + FEC_ECNTRL);
+	} else {
+		writel(1, fep->hwp + FEC_ECNTRL);
+		udelay(10);
+	}
 
 	/*
 	 * enet-mac reset will reset mac address registers too,
@@ -1118,9 +1125,16 @@ fec_stop(struct net_device *ndev)
 			netdev_err(ndev, "Graceful transmit stop did not complete!\n");
 	}
 
-	/* Whack a reset.  We should wait for this. */
-	writel(1, fep->hwp + FEC_ECNTRL);
-	udelay(10);
+	/* Whack a reset.  We should wait for this.
+	 * For i.MX6SX SOC, enet use AXI bus, we use disable MAC
+	 * instead of reset MAC itself.
+	 */
+	if (id_entry && id_entry->driver_data & FEC_QUIRK_HAS_AVB) {
+		writel(0, fep->hwp + FEC_ECNTRL);
+	} else {
+		writel(1, fep->hwp + FEC_ECNTRL);
+		udelay(10);
+	}
 	writel(fep->phy_speed, fep->hwp + FEC_MII_SPEED);
 	writel(FEC_DEFAULT_IMASK, fep->hwp + FEC_IMASK);
 
-- 
1.9.1

  parent reply	other threads:[~2014-09-10 18:30 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-10 18:30 [Patch v3 net-next 00/12] net: fec: imx6sx multiqueue support Frank Li
2014-09-10 18:30 ` [Patch v3 net-next 01/12] net:fec: add enet refrence clock for i.MX 6SX chip Frank Li
2014-09-10 18:30 ` [Patch v3 net-next 02/12] net:fec: add enet AVB feature macro define for imx6sx Frank Li
2014-09-10 18:30 ` [Patch v3 net-next 03/12] net: fec: change data structure to support multiqueue Frank Li
2014-09-10 18:30 ` [Patch v3 net-next 04/12] net: fec: parser max queue number from dt file Frank Li
2014-09-10 18:30 ` [Patch v3 net-next 05/12] net: fec: init multi queue date structure Frank Li
2014-09-10 18:30 ` Frank Li [this message]
2014-09-10 18:30 ` [Patch v3 net-next 07/12] net: fec: add enet-avb IP support Frank Li
2014-09-10 18:30 ` [Patch v3 net-next 08/12] net:fec: Add fsl,imx6sx-fec compatible strings Frank Li
2014-09-10 18:30 ` [Patch v3 net-next 09/12] net: fec: change FEC alignment according to i.mx6 sx requirement Frank Li
2014-09-12 20:40   ` David Miller
2014-09-12 20:45     ` Zhi Li
     [not found] ` <1410373845-5801-1-git-send-email-Frank.Li-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2014-09-10 18:30   ` [Patch v3 net-next 10/12] net: fec: init complete variable in early to avoid kernel dump Frank Li
2014-09-10 18:30 ` [Patch v3 net-next 11/12] ARM: Documentation: Update fec dts binding doc Frank Li
2014-09-10 18:30 ` [Patch v3 net-next 12/12] ARM: dts: imx6sx: add multi-queue support enet Frank Li
     [not found] <1410373813-5731-1-git-send-email-yes>
2014-09-10 18:30 ` [Patch v3 net-next 06/12] net:fec: Disable enet-avb MAC instead of reset MAC yes-KgLukfWpBlCctlrPMvKcciBecyulp+rMXqFh9Ls21Oc
2014-09-10 18:30 ` yes

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=1410373845-5801-7-git-send-email-Frank.Li@freescale.com \
    --to=frank.li@freescale.com \
    --cc=b38611@freescale.com \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux@arm.linux.org.uk \
    --cc=lznuaa@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=shawn.guo@linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).