diff options
author | Michael Chan <mchan@broadcom.com> | 2006-03-22 04:06:52 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-03-22 04:06:52 -0500 |
commit | 15c3b696101992c4d69962325f0e91647164427f (patch) | |
tree | da26359a3cd8899f284cb320b9918b418e0784df | |
parent | caf636c760b33c72ebf018ff03c1b0d79ea6656a (diff) |
[TG3]: Skip phy power down on some devices
Some PHYs should not be powered down in tg3_set_power_state() because
of bugs or other hardware limitations.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/tg3.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index cb687fcaae1f..f1d9a07bb888 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
@@ -1148,6 +1148,19 @@ static int tg3_halt_cpu(struct tg3 *, u32); | |||
1148 | static int tg3_nvram_lock(struct tg3 *); | 1148 | static int tg3_nvram_lock(struct tg3 *); |
1149 | static void tg3_nvram_unlock(struct tg3 *); | 1149 | static void tg3_nvram_unlock(struct tg3 *); |
1150 | 1150 | ||
1151 | static void tg3_power_down_phy(struct tg3 *tp) | ||
1152 | { | ||
1153 | /* The PHY should not be powered down on some chips because | ||
1154 | * of bugs. | ||
1155 | */ | ||
1156 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5700 || | ||
1157 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704 || | ||
1158 | (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5780 && | ||
1159 | (tp->tg3_flags2 & TG3_FLG2_MII_SERDES))) | ||
1160 | return; | ||
1161 | tg3_writephy(tp, MII_BMCR, BMCR_PDOWN); | ||
1162 | } | ||
1163 | |||
1151 | static int tg3_set_power_state(struct tg3 *tp, pci_power_t state) | 1164 | static int tg3_set_power_state(struct tg3 *tp, pci_power_t state) |
1152 | { | 1165 | { |
1153 | u32 misc_host_ctrl; | 1166 | u32 misc_host_ctrl; |
@@ -1327,8 +1340,7 @@ static int tg3_set_power_state(struct tg3 *tp, pci_power_t state) | |||
1327 | tg3_writephy(tp, MII_TG3_EXT_CTRL, | 1340 | tg3_writephy(tp, MII_TG3_EXT_CTRL, |
1328 | MII_TG3_EXT_CTRL_FORCE_LED_OFF); | 1341 | MII_TG3_EXT_CTRL_FORCE_LED_OFF); |
1329 | tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x01b2); | 1342 | tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x01b2); |
1330 | if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5700) | 1343 | tg3_power_down_phy(tp); |
1331 | tg3_writephy(tp, MII_BMCR, BMCR_PDOWN); | ||
1332 | } | 1344 | } |
1333 | } | 1345 | } |
1334 | 1346 | ||