Skip to contentSkip to conversation

PHY library?

U-Boot-Users David Saada 6 participants 7 messages Nov 21, 2007

lore
Share & tools
lore
#0 lore raw

Hi,
I have a new PHY that needs to be handled in U-boot. Now this PHY is used in two differenet ports - TSEC & UCC (it's an MPC8568 board). The problem is that now I need to duplicate the handling of this PHY in both the TSEC and UCC drivers. Wouldn't it be better if U-boot had an indepedent PHY library (as in Linux) used by the different Ethernet drivers?
Regards,
David.

Signature · 2 lines
View this message in context: http://www.nabble.com/PHY-library--tf4849909.html#a13876488
Sent from the Uboot - Users mailing list archive at Nabble.com.
#1 lore raw
Quoted 2 lines · On Wed, 21 Nov 2007 04:51:19 -0800 (PST) David Saada <[email protected]>…

Wouldn't it be better if U-boot had an indepedent PHY library (as in Linux) used by the different Ethernet drivers?

Absolutely. At the very least, the multiple MII header files and duplicate MII register definitions at various places under include/ should be consolidated. But I think it makes sense to take it one step further and do a MAC-independent PHY library as well.

H?vard

#2 lore raw
In reply to David Saada
Quoted 9 lines · David Saada

Hi,
I have a new PHY that needs to be handled in U-boot. Now this PHY is used in two differenet ports - TSEC & UCC (it's an MPC8568 board). The problem is that now I need to duplicate the handling of this PHY in both the TSEC and UCC drivers. Wouldn't it be better if U-boot had an indepedent PHY library (as in Linux) used by the different Ethernet drivers?
Regards,
David.

Absolutely. In fact, I'm working on one right now... Access methods to PHYs are currently common (miiphybb.c and miiphyutil.c) but there's no reason why the TSEC, UCC and other drivers should have hard wiring for individual PHY devices. Any design suggestions you or others have are welcome.

regards,
Ben

#3 lore raw
Quoted 9 lines · Ben Warren
Quoted 7 lines

I have a new PHY that needs to be handled in U-boot. Now this PHY is used in two differenet ports - TSEC & UCC (it's an MPC8568 board). The problem is that now I need to duplicate the handling of this PHY in both the TSEC and UCC drivers. Wouldn't it be better if U-boot had an indepedent PHY library (as in Linux) used by the different Ethernet drivers? Regards,
David.

Absolutely. In fact, I'm working on one right now...

That's great news. Thanks.

Quoted 5 lines

Access methods to
PHYs are currently common (miiphybb.c and miiphyutil.c) but there's no reason why the TSEC, UCC and other drivers should have hard wiring for individual PHY devices. Any design suggestions you or others have are welcome.

Not really. Just "Go Ben, go go go ...!" ;)

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================

#4 lore raw
In reply to Ben Warren
Quoted 5 lines · Ben Warren

Absolutely. In fact, I'm working on one right now... Access methods to PHYs are currently common (miiphybb.c and miiphyutil.c) but there's no reason why the TSEC, UCC and other drivers should have hard wiring for individual PHY devices. Any design suggestions you or others have are welcome.

Well, there _is_ the long standing tradition of, er, borrowing code from Linux...where there just happens to be a PHY lib already in place, written by somebody named Andy Fleming. We might consider leveraging that some...?

jdl

#5 lore raw
Quoted 11 lines · Jon Loeliger
Quoted 6 lines · Ben Warren

Absolutely. In fact, I'm working on one right now... Access methods to PHYs are currently common (miiphybb.c and miiphyutil.c) but there's no reason why the TSEC, UCC and other drivers should have hard wiring for individual PHY devices. Any design suggestions you or others have are welcome.

Quoted 10 lines

Well, there _is_ the long standing tradition of, er, borrowing code from Linux...where there just happens to be a PHY lib already in place, written by somebody named Andy Fleming. We might consider leveraging that some...?

jdl

There will be much blatant ripping-off of Andy's fine library.

Ben

#6 lore raw
Quoted 11 lines · Ben Warren
Quoted 10 lines · Jon Loeliger
Quoted 6 lines · Ben Warren

Absolutely. In fact, I'm working on one right now... Access methods to PHYs are currently common (miiphybb.c and miiphyutil.c) but there's no reason why the TSEC, UCC and other drivers should have hard wiring for individual PHY devices. Any design suggestions you or others have are welcome.

[...]

Quoted 1 line

There will be much blatant ripping-off of Andy's fine library.

Excellent. It was on my personal to-do list, but I'm still bogged down in other tasks. So I second the "Go Ben Go!" sentiment!

If I had one potentially non-obvious design request it's that the PHYs be accessible by board code, too. There are a number of boards that have specific demands on the PHYs. I suspect you've already got that, though, since it's currently possible. :)

Andy