[U-Boot] [PATCH] tsec: Wait for auto-negotiation to complete without link

Andy Fleming afleming at gmail.com
Fri Feb 6 19:49:27 CET 2009


On Fri, Feb 6, 2009 at 7:32 AM, Jerry Van Baren <gerald.vanbaren at ge.com> wrote:
> Peter Tyser wrote:
>>

>>> The problem is that you don't always know which interface you have
>>> hooked up.  So u-boot tries the one set in ethact, and then the next,
>>> etc.  With the old method, the penalty for being wrong was quite high.
>>>  I hadn't run into an issue with the link not being up.  Why don't we
>>> look up the spec, and find out the maximum time we'd have to wait for
>>> that to happen.  That way we get the best of both worlds.  My sense is
>>> that the link comes up fast, but autonegotiation potentially takes a
>>> while.
>
> 2 seconds minimum, it is written in the autonegotiation spec.  If you add
> the spec-required minimum times for each step of the dance, it is 2 seconds.
>  It could take longer, but I've never seen anything but 2 seconds.

Could you point me at where in the spec it says this?  I've been
digging around in it, and found nothing concrete so far.


>
>> My understanding was that link was was never achieved until
>> autonegotiation was finished.  How could link be up before
>> autonegotiation was complete?


Actually, as best I can tell, the link status is not well-defined.
The PHY designers are allowed to decide for themselves when the link
is considered "up".  The link state machine goes through several
states, and before auto-negotiation completes, the link can be in a
"READY" state.

Anyway, I'm fairly convinced that we can't assume the link will come
up, first, but I'd like to review the part of the spec where it says 2
seconds, and then I suggest Peter modify his patch to change the
timeout to 2 seconds.  I'm also trying to figure out why I remember
the timeout being 30 seconds, when it is clearly setup to be 5...

> I never tried #3 personally, but my understanding of the link and
> autonegotiation dance is that #3 is not possible.
>
> You may see what appears to be #3 *if* your PHY is strapped to start
> autonegotiation on application of power (typically true) and *if* you don't
> do a software reset on the PHY as part of your power up sequence (see also
> my previous email on this thread).  This really isn't #3, it is...
> 4. Strap the PHY to autonegotiate on application of power and use the
>     results from that rather than resetting the PHY and re-starting
>     auto-negotiation in software.

I'd be fine with that, it's similar to a change we made in Linux,
where we don't reset a PHY that appears to be configured.

It seems to me that, as the timeout for receiving link negotiation
bursts from the link partner is 150ms, that after 150ms, the PHY would
be able to report the link as definitively down, somehow...

Anyway, I'm fine with a 2 second timeout, as long as I've confirmed it
in the spec.

And then I suspect we'll have to change it again when we find someone
who has a PHY that didn't conform to the spec...

Andy


More information about the U-Boot mailing list