Thread (6 messages) 6 messages, 3 authors, 2009-06-24

Re: [PATCH] gianfar: Fix half-duplex operation for non-MII/RMII interfaces

From: Andy Fleming <hidden>
Date: 2009-06-24 21:25:27
Also in: linuxppc-dev

quoted
*Technically*, full
duplex is required for GMII, as GMII is used only for gigabit.   
However,
we've been treating the GMII interface type as an indicator that  
the PHY
*has* a GMII connection to the NIC.  When gianfar detects the speed  
is
10/100 it switches to the compatible MII interface via this code,  
just
below:

                       case 100:
                       case 10:
                               tempval =
                                   ((tempval & ~(MACCFG2_IF)) |
MACCFG2_MII);


My concern is that you will be detecting the GMII interface, and
disallowing half-duplex, despite the fact that the interface is  
actually
running at 10 or 100 Mbit.
Very interesting, though I'm not sure I'm completely following. :-)

Are you saying that I should do this instead:

	if (!phydev->duplex &&
			(phyi == PHY_INTERFACE_MODE_MII ||
			 phyi == PHY_INTERFACE_MODE_RMII ||
			 (phyi == PHY_INTERFACE_MODE_GMII &&
			  phydev->speed < 1000)))
		tempval &= ~MACCFG2_FULL_DUPLEX;
	else
		tempval |= MACCFG2_FULL_DUPLEX;

i.e. we detected GMII interface initially, but it downgraded
to MII since speed is < 1000, thus we can set half-duplex in MAC?
Yeah, I think that works out more correctly.  And I suspect that the  
same is true for UCC

Andy
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help