aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tg3.c
diff options
context:
space:
mode:
authorMichael Chan <mchan@broadcom.com>2006-09-27 19:09:25 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2006-09-28 21:01:41 -0400
commit715116a12610b67c1d301a9b845ce95f7247dad3 (patch)
tree1f9b680e4cfc32cc7759b82481f104eae6e22f24 /drivers/net/tg3.c
parentb5d3772ccbe0bc5ac8ffbb5356b74ca698aee28c (diff)
[TG3]: Add 5709 PHY support.
Add support for the 5709 10/100 PHY. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/tg3.c')
-rw-r--r--drivers/net/tg3.c37
1 files changed, 33 insertions, 4 deletions
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 2b062d776511..23f5744bdffa 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -1035,6 +1035,24 @@ out:
1035 phy_reg | MII_TG3_EXT_CTRL_FIFO_ELASTIC); 1035 phy_reg | MII_TG3_EXT_CTRL_FIFO_ELASTIC);
1036 } 1036 }
1037 1037
1038 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906) {
1039 u32 phy_reg;
1040
1041 /* adjust output voltage */
1042 tg3_writephy(tp, MII_TG3_EPHY_PTEST, 0x12);
1043
1044 if (!tg3_readphy(tp, MII_TG3_EPHY_TEST, &phy_reg)) {
1045 u32 phy_reg2;
1046
1047 tg3_writephy(tp, MII_TG3_EPHY_TEST,
1048 phy_reg | MII_TG3_EPHY_SHADOW_EN);
1049 /* Enable auto-MDIX */
1050 if (!tg3_readphy(tp, 0x10, &phy_reg2))
1051 tg3_writephy(tp, 0x10, phy_reg2 | 0x4000);
1052 tg3_writephy(tp, MII_TG3_EPHY_TEST, phy_reg);
1053 }
1054 }
1055
1038 tg3_phy_set_wirespeed(tp); 1056 tg3_phy_set_wirespeed(tp);
1039 return 0; 1057 return 0;
1040} 1058}
@@ -1151,8 +1169,11 @@ static void tg3_power_down_phy(struct tg3 *tp)
1151 if (tp->tg3_flags2 & TG3_FLG2_PHY_SERDES) 1169 if (tp->tg3_flags2 & TG3_FLG2_PHY_SERDES)
1152 return; 1170 return;
1153 1171
1154 tg3_writephy(tp, MII_TG3_EXT_CTRL, MII_TG3_EXT_CTRL_FORCE_LED_OFF); 1172 if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5906) {
1155 tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x01b2); 1173 tg3_writephy(tp, MII_TG3_EXT_CTRL,
1174 MII_TG3_EXT_CTRL_FORCE_LED_OFF);
1175 tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x01b2);
1176 }
1156 1177
1157 /* The PHY should not be powered down on some chips because 1178 /* The PHY should not be powered down on some chips because
1158 * of bugs. 1179 * of bugs.
@@ -1505,6 +1526,13 @@ static void tg3_aux_stat_to_speed_duplex(struct tg3 *tp, u32 val, u16 *speed, u8
1505 break; 1526 break;
1506 1527
1507 default: 1528 default:
1529 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906) {
1530 *speed = (val & MII_TG3_AUX_STAT_100) ? SPEED_100 :
1531 SPEED_10;
1532 *duplex = (val & MII_TG3_AUX_STAT_FULL) ? DUPLEX_FULL :
1533 DUPLEX_HALF;
1534 break;
1535 }
1508 *speed = SPEED_INVALID; 1536 *speed = SPEED_INVALID;
1509 *duplex = DUPLEX_INVALID; 1537 *duplex = DUPLEX_INVALID;
1510 break; 1538 break;
@@ -1787,7 +1815,7 @@ static int tg3_setup_copper_phy(struct tg3 *tp, int force_reset)
1787 1815
1788 if (tp->tg3_flags & TG3_FLAG_USE_MI_INTERRUPT) 1816 if (tp->tg3_flags & TG3_FLAG_USE_MI_INTERRUPT)
1789 tg3_writephy(tp, MII_TG3_IMASK, ~MII_TG3_INT_LINKCHG); 1817 tg3_writephy(tp, MII_TG3_IMASK, ~MII_TG3_INT_LINKCHG);
1790 else 1818 else if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5906)
1791 tg3_writephy(tp, MII_TG3_IMASK, ~0); 1819 tg3_writephy(tp, MII_TG3_IMASK, ~0);
1792 1820
1793 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5700 || 1821 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5700 ||
@@ -6552,7 +6580,8 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
6552 if (err) 6580 if (err)
6553 return err; 6581 return err;
6554 6582
6555 if (!(tp->tg3_flags2 & TG3_FLG2_PHY_SERDES)) { 6583 if (!(tp->tg3_flags2 & TG3_FLG2_PHY_SERDES) &&
6584 GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5906) {
6556 u32 tmp; 6585 u32 tmp;
6557 6586
6558 /* Clear CRC stats. */ 6587 /* Clear CRC stats. */