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

Andy Fleming afleming at freescale.com
Thu Jun 25 07:25:06 EST 2009


>
>> *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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20090624/76218efa/attachment-0001.htm>


More information about the Linuxppc-dev mailing list