mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bhuvanchandra DV <bhuvanchandra.dv@toradex.com>
To: <linux-kernel@vger.kernel.org>
Cc: <b45643@freescale.com>, <LW@KARO-electronics.de>,
	<Frank.Li@freescale.com>, <B38611@freescale.com>,
	<davem@davemloft.net>, <stefan@agner.ch>,
	Bhuvanchandra DV <bhuvanchandra.dv@toradex.com>
Subject: [PATCH] net: fec: Fix dual ethernet issue in VFxx
Date: Tue, 6 Jan 2015 19:17:32 +0530	[thread overview]
Message-ID: <1420552052-4697-1-git-send-email-bhuvanchandra.dv@toradex.com> (raw)

On i.MX28, the MDIO bus is shared between the
two RMII interfaces. However, in newer designs,
such as Vybrid, this is not the case. This patch
adds a quirk for the single MDIO case. This allows
to use both FEC interfaces working independently
on Vybird.

Signed-off-by: Bhuvanchandra DV <bhuvanchandra.dv@toradex.com>
---
 drivers/net/ethernet/freescale/fec.h      |    3 +++
 drivers/net/ethernet/freescale/fec_main.c |    7 ++++---
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/freescale/fec.h b/drivers/net/ethernet/freescale/fec.h
index 469691a..c9515bc 100644
--- a/drivers/net/ethernet/freescale/fec.h
+++ b/drivers/net/ethernet/freescale/fec.h
@@ -425,6 +425,9 @@ struct bufdesc_ex {
  */
 #define FEC_QUIRK_BUG_CAPTURE		(1 << 10)
 
+/* Controller has only one MDIO bus for interfacing external PHY's */
+#define FEC_QUIRK_SINGLE_MDIO		(1 << 11)
+
 struct fec_enet_priv_tx_q {
 	int index;
 	unsigned char *tx_bounce[TX_RING_SIZE];
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index 5ebdf8d..22b7748 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -91,7 +91,8 @@ static struct platform_device_id fec_devtype[] = {
 		.driver_data = 0,
 	}, {
 		.name = "imx28-fec",
-		.driver_data = FEC_QUIRK_ENET_MAC | FEC_QUIRK_SWAP_FRAME,
+		.driver_data = FEC_QUIRK_ENET_MAC | FEC_QUIRK_SWAP_FRAME |
+				FEC_QUIRK_SINGLE_MDIO,
 	}, {
 		.name = "imx6q-fec",
 		.driver_data = FEC_QUIRK_ENET_MAC | FEC_QUIRK_HAS_GBIT |
@@ -1952,7 +1953,7 @@ static int fec_enet_mii_init(struct platform_device *pdev)
 	 * mdio interface in board design, and need to be configured by
 	 * fec0 mii_bus.
 	 */
-	if ((fep->quirks & FEC_QUIRK_ENET_MAC) && fep->dev_id > 0) {
+	if ((fep->quirks & FEC_QUIRK_SINGLE_MDIO) && fep->dev_id > 0) {
 		/* fec1 uses fec0 mii_bus */
 		if (mii_cnt && fec0_mii_bus) {
 			fep->mii_bus = fec0_mii_bus;
@@ -2015,7 +2016,7 @@ static int fec_enet_mii_init(struct platform_device *pdev)
 	mii_cnt++;
 
 	/* save fec0 mii_bus */
-	if (fep->quirks & FEC_QUIRK_ENET_MAC)
+	if (fep->quirks & FEC_QUIRK_SINGLE_MDIO)
 		fec0_mii_bus = fep->mii_bus;
 
 	return 0;
-- 
1.7.9.5


             reply	other threads:[~2015-01-06 13:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-06 13:47 Bhuvanchandra DV [this message]
2015-01-06 14:51 ` Stefan Agner
2015-01-07  2:11   ` fugang.duan
2015-01-07 10:30     ` Stefan Agner
2015-01-08  3:33       ` fugang.duan
2015-01-08 18:58         ` Stefan Agner
2015-01-09  3:00           ` fugang.duan
2015-01-09  8:22             ` Stefan Agner
2015-01-09  8:43               ` fugang.duan

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=1420552052-4697-1-git-send-email-bhuvanchandra.dv@toradex.com \
    --to=bhuvanchandra.dv@toradex.com \
    --cc=B38611@freescale.com \
    --cc=Frank.Li@freescale.com \
    --cc=LW@KARO-electronics.de \
    --cc=b45643@freescale.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stefan@agner.ch \
    /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

all inboxes | Powered by JetHome®