From: Graeme Russ <graeme.russ@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] Question: Information regarding MII and PHY
Date: Fri, 23 Sep 2011 10:17:33 +1000 [thread overview]
Message-ID: <CALButC+UtA6MDh8fEED-iPab=Avh_RK1RxDyBn9bMek94cLHVw@mail.gmail.com> (raw)
In-Reply-To: <CAKWjMd7vwNHBU2SZC1-SqOKp-FVFxYtOm9UO-2_YA8cgSD-5bA@mail.gmail.com>
Hi Andy
On Fri, Sep 23, 2011 at 9:36 AM, Andy Fleming <afleming@gmail.com> wrote:
> On Thu, Sep 22, 2011 at 6:27 PM, Graeme Russ <graeme.russ@gmail.com> wrote:
[snip]
>> Is there any documentation on how I should build a new MAC and PHY driver
>> from scratch (i.e. what is the official network driver API)
>
> There's not really any documentation for phylib at the moment, except
> the header files. There aren't a lot of examples for mdio buses at the
> moment, but it's straightforward:
>
> 1) Call mdio_alloc() to create a new bus object
> 2) Fill in the name, then read, write, and reset functions, and set
> bus->priv to whatever context structure you want
> 3) Call mdio_register(bus)
>
> For an example, see drivers/net/fsl_mdio.c
>
> A PHY driver is not much more complicated, and there are many examples.
>
> Then, in the ethernet driver, you will need to call:
>
> phy_connect() to declare the connection between your MAC and the PHY
> phy_config() to initialize the PHY
>
> When the MAC is ready to deal with traffic, you call phy_startup()
>
> When the MAC is being shut down (the close function), you call phy_shutdown()
Thanks for the explanation - I'll have a look tonight
A couple of quick questions regarding network drivers...
1) Was it the case that the Linux phylib was 'tight' enough to bring
straight into U-Boot, or was a new phylib written for U-Boot?
2) The Linux network driver framework (at least now) is so
massive that porting a network driver over is practically impossible.
Is the U-Boot network driver framework similar in any way to the Linux
framework such that I can take relevant portions of code straight from
a Linux driver, or is it a case of carefully picking out the relevant
bits and stitching together a entirely new beast?
3) Any idea what would be one of the most recent network drivers added
from scratch to U-Boot that would serve as a 'style guide' for my new
driver?
Thanks and Regards,
Graeme
next prev parent reply other threads:[~2011-09-23 0:17 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-22 1:20 [U-Boot] Question: Information regarding MII and PHY Graeme Russ
2011-09-22 3:12 ` Graeme Russ
2011-09-22 22:21 ` Mike Frysinger
2011-09-22 23:06 ` Graeme Russ
2011-09-22 23:27 ` Graeme Russ
2011-09-22 23:36 ` Andy Fleming
2011-09-23 0:17 ` Graeme Russ [this message]
2011-09-23 1:23 ` Mike Frysinger
2011-09-27 16:32 ` Andy Fleming
2011-09-22 23:30 ` Andy Fleming
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CALButC+UtA6MDh8fEED-iPab=Avh_RK1RxDyBn9bMek94cLHVw@mail.gmail.com' \
--to=graeme.russ@gmail.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.