All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/2] net: fec_mxc: Fix setting of RCR for xMII
       [not found] <9848F2DB572E5649BA045B288BE08FBEE2D9DD@039-SN2MPN1-021.039d.mgd.msft.net>
@ 2012-07-23 17:43 ` Benoît Thébaudeau
  0 siblings, 0 replies; 3+ messages in thread
From: Benoît Thébaudeau @ 2012-07-23 17:43 UTC (permalink / raw)
  To: u-boot

Hi Andy,

On Mon, Jul 23, 2012 at 04:11:22AM, Duan Fugang-B38611 wrote:
> With flow control (FCE) feature, it depends on the hardware support.
> I.MX serial Ethernet ip (FEC, enet) can support the features, and it
> don't need to enable flow control in 100Mbps transition in fact.
> As our test result, if Ethernet rx bandwidth more than 140Mbps, FCE
> feature can be helpful to resolve FIFO overruns issue.
> In uboot, Ethernet has no the  similar cases needed so big bandwidth,
> so it don't care FCE feature.

OK.

> With fec_open enables full-duplex in TCR regardless of xcv_type, it
> is not reasonable.
> The good method must be use auto-negotiation and check phy duplex
> status,  you can refer to net/mxc_fec.c file.

I agree. I don't have time to fix this right now. Perhaps you or someone else
can handle this. There does not seem to be any bug tracking system in U-Boot, so
I don't know if something specific should be done to report this. Anyway, this
does not seem to be an issue for current hardware using this driver, so there is
no emergency.

I also noticed that fec_eth_phy_config calls phy_connect with
PHY_INTERFACE_MODE_RGMII regardless of xcv_type, which does not seem
appropriate.

Best regards,
Beno?t

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH 1/2] net: fec_mxc: Fix setting of RCR for xMII
       [not found] <9848F2DB572E5649BA045B288BE08FBEE2A8C0@039-SN2MPN1-021.039d.mgd.msft.net>
@ 2012-07-21 13:49 ` Benoît Thébaudeau
  0 siblings, 0 replies; 3+ messages in thread
From: Benoît Thébaudeau @ 2012-07-21 13:49 UTC (permalink / raw)
  To: u-boot

Hi Andy,

On Fri, Jul 20, 2012 at 07:35:30AM, Duan Fugang-B38611 wrote:
> The changes is reasonable. Thanks!
> 
> Best Regards,
> Andy

The change for MII_MODE is clear.

As to FCE, this can be discussed, and it depends on the hardware support.
Actually, fec_open enables full-duplex in TCR regardless of xcv_type, so a
further change could be to set the FCE bit for full-duplex flow control in
fec_reg_setup regardless of xcv_type, or on the contrary, to make the
full-duplex setting in fec_open depend on xcv_type. In the latter case, RCR[DRT]
could also be set for the half-duplex case.

Best regards,
Beno?t

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH 1/2] net: fec_mxc: Fix setting of RCR for xMII
@ 2012-07-19 12:12 Benoît Thébaudeau
  0 siblings, 0 replies; 3+ messages in thread
From: Benoît Thébaudeau @ 2012-07-19 12:12 UTC (permalink / raw)
  To: u-boot

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);
 }

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-07-23 17:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <9848F2DB572E5649BA045B288BE08FBEE2D9DD@039-SN2MPN1-021.039d.mgd.msft.net>
2012-07-23 17:43 ` [U-Boot] [PATCH 1/2] net: fec_mxc: Fix setting of RCR for xMII Benoît Thébaudeau
     [not found] <9848F2DB572E5649BA045B288BE08FBEE2A8C0@039-SN2MPN1-021.039d.mgd.msft.net>
2012-07-21 13:49 ` Benoît Thébaudeau
2012-07-19 12:12 Benoît Thébaudeau

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.