[U-Boot-Users] [PATCH] Add support for Generic PHY in macb

Haavard Skinnemoen
2008-02-22T14:39:28Z

On Fri, 22 Feb 2008 15:05:52 +0100
michael <trimarchi@gandalf.sssup.it> wrote:

> - dm9161a
> - at91sam9260
>
> When I try to read at phy id it reports 0xffff and linux too.
> I suppose that can be related to a broken phy. But seems to be
> broken on this read. I think that you have more experience,
> do you have an idea?

According to the data sheet, a read from PHYID1 should return 0x0181 on
this particular PHY. So the PHY seems sane enough, but something is not
working as it should.

There can be several reasons why the PHY doesn't respond:
* The board code specifies the wrong PHY address. If this is the
case, the PHY will simply not respond to anything.
* The board code has not set up the MDIO and MDC I/O pins for use
by the MACB. If so, the CPU won't toggle these lines as it should,
and it will probably just see floating signals on the input.
* The MDIO and/or MDC lines aren't connected to the PHY. If so,
there's really nothing to do about it except modify the driver to
use fixed settings instead of asking the PHY about the current
speed/duplex settings.
* The PHYAD[4:0] pins on the PHY aren't strapped correctly. The state
of these pins is latched on powerup and determine the PHY address. A
combination of pull-ups and pull-downs must be used to specify a
particular address. IIRC address 0 is special, so you probably
shouldn't pull all of them down.

Or it could be something else. Hard to say for sure without seeing the
board code and schematics.

I think that if the macb driver only ever sees 0xffff returned from the
PHY it will probably still work, but it will always run at 100 Mbps
full-duplex. So while your patch appears to work, I suspect it will
fail if you plug your device into a switch or hub that doesn't do 100
Mbps full-duplex.

Haavard