diff options
Diffstat (limited to 'drivers/net/ixgb/ixgb_hw.c')
-rw-r--r-- | drivers/net/ixgb/ixgb_hw.c | 82 |
1 files changed, 80 insertions, 2 deletions
diff --git a/drivers/net/ixgb/ixgb_hw.c b/drivers/net/ixgb/ixgb_hw.c index 2c6367ace3cd..80a8b9888225 100644 --- a/drivers/net/ixgb/ixgb_hw.c +++ b/drivers/net/ixgb/ixgb_hw.c | |||
@@ -45,6 +45,8 @@ static boolean_t ixgb_link_reset(struct ixgb_hw *hw); | |||
45 | 45 | ||
46 | static void ixgb_optics_reset(struct ixgb_hw *hw); | 46 | static void ixgb_optics_reset(struct ixgb_hw *hw); |
47 | 47 | ||
48 | static void ixgb_optics_reset_bcm(struct ixgb_hw *hw); | ||
49 | |||
48 | static ixgb_phy_type ixgb_identify_phy(struct ixgb_hw *hw); | 50 | static ixgb_phy_type ixgb_identify_phy(struct ixgb_hw *hw); |
49 | 51 | ||
50 | static void ixgb_clear_hw_cntrs(struct ixgb_hw *hw); | 52 | static void ixgb_clear_hw_cntrs(struct ixgb_hw *hw); |
@@ -90,10 +92,20 @@ static uint32_t ixgb_mac_reset(struct ixgb_hw *hw) | |||
90 | ASSERT(!(ctrl_reg & IXGB_CTRL0_RST)); | 92 | ASSERT(!(ctrl_reg & IXGB_CTRL0_RST)); |
91 | #endif | 93 | #endif |
92 | 94 | ||
93 | if (hw->phy_type == ixgb_phy_type_txn17401) { | 95 | if (hw->subsystem_vendor_id == SUN_SUBVENDOR_ID) { |
94 | ixgb_optics_reset(hw); | 96 | ctrl_reg = /* Enable interrupt from XFP and SerDes */ |
97 | IXGB_CTRL1_GPI0_EN | | ||
98 | IXGB_CTRL1_SDP6_DIR | | ||
99 | IXGB_CTRL1_SDP7_DIR | | ||
100 | IXGB_CTRL1_SDP6 | | ||
101 | IXGB_CTRL1_SDP7; | ||
102 | IXGB_WRITE_REG(hw, CTRL1, ctrl_reg); | ||
103 | ixgb_optics_reset_bcm(hw); | ||
95 | } | 104 | } |
96 | 105 | ||
106 | if (hw->phy_type == ixgb_phy_type_txn17401) | ||
107 | ixgb_optics_reset(hw); | ||
108 | |||
97 | return ctrl_reg; | 109 | return ctrl_reg; |
98 | } | 110 | } |
99 | 111 | ||
@@ -253,6 +265,10 @@ ixgb_identify_phy(struct ixgb_hw *hw) | |||
253 | break; | 265 | break; |
254 | } | 266 | } |
255 | 267 | ||
268 | /* update phy type for sun specific board */ | ||
269 | if (hw->subsystem_vendor_id == SUN_SUBVENDOR_ID) | ||
270 | phy_type = ixgb_phy_type_bcm; | ||
271 | |||
256 | return (phy_type); | 272 | return (phy_type); |
257 | } | 273 | } |
258 | 274 | ||
@@ -1225,3 +1241,65 @@ ixgb_optics_reset(struct ixgb_hw *hw) | |||
1225 | 1241 | ||
1226 | return; | 1242 | return; |
1227 | } | 1243 | } |
1244 | |||
1245 | /****************************************************************************** | ||
1246 | * Resets the 10GbE optics module for Sun variant NIC. | ||
1247 | * | ||
1248 | * hw - Struct containing variables accessed by shared code | ||
1249 | *****************************************************************************/ | ||
1250 | |||
1251 | #define IXGB_BCM8704_USER_PMD_TX_CTRL_REG 0xC803 | ||
1252 | #define IXGB_BCM8704_USER_PMD_TX_CTRL_REG_VAL 0x0164 | ||
1253 | #define IXGB_BCM8704_USER_CTRL_REG 0xC800 | ||
1254 | #define IXGB_BCM8704_USER_CTRL_REG_VAL 0x7FBF | ||
1255 | #define IXGB_BCM8704_USER_DEV3_ADDR 0x0003 | ||
1256 | #define IXGB_SUN_PHY_ADDRESS 0x0000 | ||
1257 | #define IXGB_SUN_PHY_RESET_DELAY 305 | ||
1258 | |||
1259 | static void | ||
1260 | ixgb_optics_reset_bcm(struct ixgb_hw *hw) | ||
1261 | { | ||
1262 | u32 ctrl = IXGB_READ_REG(hw, CTRL0); | ||
1263 | ctrl &= ~IXGB_CTRL0_SDP2; | ||
1264 | ctrl |= IXGB_CTRL0_SDP3; | ||
1265 | IXGB_WRITE_REG(hw, CTRL0, ctrl); | ||
1266 | |||
1267 | /* SerDes needs extra delay */ | ||
1268 | msleep(IXGB_SUN_PHY_RESET_DELAY); | ||
1269 | |||
1270 | /* Broadcom 7408L configuration */ | ||
1271 | /* Reference clock config */ | ||
1272 | ixgb_write_phy_reg(hw, | ||
1273 | IXGB_BCM8704_USER_PMD_TX_CTRL_REG, | ||
1274 | IXGB_SUN_PHY_ADDRESS, | ||
1275 | IXGB_BCM8704_USER_DEV3_ADDR, | ||
1276 | IXGB_BCM8704_USER_PMD_TX_CTRL_REG_VAL); | ||
1277 | /* we must read the registers twice */ | ||
1278 | ixgb_read_phy_reg(hw, | ||
1279 | IXGB_BCM8704_USER_PMD_TX_CTRL_REG, | ||
1280 | IXGB_SUN_PHY_ADDRESS, | ||
1281 | IXGB_BCM8704_USER_DEV3_ADDR); | ||
1282 | ixgb_read_phy_reg(hw, | ||
1283 | IXGB_BCM8704_USER_PMD_TX_CTRL_REG, | ||
1284 | IXGB_SUN_PHY_ADDRESS, | ||
1285 | IXGB_BCM8704_USER_DEV3_ADDR); | ||
1286 | |||
1287 | ixgb_write_phy_reg(hw, | ||
1288 | IXGB_BCM8704_USER_CTRL_REG, | ||
1289 | IXGB_SUN_PHY_ADDRESS, | ||
1290 | IXGB_BCM8704_USER_DEV3_ADDR, | ||
1291 | IXGB_BCM8704_USER_CTRL_REG_VAL); | ||
1292 | ixgb_read_phy_reg(hw, | ||
1293 | IXGB_BCM8704_USER_CTRL_REG, | ||
1294 | IXGB_SUN_PHY_ADDRESS, | ||
1295 | IXGB_BCM8704_USER_DEV3_ADDR); | ||
1296 | ixgb_read_phy_reg(hw, | ||
1297 | IXGB_BCM8704_USER_CTRL_REG, | ||
1298 | IXGB_SUN_PHY_ADDRESS, | ||
1299 | IXGB_BCM8704_USER_DEV3_ADDR); | ||
1300 | |||
1301 | /* SerDes needs extra delay */ | ||
1302 | msleep(IXGB_SUN_PHY_RESET_DELAY); | ||
1303 | |||
1304 | return; | ||
1305 | } | ||