ixgbe: add SFP+ driver support
Subsystems (2)
PATCH v2 1/1 ixgbe: add SFP+ driver support
From: Donald Skidmore <[email protected]>
This patch adds support for SFP+ PHY in the following device ID's (10DB, 10F1, 10E1). These SFP+ PHY's are accessed via an I2C interface so the patch also includes functions to support this.
Another feature of note is that the PHY is pluggable and some rearchitecting was needed to support this.
---
drivers/net/ixgbe/ixgbe.h | 5 + drivers/net/ixgbe/ixgbe_82598.c | 160 ++++++++++++++++++++++++ drivers/net/ixgbe/ixgbe_main.c | 94 ++++++++++++++ drivers/net/ixgbe/ixgbe_phy.c | 258 +++++++++++++++++++++++++++++++++++++++ drivers/net/ixgbe/ixgbe_phy.h | 18 +++ drivers/net/ixgbe/ixgbe_type.h | 22 +++ 6 files changed, 550 insertions(+), 7 deletions(-)
drivers/net/ixgbe/ixgbe.h +4 -1
@@ -311,12 +311,15 @@ struct ixgbe_adapter {unsigned long link_check_timeout;struct work_struct watchdog_task; +struct work_struct sfp_task; +struct timer_list sfp_timer; };enum ixbge_state_t { __IXGBE_TESTING, __IXGBE_RESETTING, - __IXGBE_DOWN + __IXGBE_DOWN, + __IXGBE_SFP_MODULE_NOT_FOUND };enum ixgbe_boards {
drivers/net/ixgbe/ixgbe_82598.c +158 -2
234 lines not on this page · raw message
drivers/net/ixgbe/ixgbe_main.c +91 -3
137 lines not on this page · raw message
drivers/net/ixgbe/ixgbe_phy.c +258 -0
270 lines not on this page · raw message
drivers/net/ixgbe/ixgbe_phy.h +18 -0
@@ -63,6 +63,18 @@#define IXGBE_SFF_VENDOR_OUI_FTL 0x00906500#define IXGBE_SFF_VENDOR_OUI_AVAGO 0x00176A00 +/* I2C SDA and SCL timing parameters for standard mode */ +#define IXGBE_I2C_T_HD_STA 4 +#define IXGBE_I2C_T_LOW 5 +#define IXGBE_I2C_T_HIGH 4 +#define IXGBE_I2C_T_SU_STA 5 +#define IXGBE_I2C_T_HD_DATA 5 +#define IXGBE_I2C_T_SU_DATA 1 +#define IXGBE_I2C_T_RISE 1 +#define IXGBE_I2C_T_FALL 1 +#define IXGBE_I2C_T_SU_STO 4 +#define IXGBE_I2C_T_BUF 5 +s32 ixgbe_init_phy_ops_generic (struct ixgbe_hw *hw);s32 ixgbe_identify_phy_generic (struct ixgbe_hw *hw);
@@ -84,4 +96,10 @@ s32 ixgbe_check_phy_link_tnx(struct ixgbe_hw *hw,s32 ixgbe_get_phy_firmware_version_tnx (struct ixgbe_hw *hw,u16 *firmware_version); +s32 ixgbe_reset_phy_nl (struct ixgbe_hw *hw); +s32 ixgbe_identify_sfp_module_generic (struct ixgbe_hw *hw); +s32 ixgbe_get_sfp_init_sequence_offsets (struct ixgbe_hw *hw, +u16 *list_offset, +u16 *data_offset); +#endif /* _IXGBE_PHY_H_ */
drivers/net/ixgbe/ixgbe_type.h +21 -1
@@ -36,9 +36,12 @@/* Device IDs */ #define IXGBE_DEV_ID_82598AF_DUAL_PORT 0x10C6#define IXGBE_DEV_ID_82598AF_SINGLE_PORT 0x10C7 +#define IXGBE_DEV_ID_82598EB_SFP_LOM 0x10DB#define IXGBE_DEV_ID_82598AT 0x10C8#define IXGBE_DEV_ID_82598EB_CX4 0x10DD#define IXGBE_DEV_ID_82598_CX4_DUAL_PORT 0x10EC +#define IXGBE_DEV_ID_82598_DA_DUAL_PORT 0x10F1 +#define IXGBE_DEV_ID_82598_SR_DUAL_PORT_EM 0x10E1#define IXGBE_DEV_ID_82598EB_XF_LR 0x10F4/* General Registers */
@@ -453,6 +456,7 @@#define IXGBE_MDIO_PHY_XS_DEV_TYPE 0x4#define IXGBE_MDIO_AUTO_NEG_DEV_TYPE 0x7#define IXGBE_MDIO_VENDOR_SPECIFIC_1_DEV_TYPE 0x1E/* Device 30 */ +#define IXGBE_TWINAX_DEV 1#define IXGBE_MDIO_COMMAND_TIMEOUT 100/* PHY Timeout for 1 GB mode */
@@ -488,14 +492,27 @@#define IXGBE_PHY_REVISION_MASK 0xFFFFFFF0#define IXGBE_MAX_PHY_ADDR 32 -/* PHY IDs*/ +/* PHY IDs */ #define TN1010_PHY_ID 0x00A19410#define TNX_FW_REV 0xB#define QT2022_PHY_ID 0x0043A400 +#define ATH_PHY_ID 0x03429050/* PHY Types */ #define IXGBE_M88E1145_E_PHY_ID 0x01410CD0 +/* Special PHY Init Routine */ +#define IXGBE_PHY_INIT_OFFSET_NL 0x002B +#define IXGBE_PHY_INIT_END_NL 0xFFFF +#define IXGBE_CONTROL_MASK_NL 0xF000 +#define IXGBE_DATA_MASK_NL 0x0FFF +#define IXGBE_CONTROL_SHIFT_NL 12 +#define IXGBE_DELAY_NL 0 +#define IXGBE_DATA_NL 1 +#define IXGBE_CONTROL_NL 0x000F +#define IXGBE_CONTROL_EOL_NL 0x0FFF +#define IXGBE_CONTROL_SOL_NL 0x0000 +/* General purpose Interrupt Enable */ #define IXGBE_SDP0_GPIEN 0x00000001/* SDP0 */ #define IXGBE_SDP1_GPIEN 0x00000002/* SDP1 */
@@ -1208,6 +1225,7 @@ enum ixgbe_phy_type { ixgbe_phy_tn, ixgbe_phy_qt, ixgbe_phy_xaui, + ixgbe_phy_nl, ixgbe_phy_tw_tyco, ixgbe_phy_tw_unknown, ixgbe_phy_sfp_avago,
@@ -1229,6 +1247,7 @@ enum ixgbe_sfp_type { ixgbe_sfp_type_da_cu =0 , ixgbe_sfp_type_sr =1 , ixgbe_sfp_type_lr =2 , + ixgbe_sfp_type_not_present =0xFFFE , ixgbe_sfp_type_unknown = 0xFFFF };
@@ -1492,6 +1511,7 @@ struct ixgbe_info {#define IXGBE_ERR_PHY_ADDR_INVALID -17#define IXGBE_ERR_I2C -18#define IXGBE_ERR_SFP_NOT_SUPPORTED -19 +#define IXGBE_ERR_SFP_NOT_PRESENT -20#define IXGBE_NOT_IMPLEMENTED 0x7FFFFFFF#endif /* _IXGBE_TYPE_H_ */
From: Jeff Kirsher <[email protected]>
Date: Thu, 20 Nov 2008 18:03:21 -0800
Quoted 10 lines
This patch adds support for SFP+ PHY in the following device ID's (10DB, 10F1, 10E1). These SFP+ PHY's are accessed via an I2C interface so the patch also includes functions to support this.
Another feature of note is that the PHY is pluggable and some rearchitecting was needed to support this.
Signed-off-by Donald Skidmore <[email protected]>Signed-off-by Peter P Waskiewicz Jr <[email protected]>Signed-off-by Jeff Kirsher <[email protected]>
Applied.