source: patches/linux-2.6.18.1-tulip-1.patch@ ea28333c

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since ea28333c was 60d7c102, checked in by Jim Gifford <clfs@…>, 18 years ago

Updated Patches

  • Property mode set to 100644
File size: 4.7 KB
RevLine 
[8bb5996]1Submitted By: Jim Gifford (patches at jg555 dot com)
2Date: 2005-10-29
3Initial Package Version: 2.6.14
4Origin: Grant Gundler (parisc linux)
5Upstream Status: in -mm
6Description: Make the tulip drivers follow the chipset specs
7
8diff -Naur linux-2.6.14.orig/drivers/net/tulip/21142.c linux-2.6.14/drivers/net/tulip/21142.c
9--- linux-2.6.14.orig/drivers/net/tulip/21142.c 2005-10-28 00:02:08.000000000 +0000
10+++ linux-2.6.14/drivers/net/tulip/21142.c 2005-10-30 03:54:09.000000000 +0000
11@@ -172,7 +172,7 @@
12 int i;
13 for (i = 0; i < tp->mtable->leafcount; i++)
14 if (tp->mtable->mleaf[i].media == dev->if_port) {
15- int startup = ! ((tp->chip_id == DC21143 && (tp->revision == 48 || tp->revision == 65)));
16+ int startup = ! ((tp->chip_id == DC21143 && tp->revision == 65));
17 tp->cur_index = i;
18 tulip_select_media(dev, startup);
19 setup_done = 1;
20diff -Naur linux-2.6.14.orig/drivers/net/tulip/media.c linux-2.6.14/drivers/net/tulip/media.c
21--- linux-2.6.14.orig/drivers/net/tulip/media.c 2005-10-28 00:02:08.000000000 +0000
22+++ linux-2.6.14/drivers/net/tulip/media.c 2005-10-30 03:54:09.000000000 +0000
23@@ -44,8 +44,10 @@
24
25 /* MII transceiver control section.
26 Read and write the MII registers using software-generated serial
27- MDIO protocol. See the MII specifications or DP83840A data sheet
28- for details. */
29+ MDIO protocol.
30+ See IEEE 802.3-2002.pdf (Section 2, Chapter "22.2.4 Management functions")
31+ or DP83840A data sheet for more details.
32+ */
33
34 int tulip_mdio_read(struct net_device *dev, int phy_id, int location)
35 {
36@@ -261,24 +263,56 @@
37 u16 *reset_sequence = &((u16*)(p+3))[init_length];
38 int reset_length = p[2 + init_length*2];
39 misc_info = reset_sequence + reset_length;
40- if (startup)
41+ if (startup) {
42+ int timeout = 10; /* max 1 ms */
43 for (i = 0; i < reset_length; i++)
44 iowrite32(get_u16(&reset_sequence[i]) << 16, ioaddr + CSR15);
45+
46+ /* flush posted writes */
47+ ioread32(ioaddr + CSR15);
48+
49+ /* Sect 3.10.3 in DP83840A.pdf (p39) */
50+ udelay(500);
51+
52+ /* Section 4.2 in DP83840A.pdf (p43) */
53+ /* and IEEE 802.3 "22.2.4.1.1 Reset" */
54+ while (timeout-- &&
55+ (tulip_mdio_read (dev, phy_num, MII_BMCR) & BMCR_RESET))
56+ udelay(100);
57+ }
58 for (i = 0; i < init_length; i++)
59 iowrite32(get_u16(&init_sequence[i]) << 16, ioaddr + CSR15);
60+
61+ ioread32(ioaddr + CSR15); /* flush posted writes */
62 } else {
63 u8 *init_sequence = p + 2;
64 u8 *reset_sequence = p + 3 + init_length;
65 int reset_length = p[2 + init_length];
66 misc_info = (u16*)(reset_sequence + reset_length);
67 if (startup) {
68+ int timeout = 10; /* max 1 ms */
69 iowrite32(mtable->csr12dir | 0x100, ioaddr + CSR12);
70 for (i = 0; i < reset_length; i++)
71 iowrite32(reset_sequence[i], ioaddr + CSR12);
72+
73+ /* flush posted writes */
74+ ioread32(ioaddr + CSR12);
75+
76+ /* Sect 3.10.3 in DP83840A.pdf (p39) */
77+ udelay(500);
78+
79+ /* Section 4.2 in DP83840A.pdf (p43) */
80+ /* and IEEE 802.3 "22.2.4.1.1 Reset" */
81+ while (timeout-- &&
82+ (tulip_mdio_read (dev, phy_num, MII_BMCR) & BMCR_RESET))
83+ udelay(100);
84 }
85 for (i = 0; i < init_length; i++)
86 iowrite32(init_sequence[i], ioaddr + CSR12);
87+
88+ ioread32(ioaddr + CSR12); /* flush posted writes */
89 }
90+
91 tmp_info = get_u16(&misc_info[1]);
92 if (tmp_info)
93 tp->advertising[phy_num] = tmp_info | 1;
94diff -Naur linux-2.6.14.orig/drivers/net/tulip/tulip.h linux-2.6.14/drivers/net/tulip/tulip.h
95--- linux-2.6.14.orig/drivers/net/tulip/tulip.h 2005-10-28 00:02:08.000000000 +0000
96+++ linux-2.6.14/drivers/net/tulip/tulip.h 2005-10-30 03:54:09.000000000 +0000
97@@ -474,8 +474,11 @@
98 udelay(10);
99
100 if (!i)
101- printk(KERN_DEBUG "%s: tulip_stop_rxtx() failed\n",
102- pci_name(tp->pdev));
103+ printk(KERN_DEBUG "%s: tulip_stop_rxtx() failed"
104+ " (CSR5 0x%x CSR6 0x%x)\n",
105+ pci_name(tp->pdev),
106+ ioread32(ioaddr + CSR5),
107+ ioread32(ioaddr + CSR6));
108 }
109 }
110
111diff -Naur linux-2.6.14.orig/drivers/net/tulip/tulip_core.c linux-2.6.14/drivers/net/tulip/tulip_core.c
112--- linux-2.6.14.orig/drivers/net/tulip/tulip_core.c 2005-10-28 00:02:08.000000000 +0000
113+++ linux-2.6.14/drivers/net/tulip/tulip_core.c 2005-10-30 03:54:09.000000000 +0000
114@@ -22,7 +22,7 @@
115 #else
116 #define DRV_VERSION "1.1.13"
117 #endif
118-#define DRV_RELDATE "May 11, 2002"
119+#define DRV_RELDATE "December 15, 2004"
120
121
122 #include <linux/module.h>
123@@ -148,7 +148,7 @@
124 HAS_MII | HAS_MEDIA_TABLE | CSR12_IN_SROM | HAS_PCI_MWI, tulip_timer },
125
126 /* DC21142, DC21143 */
127- { "Digital DS21143 Tulip", 128, 0x0801fbff,
128+ { "Digital DS21142/DS21143 Tulip", 128, 0x0801fbff,
129 HAS_MII | HAS_MEDIA_TABLE | ALWAYS_CHECK_MII | HAS_ACPI | HAS_NWAY
130 | HAS_INTR_MITIGATION | HAS_PCI_MWI, t21142_timer },
131
Note: See TracBrowser for help on using the repository browser.