public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] [PATCH] Add support for Generic PHY in macb
@ 2008-02-22 12:27 Michael Trimarchi
  2008-02-22 12:52 ` Haavard Skinnemoen
  0 siblings, 1 reply; 23+ messages in thread
From: Michael Trimarchi @ 2008-02-22 12:27 UTC (permalink / raw)
  To: u-boot

Hi,
> On Fri, 22 Feb 2008 12:41:17 +0100
> michael  wrote:
> 
> > Add support for Generic PHY in macb.
> > 
> > Signed-off-by: michael 
> 
> What's a "generic PHY"?
> 

> hskinnemoen at dhcp-252-066:~/git/u-boot/master$ grep -r GENERIC_PHY 
> include/configs
> hskinnemoen at dhcp-252-066:~/git/u-boot/master$ 
> 
> >         if (phy_id == 0xffff) {
> > +#if defined (CONFIG_GENERIC_PHY)
> > +               printf("%s: Using the Generic PHY\n", netdev->name);
> > +#else
> >                 printf("%s: No PHY present\n", netdev->name);
> >                 return 0;
> > +#endif
>
When I read to my id u-boot report 0xffff and fail, but
the device works pretty well skipping this testing. 
If I remember linux report the same issue.

I test it on my board and it works well.

Regards Michael







      ___________________________________ 
L'email della prossima generazione? Puoi averla con la nuova Yahoo! Mail: http://it.docs.yahoo.com/nowyoucan.html

^ permalink raw reply	[flat|nested] 23+ messages in thread
* [U-Boot-Users] [PATCH] Add support for Generic PHY in macb
@ 2008-02-22 16:19 Michael Trimarchi
  2008-02-26  1:30 ` Ben Warren
  0 siblings, 1 reply; 23+ messages in thread
From: Michael Trimarchi @ 2008-02-22 16:19 UTC (permalink / raw)
  To: u-boot

Hi,
----- Messaggio originale -----
> Da: Haavard Skinnemoen <hskinnemoen@atmel.com>
> A: Michael Trimarchi <trimarchimichael@yahoo.it>
> Cc: Michael Schwingen <rincewind@discworld.dascon.de>; u-boot-users at lists.sourceforge.net
> Inviato: Venerd? 22 febbraio 2008, 17:08:56
> Oggetto: Re: [U-Boot-Users] [PATCH] Add support for Generic PHY in macb
> 
> On Fri, 22 Feb 2008 16:02:13 +0000 (GMT)
> Michael Trimarchi  wrote:
> 
> > > In any case, the dm9161a PHY in question does implement MDIO, so it
> > > really should work without any modifications.
> > >   
> > Maybe we can add the for cycle like in linux to check the phy addr?
> 
> Yes, we could do that. But it comes with its own share of problems --
> some boards have a too weak pull-up (or none at all) on the MDIO line,
> so the probing code sometimes thinks it has found a whole bunch of
> PHYs...
> 
> Haavard
>
But the u-boot user may to choice to use the automatic detection, based on
phy_id mask and stop the search on the first one, or somenthing like this.

Michael

 




      ___________________________________ 
L'email della prossima generazione? Puoi averla con la nuova Yahoo! Mail: http://it.docs.yahoo.com/nowyoucan.html

^ permalink raw reply	[flat|nested] 23+ messages in thread
* [U-Boot-Users] [PATCH] Add support for Generic PHY in macb
@ 2008-02-22 16:02 Michael Trimarchi
  2008-02-22 16:08 ` Haavard Skinnemoen
  0 siblings, 1 reply; 23+ messages in thread
From: Michael Trimarchi @ 2008-02-22 16:02 UTC (permalink / raw)
  To: u-boot

Hi

----- Messaggio originale -----
> Da: Haavard Skinnemoen <hskinnemoen@atmel.com>
> A: Michael Schwingen <rincewind@discworld.dascon.de>
> Cc: Michael Trimarchi <trimarchimichael@yahoo.it>; u-boot-users at lists.sourceforge.net
> Inviato: Venerd? 22 febbraio 2008, 16:34:03
> Oggetto: Re: [U-Boot-Users] [PATCH] Add support for Generic PHY in macb
> 
> On Fri, 22 Feb 2008 16:05:34 +0100
> Michael Schwingen  wrote:
> 
> > Haavard Skinnemoen wrote:
> > > All MII-capable PHYs should have a working PHYSID1 register. If it
> > > doesn't, something is broken.
> > >   
> > It depends - I am not sure if there are PHYs which simply do not 
> > implement MDIO, but at least for ethernet switches, such chips do exist.
> 
> Right. We might need to add support for such PHYs, but just disabling
> the sanity check is far from enough.
> 
> In any case, the dm9161a PHY in question does implement MDIO, so it
> really should work without any modifications.
> 
Maybe we can add the for cycle like in linux to check the phy addr?

Michael





      ___________________________________ 
L'email della prossima generazione? Puoi averla con la nuova Yahoo! Mail: http://it.docs.yahoo.com/nowyoucan.html

^ permalink raw reply	[flat|nested] 23+ messages in thread
* [U-Boot-Users] [PATCH] Add support for Generic PHY in macb
@ 2008-02-22 14:07 Michael Trimarchi
  0 siblings, 0 replies; 23+ messages in thread
From: Michael Trimarchi @ 2008-02-22 14:07 UTC (permalink / raw)
  To: u-boot


Hi,
----- Messaggio originale -----
> Da: Haavard Skinnemoen <hskinnemoen@atmel.com>
> A: Michael Trimarchi <trimarchimichael@yahoo.it>
> Cc: michael <trimarchi@gandalf.sssup.it>; u-boot-users at lists.sourceforge.net
> Inviato: Venerd? 22 febbraio 2008, 13:52:09
> Oggetto: Re: [U-Boot-Users] [PATCH] Add support for Generic PHY in macb
> 
> On Fri, 22 Feb 2008 12:27:48 +0000 (GMT)
> Michael Trimarchi  wrote:
> 
> > When I read to my id u-boot report 0xffff and fail, but
> > the device works pretty well skipping this testing. 
> > If I remember linux report the same issue.
> 
> Is the MII address of your PHY set correctly?
> 
> All MII-capable PHYs should have a working PHYSID1 register. If it
> doesn't, something is broken.
> 
> So I think the CONFIG_GENERIC_PHY name is misleading -- the test is
> generic enough as is. CONFIG_BROKEN_PHY would be better, if there's
> really no way to get your PHY to behave.
> 
> But note that if MDIO communication isn't working, autonegotiation
> won't work, and the speed and duplex settings will most likely be
> wrong. So I don't think simply #ifdefing out that sanity check is
> really going to solve any problems.
> 
> Haavard
>
Yes I know but this is the situation:

- 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?

Regards Michael






      ___________________________________ 
L'email della prossima generazione? Puoi averla con la nuova Yahoo! Mail: http://it.docs.yahoo.com/nowyoucan.html

^ permalink raw reply	[flat|nested] 23+ messages in thread
* [U-Boot-Users] [PATCH] Add support for Generic PHY in macb
@ 2008-02-22 12:29 Michael Trimarchi
  0 siblings, 0 replies; 23+ messages in thread
From: Michael Trimarchi @ 2008-02-22 12:29 UTC (permalink / raw)
  To: u-boot

Hi,
> 
> >         if (phy_id == 0xffff) {
> > +#if defined (CONFIG_GENERIC_PHY)
> > +               printf("%s: Using the Generic PHY\n", netdev->name);
> > +#else
> >                 printf("%s: No PHY present\n", netdev->name);
> >                 return 0;
> > +#endif
> 
> You mean a PHY that isn't actually hooked up?
> 
The CONFIG_GENERIC_PHY is not u-boot option currently.
This patch is a proposal.

Regards Michael





      ___________________________________ 
L'email della prossima generazione? Puoi averla con la nuova Yahoo! Mail: http://it.docs.yahoo.com/nowyoucan.html

^ permalink raw reply	[flat|nested] 23+ messages in thread
* [U-Boot-Users] [PATCH] Add support for Generic PHY in macb
@ 2008-02-22 11:41 michael
  2008-02-22 12:16 ` Haavard Skinnemoen
  0 siblings, 1 reply; 23+ messages in thread
From: michael @ 2008-02-22 11:41 UTC (permalink / raw)
  To: u-boot

Add support for Generic PHY in macb.

Signed-off-by: michael <trimarchi@gandalf.sssup.it>

---
 drivers/net/macb.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index 9c98338..2a6fc5d 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -330,8 +330,12 @@ static int macb_phy_init(struct macb_device *macb)
        /* Check if the PHY is up to snuff... */
        phy_id = macb_mdio_read(macb, MII_PHYSID1);
        if (phy_id == 0xffff) {
+#if defined (CONFIG_GENERIC_PHY)
+               printf("%s: Using the Generic PHY\n", netdev->name);
+#else
                printf("%s: No PHY present\n", netdev->name);
                return 0;
+#endif
        }

        status = macb_mdio_read(macb, MII_BMSR);
--

^ permalink raw reply related	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2008-02-26  1:30 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-22 12:27 [U-Boot-Users] [PATCH] Add support for Generic PHY in macb Michael Trimarchi
2008-02-22 12:52 ` Haavard Skinnemoen
2008-02-22 14:05   ` michael
2008-02-22 14:39     ` Haavard Skinnemoen
2008-02-22 15:05   ` Michael Schwingen
2008-02-22 15:34     ` Haavard Skinnemoen
2008-02-22 15:46       ` Michael Schwingen
2008-02-26  1:23       ` Ben Warren
  -- strict thread matches above, loose matches on Subject: below --
2008-02-22 16:19 Michael Trimarchi
2008-02-26  1:30 ` Ben Warren
2008-02-22 16:02 Michael Trimarchi
2008-02-22 16:08 ` Haavard Skinnemoen
2008-02-22 16:22   ` Michael Schwingen
2008-02-23 12:23   ` michael
2008-02-24  9:10     ` Michael Schwingen
2008-02-24 13:30       ` trimarchi at gandalf.sssup.it
2008-02-24 16:36         ` Michael Schwingen
2008-02-24 17:48           ` trimarchi at gandalf.sssup.it
2008-02-24 18:24         ` Andy Fleming
2008-02-22 14:07 Michael Trimarchi
2008-02-22 12:29 Michael Trimarchi
2008-02-22 11:41 michael
2008-02-22 12:16 ` Haavard Skinnemoen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox