diff options
author | Stephen Hemminger <shemminger@osdl.org> | 2006-02-22 14:44:58 -0500 |
---|---|---|
committer | Francois Romieu <romieu@fr.zoreil.com> | 2006-02-22 19:23:36 -0500 |
commit | 977bdf06ca8dd7ed081fab8d30249d9e6b1c24d3 (patch) | |
tree | dd12c7e2ad88e6dc33e70af401910d70941645d5 /drivers/net/sky2.c | |
parent | c45ec6566021ba3162233b575e7bc76d57b86688 (diff) |
[PATCH] sky2: yukon-ec-u chipset initialization
Add more complete setup code for Yukon EC_U chipset.
Based on matching code in 8.31 code in SysKonnect vendor driver.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Diffstat (limited to 'drivers/net/sky2.c')
-rw-r--r-- | drivers/net/sky2.c | 50 |
1 files changed, 41 insertions, 9 deletions
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index bfeba5b9cd7a..ce135b84a54c 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c | |||
@@ -232,7 +232,17 @@ static int sky2_set_power_state(struct sky2_hw *hw, pci_power_t state) | |||
232 | if (hw->ports > 1) | 232 | if (hw->ports > 1) |
233 | reg1 |= PCI_Y2_PHY2_COMA; | 233 | reg1 |= PCI_Y2_PHY2_COMA; |
234 | } | 234 | } |
235 | |||
236 | if (hw->chip_id == CHIP_ID_YUKON_EC_U) { | ||
237 | pci_write_config_dword(hw->pdev, PCI_DEV_REG3, 0); | ||
238 | pci_read_config_dword(hw->pdev, PCI_DEV_REG4, ®1); | ||
239 | reg1 &= P_ASPM_CONTROL_MSK; | ||
240 | pci_write_config_dword(hw->pdev, PCI_DEV_REG4, reg1); | ||
241 | pci_write_config_dword(hw->pdev, PCI_DEV_REG5, 0); | ||
242 | } | ||
243 | |||
235 | pci_write_config_dword(hw->pdev, PCI_DEV_REG1, reg1); | 244 | pci_write_config_dword(hw->pdev, PCI_DEV_REG1, reg1); |
245 | |||
236 | break; | 246 | break; |
237 | 247 | ||
238 | case PCI_D3hot: | 248 | case PCI_D3hot: |
@@ -463,16 +473,31 @@ static void sky2_phy_init(struct sky2_hw *hw, unsigned port) | |||
463 | ledover |= PHY_M_LED_MO_RX(MO_LED_OFF); | 473 | ledover |= PHY_M_LED_MO_RX(MO_LED_OFF); |
464 | } | 474 | } |
465 | 475 | ||
466 | gm_phy_write(hw, port, PHY_MARV_LED_CTRL, ledctrl); | 476 | if (hw->chip_id == CHIP_ID_YUKON_EC_U && hw->chip_rev >= 2) { |
477 | /* apply fixes in PHY AFE */ | ||
478 | gm_phy_write(hw, port, 22, 255); | ||
479 | /* increase differential signal amplitude in 10BASE-T */ | ||
480 | gm_phy_write(hw, port, 24, 0xaa99); | ||
481 | gm_phy_write(hw, port, 23, 0x2011); | ||
467 | 482 | ||
468 | if (sky2->autoneg == AUTONEG_DISABLE || sky2->speed == SPEED_100) { | 483 | /* fix for IEEE A/B Symmetry failure in 1000BASE-T */ |
469 | /* turn on 100 Mbps LED (LED_LINK100) */ | 484 | gm_phy_write(hw, port, 24, 0xa204); |
470 | ledover |= PHY_M_LED_MO_100(MO_LED_ON); | 485 | gm_phy_write(hw, port, 23, 0x2002); |
471 | } | ||
472 | 486 | ||
473 | if (ledover) | 487 | /* set page register to 0 */ |
474 | gm_phy_write(hw, port, PHY_MARV_LED_OVER, ledover); | 488 | gm_phy_write(hw, port, 22, 0); |
489 | } else { | ||
490 | gm_phy_write(hw, port, PHY_MARV_LED_CTRL, ledctrl); | ||
475 | 491 | ||
492 | if (sky2->autoneg == AUTONEG_DISABLE || sky2->speed == SPEED_100) { | ||
493 | /* turn on 100 Mbps LED (LED_LINK100) */ | ||
494 | ledover |= PHY_M_LED_MO_100(MO_LED_ON); | ||
495 | } | ||
496 | |||
497 | if (ledover) | ||
498 | gm_phy_write(hw, port, PHY_MARV_LED_OVER, ledover); | ||
499 | |||
500 | } | ||
476 | /* Enable phy interrupt on auto-negotiation complete (or link up) */ | 501 | /* Enable phy interrupt on auto-negotiation complete (or link up) */ |
477 | if (sky2->autoneg == AUTONEG_ENABLE) | 502 | if (sky2->autoneg == AUTONEG_ENABLE) |
478 | gm_phy_write(hw, port, PHY_MARV_INT_MASK, PHY_M_IS_AN_COMPL); | 503 | gm_phy_write(hw, port, PHY_MARV_INT_MASK, PHY_M_IS_AN_COMPL); |
@@ -953,6 +978,12 @@ static int sky2_rx_start(struct sky2_port *sky2) | |||
953 | 978 | ||
954 | sky2->rx_put = sky2->rx_next = 0; | 979 | sky2->rx_put = sky2->rx_next = 0; |
955 | sky2_qset(hw, rxq); | 980 | sky2_qset(hw, rxq); |
981 | |||
982 | if (hw->chip_id == CHIP_ID_YUKON_EC_U && hw->chip_rev >= 2) { | ||
983 | /* MAC Rx RAM Read is controlled by hardware */ | ||
984 | sky2_write32(hw, Q_ADDR(rxq, Q_F), F_M_RX_RAM_DIS); | ||
985 | } | ||
986 | |||
956 | sky2_prefetch_init(hw, rxq, sky2->rx_le_map, RX_LE_SIZE - 1); | 987 | sky2_prefetch_init(hw, rxq, sky2->rx_le_map, RX_LE_SIZE - 1); |
957 | 988 | ||
958 | rx_set_checksum(sky2); | 989 | rx_set_checksum(sky2); |
@@ -1035,9 +1066,10 @@ static int sky2_up(struct net_device *dev) | |||
1035 | RB_RST_SET); | 1066 | RB_RST_SET); |
1036 | 1067 | ||
1037 | sky2_qset(hw, txqaddr[port]); | 1068 | sky2_qset(hw, txqaddr[port]); |
1038 | if (hw->chip_id == CHIP_ID_YUKON_EC_U) | ||
1039 | sky2_write16(hw, Q_ADDR(txqaddr[port], Q_AL), 0x1a0); | ||
1040 | 1069 | ||
1070 | /* Set almost empty threshold */ | ||
1071 | if (hw->chip_id == CHIP_ID_YUKON_EC_U && hw->chip_rev == 1) | ||
1072 | sky2_write16(hw, Q_ADDR(txqaddr[port], Q_AL), 0x1a0); | ||
1041 | 1073 | ||
1042 | sky2_prefetch_init(hw, txqaddr[port], sky2->tx_le_map, | 1074 | sky2_prefetch_init(hw, txqaddr[port], sky2->tx_le_map, |
1043 | TX_RING_SIZE - 1); | 1075 | TX_RING_SIZE - 1); |