152 lines
5.0 KiB
Diff
152 lines
5.0 KiB
Diff
## DP: Tulip - fixes compile on MIPS64.
|
|
## DP: Path author: Grant Grundler <grundler@parisc-linux.org>
|
|
## DP: Basically got rejected as it by Jeff Garzik but needed for now.
|
|
## DP: Has been used by the HPPA folks for years
|
|
|
|
From: Jim Gifford <maillist@jg555.com>
|
|
|
|
I have been working on getting the RaQ2 to build using 64 bit. I ran
|
|
into numerous issues. After I got the kernel to compile, the tulip
|
|
driver didn't work. It kept showing error messages like
|
|
tulip_stop_rxtx() failed
|
|
|
|
This patch fixes the compile issue, this patch was create by Grant
|
|
Grundler of linux-parsic. This patch matches the tulip driver follow the
|
|
specs laid out by the manufacture. On 32 bit this patch seemed to make
|
|
the tulip more responsive on my RaQ2 systems.
|
|
|
|
diff -urN linux-mips/drivers/net/tulip/de2104x.c new/drivers/net/tulip/de2104x.c
|
|
--- linux-mips/drivers/net/tulip/de2104x.c 2006-01-10 11:21:43.000000000 +0000
|
|
+++ new/drivers/net/tulip/de2104x.c 2006-01-16 16:54:50.000000000 +0000
|
|
@@ -1787,15 +1787,10 @@
|
|
/* DEC now has a specification but early board makers
|
|
just put the address in the first EEPROM locations. */
|
|
/* This does memcmp(eedata, eedata+16, 8) */
|
|
-
|
|
-#ifndef CONFIG_MIPS_COBALT
|
|
-
|
|
for (i = 0; i < 8; i ++)
|
|
if (ee_data[i] != ee_data[16+i])
|
|
sa_offset = 20;
|
|
|
|
-#endif
|
|
-
|
|
/* store MAC address */
|
|
for (i = 0; i < 6; i ++)
|
|
de->dev->dev_addr[i] = ee_data[i + sa_offset];
|
|
@@ -1932,7 +1927,7 @@
|
|
goto fill_defaults;
|
|
}
|
|
|
|
-static int __init de_init_one (struct pci_dev *pdev,
|
|
+static int __devinit de_init_one (struct pci_dev *pdev,
|
|
const struct pci_device_id *ent)
|
|
{
|
|
struct net_device *dev;
|
|
diff -urN linux-mips/drivers/net/tulip/de4x5.c new/drivers/net/tulip/de4x5.c
|
|
--- linux-mips/drivers/net/tulip/de4x5.c 2006-01-10 11:21:43.000000000 +0000
|
|
+++ new/drivers/net/tulip/de4x5.c 2006-01-16 16:54:50.000000000 +0000
|
|
@@ -2124,7 +2124,6 @@
|
|
.remove = __devexit_p (de4x5_eisa_remove),
|
|
}
|
|
};
|
|
-MODULE_DEVICE_TABLE(eisa, de4x5_eisa_ids);
|
|
#endif
|
|
|
|
#ifdef CONFIG_PCI
|
|
diff -urN linux-mips/drivers/net/tulip/media.c new/drivers/net/tulip/media.c
|
|
--- linux-mips/drivers/net/tulip/media.c 2006-01-10 11:21:43.000000000 +0000
|
|
+++ new/drivers/net/tulip/media.c 2006-01-16 16:54:50.000000000 +0000
|
|
@@ -44,8 +44,10 @@
|
|
|
|
/* 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 @@
|
|
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;
|
|
@@ -365,8 +383,6 @@
|
|
|
|
tp->csr6 = new_csr6 | (tp->csr6 & 0xfdff) | (tp->full_duplex ? 0x0200 : 0);
|
|
|
|
- mdelay(1);
|
|
-
|
|
return;
|
|
}
|
|
|
|
diff -urN linux-mips/drivers/net/tulip/tulip.h new/drivers/net/tulip/tulip.h
|
|
--- linux-mips/drivers/net/tulip/tulip.h 2006-01-10 11:21:43.000000000 +0000
|
|
+++ new/drivers/net/tulip/tulip.h 2006-01-16 16:54:50.000000000 +0000
|
|
@@ -474,8 +474,11 @@
|
|
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));
|
|
}
|
|
}
|
|
|
|
diff -urN linux-mips/drivers/net/tulip/tulip_core.c new/drivers/net/tulip/tulip_core.c
|
|
--- linux-mips/drivers/net/tulip/tulip_core.c 2006-01-10 11:21:43.000000000 +0000
|
|
+++ new/drivers/net/tulip/tulip_core.c 2006-01-16 16:54:50.000000000 +0000
|
|
@@ -22,7 +22,7 @@
|
|
#else
|
|
#define DRV_VERSION "1.1.13"
|
|
#endif
|
|
-#define DRV_RELDATE "May 11, 2002"
|
|
+#define DRV_RELDATE "December 15, 2004"
|
|
|
|
|
|
#include <linux/module.h>
|
|
@@ -1505,8 +1505,8 @@
|
|
(PCI_SLOT(pdev->devfn) == 12))) {
|
|
/* Cobalt MAC address in first EEPROM locations. */
|
|
sa_offset = 0;
|
|
- /* Ensure our media table fixup get's applied */
|
|
- memcpy(ee_data + 16, ee_data, 8);
|
|
+ /* No media table either */
|
|
+ tp->flags &= ~HAS_MEDIA_TABLE;
|
|
}
|
|
#endif
|
|
#ifdef CONFIG_GSC
|