@@ -3968,8 +3968,9 @@ static int qed_hw_get_resc(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt)
39683968
39693969static int qed_hw_get_nvm_info (struct qed_hwfn * p_hwfn , struct qed_ptt * p_ptt )
39703970{
3971- u32 port_cfg_addr , link_temp , nvm_cfg_addr , device_capabilities , fc ;
3971+ u32 port_cfg_addr , link_temp , nvm_cfg_addr , device_capabilities , fld ;
39723972 u32 nvm_cfg1_offset , mf_mode , addr , generic_cont0 , core_cfg ;
3973+ struct qed_mcp_link_speed_params * ext_speed ;
39733974 struct qed_mcp_link_capabilities * p_caps ;
39743975 struct qed_mcp_link_params * link ;
39753976
@@ -4026,8 +4027,7 @@ static int qed_hw_get_nvm_info(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt)
40264027 link_temp &= NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_MASK ;
40274028 link -> speed .advertised_speeds = link_temp ;
40284029
4029- link_temp = link -> speed .advertised_speeds ;
4030- p_hwfn -> mcp_info -> link_capabilities .speed_capabilities = link_temp ;
4030+ p_caps -> speed_capabilities = link -> speed .advertised_speeds ;
40314031
40324032 link_temp = qed_rd (p_hwfn , p_ptt ,
40334033 port_cfg_addr +
@@ -4062,13 +4062,12 @@ static int qed_hw_get_nvm_info(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt)
40624062 DP_NOTICE (p_hwfn , "Unknown Speed in 0x%08x\n" , link_temp );
40634063 }
40644064
4065- p_hwfn -> mcp_info -> link_capabilities .default_speed_autoneg =
4066- link -> speed .autoneg ;
4065+ p_caps -> default_speed_autoneg = link -> speed .autoneg ;
40674066
4068- fc = GET_MFW_FIELD (link_temp , NVM_CFG1_PORT_DRV_FLOW_CONTROL );
4069- link -> pause .autoneg = !!(fc & NVM_CFG1_PORT_DRV_FLOW_CONTROL_AUTONEG );
4070- link -> pause .forced_rx = !!(fc & NVM_CFG1_PORT_DRV_FLOW_CONTROL_RX );
4071- link -> pause .forced_tx = !!(fc & NVM_CFG1_PORT_DRV_FLOW_CONTROL_TX );
4067+ fld = GET_MFW_FIELD (link_temp , NVM_CFG1_PORT_DRV_FLOW_CONTROL );
4068+ link -> pause .autoneg = !!(fld & NVM_CFG1_PORT_DRV_FLOW_CONTROL_AUTONEG );
4069+ link -> pause .forced_rx = !!(fld & NVM_CFG1_PORT_DRV_FLOW_CONTROL_RX );
4070+ link -> pause .forced_tx = !!(fld & NVM_CFG1_PORT_DRV_FLOW_CONTROL_TX );
40724071 link -> loopback_mode = 0 ;
40734072
40744073 if (p_hwfn -> mcp_info -> capabilities &
@@ -4128,6 +4127,91 @@ static int qed_hw_get_nvm_info(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt)
41284127 p_caps -> default_eee = QED_MCP_EEE_UNSUPPORTED ;
41294128 }
41304129
4130+ if (p_hwfn -> mcp_info -> capabilities &
4131+ FW_MB_PARAM_FEATURE_SUPPORT_EXT_SPEED_FEC_CONTROL ) {
4132+ ext_speed = & link -> ext_speed ;
4133+
4134+ link_temp = qed_rd (p_hwfn , p_ptt ,
4135+ port_cfg_addr +
4136+ offsetof(struct nvm_cfg1_port ,
4137+ extended_speed ));
4138+
4139+ fld = GET_MFW_FIELD (link_temp , NVM_CFG1_PORT_EXTENDED_SPEED );
4140+ if (fld & NVM_CFG1_PORT_EXTENDED_SPEED_EXTND_SPD_AN )
4141+ ext_speed -> autoneg = true;
4142+
4143+ ext_speed -> forced_speed = 0 ;
4144+ if (fld & NVM_CFG1_PORT_EXTENDED_SPEED_EXTND_SPD_1G )
4145+ ext_speed -> forced_speed |= QED_EXT_SPEED_1G ;
4146+ if (fld & NVM_CFG1_PORT_EXTENDED_SPEED_EXTND_SPD_10G )
4147+ ext_speed -> forced_speed |= QED_EXT_SPEED_10G ;
4148+ if (fld & NVM_CFG1_PORT_EXTENDED_SPEED_EXTND_SPD_20G )
4149+ ext_speed -> forced_speed |= QED_EXT_SPEED_20G ;
4150+ if (fld & NVM_CFG1_PORT_EXTENDED_SPEED_EXTND_SPD_25G )
4151+ ext_speed -> forced_speed |= QED_EXT_SPEED_25G ;
4152+ if (fld & NVM_CFG1_PORT_EXTENDED_SPEED_EXTND_SPD_40G )
4153+ ext_speed -> forced_speed |= QED_EXT_SPEED_40G ;
4154+ if (fld & NVM_CFG1_PORT_EXTENDED_SPEED_EXTND_SPD_50G_R )
4155+ ext_speed -> forced_speed |= QED_EXT_SPEED_50G_R ;
4156+ if (fld & NVM_CFG1_PORT_EXTENDED_SPEED_EXTND_SPD_50G_R2 )
4157+ ext_speed -> forced_speed |= QED_EXT_SPEED_50G_R2 ;
4158+ if (fld & NVM_CFG1_PORT_EXTENDED_SPEED_EXTND_SPD_100G_R2 )
4159+ ext_speed -> forced_speed |= QED_EXT_SPEED_100G_R2 ;
4160+ if (fld & NVM_CFG1_PORT_EXTENDED_SPEED_EXTND_SPD_100G_R4 )
4161+ ext_speed -> forced_speed |= QED_EXT_SPEED_100G_R4 ;
4162+ if (fld & NVM_CFG1_PORT_EXTENDED_SPEED_EXTND_SPD_100G_P4 )
4163+ ext_speed -> forced_speed |= QED_EXT_SPEED_100G_P4 ;
4164+
4165+ fld = GET_MFW_FIELD (link_temp ,
4166+ NVM_CFG1_PORT_EXTENDED_SPEED_CAP );
4167+
4168+ ext_speed -> advertised_speeds = 0 ;
4169+ if (fld & NVM_CFG1_PORT_EXTENDED_SPEED_CAP_EXTND_SPD_RESERVED )
4170+ ext_speed -> advertised_speeds |= QED_EXT_SPEED_MASK_RES ;
4171+ if (fld & NVM_CFG1_PORT_EXTENDED_SPEED_CAP_EXTND_SPD_1G )
4172+ ext_speed -> advertised_speeds |= QED_EXT_SPEED_MASK_1G ;
4173+ if (fld & NVM_CFG1_PORT_EXTENDED_SPEED_CAP_EXTND_SPD_10G )
4174+ ext_speed -> advertised_speeds |= QED_EXT_SPEED_MASK_10G ;
4175+ if (fld & NVM_CFG1_PORT_EXTENDED_SPEED_CAP_EXTND_SPD_20G )
4176+ ext_speed -> advertised_speeds |= QED_EXT_SPEED_MASK_20G ;
4177+ if (fld & NVM_CFG1_PORT_EXTENDED_SPEED_CAP_EXTND_SPD_25G )
4178+ ext_speed -> advertised_speeds |= QED_EXT_SPEED_MASK_25G ;
4179+ if (fld & NVM_CFG1_PORT_EXTENDED_SPEED_CAP_EXTND_SPD_40G )
4180+ ext_speed -> advertised_speeds |= QED_EXT_SPEED_MASK_40G ;
4181+ if (fld & NVM_CFG1_PORT_EXTENDED_SPEED_CAP_EXTND_SPD_50G_R )
4182+ ext_speed -> advertised_speeds |=
4183+ QED_EXT_SPEED_MASK_50G_R ;
4184+ if (fld & NVM_CFG1_PORT_EXTENDED_SPEED_CAP_EXTND_SPD_50G_R2 )
4185+ ext_speed -> advertised_speeds |=
4186+ QED_EXT_SPEED_MASK_50G_R2 ;
4187+ if (fld & NVM_CFG1_PORT_EXTENDED_SPEED_CAP_EXTND_SPD_100G_R2 )
4188+ ext_speed -> advertised_speeds |=
4189+ QED_EXT_SPEED_MASK_100G_R2 ;
4190+ if (fld & NVM_CFG1_PORT_EXTENDED_SPEED_CAP_EXTND_SPD_100G_R4 )
4191+ ext_speed -> advertised_speeds |=
4192+ QED_EXT_SPEED_MASK_100G_R4 ;
4193+ if (fld & NVM_CFG1_PORT_EXTENDED_SPEED_CAP_EXTND_SPD_100G_P4 )
4194+ ext_speed -> advertised_speeds |=
4195+ QED_EXT_SPEED_MASK_100G_P4 ;
4196+
4197+ link_temp = qed_rd (p_hwfn , p_ptt ,
4198+ port_cfg_addr +
4199+ offsetof(struct nvm_cfg1_port ,
4200+ extended_fec_mode ));
4201+ link -> ext_fec_mode = link_temp ;
4202+
4203+ p_caps -> default_ext_speed_caps = ext_speed -> advertised_speeds ;
4204+ p_caps -> default_ext_speed = ext_speed -> forced_speed ;
4205+ p_caps -> default_ext_autoneg = ext_speed -> autoneg ;
4206+ p_caps -> default_ext_fec = link -> ext_fec_mode ;
4207+
4208+ DP_VERBOSE (p_hwfn , NETIF_MSG_LINK ,
4209+ "Read default extended link config: Speed 0x%08x, Adv. Speed 0x%08x, AN: 0x%02x, FEC: 0x%02x\n" ,
4210+ ext_speed -> forced_speed ,
4211+ ext_speed -> advertised_speeds , ext_speed -> autoneg ,
4212+ p_caps -> default_ext_fec );
4213+ }
4214+
41314215 DP_VERBOSE (p_hwfn , NETIF_MSG_LINK ,
41324216 "Read default link: Speed 0x%08x, Adv. Speed 0x%08x, AN: 0x%02x, PAUSE AN: 0x%02x, EEE: 0x%02x [0x%08x usec], FEC: 0x%02x\n" ,
41334217 link -> speed .forced_speed , link -> speed .advertised_speeds ,
0 commit comments