From: Kyle Moffett <kyle@moffetthome.net>
To: Grant Likely <grant.likely@secretlab.ca>
Cc: linuxppc-dev@ozlabs.org,
"Linux-Kernel@Vger. Kernel. Org" <linux-kernel@vger.kernel.org>,
netdev <netdev@vger.kernel.org>
Subject: Re: Porting the ibm_newemac driver to use phylib (and other PHY/MAC questions)
Date: Thu, 30 Apr 2009 11:33:31 -0400 [thread overview]
Message-ID: <f73f7ab80904300833w69025c2fjdefbe9f2eef323f1@mail.gmail.com> (raw)
In-Reply-To: <fa686aa40904300811u41e94972offfd75520636bb02@mail.gmail.com>
On Thu, Apr 30, 2009 at 11:11 AM, Grant Likely
<grant.likely@secretlab.ca> wrote:
> Just a heads up Kyle; there are changes queued in the netdev tree
> which add OF helpers for MDIO bus drivers and MAC drivers. =C2=A0See here=
:
>
> http://git.kernel.org/?p=3Dlinux/kernel/git/davem/net-next-2.6.git;a=3Dco=
mmit;h=3D8bc487d150b939e69830c39322df4ee486efe381
>
> and here is an example of a driver change:
>
> http://git.kernel.org/?p=3Dlinux/kernel/git/davem/net-next-2.6.git;a=3Dco=
mmit;h=3D1dd2d06c0459a2f1bffc56765e3cc57427818867
Hmm, very interesting! Thanks! Although I'm not sure that those OF
helpers are entirely usable for the emac driver at the moment, as the
device trees for the existing boards simply don't have PHYs present in
them. Most of the ibm_newemac board device-trees just have one of:
"phy-address =3D <4>", "phy-mask =3D <0xffff0000>", or nothing at all (for
autodetection). I will probably need to leave in support for the old
PHY mask parsing to preserve backwards compatibility.
My main concern at the moment is cleaning up the driver's general PHY
handling. I got started on this whole mess when I was trying to write
some hackish PHY drivers for a weird custom board I've got here. I
couldn't figure out why the hell all my PHY register changes in the
phy_ops->init function kept getting cleared, until I noticed 2 things:
The emac_reset_phy() function gets called occasionally and does not
call the ->init() function again afterwards. The
genmii_setup_forced() function (in the EMAC driver) unconditionally
ORs the BCMR_RESET flag into the MII_BCMR register. Both of those
meant that any early setup I did for my PHY was getting completely
cleared on a regular basis, with no decent way for me to patch it back
up again.
Cheers,
Kyle Moffett
next prev parent reply other threads:[~2009-04-30 15:33 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <f73f7ab80904171732n41832d0hc62978e57bbcc32e@mail.gmail.com>
2009-04-20 12:29 ` Porting the ibm_newemac driver to use phylib (and other PHY/MAC questions) Josh Boyer
2009-04-21 0:10 ` Kyle Moffett
2009-04-22 8:21 ` Benjamin Herrenschmidt
2009-04-30 15:04 ` Kyle Moffett
2009-04-30 15:11 ` Grant Likely
2009-04-30 15:33 ` Kyle Moffett [this message]
2009-04-30 21:18 ` Benjamin Herrenschmidt
2009-04-30 22:21 ` Kyle Moffett
2009-05-03 4:26 ` Kyle Moffett
2009-05-03 22:14 ` Benjamin Herrenschmidt
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=f73f7ab80904300833w69025c2fjdefbe9f2eef323f1@mail.gmail.com \
--to=kyle@moffetthome.net \
--cc=grant.likely@secretlab.ca \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=netdev@vger.kernel.org \
/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 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 NNTP newsgroup(s).