From: David Ashley <dash@xdr.com>
To: linuxppc-embedded@lists.linuxppc.org
Subject: fcc_enet.c phy mii communication broken
Date: Wed, 2 Jan 2002 21:54:42 -0800 [thread overview]
Message-ID: <200201030554.g035sgW00250@dave.home> (raw)
I switched from HHL 2.4.2 to the standard 2.4.17 kernel (surprisingly
easy, actually). One thing I found was the mii communication was broken in
arch/ppc/8260_io/fcc_enet.c
It was working in 2.4.2 but someone made changes that couldn't
possibly have worked. There is a loop where in the old version only
14 bits are clocked out, but in the new version 16 are. Then in both
versions 2 more bits are clocked either in or out depending on whether
it is a read or write operation. Then in the new version, on a read,
one more bit is clocked and lost before bits begin to get saved. The
net result is the 3 most significant bits are lost, and the data ends up
getting shifted 3 bits to the left, whereas on the original version it
worked fine.
What's more, this code isn't even getting called. Someone broke the
code, then disabled calling of it. They also removed the phy_speed from
the fcc_enet_private structure. True, it wasn't getting used but it
might eventually be. The system was locking the port in half duplex
mode.
I changed the way the system operates. I added fields in the fcc_info_t
structures which tell the interrupt number and the phy number, so if they
are specified those are taken to determine line settings. That is required
if there is more than one PHY. Then I install an interrupt handler for
the PHY interrupt, that will set the duplex/speed after auto-negotiation.
Also the mii_discover_phy_poll has to be called before the init_fcc_startup,
otherwise the duplex is set wrong. On and on and on...
Also someone removed the MII #defines and replaced them with magic numbers.
Why would anyone do that? It makes the code more cryptic and less useful.
Anyway just be warned that the mii_send_receive function is broken. You'd
be better off going back to the 2.4.2 version, if you find you're having
no luck with mii communication.
-Dave
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
reply other threads:[~2002-01-03 5:54 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=200201030554.g035sgW00250@dave.home \
--to=dash@xdr.com \
--cc=linuxppc-embedded@lists.linuxppc.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).