[U-Boot-Users] DP83848 PHY for AT91RM9200 board

ksi at koi8.net ksi at koi8.net
Mon Oct 1 19:07:26 CEST 2007


On Mon, 1 Oct 2007, Marco Cavallini wrote:

> ksi at koi8.net ha scritto:
>> On Mon, 1 Oct 2007, Marco Cavallini wrote:
>> 
>> Here is DP83848 driver code for AT91RM9200 for u-boot-1.1.4 :) Just
> from my
>> archives...
>> 
>> Something might be missing but the driver source and the header files
> are
>> there...
>> 
>>> Hi,
>>> I'm using u-boot-1.1.4 (quite old but I must use it)
>>> with my AT91RM9200 based board.
>>> I replaced DM9161 with a new DP83848 PHY ethernet physical layer
>>> transceiver.
>>> 
>>> So I'm backporting Sergey Kubushyn's driver
>>> National Semiconductor DP83848 PHY Driver for TI DaVinci
> (TMS320DM644x)
>>> adapting it for my AT91RM9200 based board.
>>> 
>>> I left eth_init() like it was for DM9161 because connections are the
>>> same.
>>> The problem I'm facing to is that PHY is not detected when I call
>>> dp83848_is_phy_connected (see below).
>>> 
>>> I wonder if anybody used DP83848 PHY before and maybe could give me a
>>> hint.
>>> 
>>> int dp83848_is_phy_connected(AT91PS_EMAC phy_addr)
>>> {
>>>     u_int16_t    id1, id2;
>>>
>>>     printf ("*** dp83848_is_phy_connected\n");
>>>
>>>     at91rm9200_EmacEnableMDIO (phy_addr);
>>>     at91rm9200_EmacReadPhy(phy_addr, DP83848_PHYID1_REG, &id1) ;
>>>     at91rm9200_EmacReadPhy(phy_addr, DP83848_PHYID2_REG, &id2) ;
>>>     at91rm9200_EmacDisableMDIO (phy_addr);
>>>
>>>     printf ("phy_addr=%X - id1=%X - id2=%X\n", phy_addr, id1, id2);
>>>     // here I always get 0xFFFBC000 0xFFFF 0xFFFF
>>>
>>>     if ((id1 == DP83848_PHYID1_OUI) && (id2 == DP83848_PHYID2_OUI))
>>>         return(1);
>>>
>>>     return(0);
>>> }
>>> 
>>> TIA
>>> -- 
>>> Marco Cavallini
>
>
>
> Hi Sergey,
> thank you for answering.
> we have just discovered an hardware mistake on PFBOUT-PFBIN2 pins
> now I can detect the PHY using your code

Please be aware that for AT91RM9200 you should read the negotiated
connection status from the PHY and setup EMAC accordingly. That is in that
old code.

Davinci, on the other hand, doesn't require it (as a matter of fact it
doesn't even have provision for setting those parameters for EMAC,) it's
more automated so PHY code is different. And PHY presence is detected by
reading DaVinci register that monitors PHY presence.

---
******************************************************************
*  KSI at home    KOI8 Net  < >  The impossible we do immediately.  *
*  Las Vegas   NV, USA   < >  Miracles require 24-hour notice.   *
******************************************************************




More information about the U-Boot mailing list