netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Valerie Henson <val_henson@linux.intel.com>
To: Jeff Garzik <jeff@garzik.org>, akpm@osdl.org
Cc: netdev@vger.kernel.org, Thibaut VARENE <varenet@parisc-linux.org>,
	Jeff Garzik <jgarzik@pobox.com>,
	Grant Grundler <grundler@parisc-linux.org>,
	Valerie Henson <val_henson@linux.intel.com>
Subject: [patch 2/6] [TULIP]  From: Thibaut VARENE <T-Bone@parisc-linux.org>
Date: Mon, 12 Mar 2007 02:31:30 -0700	[thread overview]
Message-ID: <20070312184217.409509000@linux.intel.com> (raw)
In-Reply-To: 20070312093128.577087000@linux.intel.com

[-- Attachment #1: tulip-natsemi-dp83840a-phy-fix.patch --]
[-- Type: text/plain, Size: 1863 bytes --]

Fix a problem with Tulip 21142 HP branded PCI cards (PN#: B5509-66001),
which feature a NatSemi DP83840A PHY.

Without that patch, it is impossible to properly initialize the card's PHY,
and it's thus impossible to monitor/configure it.

[VAL: I'm happy with the 1.5 ms max delay; it doesn't seem excessive.]

Signed-off-by: Thibaut VARENE <varenet@parisc-linux.org>
Cc: Jeff Garzik <jgarzik@pobox.com>
Acked-by: Grant Grundler <grundler@parisc-linux.org>
Signed-off-by: Valerie Henson <val_henson@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 drivers/net/tulip/media.c |   18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff -puN drivers/net/tulip/media.c~tulip-natsemi-dp83840a-phy-fix drivers/net/tulip/media.c
--- a/drivers/net/tulip/media.c~tulip-natsemi-dp83840a-phy-fix
+++ a/drivers/net/tulip/media.c
@@ -263,11 +263,27 @@ void tulip_select_media(struct net_devic
 				u16 *reset_sequence = &((u16*)(p+3))[init_length];
 				int reset_length = p[2 + init_length*2];
 				misc_info = reset_sequence + reset_length;
-				if (startup)
+				if (startup) {
+					int timeout = 10;	/* max 1 ms */
 					for (i = 0; i < reset_length; i++)
 						iowrite32(get_u16(&reset_sequence[i]) << 16, ioaddr + CSR15);
+
+					/* flush posted writes */
+					ioread32(ioaddr + CSR15);
+
+					/* Sect 3.10.3 in DP83840A.pdf (p39) */
+					udelay(500);
+
+					/* Section 4.2 in DP83840A.pdf (p43) */
+					/* and IEEE 802.3 "22.2.4.1.1 Reset" */
+					while (timeout-- &&
+						(tulip_mdio_read (dev, phy_num, MII_BMCR) & BMCR_RESET))
+						udelay(100);
+				}
 				for (i = 0; i < init_length; i++)
 					iowrite32(get_u16(&init_sequence[i]) << 16, ioaddr + CSR15);
+
+				ioread32(ioaddr + CSR15);	/* flush posted writes */
 			} else {
 				u8 *init_sequence = p + 2;
 				u8 *reset_sequence = p + 3 + init_length;
_

--

  parent reply	other threads:[~2007-03-12 18:42 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-12  9:59 [patch 0/4] [TULIP] Tulip updates Valerie Henson
2007-03-12  9:31 ` [patch 1/6] [TULIP] From: Jim Gifford <maillist@jg555.com>, Grant Grundler <grundler@parisc-linux.org>, Peter Horton <pdh@colonel-panic.org> Valerie Henson
2007-03-15 15:20   ` Jeff Garzik
2007-03-12  9:31 ` Valerie Henson [this message]
2007-03-12  9:31 ` [patch 3/6] [TULIP] fix for Lite-On 82c168 PNIC Valerie Henson
2007-03-15 15:21   ` Jeff Garzik
2007-03-12  9:31 ` [patch 4/6] [TULIP] Quiet down tulip_stop_rxtx Valerie Henson
2007-03-15 15:25   ` Jeff Garzik
2007-03-16  0:10     ` Valerie Henson
2007-03-17 19:05     ` Grant Grundler
2007-03-12  9:31 ` [patch 5/6] [TULIP] Fix SytemError typo Valerie Henson
2007-03-15 15:29   ` Jeff Garzik
2007-03-12  9:31 ` [patch 6/6] [TULIP] Rev tulip version Valerie Henson
2007-03-12  9:59 ` [patch 1/4] [TULIP] fix for Lite-On 82c168 PNIC Valerie Henson
2007-03-15 12:40   ` Mikael Pettersson
2007-03-12  9:59 ` [patch 2/4] [TULIP] Quiet down tulip_stop_rxtx Valerie Henson
2007-03-12  9:59 ` [patch 3/4] [TULIP] Fix SytemError typo Valerie Henson
2007-03-12  9:59 ` [patch 4/4] [TULIP] Rev tulip version Valerie Henson
2007-03-12 10:44   ` Pekka Enberg
2007-03-12 14:07     ` Jeff Garzik
2007-03-13 17:07       ` Andy Gospodarek

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=20070312184217.409509000@linux.intel.com \
    --to=val_henson@linux.intel.com \
    --cc=akpm@osdl.org \
    --cc=grundler@parisc-linux.org \
    --cc=jeff@garzik.org \
    --cc=jgarzik@pobox.com \
    --cc=netdev@vger.kernel.org \
    --cc=varenet@parisc-linux.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).