*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
_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://lists.ozlabs.org/listinfo/linuxppc-dev

Reply via email to