ixgbe: remove SFP ixfi support
Subsystems (2)
PATCH 1/2 ixgbe: remove SFP ixfi support
Remove SFP ixfi code since there is no HW that currently supports it.
--- drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c | 76 ++++--------------------- 1 file changed, 11 insertions(+), 65 deletions(-)
drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c +11 -65
@@ -1351,7 +1351,7 @@ ixgbe_setup_mac_link_sfp_x550em(struct ixgbe_hw *hw, __always_unused bool autoneg_wait_to_complete) {s32 status; -u16 slice, value; +u16 reg_slice, reg_val;bool setup_linear = false;/* Check if SFP module is supported and linear */
@@ -1367,71 +1367,17 @@ ixgbe_setup_mac_link_sfp_x550em(struct ixgbe_hw *hw,if (status)return status; -if (!(hw->phy.nw_mng_if_sel &IXGBE_NW_MNG_IF_SEL_INT_PHY_MODE )) { -/* Configure CS4227 LINE side to 10G SR. */ - slice =IXGBE_CS4227_LINE_SPARE22_MSB + (hw->bus.lan_id <<12 ); - value =IXGBE_CS4227_SPEED_10G ; - status =ixgbe_write_i2c_combined_generic (hw,IXGBE_CS4227 , - slice, value); -if (status) - goto i2c_err; - - slice =IXGBE_CS4227_LINE_SPARE24_LSB + (hw->bus.lan_id <<12 ); - value = (IXGBE_CS4227_EDC_MODE_SR <<1 ) |1 ; - status =ixgbe_write_i2c_combined_generic (hw,IXGBE_CS4227 , - slice, value); -if (status) - goto i2c_err; - -/* Configure CS4227 for HOST connection rate then type. */ - slice =IXGBE_CS4227_HOST_SPARE22_MSB + (hw->bus.lan_id <<12 ); - value = speed &IXGBE_LINK_SPEED_10GB_FULL ? -IXGBE_CS4227_SPEED_10G :IXGBE_CS4227_SPEED_1G ; - status =ixgbe_write_i2c_combined_generic (hw,IXGBE_CS4227 , - slice, value); -if (status) - goto i2c_err; - - slice =IXGBE_CS4227_HOST_SPARE24_LSB + (hw->bus.lan_id <<12 ); -if (setup_linear) - value = (IXGBE_CS4227_EDC_MODE_CX1 <<1 ) |1 ; -else - value = (IXGBE_CS4227_EDC_MODE_SR <<1 ) |1 ; - status =ixgbe_write_i2c_combined_generic (hw,IXGBE_CS4227 , - slice, value); -if (status) - goto i2c_err; - -/* Setup XFI internal link. */ - status =ixgbe_setup_ixfi_x550em (hw, &speed); -if (status) { -hw_dbg (hw,"setup_ixfi failed with %d\n" , status); -return status; - } - }else { -/* Configure internal PHY for KR/KX. */ - status =ixgbe_setup_kr_speed_x550em (hw, speed); -if (status) { -hw_dbg (hw,"setup_kr_speed failed with %d\n" , status); -return status; - } - -/* Configure CS4227 LINE side to proper mode. */ - slice =IXGBE_CS4227_LINE_SPARE24_LSB + (hw->bus.lan_id <<12 ); -if (setup_linear) - value = (IXGBE_CS4227_EDC_MODE_CX1 <<1 ) |1 ; -else - value = (IXGBE_CS4227_EDC_MODE_SR <<1 ) |1 ; - status =ixgbe_write_i2c_combined_generic (hw,IXGBE_CS4227 , - slice, value); -if (status) - goto i2c_err; - } - -return 0 ; +/* Configure internal PHY for KR/KX. */ +ixgbe_setup_kr_speed_x550em (hw, speed); -i2c_err: -hw_dbg (hw,"combined i2c access failed with %d\n" , status); +/* Configure CS4227 LINE side to proper mode. */ + reg_slice =IXGBE_CS4227_LINE_SPARE24_LSB + (hw->bus.lan_id <<12 ); +if (setup_linear) + reg_val = (IXGBE_CS4227_EDC_MODE_CX1 <<1 ) |0x1 ; +else + reg_val = (IXGBE_CS4227_EDC_MODE_SR <<1 ) |0x1 ; + status =ixgbe_write_i2c_combined_generic (hw,IXGBE_CS4227 , + reg_slice, reg_val);return status; }
PATCH 2/2 ixgbe: use link instead of I2C combined abstraction
Introduce ixgbe_link_operations struct with the following changes:
read_i2c_combined => read_link
read_i2c_combined_unlocked => read_link_unlocked
write_i2c_combined => write_link
write_i2c_combined_unlocked => write_link_unlocked
This will allow X550EM_a to override these methods for MDIO access while X550EM_x provides methods to use I2C combined access. This also adds a new structure, ixgbe_link_info, to hold information about the link. Initially this is just method pointers and a bus address.
The functions involved in combined I2C accesses were moved from ixgbe_phy.c to ixgbe_x550.c. The underlying functions that carry out the combined I2C accesses were left in ixgbe_phy.c because they share some functions with other I2C methods.
--- drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c | 68 +--------------- drivers/net/ethernet/intel/ixgbe/ixgbe_phy.h | 12 +-- drivers/net/ethernet/intel/ixgbe/ixgbe_type.h | 26 +++++- drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c | 106 ++++++++++++++++++++++--- 4 files changed, 122 insertions(+), 90 deletions(-)
drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c +4 -64
@@ -109,8 +109,8 @@ static u8 ixgbe_ones_comp_byte_add(u8 add1, u8 add2)* * Returns an error code on error. */ -static s32 ixgbe_read_i2c_combined_generic_int (struct ixgbe_hw *hw,u8 addr, -u16 reg,u16 *val,bool lock) +s32 ixgbe_read_i2c_combined_generic_int (struct ixgbe_hw *hw,u8 addr, +u16 reg,u16 *val,bool lock) {u32 swfw_mask = hw->phy.phy_semaphore_mask;int max_retry =10 ;
@@ -178,36 +178,6 @@ fail: }/** -* ixgbe_read_i2c_combined_generic - Perform I2C read combined operation -* @hw: pointer to the hardware structure -* @addr: I2C bus address to read from -* @reg: I2C device register to read from -* @val: pointer to location to receive read value -* -* Returns an error code on error. -*/ -s32 ixgbe_read_i2c_combined_generic (struct ixgbe_hw *hw,u8 addr, -u16 reg,u16 *val) -{ -return ixgbe_read_i2c_combined_generic_int (hw, addr, reg, val, true); -} - -/** -* ixgbe_read_i2c_combined_generic_unlocked - Unlocked I2C read combined -* @hw: pointer to the hardware structure -* @addr: I2C bus address to read from -* @reg: I2C device register to read from -* @val: pointer to location to receive read value -* -* Returns an error code on error. -*/ -s32 ixgbe_read_i2c_combined_generic_unlocked (struct ixgbe_hw *hw,u8 addr, -u16 reg,u16 *val) -{ -return ixgbe_read_i2c_combined_generic_int (hw, addr, reg, val, false); -} - -/** * ixgbe_write_i2c_combined_generic_int - Perform I2C write combined operation * @hw: pointer to the hardware structure * @addr: I2C bus address to write to
@@ -217,8 +187,8 @@ s32 ixgbe_read_i2c_combined_generic_unlocked(struct ixgbe_hw *hw, u8 addr,* * Returns an error code on error. */ -static s32 ixgbe_write_i2c_combined_generic_int (struct ixgbe_hw *hw,u8 addr, -u16 reg,u16 val,bool lock) +s32 ixgbe_write_i2c_combined_generic_int (struct ixgbe_hw *hw,u8 addr, +u16 reg,u16 val,bool lock) {u32 swfw_mask = hw->phy.phy_semaphore_mask;int max_retry =1 ;
@@ -273,36 +243,6 @@ fail: }/** -* ixgbe_write_i2c_combined_generic - Perform I2C write combined operation -* @hw: pointer to the hardware structure -* @addr: I2C bus address to write to -* @reg: I2C device register to write to -* @val: value to write -* -* Returns an error code on error. -*/ -s32 ixgbe_write_i2c_combined_generic (struct ixgbe_hw *hw, -u8 addr,u16 reg,u16 val) -{ -return ixgbe_write_i2c_combined_generic_int (hw, addr, reg, val, true); -} - -/** -* ixgbe_write_i2c_combined_generic_unlocked - Unlocked I2C write combined -* @hw: pointer to the hardware structure -* @addr: I2C bus address to write to -* @reg: I2C device register to write to -* @val: value to write -* -* Returns an error code on error. -*/ -s32 ixgbe_write_i2c_combined_generic_unlocked (struct ixgbe_hw *hw, -u8 addr,u16 reg,u16 val) -{ -return ixgbe_write_i2c_combined_generic_int (hw, addr, reg, val, false); -} - -/** * ixgbe_identify_phy_generic - Get physical layer module * @hw: pointer to hardware structure *
drivers/net/ethernet/intel/ixgbe/ixgbe_phy.h +4 -8
@@ -195,12 +195,8 @@ s32 ixgbe_read_i2c_sff8472_generic(struct ixgbe_hw *hw, u8 byte_offset, u8 *sff8472_data);s32 ixgbe_write_i2c_eeprom_generic (struct ixgbe_hw *hw,u8 byte_offset,u8 eeprom_data); -s32 ixgbe_read_i2c_combined_generic (struct ixgbe_hw *hw,u8 addr, -u16 reg,u16 *val); -s32 ixgbe_read_i2c_combined_generic_unlocked (struct ixgbe_hw *hw,u8 addr, -u16 reg,u16 *val); -s32 ixgbe_write_i2c_combined_generic (struct ixgbe_hw *hw,u8 addr, -u16 reg,u16 val); -s32 ixgbe_write_i2c_combined_generic_unlocked (struct ixgbe_hw *hw,u8 addr, -u16 reg,u16 val); +s32 ixgbe_read_i2c_combined_generic_int (struct ixgbe_hw *,u8 addr,u16 reg, +u16 *val,bool lock); +s32 ixgbe_write_i2c_combined_generic_int (struct ixgbe_hw *,u8 addr,u16 reg, +u16 val,bool lock);#endif /* _IXGBE_PHY_H_ */
drivers/net/ethernet/intel/ixgbe/ixgbe_type.h +20 -6
@@ -3395,16 +3395,28 @@ struct ixgbe_phy_operations {s32 (*read_i2c_sff8472)(struct ixgbe_hw *,u8 ,u8 *);s32 (*read_i2c_eeprom)(struct ixgbe_hw *,u8 ,u8 *);s32 (*write_i2c_eeprom)(struct ixgbe_hw *,u8 ,u8 ); -s32 (*read_i2c_combined)(struct ixgbe_hw *,u8 addr,u16 reg,u16 *val); -s32 (*write_i2c_combined)(struct ixgbe_hw *,u8 addr,u16 reg,u16 val);s32 (*check_overtemp)(struct ixgbe_hw *);s32 (*set_phy_power)(struct ixgbe_hw *,bool on);s32 (*enter_lplu)(struct ixgbe_hw *);s32 (*handle_lasi)(struct ixgbe_hw *hw); -s32 (*read_i2c_combined_unlocked)(struct ixgbe_hw *,u8 addr,u16 reg, -u16 *value); -s32 (*write_i2c_combined_unlocked)(struct ixgbe_hw *,u8 addr,u16 reg, -u16 value); +s32 (*read_i2c_byte_unlocked)(struct ixgbe_hw *,u8 offset,u8 addr, +u8 *value); +s32 (*write_i2c_byte_unlocked)(struct ixgbe_hw *,u8 offset,u8 addr, +u8 value); +}; + +struct ixgbe_link_operations { +s32 (*read_link)(struct ixgbe_hw *,u8 addr,u16 reg,u16 *val); +s32 (*read_link_unlocked)(struct ixgbe_hw *,u8 addr,u16 reg, +u16 *val); +s32 (*write_link)(struct ixgbe_hw *,u8 addr,u16 reg,u16 val); +s32 (*write_link_unlocked)(struct ixgbe_hw *,u8 addr,u16 reg, +u16 val); +}; + +struct ixgbe_link_info { +struct ixgbe_link_operations ops; +u8 addr; };struct ixgbe_eeprom_info {
@@ -3508,6 +3520,7 @@ struct ixgbe_hw {struct ixgbe_addr_filter_info addr_ctrl;struct ixgbe_fc_info fc;struct ixgbe_phy_info phy; +struct ixgbe_link_info link;struct ixgbe_eeprom_info eeprom;struct ixgbe_bus_info bus;struct ixgbe_mbx_info mbx;
@@ -3531,6 +3544,7 @@ struct ixgbe_info {const struct ixgbe_eeprom_operations *eeprom_ops;const struct ixgbe_phy_operations *phy_ops;const struct ixgbe_mbx_operations *mbx_ops; +const struct ixgbe_link_operations *link_ops;const u32 *mvals; };
drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c +94 -12
158 lines not on this page · raw message
Singh
PATCH 1/2 ixgbe: remove SFP ixfi support
In reply to Emil Tantilov-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Emil Tantilov
Sent: Monday, October 3, 2016 5:10 PM
To: [email protected]
Subject: [Intel-wired-lan] [PATCH 1/2] ixgbe: remove SFP ixfi support
Remove SFP ixfi code since there is no HW that currently supports it.
---