devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: <Frank.Li@freescale.com>
To: b38611@freescale.com, davem@davemloft.net,
	netdev@vger.kernel.org, lznuaa@gmail.com
Cc: devicetree@vger.kernel.org, Frank Li <Frank.Li@freescale.com>,
	Fugang Duan <B38611@freescale.com>,
	linux@arm.linux.org.uk, shawn.guo@linaro.org,
	linux-arm-kernel@lists.infradead.org
Subject: [Patch v4 net-next 06/12] net:fec: Disable enet-avb MAC instead of reset MAC
Date: Sat, 13 Sep 2014 05:00:51 +0800	[thread overview]
Message-ID: <1410555657-10744-7-git-send-email-Frank.Li@freescale.com> (raw)
In-Reply-To: <1410555657-10744-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-12 21:00 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-12 21:00 [Patch v4 net-next 00/12] net: fec: imx6sx multiqueue support Frank.Li
2014-09-12 21:00 ` [Patch v4 net-next 01/12] net:fec: add enet refrence clock for i.MX 6SX chip Frank.Li
2014-09-12 21:00 ` [Patch v4 net-next 02/12] net:fec: add enet AVB feature macro define for imx6sx Frank.Li
2014-09-12 21:00 ` [Patch v4 net-next 03/12] net: fec: change data structure to support multiqueue Frank.Li
2014-09-12 21:00 ` [Patch v4 net-next 04/12] net: fec: parser max queue number from dt file Frank.Li
2014-09-15  7:39   ` Lothar Waßmann
2014-09-15 13:21     ` Zhi Li
     [not found]     ` <20140915093926.11bdbc32-VjFSrY7JcPWvSplVBqRQBQ@public.gmane.org>
2014-09-15 13:24       ` Zhi Li
2014-09-15 15:08         ` Lothar Waßmann
     [not found]           ` <20140915170804.39061c0d-VjFSrY7JcPWvSplVBqRQBQ@public.gmane.org>
2014-09-15 15:33             ` Zhi Li
2014-09-12 21:00 ` [Patch v4 net-next 05/12] net: fec: init multi queue date structure Frank.Li
2014-09-12 21:00 ` Frank.Li [this message]
2014-09-12 21:00 ` [Patch v4 net-next 07/12] net: fec: add enet-avb IP support Frank.Li
2014-09-12 21:00 ` [Patch v4 net-next 08/12] net:fec: Add fsl, imx6sx-fec compatible strings Frank.Li
2014-09-12 21:00 ` [Patch v4 net-next 09/12] net: fec: change FEC alignment according to i.mx6 sx requirement Frank.Li
2014-09-12 21:00 ` [Patch v4 net-next 10/12] net: fec: init complete variable in early to avoid kernel dump Frank.Li
2014-09-12 21:00 ` [Patch v4 net-next 11/12] ARM: Documentation: Update fec dts binding doc Frank.Li
2014-09-12 21:00 ` [Patch v4 net-next 12/12] ARM: dts: imx6sx: add multi-queue support enet Frank.Li
2014-09-15  7:31   ` Lothar Waßmann
2014-09-13 21:32 ` [Patch v4 net-next 00/12] net: fec: imx6sx multiqueue support David Miller

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=1410555657-10744-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).