All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Benoît Thébaudeau" <benoit.thebaudeau@advansee.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/2] net: fec_mxc: Fix setting of RCR for xMII
Date: Thu, 19 Jul 2012 14:12:46 +0200 (CEST)	[thread overview]
Message-ID: <1505433006.265325.1342699966550.JavaMail.root@advansee.com> (raw)

At least on i.MX25, the RMII mode did not work, which is fixed by this patch.

The MII_MODE bit of the FEC RCR register means xMII, i.e. 'not 7-wire', so set
it accordingly.

According to the xMII and 7-wire (aka GPSI) standards, full duplex should be
available on xMII, but not on 7-wire, so set FCE accordingly. The FEC may
support full duplex for 7-wire too, but the reference manual does not say that,
so avoid an invalid assumption. Actually, the choice between half and full
duplex also depends on the endpoint/switch/repeater configuration, so a config
option could be added for that, but there has been no need for it so far.

Signed-off-by: Beno?t Th?baudeau <benoit.thebaudeau@advansee.com>
Cc: Joe Hershberger <joe.hershberger@gmail.com>
Cc: Stefano Babic <sbabic@denx.de>
---
 .../drivers/net/fec_mxc.c                          |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git u-boot-66714b1.orig/drivers/net/fec_mxc.c u-boot-66714b1/drivers/net/fec_mxc.c
index eee41d7..c64a223 100644
--- u-boot-66714b1.orig/drivers/net/fec_mxc.c
+++ u-boot-66714b1/drivers/net/fec_mxc.c
@@ -424,14 +424,12 @@ static void fec_reg_setup(struct fec_priv *fec)
 
 	/* Start with frame length = 1518, common for all modes. */
 	rcntrl = PKTSIZE << FEC_RCNTRL_MAX_FL_SHIFT;
-	if (fec->xcv_type == SEVENWIRE)
-		rcntrl |= FEC_RCNTRL_FCE;
-	else if (fec->xcv_type == RGMII)
+	if (fec->xcv_type != SEVENWIRE)		/* xMII modes */
+		rcntrl |= FEC_RCNTRL_FCE | FEC_RCNTRL_MII_MODE;
+	if (fec->xcv_type == RGMII)
 		rcntrl |= FEC_RCNTRL_RGMII;
 	else if (fec->xcv_type == RMII)
 		rcntrl |= FEC_RCNTRL_RMII;
-	else	/* MII mode */
-		rcntrl |= FEC_RCNTRL_FCE | FEC_RCNTRL_MII_MODE;
 
 	writel(rcntrl, &fec->eth->r_cntrl);
 }

             reply	other threads:[~2012-07-19 12:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-19 12:12 Benoît Thébaudeau [this message]
     [not found] <9848F2DB572E5649BA045B288BE08FBEE2A8C0@039-SN2MPN1-021.039d.mgd.msft.net>
2012-07-21 13:49 ` [U-Boot] [PATCH 1/2] net: fec_mxc: Fix setting of RCR for xMII Benoît Thébaudeau
     [not found] <9848F2DB572E5649BA045B288BE08FBEE2D9DD@039-SN2MPN1-021.039d.mgd.msft.net>
2012-07-23 17:43 ` Benoît Thébaudeau

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=1505433006.265325.1342699966550.JavaMail.root@advansee.com \
    --to=benoit.thebaudeau@advansee.com \
    --cc=u-boot@lists.denx.de \
    /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.