diff options
Diffstat (limited to 'drivers/net/tulip/media.c')
-rw-r--r-- | drivers/net/tulip/media.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/drivers/net/tulip/media.c b/drivers/net/tulip/media.c index 1594160a0f62..b56256636543 100644 --- a/drivers/net/tulip/media.c +++ b/drivers/net/tulip/media.c | |||
@@ -263,11 +263,27 @@ void tulip_select_media(struct net_device *dev, int startup) | |||
263 | u16 *reset_sequence = &((u16*)(p+3))[init_length]; | 263 | u16 *reset_sequence = &((u16*)(p+3))[init_length]; |
264 | int reset_length = p[2 + init_length*2]; | 264 | int reset_length = p[2 + init_length*2]; |
265 | misc_info = reset_sequence + reset_length; | 265 | misc_info = reset_sequence + reset_length; |
266 | if (startup) | 266 | if (startup) { |
267 | int timeout = 10; /* max 1 ms */ | ||
267 | for (i = 0; i < reset_length; i++) | 268 | for (i = 0; i < reset_length; i++) |
268 | iowrite32(get_u16(&reset_sequence[i]) << 16, ioaddr + CSR15); | 269 | iowrite32(get_u16(&reset_sequence[i]) << 16, ioaddr + CSR15); |
270 | |||
271 | /* flush posted writes */ | ||
272 | ioread32(ioaddr + CSR15); | ||
273 | |||
274 | /* Sect 3.10.3 in DP83840A.pdf (p39) */ | ||
275 | udelay(500); | ||
276 | |||
277 | /* Section 4.2 in DP83840A.pdf (p43) */ | ||
278 | /* and IEEE 802.3 "22.2.4.1.1 Reset" */ | ||
279 | while (timeout-- && | ||
280 | (tulip_mdio_read (dev, phy_num, MII_BMCR) & BMCR_RESET)) | ||
281 | udelay(100); | ||
282 | } | ||
269 | for (i = 0; i < init_length; i++) | 283 | for (i = 0; i < init_length; i++) |
270 | iowrite32(get_u16(&init_sequence[i]) << 16, ioaddr + CSR15); | 284 | iowrite32(get_u16(&init_sequence[i]) << 16, ioaddr + CSR15); |
285 | |||
286 | ioread32(ioaddr + CSR15); /* flush posted writes */ | ||
271 | } else { | 287 | } else { |
272 | u8 *init_sequence = p + 2; | 288 | u8 *init_sequence = p + 2; |
273 | u8 *reset_sequence = p + 3 + init_length; | 289 | u8 *reset_sequence = p + 3 + init_length; |