aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tulip/media.c
diff options
context:
space:
mode:
authorValerie Henson <val_henson@linux.intel.com>2007-03-12 05:31:29 -0400
committerJeff Garzik <jeff@garzik.org>2007-04-28 11:00:58 -0400
commitb3bff39a2b3574542f5007e19038393dfdd64c85 (patch)
tree4e4f8caf4a9be3c215972c8e50c7198f279c076b /drivers/net/tulip/media.c
parentc28896a4244e2fbe28c94e3a6048625f5c15cab4 (diff)
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>
Diffstat (limited to 'drivers/net/tulip/media.c')
-rw-r--r--drivers/net/tulip/media.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/drivers/net/tulip/media.c b/drivers/net/tulip/media.c
index 20bd52b86993..1594160a0f62 100644
--- a/drivers/net/tulip/media.c
+++ b/drivers/net/tulip/media.c
@@ -44,8 +44,10 @@ static const unsigned char comet_miireg2offset[32] = {
44 44
45/* MII transceiver control section. 45/* MII transceiver control section.
46 Read and write the MII registers using software-generated serial 46 Read and write the MII registers using software-generated serial
47 MDIO protocol. See the MII specifications or DP83840A data sheet 47 MDIO protocol.
48 for details. */ 48 See IEEE 802.3-2002.pdf (Section 2, Chapter "22.2.4 Management functions")
49 or DP83840A data sheet for more details.
50 */
49 51
50int tulip_mdio_read(struct net_device *dev, int phy_id, int location) 52int tulip_mdio_read(struct net_device *dev, int phy_id, int location)
51{ 53{
@@ -272,13 +274,29 @@ void tulip_select_media(struct net_device *dev, int startup)
272 int reset_length = p[2 + init_length]; 274 int reset_length = p[2 + init_length];
273 misc_info = (u16*)(reset_sequence + reset_length); 275 misc_info = (u16*)(reset_sequence + reset_length);
274 if (startup) { 276 if (startup) {
277 int timeout = 10; /* max 1 ms */
275 iowrite32(mtable->csr12dir | 0x100, ioaddr + CSR12); 278 iowrite32(mtable->csr12dir | 0x100, ioaddr + CSR12);
276 for (i = 0; i < reset_length; i++) 279 for (i = 0; i < reset_length; i++)
277 iowrite32(reset_sequence[i], ioaddr + CSR12); 280 iowrite32(reset_sequence[i], ioaddr + CSR12);
281
282 /* flush posted writes */
283 ioread32(ioaddr + CSR12);
284
285 /* Sect 3.10.3 in DP83840A.pdf (p39) */
286 udelay(500);
287
288 /* Section 4.2 in DP83840A.pdf (p43) */
289 /* and IEEE 802.3 "22.2.4.1.1 Reset" */
290 while (timeout-- &&
291 (tulip_mdio_read (dev, phy_num, MII_BMCR) & BMCR_RESET))
292 udelay(100);
278 } 293 }
279 for (i = 0; i < init_length; i++) 294 for (i = 0; i < init_length; i++)
280 iowrite32(init_sequence[i], ioaddr + CSR12); 295 iowrite32(init_sequence[i], ioaddr + CSR12);
296
297 ioread32(ioaddr + CSR12); /* flush posted writes */
281 } 298 }
299
282 tmp_info = get_u16(&misc_info[1]); 300 tmp_info = get_u16(&misc_info[1]);
283 if (tmp_info) 301 if (tmp_info)
284 tp->advertising[phy_num] = tmp_info | 1; 302 tp->advertising[phy_num] = tmp_info | 1;