7272
7373#include "iwl-trans.h"
7474#include "iwl-drv.h"
75+ #include "iwl-prph.h"
7576#include "internal.h"
7677
7778#define IWL_PCI_DEVICE (dev , subdev , cfg ) \
@@ -1017,29 +1018,70 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
10171018 else if (cfg == & iwl7265_n_cfg )
10181019 cfg_7265d = & iwl7265d_n_cfg ;
10191020 if (cfg_7265d &&
1020- (iwl_trans -> hw_rev & CSR_HW_REV_TYPE_MSK ) == CSR_HW_REV_TYPE_7265D ) {
1021+ (iwl_trans -> hw_rev & CSR_HW_REV_TYPE_MSK ) == CSR_HW_REV_TYPE_7265D )
10211022 cfg = cfg_7265d ;
1022- iwl_trans -> cfg = cfg_7265d ;
1023- }
10241023
1025- if (iwl_trans -> cfg -> trans .rf_id && cfg == & iwl22000_2ac_cfg_hr_cdb &&
1026- iwl_trans -> hw_rev != CSR_HW_REV_TYPE_HR_CDB ) {
1027- u32 rf_id_chp = CSR_HW_RF_ID_TYPE_CHIP_ID (iwl_trans -> hw_rf_id );
1028- u32 jf_chp_id = CSR_HW_RF_ID_TYPE_CHIP_ID (CSR_HW_RF_ID_TYPE_JF );
1029- u32 hr_chp_id = CSR_HW_RF_ID_TYPE_CHIP_ID (CSR_HW_RF_ID_TYPE_HR );
1030-
1031- if (rf_id_chp == jf_chp_id ) {
1032- if (iwl_trans -> hw_rev == CSR_HW_REV_TYPE_QNJ )
1033- cfg = & iwl9560_2ac_cfg_qnj_jf_b0 ;
1034- else
1035- cfg = & iwl22000_2ac_cfg_jf ;
1036- } else if (rf_id_chp == hr_chp_id ) {
1037- if (iwl_trans -> hw_rev == CSR_HW_REV_TYPE_QNJ )
1038- cfg = & iwl22000_2ax_cfg_qnj_hr_a0 ;
1039- else
1040- cfg = & iwl22000_2ac_cfg_hr ;
1024+ iwl_trans -> hw_rf_id = iwl_read32 (iwl_trans , CSR_HW_RF_ID );
1025+
1026+ if (cfg == & iwlax210_2ax_cfg_so_hr_a0 ) {
1027+ if (iwl_trans -> hw_rev == CSR_HW_REV_TYPE_TY ) {
1028+ cfg = & iwlax210_2ax_cfg_ty_gf_a0 ;
1029+ } else if (CSR_HW_RF_ID_TYPE_CHIP_ID (iwl_trans -> hw_rf_id ) ==
1030+ CSR_HW_RF_ID_TYPE_CHIP_ID (CSR_HW_RF_ID_TYPE_JF )) {
1031+ cfg = & iwlax210_2ax_cfg_so_jf_a0 ;
1032+ } else if (CSR_HW_RF_ID_TYPE_CHIP_ID (iwl_trans -> hw_rf_id ) ==
1033+ CSR_HW_RF_ID_TYPE_CHIP_ID (CSR_HW_RF_ID_TYPE_GF )) {
1034+ cfg = & iwlax211_2ax_cfg_so_gf_a0 ;
1035+ } else if (CSR_HW_RF_ID_TYPE_CHIP_ID (iwl_trans -> hw_rf_id ) ==
1036+ CSR_HW_RF_ID_TYPE_CHIP_ID (CSR_HW_RF_ID_TYPE_GF4 )) {
1037+ cfg = & iwlax411_2ax_cfg_so_gf4_a0 ;
1038+ }
1039+ } else if (cfg == & iwl_ax101_cfg_qu_hr ) {
1040+ if ((CSR_HW_RF_ID_TYPE_CHIP_ID (iwl_trans -> hw_rf_id ) ==
1041+ CSR_HW_RF_ID_TYPE_CHIP_ID (CSR_HW_RF_ID_TYPE_HR ) &&
1042+ iwl_trans -> hw_rev == CSR_HW_REV_TYPE_QNJ_B0 ) ||
1043+ (CSR_HW_RF_ID_TYPE_CHIP_ID (iwl_trans -> hw_rf_id ) ==
1044+ CSR_HW_RF_ID_TYPE_CHIP_ID (CSR_HW_RF_ID_TYPE_HR1 ))) {
1045+ cfg = & iwl22000_2ax_cfg_qnj_hr_b0 ;
1046+ } else if (CSR_HW_RF_ID_TYPE_CHIP_ID (iwl_trans -> hw_rf_id ) ==
1047+ CSR_HW_RF_ID_TYPE_CHIP_ID (CSR_HW_RF_ID_TYPE_HR )) {
1048+ cfg = & iwl_ax101_cfg_qu_hr ;
1049+ } else if (CSR_HW_RF_ID_TYPE_CHIP_ID (iwl_trans -> hw_rf_id ) ==
1050+ CSR_HW_RF_ID_TYPE_CHIP_ID (CSR_HW_RF_ID_TYPE_JF )) {
1051+ cfg = & iwl22000_2ax_cfg_jf ;
1052+ } else if (CSR_HW_RF_ID_TYPE_CHIP_ID (iwl_trans -> hw_rf_id ) ==
1053+ CSR_HW_RF_ID_TYPE_CHIP_ID (CSR_HW_RF_ID_TYPE_HRCDB )) {
1054+ IWL_ERR (iwl_trans , "RF ID HRCDB is not supported\n" );
1055+ return - EINVAL ;
1056+ } else {
1057+ IWL_ERR (iwl_trans , "Unrecognized RF ID 0x%08x\n" ,
1058+ CSR_HW_RF_ID_TYPE_CHIP_ID (iwl_trans -> hw_rf_id ));
1059+ return - EINVAL ;
1060+ }
1061+ } else if (CSR_HW_RF_ID_TYPE_CHIP_ID (iwl_trans -> hw_rf_id ) ==
1062+ CSR_HW_RF_ID_TYPE_CHIP_ID (CSR_HW_RF_ID_TYPE_HR ) &&
1063+ ((cfg != & iwl_ax200_cfg_cc &&
1064+ cfg != & killer1650x_2ax_cfg &&
1065+ cfg != & killer1650w_2ax_cfg &&
1066+ cfg != & iwl_ax201_cfg_quz_hr ) ||
1067+ iwl_trans -> hw_rev == CSR_HW_REV_TYPE_QNJ_B0 )) {
1068+ u32 hw_status ;
1069+
1070+ hw_status = iwl_read_prph (iwl_trans , UMAG_GEN_HW_STATUS );
1071+ if (CSR_HW_RF_STEP (iwl_trans -> hw_rf_id ) == SILICON_B_STEP )
1072+ /*
1073+ * b step fw is the same for physical card and fpga
1074+ */
1075+ cfg = & iwl22000_2ax_cfg_qnj_hr_b0 ;
1076+ else if ((hw_status & UMAG_GEN_HW_IS_FPGA ) &&
1077+ CSR_HW_RF_STEP (iwl_trans -> hw_rf_id ) == SILICON_A_STEP ) {
1078+ cfg = & iwl22000_2ax_cfg_qnj_hr_a0_f0 ;
1079+ } else {
1080+ /*
1081+ * a step no FPGA
1082+ */
1083+ cfg = & iwl22000_2ac_cfg_hr ;
10411084 }
1042- iwl_trans -> cfg = cfg ;
10431085 }
10441086
10451087 /*
@@ -1049,22 +1091,18 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
10491091 * thing to do to support Qu C-step.
10501092 */
10511093 if (iwl_trans -> hw_rev == CSR_HW_REV_TYPE_QU_C0 ) {
1052- if (iwl_trans -> cfg == & iwl_ax101_cfg_qu_hr )
1053- iwl_trans -> cfg = & iwl_ax101_cfg_qu_c0_hr_b0 ;
1054- else if (iwl_trans -> cfg == & iwl_ax201_cfg_qu_hr )
1055- iwl_trans -> cfg = & iwl_ax201_cfg_qu_c0_hr_b0 ;
1056- else if (iwl_trans -> cfg == & iwl9461_2ac_cfg_qu_b0_jf_b0 )
1057- iwl_trans -> cfg = & iwl9461_2ac_cfg_qu_c0_jf_b0 ;
1058- else if (iwl_trans -> cfg == & iwl9462_2ac_cfg_qu_b0_jf_b0 )
1059- iwl_trans -> cfg = & iwl9462_2ac_cfg_qu_c0_jf_b0 ;
1060- else if (iwl_trans -> cfg == & iwl9560_2ac_cfg_qu_b0_jf_b0 )
1061- iwl_trans -> cfg = & iwl9560_2ac_cfg_qu_c0_jf_b0 ;
1062- else if (iwl_trans -> cfg == & iwl9560_2ac_160_cfg_qu_b0_jf_b0 )
1063- iwl_trans -> cfg = & iwl9560_2ac_160_cfg_qu_c0_jf_b0 ;
1064- else if (iwl_trans -> cfg == & killer1650s_2ax_cfg_qu_b0_hr_b0 )
1065- iwl_trans -> cfg = & killer1650s_2ax_cfg_qu_c0_hr_b0 ;
1066- else if (iwl_trans -> cfg == & killer1650i_2ax_cfg_qu_b0_hr_b0 )
1067- iwl_trans -> cfg = & killer1650i_2ax_cfg_qu_c0_hr_b0 ;
1094+ if (cfg == & iwl_ax101_cfg_qu_hr )
1095+ cfg = & iwl_ax101_cfg_qu_c0_hr_b0 ;
1096+ else if (cfg == & iwl_ax201_cfg_qu_hr )
1097+ cfg = & iwl_ax201_cfg_qu_c0_hr_b0 ;
1098+ else if (cfg == & iwl9461_2ac_cfg_qu_b0_jf_b0 )
1099+ cfg = & iwl9461_2ac_cfg_qu_c0_jf_b0 ;
1100+ else if (cfg == & iwl9462_2ac_cfg_qu_b0_jf_b0 )
1101+ cfg = & iwl9462_2ac_cfg_qu_c0_jf_b0 ;
1102+ else if (cfg == & iwl9560_2ac_cfg_qu_b0_jf_b0 )
1103+ cfg = & iwl9560_2ac_cfg_qu_c0_jf_b0 ;
1104+ else if (cfg == & iwl9560_2ac_160_cfg_qu_b0_jf_b0 )
1105+ cfg = & iwl9560_2ac_160_cfg_qu_c0_jf_b0 ;
10681106 }
10691107
10701108 /* same thing for QuZ... */
@@ -1084,6 +1122,8 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
10841122 }
10851123
10861124#endif
1125+ /* now set the real cfg we decided to use */
1126+ iwl_trans -> cfg = cfg ;
10871127
10881128 pci_set_drvdata (pdev , iwl_trans );
10891129 iwl_trans -> drv = iwl_drv_start (iwl_trans );
0 commit comments