public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Generic PHY Driver Changes
@ 2006-06-23  0:32 Jay Foster
  0 siblings, 0 replies; only message in thread
From: Jay Foster @ 2006-06-23  0:32 UTC (permalink / raw)
  To: 'gary@mlbassoc.com'; +Cc: 'ecos-discuss@ecos.sourceware.org'

I'm developing a new ethernet driver for an MCU that has two ethernet
interfaces.  I would like to use the generic PHY driver, but have
encountered the following problem:

The two ethernet interfaces on the MCU share common MDC and MDIO signals, so
both PHYs are on the same MII bus.  The _eth_phy_init() function simply
scans each possible MII address (0 through 31) attempting to find a PHY
driver.  It will find the same PHY for both ethernet interfaces.  There
currently is no way to specify which PHY is associated with which ethernet
interface.

Some possible solutions (for discussion) are:

1) Set the initial phy_addr member of the eth_phy_access_t object passed to
_eth_phy_init() to indicate that _eth_phy_init() should only try that MII
address.  One approach would be to logically OR the phy_addr value with a
special flag bit (0x20 for example).  The _eth_phy_init() routine could
detect this, since the resulting phy_addr value would be invalid, and just
look for the PHY at that address (after removing the flag bit of course).

2) Add an additional parameter to the _eth_phy_init() function.  Perhaps a
'flags' parameter.  A flag could be defined that indicates to only look for
the PHY at the address specified by the initial phy_addr value in the
eth_phy_access_t object.  The flags parameter could be expanded in the
future to have other uses too.

Any thoughts?

Jay

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-06-23  0:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-23  0:32 [ECOS] Generic PHY Driver Changes Jay Foster

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).