1 /*******************************************************************************
3 Copyright (c) 2001-2012, Intel Corporation
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions are met:
9 1. Redistributions of source code must retain the above copyright notice,
10 this list of conditions and the following disclaimer.
12 2. Redistributions in binary form must reproduce the above copyright
13 notice, this list of conditions and the following disclaimer in the
14 documentation and/or other materials provided with the distribution.
16 3. Neither the name of the Intel Corporation nor the names of its
17 contributors may be used to endorse or promote products derived from
18 this software without specific prior written permission.
20 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
24 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 POSSIBILITY OF SUCH DAMAGE.
32 ***************************************************************************/
34 #include "ixgbe_api.h"
35 #include "ixgbe_common.h"
36 #include "ixgbe_phy.h"
37 #ident "$Id: ixgbe_phy.c,v 1.139 2012/05/24 23:36:12 jtkirshe Exp $"
39 STATIC void ixgbe_i2c_start(struct ixgbe_hw *hw);
40 STATIC void ixgbe_i2c_stop(struct ixgbe_hw *hw);
41 STATIC s32 ixgbe_clock_in_i2c_byte(struct ixgbe_hw *hw, u8 *data);
42 STATIC s32 ixgbe_clock_out_i2c_byte(struct ixgbe_hw *hw, u8 data);
43 STATIC s32 ixgbe_get_i2c_ack(struct ixgbe_hw *hw);
44 STATIC s32 ixgbe_clock_in_i2c_bit(struct ixgbe_hw *hw, bool *data);
45 STATIC s32 ixgbe_clock_out_i2c_bit(struct ixgbe_hw *hw, bool data);
46 STATIC void ixgbe_raise_i2c_clk(struct ixgbe_hw *hw, u32 *i2cctl);
47 STATIC void ixgbe_lower_i2c_clk(struct ixgbe_hw *hw, u32 *i2cctl);
48 STATIC s32 ixgbe_set_i2c_data(struct ixgbe_hw *hw, u32 *i2cctl, bool data);
49 STATIC bool ixgbe_get_i2c_data(u32 *i2cctl);
52 * ixgbe_init_phy_ops_generic - Inits PHY function ptrs
53 * @hw: pointer to the hardware structure
55 * Initialize the function pointers.
57 s32 ixgbe_init_phy_ops_generic(struct ixgbe_hw *hw)
59 struct ixgbe_phy_info *phy = &hw->phy;
61 DEBUGFUNC("ixgbe_init_phy_ops_generic");
64 phy->ops.identify = &ixgbe_identify_phy_generic;
65 phy->ops.reset = &ixgbe_reset_phy_generic;
66 phy->ops.read_reg = &ixgbe_read_phy_reg_generic;
67 phy->ops.write_reg = &ixgbe_write_phy_reg_generic;
68 phy->ops.read_reg_mdi = &ixgbe_read_phy_reg_mdi;
69 phy->ops.write_reg_mdi = &ixgbe_write_phy_reg_mdi;
70 phy->ops.setup_link = &ixgbe_setup_phy_link_generic;
71 phy->ops.setup_link_speed = &ixgbe_setup_phy_link_speed_generic;
72 phy->ops.check_link = NULL;
73 phy->ops.get_firmware_version = ixgbe_get_phy_firmware_version_generic;
74 phy->ops.read_i2c_byte = &ixgbe_read_i2c_byte_generic;
75 phy->ops.write_i2c_byte = &ixgbe_write_i2c_byte_generic;
76 phy->ops.read_i2c_eeprom = &ixgbe_read_i2c_eeprom_generic;
77 phy->ops.write_i2c_eeprom = &ixgbe_write_i2c_eeprom_generic;
78 phy->ops.i2c_bus_clear = &ixgbe_i2c_bus_clear;
79 phy->ops.identify_sfp = &ixgbe_identify_module_generic;
80 phy->sfp_type = ixgbe_sfp_type_unknown;
81 phy->ops.check_overtemp = &ixgbe_tn_check_overtemp;
86 * ixgbe_identify_phy_generic - Get physical layer module
87 * @hw: pointer to hardware structure
89 * Determines the physical layer module found on the current adapter.
91 s32 ixgbe_identify_phy_generic(struct ixgbe_hw *hw)
93 s32 status = IXGBE_ERR_PHY_ADDR_INVALID;
97 DEBUGFUNC("ixgbe_identify_phy_generic");
99 if (hw->phy.type == ixgbe_phy_unknown) {
100 for (phy_addr = 0; phy_addr < IXGBE_MAX_PHY_ADDR; phy_addr++) {
101 if (ixgbe_validate_phy_addr(hw, phy_addr)) {
102 hw->phy.addr = phy_addr;
103 ixgbe_get_phy_id(hw);
105 ixgbe_get_phy_type_from_id(hw->phy.id);
107 if (hw->phy.type == ixgbe_phy_unknown) {
108 hw->phy.ops.read_reg(hw,
109 IXGBE_MDIO_PHY_EXT_ABILITY,
110 IXGBE_MDIO_PMA_PMD_DEV_TYPE,
113 (IXGBE_MDIO_PHY_10GBASET_ABILITY |
114 IXGBE_MDIO_PHY_1000BASET_ABILITY))
116 ixgbe_phy_cu_unknown;
122 status = IXGBE_SUCCESS;
127 /* Certain media types do not have a phy so an address will not
128 * be found and the code will take this path. Caller has to
129 * decide if it is an error or not.
131 if (status != IXGBE_SUCCESS) {
135 status = IXGBE_SUCCESS;
142 * ixgbe_check_reset_blocked - check status of MNG FW veto bit
143 * @hw: pointer to the hardware structure
145 * This function checks the MMNGC.MNG_VETO bit to see if there are
146 * any constraints on link from manageability. For MAC's that don't
147 * have this bit just return faluse since the link can not be blocked
150 s32 ixgbe_check_reset_blocked(struct ixgbe_hw *hw)
154 DEBUGFUNC("ixgbe_check_reset_blocked");
156 /* If we don't have this bit, it can't be blocking */
157 if (hw->mac.type == ixgbe_mac_82598EB)
160 mmngc = IXGBE_READ_REG(hw, IXGBE_MMNGC);
161 if (mmngc & IXGBE_MMNGC_MNG_VETO) {
162 ERROR_REPORT1(IXGBE_ERROR_SOFTWARE,
163 "MNG_VETO bit detected.\n");
171 * ixgbe_validate_phy_addr - Determines phy address is valid
172 * @hw: pointer to hardware structure
175 bool ixgbe_validate_phy_addr(struct ixgbe_hw *hw, u32 phy_addr)
180 DEBUGFUNC("ixgbe_validate_phy_addr");
182 hw->phy.addr = phy_addr;
183 hw->phy.ops.read_reg(hw, IXGBE_MDIO_PHY_ID_HIGH,
184 IXGBE_MDIO_PMA_PMD_DEV_TYPE, &phy_id);
186 if (phy_id != 0xFFFF && phy_id != 0x0)
193 * ixgbe_get_phy_id - Get the phy type
194 * @hw: pointer to hardware structure
197 s32 ixgbe_get_phy_id(struct ixgbe_hw *hw)
203 DEBUGFUNC("ixgbe_get_phy_id");
205 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_PHY_ID_HIGH,
206 IXGBE_MDIO_PMA_PMD_DEV_TYPE,
209 if (status == IXGBE_SUCCESS) {
210 hw->phy.id = (u32)(phy_id_high << 16);
211 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_PHY_ID_LOW,
212 IXGBE_MDIO_PMA_PMD_DEV_TYPE,
214 hw->phy.id |= (u32)(phy_id_low & IXGBE_PHY_REVISION_MASK);
215 hw->phy.revision = (u32)(phy_id_low & ~IXGBE_PHY_REVISION_MASK);
221 * ixgbe_get_phy_type_from_id - Get the phy type
222 * @hw: pointer to hardware structure
225 enum ixgbe_phy_type ixgbe_get_phy_type_from_id(u32 phy_id)
227 enum ixgbe_phy_type phy_type;
229 DEBUGFUNC("ixgbe_get_phy_type_from_id");
233 phy_type = ixgbe_phy_tn;
236 phy_type = ixgbe_phy_aq;
239 phy_type = ixgbe_phy_qt;
242 phy_type = ixgbe_phy_nl;
245 phy_type = ixgbe_phy_unknown;
249 DEBUGOUT1("phy type found is %d\n", phy_type);
254 * ixgbe_reset_phy_generic - Performs a PHY reset
255 * @hw: pointer to hardware structure
257 s32 ixgbe_reset_phy_generic(struct ixgbe_hw *hw)
261 s32 status = IXGBE_SUCCESS;
263 DEBUGFUNC("ixgbe_reset_phy_generic");
265 if (hw->phy.type == ixgbe_phy_unknown)
266 status = ixgbe_identify_phy_generic(hw);
268 if (status != IXGBE_SUCCESS || hw->phy.type == ixgbe_phy_none)
271 /* Don't reset PHY if it's shut down due to overtemp. */
272 if (!hw->phy.reset_if_overtemp &&
273 (IXGBE_ERR_OVERTEMP == hw->phy.ops.check_overtemp(hw)))
276 /* Blocked by MNG FW so bail */
277 if (ixgbe_check_reset_blocked(hw))
281 * Perform soft PHY reset to the PHY_XS.
282 * This will cause a soft reset to the PHY
284 hw->phy.ops.write_reg(hw, IXGBE_MDIO_PHY_XS_CONTROL,
285 IXGBE_MDIO_PHY_XS_DEV_TYPE,
286 IXGBE_MDIO_PHY_XS_RESET);
289 * Poll for reset bit to self-clear indicating reset is complete.
290 * Some PHYs could take up to 3 seconds to complete and need about
291 * 1.7 usec delay after the reset is complete.
293 for (i = 0; i < 30; i++) {
295 hw->phy.ops.read_reg(hw, IXGBE_MDIO_PHY_XS_CONTROL,
296 IXGBE_MDIO_PHY_XS_DEV_TYPE, &ctrl);
297 if (!(ctrl & IXGBE_MDIO_PHY_XS_RESET)) {
303 if (ctrl & IXGBE_MDIO_PHY_XS_RESET) {
304 status = IXGBE_ERR_RESET_FAILED;
305 ERROR_REPORT1(IXGBE_ERROR_POLLING,
306 "PHY reset polling failed to complete.\n");
314 * ixgbe_read_phy_mdi - Reads a value from a specified PHY register without
316 * @hw: pointer to hardware structure
317 * @reg_addr: 32 bit address of PHY register to read
318 * @phy_data: Pointer to read data from PHY register
320 s32 ixgbe_read_phy_reg_mdi(struct ixgbe_hw *hw, u32 reg_addr, u32 device_type,
323 u32 i, data, command;
325 /* Setup and write the address cycle command */
326 command = ((reg_addr << IXGBE_MSCA_NP_ADDR_SHIFT) |
327 (device_type << IXGBE_MSCA_DEV_TYPE_SHIFT) |
328 (hw->phy.addr << IXGBE_MSCA_PHY_ADDR_SHIFT) |
329 (IXGBE_MSCA_ADDR_CYCLE | IXGBE_MSCA_MDI_COMMAND));
331 IXGBE_WRITE_REG(hw, IXGBE_MSCA, command);
334 * Check every 10 usec to see if the address cycle completed.
335 * The MDI Command bit will clear when the operation is
338 for (i = 0; i < IXGBE_MDIO_COMMAND_TIMEOUT; i++) {
341 command = IXGBE_READ_REG(hw, IXGBE_MSCA);
342 if ((command & IXGBE_MSCA_MDI_COMMAND) == 0)
347 if ((command & IXGBE_MSCA_MDI_COMMAND) != 0) {
348 ERROR_REPORT1(IXGBE_ERROR_POLLING, "PHY address command did not complete.\n");
349 return IXGBE_ERR_PHY;
353 * Address cycle complete, setup and write the read
356 command = ((reg_addr << IXGBE_MSCA_NP_ADDR_SHIFT) |
357 (device_type << IXGBE_MSCA_DEV_TYPE_SHIFT) |
358 (hw->phy.addr << IXGBE_MSCA_PHY_ADDR_SHIFT) |
359 (IXGBE_MSCA_READ | IXGBE_MSCA_MDI_COMMAND));
361 IXGBE_WRITE_REG(hw, IXGBE_MSCA, command);
364 * Check every 10 usec to see if the address cycle
365 * completed. The MDI Command bit will clear when the
366 * operation is complete
368 for (i = 0; i < IXGBE_MDIO_COMMAND_TIMEOUT; i++) {
371 command = IXGBE_READ_REG(hw, IXGBE_MSCA);
372 if ((command & IXGBE_MSCA_MDI_COMMAND) == 0)
376 if ((command & IXGBE_MSCA_MDI_COMMAND) != 0) {
377 ERROR_REPORT1(IXGBE_ERROR_POLLING, "PHY read command didn't complete\n");
378 return IXGBE_ERR_PHY;
382 * Read operation is complete. Get the data
385 data = IXGBE_READ_REG(hw, IXGBE_MSRWD);
386 data >>= IXGBE_MSRWD_READ_DATA_SHIFT;
387 *phy_data = (u16)(data);
389 return IXGBE_SUCCESS;
393 * ixgbe_read_phy_reg_generic - Reads a value from a specified PHY register
394 * using the SWFW lock - this function is needed in most cases
395 * @hw: pointer to hardware structure
396 * @reg_addr: 32 bit address of PHY register to read
397 * @phy_data: Pointer to read data from PHY register
399 s32 ixgbe_read_phy_reg_generic(struct ixgbe_hw *hw, u32 reg_addr,
400 u32 device_type, u16 *phy_data)
405 DEBUGFUNC("ixgbe_read_phy_reg_generic");
407 if (IXGBE_READ_REG(hw, IXGBE_STATUS) & IXGBE_STATUS_LAN_ID_1)
408 gssr = IXGBE_GSSR_PHY1_SM;
410 gssr = IXGBE_GSSR_PHY0_SM;
412 if (hw->mac.ops.acquire_swfw_sync(hw, gssr) == IXGBE_SUCCESS) {
413 status = ixgbe_read_phy_reg_mdi(hw, reg_addr, device_type,
415 hw->mac.ops.release_swfw_sync(hw, gssr);
417 status = IXGBE_ERR_SWFW_SYNC;
424 * ixgbe_write_phy_reg_mdi - Writes a value to specified PHY register
426 * @hw: pointer to hardware structure
427 * @reg_addr: 32 bit PHY register to write
428 * @device_type: 5 bit device type
429 * @phy_data: Data to write to the PHY register
431 s32 ixgbe_write_phy_reg_mdi(struct ixgbe_hw *hw, u32 reg_addr,
432 u32 device_type, u16 phy_data)
436 /* Put the data in the MDI single read and write data register*/
437 IXGBE_WRITE_REG(hw, IXGBE_MSRWD, (u32)phy_data);
439 /* Setup and write the address cycle command */
440 command = ((reg_addr << IXGBE_MSCA_NP_ADDR_SHIFT) |
441 (device_type << IXGBE_MSCA_DEV_TYPE_SHIFT) |
442 (hw->phy.addr << IXGBE_MSCA_PHY_ADDR_SHIFT) |
443 (IXGBE_MSCA_ADDR_CYCLE | IXGBE_MSCA_MDI_COMMAND));
445 IXGBE_WRITE_REG(hw, IXGBE_MSCA, command);
448 * Check every 10 usec to see if the address cycle completed.
449 * The MDI Command bit will clear when the operation is
452 for (i = 0; i < IXGBE_MDIO_COMMAND_TIMEOUT; i++) {
455 command = IXGBE_READ_REG(hw, IXGBE_MSCA);
456 if ((command & IXGBE_MSCA_MDI_COMMAND) == 0)
460 if ((command & IXGBE_MSCA_MDI_COMMAND) != 0) {
461 ERROR_REPORT1(IXGBE_ERROR_POLLING, "PHY address cmd didn't complete\n");
462 return IXGBE_ERR_PHY;
466 * Address cycle complete, setup and write the write
469 command = ((reg_addr << IXGBE_MSCA_NP_ADDR_SHIFT) |
470 (device_type << IXGBE_MSCA_DEV_TYPE_SHIFT) |
471 (hw->phy.addr << IXGBE_MSCA_PHY_ADDR_SHIFT) |
472 (IXGBE_MSCA_WRITE | IXGBE_MSCA_MDI_COMMAND));
474 IXGBE_WRITE_REG(hw, IXGBE_MSCA, command);
477 * Check every 10 usec to see if the address cycle
478 * completed. The MDI Command bit will clear when the
479 * operation is complete
481 for (i = 0; i < IXGBE_MDIO_COMMAND_TIMEOUT; i++) {
484 command = IXGBE_READ_REG(hw, IXGBE_MSCA);
485 if ((command & IXGBE_MSCA_MDI_COMMAND) == 0)
489 if ((command & IXGBE_MSCA_MDI_COMMAND) != 0) {
490 ERROR_REPORT1(IXGBE_ERROR_POLLING, "PHY write cmd didn't complete\n");
491 return IXGBE_ERR_PHY;
494 return IXGBE_SUCCESS;
498 * ixgbe_write_phy_reg_generic - Writes a value to specified PHY register
499 * using SWFW lock- this function is needed in most cases
500 * @hw: pointer to hardware structure
501 * @reg_addr: 32 bit PHY register to write
502 * @device_type: 5 bit device type
503 * @phy_data: Data to write to the PHY register
505 s32 ixgbe_write_phy_reg_generic(struct ixgbe_hw *hw, u32 reg_addr,
506 u32 device_type, u16 phy_data)
511 DEBUGFUNC("ixgbe_write_phy_reg_generic");
513 if (IXGBE_READ_REG(hw, IXGBE_STATUS) & IXGBE_STATUS_LAN_ID_1)
514 gssr = IXGBE_GSSR_PHY1_SM;
516 gssr = IXGBE_GSSR_PHY0_SM;
518 if (hw->mac.ops.acquire_swfw_sync(hw, gssr) == IXGBE_SUCCESS) {
519 status = ixgbe_write_phy_reg_mdi(hw, reg_addr, device_type,
521 hw->mac.ops.release_swfw_sync(hw, gssr);
523 status = IXGBE_ERR_SWFW_SYNC;
530 * ixgbe_setup_phy_link_generic - Set and restart autoneg
531 * @hw: pointer to hardware structure
533 * Restart autonegotiation and PHY and waits for completion.
535 s32 ixgbe_setup_phy_link_generic(struct ixgbe_hw *hw)
537 s32 status = IXGBE_SUCCESS;
539 u32 max_time_out = 10;
540 u16 autoneg_reg = IXGBE_MII_AUTONEG_REG;
541 bool autoneg = false;
542 ixgbe_link_speed speed;
544 DEBUGFUNC("ixgbe_setup_phy_link_generic");
546 ixgbe_get_copper_link_capabilities_generic(hw, &speed, &autoneg);
548 if (speed & IXGBE_LINK_SPEED_10GB_FULL) {
549 /* Set or unset auto-negotiation 10G advertisement */
550 hw->phy.ops.read_reg(hw, IXGBE_MII_10GBASE_T_AUTONEG_CTRL_REG,
551 IXGBE_MDIO_AUTO_NEG_DEV_TYPE,
554 autoneg_reg &= ~IXGBE_MII_10GBASE_T_ADVERTISE;
555 if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_10GB_FULL)
556 autoneg_reg |= IXGBE_MII_10GBASE_T_ADVERTISE;
558 hw->phy.ops.write_reg(hw, IXGBE_MII_10GBASE_T_AUTONEG_CTRL_REG,
559 IXGBE_MDIO_AUTO_NEG_DEV_TYPE,
563 if (speed & IXGBE_LINK_SPEED_1GB_FULL) {
564 /* Set or unset auto-negotiation 1G advertisement */
565 hw->phy.ops.read_reg(hw,
566 IXGBE_MII_AUTONEG_VENDOR_PROVISION_1_REG,
567 IXGBE_MDIO_AUTO_NEG_DEV_TYPE,
570 autoneg_reg &= ~IXGBE_MII_1GBASE_T_ADVERTISE;
571 if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_1GB_FULL)
572 autoneg_reg |= IXGBE_MII_1GBASE_T_ADVERTISE;
574 hw->phy.ops.write_reg(hw,
575 IXGBE_MII_AUTONEG_VENDOR_PROVISION_1_REG,
576 IXGBE_MDIO_AUTO_NEG_DEV_TYPE,
580 if (speed & IXGBE_LINK_SPEED_100_FULL) {
581 /* Set or unset auto-negotiation 100M advertisement */
582 hw->phy.ops.read_reg(hw, IXGBE_MII_AUTONEG_ADVERTISE_REG,
583 IXGBE_MDIO_AUTO_NEG_DEV_TYPE,
586 autoneg_reg &= ~(IXGBE_MII_100BASE_T_ADVERTISE |
587 IXGBE_MII_100BASE_T_ADVERTISE_HALF);
588 if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_100_FULL)
589 autoneg_reg |= IXGBE_MII_100BASE_T_ADVERTISE;
591 hw->phy.ops.write_reg(hw, IXGBE_MII_AUTONEG_ADVERTISE_REG,
592 IXGBE_MDIO_AUTO_NEG_DEV_TYPE,
596 /* Blocked by MNG FW so don't reset PHY */
597 if (ixgbe_check_reset_blocked(hw))
600 /* Restart PHY autonegotiation and wait for completion */
601 hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_CONTROL,
602 IXGBE_MDIO_AUTO_NEG_DEV_TYPE, &autoneg_reg);
604 autoneg_reg |= IXGBE_MII_RESTART;
606 hw->phy.ops.write_reg(hw, IXGBE_MDIO_AUTO_NEG_CONTROL,
607 IXGBE_MDIO_AUTO_NEG_DEV_TYPE, autoneg_reg);
609 /* Wait for autonegotiation to finish */
610 for (time_out = 0; time_out < max_time_out; time_out++) {
612 /* Restart PHY autonegotiation and wait for completion */
613 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_STATUS,
614 IXGBE_MDIO_AUTO_NEG_DEV_TYPE,
617 autoneg_reg &= IXGBE_MII_AUTONEG_COMPLETE;
618 if (autoneg_reg == IXGBE_MII_AUTONEG_COMPLETE)
622 if (time_out == max_time_out) {
623 status = IXGBE_ERR_LINK_SETUP;
624 ERROR_REPORT1(IXGBE_ERROR_POLLING,
625 "PHY autonegotiation time out");
632 * ixgbe_setup_phy_link_speed_generic - Sets the auto advertised capabilities
633 * @hw: pointer to hardware structure
634 * @speed: new link speed
636 s32 ixgbe_setup_phy_link_speed_generic(struct ixgbe_hw *hw,
637 ixgbe_link_speed speed,
638 bool autoneg_wait_to_complete)
640 UNREFERENCED_1PARAMETER(autoneg_wait_to_complete);
642 DEBUGFUNC("ixgbe_setup_phy_link_speed_generic");
645 * Clear autoneg_advertised and set new values based on input link
648 hw->phy.autoneg_advertised = 0;
650 if (speed & IXGBE_LINK_SPEED_10GB_FULL)
651 hw->phy.autoneg_advertised |= IXGBE_LINK_SPEED_10GB_FULL;
653 if (speed & IXGBE_LINK_SPEED_1GB_FULL)
654 hw->phy.autoneg_advertised |= IXGBE_LINK_SPEED_1GB_FULL;
656 if (speed & IXGBE_LINK_SPEED_100_FULL)
657 hw->phy.autoneg_advertised |= IXGBE_LINK_SPEED_100_FULL;
659 /* Setup link based on the new speed settings */
660 hw->phy.ops.setup_link(hw);
662 return IXGBE_SUCCESS;
666 * ixgbe_get_copper_link_capabilities_generic - Determines link capabilities
667 * @hw: pointer to hardware structure
668 * @speed: pointer to link speed
669 * @autoneg: boolean auto-negotiation value
671 * Determines the link capabilities by reading the AUTOC register.
673 s32 ixgbe_get_copper_link_capabilities_generic(struct ixgbe_hw *hw,
674 ixgbe_link_speed *speed,
680 DEBUGFUNC("ixgbe_get_copper_link_capabilities_generic");
685 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_PHY_SPEED_ABILITY,
686 IXGBE_MDIO_PMA_PMD_DEV_TYPE,
689 if (status == IXGBE_SUCCESS) {
690 if (speed_ability & IXGBE_MDIO_PHY_SPEED_10G)
691 *speed |= IXGBE_LINK_SPEED_10GB_FULL;
692 if (speed_ability & IXGBE_MDIO_PHY_SPEED_1G)
693 *speed |= IXGBE_LINK_SPEED_1GB_FULL;
694 if (speed_ability & IXGBE_MDIO_PHY_SPEED_100M)
695 *speed |= IXGBE_LINK_SPEED_100_FULL;
702 * ixgbe_check_phy_link_tnx - Determine link and speed status
703 * @hw: pointer to hardware structure
705 * Reads the VS1 register to determine if link is up and the current speed for
708 s32 ixgbe_check_phy_link_tnx(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
711 s32 status = IXGBE_SUCCESS;
713 u32 max_time_out = 10;
718 DEBUGFUNC("ixgbe_check_phy_link_tnx");
720 /* Initialize speed and link to default case */
722 *speed = IXGBE_LINK_SPEED_10GB_FULL;
725 * Check current speed and link status of the PHY register.
726 * This is a vendor specific register and may have to
727 * be changed for other copper PHYs.
729 for (time_out = 0; time_out < max_time_out; time_out++) {
731 status = hw->phy.ops.read_reg(hw,
732 IXGBE_MDIO_VENDOR_SPECIFIC_1_STATUS,
733 IXGBE_MDIO_VENDOR_SPECIFIC_1_DEV_TYPE,
735 phy_link = phy_data & IXGBE_MDIO_VENDOR_SPECIFIC_1_LINK_STATUS;
736 phy_speed = phy_data &
737 IXGBE_MDIO_VENDOR_SPECIFIC_1_SPEED_STATUS;
738 if (phy_link == IXGBE_MDIO_VENDOR_SPECIFIC_1_LINK_STATUS) {
741 IXGBE_MDIO_VENDOR_SPECIFIC_1_SPEED_STATUS)
742 *speed = IXGBE_LINK_SPEED_1GB_FULL;
751 * ixgbe_setup_phy_link_tnx - Set and restart autoneg
752 * @hw: pointer to hardware structure
754 * Restart autonegotiation and PHY and waits for completion.
756 s32 ixgbe_setup_phy_link_tnx(struct ixgbe_hw *hw)
758 s32 status = IXGBE_SUCCESS;
760 u32 max_time_out = 10;
761 u16 autoneg_reg = IXGBE_MII_AUTONEG_REG;
762 bool autoneg = false;
763 ixgbe_link_speed speed;
765 DEBUGFUNC("ixgbe_setup_phy_link_tnx");
767 ixgbe_get_copper_link_capabilities_generic(hw, &speed, &autoneg);
769 if (speed & IXGBE_LINK_SPEED_10GB_FULL) {
770 /* Set or unset auto-negotiation 10G advertisement */
771 hw->phy.ops.read_reg(hw, IXGBE_MII_10GBASE_T_AUTONEG_CTRL_REG,
772 IXGBE_MDIO_AUTO_NEG_DEV_TYPE,
775 autoneg_reg &= ~IXGBE_MII_10GBASE_T_ADVERTISE;
776 if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_10GB_FULL)
777 autoneg_reg |= IXGBE_MII_10GBASE_T_ADVERTISE;
779 hw->phy.ops.write_reg(hw, IXGBE_MII_10GBASE_T_AUTONEG_CTRL_REG,
780 IXGBE_MDIO_AUTO_NEG_DEV_TYPE,
784 if (speed & IXGBE_LINK_SPEED_1GB_FULL) {
785 /* Set or unset auto-negotiation 1G advertisement */
786 hw->phy.ops.read_reg(hw, IXGBE_MII_AUTONEG_XNP_TX_REG,
787 IXGBE_MDIO_AUTO_NEG_DEV_TYPE,
790 autoneg_reg &= ~IXGBE_MII_1GBASE_T_ADVERTISE_XNP_TX;
791 if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_1GB_FULL)
792 autoneg_reg |= IXGBE_MII_1GBASE_T_ADVERTISE_XNP_TX;
794 hw->phy.ops.write_reg(hw, IXGBE_MII_AUTONEG_XNP_TX_REG,
795 IXGBE_MDIO_AUTO_NEG_DEV_TYPE,
799 if (speed & IXGBE_LINK_SPEED_100_FULL) {
800 /* Set or unset auto-negotiation 100M advertisement */
801 hw->phy.ops.read_reg(hw, IXGBE_MII_AUTONEG_ADVERTISE_REG,
802 IXGBE_MDIO_AUTO_NEG_DEV_TYPE,
805 autoneg_reg &= ~IXGBE_MII_100BASE_T_ADVERTISE;
806 if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_100_FULL)
807 autoneg_reg |= IXGBE_MII_100BASE_T_ADVERTISE;
809 hw->phy.ops.write_reg(hw, IXGBE_MII_AUTONEG_ADVERTISE_REG,
810 IXGBE_MDIO_AUTO_NEG_DEV_TYPE,
814 /* Blocked by MNG FW so don't reset PHY */
815 if (ixgbe_check_reset_blocked(hw))
818 /* Restart PHY autonegotiation and wait for completion */
819 hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_CONTROL,
820 IXGBE_MDIO_AUTO_NEG_DEV_TYPE, &autoneg_reg);
822 autoneg_reg |= IXGBE_MII_RESTART;
824 hw->phy.ops.write_reg(hw, IXGBE_MDIO_AUTO_NEG_CONTROL,
825 IXGBE_MDIO_AUTO_NEG_DEV_TYPE, autoneg_reg);
827 /* Wait for autonegotiation to finish */
828 for (time_out = 0; time_out < max_time_out; time_out++) {
830 /* Restart PHY autonegotiation and wait for completion */
831 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_STATUS,
832 IXGBE_MDIO_AUTO_NEG_DEV_TYPE,
835 autoneg_reg &= IXGBE_MII_AUTONEG_COMPLETE;
836 if (autoneg_reg == IXGBE_MII_AUTONEG_COMPLETE)
840 if (time_out == max_time_out) {
841 status = IXGBE_ERR_LINK_SETUP;
842 DEBUGOUT("ixgbe_setup_phy_link_tnx: time out");
849 * ixgbe_get_phy_firmware_version_tnx - Gets the PHY Firmware Version
850 * @hw: pointer to hardware structure
851 * @firmware_version: pointer to the PHY Firmware Version
853 s32 ixgbe_get_phy_firmware_version_tnx(struct ixgbe_hw *hw,
854 u16 *firmware_version)
858 DEBUGFUNC("ixgbe_get_phy_firmware_version_tnx");
860 status = hw->phy.ops.read_reg(hw, TNX_FW_REV,
861 IXGBE_MDIO_VENDOR_SPECIFIC_1_DEV_TYPE,
868 * ixgbe_get_phy_firmware_version_generic - Gets the PHY Firmware Version
869 * @hw: pointer to hardware structure
870 * @firmware_version: pointer to the PHY Firmware Version
872 s32 ixgbe_get_phy_firmware_version_generic(struct ixgbe_hw *hw,
873 u16 *firmware_version)
877 DEBUGFUNC("ixgbe_get_phy_firmware_version_generic");
879 status = hw->phy.ops.read_reg(hw, AQ_FW_REV,
880 IXGBE_MDIO_VENDOR_SPECIFIC_1_DEV_TYPE,
887 * ixgbe_reset_phy_nl - Performs a PHY reset
888 * @hw: pointer to hardware structure
890 s32 ixgbe_reset_phy_nl(struct ixgbe_hw *hw)
892 u16 phy_offset, control, eword, edata, block_crc;
893 bool end_data = false;
894 u16 list_offset, data_offset;
896 s32 ret_val = IXGBE_SUCCESS;
899 DEBUGFUNC("ixgbe_reset_phy_nl");
901 /* Blocked by MNG FW so bail */
902 if (ixgbe_check_reset_blocked(hw))
905 hw->phy.ops.read_reg(hw, IXGBE_MDIO_PHY_XS_CONTROL,
906 IXGBE_MDIO_PHY_XS_DEV_TYPE, &phy_data);
908 /* reset the PHY and poll for completion */
909 hw->phy.ops.write_reg(hw, IXGBE_MDIO_PHY_XS_CONTROL,
910 IXGBE_MDIO_PHY_XS_DEV_TYPE,
911 (phy_data | IXGBE_MDIO_PHY_XS_RESET));
913 for (i = 0; i < 100; i++) {
914 hw->phy.ops.read_reg(hw, IXGBE_MDIO_PHY_XS_CONTROL,
915 IXGBE_MDIO_PHY_XS_DEV_TYPE, &phy_data);
916 if ((phy_data & IXGBE_MDIO_PHY_XS_RESET) == 0)
921 if ((phy_data & IXGBE_MDIO_PHY_XS_RESET) != 0) {
922 DEBUGOUT("PHY reset did not complete.\n");
923 ret_val = IXGBE_ERR_PHY;
927 /* Get init offsets */
928 ret_val = ixgbe_get_sfp_init_sequence_offsets(hw, &list_offset,
930 if (ret_val != IXGBE_SUCCESS)
933 ret_val = hw->eeprom.ops.read(hw, data_offset, &block_crc);
937 * Read control word from PHY init contents offset
939 ret_val = hw->eeprom.ops.read(hw, data_offset, &eword);
942 control = (eword & IXGBE_CONTROL_MASK_NL) >>
943 IXGBE_CONTROL_SHIFT_NL;
944 edata = eword & IXGBE_DATA_MASK_NL;
948 DEBUGOUT1("DELAY: %d MS\n", edata);
954 ret_val = hw->eeprom.ops.read(hw, data_offset,
959 for (i = 0; i < edata; i++) {
960 ret_val = hw->eeprom.ops.read(hw, data_offset,
964 hw->phy.ops.write_reg(hw, phy_offset,
965 IXGBE_TWINAX_DEV, eword);
966 DEBUGOUT2("Wrote %4.4x to %4.4x\n", eword,
972 case IXGBE_CONTROL_NL:
974 DEBUGOUT("CONTROL:\n");
975 if (edata == IXGBE_CONTROL_EOL_NL) {
978 } else if (edata == IXGBE_CONTROL_SOL_NL) {
981 DEBUGOUT("Bad control value\n");
982 ret_val = IXGBE_ERR_PHY;
987 DEBUGOUT("Bad control type\n");
988 ret_val = IXGBE_ERR_PHY;
997 ERROR_REPORT2(IXGBE_ERROR_INVALID_STATE,
998 "eeprom read at offset %d failed", data_offset);
999 return IXGBE_ERR_PHY;
1003 * ixgbe_identify_module_generic - Identifies module type
1004 * @hw: pointer to hardware structure
1006 * Determines HW type and calls appropriate function.
1008 s32 ixgbe_identify_module_generic(struct ixgbe_hw *hw)
1010 s32 status = IXGBE_ERR_SFP_NOT_PRESENT;
1012 DEBUGFUNC("ixgbe_identify_module_generic");
1014 switch (hw->mac.ops.get_media_type(hw)) {
1015 case ixgbe_media_type_fiber:
1016 status = ixgbe_identify_sfp_module_generic(hw);
1021 hw->phy.sfp_type = ixgbe_sfp_type_not_present;
1022 status = IXGBE_ERR_SFP_NOT_PRESENT;
1030 * ixgbe_identify_sfp_module_generic - Identifies SFP modules
1031 * @hw: pointer to hardware structure
1033 * Searches for and identifies the SFP module and assigns appropriate PHY type.
1035 s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw)
1037 s32 status = IXGBE_ERR_PHY_ADDR_INVALID;
1039 enum ixgbe_sfp_type stored_sfp_type = hw->phy.sfp_type;
1041 u8 comp_codes_1g = 0;
1042 u8 comp_codes_10g = 0;
1043 u8 oui_bytes[3] = {0, 0, 0};
1046 u16 enforce_sfp = 0;
1048 DEBUGFUNC("ixgbe_identify_sfp_module_generic");
1050 if (hw->mac.ops.get_media_type(hw) != ixgbe_media_type_fiber) {
1051 hw->phy.sfp_type = ixgbe_sfp_type_not_present;
1052 status = IXGBE_ERR_SFP_NOT_PRESENT;
1056 status = hw->phy.ops.read_i2c_eeprom(hw,
1057 IXGBE_SFF_IDENTIFIER,
1060 if (status != IXGBE_SUCCESS)
1061 goto err_read_i2c_eeprom;
1063 /* LAN ID is needed for sfp_type determination */
1064 hw->mac.ops.set_lan_id(hw);
1066 if (identifier != IXGBE_SFF_IDENTIFIER_SFP) {
1067 hw->phy.type = ixgbe_phy_sfp_unsupported;
1068 status = IXGBE_ERR_SFP_NOT_SUPPORTED;
1070 status = hw->phy.ops.read_i2c_eeprom(hw,
1071 IXGBE_SFF_1GBE_COMP_CODES,
1074 if (status != IXGBE_SUCCESS)
1075 goto err_read_i2c_eeprom;
1077 status = hw->phy.ops.read_i2c_eeprom(hw,
1078 IXGBE_SFF_10GBE_COMP_CODES,
1081 if (status != IXGBE_SUCCESS)
1082 goto err_read_i2c_eeprom;
1083 status = hw->phy.ops.read_i2c_eeprom(hw,
1084 IXGBE_SFF_CABLE_TECHNOLOGY,
1087 if (status != IXGBE_SUCCESS)
1088 goto err_read_i2c_eeprom;
1095 * 3 SFP_DA_CORE0 - 82599-specific
1096 * 4 SFP_DA_CORE1 - 82599-specific
1097 * 5 SFP_SR/LR_CORE0 - 82599-specific
1098 * 6 SFP_SR/LR_CORE1 - 82599-specific
1099 * 7 SFP_act_lmt_DA_CORE0 - 82599-specific
1100 * 8 SFP_act_lmt_DA_CORE1 - 82599-specific
1101 * 9 SFP_1g_cu_CORE0 - 82599-specific
1102 * 10 SFP_1g_cu_CORE1 - 82599-specific
1103 * 11 SFP_1g_sx_CORE0 - 82599-specific
1104 * 12 SFP_1g_sx_CORE1 - 82599-specific
1106 if (hw->mac.type == ixgbe_mac_82598EB) {
1107 if (cable_tech & IXGBE_SFF_DA_PASSIVE_CABLE)
1108 hw->phy.sfp_type = ixgbe_sfp_type_da_cu;
1109 else if (comp_codes_10g & IXGBE_SFF_10GBASESR_CAPABLE)
1110 hw->phy.sfp_type = ixgbe_sfp_type_sr;
1111 else if (comp_codes_10g & IXGBE_SFF_10GBASELR_CAPABLE)
1112 hw->phy.sfp_type = ixgbe_sfp_type_lr;
1114 hw->phy.sfp_type = ixgbe_sfp_type_unknown;
1115 } else if (hw->mac.type == ixgbe_mac_82599EB) {
1116 if (cable_tech & IXGBE_SFF_DA_PASSIVE_CABLE) {
1117 if (hw->bus.lan_id == 0)
1119 ixgbe_sfp_type_da_cu_core0;
1122 ixgbe_sfp_type_da_cu_core1;
1123 } else if (cable_tech & IXGBE_SFF_DA_ACTIVE_CABLE) {
1124 hw->phy.ops.read_i2c_eeprom(
1125 hw, IXGBE_SFF_CABLE_SPEC_COMP,
1128 IXGBE_SFF_DA_SPEC_ACTIVE_LIMITING) {
1129 if (hw->bus.lan_id == 0)
1131 ixgbe_sfp_type_da_act_lmt_core0;
1134 ixgbe_sfp_type_da_act_lmt_core1;
1137 ixgbe_sfp_type_unknown;
1139 } else if (comp_codes_10g &
1140 (IXGBE_SFF_10GBASESR_CAPABLE |
1141 IXGBE_SFF_10GBASELR_CAPABLE)) {
1142 if (hw->bus.lan_id == 0)
1144 ixgbe_sfp_type_srlr_core0;
1147 ixgbe_sfp_type_srlr_core1;
1148 #ifdef SUPPORT_10GBASE_ER
1149 } else if (comp_codes_10g &
1150 IXGBE_SFF_10GBASEER_CAPABLE) {
1151 if (hw->bus.lan_id == 0)
1153 ixgbe_sfp_type_er_core0;
1156 ixgbe_sfp_type_er_core1;
1157 #endif /* SUPPORT_10GBASE_ER */
1158 } else if (comp_codes_1g & IXGBE_SFF_1GBASET_CAPABLE) {
1159 if (hw->bus.lan_id == 0)
1161 ixgbe_sfp_type_1g_cu_core0;
1164 ixgbe_sfp_type_1g_cu_core1;
1165 } else if (comp_codes_1g & IXGBE_SFF_1GBASESX_CAPABLE) {
1166 if (hw->bus.lan_id == 0)
1168 ixgbe_sfp_type_1g_sx_core0;
1171 ixgbe_sfp_type_1g_sx_core1;
1172 #ifdef SUPPORT_1000BASE_LX
1173 } else if (comp_codes_1g & IXGBE_SFF_1GBASELX_CAPABLE) {
1174 if (hw->bus.lan_id == 0)
1176 ixgbe_sfp_type_1g_lx_core0;
1179 ixgbe_sfp_type_1g_lx_core1;
1180 #endif /* SUPPORT_1000BASE_LX */
1182 hw->phy.sfp_type = ixgbe_sfp_type_unknown;
1186 if (hw->phy.sfp_type != stored_sfp_type)
1187 hw->phy.sfp_setup_needed = true;
1189 /* Determine if the SFP+ PHY is dual speed or not. */
1190 hw->phy.multispeed_fiber = false;
1191 if (((comp_codes_1g & IXGBE_SFF_1GBASESX_CAPABLE) &&
1192 (comp_codes_10g & IXGBE_SFF_10GBASESR_CAPABLE)) ||
1193 ((comp_codes_1g & IXGBE_SFF_1GBASELX_CAPABLE) &&
1194 (comp_codes_10g & IXGBE_SFF_10GBASELR_CAPABLE)))
1195 hw->phy.multispeed_fiber = true;
1197 /* Determine PHY vendor */
1198 if (hw->phy.type != ixgbe_phy_nl) {
1199 hw->phy.id = identifier;
1200 status = hw->phy.ops.read_i2c_eeprom(hw,
1201 IXGBE_SFF_VENDOR_OUI_BYTE0,
1204 if (status != IXGBE_SUCCESS)
1205 goto err_read_i2c_eeprom;
1207 status = hw->phy.ops.read_i2c_eeprom(hw,
1208 IXGBE_SFF_VENDOR_OUI_BYTE1,
1211 if (status != IXGBE_SUCCESS)
1212 goto err_read_i2c_eeprom;
1214 status = hw->phy.ops.read_i2c_eeprom(hw,
1215 IXGBE_SFF_VENDOR_OUI_BYTE2,
1218 if (status != IXGBE_SUCCESS)
1219 goto err_read_i2c_eeprom;
1222 ((oui_bytes[0] << IXGBE_SFF_VENDOR_OUI_BYTE0_SHIFT) |
1223 (oui_bytes[1] << IXGBE_SFF_VENDOR_OUI_BYTE1_SHIFT) |
1224 (oui_bytes[2] << IXGBE_SFF_VENDOR_OUI_BYTE2_SHIFT));
1226 switch (vendor_oui) {
1227 case IXGBE_SFF_VENDOR_OUI_TYCO:
1228 if (cable_tech & IXGBE_SFF_DA_PASSIVE_CABLE)
1230 ixgbe_phy_sfp_passive_tyco;
1232 case IXGBE_SFF_VENDOR_OUI_FTL:
1233 if (cable_tech & IXGBE_SFF_DA_ACTIVE_CABLE)
1234 hw->phy.type = ixgbe_phy_sfp_ftl_active;
1236 hw->phy.type = ixgbe_phy_sfp_ftl;
1238 case IXGBE_SFF_VENDOR_OUI_AVAGO:
1239 hw->phy.type = ixgbe_phy_sfp_avago;
1241 case IXGBE_SFF_VENDOR_OUI_INTEL:
1242 hw->phy.type = ixgbe_phy_sfp_intel;
1245 if (cable_tech & IXGBE_SFF_DA_PASSIVE_CABLE)
1247 ixgbe_phy_sfp_passive_unknown;
1248 else if (cable_tech & IXGBE_SFF_DA_ACTIVE_CABLE)
1250 ixgbe_phy_sfp_active_unknown;
1252 hw->phy.type = ixgbe_phy_sfp_unknown;
1257 /* Allow any DA cable vendor */
1258 if (cable_tech & (IXGBE_SFF_DA_PASSIVE_CABLE |
1259 IXGBE_SFF_DA_ACTIVE_CABLE)) {
1260 status = IXGBE_SUCCESS;
1264 /* Verify supported 1G SFP modules */
1265 if (comp_codes_10g == 0 &&
1266 !(hw->phy.sfp_type == ixgbe_sfp_type_1g_cu_core1 ||
1267 hw->phy.sfp_type == ixgbe_sfp_type_1g_cu_core0 ||
1268 #ifdef SUPPORT_1000BASE_LX
1269 hw->phy.sfp_type == ixgbe_sfp_type_1g_lx_core0 ||
1270 hw->phy.sfp_type == ixgbe_sfp_type_1g_lx_core1 ||
1272 hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core0 ||
1273 hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core1)) {
1274 hw->phy.type = ixgbe_phy_sfp_unsupported;
1275 status = IXGBE_ERR_SFP_NOT_SUPPORTED;
1279 /* Anything else 82598-based is supported */
1280 if (hw->mac.type == ixgbe_mac_82598EB) {
1281 status = IXGBE_SUCCESS;
1285 ixgbe_get_device_caps(hw, &enforce_sfp);
1286 if (!(enforce_sfp & IXGBE_DEVICE_CAPS_ALLOW_ANY_SFP) &&
1287 !(hw->phy.sfp_type == ixgbe_sfp_type_1g_cu_core0 ||
1288 hw->phy.sfp_type == ixgbe_sfp_type_1g_cu_core1 ||
1289 #ifdef SUPPORT_1000BASE_LX
1290 hw->phy.sfp_type == ixgbe_sfp_type_1g_lx_core0 ||
1291 hw->phy.sfp_type == ixgbe_sfp_type_1g_lx_core1 ||
1293 #ifdef SUPPORT_10GBASE_ER
1294 hw->phy.sfp_type == ixgbe_sfp_type_er_core0 ||
1295 hw->phy.sfp_type == ixgbe_sfp_type_er_core1 ||
1297 hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core0 ||
1298 hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core1)) {
1299 /* Make sure we're a supported PHY type */
1300 if (hw->phy.type == ixgbe_phy_sfp_intel) {
1301 status = IXGBE_SUCCESS;
1303 if (hw->allow_unsupported_sfp == true) {
1304 EWARN(hw, "WARNING: Intel (R) Network "
1305 "Connections are quality tested "
1306 "using Intel (R) Ethernet Optics."
1307 " Using untested modules is not "
1308 "supported and may cause unstable"
1309 " operation or damage to the "
1310 "module or the adapter. Intel "
1311 "Corporation is not responsible "
1312 "for any harm caused by using "
1313 "untested modules.\n", status);
1314 status = IXGBE_SUCCESS;
1316 DEBUGOUT("SFP+ module not supported\n");
1318 ixgbe_phy_sfp_unsupported;
1319 status = IXGBE_ERR_SFP_NOT_SUPPORTED;
1323 status = IXGBE_SUCCESS;
1330 err_read_i2c_eeprom:
1331 hw->phy.sfp_type = ixgbe_sfp_type_not_present;
1332 if (hw->phy.type != ixgbe_phy_nl) {
1334 hw->phy.type = ixgbe_phy_unknown;
1336 return IXGBE_ERR_SFP_NOT_PRESENT;
1342 * ixgbe_get_sfp_init_sequence_offsets - Provides offset of PHY init sequence
1343 * @hw: pointer to hardware structure
1344 * @list_offset: offset to the SFP ID list
1345 * @data_offset: offset to the SFP data block
1347 * Checks the MAC's EEPROM to see if it supports a given SFP+ module type, if
1348 * so it returns the offsets to the phy init sequence block.
1350 s32 ixgbe_get_sfp_init_sequence_offsets(struct ixgbe_hw *hw,
1355 u16 sfp_type = hw->phy.sfp_type;
1357 DEBUGFUNC("ixgbe_get_sfp_init_sequence_offsets");
1359 if (hw->phy.sfp_type == ixgbe_sfp_type_unknown)
1360 return IXGBE_ERR_SFP_NOT_SUPPORTED;
1362 if (hw->phy.sfp_type == ixgbe_sfp_type_not_present)
1363 return IXGBE_ERR_SFP_NOT_PRESENT;
1365 if ((hw->device_id == IXGBE_DEV_ID_82598_SR_DUAL_PORT_EM) &&
1366 (hw->phy.sfp_type == ixgbe_sfp_type_da_cu))
1367 return IXGBE_ERR_SFP_NOT_SUPPORTED;
1370 * Limiting active cables and 1G Phys must be initialized as
1373 if (sfp_type == ixgbe_sfp_type_da_act_lmt_core0 ||
1374 #ifdef SUPPORT_10GBASE_ER
1375 sfp_type == ixgbe_sfp_type_er_core0 ||
1376 #endif /* SUPPORT_10GBASE_ER */
1377 #ifdef SUPPORT_1000BASE_LX
1378 sfp_type == ixgbe_sfp_type_1g_lx_core0 ||
1379 #endif /* SUPPORT_1000BASE_LX */
1380 sfp_type == ixgbe_sfp_type_1g_cu_core0 ||
1381 sfp_type == ixgbe_sfp_type_1g_sx_core0)
1382 sfp_type = ixgbe_sfp_type_srlr_core0;
1383 else if (sfp_type == ixgbe_sfp_type_da_act_lmt_core1 ||
1384 #ifdef SUPPORT_10GBASE_ER
1385 sfp_type == ixgbe_sfp_type_er_core1 ||
1386 #endif /* SUPPORT_10GBASE_ER */
1387 #ifdef SUPPORT_1000BASE_LX
1388 sfp_type == ixgbe_sfp_type_1g_lx_core1 ||
1389 #endif /* SUPPORT_1000BASE_LX */
1390 sfp_type == ixgbe_sfp_type_1g_cu_core1 ||
1391 sfp_type == ixgbe_sfp_type_1g_sx_core1)
1392 sfp_type = ixgbe_sfp_type_srlr_core1;
1394 /* Read offset to PHY init contents */
1395 if (hw->eeprom.ops.read(hw, IXGBE_PHY_INIT_OFFSET_NL, list_offset)) {
1396 ERROR_REPORT2(IXGBE_ERROR_INVALID_STATE,
1397 "eeprom read at offset %d failed",
1398 IXGBE_PHY_INIT_OFFSET_NL);
1399 return IXGBE_ERR_SFP_NO_INIT_SEQ_PRESENT;
1402 if ((!*list_offset) || (*list_offset == 0xFFFF))
1403 return IXGBE_ERR_SFP_NO_INIT_SEQ_PRESENT;
1405 /* Shift offset to first ID word */
1409 * Find the matching SFP ID in the EEPROM
1410 * and program the init sequence
1412 if (hw->eeprom.ops.read(hw, *list_offset, &sfp_id))
1415 while (sfp_id != IXGBE_PHY_INIT_END_NL) {
1416 if (sfp_id == sfp_type) {
1418 if (hw->eeprom.ops.read(hw, *list_offset, data_offset))
1420 if ((!*data_offset) || (*data_offset == 0xFFFF)) {
1421 DEBUGOUT("SFP+ module not supported\n");
1422 return IXGBE_ERR_SFP_NOT_SUPPORTED;
1427 (*list_offset) += 2;
1428 if (hw->eeprom.ops.read(hw, *list_offset, &sfp_id))
1433 if (sfp_id == IXGBE_PHY_INIT_END_NL) {
1434 DEBUGOUT("No matching SFP+ module found\n");
1435 return IXGBE_ERR_SFP_NOT_SUPPORTED;
1438 return IXGBE_SUCCESS;
1441 ERROR_REPORT2(IXGBE_ERROR_INVALID_STATE,
1442 "eeprom read at offset %d failed", *list_offset);
1443 return IXGBE_ERR_PHY;
1447 * ixgbe_read_i2c_eeprom_generic - Reads 8 bit EEPROM word over I2C interface
1448 * @hw: pointer to hardware structure
1449 * @byte_offset: EEPROM byte offset to read
1450 * @eeprom_data: value read
1452 * Performs byte read operation to SFP module's EEPROM over I2C interface.
1454 s32 ixgbe_read_i2c_eeprom_generic(struct ixgbe_hw *hw, u8 byte_offset,
1457 DEBUGFUNC("ixgbe_read_i2c_eeprom_generic");
1459 return hw->phy.ops.read_i2c_byte(hw, byte_offset,
1460 IXGBE_I2C_EEPROM_DEV_ADDR,
1465 * ixgbe_write_i2c_eeprom_generic - Writes 8 bit EEPROM word over I2C interface
1466 * @hw: pointer to hardware structure
1467 * @byte_offset: EEPROM byte offset to write
1468 * @eeprom_data: value to write
1470 * Performs byte write operation to SFP module's EEPROM over I2C interface.
1472 s32 ixgbe_write_i2c_eeprom_generic(struct ixgbe_hw *hw, u8 byte_offset,
1475 DEBUGFUNC("ixgbe_write_i2c_eeprom_generic");
1477 return hw->phy.ops.write_i2c_byte(hw, byte_offset,
1478 IXGBE_I2C_EEPROM_DEV_ADDR,
1483 * ixgbe_read_i2c_byte_generic - Reads 8 bit word over I2C
1484 * @hw: pointer to hardware structure
1485 * @byte_offset: byte offset to read
1488 * Performs byte read operation to SFP module's EEPROM over I2C interface at
1489 * a specified device address.
1491 s32 ixgbe_read_i2c_byte_generic(struct ixgbe_hw *hw, u8 byte_offset,
1492 u8 dev_addr, u8 *data)
1494 s32 status = IXGBE_SUCCESS;
1501 DEBUGFUNC("ixgbe_read_i2c_byte_generic");
1503 if (IXGBE_READ_REG(hw, IXGBE_STATUS) & IXGBE_STATUS_LAN_ID_1)
1504 swfw_mask = IXGBE_GSSR_PHY1_SM;
1506 swfw_mask = IXGBE_GSSR_PHY0_SM;
1509 if (hw->mac.ops.acquire_swfw_sync(hw, swfw_mask)
1511 status = IXGBE_ERR_SWFW_SYNC;
1515 ixgbe_i2c_start(hw);
1517 /* Device Address and write indication */
1518 status = ixgbe_clock_out_i2c_byte(hw, dev_addr);
1519 if (status != IXGBE_SUCCESS)
1522 status = ixgbe_get_i2c_ack(hw);
1523 if (status != IXGBE_SUCCESS)
1526 status = ixgbe_clock_out_i2c_byte(hw, byte_offset);
1527 if (status != IXGBE_SUCCESS)
1530 status = ixgbe_get_i2c_ack(hw);
1531 if (status != IXGBE_SUCCESS)
1534 ixgbe_i2c_start(hw);
1536 /* Device Address and read indication */
1537 status = ixgbe_clock_out_i2c_byte(hw, (dev_addr | 0x1));
1538 if (status != IXGBE_SUCCESS)
1541 status = ixgbe_get_i2c_ack(hw);
1542 if (status != IXGBE_SUCCESS)
1545 status = ixgbe_clock_in_i2c_byte(hw, data);
1546 if (status != IXGBE_SUCCESS)
1549 status = ixgbe_clock_out_i2c_bit(hw, nack);
1550 if (status != IXGBE_SUCCESS)
1557 ixgbe_i2c_bus_clear(hw);
1558 hw->mac.ops.release_swfw_sync(hw, swfw_mask);
1561 if (retry < max_retry)
1562 DEBUGOUT("I2C byte read error - Retrying.\n");
1564 DEBUGOUT("I2C byte read error.\n");
1566 } while (retry < max_retry);
1568 hw->mac.ops.release_swfw_sync(hw, swfw_mask);
1575 * ixgbe_write_i2c_byte_generic - Writes 8 bit word over I2C
1576 * @hw: pointer to hardware structure
1577 * @byte_offset: byte offset to write
1578 * @data: value to write
1580 * Performs byte write operation to SFP module's EEPROM over I2C interface at
1581 * a specified device address.
1583 s32 ixgbe_write_i2c_byte_generic(struct ixgbe_hw *hw, u8 byte_offset,
1584 u8 dev_addr, u8 data)
1586 s32 status = IXGBE_SUCCESS;
1591 DEBUGFUNC("ixgbe_write_i2c_byte_generic");
1593 if (IXGBE_READ_REG(hw, IXGBE_STATUS) & IXGBE_STATUS_LAN_ID_1)
1594 swfw_mask = IXGBE_GSSR_PHY1_SM;
1596 swfw_mask = IXGBE_GSSR_PHY0_SM;
1598 if (hw->mac.ops.acquire_swfw_sync(hw, swfw_mask) != IXGBE_SUCCESS) {
1599 status = IXGBE_ERR_SWFW_SYNC;
1600 goto write_byte_out;
1604 ixgbe_i2c_start(hw);
1606 status = ixgbe_clock_out_i2c_byte(hw, dev_addr);
1607 if (status != IXGBE_SUCCESS)
1610 status = ixgbe_get_i2c_ack(hw);
1611 if (status != IXGBE_SUCCESS)
1614 status = ixgbe_clock_out_i2c_byte(hw, byte_offset);
1615 if (status != IXGBE_SUCCESS)
1618 status = ixgbe_get_i2c_ack(hw);
1619 if (status != IXGBE_SUCCESS)
1622 status = ixgbe_clock_out_i2c_byte(hw, data);
1623 if (status != IXGBE_SUCCESS)
1626 status = ixgbe_get_i2c_ack(hw);
1627 if (status != IXGBE_SUCCESS)
1634 ixgbe_i2c_bus_clear(hw);
1636 if (retry < max_retry)
1637 DEBUGOUT("I2C byte write error - Retrying.\n");
1639 DEBUGOUT("I2C byte write error.\n");
1640 } while (retry < max_retry);
1642 hw->mac.ops.release_swfw_sync(hw, swfw_mask);
1649 * ixgbe_i2c_start - Sets I2C start condition
1650 * @hw: pointer to hardware structure
1652 * Sets I2C start condition (High -> Low on SDA while SCL is High)
1654 STATIC void ixgbe_i2c_start(struct ixgbe_hw *hw)
1656 u32 i2cctl = IXGBE_READ_REG(hw, IXGBE_I2CCTL);
1658 DEBUGFUNC("ixgbe_i2c_start");
1660 /* Start condition must begin with data and clock high */
1661 ixgbe_set_i2c_data(hw, &i2cctl, 1);
1662 ixgbe_raise_i2c_clk(hw, &i2cctl);
1664 /* Setup time for start condition (4.7us) */
1665 usec_delay(IXGBE_I2C_T_SU_STA);
1667 ixgbe_set_i2c_data(hw, &i2cctl, 0);
1669 /* Hold time for start condition (4us) */
1670 usec_delay(IXGBE_I2C_T_HD_STA);
1672 ixgbe_lower_i2c_clk(hw, &i2cctl);
1674 /* Minimum low period of clock is 4.7 us */
1675 usec_delay(IXGBE_I2C_T_LOW);
1680 * ixgbe_i2c_stop - Sets I2C stop condition
1681 * @hw: pointer to hardware structure
1683 * Sets I2C stop condition (Low -> High on SDA while SCL is High)
1685 STATIC void ixgbe_i2c_stop(struct ixgbe_hw *hw)
1687 u32 i2cctl = IXGBE_READ_REG(hw, IXGBE_I2CCTL);
1689 DEBUGFUNC("ixgbe_i2c_stop");
1691 /* Stop condition must begin with data low and clock high */
1692 ixgbe_set_i2c_data(hw, &i2cctl, 0);
1693 ixgbe_raise_i2c_clk(hw, &i2cctl);
1695 /* Setup time for stop condition (4us) */
1696 usec_delay(IXGBE_I2C_T_SU_STO);
1698 ixgbe_set_i2c_data(hw, &i2cctl, 1);
1700 /* bus free time between stop and start (4.7us)*/
1701 usec_delay(IXGBE_I2C_T_BUF);
1705 * ixgbe_clock_in_i2c_byte - Clocks in one byte via I2C
1706 * @hw: pointer to hardware structure
1707 * @data: data byte to clock in
1709 * Clocks in one byte data via I2C data/clock
1711 STATIC s32 ixgbe_clock_in_i2c_byte(struct ixgbe_hw *hw, u8 *data)
1716 DEBUGFUNC("ixgbe_clock_in_i2c_byte");
1718 for (i = 7; i >= 0; i--) {
1719 ixgbe_clock_in_i2c_bit(hw, &bit);
1723 return IXGBE_SUCCESS;
1727 * ixgbe_clock_out_i2c_byte - Clocks out one byte via I2C
1728 * @hw: pointer to hardware structure
1729 * @data: data byte clocked out
1731 * Clocks out one byte data via I2C data/clock
1733 STATIC s32 ixgbe_clock_out_i2c_byte(struct ixgbe_hw *hw, u8 data)
1735 s32 status = IXGBE_SUCCESS;
1740 DEBUGFUNC("ixgbe_clock_out_i2c_byte");
1742 for (i = 7; i >= 0; i--) {
1743 bit = (data >> i) & 0x1;
1744 status = ixgbe_clock_out_i2c_bit(hw, bit);
1746 if (status != IXGBE_SUCCESS)
1750 /* Release SDA line (set high) */
1751 i2cctl = IXGBE_READ_REG(hw, IXGBE_I2CCTL);
1752 i2cctl |= IXGBE_I2C_DATA_OUT;
1753 IXGBE_WRITE_REG(hw, IXGBE_I2CCTL, i2cctl);
1754 IXGBE_WRITE_FLUSH(hw);
1760 * ixgbe_get_i2c_ack - Polls for I2C ACK
1761 * @hw: pointer to hardware structure
1763 * Clocks in/out one bit via I2C data/clock
1765 STATIC s32 ixgbe_get_i2c_ack(struct ixgbe_hw *hw)
1767 s32 status = IXGBE_SUCCESS;
1769 u32 i2cctl = IXGBE_READ_REG(hw, IXGBE_I2CCTL);
1773 DEBUGFUNC("ixgbe_get_i2c_ack");
1775 ixgbe_raise_i2c_clk(hw, &i2cctl);
1778 /* Minimum high period of clock is 4us */
1779 usec_delay(IXGBE_I2C_T_HIGH);
1781 /* Poll for ACK. Note that ACK in I2C spec is
1782 * transition from 1 to 0 */
1783 for (i = 0; i < timeout; i++) {
1784 i2cctl = IXGBE_READ_REG(hw, IXGBE_I2CCTL);
1785 ack = ixgbe_get_i2c_data(&i2cctl);
1793 ERROR_REPORT1(IXGBE_ERROR_POLLING,
1794 "I2C ack was not received.\n");
1795 status = IXGBE_ERR_I2C;
1798 ixgbe_lower_i2c_clk(hw, &i2cctl);
1800 /* Minimum low period of clock is 4.7 us */
1801 usec_delay(IXGBE_I2C_T_LOW);
1807 * ixgbe_clock_in_i2c_bit - Clocks in one bit via I2C data/clock
1808 * @hw: pointer to hardware structure
1809 * @data: read data value
1811 * Clocks in one bit via I2C data/clock
1813 STATIC s32 ixgbe_clock_in_i2c_bit(struct ixgbe_hw *hw, bool *data)
1815 u32 i2cctl = IXGBE_READ_REG(hw, IXGBE_I2CCTL);
1817 DEBUGFUNC("ixgbe_clock_in_i2c_bit");
1819 ixgbe_raise_i2c_clk(hw, &i2cctl);
1821 /* Minimum high period of clock is 4us */
1822 usec_delay(IXGBE_I2C_T_HIGH);
1824 i2cctl = IXGBE_READ_REG(hw, IXGBE_I2CCTL);
1825 *data = ixgbe_get_i2c_data(&i2cctl);
1827 ixgbe_lower_i2c_clk(hw, &i2cctl);
1829 /* Minimum low period of clock is 4.7 us */
1830 usec_delay(IXGBE_I2C_T_LOW);
1832 return IXGBE_SUCCESS;
1836 * ixgbe_clock_out_i2c_bit - Clocks in/out one bit via I2C data/clock
1837 * @hw: pointer to hardware structure
1838 * @data: data value to write
1840 * Clocks out one bit via I2C data/clock
1842 STATIC s32 ixgbe_clock_out_i2c_bit(struct ixgbe_hw *hw, bool data)
1845 u32 i2cctl = IXGBE_READ_REG(hw, IXGBE_I2CCTL);
1847 DEBUGFUNC("ixgbe_clock_out_i2c_bit");
1849 status = ixgbe_set_i2c_data(hw, &i2cctl, data);
1850 if (status == IXGBE_SUCCESS) {
1851 ixgbe_raise_i2c_clk(hw, &i2cctl);
1853 /* Minimum high period of clock is 4us */
1854 usec_delay(IXGBE_I2C_T_HIGH);
1856 ixgbe_lower_i2c_clk(hw, &i2cctl);
1858 /* Minimum low period of clock is 4.7 us.
1859 * This also takes care of the data hold time.
1861 usec_delay(IXGBE_I2C_T_LOW);
1863 status = IXGBE_ERR_I2C;
1864 ERROR_REPORT2(IXGBE_ERROR_INVALID_STATE,
1865 "I2C data was not set to %X\n", data);
1871 * ixgbe_raise_i2c_clk - Raises the I2C SCL clock
1872 * @hw: pointer to hardware structure
1873 * @i2cctl: Current value of I2CCTL register
1875 * Raises the I2C clock line '0'->'1'
1877 STATIC void ixgbe_raise_i2c_clk(struct ixgbe_hw *hw, u32 *i2cctl)
1880 u32 timeout = IXGBE_I2C_CLOCK_STRETCHING_TIMEOUT;
1883 DEBUGFUNC("ixgbe_raise_i2c_clk");
1885 for (i = 0; i < timeout; i++) {
1886 *i2cctl |= IXGBE_I2C_CLK_OUT;
1888 IXGBE_WRITE_REG(hw, IXGBE_I2CCTL, *i2cctl);
1889 IXGBE_WRITE_FLUSH(hw);
1890 /* SCL rise time (1000ns) */
1891 usec_delay(IXGBE_I2C_T_RISE);
1893 i2cctl_r = IXGBE_READ_REG(hw, IXGBE_I2CCTL);
1894 if (i2cctl_r & IXGBE_I2C_CLK_IN)
1900 * ixgbe_lower_i2c_clk - Lowers the I2C SCL clock
1901 * @hw: pointer to hardware structure
1902 * @i2cctl: Current value of I2CCTL register
1904 * Lowers the I2C clock line '1'->'0'
1906 STATIC void ixgbe_lower_i2c_clk(struct ixgbe_hw *hw, u32 *i2cctl)
1909 DEBUGFUNC("ixgbe_lower_i2c_clk");
1911 *i2cctl &= ~IXGBE_I2C_CLK_OUT;
1913 IXGBE_WRITE_REG(hw, IXGBE_I2CCTL, *i2cctl);
1914 IXGBE_WRITE_FLUSH(hw);
1916 /* SCL fall time (300ns) */
1917 usec_delay(IXGBE_I2C_T_FALL);
1921 * ixgbe_set_i2c_data - Sets the I2C data bit
1922 * @hw: pointer to hardware structure
1923 * @i2cctl: Current value of I2CCTL register
1924 * @data: I2C data value (0 or 1) to set
1926 * Sets the I2C data bit
1928 STATIC s32 ixgbe_set_i2c_data(struct ixgbe_hw *hw, u32 *i2cctl, bool data)
1930 s32 status = IXGBE_SUCCESS;
1932 DEBUGFUNC("ixgbe_set_i2c_data");
1935 *i2cctl |= IXGBE_I2C_DATA_OUT;
1937 *i2cctl &= ~IXGBE_I2C_DATA_OUT;
1939 IXGBE_WRITE_REG(hw, IXGBE_I2CCTL, *i2cctl);
1940 IXGBE_WRITE_FLUSH(hw);
1942 /* Data rise/fall (1000ns/300ns) and set-up time (250ns) */
1943 usec_delay(IXGBE_I2C_T_RISE + IXGBE_I2C_T_FALL + IXGBE_I2C_T_SU_DATA);
1945 /* Verify data was set correctly */
1946 *i2cctl = IXGBE_READ_REG(hw, IXGBE_I2CCTL);
1947 if (data != ixgbe_get_i2c_data(i2cctl)) {
1948 status = IXGBE_ERR_I2C;
1949 ERROR_REPORT2(IXGBE_ERROR_INVALID_STATE,
1950 "Error - I2C data was not set to %X.\n",
1958 * ixgbe_get_i2c_data - Reads the I2C SDA data bit
1959 * @hw: pointer to hardware structure
1960 * @i2cctl: Current value of I2CCTL register
1962 * Returns the I2C data bit value
1964 STATIC bool ixgbe_get_i2c_data(u32 *i2cctl)
1968 DEBUGFUNC("ixgbe_get_i2c_data");
1970 if (*i2cctl & IXGBE_I2C_DATA_IN)
1979 * ixgbe_i2c_bus_clear - Clears the I2C bus
1980 * @hw: pointer to hardware structure
1982 * Clears the I2C bus by sending nine clock pulses.
1983 * Used when data line is stuck low.
1985 void ixgbe_i2c_bus_clear(struct ixgbe_hw *hw)
1987 u32 i2cctl = IXGBE_READ_REG(hw, IXGBE_I2CCTL);
1990 DEBUGFUNC("ixgbe_i2c_bus_clear");
1992 ixgbe_i2c_start(hw);
1994 ixgbe_set_i2c_data(hw, &i2cctl, 1);
1996 for (i = 0; i < 9; i++) {
1997 ixgbe_raise_i2c_clk(hw, &i2cctl);
1999 /* Min high period of clock is 4us */
2000 usec_delay(IXGBE_I2C_T_HIGH);
2002 ixgbe_lower_i2c_clk(hw, &i2cctl);
2004 /* Min low period of clock is 4.7us*/
2005 usec_delay(IXGBE_I2C_T_LOW);
2008 ixgbe_i2c_start(hw);
2010 /* Put the i2c bus back to default state */
2015 * ixgbe_tn_check_overtemp - Checks if an overtemp occurred.
2016 * @hw: pointer to hardware structure
2018 * Checks if the LASI temp alarm status was triggered due to overtemp
2020 s32 ixgbe_tn_check_overtemp(struct ixgbe_hw *hw)
2022 s32 status = IXGBE_SUCCESS;
2025 DEBUGFUNC("ixgbe_tn_check_overtemp");
2027 if (hw->device_id != IXGBE_DEV_ID_82599_T3_LOM)
2030 /* Check that the LASI temp alarm status was triggered */
2031 hw->phy.ops.read_reg(hw, IXGBE_TN_LASI_STATUS_REG,
2032 IXGBE_MDIO_PMA_PMD_DEV_TYPE, &phy_data);
2034 if (!(phy_data & IXGBE_TN_LASI_STATUS_TEMP_ALARM))
2037 status = IXGBE_ERR_OVERTEMP;
2038 ERROR_REPORT1(IXGBE_ERROR_CAUTION, "Device over temperature");