summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValerie Henson <val_henson@linux.intel.com>2007-03-12 02:31:29 -0700
committerJeff Garzik <jeff@garzik.org>2007-04-28 11:00:58 -0400
commitb3bff39a2b3574542f5007e19038393dfdd64c85 (patch)
tree4e4f8caf4a9be3c215972c8e50c7198f279c076b
parentc28896a4244e2fbe28c94e3a6048625f5c15cab4 (diff)
downloadlinux-3.10-b3bff39a2b3574542f5007e19038393dfdd64c85.tar.gz
linux-3.10-b3bff39a2b3574542f5007e19038393dfdd64c85.tar.bz2
linux-3.10-b3bff39a2b3574542f5007e19038393dfdd64c85.zip
TULIP: Fix for 64-bit MIPS
From: Jim Gifford <maillist@jg555.com>, Grant Grundler <grundler@parisc-linux.org>, Peter Horton <pdh@colonel-panic.org> With Grant's help I was able to get the tulip driver to work with 64 bit MIPS. [VAL: I'm happy with the 1.5 ms max delay; it doesn't seem excessive.] Signed-off-by: Valerie Henson <val_henson@linux.intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Cc: Jeff Garzik <jgarzik@pobox.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
-rw-r--r--drivers/net/tulip/media.c22
-rw-r--r--drivers/net/tulip/tulip.h7
2 files changed, 25 insertions, 4 deletions
diff --git a/drivers/net/tulip/media.c b/drivers/net/tulip/media.c
index 20bd52b8699..1594160a0f6 100644
--- a/drivers/net/tulip/media.c
+++ b/drivers/net/tulip/media.c
@@ -44,8 +44,10 @@ static const unsigned char comet_miireg2offset[32] = {
/* MII transceiver control section.
Read and write the MII registers using software-generated serial
- MDIO protocol. See the MII specifications or DP83840A data sheet
- for details. */
+ MDIO protocol.
+ See IEEE 802.3-2002.pdf (Section 2, Chapter "22.2.4 Management functions")
+ or DP83840A data sheet for more details.
+ */
int tulip_mdio_read(struct net_device *dev, int phy_id, int location)
{
@@ -272,13 +274,29 @@ void tulip_select_media(struct net_device *dev, int startup)
int reset_length = p[2 + init_length];
misc_info = (u16*)(reset_sequence + reset_length);
if (startup) {
+ int timeout = 10; /* max 1 ms */
iowrite32(mtable->csr12dir | 0x100, ioaddr + CSR12);
for (i = 0; i < reset_length; i++)
iowrite32(reset_sequence[i], ioaddr + CSR12);
+
+ /* flush posted writes */
+ ioread32(ioaddr + CSR12);
+
+ /* 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(init_sequence[i], ioaddr + CSR12);
+
+ ioread32(ioaddr + CSR12); /* flush posted writes */
}
+
tmp_info = get_u16(&misc_info[1]);
if (tmp_info)
tp->advertising[phy_num] = tmp_info | 1;
diff --git a/drivers/net/tulip/tulip.h b/drivers/net/tulip/tulip.h
index 25f25da7691..ceac47e775c 100644
--- a/drivers/net/tulip/tulip.h
+++ b/drivers/net/tulip/tulip.h
@@ -482,8 +482,11 @@ static inline void tulip_stop_rxtx(struct tulip_private *tp)
udelay(10);
if (!i)
- printk(KERN_DEBUG "%s: tulip_stop_rxtx() failed\n",
- pci_name(tp->pdev));
+ printk(KERN_DEBUG "%s: tulip_stop_rxtx() failed"
+ " (CSR5 0x%x CSR6 0x%x)\n",
+ pci_name(tp->pdev),
+ ioread32(ioaddr + CSR5),
+ ioread32(ioaddr + CSR6));
}
}