aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sky2.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/sky2.c')
-rw-r--r--drivers/net/sky2.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index cae2edf23004..bfeba5b9cd7a 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -520,10 +520,16 @@ static void sky2_mac_init(struct sky2_hw *hw, unsigned port)
520 520
521 switch (sky2->speed) { 521 switch (sky2->speed) {
522 case SPEED_1000: 522 case SPEED_1000:
523 reg &= ~GM_GPCR_SPEED_100;
523 reg |= GM_GPCR_SPEED_1000; 524 reg |= GM_GPCR_SPEED_1000;
524 /* fallthru */ 525 break;
525 case SPEED_100: 526 case SPEED_100:
527 reg &= ~GM_GPCR_SPEED_1000;
526 reg |= GM_GPCR_SPEED_100; 528 reg |= GM_GPCR_SPEED_100;
529 break;
530 case SPEED_10:
531 reg &= ~(GM_GPCR_SPEED_1000 | GM_GPCR_SPEED_100);
532 break;
527 } 533 }
528 534
529 if (sky2->duplex == DUPLEX_FULL) 535 if (sky2->duplex == DUPLEX_FULL)
@@ -1446,6 +1452,29 @@ static void sky2_link_up(struct sky2_port *sky2)
1446 sky2_write8(hw, SK_REG(port, GMAC_IRQ_MSK), GMAC_DEF_MSK); 1452 sky2_write8(hw, SK_REG(port, GMAC_IRQ_MSK), GMAC_DEF_MSK);
1447 1453
1448 reg = gma_read16(hw, port, GM_GP_CTRL); 1454 reg = gma_read16(hw, port, GM_GP_CTRL);
1455 if (sky2->autoneg == AUTONEG_DISABLE) {
1456 reg |= GM_GPCR_AU_ALL_DIS;
1457
1458 /* Is write/read necessary? Copied from sky2_mac_init */
1459 gma_write16(hw, port, GM_GP_CTRL, reg);
1460 gma_read16(hw, port, GM_GP_CTRL);
1461
1462 switch (sky2->speed) {
1463 case SPEED_1000:
1464 reg &= ~GM_GPCR_SPEED_100;
1465 reg |= GM_GPCR_SPEED_1000;
1466 break;
1467 case SPEED_100:
1468 reg &= ~GM_GPCR_SPEED_1000;
1469 reg |= GM_GPCR_SPEED_100;
1470 break;
1471 case SPEED_10:
1472 reg &= ~(GM_GPCR_SPEED_1000 | GM_GPCR_SPEED_100);
1473 break;
1474 }
1475 } else
1476 reg &= ~GM_GPCR_AU_ALL_DIS;
1477
1449 if (sky2->duplex == DUPLEX_FULL || sky2->autoneg == AUTONEG_ENABLE) 1478 if (sky2->duplex == DUPLEX_FULL || sky2->autoneg == AUTONEG_ENABLE)
1450 reg |= GM_GPCR_DUP_FULL; 1479 reg |= GM_GPCR_DUP_FULL;
1451 1480