Lines Matching refs:pi
25 #define READ_RADIO_REG2(pi, radio_type, jspace, core, reg_name) \ argument
26 read_radio_reg(pi, radio_type##_##jspace##_##reg_name | \
31 #define WRITE_RADIO_REG2(pi, radio_type, jspace, core, reg_name, value) \ argument
32 write_radio_reg(pi, radio_type##_##jspace##_##reg_name | \
37 #define WRITE_RADIO_SYN(pi, radio_type, reg_name, value) \ argument
38 write_radio_reg(pi, radio_type##_##SYN##_##reg_name, value)
40 #define READ_RADIO_REG3(pi, radio_type, jspace, core, reg_name) \ argument
41 read_radio_reg(pi, ((core == PHY_CORE_0) ? \
45 #define WRITE_RADIO_REG3(pi, radio_type, jspace, core, reg_name, value) \ argument
46 write_radio_reg(pi, ((core == PHY_CORE_0) ? \
51 #define READ_RADIO_REG4(pi, radio_type, jspace, core, reg_name) \ argument
52 read_radio_reg(pi, ((core == PHY_CORE_0) ? \
56 #define WRITE_RADIO_REG4(pi, radio_type, jspace, core, reg_name, value) \ argument
57 write_radio_reg(pi, ((core == PHY_CORE_0) ? \
97 #define NPHY_IS_SROM_REINTERPRET NREV_GE(pi->pubpi.phy_rev, 5)
256 #define wlc_phy_get_papd_nphy(pi) \ argument
257 (read_phy_reg((pi), 0x1e7) & \
14113 struct brcms_phy *pi = container_of(pih, struct brcms_phy, pubpi_ro); in wlc_phy_bist_check_phy() local
14116 if (NREV_GE(pi->pubpi.phy_rev, 16)) in wlc_phy_bist_check_phy()
14119 phybist0 = read_phy_reg(pi, 0x0e); in wlc_phy_bist_check_phy()
14120 phybist1 = read_phy_reg(pi, 0x0f); in wlc_phy_bist_check_phy()
14121 phybist2 = read_phy_reg(pi, 0xea); in wlc_phy_bist_check_phy()
14122 phybist3 = read_phy_reg(pi, 0xeb); in wlc_phy_bist_check_phy()
14123 phybist4 = read_phy_reg(pi, 0x156); in wlc_phy_bist_check_phy()
14132 static void wlc_phy_bphy_init_nphy(struct brcms_phy *pi) in wlc_phy_bphy_init_nphy() argument
14139 write_phy_reg(pi, addr, val); in wlc_phy_bphy_init_nphy()
14146 write_phy_reg(pi, NPHY_TO_BPHY_OFF + BPHY_STEP, 0x668); in wlc_phy_bphy_init_nphy()
14150 wlc_phy_table_write_nphy(struct brcms_phy *pi, u32 id, u32 len, u32 offset, in wlc_phy_table_write_nphy() argument
14160 wlc_phy_write_table_nphy(pi, &tbl); in wlc_phy_table_write_nphy()
14164 wlc_phy_table_read_nphy(struct brcms_phy *pi, u32 id, u32 len, u32 offset, in wlc_phy_table_read_nphy() argument
14174 wlc_phy_read_table_nphy(pi, &tbl); in wlc_phy_table_read_nphy()
14178 wlc_phy_static_table_download_nphy(struct brcms_phy *pi) in wlc_phy_static_table_download_nphy() argument
14182 if (NREV_GE(pi->pubpi.phy_rev, 16)) { in wlc_phy_static_table_download_nphy()
14184 wlc_phy_write_table_nphy(pi, in wlc_phy_static_table_download_nphy()
14186 } else if (NREV_GE(pi->pubpi.phy_rev, 7)) { in wlc_phy_static_table_download_nphy()
14188 wlc_phy_write_table_nphy(pi, in wlc_phy_static_table_download_nphy()
14190 } else if (NREV_GE(pi->pubpi.phy_rev, 3)) { in wlc_phy_static_table_download_nphy()
14192 wlc_phy_write_table_nphy(pi, in wlc_phy_static_table_download_nphy()
14196 wlc_phy_write_table_nphy(pi, in wlc_phy_static_table_download_nphy()
14201 static void wlc_phy_tbl_init_nphy(struct brcms_phy *pi) in wlc_phy_tbl_init_nphy() argument
14206 if (pi->phy_init_por) in wlc_phy_tbl_init_nphy()
14207 wlc_phy_static_table_download_nphy(pi); in wlc_phy_tbl_init_nphy()
14209 if (NREV_GE(pi->pubpi.phy_rev, 7)) { in wlc_phy_tbl_init_nphy()
14211 antswctrllut = CHSPEC_IS2G(pi->radio_chanspec) ? in wlc_phy_tbl_init_nphy()
14212 pi->srom_fem2g.antswctrllut : pi->srom_fem5g. in wlc_phy_tbl_init_nphy()
14222 if (pi->aa2g == 7) in wlc_phy_tbl_init_nphy()
14224 pi, in wlc_phy_tbl_init_nphy()
14230 pi, in wlc_phy_tbl_init_nphy()
14236 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_ANTSWCTRLLUT, in wlc_phy_tbl_init_nphy()
14239 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_ANTSWCTRLLUT, in wlc_phy_tbl_init_nphy()
14247 pi, NPHY_TBL_ID_ANTSWCTRLLUT, in wlc_phy_tbl_init_nphy()
14251 pi, NPHY_TBL_ID_ANTSWCTRLLUT, in wlc_phy_tbl_init_nphy()
14255 pi, NPHY_TBL_ID_ANTSWCTRLLUT, in wlc_phy_tbl_init_nphy()
14260 pi, NPHY_TBL_ID_ANTSWCTRLLUT, in wlc_phy_tbl_init_nphy()
14264 pi, NPHY_TBL_ID_ANTSWCTRLLUT, in wlc_phy_tbl_init_nphy()
14268 pi, NPHY_TBL_ID_ANTSWCTRLLUT, in wlc_phy_tbl_init_nphy()
14277 } else if (NREV_GE(pi->pubpi.phy_rev, 3)) { in wlc_phy_tbl_init_nphy()
14282 CHSPEC_IS2G(pi->radio_chanspec) ? in wlc_phy_tbl_init_nphy()
14283 pi->srom_fem2g.antswctrllut : in wlc_phy_tbl_init_nphy()
14284 pi->srom_fem5g.antswctrllut; in wlc_phy_tbl_init_nphy()
14288 pi, in wlc_phy_tbl_init_nphy()
14294 pi, in wlc_phy_tbl_init_nphy()
14300 pi, in wlc_phy_tbl_init_nphy()
14306 pi, in wlc_phy_tbl_init_nphy()
14315 pi, in wlc_phy_tbl_init_nphy()
14321 wlc_phy_write_table_nphy(pi, in wlc_phy_tbl_init_nphy()
14328 wlc_phy_write_txmacreg_nphy(struct brcms_phy *pi, u16 holdoff, u16 delay) in wlc_phy_write_txmacreg_nphy() argument
14330 write_phy_reg(pi, 0x77, holdoff); in wlc_phy_write_txmacreg_nphy()
14331 write_phy_reg(pi, 0xb4, delay); in wlc_phy_write_txmacreg_nphy()
14334 void wlc_phy_nphy_tkip_rifs_war(struct brcms_phy *pi, u8 rifs) in wlc_phy_nphy_tkip_rifs_war() argument
14348 wlc_phy_write_txmacreg_nphy(pi, holdoff, delay); in wlc_phy_nphy_tkip_rifs_war()
14350 if (pi->sh && (pi->sh->_rifs_phy != rifs)) in wlc_phy_nphy_tkip_rifs_war()
14351 pi->sh->_rifs_phy = rifs; in wlc_phy_nphy_tkip_rifs_war()
14354 static void wlc_phy_txpwrctrl_config_nphy(struct brcms_phy *pi) in wlc_phy_txpwrctrl_config_nphy() argument
14357 if (NREV_GE(pi->pubpi.phy_rev, 3)) { in wlc_phy_txpwrctrl_config_nphy()
14358 pi->nphy_txpwrctrl = PHY_TPC_HW_ON; in wlc_phy_txpwrctrl_config_nphy()
14359 pi->phy_5g_pwrgain = true; in wlc_phy_txpwrctrl_config_nphy()
14363 pi->nphy_txpwrctrl = PHY_TPC_HW_OFF; in wlc_phy_txpwrctrl_config_nphy()
14364 pi->phy_5g_pwrgain = false; in wlc_phy_txpwrctrl_config_nphy()
14366 if ((pi->sh->boardflags2 & BFL2_TXPWRCTRL_EN) && in wlc_phy_txpwrctrl_config_nphy()
14367 NREV_GE(pi->pubpi.phy_rev, 2) && (pi->sh->sromrev >= 4)) in wlc_phy_txpwrctrl_config_nphy()
14368 pi->nphy_txpwrctrl = PHY_TPC_HW_ON; in wlc_phy_txpwrctrl_config_nphy()
14369 else if ((pi->sh->sromrev >= 4) in wlc_phy_txpwrctrl_config_nphy()
14370 && (pi->sh->boardflags2 & BFL2_5G_PWRGAIN)) in wlc_phy_txpwrctrl_config_nphy()
14371 pi->phy_5g_pwrgain = true; in wlc_phy_txpwrctrl_config_nphy()
14374 static void wlc_phy_txpwr_srom_read_ppr_nphy(struct brcms_phy *pi) in wlc_phy_txpwr_srom_read_ppr_nphy() argument
14378 struct ssb_sprom *sprom = &pi->d11core->bus->sprom; in wlc_phy_txpwr_srom_read_ppr_nphy()
14380 if (pi->sh->sromrev >= 9) in wlc_phy_txpwr_srom_read_ppr_nphy()
14384 pi->bw402gpo = bw40po & 0xf; in wlc_phy_txpwr_srom_read_ppr_nphy()
14385 pi->bw405gpo = (bw40po & 0xf0) >> 4; in wlc_phy_txpwr_srom_read_ppr_nphy()
14386 pi->bw405glpo = (bw40po & 0xf00) >> 8; in wlc_phy_txpwr_srom_read_ppr_nphy()
14387 pi->bw405ghpo = (bw40po & 0xf000) >> 12; in wlc_phy_txpwr_srom_read_ppr_nphy()
14390 pi->cdd2gpo = cddpo & 0xf; in wlc_phy_txpwr_srom_read_ppr_nphy()
14391 pi->cdd5gpo = (cddpo & 0xf0) >> 4; in wlc_phy_txpwr_srom_read_ppr_nphy()
14392 pi->cdd5glpo = (cddpo & 0xf00) >> 8; in wlc_phy_txpwr_srom_read_ppr_nphy()
14393 pi->cdd5ghpo = (cddpo & 0xf000) >> 12; in wlc_phy_txpwr_srom_read_ppr_nphy()
14396 pi->stbc2gpo = stbcpo & 0xf; in wlc_phy_txpwr_srom_read_ppr_nphy()
14397 pi->stbc5gpo = (stbcpo & 0xf0) >> 4; in wlc_phy_txpwr_srom_read_ppr_nphy()
14398 pi->stbc5glpo = (stbcpo & 0xf00) >> 8; in wlc_phy_txpwr_srom_read_ppr_nphy()
14399 pi->stbc5ghpo = (stbcpo & 0xf000) >> 12; in wlc_phy_txpwr_srom_read_ppr_nphy()
14402 pi->bwdup2gpo = bwduppo & 0xf; in wlc_phy_txpwr_srom_read_ppr_nphy()
14403 pi->bwdup5gpo = (bwduppo & 0xf0) >> 4; in wlc_phy_txpwr_srom_read_ppr_nphy()
14404 pi->bwdup5glpo = (bwduppo & 0xf00) >> 8; in wlc_phy_txpwr_srom_read_ppr_nphy()
14405 pi->bwdup5ghpo = (bwduppo & 0xf000) >> 12; in wlc_phy_txpwr_srom_read_ppr_nphy()
14411 pi->nphy_pwrctrl_info[PHY_CORE_0].max_pwr_2g = in wlc_phy_txpwr_srom_read_ppr_nphy()
14413 pi->nphy_pwrctrl_info[PHY_CORE_1].max_pwr_2g = in wlc_phy_txpwr_srom_read_ppr_nphy()
14415 pi->nphy_pwrctrl_info[PHY_CORE_0].pwrdet_2g_a1 = in wlc_phy_txpwr_srom_read_ppr_nphy()
14417 pi->nphy_pwrctrl_info[PHY_CORE_1].pwrdet_2g_a1 = in wlc_phy_txpwr_srom_read_ppr_nphy()
14419 pi->nphy_pwrctrl_info[PHY_CORE_0].pwrdet_2g_b0 = in wlc_phy_txpwr_srom_read_ppr_nphy()
14421 pi->nphy_pwrctrl_info[PHY_CORE_1].pwrdet_2g_b0 = in wlc_phy_txpwr_srom_read_ppr_nphy()
14423 pi->nphy_pwrctrl_info[PHY_CORE_0].pwrdet_2g_b1 = in wlc_phy_txpwr_srom_read_ppr_nphy()
14425 pi->nphy_pwrctrl_info[PHY_CORE_1].pwrdet_2g_b1 = in wlc_phy_txpwr_srom_read_ppr_nphy()
14427 pi->nphy_pwrctrl_info[PHY_CORE_0].idle_targ_2g = in wlc_phy_txpwr_srom_read_ppr_nphy()
14429 pi->nphy_pwrctrl_info[PHY_CORE_1].idle_targ_2g = in wlc_phy_txpwr_srom_read_ppr_nphy()
14432 pi->cck2gpo = sprom->cck2gpo; in wlc_phy_txpwr_srom_read_ppr_nphy()
14434 pi->ofdm2gpo = sprom->ofdm2gpo; in wlc_phy_txpwr_srom_read_ppr_nphy()
14436 pi->mcs2gpo[0] = sprom->mcs2gpo[0]; in wlc_phy_txpwr_srom_read_ppr_nphy()
14437 pi->mcs2gpo[1] = sprom->mcs2gpo[1]; in wlc_phy_txpwr_srom_read_ppr_nphy()
14438 pi->mcs2gpo[2] = sprom->mcs2gpo[2]; in wlc_phy_txpwr_srom_read_ppr_nphy()
14439 pi->mcs2gpo[3] = sprom->mcs2gpo[3]; in wlc_phy_txpwr_srom_read_ppr_nphy()
14440 pi->mcs2gpo[4] = sprom->mcs2gpo[4]; in wlc_phy_txpwr_srom_read_ppr_nphy()
14441 pi->mcs2gpo[5] = sprom->mcs2gpo[5]; in wlc_phy_txpwr_srom_read_ppr_nphy()
14442 pi->mcs2gpo[6] = sprom->mcs2gpo[6]; in wlc_phy_txpwr_srom_read_ppr_nphy()
14443 pi->mcs2gpo[7] = sprom->mcs2gpo[7]; in wlc_phy_txpwr_srom_read_ppr_nphy()
14447 pi->nphy_pwrctrl_info[PHY_CORE_0].max_pwr_5gm = in wlc_phy_txpwr_srom_read_ppr_nphy()
14449 pi->nphy_pwrctrl_info[PHY_CORE_1].max_pwr_5gm = in wlc_phy_txpwr_srom_read_ppr_nphy()
14451 pi->nphy_pwrctrl_info[PHY_CORE_0].pwrdet_5gm_a1 = in wlc_phy_txpwr_srom_read_ppr_nphy()
14453 pi->nphy_pwrctrl_info[PHY_CORE_1].pwrdet_5gm_a1 = in wlc_phy_txpwr_srom_read_ppr_nphy()
14455 pi->nphy_pwrctrl_info[PHY_CORE_0].pwrdet_5gm_b0 = in wlc_phy_txpwr_srom_read_ppr_nphy()
14457 pi->nphy_pwrctrl_info[PHY_CORE_1].pwrdet_5gm_b0 = in wlc_phy_txpwr_srom_read_ppr_nphy()
14459 pi->nphy_pwrctrl_info[PHY_CORE_0].pwrdet_5gm_b1 = in wlc_phy_txpwr_srom_read_ppr_nphy()
14461 pi->nphy_pwrctrl_info[PHY_CORE_1].pwrdet_5gm_b1 = in wlc_phy_txpwr_srom_read_ppr_nphy()
14463 pi->nphy_pwrctrl_info[PHY_CORE_0].idle_targ_5gm = in wlc_phy_txpwr_srom_read_ppr_nphy()
14465 pi->nphy_pwrctrl_info[PHY_CORE_1].idle_targ_5gm = in wlc_phy_txpwr_srom_read_ppr_nphy()
14468 pi->ofdm5gpo = sprom->ofdm5gpo; in wlc_phy_txpwr_srom_read_ppr_nphy()
14470 pi->mcs5gpo[0] = sprom->mcs5gpo[0]; in wlc_phy_txpwr_srom_read_ppr_nphy()
14471 pi->mcs5gpo[1] = sprom->mcs5gpo[1]; in wlc_phy_txpwr_srom_read_ppr_nphy()
14472 pi->mcs5gpo[2] = sprom->mcs5gpo[2]; in wlc_phy_txpwr_srom_read_ppr_nphy()
14473 pi->mcs5gpo[3] = sprom->mcs5gpo[3]; in wlc_phy_txpwr_srom_read_ppr_nphy()
14474 pi->mcs5gpo[4] = sprom->mcs5gpo[4]; in wlc_phy_txpwr_srom_read_ppr_nphy()
14475 pi->mcs5gpo[5] = sprom->mcs5gpo[5]; in wlc_phy_txpwr_srom_read_ppr_nphy()
14476 pi->mcs5gpo[6] = sprom->mcs5gpo[6]; in wlc_phy_txpwr_srom_read_ppr_nphy()
14477 pi->mcs5gpo[7] = sprom->mcs5gpo[7]; in wlc_phy_txpwr_srom_read_ppr_nphy()
14481 pi->nphy_pwrctrl_info[0].max_pwr_5gl = in wlc_phy_txpwr_srom_read_ppr_nphy()
14483 pi->nphy_pwrctrl_info[1].max_pwr_5gl = in wlc_phy_txpwr_srom_read_ppr_nphy()
14485 pi->nphy_pwrctrl_info[0].pwrdet_5gl_a1 = in wlc_phy_txpwr_srom_read_ppr_nphy()
14487 pi->nphy_pwrctrl_info[1].pwrdet_5gl_a1 = in wlc_phy_txpwr_srom_read_ppr_nphy()
14489 pi->nphy_pwrctrl_info[0].pwrdet_5gl_b0 = in wlc_phy_txpwr_srom_read_ppr_nphy()
14491 pi->nphy_pwrctrl_info[1].pwrdet_5gl_b0 = in wlc_phy_txpwr_srom_read_ppr_nphy()
14493 pi->nphy_pwrctrl_info[0].pwrdet_5gl_b1 = in wlc_phy_txpwr_srom_read_ppr_nphy()
14495 pi->nphy_pwrctrl_info[1].pwrdet_5gl_b1 = in wlc_phy_txpwr_srom_read_ppr_nphy()
14497 pi->nphy_pwrctrl_info[0].idle_targ_5gl = 0; in wlc_phy_txpwr_srom_read_ppr_nphy()
14498 pi->nphy_pwrctrl_info[1].idle_targ_5gl = 0; in wlc_phy_txpwr_srom_read_ppr_nphy()
14500 pi->ofdm5glpo = sprom->ofdm5glpo; in wlc_phy_txpwr_srom_read_ppr_nphy()
14502 pi->mcs5glpo[0] = sprom->mcs5glpo[0]; in wlc_phy_txpwr_srom_read_ppr_nphy()
14503 pi->mcs5glpo[1] = sprom->mcs5glpo[1]; in wlc_phy_txpwr_srom_read_ppr_nphy()
14504 pi->mcs5glpo[2] = sprom->mcs5glpo[2]; in wlc_phy_txpwr_srom_read_ppr_nphy()
14505 pi->mcs5glpo[3] = sprom->mcs5glpo[3]; in wlc_phy_txpwr_srom_read_ppr_nphy()
14506 pi->mcs5glpo[4] = sprom->mcs5glpo[4]; in wlc_phy_txpwr_srom_read_ppr_nphy()
14507 pi->mcs5glpo[5] = sprom->mcs5glpo[5]; in wlc_phy_txpwr_srom_read_ppr_nphy()
14508 pi->mcs5glpo[6] = sprom->mcs5glpo[6]; in wlc_phy_txpwr_srom_read_ppr_nphy()
14509 pi->mcs5glpo[7] = sprom->mcs5glpo[7]; in wlc_phy_txpwr_srom_read_ppr_nphy()
14513 pi->nphy_pwrctrl_info[0].max_pwr_5gh = in wlc_phy_txpwr_srom_read_ppr_nphy()
14515 pi->nphy_pwrctrl_info[1].max_pwr_5gh = in wlc_phy_txpwr_srom_read_ppr_nphy()
14517 pi->nphy_pwrctrl_info[0].pwrdet_5gh_a1 = in wlc_phy_txpwr_srom_read_ppr_nphy()
14519 pi->nphy_pwrctrl_info[1].pwrdet_5gh_a1 = in wlc_phy_txpwr_srom_read_ppr_nphy()
14521 pi->nphy_pwrctrl_info[0].pwrdet_5gh_b0 = in wlc_phy_txpwr_srom_read_ppr_nphy()
14523 pi->nphy_pwrctrl_info[1].pwrdet_5gh_b0 = in wlc_phy_txpwr_srom_read_ppr_nphy()
14525 pi->nphy_pwrctrl_info[0].pwrdet_5gh_b1 = in wlc_phy_txpwr_srom_read_ppr_nphy()
14527 pi->nphy_pwrctrl_info[1].pwrdet_5gh_b1 = in wlc_phy_txpwr_srom_read_ppr_nphy()
14529 pi->nphy_pwrctrl_info[0].idle_targ_5gh = 0; in wlc_phy_txpwr_srom_read_ppr_nphy()
14530 pi->nphy_pwrctrl_info[1].idle_targ_5gh = 0; in wlc_phy_txpwr_srom_read_ppr_nphy()
14532 pi->ofdm5ghpo = sprom->ofdm5ghpo; in wlc_phy_txpwr_srom_read_ppr_nphy()
14534 pi->mcs5ghpo[0] = sprom->mcs5ghpo[0]; in wlc_phy_txpwr_srom_read_ppr_nphy()
14535 pi->mcs5ghpo[1] = sprom->mcs5ghpo[1]; in wlc_phy_txpwr_srom_read_ppr_nphy()
14536 pi->mcs5ghpo[2] = sprom->mcs5ghpo[2]; in wlc_phy_txpwr_srom_read_ppr_nphy()
14537 pi->mcs5ghpo[3] = sprom->mcs5ghpo[3]; in wlc_phy_txpwr_srom_read_ppr_nphy()
14538 pi->mcs5ghpo[4] = sprom->mcs5ghpo[4]; in wlc_phy_txpwr_srom_read_ppr_nphy()
14539 pi->mcs5ghpo[5] = sprom->mcs5ghpo[5]; in wlc_phy_txpwr_srom_read_ppr_nphy()
14540 pi->mcs5ghpo[6] = sprom->mcs5ghpo[6]; in wlc_phy_txpwr_srom_read_ppr_nphy()
14541 pi->mcs5ghpo[7] = sprom->mcs5ghpo[7]; in wlc_phy_txpwr_srom_read_ppr_nphy()
14546 wlc_phy_txpwr_apply_nphy(pi); in wlc_phy_txpwr_srom_read_ppr_nphy()
14549 static bool wlc_phy_txpwr_srom_read_nphy(struct brcms_phy *pi) in wlc_phy_txpwr_srom_read_nphy() argument
14551 struct ssb_sprom *sprom = &pi->d11core->bus->sprom; in wlc_phy_txpwr_srom_read_nphy()
14553 pi->antswitch = sprom->antswitch; in wlc_phy_txpwr_srom_read_nphy()
14554 pi->aa2g = sprom->ant_available_bg; in wlc_phy_txpwr_srom_read_nphy()
14555 pi->aa5g = sprom->ant_available_a; in wlc_phy_txpwr_srom_read_nphy()
14557 pi->srom_fem2g.tssipos = sprom->fem.ghz2.tssipos; in wlc_phy_txpwr_srom_read_nphy()
14558 pi->srom_fem2g.extpagain = sprom->fem.ghz2.extpa_gain; in wlc_phy_txpwr_srom_read_nphy()
14559 pi->srom_fem2g.pdetrange = sprom->fem.ghz2.pdet_range; in wlc_phy_txpwr_srom_read_nphy()
14560 pi->srom_fem2g.triso = sprom->fem.ghz2.tr_iso; in wlc_phy_txpwr_srom_read_nphy()
14561 pi->srom_fem2g.antswctrllut = sprom->fem.ghz2.antswlut; in wlc_phy_txpwr_srom_read_nphy()
14563 pi->srom_fem5g.tssipos = sprom->fem.ghz5.tssipos; in wlc_phy_txpwr_srom_read_nphy()
14564 pi->srom_fem5g.extpagain = sprom->fem.ghz5.extpa_gain; in wlc_phy_txpwr_srom_read_nphy()
14565 pi->srom_fem5g.pdetrange = sprom->fem.ghz5.pdet_range; in wlc_phy_txpwr_srom_read_nphy()
14566 pi->srom_fem5g.triso = sprom->fem.ghz5.tr_iso; in wlc_phy_txpwr_srom_read_nphy()
14568 pi->srom_fem5g.antswctrllut = sprom->fem.ghz5.antswlut; in wlc_phy_txpwr_srom_read_nphy()
14570 pi->srom_fem5g.antswctrllut = sprom->fem.ghz2.antswlut; in wlc_phy_txpwr_srom_read_nphy()
14572 wlc_phy_txpower_ipa_upd(pi); in wlc_phy_txpwr_srom_read_nphy()
14574 pi->phy_txcore_disable_temp = sprom->tempthresh; in wlc_phy_txpwr_srom_read_nphy()
14575 if (pi->phy_txcore_disable_temp == 0) in wlc_phy_txpwr_srom_read_nphy()
14576 pi->phy_txcore_disable_temp = PHY_CHAIN_TX_DISABLE_TEMP; in wlc_phy_txpwr_srom_read_nphy()
14578 pi->phy_tempsense_offset = sprom->tempoffset; in wlc_phy_txpwr_srom_read_nphy()
14579 if (pi->phy_tempsense_offset != 0) { in wlc_phy_txpwr_srom_read_nphy()
14580 if (pi->phy_tempsense_offset > in wlc_phy_txpwr_srom_read_nphy()
14582 pi->phy_tempsense_offset = NPHY_SROM_MAXTEMPOFFSET; in wlc_phy_txpwr_srom_read_nphy()
14583 else if (pi->phy_tempsense_offset < (NPHY_SROM_TEMPSHIFT + in wlc_phy_txpwr_srom_read_nphy()
14585 pi->phy_tempsense_offset = NPHY_SROM_MINTEMPOFFSET; in wlc_phy_txpwr_srom_read_nphy()
14587 pi->phy_tempsense_offset -= NPHY_SROM_TEMPSHIFT; in wlc_phy_txpwr_srom_read_nphy()
14590 pi->phy_txcore_enable_temp = in wlc_phy_txpwr_srom_read_nphy()
14591 pi->phy_txcore_disable_temp - PHY_HYSTERESIS_DELTATEMP; in wlc_phy_txpwr_srom_read_nphy()
14593 pi->phycal_tempdelta = sprom->phycal_tempdelta; in wlc_phy_txpwr_srom_read_nphy()
14594 if (pi->phycal_tempdelta > NPHY_CAL_MAXTEMPDELTA) in wlc_phy_txpwr_srom_read_nphy()
14595 pi->phycal_tempdelta = 0; in wlc_phy_txpwr_srom_read_nphy()
14597 wlc_phy_txpwr_srom_read_ppr_nphy(pi); in wlc_phy_txpwr_srom_read_nphy()
14602 bool wlc_phy_attach_nphy(struct brcms_phy *pi) in wlc_phy_attach_nphy() argument
14606 if (NREV_GE(pi->pubpi.phy_rev, 3) && NREV_LT(pi->pubpi.phy_rev, 6)) in wlc_phy_attach_nphy()
14607 pi->phyhang_avoid = true; in wlc_phy_attach_nphy()
14609 if (NREV_GE(pi->pubpi.phy_rev, 3) && NREV_LT(pi->pubpi.phy_rev, 7)) { in wlc_phy_attach_nphy()
14610 pi->nphy_gband_spurwar_en = true; in wlc_phy_attach_nphy()
14611 if (pi->sh->boardflags2 & BFL2_SPUR_WAR) in wlc_phy_attach_nphy()
14612 pi->nphy_aband_spurwar_en = true; in wlc_phy_attach_nphy()
14614 if (NREV_GE(pi->pubpi.phy_rev, 6) && NREV_LT(pi->pubpi.phy_rev, 7)) { in wlc_phy_attach_nphy()
14615 if (pi->sh->boardflags2 & BFL2_2G_SPUR_WAR) in wlc_phy_attach_nphy()
14616 pi->nphy_gband_spurwar2_en = true; in wlc_phy_attach_nphy()
14619 pi->n_preamble_override = AUTO; in wlc_phy_attach_nphy()
14620 if (NREV_IS(pi->pubpi.phy_rev, 3) || NREV_IS(pi->pubpi.phy_rev, 4)) in wlc_phy_attach_nphy()
14621 pi->n_preamble_override = BRCMS_N_PREAMBLE_MIXEDMODE; in wlc_phy_attach_nphy()
14623 pi->nphy_txrx_chain = AUTO; in wlc_phy_attach_nphy()
14624 pi->phy_scraminit = AUTO; in wlc_phy_attach_nphy()
14626 pi->nphy_rxcalparams = 0x010100B5; in wlc_phy_attach_nphy()
14628 pi->nphy_perical = PHY_PERICAL_MPHASE; in wlc_phy_attach_nphy()
14629 pi->mphase_cal_phase_id = MPHASE_CAL_STATE_IDLE; in wlc_phy_attach_nphy()
14630 pi->mphase_txcal_numcmds = MPHASE_TXCAL_NUMCMDS; in wlc_phy_attach_nphy()
14632 pi->nphy_gain_boost = true; in wlc_phy_attach_nphy()
14633 pi->nphy_elna_gain_config = false; in wlc_phy_attach_nphy()
14634 pi->radio_is_on = false; in wlc_phy_attach_nphy()
14636 for (i = 0; i < pi->pubpi.phy_corenum; i++) in wlc_phy_attach_nphy()
14637 pi->nphy_txpwrindex[i].index = AUTO; in wlc_phy_attach_nphy()
14639 wlc_phy_txpwrctrl_config_nphy(pi); in wlc_phy_attach_nphy()
14640 if (pi->nphy_txpwrctrl == PHY_TPC_HW_ON) in wlc_phy_attach_nphy()
14641 pi->hwpwrctrl_capable = true; in wlc_phy_attach_nphy()
14643 pi->pi_fptr.init = wlc_phy_init_nphy; in wlc_phy_attach_nphy()
14644 pi->pi_fptr.calinit = wlc_phy_cal_init_nphy; in wlc_phy_attach_nphy()
14645 pi->pi_fptr.chanset = wlc_phy_chanspec_set_nphy; in wlc_phy_attach_nphy()
14646 pi->pi_fptr.txpwrrecalc = wlc_phy_txpower_recalc_target_nphy; in wlc_phy_attach_nphy()
14648 if (!wlc_phy_txpwr_srom_read_nphy(pi)) in wlc_phy_attach_nphy()
14654 static s32 get_rf_pwr_offset(struct brcms_phy *pi, s16 pga_gn, s16 pad_gn) in get_rf_pwr_offset() argument
14658 if (CHSPEC_IS2G(pi->radio_chanspec)) { in get_rf_pwr_offset()
14659 if ((pi->pubpi.radiorev == 3) || in get_rf_pwr_offset()
14660 (pi->pubpi.radiorev == 4) || in get_rf_pwr_offset()
14661 (pi->pubpi.radiorev == 6)) in get_rf_pwr_offset()
14665 else if (pi->pubpi.radiorev == 5) in get_rf_pwr_offset()
14669 else if ((pi->pubpi.radiorev == 7) in get_rf_pwr_offset()
14670 || (pi->pubpi.radiorev == in get_rf_pwr_offset()
14676 if ((pi->pubpi.radiorev == 3) || in get_rf_pwr_offset()
14677 (pi->pubpi.radiorev == 4) || in get_rf_pwr_offset()
14678 (pi->pubpi.radiorev == 6)) in get_rf_pwr_offset()
14682 else if ((pi->pubpi.radiorev == 7) in get_rf_pwr_offset()
14683 || (pi->pubpi.radiorev == in get_rf_pwr_offset()
14692 static void wlc_phy_update_mimoconfig_nphy(struct brcms_phy *pi, s32 preamble) in wlc_phy_update_mimoconfig_nphy() argument
14700 val = read_phy_reg(pi, 0xed); in wlc_phy_update_mimoconfig_nphy()
14707 write_phy_reg(pi, 0xed, val); in wlc_phy_update_mimoconfig_nphy()
14710 static void wlc_phy_ipa_set_tx_digi_filts_nphy(struct brcms_phy *pi) in wlc_phy_ipa_set_tx_digi_filts_nphy() argument
14717 write_phy_reg(pi, addr_offset[type] + j, in wlc_phy_ipa_set_tx_digi_filts_nphy()
14721 if (pi->bw == WL_CHANSPEC_BW_40) { in wlc_phy_ipa_set_tx_digi_filts_nphy()
14723 write_phy_reg(pi, 0x186 + j, in wlc_phy_ipa_set_tx_digi_filts_nphy()
14726 if (CHSPEC_IS5G(pi->radio_chanspec)) { in wlc_phy_ipa_set_tx_digi_filts_nphy()
14728 write_phy_reg(pi, 0x186 + j, in wlc_phy_ipa_set_tx_digi_filts_nphy()
14732 if (CHSPEC_CHANNEL(pi->radio_chanspec) == 14) { in wlc_phy_ipa_set_tx_digi_filts_nphy()
14734 write_phy_reg(pi, 0x2c5 + j, in wlc_phy_ipa_set_tx_digi_filts_nphy()
14740 static void wlc_phy_ipa_restore_tx_digi_filts_nphy(struct brcms_phy *pi) in wlc_phy_ipa_restore_tx_digi_filts_nphy() argument
14744 if (pi->bw == WL_CHANSPEC_BW_40) { in wlc_phy_ipa_restore_tx_digi_filts_nphy()
14746 write_phy_reg(pi, 0x195 + j, in wlc_phy_ipa_restore_tx_digi_filts_nphy()
14750 write_phy_reg(pi, 0x186 + j, in wlc_phy_ipa_restore_tx_digi_filts_nphy()
14756 wlc_phy_set_rfseq_nphy(struct brcms_phy *pi, u8 cmd, const u8 *events, in wlc_phy_set_rfseq_nphy() argument
14762 NREV_GE(pi->pubpi.phy_rev, in wlc_phy_set_rfseq_nphy()
14766 if (pi->phyhang_avoid) in wlc_phy_set_rfseq_nphy()
14767 wlc_phy_stay_in_carriersearch_nphy(pi, true); in wlc_phy_set_rfseq_nphy()
14770 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_RFSEQ, len, t1_offset, 8, in wlc_phy_set_rfseq_nphy()
14773 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_RFSEQ, len, t2_offset, 8, in wlc_phy_set_rfseq_nphy()
14777 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_RFSEQ, 1, in wlc_phy_set_rfseq_nphy()
14779 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_RFSEQ, 1, in wlc_phy_set_rfseq_nphy()
14783 if (pi->phyhang_avoid) in wlc_phy_set_rfseq_nphy()
14784 wlc_phy_stay_in_carriersearch_nphy(pi, false); in wlc_phy_set_rfseq_nphy()
14787 static u16 wlc_phy_read_lpf_bw_ctl_nphy(struct brcms_phy *pi, u16 offset) in wlc_phy_read_lpf_bw_ctl_nphy() argument
14793 if (CHSPEC_IS40(pi->radio_chanspec)) in wlc_phy_read_lpf_bw_ctl_nphy()
14800 wlc_phy_table_read_nphy(pi, NPHY_TBL_ID_RFSEQ, 1, in wlc_phy_read_lpf_bw_ctl_nphy()
14810 wlc_phy_rfctrl_override_nphy_rev7(struct brcms_phy *pi, u16 field, u16 value, in wlc_phy_rfctrl_override_nphy_rev7() argument
14817 if (NREV_GE(pi->pubpi.phy_rev, 7)) { in wlc_phy_rfctrl_override_nphy_rev7()
15061 and_phy_reg(pi, en_addr, ~en_mask); in wlc_phy_rfctrl_override_nphy_rev7()
15062 and_phy_reg(pi, val_addr, ~val_mask); in wlc_phy_rfctrl_override_nphy_rev7()
15067 or_phy_reg(pi, en_addr, en_mask); in wlc_phy_rfctrl_override_nphy_rev7()
15070 mod_phy_reg(pi, val_addr, in wlc_phy_rfctrl_override_nphy_rev7()
15080 static void wlc_phy_adjust_lnagaintbl_nphy(struct brcms_phy *pi) in wlc_phy_adjust_lnagaintbl_nphy() argument
15089 if (pi->phyhang_avoid) in wlc_phy_adjust_lnagaintbl_nphy()
15090 wlc_phy_stay_in_carriersearch_nphy(pi, true); in wlc_phy_adjust_lnagaintbl_nphy()
15092 if (pi->nphy_gain_boost) { in wlc_phy_adjust_lnagaintbl_nphy()
15093 if ((CHSPEC_IS2G(pi->radio_chanspec))) { in wlc_phy_adjust_lnagaintbl_nphy()
15099 curr_channel = CHSPEC_CHANNEL(pi->radio_chanspec); in wlc_phy_adjust_lnagaintbl_nphy()
15117 for (core = 0; core < pi->pubpi.phy_corenum; core++) { in wlc_phy_adjust_lnagaintbl_nphy()
15118 if (pi->nphy_elna_gain_config) { in wlc_phy_adjust_lnagaintbl_nphy()
15130 wlc_phy_table_write_nphy(pi, core, 4, 8, 16, regval); in wlc_phy_adjust_lnagaintbl_nphy()
15136 mod_phy_reg(pi, 0x1e, (0xff << 0), (minmax_gain[0] << 0)); in wlc_phy_adjust_lnagaintbl_nphy()
15137 mod_phy_reg(pi, 0x34, (0xff << 0), (minmax_gain[1] << 0)); in wlc_phy_adjust_lnagaintbl_nphy()
15139 if (pi->phyhang_avoid) in wlc_phy_adjust_lnagaintbl_nphy()
15140 wlc_phy_stay_in_carriersearch_nphy(pi, false); in wlc_phy_adjust_lnagaintbl_nphy()
15144 wlc_phy_war_force_trsw_to_R_cliplo_nphy(struct brcms_phy *pi, u8 core) in wlc_phy_war_force_trsw_to_R_cliplo_nphy() argument
15147 write_phy_reg(pi, 0x38, 0x4); in wlc_phy_war_force_trsw_to_R_cliplo_nphy()
15148 if (CHSPEC_IS2G(pi->radio_chanspec)) in wlc_phy_war_force_trsw_to_R_cliplo_nphy()
15149 write_phy_reg(pi, 0x37, 0x0060); in wlc_phy_war_force_trsw_to_R_cliplo_nphy()
15151 write_phy_reg(pi, 0x37, 0x1080); in wlc_phy_war_force_trsw_to_R_cliplo_nphy()
15153 write_phy_reg(pi, 0x2ae, 0x4); in wlc_phy_war_force_trsw_to_R_cliplo_nphy()
15154 if (CHSPEC_IS2G(pi->radio_chanspec)) in wlc_phy_war_force_trsw_to_R_cliplo_nphy()
15155 write_phy_reg(pi, 0x2ad, 0x0060); in wlc_phy_war_force_trsw_to_R_cliplo_nphy()
15157 write_phy_reg(pi, 0x2ad, 0x1080); in wlc_phy_war_force_trsw_to_R_cliplo_nphy()
15161 static void wlc_phy_war_txchain_upd_nphy(struct brcms_phy *pi, u8 txchain) in wlc_phy_war_txchain_upd_nphy() argument
15168 wlc_phy_war_force_trsw_to_R_cliplo_nphy(pi, PHY_CORE_0); in wlc_phy_war_txchain_upd_nphy()
15171 wlc_phy_war_force_trsw_to_R_cliplo_nphy(pi, PHY_CORE_1); in wlc_phy_war_txchain_upd_nphy()
15174 static void wlc_phy_workarounds_nphy_gainctrl_2057_rev5(struct brcms_phy *pi) in wlc_phy_workarounds_nphy_gainctrl_2057_rev5() argument
15182 mod_phy_reg(pi, 0x1c, (0x1 << 13), (1 << 13)); in wlc_phy_workarounds_nphy_gainctrl_2057_rev5()
15183 mod_phy_reg(pi, 0x32, (0x1 << 13), (1 << 13)); in wlc_phy_workarounds_nphy_gainctrl_2057_rev5()
15185 mod_phy_reg(pi, 0x289, (0xff << 0), (0x46 << 0)); in wlc_phy_workarounds_nphy_gainctrl_2057_rev5()
15187 mod_phy_reg(pi, 0x283, (0xff << 0), (0x3c << 0)); in wlc_phy_workarounds_nphy_gainctrl_2057_rev5()
15188 mod_phy_reg(pi, 0x280, (0xff << 0), (0x3c << 0)); in wlc_phy_workarounds_nphy_gainctrl_2057_rev5()
15190 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_GAIN1, 4, 0x8, 8, in wlc_phy_workarounds_nphy_gainctrl_2057_rev5()
15192 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_GAIN2, 4, 0x8, 8, in wlc_phy_workarounds_nphy_gainctrl_2057_rev5()
15195 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_GAIN1, 4, 0x10, 8, in wlc_phy_workarounds_nphy_gainctrl_2057_rev5()
15197 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_GAIN2, 4, 0x10, 8, in wlc_phy_workarounds_nphy_gainctrl_2057_rev5()
15200 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_GAIN1, 10, 0x20, 8, in wlc_phy_workarounds_nphy_gainctrl_2057_rev5()
15202 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_GAIN2, 10, 0x20, 8, in wlc_phy_workarounds_nphy_gainctrl_2057_rev5()
15205 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_GAINBITS1, 10, 0x20, 8, in wlc_phy_workarounds_nphy_gainctrl_2057_rev5()
15207 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_GAINBITS2, 10, 0x20, 8, in wlc_phy_workarounds_nphy_gainctrl_2057_rev5()
15210 write_phy_reg(pi, 0x37, 0x74); in wlc_phy_workarounds_nphy_gainctrl_2057_rev5()
15211 write_phy_reg(pi, 0x2ad, 0x74); in wlc_phy_workarounds_nphy_gainctrl_2057_rev5()
15212 write_phy_reg(pi, 0x38, 0x18); in wlc_phy_workarounds_nphy_gainctrl_2057_rev5()
15213 write_phy_reg(pi, 0x2ae, 0x18); in wlc_phy_workarounds_nphy_gainctrl_2057_rev5()
15215 write_phy_reg(pi, 0x2b, 0xe8); in wlc_phy_workarounds_nphy_gainctrl_2057_rev5()
15216 write_phy_reg(pi, 0x41, 0xe8); in wlc_phy_workarounds_nphy_gainctrl_2057_rev5()
15218 if (CHSPEC_IS20(pi->radio_chanspec)) { in wlc_phy_workarounds_nphy_gainctrl_2057_rev5()
15220 mod_phy_reg(pi, 0x300, (0x3f << 0), (0x12 << 0)); in wlc_phy_workarounds_nphy_gainctrl_2057_rev5()
15221 mod_phy_reg(pi, 0x301, (0x3f << 0), (0x12 << 0)); in wlc_phy_workarounds_nphy_gainctrl_2057_rev5()
15224 mod_phy_reg(pi, 0x300, (0x3f << 0), (0x10 << 0)); in wlc_phy_workarounds_nphy_gainctrl_2057_rev5()
15225 mod_phy_reg(pi, 0x301, (0x3f << 0), (0x10 << 0)); in wlc_phy_workarounds_nphy_gainctrl_2057_rev5()
15229 static void wlc_phy_workarounds_nphy_gainctrl_2057_rev6(struct brcms_phy *pi) in wlc_phy_workarounds_nphy_gainctrl_2057_rev6() argument
15256 mod_phy_reg(pi, 0x1c, (0x1 << 13), (1 << 13)); in wlc_phy_workarounds_nphy_gainctrl_2057_rev6()
15257 mod_phy_reg(pi, 0x32, (0x1 << 13), (1 << 13)); in wlc_phy_workarounds_nphy_gainctrl_2057_rev6()
15259 currband = read_phy_reg(pi, 0x09) & NPHY_BandControl_currentBand; in wlc_phy_workarounds_nphy_gainctrl_2057_rev6()
15264 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_GAIN1, 4, 8, 8, in wlc_phy_workarounds_nphy_gainctrl_2057_rev6()
15266 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_GAIN2, 4, 8, 8, in wlc_phy_workarounds_nphy_gainctrl_2057_rev6()
15269 mod_phy_reg(pi, 0x283, (0xff << 0), (0x40 << 0)); in wlc_phy_workarounds_nphy_gainctrl_2057_rev6()
15271 if (CHSPEC_IS40(pi->radio_chanspec)) { in wlc_phy_workarounds_nphy_gainctrl_2057_rev6()
15272 mod_phy_reg(pi, 0x280, (0xff << 0), (0x3e << 0)); in wlc_phy_workarounds_nphy_gainctrl_2057_rev6()
15273 mod_phy_reg(pi, 0x283, (0xff << 0), (0x3e << 0)); in wlc_phy_workarounds_nphy_gainctrl_2057_rev6()
15276 mod_phy_reg(pi, 0x289, (0xff << 0), (0x46 << 0)); in wlc_phy_workarounds_nphy_gainctrl_2057_rev6()
15278 if (CHSPEC_IS20(pi->radio_chanspec)) { in wlc_phy_workarounds_nphy_gainctrl_2057_rev6()
15279 mod_phy_reg(pi, 0x300, (0x3f << 0), (13 << 0)); in wlc_phy_workarounds_nphy_gainctrl_2057_rev6()
15280 mod_phy_reg(pi, 0x301, (0x3f << 0), (13 << 0)); in wlc_phy_workarounds_nphy_gainctrl_2057_rev6()
15294 freq = CHAN5G_FREQ(CHSPEC_CHANNEL(pi->radio_chanspec)); in wlc_phy_workarounds_nphy_gainctrl_2057_rev6()
15295 if (CHSPEC_IS20(pi->radio_chanspec)) { in wlc_phy_workarounds_nphy_gainctrl_2057_rev6()
15366 write_phy_reg(pi, 0x20, init_gaincode); in wlc_phy_workarounds_nphy_gainctrl_2057_rev6()
15367 write_phy_reg(pi, 0x2a7, init_gaincode); in wlc_phy_workarounds_nphy_gainctrl_2057_rev6()
15369 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_RFSEQ, in wlc_phy_workarounds_nphy_gainctrl_2057_rev6()
15370 pi->pubpi.phy_corenum, 0x106, 16, in wlc_phy_workarounds_nphy_gainctrl_2057_rev6()
15373 write_phy_reg(pi, 0x22, clip1hi_gaincode); in wlc_phy_workarounds_nphy_gainctrl_2057_rev6()
15374 write_phy_reg(pi, 0x2a9, clip1hi_gaincode); in wlc_phy_workarounds_nphy_gainctrl_2057_rev6()
15376 write_phy_reg(pi, 0x36, clip1md_gaincode_B); in wlc_phy_workarounds_nphy_gainctrl_2057_rev6()
15377 write_phy_reg(pi, 0x2ac, clip1md_gaincode_B); in wlc_phy_workarounds_nphy_gainctrl_2057_rev6()
15379 write_phy_reg(pi, 0x37, clip1lo_gaincode); in wlc_phy_workarounds_nphy_gainctrl_2057_rev6()
15380 write_phy_reg(pi, 0x2ad, clip1lo_gaincode); in wlc_phy_workarounds_nphy_gainctrl_2057_rev6()
15381 write_phy_reg(pi, 0x38, clip1lo_gaincode_B); in wlc_phy_workarounds_nphy_gainctrl_2057_rev6()
15382 write_phy_reg(pi, 0x2ae, clip1lo_gaincode_B); in wlc_phy_workarounds_nphy_gainctrl_2057_rev6()
15384 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_GAIN1, 10, 0x20, 8, in wlc_phy_workarounds_nphy_gainctrl_2057_rev6()
15386 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_GAIN2, 10, 0x20, 8, in wlc_phy_workarounds_nphy_gainctrl_2057_rev6()
15389 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_GAINBITS1, 10, 0x20, 8, in wlc_phy_workarounds_nphy_gainctrl_2057_rev6()
15391 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_GAINBITS2, 10, 0x20, 8, in wlc_phy_workarounds_nphy_gainctrl_2057_rev6()
15394 mod_phy_reg(pi, 0x283, (0xff << 0), (crsminu_th << 0)); in wlc_phy_workarounds_nphy_gainctrl_2057_rev6()
15397 write_phy_reg(pi, 0x2b, nbclip_th); in wlc_phy_workarounds_nphy_gainctrl_2057_rev6()
15398 write_phy_reg(pi, 0x41, nbclip_th); in wlc_phy_workarounds_nphy_gainctrl_2057_rev6()
15401 mod_phy_reg(pi, 0x300, (0x3f << 0), (w1clip_th << 0)); in wlc_phy_workarounds_nphy_gainctrl_2057_rev6()
15402 mod_phy_reg(pi, 0x301, (0x3f << 0), (w1clip_th << 0)); in wlc_phy_workarounds_nphy_gainctrl_2057_rev6()
15404 mod_phy_reg(pi, 0x2e4, in wlc_phy_workarounds_nphy_gainctrl_2057_rev6()
15407 mod_phy_reg(pi, 0x2e4, in wlc_phy_workarounds_nphy_gainctrl_2057_rev6()
15410 if (CHSPEC_IS20(pi->radio_chanspec)) { in wlc_phy_workarounds_nphy_gainctrl_2057_rev6()
15412 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_GAIN1, 4, 8, 8, in wlc_phy_workarounds_nphy_gainctrl_2057_rev6()
15414 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_GAIN2, 4, 8, 8, in wlc_phy_workarounds_nphy_gainctrl_2057_rev6()
15417 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_GAIN1, 4, 0x10, in wlc_phy_workarounds_nphy_gainctrl_2057_rev6()
15419 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_GAIN2, 4, 0x10, in wlc_phy_workarounds_nphy_gainctrl_2057_rev6()
15422 write_phy_reg(pi, 0x24, clip1md_gaincode); in wlc_phy_workarounds_nphy_gainctrl_2057_rev6()
15423 write_phy_reg(pi, 0x2ab, clip1md_gaincode); in wlc_phy_workarounds_nphy_gainctrl_2057_rev6()
15425 mod_phy_reg(pi, 0x280, (0xff << 0), (crsminl_th << 0)); in wlc_phy_workarounds_nphy_gainctrl_2057_rev6()
15430 static void wlc_phy_workarounds_nphy_gainctrl(struct brcms_phy *pi) in wlc_phy_workarounds_nphy_gainctrl() argument
15585 triso = (CHSPEC_IS5G(pi->radio_chanspec)) ? pi->srom_fem5g.triso : in wlc_phy_workarounds_nphy_gainctrl()
15586 pi->srom_fem2g.triso; in wlc_phy_workarounds_nphy_gainctrl()
15588 if (NREV_GE(pi->pubpi.phy_rev, 7)) { in wlc_phy_workarounds_nphy_gainctrl()
15589 if (pi->pubpi.radiorev == 5) { in wlc_phy_workarounds_nphy_gainctrl()
15590 wlc_phy_workarounds_nphy_gainctrl_2057_rev5(pi); in wlc_phy_workarounds_nphy_gainctrl()
15591 } else if (pi->pubpi.radiorev == 7) { in wlc_phy_workarounds_nphy_gainctrl()
15592 wlc_phy_workarounds_nphy_gainctrl_2057_rev6(pi); in wlc_phy_workarounds_nphy_gainctrl()
15594 mod_phy_reg(pi, 0x283, (0xff << 0), (0x44 << 0)); in wlc_phy_workarounds_nphy_gainctrl()
15595 mod_phy_reg(pi, 0x280, (0xff << 0), (0x44 << 0)); in wlc_phy_workarounds_nphy_gainctrl()
15597 } else if ((pi->pubpi.radiorev == 3) in wlc_phy_workarounds_nphy_gainctrl()
15598 || (pi->pubpi.radiorev == 8)) { in wlc_phy_workarounds_nphy_gainctrl()
15599 wlc_phy_workarounds_nphy_gainctrl_2057_rev6(pi); in wlc_phy_workarounds_nphy_gainctrl()
15601 if (pi->pubpi.radiorev == 8) { in wlc_phy_workarounds_nphy_gainctrl()
15602 mod_phy_reg(pi, 0x283, in wlc_phy_workarounds_nphy_gainctrl()
15604 mod_phy_reg(pi, 0x280, in wlc_phy_workarounds_nphy_gainctrl()
15608 wlc_phy_workarounds_nphy_gainctrl_2057_rev6(pi); in wlc_phy_workarounds_nphy_gainctrl()
15610 } else if (NREV_GE(pi->pubpi.phy_rev, 3)) { in wlc_phy_workarounds_nphy_gainctrl()
15612 mod_phy_reg(pi, 0xa0, (0x1 << 6), (1 << 6)); in wlc_phy_workarounds_nphy_gainctrl()
15614 mod_phy_reg(pi, 0x1c, (0x1 << 13), (1 << 13)); in wlc_phy_workarounds_nphy_gainctrl()
15615 mod_phy_reg(pi, 0x32, (0x1 << 13), (1 << 13)); in wlc_phy_workarounds_nphy_gainctrl()
15618 read_phy_reg(pi, 0x09) & NPHY_BandControl_currentBand; in wlc_phy_workarounds_nphy_gainctrl()
15620 if (NREV_GE(pi->pubpi.phy_rev, 6)) { in wlc_phy_workarounds_nphy_gainctrl()
15621 if (pi->pubpi.radiorev == 11) { in wlc_phy_workarounds_nphy_gainctrl()
15641 if (pi->sh->boardflags & BFL_EXTLNA) { in wlc_phy_workarounds_nphy_gainctrl()
15706 } else if (NREV_IS(pi->pubpi.phy_rev, 5)) { in wlc_phy_workarounds_nphy_gainctrl()
15709 if (pi->sh->boardflags & BFL_EXTLNA) { in wlc_phy_workarounds_nphy_gainctrl()
15765 } else if (NREV_IS(pi->pubpi.phy_rev, 4)) { in wlc_phy_workarounds_nphy_gainctrl()
15796 if (NREV_GE(pi->pubpi.phy_rev, 6)) { in wlc_phy_workarounds_nphy_gainctrl()
15808 if ((pi->pubpi.radiorev == 11) && in wlc_phy_workarounds_nphy_gainctrl()
15809 (CHSPEC_IS40(pi->radio_chanspec) == 0)) in wlc_phy_workarounds_nphy_gainctrl()
15816 } else if (NREV_IS(pi->pubpi.phy_rev, 5)) { in wlc_phy_workarounds_nphy_gainctrl()
15831 } else if (NREV_IS(pi->pubpi.phy_rev, 4)) { in wlc_phy_workarounds_nphy_gainctrl()
15836 if (pi->sh->boardflags & BFL_EXTLNA_5GHz) { in wlc_phy_workarounds_nphy_gainctrl()
15873 write_radio_reg(pi, in wlc_phy_workarounds_nphy_gainctrl()
15876 write_radio_reg(pi, in wlc_phy_workarounds_nphy_gainctrl()
15880 write_radio_reg(pi, (RADIO_2056_RX_LNAG2_IDAC | RADIO_2056_RX0), in wlc_phy_workarounds_nphy_gainctrl()
15882 write_radio_reg(pi, (RADIO_2056_RX_LNAG2_IDAC | RADIO_2056_RX1), in wlc_phy_workarounds_nphy_gainctrl()
15885 write_radio_reg(pi, (RADIO_2056_RX_RSSI_POLE | RADIO_2056_RX0), in wlc_phy_workarounds_nphy_gainctrl()
15887 write_radio_reg(pi, (RADIO_2056_RX_RSSI_POLE | RADIO_2056_RX1), in wlc_phy_workarounds_nphy_gainctrl()
15890 write_radio_reg(pi, (RADIO_2056_RX_RSSI_GAIN | RADIO_2056_RX0), in wlc_phy_workarounds_nphy_gainctrl()
15892 write_radio_reg(pi, (RADIO_2056_RX_RSSI_GAIN | RADIO_2056_RX1), in wlc_phy_workarounds_nphy_gainctrl()
15895 write_radio_reg(pi, in wlc_phy_workarounds_nphy_gainctrl()
15898 write_radio_reg(pi, in wlc_phy_workarounds_nphy_gainctrl()
15902 write_radio_reg(pi, (RADIO_2056_RX_LNAA2_IDAC | RADIO_2056_RX0), in wlc_phy_workarounds_nphy_gainctrl()
15904 write_radio_reg(pi, (RADIO_2056_RX_LNAA2_IDAC | RADIO_2056_RX1), in wlc_phy_workarounds_nphy_gainctrl()
15907 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_GAIN1, 4, 8, in wlc_phy_workarounds_nphy_gainctrl()
15909 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_GAIN2, 4, 8, in wlc_phy_workarounds_nphy_gainctrl()
15912 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_GAIN1, 4, 0x10, in wlc_phy_workarounds_nphy_gainctrl()
15914 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_GAIN2, 4, 0x10, in wlc_phy_workarounds_nphy_gainctrl()
15917 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_GAIN1, 10, 0x20, in wlc_phy_workarounds_nphy_gainctrl()
15919 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_GAIN2, 10, 0x20, in wlc_phy_workarounds_nphy_gainctrl()
15922 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_GAINBITS1, 10, 0x20, in wlc_phy_workarounds_nphy_gainctrl()
15924 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_GAINBITS2, 10, 0x20, in wlc_phy_workarounds_nphy_gainctrl()
15927 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_GAIN1, 6, 0x40, in wlc_phy_workarounds_nphy_gainctrl()
15929 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_GAIN2, 6, 0x40, in wlc_phy_workarounds_nphy_gainctrl()
15931 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_GAINBITS1, 6, 0x40, in wlc_phy_workarounds_nphy_gainctrl()
15933 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_GAINBITS2, 6, 0x40, in wlc_phy_workarounds_nphy_gainctrl()
15936 write_phy_reg(pi, 0x20, init_gaincode); in wlc_phy_workarounds_nphy_gainctrl()
15937 write_phy_reg(pi, 0x2a7, init_gaincode); in wlc_phy_workarounds_nphy_gainctrl()
15939 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_RFSEQ, in wlc_phy_workarounds_nphy_gainctrl()
15940 pi->pubpi.phy_corenum, 0x106, 16, in wlc_phy_workarounds_nphy_gainctrl()
15943 write_phy_reg(pi, 0x22, clip1hi_gaincode); in wlc_phy_workarounds_nphy_gainctrl()
15944 write_phy_reg(pi, 0x2a9, clip1hi_gaincode); in wlc_phy_workarounds_nphy_gainctrl()
15946 write_phy_reg(pi, 0x24, clip1md_gaincode); in wlc_phy_workarounds_nphy_gainctrl()
15947 write_phy_reg(pi, 0x2ab, clip1md_gaincode); in wlc_phy_workarounds_nphy_gainctrl()
15949 write_phy_reg(pi, 0x37, clip1lo_gaincode); in wlc_phy_workarounds_nphy_gainctrl()
15950 write_phy_reg(pi, 0x2ad, clip1lo_gaincode); in wlc_phy_workarounds_nphy_gainctrl()
15952 mod_phy_reg(pi, 0x27d, (0xff << 0), (crsmin_th << 0)); in wlc_phy_workarounds_nphy_gainctrl()
15953 mod_phy_reg(pi, 0x280, (0xff << 0), (crsminl_th << 0)); in wlc_phy_workarounds_nphy_gainctrl()
15954 mod_phy_reg(pi, 0x283, (0xff << 0), (crsminu_th << 0)); in wlc_phy_workarounds_nphy_gainctrl()
15956 write_phy_reg(pi, 0x2b, nbclip_th); in wlc_phy_workarounds_nphy_gainctrl()
15957 write_phy_reg(pi, 0x41, nbclip_th); in wlc_phy_workarounds_nphy_gainctrl()
15959 mod_phy_reg(pi, 0x27, (0x3f << 0), (w1clip_th << 0)); in wlc_phy_workarounds_nphy_gainctrl()
15960 mod_phy_reg(pi, 0x3d, (0x3f << 0), (w1clip_th << 0)); in wlc_phy_workarounds_nphy_gainctrl()
15962 write_phy_reg(pi, 0x150, 0x809c); in wlc_phy_workarounds_nphy_gainctrl()
15966 mod_phy_reg(pi, 0x1c, (0x1 << 13), (1 << 13)); in wlc_phy_workarounds_nphy_gainctrl()
15967 mod_phy_reg(pi, 0x32, (0x1 << 13), (1 << 13)); in wlc_phy_workarounds_nphy_gainctrl()
15969 write_phy_reg(pi, 0x2b, 0x84); in wlc_phy_workarounds_nphy_gainctrl()
15970 write_phy_reg(pi, 0x41, 0x84); in wlc_phy_workarounds_nphy_gainctrl()
15972 if (CHSPEC_IS20(pi->radio_chanspec)) { in wlc_phy_workarounds_nphy_gainctrl()
15973 write_phy_reg(pi, 0x6b, 0x2b); in wlc_phy_workarounds_nphy_gainctrl()
15974 write_phy_reg(pi, 0x6c, 0x2b); in wlc_phy_workarounds_nphy_gainctrl()
15975 write_phy_reg(pi, 0x6d, 0x9); in wlc_phy_workarounds_nphy_gainctrl()
15976 write_phy_reg(pi, 0x6e, 0x9); in wlc_phy_workarounds_nphy_gainctrl()
15980 mod_phy_reg(pi, 0x27, (0x3f << 0), (w1th << 0)); in wlc_phy_workarounds_nphy_gainctrl()
15981 mod_phy_reg(pi, 0x3d, (0x3f << 0), (w1th << 0)); in wlc_phy_workarounds_nphy_gainctrl()
15983 if (CHSPEC_IS20(pi->radio_chanspec)) { in wlc_phy_workarounds_nphy_gainctrl()
15984 mod_phy_reg(pi, 0x1c, (0x1f << 0), (0x1 << 0)); in wlc_phy_workarounds_nphy_gainctrl()
15985 mod_phy_reg(pi, 0x32, (0x1f << 0), (0x1 << 0)); in wlc_phy_workarounds_nphy_gainctrl()
15987 mod_phy_reg(pi, 0x1d, (0x1f << 0), (0x1 << 0)); in wlc_phy_workarounds_nphy_gainctrl()
15988 mod_phy_reg(pi, 0x33, (0x1f << 0), (0x1 << 0)); in wlc_phy_workarounds_nphy_gainctrl()
15991 write_phy_reg(pi, 0x150, 0x809c); in wlc_phy_workarounds_nphy_gainctrl()
15993 if (pi->nphy_gain_boost) in wlc_phy_workarounds_nphy_gainctrl()
15994 if ((CHSPEC_IS2G(pi->radio_chanspec)) && in wlc_phy_workarounds_nphy_gainctrl()
15995 (CHSPEC_IS40(pi->radio_chanspec))) in wlc_phy_workarounds_nphy_gainctrl()
15999 else if (CHSPEC_IS40(pi->radio_chanspec)) in wlc_phy_workarounds_nphy_gainctrl()
16004 mod_phy_reg(pi, 0x20, (0x1f << 7), (hpf_code << 7)); in wlc_phy_workarounds_nphy_gainctrl()
16005 mod_phy_reg(pi, 0x36, (0x1f << 7), (hpf_code << 7)); in wlc_phy_workarounds_nphy_gainctrl()
16009 wlc_phy_table_write_nphy(pi, 7, 4, 0x106, 16, regval); in wlc_phy_workarounds_nphy_gainctrl()
16011 wlc_phy_adjust_lnagaintbl_nphy(pi); in wlc_phy_workarounds_nphy_gainctrl()
16013 if (pi->nphy_elna_gain_config) { in wlc_phy_workarounds_nphy_gainctrl()
16018 wlc_phy_table_write_nphy(pi, 2, 4, 8, 16, regval); in wlc_phy_workarounds_nphy_gainctrl()
16019 wlc_phy_table_write_nphy(pi, 3, 4, 8, 16, regval); in wlc_phy_workarounds_nphy_gainctrl()
16023 wlc_phy_table_write_nphy(pi, 7, 4, 0x106, 16, regval); in wlc_phy_workarounds_nphy_gainctrl()
16026 if (NREV_IS(pi->pubpi.phy_rev, 2)) { in wlc_phy_workarounds_nphy_gainctrl()
16029 wlc_phy_table_write_nphy(pi, 0, 21, 32, 16, regval); in wlc_phy_workarounds_nphy_gainctrl()
16030 wlc_phy_table_write_nphy(pi, 1, 21, 32, 16, regval); in wlc_phy_workarounds_nphy_gainctrl()
16034 wlc_phy_table_write_nphy(pi, 2, 21, 32, 16, regval); in wlc_phy_workarounds_nphy_gainctrl()
16035 wlc_phy_table_write_nphy(pi, 3, 21, 32, 16, regval); in wlc_phy_workarounds_nphy_gainctrl()
16038 wlc_phy_set_rfseq_nphy(pi, NPHY_RFSEQ_UPDATEGAINU, in wlc_phy_workarounds_nphy_gainctrl()
16043 mod_phy_reg(pi, 0x153, (0xff << 8), (90 << 8)); in wlc_phy_workarounds_nphy_gainctrl()
16045 if (CHSPEC_IS2G(pi->radio_chanspec)) in wlc_phy_workarounds_nphy_gainctrl()
16046 mod_phy_reg(pi, in wlc_phy_workarounds_nphy_gainctrl()
16052 static void wlc_phy_workarounds_nphy_rev7(struct brcms_phy *pi) in wlc_phy_workarounds_nphy_rev7() argument
16106 if (NREV_IS(pi->pubpi.phy_rev, 7)) { in wlc_phy_workarounds_nphy_rev7()
16107 mod_phy_reg(pi, 0x221, (0x1 << 4), (1 << 4)); in wlc_phy_workarounds_nphy_rev7()
16109 mod_phy_reg(pi, 0x160, (0x7f << 0), (32 << 0)); in wlc_phy_workarounds_nphy_rev7()
16110 mod_phy_reg(pi, 0x160, (0x7f << 8), (39 << 8)); in wlc_phy_workarounds_nphy_rev7()
16111 mod_phy_reg(pi, 0x161, (0x7f << 0), (46 << 0)); in wlc_phy_workarounds_nphy_rev7()
16112 mod_phy_reg(pi, 0x161, (0x7f << 8), (51 << 8)); in wlc_phy_workarounds_nphy_rev7()
16113 mod_phy_reg(pi, 0x162, (0x7f << 0), (55 << 0)); in wlc_phy_workarounds_nphy_rev7()
16114 mod_phy_reg(pi, 0x162, (0x7f << 8), (58 << 8)); in wlc_phy_workarounds_nphy_rev7()
16115 mod_phy_reg(pi, 0x163, (0x7f << 0), (60 << 0)); in wlc_phy_workarounds_nphy_rev7()
16116 mod_phy_reg(pi, 0x163, (0x7f << 8), (62 << 8)); in wlc_phy_workarounds_nphy_rev7()
16117 mod_phy_reg(pi, 0x164, (0x7f << 0), (62 << 0)); in wlc_phy_workarounds_nphy_rev7()
16118 mod_phy_reg(pi, 0x164, (0x7f << 8), (63 << 8)); in wlc_phy_workarounds_nphy_rev7()
16119 mod_phy_reg(pi, 0x165, (0x7f << 0), (63 << 0)); in wlc_phy_workarounds_nphy_rev7()
16120 mod_phy_reg(pi, 0x165, (0x7f << 8), (64 << 8)); in wlc_phy_workarounds_nphy_rev7()
16121 mod_phy_reg(pi, 0x166, (0x7f << 0), (64 << 0)); in wlc_phy_workarounds_nphy_rev7()
16122 mod_phy_reg(pi, 0x166, (0x7f << 8), (64 << 8)); in wlc_phy_workarounds_nphy_rev7()
16123 mod_phy_reg(pi, 0x167, (0x7f << 0), (64 << 0)); in wlc_phy_workarounds_nphy_rev7()
16124 mod_phy_reg(pi, 0x167, (0x7f << 8), (64 << 8)); in wlc_phy_workarounds_nphy_rev7()
16127 if (NREV_LE(pi->pubpi.phy_rev, 8)) { in wlc_phy_workarounds_nphy_rev7()
16128 write_phy_reg(pi, 0x23f, 0x1b0); in wlc_phy_workarounds_nphy_rev7()
16129 write_phy_reg(pi, 0x240, 0x1b0); in wlc_phy_workarounds_nphy_rev7()
16132 if (NREV_GE(pi->pubpi.phy_rev, 8)) in wlc_phy_workarounds_nphy_rev7()
16133 mod_phy_reg(pi, 0xbd, (0xff << 0), (114 << 0)); in wlc_phy_workarounds_nphy_rev7()
16135 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 1, 0x00, 16, in wlc_phy_workarounds_nphy_rev7()
16137 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 1, 0x10, 16, in wlc_phy_workarounds_nphy_rev7()
16140 wlc_phy_table_read_nphy(pi, NPHY_TBL_ID_CMPMETRICDATAWEIGHTTBL, in wlc_phy_workarounds_nphy_rev7()
16143 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_CMPMETRICDATAWEIGHTTBL, in wlc_phy_workarounds_nphy_rev7()
16146 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_RFSEQ, in wlc_phy_workarounds_nphy_rev7()
16148 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_RFSEQ, 2, 0x16e, 16, in wlc_phy_workarounds_nphy_rev7()
16151 if (PHY_IPA(pi)) in wlc_phy_workarounds_nphy_rev7()
16152 wlc_phy_set_rfseq_nphy(pi, NPHY_RFSEQ_RX2TX, in wlc_phy_workarounds_nphy_rev7()
16158 mod_phy_reg(pi, 0x299, (0x3 << 14), (0x1 << 14)); in wlc_phy_workarounds_nphy_rev7()
16159 mod_phy_reg(pi, 0x29d, (0x3 << 14), (0x1 << 14)); in wlc_phy_workarounds_nphy_rev7()
16161 tx_lpf_bw_ofdm_20mhz = wlc_phy_read_lpf_bw_ctl_nphy(pi, 0x154); in wlc_phy_workarounds_nphy_rev7()
16162 tx_lpf_bw_ofdm_40mhz = wlc_phy_read_lpf_bw_ctl_nphy(pi, 0x159); in wlc_phy_workarounds_nphy_rev7()
16163 tx_lpf_bw_11b = wlc_phy_read_lpf_bw_ctl_nphy(pi, 0x152); in wlc_phy_workarounds_nphy_rev7()
16165 if (PHY_IPA(pi)) { in wlc_phy_workarounds_nphy_rev7()
16167 if (((pi->pubpi.radiorev == 5) in wlc_phy_workarounds_nphy_rev7()
16168 && (CHSPEC_IS40(pi->radio_chanspec) == 1)) in wlc_phy_workarounds_nphy_rev7()
16169 || (pi->pubpi.radiorev == 7) in wlc_phy_workarounds_nphy_rev7()
16170 || (pi->pubpi.radiorev == 8)) { in wlc_phy_workarounds_nphy_rev7()
16173 read_radio_reg(pi, RADIO_2057_RCCAL_BCAP_VAL); in wlc_phy_workarounds_nphy_rev7()
16175 read_radio_reg(pi, RADIO_2057_RCCAL_SCAP_VAL); in wlc_phy_workarounds_nphy_rev7()
16180 if ((pi->pubpi.radiorev == 5) && in wlc_phy_workarounds_nphy_rev7()
16181 (CHSPEC_IS40(pi->radio_chanspec) == 1)) { in wlc_phy_workarounds_nphy_rev7()
16190 } else if ((pi->pubpi.radiorev == 7) in wlc_phy_workarounds_nphy_rev7()
16191 || (pi->pubpi.radiorev == 8)) { in wlc_phy_workarounds_nphy_rev7()
16196 if (CHSPEC_IS2G(pi->radio_chanspec)) { in wlc_phy_workarounds_nphy_rev7()
16214 if (pi->pubpi.radiorev == 5) { in wlc_phy_workarounds_nphy_rev7()
16220 read_radio_reg(pi, RADIO_2057_RCCAL_BCAP_VAL); in wlc_phy_workarounds_nphy_rev7()
16222 read_radio_reg(pi, RADIO_2057_RCCAL_SCAP_VAL); in wlc_phy_workarounds_nphy_rev7()
16249 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_RFSEQ, 1, in wlc_phy_workarounds_nphy_rev7()
16252 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_RFSEQ, 1, in wlc_phy_workarounds_nphy_rev7()
16255 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_RFSEQ, 1, in wlc_phy_workarounds_nphy_rev7()
16258 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_RFSEQ, 1, in wlc_phy_workarounds_nphy_rev7()
16261 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_RFSEQ, 1, in wlc_phy_workarounds_nphy_rev7()
16264 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_RFSEQ, 1, in wlc_phy_workarounds_nphy_rev7()
16267 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_RFSEQ, 1, in wlc_phy_workarounds_nphy_rev7()
16270 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_RFSEQ, 1, in wlc_phy_workarounds_nphy_rev7()
16275 wlc_phy_rfctrl_override_nphy_rev7(pi, (0x1 << 4), 1, 0x3, 0, in wlc_phy_workarounds_nphy_rev7()
16279 write_phy_reg(pi, 0x32f, 0x3); in wlc_phy_workarounds_nphy_rev7()
16281 if ((pi->pubpi.radiorev == 4) || (pi->pubpi.radiorev == 6)) in wlc_phy_workarounds_nphy_rev7()
16282 wlc_phy_rfctrl_override_nphy_rev7(pi, (0x1 << 2), 1, 0x3, 0, in wlc_phy_workarounds_nphy_rev7()
16285 if ((pi->pubpi.radiorev == 3) || (pi->pubpi.radiorev == 4) || in wlc_phy_workarounds_nphy_rev7()
16286 (pi->pubpi.radiorev == 6)) { in wlc_phy_workarounds_nphy_rev7()
16287 if ((pi->sh->sromrev >= 8) in wlc_phy_workarounds_nphy_rev7()
16288 && (pi->sh->boardflags2 & BFL2_IPALVLSHIFT_3P3)) in wlc_phy_workarounds_nphy_rev7()
16292 write_radio_reg(pi, RADIO_2057_GPAIO_CONFIG, 0x5); in wlc_phy_workarounds_nphy_rev7()
16293 write_radio_reg(pi, RADIO_2057_GPAIO_SEL1, 0x30); in wlc_phy_workarounds_nphy_rev7()
16294 write_radio_reg(pi, RADIO_2057_GPAIO_SEL0, 0x0); in wlc_phy_workarounds_nphy_rev7()
16295 or_radio_reg(pi, RADIO_2057_RXTXBIAS_CONFIG_CORE0, 0x1); in wlc_phy_workarounds_nphy_rev7()
16296 or_radio_reg(pi, RADIO_2057_RXTXBIAS_CONFIG_CORE1, 0x1); in wlc_phy_workarounds_nphy_rev7()
16312 if (CHSPEC_IS2G(pi->radio_chanspec)) { in wlc_phy_workarounds_nphy_rev7()
16314 WRITE_RADIO_REG4(pi, RADIO_2057, CORE, in wlc_phy_workarounds_nphy_rev7()
16317 WRITE_RADIO_REG4(pi, RADIO_2057, CORE, in wlc_phy_workarounds_nphy_rev7()
16320 WRITE_RADIO_REG4(pi, RADIO_2057, CORE, in wlc_phy_workarounds_nphy_rev7()
16328 if (PHY_IPA(pi)) { in wlc_phy_workarounds_nphy_rev7()
16329 if (CHSPEC_IS2G(pi->radio_chanspec)) { in wlc_phy_workarounds_nphy_rev7()
16330 if ((pi->pubpi.radiorev == 3) in wlc_phy_workarounds_nphy_rev7()
16331 || (pi->pubpi.radiorev == 4) in wlc_phy_workarounds_nphy_rev7()
16332 || (pi->pubpi.radiorev == 6)) in wlc_phy_workarounds_nphy_rev7()
16337 WRITE_RADIO_REG4(pi, RADIO_2057, in wlc_phy_workarounds_nphy_rev7()
16343 if (pi->pubpi.radiorev == 5) { in wlc_phy_workarounds_nphy_rev7()
16345 WRITE_RADIO_REG4(pi, RADIO_2057, in wlc_phy_workarounds_nphy_rev7()
16349 WRITE_RADIO_REG4(pi, RADIO_2057, in wlc_phy_workarounds_nphy_rev7()
16353 WRITE_RADIO_REG4(pi, RADIO_2057, in wlc_phy_workarounds_nphy_rev7()
16357 WRITE_RADIO_REG4(pi, RADIO_2057, in wlc_phy_workarounds_nphy_rev7()
16361 WRITE_RADIO_REG4(pi, RADIO_2057, in wlc_phy_workarounds_nphy_rev7()
16366 } else if ((pi->pubpi.radiorev == 7) || in wlc_phy_workarounds_nphy_rev7()
16367 (pi->pubpi.radiorev == 8)) { in wlc_phy_workarounds_nphy_rev7()
16369 if (CHSPEC_IS40(pi->radio_chanspec) == 0) { in wlc_phy_workarounds_nphy_rev7()
16370 WRITE_RADIO_REG4(pi, RADIO_2057, CORE, in wlc_phy_workarounds_nphy_rev7()
16372 WRITE_RADIO_REG4(pi, RADIO_2057, CORE, in wlc_phy_workarounds_nphy_rev7()
16375 WRITE_RADIO_REG4(pi, RADIO_2057, CORE, in wlc_phy_workarounds_nphy_rev7()
16377 WRITE_RADIO_REG4(pi, RADIO_2057, CORE, in wlc_phy_workarounds_nphy_rev7()
16385 (pi->radio_chanspec)); in wlc_phy_workarounds_nphy_rev7()
16388 WRITE_RADIO_REG4(pi, RADIO_2057, CORE, in wlc_phy_workarounds_nphy_rev7()
16390 WRITE_RADIO_REG4(pi, RADIO_2057, CORE, in wlc_phy_workarounds_nphy_rev7()
16396 if (pi->pubpi.radiorev != 5) { in wlc_phy_workarounds_nphy_rev7()
16398 WRITE_RADIO_REG4(pi, RADIO_2057, CORE, coreNum, in wlc_phy_workarounds_nphy_rev7()
16400 WRITE_RADIO_REG4(pi, RADIO_2057, CORE, coreNum, in wlc_phy_workarounds_nphy_rev7()
16406 if (pi->pubpi.radiorev == 4) { in wlc_phy_workarounds_nphy_rev7()
16407 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 1, 0x05, 16, in wlc_phy_workarounds_nphy_rev7()
16409 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 1, 0x15, 16, in wlc_phy_workarounds_nphy_rev7()
16413 WRITE_RADIO_REG4(pi, RADIO_2057, CORE, coreNum, in wlc_phy_workarounds_nphy_rev7()
16415 WRITE_RADIO_REG4(pi, RADIO_2057, CORE, coreNum, in wlc_phy_workarounds_nphy_rev7()
16417 WRITE_RADIO_REG4(pi, RADIO_2057, CORE, coreNum, in wlc_phy_workarounds_nphy_rev7()
16421 mod_phy_reg(pi, 0xa6, (0x1 << 2), (0x1 << 2)); in wlc_phy_workarounds_nphy_rev7()
16422 mod_phy_reg(pi, 0x8f, (0x1 << 2), (0x1 << 2)); in wlc_phy_workarounds_nphy_rev7()
16423 mod_phy_reg(pi, 0xa7, (0x1 << 2), (0x1 << 2)); in wlc_phy_workarounds_nphy_rev7()
16424 mod_phy_reg(pi, 0xa5, (0x1 << 2), (0x1 << 2)); in wlc_phy_workarounds_nphy_rev7()
16426 mod_phy_reg(pi, 0xa6, (0x1 << 0), 0); in wlc_phy_workarounds_nphy_rev7()
16427 mod_phy_reg(pi, 0x8f, (0x1 << 0), (0x1 << 0)); in wlc_phy_workarounds_nphy_rev7()
16428 mod_phy_reg(pi, 0xa7, (0x1 << 0), 0); in wlc_phy_workarounds_nphy_rev7()
16429 mod_phy_reg(pi, 0xa5, (0x1 << 0), (0x1 << 0)); in wlc_phy_workarounds_nphy_rev7()
16431 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 1, 0x05, 16, in wlc_phy_workarounds_nphy_rev7()
16433 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 1, 0x15, 16, in wlc_phy_workarounds_nphy_rev7()
16436 mod_phy_reg(pi, 0xa6, (0x1 << 2), 0); in wlc_phy_workarounds_nphy_rev7()
16437 mod_phy_reg(pi, 0x8f, (0x1 << 2), 0); in wlc_phy_workarounds_nphy_rev7()
16438 mod_phy_reg(pi, 0xa7, (0x1 << 2), 0); in wlc_phy_workarounds_nphy_rev7()
16439 mod_phy_reg(pi, 0xa5, (0x1 << 2), 0); in wlc_phy_workarounds_nphy_rev7()
16442 write_phy_reg(pi, 0x6a, 0x2); in wlc_phy_workarounds_nphy_rev7()
16444 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_NOISEVAR, 1, 256, 32, in wlc_phy_workarounds_nphy_rev7()
16447 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_RFSEQ, 2, 0x138, 16, in wlc_phy_workarounds_nphy_rev7()
16450 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_RFSEQ, 1, 0x141, 16, in wlc_phy_workarounds_nphy_rev7()
16453 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_RFSEQ, 3, 0x133, 16, in wlc_phy_workarounds_nphy_rev7()
16456 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_RFSEQ, 2, 0x146, 16, in wlc_phy_workarounds_nphy_rev7()
16459 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_RFSEQ, 1, 0x123, 16, in wlc_phy_workarounds_nphy_rev7()
16462 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_RFSEQ, 1, 0x12A, 16, in wlc_phy_workarounds_nphy_rev7()
16465 if (CHSPEC_IS40(pi->radio_chanspec) == 0) { in wlc_phy_workarounds_nphy_rev7()
16466 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_NOISEVAR, 1, 3, in wlc_phy_workarounds_nphy_rev7()
16468 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_NOISEVAR, 1, in wlc_phy_workarounds_nphy_rev7()
16472 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_NOISEVAR, 1, 3, in wlc_phy_workarounds_nphy_rev7()
16476 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_NOISEVAR, 1, in wlc_phy_workarounds_nphy_rev7()
16480 wlc_phy_workarounds_nphy_gainctrl(pi); in wlc_phy_workarounds_nphy_rev7()
16482 pdetrange = (CHSPEC_IS5G(pi->radio_chanspec)) ? in wlc_phy_workarounds_nphy_rev7()
16483 pi->srom_fem5g.pdetrange : pi->srom_fem2g.pdetrange; in wlc_phy_workarounds_nphy_rev7()
16486 chan_freq_range = wlc_phy_get_chan_freq_range_nphy(pi, 0); in wlc_phy_workarounds_nphy_rev7()
16507 if (pi->pubpi.radioid == BCM2057_ID) { in wlc_phy_workarounds_nphy_rev7()
16508 if ((pi->pubpi.radiorev == 5) in wlc_phy_workarounds_nphy_rev7()
16509 || (pi->pubpi.radiorev == 7) in wlc_phy_workarounds_nphy_rev7()
16510 || (pi->pubpi.radiorev == 8)) { in wlc_phy_workarounds_nphy_rev7()
16544 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4, 0x08, 16, in wlc_phy_workarounds_nphy_rev7()
16546 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4, 0x18, 16, in wlc_phy_workarounds_nphy_rev7()
16548 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4, 0x0c, 16, in wlc_phy_workarounds_nphy_rev7()
16550 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4, 0x1c, 16, in wlc_phy_workarounds_nphy_rev7()
16554 static void wlc_phy_workarounds_nphy_rev3(struct brcms_phy *pi) in wlc_phy_workarounds_nphy_rev3() argument
16610 write_phy_reg(pi, 0x23f, 0x1f8); in wlc_phy_workarounds_nphy_rev3()
16611 write_phy_reg(pi, 0x240, 0x1f8); in wlc_phy_workarounds_nphy_rev3()
16613 wlc_phy_table_read_nphy(pi, NPHY_TBL_ID_CMPMETRICDATAWEIGHTTBL, in wlc_phy_workarounds_nphy_rev3()
16616 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_CMPMETRICDATAWEIGHTTBL, in wlc_phy_workarounds_nphy_rev3()
16625 write_phy_reg(pi, 0x145, alpha0); in wlc_phy_workarounds_nphy_rev3()
16626 write_phy_reg(pi, 0x146, alpha1); in wlc_phy_workarounds_nphy_rev3()
16627 write_phy_reg(pi, 0x147, alpha2); in wlc_phy_workarounds_nphy_rev3()
16628 write_phy_reg(pi, 0x148, beta0); in wlc_phy_workarounds_nphy_rev3()
16629 write_phy_reg(pi, 0x149, beta1); in wlc_phy_workarounds_nphy_rev3()
16630 write_phy_reg(pi, 0x14a, beta2); in wlc_phy_workarounds_nphy_rev3()
16632 write_phy_reg(pi, 0x38, 0xC); in wlc_phy_workarounds_nphy_rev3()
16633 write_phy_reg(pi, 0x2ae, 0xC); in wlc_phy_workarounds_nphy_rev3()
16635 wlc_phy_set_rfseq_nphy(pi, NPHY_RFSEQ_TX2RX, in wlc_phy_workarounds_nphy_rev3()
16640 if (PHY_IPA(pi)) in wlc_phy_workarounds_nphy_rev3()
16641 wlc_phy_set_rfseq_nphy(pi, NPHY_RFSEQ_RX2TX, in wlc_phy_workarounds_nphy_rev3()
16646 if ((pi->sh->hw_phyrxchain != 0x3) && in wlc_phy_workarounds_nphy_rev3()
16647 (pi->sh->hw_phyrxchain != pi->sh->hw_phytxchain)) { in wlc_phy_workarounds_nphy_rev3()
16649 if (PHY_IPA(pi)) { in wlc_phy_workarounds_nphy_rev3()
16655 wlc_phy_set_rfseq_nphy(pi, NPHY_RFSEQ_RX2TX, in wlc_phy_workarounds_nphy_rev3()
16661 if (CHSPEC_IS2G(pi->radio_chanspec)) in wlc_phy_workarounds_nphy_rev3()
16662 write_phy_reg(pi, 0x6a, 0x2); in wlc_phy_workarounds_nphy_rev3()
16664 write_phy_reg(pi, 0x6a, 0x9c40); in wlc_phy_workarounds_nphy_rev3()
16666 mod_phy_reg(pi, 0x294, (0xf << 8), (7 << 8)); in wlc_phy_workarounds_nphy_rev3()
16668 if (CHSPEC_IS40(pi->radio_chanspec) == 0) { in wlc_phy_workarounds_nphy_rev3()
16669 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_NOISEVAR, 1, 3, in wlc_phy_workarounds_nphy_rev3()
16671 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_NOISEVAR, 1, in wlc_phy_workarounds_nphy_rev3()
16675 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_NOISEVAR, 1, 3, in wlc_phy_workarounds_nphy_rev3()
16679 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_NOISEVAR, 1, in wlc_phy_workarounds_nphy_rev3()
16683 wlc_phy_workarounds_nphy_gainctrl(pi); in wlc_phy_workarounds_nphy_rev3()
16685 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 1, 0x00, 16, in wlc_phy_workarounds_nphy_rev3()
16687 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 1, 0x10, 16, in wlc_phy_workarounds_nphy_rev3()
16690 pdetrange = (CHSPEC_IS5G(pi->radio_chanspec)) ? in wlc_phy_workarounds_nphy_rev3()
16691 pi->srom_fem5g.pdetrange : pi->srom_fem2g.pdetrange; in wlc_phy_workarounds_nphy_rev3()
16694 if (NREV_GE(pi->pubpi.phy_rev, 4)) { in wlc_phy_workarounds_nphy_rev3()
16701 chan_freq_range = wlc_phy_get_chan_freq_range_nphy(pi, 0); in wlc_phy_workarounds_nphy_rev3()
16720 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4, in wlc_phy_workarounds_nphy_rev3()
16722 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4, in wlc_phy_workarounds_nphy_rev3()
16724 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4, in wlc_phy_workarounds_nphy_rev3()
16726 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4, in wlc_phy_workarounds_nphy_rev3()
16729 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4, in wlc_phy_workarounds_nphy_rev3()
16731 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4, in wlc_phy_workarounds_nphy_rev3()
16733 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4, in wlc_phy_workarounds_nphy_rev3()
16735 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4, in wlc_phy_workarounds_nphy_rev3()
16742 if (NREV_GE(pi->pubpi.phy_rev, 6)) { in wlc_phy_workarounds_nphy_rev3()
16744 wlc_phy_get_chan_freq_range_nphy(pi, 0); in wlc_phy_workarounds_nphy_rev3()
16752 } else if (NREV_IS(pi->pubpi.phy_rev, 5)) { in wlc_phy_workarounds_nphy_rev3()
16757 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4, in wlc_phy_workarounds_nphy_rev3()
16759 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4, in wlc_phy_workarounds_nphy_rev3()
16761 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4, in wlc_phy_workarounds_nphy_rev3()
16763 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4, in wlc_phy_workarounds_nphy_rev3()
16766 chan_freq_range = wlc_phy_get_chan_freq_range_nphy(pi, 0); in wlc_phy_workarounds_nphy_rev3()
16767 if ((NREV_GE(pi->pubpi.phy_rev, 4)) && in wlc_phy_workarounds_nphy_rev3()
16772 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4, in wlc_phy_workarounds_nphy_rev3()
16774 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4, in wlc_phy_workarounds_nphy_rev3()
16776 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4, in wlc_phy_workarounds_nphy_rev3()
16778 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4, in wlc_phy_workarounds_nphy_rev3()
16786 chan_freq_range = wlc_phy_get_chan_freq_range_nphy(pi, 0); in wlc_phy_workarounds_nphy_rev3()
16801 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4, in wlc_phy_workarounds_nphy_rev3()
16803 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4, in wlc_phy_workarounds_nphy_rev3()
16808 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4, in wlc_phy_workarounds_nphy_rev3()
16810 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4, in wlc_phy_workarounds_nphy_rev3()
16814 write_radio_reg(pi, (RADIO_2056_RX_MIXA_MAST_BIAS | RADIO_2056_RX0), 0x0); in wlc_phy_workarounds_nphy_rev3()
16815 write_radio_reg(pi, (RADIO_2056_RX_MIXA_MAST_BIAS | RADIO_2056_RX1), 0x0); in wlc_phy_workarounds_nphy_rev3()
16817 write_radio_reg(pi, (RADIO_2056_RX_MIXA_BIAS_MAIN | RADIO_2056_RX0), 0x6); in wlc_phy_workarounds_nphy_rev3()
16818 write_radio_reg(pi, (RADIO_2056_RX_MIXA_BIAS_MAIN | RADIO_2056_RX1), 0x6); in wlc_phy_workarounds_nphy_rev3()
16820 write_radio_reg(pi, (RADIO_2056_RX_MIXA_BIAS_AUX | RADIO_2056_RX0), 0x7); in wlc_phy_workarounds_nphy_rev3()
16821 write_radio_reg(pi, (RADIO_2056_RX_MIXA_BIAS_AUX | RADIO_2056_RX1), 0x7); in wlc_phy_workarounds_nphy_rev3()
16823 write_radio_reg(pi, (RADIO_2056_RX_MIXA_LOB_BIAS | RADIO_2056_RX0), 0x88); in wlc_phy_workarounds_nphy_rev3()
16824 write_radio_reg(pi, (RADIO_2056_RX_MIXA_LOB_BIAS | RADIO_2056_RX1), 0x88); in wlc_phy_workarounds_nphy_rev3()
16826 write_radio_reg(pi, (RADIO_2056_RX_MIXA_CMFB_IDAC | RADIO_2056_RX0), 0x0); in wlc_phy_workarounds_nphy_rev3()
16827 write_radio_reg(pi, (RADIO_2056_RX_MIXA_CMFB_IDAC | RADIO_2056_RX1), 0x0); in wlc_phy_workarounds_nphy_rev3()
16829 write_radio_reg(pi, (RADIO_2056_RX_MIXG_CMFB_IDAC | RADIO_2056_RX0), 0x0); in wlc_phy_workarounds_nphy_rev3()
16830 write_radio_reg(pi, (RADIO_2056_RX_MIXG_CMFB_IDAC | RADIO_2056_RX1), 0x0); in wlc_phy_workarounds_nphy_rev3()
16832 triso = (CHSPEC_IS5G(pi->radio_chanspec)) ? in wlc_phy_workarounds_nphy_rev3()
16833 pi->srom_fem5g.triso : pi->srom_fem2g.triso; in wlc_phy_workarounds_nphy_rev3()
16835 wlc_phy_war_force_trsw_to_R_cliplo_nphy(pi, PHY_CORE_0); in wlc_phy_workarounds_nphy_rev3()
16836 wlc_phy_war_force_trsw_to_R_cliplo_nphy(pi, PHY_CORE_1); in wlc_phy_workarounds_nphy_rev3()
16839 wlc_phy_war_txchain_upd_nphy(pi, pi->sh->hw_phytxchain); in wlc_phy_workarounds_nphy_rev3()
16841 if (((pi->sh->boardflags2 & BFL2_APLL_WAR) && in wlc_phy_workarounds_nphy_rev3()
16842 (CHSPEC_IS5G(pi->radio_chanspec))) || in wlc_phy_workarounds_nphy_rev3()
16843 (((pi->sh->boardflags2 & BFL2_GPLL_WAR) || in wlc_phy_workarounds_nphy_rev3()
16844 (pi->sh->boardflags2 & BFL2_GPLL_WAR2)) && in wlc_phy_workarounds_nphy_rev3()
16845 (CHSPEC_IS2G(pi->radio_chanspec)))) { in wlc_phy_workarounds_nphy_rev3()
16854 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_CMPMETRICDATAWEIGHTTBL, in wlc_phy_workarounds_nphy_rev3()
16856 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_CMPMETRICDATAWEIGHTTBL, in wlc_phy_workarounds_nphy_rev3()
16858 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_CMPMETRICDATAWEIGHTTBL, in wlc_phy_workarounds_nphy_rev3()
16861 if (NREV_IS(pi->pubpi.phy_rev, 4)) { in wlc_phy_workarounds_nphy_rev3()
16862 if (CHSPEC_IS5G(pi->radio_chanspec)) { in wlc_phy_workarounds_nphy_rev3()
16863 write_radio_reg(pi, in wlc_phy_workarounds_nphy_rev3()
16866 write_radio_reg(pi, in wlc_phy_workarounds_nphy_rev3()
16872 if (!pi->edcrs_threshold_lock) { in wlc_phy_workarounds_nphy_rev3()
16873 write_phy_reg(pi, 0x224, 0x3eb); in wlc_phy_workarounds_nphy_rev3()
16874 write_phy_reg(pi, 0x225, 0x3eb); in wlc_phy_workarounds_nphy_rev3()
16875 write_phy_reg(pi, 0x226, 0x341); in wlc_phy_workarounds_nphy_rev3()
16876 write_phy_reg(pi, 0x227, 0x341); in wlc_phy_workarounds_nphy_rev3()
16877 write_phy_reg(pi, 0x228, 0x42b); in wlc_phy_workarounds_nphy_rev3()
16878 write_phy_reg(pi, 0x229, 0x42b); in wlc_phy_workarounds_nphy_rev3()
16879 write_phy_reg(pi, 0x22a, 0x381); in wlc_phy_workarounds_nphy_rev3()
16880 write_phy_reg(pi, 0x22b, 0x381); in wlc_phy_workarounds_nphy_rev3()
16881 write_phy_reg(pi, 0x22c, 0x42b); in wlc_phy_workarounds_nphy_rev3()
16882 write_phy_reg(pi, 0x22d, 0x42b); in wlc_phy_workarounds_nphy_rev3()
16883 write_phy_reg(pi, 0x22e, 0x381); in wlc_phy_workarounds_nphy_rev3()
16884 write_phy_reg(pi, 0x22f, 0x381); in wlc_phy_workarounds_nphy_rev3()
16887 if (NREV_GE(pi->pubpi.phy_rev, 6)) { in wlc_phy_workarounds_nphy_rev3()
16889 if (pi->sh->boardflags2 & BFL2_SINGLEANT_CCK) in wlc_phy_workarounds_nphy_rev3()
16890 wlapi_bmac_mhf(pi->sh->physhim, MHF4, in wlc_phy_workarounds_nphy_rev3()
16896 static void wlc_phy_workarounds_nphy_rev1(struct brcms_phy *pi) in wlc_phy_workarounds_nphy_rev1() argument
16922 if (pi->sh->boardflags2 & BFL2_SKWRKFEM_BRD || in wlc_phy_workarounds_nphy_rev1()
16923 (pi->sh->boardtype == 0x8b)) { in wlc_phy_workarounds_nphy_rev1()
16930 if (CHSPEC_IS5G(pi->radio_chanspec) && pi->phy_5g_pwrgain) { in wlc_phy_workarounds_nphy_rev1()
16931 and_radio_reg(pi, RADIO_2055_CORE1_TX_RF_SPARE, 0xf7); in wlc_phy_workarounds_nphy_rev1()
16932 and_radio_reg(pi, RADIO_2055_CORE2_TX_RF_SPARE, 0xf7); in wlc_phy_workarounds_nphy_rev1()
16934 or_radio_reg(pi, RADIO_2055_CORE1_TX_RF_SPARE, 0x8); in wlc_phy_workarounds_nphy_rev1()
16935 or_radio_reg(pi, RADIO_2055_CORE2_TX_RF_SPARE, 0x8); in wlc_phy_workarounds_nphy_rev1()
16939 wlc_phy_table_write_nphy(pi, 8, 1, 0, 16, ®val); in wlc_phy_workarounds_nphy_rev1()
16940 wlc_phy_table_write_nphy(pi, 8, 1, 0x10, 16, ®val); in wlc_phy_workarounds_nphy_rev1()
16942 if (NREV_LT(pi->pubpi.phy_rev, 3)) { in wlc_phy_workarounds_nphy_rev1()
16944 wlc_phy_table_write_nphy(pi, 8, 1, 0x02, 16, ®val); in wlc_phy_workarounds_nphy_rev1()
16945 wlc_phy_table_write_nphy(pi, 8, 1, 0x12, 16, ®val); in wlc_phy_workarounds_nphy_rev1()
16948 if (NREV_LT(pi->pubpi.phy_rev, 2)) { in wlc_phy_workarounds_nphy_rev1()
16950 wlc_phy_table_write_nphy(pi, 8, 1, 0x08, 16, ®val); in wlc_phy_workarounds_nphy_rev1()
16951 wlc_phy_table_write_nphy(pi, 8, 1, 0x18, 16, ®val); in wlc_phy_workarounds_nphy_rev1()
16954 wlc_phy_table_write_nphy(pi, 8, 1, 0x07, 16, ®val); in wlc_phy_workarounds_nphy_rev1()
16955 wlc_phy_table_write_nphy(pi, 8, 1, 0x17, 16, ®val); in wlc_phy_workarounds_nphy_rev1()
16958 wlc_phy_table_write_nphy(pi, 8, 1, 0x06, 16, ®val); in wlc_phy_workarounds_nphy_rev1()
16959 wlc_phy_table_write_nphy(pi, 8, 1, 0x16, 16, ®val); in wlc_phy_workarounds_nphy_rev1()
16962 write_phy_reg(pi, 0xf8, 0x02d8); in wlc_phy_workarounds_nphy_rev1()
16963 write_phy_reg(pi, 0xf9, 0x0301); in wlc_phy_workarounds_nphy_rev1()
16964 write_phy_reg(pi, 0xfa, 0x02d8); in wlc_phy_workarounds_nphy_rev1()
16965 write_phy_reg(pi, 0xfb, 0x0301); in wlc_phy_workarounds_nphy_rev1()
16967 wlc_phy_set_rfseq_nphy(pi, NPHY_RFSEQ_RX2TX, rfseq_rx2tx_events, in wlc_phy_workarounds_nphy_rev1()
16971 wlc_phy_set_rfseq_nphy(pi, NPHY_RFSEQ_TX2RX, rfseq_tx2rx_events, in wlc_phy_workarounds_nphy_rev1()
16975 wlc_phy_workarounds_nphy_gainctrl(pi); in wlc_phy_workarounds_nphy_rev1()
16977 if (NREV_LT(pi->pubpi.phy_rev, 2)) { in wlc_phy_workarounds_nphy_rev1()
16979 if (read_phy_reg(pi, 0xa0) & NPHY_MLenable) in wlc_phy_workarounds_nphy_rev1()
16980 wlapi_bmac_mhf(pi->sh->physhim, MHF3, in wlc_phy_workarounds_nphy_rev1()
16984 } else if (NREV_IS(pi->pubpi.phy_rev, 2)) { in wlc_phy_workarounds_nphy_rev1()
16985 write_phy_reg(pi, 0x1e3, 0x0); in wlc_phy_workarounds_nphy_rev1()
16986 write_phy_reg(pi, 0x1e4, 0x0); in wlc_phy_workarounds_nphy_rev1()
16989 if (NREV_LT(pi->pubpi.phy_rev, 2)) in wlc_phy_workarounds_nphy_rev1()
16990 mod_phy_reg(pi, 0x90, (0x1 << 7), 0); in wlc_phy_workarounds_nphy_rev1()
16998 write_phy_reg(pi, 0x145, alpha0); in wlc_phy_workarounds_nphy_rev1()
16999 write_phy_reg(pi, 0x146, alpha1); in wlc_phy_workarounds_nphy_rev1()
17000 write_phy_reg(pi, 0x147, alpha2); in wlc_phy_workarounds_nphy_rev1()
17001 write_phy_reg(pi, 0x148, beta0); in wlc_phy_workarounds_nphy_rev1()
17002 write_phy_reg(pi, 0x149, beta1); in wlc_phy_workarounds_nphy_rev1()
17003 write_phy_reg(pi, 0x14a, beta2); in wlc_phy_workarounds_nphy_rev1()
17005 if (NREV_LT(pi->pubpi.phy_rev, 3)) { in wlc_phy_workarounds_nphy_rev1()
17006 mod_phy_reg(pi, 0x142, (0xf << 12), 0); in wlc_phy_workarounds_nphy_rev1()
17008 write_phy_reg(pi, 0x192, 0xb5); in wlc_phy_workarounds_nphy_rev1()
17009 write_phy_reg(pi, 0x193, 0xa4); in wlc_phy_workarounds_nphy_rev1()
17010 write_phy_reg(pi, 0x194, 0x0); in wlc_phy_workarounds_nphy_rev1()
17013 if (NREV_IS(pi->pubpi.phy_rev, 2)) in wlc_phy_workarounds_nphy_rev1()
17014 mod_phy_reg(pi, 0x221, in wlc_phy_workarounds_nphy_rev1()
17019 static void wlc_phy_workarounds_nphy(struct brcms_phy *pi) in wlc_phy_workarounds_nphy() argument
17021 if (CHSPEC_IS5G(pi->radio_chanspec)) in wlc_phy_workarounds_nphy()
17022 wlc_phy_classifier_nphy(pi, NPHY_ClassifierCtrl_cck_en, 0); in wlc_phy_workarounds_nphy()
17024 wlc_phy_classifier_nphy(pi, NPHY_ClassifierCtrl_cck_en, 1); in wlc_phy_workarounds_nphy()
17026 if (pi->phyhang_avoid) in wlc_phy_workarounds_nphy()
17027 wlc_phy_stay_in_carriersearch_nphy(pi, true); in wlc_phy_workarounds_nphy()
17029 or_phy_reg(pi, 0xb1, NPHY_IQFlip_ADC1 | NPHY_IQFlip_ADC2); in wlc_phy_workarounds_nphy()
17031 if (NREV_GE(pi->pubpi.phy_rev, 7)) in wlc_phy_workarounds_nphy()
17032 wlc_phy_workarounds_nphy_rev7(pi); in wlc_phy_workarounds_nphy()
17033 else if (NREV_GE(pi->pubpi.phy_rev, 3)) in wlc_phy_workarounds_nphy()
17034 wlc_phy_workarounds_nphy_rev3(pi); in wlc_phy_workarounds_nphy()
17036 wlc_phy_workarounds_nphy_rev1(pi); in wlc_phy_workarounds_nphy()
17038 if (pi->phyhang_avoid) in wlc_phy_workarounds_nphy()
17039 wlc_phy_stay_in_carriersearch_nphy(pi, false); in wlc_phy_workarounds_nphy()
17042 static void wlc_phy_extpa_set_tx_digi_filts_nphy(struct brcms_phy *pi) in wlc_phy_extpa_set_tx_digi_filts_nphy() argument
17048 write_phy_reg(pi, addr_offset + j, in wlc_phy_extpa_set_tx_digi_filts_nphy()
17052 static void wlc_phy_clip_det_nphy(struct brcms_phy *pi, u8 write, u16 *vals) in wlc_phy_clip_det_nphy() argument
17056 vals[0] = read_phy_reg(pi, 0x2c); in wlc_phy_clip_det_nphy()
17057 vals[1] = read_phy_reg(pi, 0x42); in wlc_phy_clip_det_nphy()
17059 write_phy_reg(pi, 0x2c, vals[0]); in wlc_phy_clip_det_nphy()
17060 write_phy_reg(pi, 0x42, vals[1]); in wlc_phy_clip_det_nphy()
17064 static void wlc_phy_ipa_internal_tssi_setup_nphy(struct brcms_phy *pi) in wlc_phy_ipa_internal_tssi_setup_nphy() argument
17068 if (NREV_GE(pi->pubpi.phy_rev, 7)) { in wlc_phy_ipa_internal_tssi_setup_nphy()
17069 for (core = 0; core < pi->pubpi.phy_corenum; core++) { in wlc_phy_ipa_internal_tssi_setup_nphy()
17070 if (CHSPEC_IS2G(pi->radio_chanspec)) { in wlc_phy_ipa_internal_tssi_setup_nphy()
17071 WRITE_RADIO_REG3(pi, RADIO_2057, TX, core, in wlc_phy_ipa_internal_tssi_setup_nphy()
17073 WRITE_RADIO_REG3(pi, RADIO_2057, TX, core, in wlc_phy_ipa_internal_tssi_setup_nphy()
17076 if (pi->pubpi.radiorev != 5) in wlc_phy_ipa_internal_tssi_setup_nphy()
17077 WRITE_RADIO_REG3(pi, RADIO_2057, TX, in wlc_phy_ipa_internal_tssi_setup_nphy()
17080 if (!NREV_IS(pi->pubpi.phy_rev, 7)) in wlc_phy_ipa_internal_tssi_setup_nphy()
17081 WRITE_RADIO_REG3(pi, RADIO_2057, TX, in wlc_phy_ipa_internal_tssi_setup_nphy()
17084 WRITE_RADIO_REG3(pi, RADIO_2057, TX, in wlc_phy_ipa_internal_tssi_setup_nphy()
17087 WRITE_RADIO_REG3(pi, RADIO_2057, TX, core, in wlc_phy_ipa_internal_tssi_setup_nphy()
17089 WRITE_RADIO_REG3(pi, RADIO_2057, TX, core, in wlc_phy_ipa_internal_tssi_setup_nphy()
17091 WRITE_RADIO_REG3(pi, RADIO_2057, TX, core, in wlc_phy_ipa_internal_tssi_setup_nphy()
17094 if (pi->pubpi.radiorev != 5) { in wlc_phy_ipa_internal_tssi_setup_nphy()
17095 if (!NREV_IS(pi->pubpi.phy_rev, 7)) in wlc_phy_ipa_internal_tssi_setup_nphy()
17096 WRITE_RADIO_REG3(pi, RADIO_2057, in wlc_phy_ipa_internal_tssi_setup_nphy()
17100 WRITE_RADIO_REG3(pi, RADIO_2057, in wlc_phy_ipa_internal_tssi_setup_nphy()
17105 WRITE_RADIO_REG3(pi, RADIO_2057, TX, core, IQCAL_VCM_HG, in wlc_phy_ipa_internal_tssi_setup_nphy()
17107 WRITE_RADIO_REG3(pi, RADIO_2057, TX, core, IQCAL_IDAC, in wlc_phy_ipa_internal_tssi_setup_nphy()
17109 WRITE_RADIO_REG3(pi, RADIO_2057, TX, core, TSSI_VCM, in wlc_phy_ipa_internal_tssi_setup_nphy()
17111 WRITE_RADIO_REG3(pi, RADIO_2057, TX, core, TSSI_MISC1, in wlc_phy_ipa_internal_tssi_setup_nphy()
17115 WRITE_RADIO_SYN(pi, RADIO_2056, RESERVED_ADDR31, in wlc_phy_ipa_internal_tssi_setup_nphy()
17116 (CHSPEC_IS2G(pi->radio_chanspec)) ? 0x128 : in wlc_phy_ipa_internal_tssi_setup_nphy()
17118 WRITE_RADIO_SYN(pi, RADIO_2056, RESERVED_ADDR30, 0x0); in wlc_phy_ipa_internal_tssi_setup_nphy()
17119 WRITE_RADIO_SYN(pi, RADIO_2056, GPIO_MASTER1, 0x29); in wlc_phy_ipa_internal_tssi_setup_nphy()
17121 for (core = 0; core < pi->pubpi.phy_corenum; core++) { in wlc_phy_ipa_internal_tssi_setup_nphy()
17122 WRITE_RADIO_REG2(pi, RADIO_2056, TX, core, IQCAL_VCM_HG, in wlc_phy_ipa_internal_tssi_setup_nphy()
17124 WRITE_RADIO_REG2(pi, RADIO_2056, TX, core, IQCAL_IDAC, in wlc_phy_ipa_internal_tssi_setup_nphy()
17126 WRITE_RADIO_REG2(pi, RADIO_2056, TX, core, TSSI_VCM, in wlc_phy_ipa_internal_tssi_setup_nphy()
17128 WRITE_RADIO_REG2(pi, RADIO_2056, TX, core, TX_AMP_DET, in wlc_phy_ipa_internal_tssi_setup_nphy()
17130 WRITE_RADIO_REG2(pi, RADIO_2056, TX, core, TSSI_MISC1, in wlc_phy_ipa_internal_tssi_setup_nphy()
17132 WRITE_RADIO_REG2(pi, RADIO_2056, TX, core, TSSI_MISC2, in wlc_phy_ipa_internal_tssi_setup_nphy()
17134 WRITE_RADIO_REG2(pi, RADIO_2056, TX, core, TSSI_MISC3, in wlc_phy_ipa_internal_tssi_setup_nphy()
17137 if (CHSPEC_IS2G(pi->radio_chanspec)) { in wlc_phy_ipa_internal_tssi_setup_nphy()
17138 WRITE_RADIO_REG2(pi, RADIO_2056, TX, core, in wlc_phy_ipa_internal_tssi_setup_nphy()
17141 if (pi->pubpi.radiorev != 5) in wlc_phy_ipa_internal_tssi_setup_nphy()
17142 WRITE_RADIO_REG2(pi, RADIO_2056, TX, in wlc_phy_ipa_internal_tssi_setup_nphy()
17144 if (NREV_GE(pi->pubpi.phy_rev, 5)) in wlc_phy_ipa_internal_tssi_setup_nphy()
17145 WRITE_RADIO_REG2(pi, RADIO_2056, TX, in wlc_phy_ipa_internal_tssi_setup_nphy()
17148 WRITE_RADIO_REG2(pi, RADIO_2056, TX, in wlc_phy_ipa_internal_tssi_setup_nphy()
17150 WRITE_RADIO_REG2(pi, RADIO_2056, TX, core, in wlc_phy_ipa_internal_tssi_setup_nphy()
17153 WRITE_RADIO_REG2(pi, RADIO_2056, TX, core, in wlc_phy_ipa_internal_tssi_setup_nphy()
17155 WRITE_RADIO_REG2(pi, RADIO_2056, TX, core, in wlc_phy_ipa_internal_tssi_setup_nphy()
17157 WRITE_RADIO_REG2(pi, RADIO_2056, TX, core, in wlc_phy_ipa_internal_tssi_setup_nphy()
17159 WRITE_RADIO_REG2(pi, RADIO_2056, TX, core, in wlc_phy_ipa_internal_tssi_setup_nphy()
17167 wlc_phy_rfctrl_override_nphy(struct brcms_phy *pi, u16 field, u16 value, in wlc_phy_rfctrl_override_nphy() argument
17175 if (NREV_GE(pi->pubpi.phy_rev, 3) && NREV_LT(pi->pubpi.phy_rev, 7)) { in wlc_phy_rfctrl_override_nphy()
17280 and_phy_reg(pi, en_addr, ~en_mask); in wlc_phy_rfctrl_override_nphy()
17281 and_phy_reg(pi, val_addr, ~val_mask); in wlc_phy_rfctrl_override_nphy()
17286 or_phy_reg(pi, en_addr, en_mask); in wlc_phy_rfctrl_override_nphy()
17289 mod_phy_reg(pi, val_addr, in wlc_phy_rfctrl_override_nphy()
17299 and_phy_reg(pi, 0xec, ~field); in wlc_phy_rfctrl_override_nphy()
17302 or_phy_reg(pi, 0xec, field); in wlc_phy_rfctrl_override_nphy()
17400 mod_phy_reg(pi, addr, mask, (value << shift)); in wlc_phy_rfctrl_override_nphy()
17403 or_phy_reg(pi, 0xec, (0x1 << 0)); in wlc_phy_rfctrl_override_nphy()
17404 or_phy_reg(pi, 0x78, (0x1 << 0)); in wlc_phy_rfctrl_override_nphy()
17406 and_phy_reg(pi, 0xec, ~(0x1 << 0)); in wlc_phy_rfctrl_override_nphy()
17410 static void wlc_phy_txpwrctrl_idle_tssi_nphy(struct brcms_phy *pi) in wlc_phy_txpwrctrl_idle_tssi_nphy() argument
17415 if (SCAN_RM_IN_PROGRESS(pi) || PLT_INPROG_PHY(pi) || PHY_MUTED(pi)) in wlc_phy_txpwrctrl_idle_tssi_nphy()
17419 if (PHY_IPA(pi)) in wlc_phy_txpwrctrl_idle_tssi_nphy()
17420 wlc_phy_ipa_internal_tssi_setup_nphy(pi); in wlc_phy_txpwrctrl_idle_tssi_nphy()
17422 if (NREV_GE(pi->pubpi.phy_rev, 7)) in wlc_phy_txpwrctrl_idle_tssi_nphy()
17423 wlc_phy_rfctrl_override_nphy_rev7(pi, (0x1 << 12), in wlc_phy_txpwrctrl_idle_tssi_nphy()
17426 else if (NREV_GE(pi->pubpi.phy_rev, 3)) in wlc_phy_txpwrctrl_idle_tssi_nphy()
17427 wlc_phy_rfctrl_override_nphy(pi, (0x1 << 13), 0, 3, 0); in wlc_phy_txpwrctrl_idle_tssi_nphy()
17429 wlc_phy_stopplayback_nphy(pi); in wlc_phy_txpwrctrl_idle_tssi_nphy()
17431 wlc_phy_tx_tone_nphy(pi, 4000, 0, 0, 0, false); in wlc_phy_txpwrctrl_idle_tssi_nphy()
17435 wlc_phy_poll_rssi_nphy(pi, (u8) NPHY_RSSI_SEL_TSSI_2G, rssi_buf, in wlc_phy_txpwrctrl_idle_tssi_nphy()
17437 wlc_phy_stopplayback_nphy(pi); in wlc_phy_txpwrctrl_idle_tssi_nphy()
17438 wlc_phy_rssisel_nphy(pi, RADIO_MIMO_CORESEL_OFF, 0); in wlc_phy_txpwrctrl_idle_tssi_nphy()
17440 if (NREV_GE(pi->pubpi.phy_rev, 7)) in wlc_phy_txpwrctrl_idle_tssi_nphy()
17441 wlc_phy_rfctrl_override_nphy_rev7(pi, (0x1 << 12), in wlc_phy_txpwrctrl_idle_tssi_nphy()
17444 else if (NREV_GE(pi->pubpi.phy_rev, 3)) in wlc_phy_txpwrctrl_idle_tssi_nphy()
17445 wlc_phy_rfctrl_override_nphy(pi, (0x1 << 13), 0, 3, 1); in wlc_phy_txpwrctrl_idle_tssi_nphy()
17447 if (NREV_GE(pi->pubpi.phy_rev, 3)) { in wlc_phy_txpwrctrl_idle_tssi_nphy()
17449 pi->nphy_pwrctrl_info[PHY_CORE_0].idle_tssi_2g = in wlc_phy_txpwrctrl_idle_tssi_nphy()
17451 pi->nphy_pwrctrl_info[PHY_CORE_0].idle_tssi_5g = in wlc_phy_txpwrctrl_idle_tssi_nphy()
17454 pi->nphy_pwrctrl_info[PHY_CORE_1].idle_tssi_2g = in wlc_phy_txpwrctrl_idle_tssi_nphy()
17456 pi->nphy_pwrctrl_info[PHY_CORE_1].idle_tssi_5g = in wlc_phy_txpwrctrl_idle_tssi_nphy()
17459 pi->nphy_pwrctrl_info[PHY_CORE_0].idle_tssi_2g = in wlc_phy_txpwrctrl_idle_tssi_nphy()
17462 pi->nphy_pwrctrl_info[PHY_CORE_1].idle_tssi_2g = in wlc_phy_txpwrctrl_idle_tssi_nphy()
17465 pi->nphy_pwrctrl_info[PHY_CORE_0].idle_tssi_5g = in wlc_phy_txpwrctrl_idle_tssi_nphy()
17467 pi->nphy_pwrctrl_info[PHY_CORE_1].idle_tssi_5g = in wlc_phy_txpwrctrl_idle_tssi_nphy()
17473 static void wlc_phy_txpwr_limit_to_tbl_nphy(struct brcms_phy *pi) in wlc_phy_txpwr_limit_to_tbl_nphy() argument
17478 pi->adj_pwr_tbl_nphy[idx] = pi->tx_power_offset[idx]; in wlc_phy_txpwr_limit_to_tbl_nphy()
17488 if (CHSPEC_IS40(pi->radio_chanspec) in wlc_phy_txpwr_limit_to_tbl_nphy()
17492 idx = (CHSPEC_IS40(pi->radio_chanspec)) ? in wlc_phy_txpwr_limit_to_tbl_nphy()
17500 idx = (CHSPEC_IS40(pi->radio_chanspec)) ? in wlc_phy_txpwr_limit_to_tbl_nphy()
17506 idx = (CHSPEC_IS40(pi->radio_chanspec)) ? in wlc_phy_txpwr_limit_to_tbl_nphy()
17512 idx = (CHSPEC_IS40(pi->radio_chanspec)) ? in wlc_phy_txpwr_limit_to_tbl_nphy()
17517 pi->adj_pwr_tbl_nphy[4 + 4 * (idx2++) + i] = in wlc_phy_txpwr_limit_to_tbl_nphy()
17518 pi->tx_power_offset[idx]; in wlc_phy_txpwr_limit_to_tbl_nphy()
17520 pi->adj_pwr_tbl_nphy[4 + 4 * (idx2++) + i] = in wlc_phy_txpwr_limit_to_tbl_nphy()
17521 pi->tx_power_offset[idx]; in wlc_phy_txpwr_limit_to_tbl_nphy()
17522 pi->adj_pwr_tbl_nphy[4 + 4 * (idx2++) + i] = in wlc_phy_txpwr_limit_to_tbl_nphy()
17523 pi->tx_power_offset[idx]; in wlc_phy_txpwr_limit_to_tbl_nphy()
17524 pi->adj_pwr_tbl_nphy[4 + 4 * (idx2++) + i] = in wlc_phy_txpwr_limit_to_tbl_nphy()
17525 pi->tx_power_offset[idx++]; in wlc_phy_txpwr_limit_to_tbl_nphy()
17527 pi->adj_pwr_tbl_nphy[4 + 4 * (idx2++) + i] = in wlc_phy_txpwr_limit_to_tbl_nphy()
17528 pi->tx_power_offset[idx++]; in wlc_phy_txpwr_limit_to_tbl_nphy()
17529 pi->adj_pwr_tbl_nphy[4 + 4 * (idx2++) + i] = in wlc_phy_txpwr_limit_to_tbl_nphy()
17530 pi->tx_power_offset[idx]; in wlc_phy_txpwr_limit_to_tbl_nphy()
17531 pi->adj_pwr_tbl_nphy[4 + 4 * (idx2++) + i] = in wlc_phy_txpwr_limit_to_tbl_nphy()
17532 pi->tx_power_offset[idx]; in wlc_phy_txpwr_limit_to_tbl_nphy()
17533 pi->adj_pwr_tbl_nphy[4 + 4 * (idx2++) + i] = in wlc_phy_txpwr_limit_to_tbl_nphy()
17534 pi->tx_power_offset[idx++]; in wlc_phy_txpwr_limit_to_tbl_nphy()
17536 pi->adj_pwr_tbl_nphy[4 + 4 * (idx2++) + i] = in wlc_phy_txpwr_limit_to_tbl_nphy()
17537 pi->tx_power_offset[idx++]; in wlc_phy_txpwr_limit_to_tbl_nphy()
17538 pi->adj_pwr_tbl_nphy[4 + 4 * (idx2++) + i] = in wlc_phy_txpwr_limit_to_tbl_nphy()
17539 pi->tx_power_offset[idx]; in wlc_phy_txpwr_limit_to_tbl_nphy()
17540 pi->adj_pwr_tbl_nphy[4 + 4 * (idx2++) + i] = in wlc_phy_txpwr_limit_to_tbl_nphy()
17541 pi->tx_power_offset[idx]; in wlc_phy_txpwr_limit_to_tbl_nphy()
17542 pi->adj_pwr_tbl_nphy[4 + 4 * (idx2++) + i] = in wlc_phy_txpwr_limit_to_tbl_nphy()
17543 pi->tx_power_offset[idx++]; in wlc_phy_txpwr_limit_to_tbl_nphy()
17545 pi->adj_pwr_tbl_nphy[4 + 4 * (idx2++) + i] = in wlc_phy_txpwr_limit_to_tbl_nphy()
17546 pi->tx_power_offset[idx]; in wlc_phy_txpwr_limit_to_tbl_nphy()
17547 pi->adj_pwr_tbl_nphy[4 + 4 * (idx2++) + i] = in wlc_phy_txpwr_limit_to_tbl_nphy()
17548 pi->tx_power_offset[idx++]; in wlc_phy_txpwr_limit_to_tbl_nphy()
17549 pi->adj_pwr_tbl_nphy[4 + 4 * (idx2++) + i] = in wlc_phy_txpwr_limit_to_tbl_nphy()
17550 pi->tx_power_offset[idx]; in wlc_phy_txpwr_limit_to_tbl_nphy()
17552 pi->adj_pwr_tbl_nphy[4 + 4 * (idx2++) + i] = in wlc_phy_txpwr_limit_to_tbl_nphy()
17553 pi->tx_power_offset[idx]; in wlc_phy_txpwr_limit_to_tbl_nphy()
17555 pi->adj_pwr_tbl_nphy[4 + 4 * (idx2++) + i] = in wlc_phy_txpwr_limit_to_tbl_nphy()
17556 pi->tx_power_offset[idx]; in wlc_phy_txpwr_limit_to_tbl_nphy()
17557 pi->adj_pwr_tbl_nphy[4 + 4 * (idx2++) + i] = in wlc_phy_txpwr_limit_to_tbl_nphy()
17558 pi->tx_power_offset[idx]; in wlc_phy_txpwr_limit_to_tbl_nphy()
17559 pi->adj_pwr_tbl_nphy[4 + 4 * (idx2++) + i] = in wlc_phy_txpwr_limit_to_tbl_nphy()
17560 pi->tx_power_offset[idx]; in wlc_phy_txpwr_limit_to_tbl_nphy()
17561 pi->adj_pwr_tbl_nphy[4 + 4 * (idx2++) + i] = in wlc_phy_txpwr_limit_to_tbl_nphy()
17562 pi->tx_power_offset[idx]; in wlc_phy_txpwr_limit_to_tbl_nphy()
17566 static void wlc_phy_txpwrctrl_pwr_setup_nphy(struct brcms_phy *pi) in wlc_phy_txpwrctrl_pwr_setup_nphy() argument
17578 if (D11REV_IS(pi->sh->corerev, 11) || D11REV_IS(pi->sh->corerev, 12)) { in wlc_phy_txpwrctrl_pwr_setup_nphy()
17579 wlapi_bmac_mctrl(pi->sh->physhim, MCTL_PHYLOCK, MCTL_PHYLOCK); in wlc_phy_txpwrctrl_pwr_setup_nphy()
17580 (void)bcma_read32(pi->d11core, D11REGOFFS(maccontrol)); in wlc_phy_txpwrctrl_pwr_setup_nphy()
17584 if (pi->phyhang_avoid) in wlc_phy_txpwrctrl_pwr_setup_nphy()
17585 wlc_phy_stay_in_carriersearch_nphy(pi, true); in wlc_phy_txpwrctrl_pwr_setup_nphy()
17587 or_phy_reg(pi, 0x122, (0x1 << 0)); in wlc_phy_txpwrctrl_pwr_setup_nphy()
17589 if (NREV_GE(pi->pubpi.phy_rev, 3)) in wlc_phy_txpwrctrl_pwr_setup_nphy()
17590 and_phy_reg(pi, 0x1e7, (u16) (~(0x1 << 15))); in wlc_phy_txpwrctrl_pwr_setup_nphy()
17592 or_phy_reg(pi, 0x1e7, (0x1 << 15)); in wlc_phy_txpwrctrl_pwr_setup_nphy()
17594 if (D11REV_IS(pi->sh->corerev, 11) || D11REV_IS(pi->sh->corerev, 12)) in wlc_phy_txpwrctrl_pwr_setup_nphy()
17595 wlapi_bmac_mctrl(pi->sh->physhim, MCTL_PHYLOCK, 0); in wlc_phy_txpwrctrl_pwr_setup_nphy()
17597 if (pi->sh->sromrev < 4) { in wlc_phy_txpwrctrl_pwr_setup_nphy()
17598 idle_tssi[0] = pi->nphy_pwrctrl_info[0].idle_tssi_2g; in wlc_phy_txpwrctrl_pwr_setup_nphy()
17599 idle_tssi[1] = pi->nphy_pwrctrl_info[1].idle_tssi_2g; in wlc_phy_txpwrctrl_pwr_setup_nphy()
17608 chan_freq_range = wlc_phy_get_chan_freq_range_nphy(pi, 0); in wlc_phy_txpwrctrl_pwr_setup_nphy()
17611 idle_tssi[0] = pi->nphy_pwrctrl_info[0].idle_tssi_2g; in wlc_phy_txpwrctrl_pwr_setup_nphy()
17612 idle_tssi[1] = pi->nphy_pwrctrl_info[1].idle_tssi_2g; in wlc_phy_txpwrctrl_pwr_setup_nphy()
17613 a1[0] = pi->nphy_pwrctrl_info[0].pwrdet_2g_a1; in wlc_phy_txpwrctrl_pwr_setup_nphy()
17614 a1[1] = pi->nphy_pwrctrl_info[1].pwrdet_2g_a1; in wlc_phy_txpwrctrl_pwr_setup_nphy()
17615 b0[0] = pi->nphy_pwrctrl_info[0].pwrdet_2g_b0; in wlc_phy_txpwrctrl_pwr_setup_nphy()
17616 b0[1] = pi->nphy_pwrctrl_info[1].pwrdet_2g_b0; in wlc_phy_txpwrctrl_pwr_setup_nphy()
17617 b1[0] = pi->nphy_pwrctrl_info[0].pwrdet_2g_b1; in wlc_phy_txpwrctrl_pwr_setup_nphy()
17618 b1[1] = pi->nphy_pwrctrl_info[1].pwrdet_2g_b1; in wlc_phy_txpwrctrl_pwr_setup_nphy()
17621 idle_tssi[0] = pi->nphy_pwrctrl_info[0].idle_tssi_5g; in wlc_phy_txpwrctrl_pwr_setup_nphy()
17622 idle_tssi[1] = pi->nphy_pwrctrl_info[1].idle_tssi_5g; in wlc_phy_txpwrctrl_pwr_setup_nphy()
17623 a1[0] = pi->nphy_pwrctrl_info[0].pwrdet_5gl_a1; in wlc_phy_txpwrctrl_pwr_setup_nphy()
17624 a1[1] = pi->nphy_pwrctrl_info[1].pwrdet_5gl_a1; in wlc_phy_txpwrctrl_pwr_setup_nphy()
17625 b0[0] = pi->nphy_pwrctrl_info[0].pwrdet_5gl_b0; in wlc_phy_txpwrctrl_pwr_setup_nphy()
17626 b0[1] = pi->nphy_pwrctrl_info[1].pwrdet_5gl_b0; in wlc_phy_txpwrctrl_pwr_setup_nphy()
17627 b1[0] = pi->nphy_pwrctrl_info[0].pwrdet_5gl_b1; in wlc_phy_txpwrctrl_pwr_setup_nphy()
17628 b1[1] = pi->nphy_pwrctrl_info[1].pwrdet_5gl_b1; in wlc_phy_txpwrctrl_pwr_setup_nphy()
17631 idle_tssi[0] = pi->nphy_pwrctrl_info[0].idle_tssi_5g; in wlc_phy_txpwrctrl_pwr_setup_nphy()
17632 idle_tssi[1] = pi->nphy_pwrctrl_info[1].idle_tssi_5g; in wlc_phy_txpwrctrl_pwr_setup_nphy()
17633 a1[0] = pi->nphy_pwrctrl_info[0].pwrdet_5gm_a1; in wlc_phy_txpwrctrl_pwr_setup_nphy()
17634 a1[1] = pi->nphy_pwrctrl_info[1].pwrdet_5gm_a1; in wlc_phy_txpwrctrl_pwr_setup_nphy()
17635 b0[0] = pi->nphy_pwrctrl_info[0].pwrdet_5gm_b0; in wlc_phy_txpwrctrl_pwr_setup_nphy()
17636 b0[1] = pi->nphy_pwrctrl_info[1].pwrdet_5gm_b0; in wlc_phy_txpwrctrl_pwr_setup_nphy()
17637 b1[0] = pi->nphy_pwrctrl_info[0].pwrdet_5gm_b1; in wlc_phy_txpwrctrl_pwr_setup_nphy()
17638 b1[1] = pi->nphy_pwrctrl_info[1].pwrdet_5gm_b1; in wlc_phy_txpwrctrl_pwr_setup_nphy()
17641 idle_tssi[0] = pi->nphy_pwrctrl_info[0].idle_tssi_5g; in wlc_phy_txpwrctrl_pwr_setup_nphy()
17642 idle_tssi[1] = pi->nphy_pwrctrl_info[1].idle_tssi_5g; in wlc_phy_txpwrctrl_pwr_setup_nphy()
17643 a1[0] = pi->nphy_pwrctrl_info[0].pwrdet_5gh_a1; in wlc_phy_txpwrctrl_pwr_setup_nphy()
17644 a1[1] = pi->nphy_pwrctrl_info[1].pwrdet_5gh_a1; in wlc_phy_txpwrctrl_pwr_setup_nphy()
17645 b0[0] = pi->nphy_pwrctrl_info[0].pwrdet_5gh_b0; in wlc_phy_txpwrctrl_pwr_setup_nphy()
17646 b0[1] = pi->nphy_pwrctrl_info[1].pwrdet_5gh_b0; in wlc_phy_txpwrctrl_pwr_setup_nphy()
17647 b1[0] = pi->nphy_pwrctrl_info[0].pwrdet_5gh_b1; in wlc_phy_txpwrctrl_pwr_setup_nphy()
17648 b1[1] = pi->nphy_pwrctrl_info[1].pwrdet_5gh_b1; in wlc_phy_txpwrctrl_pwr_setup_nphy()
17651 idle_tssi[0] = pi->nphy_pwrctrl_info[0].idle_tssi_2g; in wlc_phy_txpwrctrl_pwr_setup_nphy()
17652 idle_tssi[1] = pi->nphy_pwrctrl_info[1].idle_tssi_2g; in wlc_phy_txpwrctrl_pwr_setup_nphy()
17664 target_pwr_qtrdbm[0] = (s8) pi->tx_power_max; in wlc_phy_txpwrctrl_pwr_setup_nphy()
17665 target_pwr_qtrdbm[1] = (s8) pi->tx_power_max; in wlc_phy_txpwrctrl_pwr_setup_nphy()
17667 if (NREV_GE(pi->pubpi.phy_rev, 3)) { in wlc_phy_txpwrctrl_pwr_setup_nphy()
17668 if (pi->srom_fem2g.tssipos) in wlc_phy_txpwrctrl_pwr_setup_nphy()
17669 or_phy_reg(pi, 0x1e9, (0x1 << 14)); in wlc_phy_txpwrctrl_pwr_setup_nphy()
17671 if (NREV_GE(pi->pubpi.phy_rev, 7)) { in wlc_phy_txpwrctrl_pwr_setup_nphy()
17673 if (PHY_IPA(pi)) { in wlc_phy_txpwrctrl_pwr_setup_nphy()
17674 if (CHSPEC_IS2G(pi->radio_chanspec)) in wlc_phy_txpwrctrl_pwr_setup_nphy()
17675 WRITE_RADIO_REG3(pi, RADIO_2057, in wlc_phy_txpwrctrl_pwr_setup_nphy()
17680 WRITE_RADIO_REG3(pi, RADIO_2057, in wlc_phy_txpwrctrl_pwr_setup_nphy()
17687 if (PHY_IPA(pi)) { in wlc_phy_txpwrctrl_pwr_setup_nphy()
17689 write_radio_reg(pi, RADIO_2056_TX_TX_SSI_MUX | in wlc_phy_txpwrctrl_pwr_setup_nphy()
17692 (pi->radio_chanspec)) ? in wlc_phy_txpwrctrl_pwr_setup_nphy()
17694 write_radio_reg(pi, in wlc_phy_txpwrctrl_pwr_setup_nphy()
17698 (pi->radio_chanspec)) ? in wlc_phy_txpwrctrl_pwr_setup_nphy()
17702 write_radio_reg(pi, RADIO_2056_TX_TX_SSI_MUX | in wlc_phy_txpwrctrl_pwr_setup_nphy()
17704 write_radio_reg(pi, RADIO_2056_TX_TX_SSI_MUX | in wlc_phy_txpwrctrl_pwr_setup_nphy()
17710 if (D11REV_IS(pi->sh->corerev, 11) || D11REV_IS(pi->sh->corerev, 12)) { in wlc_phy_txpwrctrl_pwr_setup_nphy()
17711 wlapi_bmac_mctrl(pi->sh->physhim, MCTL_PHYLOCK, MCTL_PHYLOCK); in wlc_phy_txpwrctrl_pwr_setup_nphy()
17712 (void)bcma_read32(pi->d11core, D11REGOFFS(maccontrol)); in wlc_phy_txpwrctrl_pwr_setup_nphy()
17716 if (NREV_GE(pi->pubpi.phy_rev, 7)) in wlc_phy_txpwrctrl_pwr_setup_nphy()
17717 mod_phy_reg(pi, 0x1e7, (0x7f << 0), in wlc_phy_txpwrctrl_pwr_setup_nphy()
17720 mod_phy_reg(pi, 0x1e7, (0x7f << 0), in wlc_phy_txpwrctrl_pwr_setup_nphy()
17723 if (NREV_GE(pi->pubpi.phy_rev, 7)) in wlc_phy_txpwrctrl_pwr_setup_nphy()
17724 mod_phy_reg(pi, 0x222, (0xff << 0), in wlc_phy_txpwrctrl_pwr_setup_nphy()
17726 else if (NREV_GT(pi->pubpi.phy_rev, 1)) in wlc_phy_txpwrctrl_pwr_setup_nphy()
17727 mod_phy_reg(pi, 0x222, (0xff << 0), in wlc_phy_txpwrctrl_pwr_setup_nphy()
17730 if (D11REV_IS(pi->sh->corerev, 11) || D11REV_IS(pi->sh->corerev, 12)) in wlc_phy_txpwrctrl_pwr_setup_nphy()
17731 wlapi_bmac_mctrl(pi->sh->physhim, MCTL_PHYLOCK, 0); in wlc_phy_txpwrctrl_pwr_setup_nphy()
17733 write_phy_reg(pi, 0x1e8, (0x3 << 8) | (240 << 0)); in wlc_phy_txpwrctrl_pwr_setup_nphy()
17735 write_phy_reg(pi, 0x1e9, in wlc_phy_txpwrctrl_pwr_setup_nphy()
17738 write_phy_reg(pi, 0x1ea, in wlc_phy_txpwrctrl_pwr_setup_nphy()
17752 if (NREV_LT(pi->pubpi.phy_rev, 3)) { in wlc_phy_txpwrctrl_pwr_setup_nphy()
17762 wlc_phy_table_write_nphy(pi, tbl_id, tbl_len, tbl_offset, 32, in wlc_phy_txpwrctrl_pwr_setup_nphy()
17766 wlc_phy_txpwr_limit_to_tbl_nphy(pi); in wlc_phy_txpwrctrl_pwr_setup_nphy()
17767 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_CORE1TXPWRCTL, 84, 64, 8, in wlc_phy_txpwrctrl_pwr_setup_nphy()
17768 pi->adj_pwr_tbl_nphy); in wlc_phy_txpwrctrl_pwr_setup_nphy()
17769 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_CORE2TXPWRCTL, 84, 64, 8, in wlc_phy_txpwrctrl_pwr_setup_nphy()
17770 pi->adj_pwr_tbl_nphy); in wlc_phy_txpwrctrl_pwr_setup_nphy()
17772 if (pi->phyhang_avoid) in wlc_phy_txpwrctrl_pwr_setup_nphy()
17773 wlc_phy_stay_in_carriersearch_nphy(pi, false); in wlc_phy_txpwrctrl_pwr_setup_nphy()
17776 static u32 *wlc_phy_get_ipa_gaintbl_nphy(struct brcms_phy *pi) in wlc_phy_get_ipa_gaintbl_nphy() argument
17780 if (CHSPEC_IS2G(pi->radio_chanspec)) { in wlc_phy_get_ipa_gaintbl_nphy()
17781 if (NREV_GE(pi->pubpi.phy_rev, 7)) { in wlc_phy_get_ipa_gaintbl_nphy()
17782 if ((pi->pubpi.radiorev == 4) in wlc_phy_get_ipa_gaintbl_nphy()
17783 || (pi->pubpi.radiorev == 6)) in wlc_phy_get_ipa_gaintbl_nphy()
17786 else if (pi->pubpi.radiorev == 3) in wlc_phy_get_ipa_gaintbl_nphy()
17789 else if (pi->pubpi.radiorev == 5) in wlc_phy_get_ipa_gaintbl_nphy()
17792 else if ((pi->pubpi.radiorev == 7) in wlc_phy_get_ipa_gaintbl_nphy()
17793 || (pi->pubpi.radiorev == 8)) in wlc_phy_get_ipa_gaintbl_nphy()
17796 } else if (NREV_IS(pi->pubpi.phy_rev, 6)) { in wlc_phy_get_ipa_gaintbl_nphy()
17798 if (pi->sh->chip == BCMA_CHIP_ID_BCM47162) in wlc_phy_get_ipa_gaintbl_nphy()
17800 } else if (NREV_IS(pi->pubpi.phy_rev, 5)) { in wlc_phy_get_ipa_gaintbl_nphy()
17807 if (NREV_GE(pi->pubpi.phy_rev, 7)) { in wlc_phy_get_ipa_gaintbl_nphy()
17808 if ((pi->pubpi.radiorev == 3) || in wlc_phy_get_ipa_gaintbl_nphy()
17809 (pi->pubpi.radiorev == 4) || in wlc_phy_get_ipa_gaintbl_nphy()
17810 (pi->pubpi.radiorev == 6)) in wlc_phy_get_ipa_gaintbl_nphy()
17812 else if ((pi->pubpi.radiorev == 7) in wlc_phy_get_ipa_gaintbl_nphy()
17813 || (pi->pubpi.radiorev == 8)) in wlc_phy_get_ipa_gaintbl_nphy()
17824 static void wlc_phy_restore_rssical_nphy(struct brcms_phy *pi) in wlc_phy_restore_rssical_nphy() argument
17826 if (CHSPEC_IS2G(pi->radio_chanspec)) { in wlc_phy_restore_rssical_nphy()
17827 if (pi->nphy_rssical_chanspec_2G == 0) in wlc_phy_restore_rssical_nphy()
17830 if (NREV_GE(pi->pubpi.phy_rev, 7)) { in wlc_phy_restore_rssical_nphy()
17831 mod_radio_reg(pi, RADIO_2057_NB_MASTER_CORE0, in wlc_phy_restore_rssical_nphy()
17833 pi->rssical_cache. in wlc_phy_restore_rssical_nphy()
17835 mod_radio_reg(pi, RADIO_2057_NB_MASTER_CORE1, in wlc_phy_restore_rssical_nphy()
17837 pi->rssical_cache. in wlc_phy_restore_rssical_nphy()
17840 mod_radio_reg(pi, in wlc_phy_restore_rssical_nphy()
17843 pi->rssical_cache. in wlc_phy_restore_rssical_nphy()
17845 mod_radio_reg(pi, in wlc_phy_restore_rssical_nphy()
17848 pi->rssical_cache. in wlc_phy_restore_rssical_nphy()
17852 write_phy_reg(pi, 0x1a6, in wlc_phy_restore_rssical_nphy()
17853 pi->rssical_cache.rssical_phyregs_2G[0]); in wlc_phy_restore_rssical_nphy()
17854 write_phy_reg(pi, 0x1ac, in wlc_phy_restore_rssical_nphy()
17855 pi->rssical_cache.rssical_phyregs_2G[1]); in wlc_phy_restore_rssical_nphy()
17856 write_phy_reg(pi, 0x1b2, in wlc_phy_restore_rssical_nphy()
17857 pi->rssical_cache.rssical_phyregs_2G[2]); in wlc_phy_restore_rssical_nphy()
17858 write_phy_reg(pi, 0x1b8, in wlc_phy_restore_rssical_nphy()
17859 pi->rssical_cache.rssical_phyregs_2G[3]); in wlc_phy_restore_rssical_nphy()
17860 write_phy_reg(pi, 0x1a4, in wlc_phy_restore_rssical_nphy()
17861 pi->rssical_cache.rssical_phyregs_2G[4]); in wlc_phy_restore_rssical_nphy()
17862 write_phy_reg(pi, 0x1aa, in wlc_phy_restore_rssical_nphy()
17863 pi->rssical_cache.rssical_phyregs_2G[5]); in wlc_phy_restore_rssical_nphy()
17864 write_phy_reg(pi, 0x1b0, in wlc_phy_restore_rssical_nphy()
17865 pi->rssical_cache.rssical_phyregs_2G[6]); in wlc_phy_restore_rssical_nphy()
17866 write_phy_reg(pi, 0x1b6, in wlc_phy_restore_rssical_nphy()
17867 pi->rssical_cache.rssical_phyregs_2G[7]); in wlc_phy_restore_rssical_nphy()
17868 write_phy_reg(pi, 0x1a5, in wlc_phy_restore_rssical_nphy()
17869 pi->rssical_cache.rssical_phyregs_2G[8]); in wlc_phy_restore_rssical_nphy()
17870 write_phy_reg(pi, 0x1ab, in wlc_phy_restore_rssical_nphy()
17871 pi->rssical_cache.rssical_phyregs_2G[9]); in wlc_phy_restore_rssical_nphy()
17872 write_phy_reg(pi, 0x1b1, in wlc_phy_restore_rssical_nphy()
17873 pi->rssical_cache.rssical_phyregs_2G[10]); in wlc_phy_restore_rssical_nphy()
17874 write_phy_reg(pi, 0x1b7, in wlc_phy_restore_rssical_nphy()
17875 pi->rssical_cache.rssical_phyregs_2G[11]); in wlc_phy_restore_rssical_nphy()
17878 if (pi->nphy_rssical_chanspec_5G == 0) in wlc_phy_restore_rssical_nphy()
17881 if (NREV_GE(pi->pubpi.phy_rev, 7)) { in wlc_phy_restore_rssical_nphy()
17882 mod_radio_reg(pi, RADIO_2057_NB_MASTER_CORE0, in wlc_phy_restore_rssical_nphy()
17884 pi->rssical_cache. in wlc_phy_restore_rssical_nphy()
17886 mod_radio_reg(pi, RADIO_2057_NB_MASTER_CORE1, in wlc_phy_restore_rssical_nphy()
17888 pi->rssical_cache. in wlc_phy_restore_rssical_nphy()
17891 mod_radio_reg(pi, in wlc_phy_restore_rssical_nphy()
17894 pi->rssical_cache. in wlc_phy_restore_rssical_nphy()
17896 mod_radio_reg(pi, in wlc_phy_restore_rssical_nphy()
17899 pi->rssical_cache. in wlc_phy_restore_rssical_nphy()
17903 write_phy_reg(pi, 0x1a6, in wlc_phy_restore_rssical_nphy()
17904 pi->rssical_cache.rssical_phyregs_5G[0]); in wlc_phy_restore_rssical_nphy()
17905 write_phy_reg(pi, 0x1ac, in wlc_phy_restore_rssical_nphy()
17906 pi->rssical_cache.rssical_phyregs_5G[1]); in wlc_phy_restore_rssical_nphy()
17907 write_phy_reg(pi, 0x1b2, in wlc_phy_restore_rssical_nphy()
17908 pi->rssical_cache.rssical_phyregs_5G[2]); in wlc_phy_restore_rssical_nphy()
17909 write_phy_reg(pi, 0x1b8, in wlc_phy_restore_rssical_nphy()
17910 pi->rssical_cache.rssical_phyregs_5G[3]); in wlc_phy_restore_rssical_nphy()
17911 write_phy_reg(pi, 0x1a4, in wlc_phy_restore_rssical_nphy()
17912 pi->rssical_cache.rssical_phyregs_5G[4]); in wlc_phy_restore_rssical_nphy()
17913 write_phy_reg(pi, 0x1aa, in wlc_phy_restore_rssical_nphy()
17914 pi->rssical_cache.rssical_phyregs_5G[5]); in wlc_phy_restore_rssical_nphy()
17915 write_phy_reg(pi, 0x1b0, in wlc_phy_restore_rssical_nphy()
17916 pi->rssical_cache.rssical_phyregs_5G[6]); in wlc_phy_restore_rssical_nphy()
17917 write_phy_reg(pi, 0x1b6, in wlc_phy_restore_rssical_nphy()
17918 pi->rssical_cache.rssical_phyregs_5G[7]); in wlc_phy_restore_rssical_nphy()
17919 write_phy_reg(pi, 0x1a5, in wlc_phy_restore_rssical_nphy()
17920 pi->rssical_cache.rssical_phyregs_5G[8]); in wlc_phy_restore_rssical_nphy()
17921 write_phy_reg(pi, 0x1ab, in wlc_phy_restore_rssical_nphy()
17922 pi->rssical_cache.rssical_phyregs_5G[9]); in wlc_phy_restore_rssical_nphy()
17923 write_phy_reg(pi, 0x1b1, in wlc_phy_restore_rssical_nphy()
17924 pi->rssical_cache.rssical_phyregs_5G[10]); in wlc_phy_restore_rssical_nphy()
17925 write_phy_reg(pi, 0x1b7, in wlc_phy_restore_rssical_nphy()
17926 pi->rssical_cache.rssical_phyregs_5G[11]); in wlc_phy_restore_rssical_nphy()
17930 static void wlc_phy_internal_cal_txgain_nphy(struct brcms_phy *pi) in wlc_phy_internal_cal_txgain_nphy() argument
17934 pi->nphy_txcal_pwr_idx[0] = pi->nphy_cal_orig_pwr_idx[0]; in wlc_phy_internal_cal_txgain_nphy()
17935 pi->nphy_txcal_pwr_idx[1] = pi->nphy_cal_orig_pwr_idx[0]; in wlc_phy_internal_cal_txgain_nphy()
17936 wlc_phy_txpwr_index_nphy(pi, 1, pi->nphy_cal_orig_pwr_idx[0], true); in wlc_phy_internal_cal_txgain_nphy()
17937 wlc_phy_txpwr_index_nphy(pi, 2, pi->nphy_cal_orig_pwr_idx[1], true); in wlc_phy_internal_cal_txgain_nphy()
17939 wlc_phy_table_read_nphy(pi, NPHY_TBL_ID_RFSEQ, 2, 0x110, 16, in wlc_phy_internal_cal_txgain_nphy()
17942 if (CHSPEC_IS2G(pi->radio_chanspec)) { in wlc_phy_internal_cal_txgain_nphy()
17950 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_RFSEQ, 2, 0x110, 16, in wlc_phy_internal_cal_txgain_nphy()
17954 static void wlc_phy_precal_txgain_nphy(struct brcms_phy *pi) in wlc_phy_precal_txgain_nphy() argument
17960 if (pi->use_int_tx_iqlo_cal_nphy) { in wlc_phy_precal_txgain_nphy()
17961 if (NREV_GE(pi->pubpi.phy_rev, 7)) { in wlc_phy_precal_txgain_nphy()
17962 if ((pi->pubpi.radiorev == 3) || in wlc_phy_precal_txgain_nphy()
17963 (pi->pubpi.radiorev == 4) || in wlc_phy_precal_txgain_nphy()
17964 (pi->pubpi.radiorev == 6)) { in wlc_phy_precal_txgain_nphy()
17966 pi->nphy_txcal_pwr_idx[0] = in wlc_phy_precal_txgain_nphy()
17968 pi->nphy_txcal_pwr_idx[1] = in wlc_phy_precal_txgain_nphy()
17971 pi, 3, in wlc_phy_precal_txgain_nphy()
17976 pi->nphy_txcal_pwr_idx[0] = in wlc_phy_precal_txgain_nphy()
17978 pi->nphy_txcal_pwr_idx[1] = in wlc_phy_precal_txgain_nphy()
17981 pi, 3, in wlc_phy_precal_txgain_nphy()
17987 } else if (NREV_LT(pi->pubpi.phy_rev, 5)) { in wlc_phy_precal_txgain_nphy()
17988 wlc_phy_cal_txgainctrl_nphy(pi, 11, false); in wlc_phy_precal_txgain_nphy()
17989 if (pi->sh->hw_phytxchain != 3) { in wlc_phy_precal_txgain_nphy()
17990 pi->nphy_txcal_pwr_idx[1] = in wlc_phy_precal_txgain_nphy()
17991 pi->nphy_txcal_pwr_idx[0]; in wlc_phy_precal_txgain_nphy()
17992 wlc_phy_txpwr_index_nphy(pi, 3, in wlc_phy_precal_txgain_nphy()
17993 pi-> in wlc_phy_precal_txgain_nphy()
17999 } else if (NREV_IS(pi->pubpi.phy_rev, 5)) { in wlc_phy_precal_txgain_nphy()
18000 if (PHY_IPA(pi)) { in wlc_phy_precal_txgain_nphy()
18001 if (CHSPEC_IS2G(pi->radio_chanspec)) { in wlc_phy_precal_txgain_nphy()
18002 wlc_phy_cal_txgainctrl_nphy(pi, 12, in wlc_phy_precal_txgain_nphy()
18005 pi->nphy_txcal_pwr_idx[0] = 80; in wlc_phy_precal_txgain_nphy()
18006 pi->nphy_txcal_pwr_idx[1] = 80; in wlc_phy_precal_txgain_nphy()
18007 wlc_phy_txpwr_index_nphy(pi, 3, 80, in wlc_phy_precal_txgain_nphy()
18012 wlc_phy_internal_cal_txgain_nphy(pi); in wlc_phy_precal_txgain_nphy()
18016 } else if (NREV_IS(pi->pubpi.phy_rev, 6)) { in wlc_phy_precal_txgain_nphy()
18017 if (PHY_IPA(pi)) { in wlc_phy_precal_txgain_nphy()
18018 if (CHSPEC_IS2G(pi->radio_chanspec)) in wlc_phy_precal_txgain_nphy()
18019 wlc_phy_cal_txgainctrl_nphy(pi, 12, in wlc_phy_precal_txgain_nphy()
18022 wlc_phy_cal_txgainctrl_nphy(pi, 14, in wlc_phy_precal_txgain_nphy()
18025 wlc_phy_internal_cal_txgain_nphy(pi); in wlc_phy_precal_txgain_nphy()
18031 wlc_phy_cal_txgainctrl_nphy(pi, 10, false); in wlc_phy_precal_txgain_nphy()
18035 wlc_phy_table_read_nphy(pi, 15, 1, 87, 16, in wlc_phy_precal_txgain_nphy()
18036 &pi->nphy_txcal_bbmult); in wlc_phy_precal_txgain_nphy()
18040 wlc_phy_rfctrlintc_override_nphy(struct brcms_phy *pi, u8 field, u16 value, in wlc_phy_rfctrlintc_override_nphy() argument
18047 if (NREV_GE(pi->pubpi.phy_rev, 3)) { in wlc_phy_rfctrlintc_override_nphy()
18048 for (core = 0; core < pi->pubpi.phy_corenum; core++) { in wlc_phy_rfctrlintc_override_nphy()
18056 if (NREV_LT(pi->pubpi.phy_rev, 7)) { in wlc_phy_rfctrlintc_override_nphy()
18060 mod_phy_reg(pi, (core == PHY_CORE_0) ? 0x91 : in wlc_phy_rfctrlintc_override_nphy()
18066 write_phy_reg(pi, (core == PHY_CORE_0) ? 0x91 : in wlc_phy_rfctrlintc_override_nphy()
18069 wlc_phy_force_rfseq_nphy(pi, in wlc_phy_rfctrlintc_override_nphy()
18073 if (NREV_GE(pi->pubpi.phy_rev, 7)) { in wlc_phy_rfctrlintc_override_nphy()
18078 mod_phy_reg(pi, in wlc_phy_rfctrlintc_override_nphy()
18083 or_phy_reg(pi, in wlc_phy_rfctrlintc_override_nphy()
18088 and_phy_reg(pi, 0x2ff, (u16) in wlc_phy_rfctrlintc_override_nphy()
18090 or_phy_reg(pi, 0x2ff, (0x1 << 13)); in wlc_phy_rfctrlintc_override_nphy()
18091 or_phy_reg(pi, 0x2ff, (0x1 << 0)); in wlc_phy_rfctrlintc_override_nphy()
18098 mod_phy_reg(pi, in wlc_phy_rfctrlintc_override_nphy()
18105 mod_phy_reg(pi, in wlc_phy_rfctrlintc_override_nphy()
18114 mod_phy_reg(pi, 0x78, mask, val); in wlc_phy_rfctrlintc_override_nphy()
18116 SPINWAIT(((read_phy_reg(pi, 0x78) & val) in wlc_phy_rfctrlintc_override_nphy()
18118 if (WARN(read_phy_reg(pi, 0x78) & val, in wlc_phy_rfctrlintc_override_nphy()
18124 mod_phy_reg(pi, in wlc_phy_rfctrlintc_override_nphy()
18130 if (NREV_GE(pi->pubpi.phy_rev, 7)) { in wlc_phy_rfctrlintc_override_nphy()
18134 if (CHSPEC_IS5G(pi->radio_chanspec)) in wlc_phy_rfctrlintc_override_nphy()
18139 mod_phy_reg(pi, in wlc_phy_rfctrlintc_override_nphy()
18144 or_phy_reg(pi, in wlc_phy_rfctrlintc_override_nphy()
18150 if (CHSPEC_IS5G(pi->radio_chanspec)) { in wlc_phy_rfctrlintc_override_nphy()
18157 mod_phy_reg(pi, in wlc_phy_rfctrlintc_override_nphy()
18164 if (NREV_GE(pi->pubpi.phy_rev, 7)) { in wlc_phy_rfctrlintc_override_nphy()
18165 if (CHSPEC_IS5G(pi->radio_chanspec)) { in wlc_phy_rfctrlintc_override_nphy()
18169 mod_phy_reg(pi, in wlc_phy_rfctrlintc_override_nphy()
18175 mod_phy_reg(pi, in wlc_phy_rfctrlintc_override_nphy()
18183 mod_phy_reg(pi, in wlc_phy_rfctrlintc_override_nphy()
18189 mod_phy_reg(pi, in wlc_phy_rfctrlintc_override_nphy()
18197 mod_phy_reg(pi, in wlc_phy_rfctrlintc_override_nphy()
18203 if (CHSPEC_IS5G(pi->radio_chanspec)) { in wlc_phy_rfctrlintc_override_nphy()
18210 mod_phy_reg(pi, in wlc_phy_rfctrlintc_override_nphy()
18217 if (NREV_GE(pi->pubpi.phy_rev, 7)) { in wlc_phy_rfctrlintc_override_nphy()
18218 if (CHSPEC_IS5G(pi->radio_chanspec)) { in wlc_phy_rfctrlintc_override_nphy()
18222 mod_phy_reg(pi, in wlc_phy_rfctrlintc_override_nphy()
18228 mod_phy_reg(pi, in wlc_phy_rfctrlintc_override_nphy()
18236 mod_phy_reg(pi, in wlc_phy_rfctrlintc_override_nphy()
18242 mod_phy_reg(pi, in wlc_phy_rfctrlintc_override_nphy()
18250 mod_phy_reg(pi, in wlc_phy_rfctrlintc_override_nphy()
18256 if (CHSPEC_IS5G(pi->radio_chanspec)) { in wlc_phy_rfctrlintc_override_nphy()
18263 mod_phy_reg(pi, in wlc_phy_rfctrlintc_override_nphy()
18274 wlc_phy_cal_txgainctrl_nphy(struct brcms_phy *pi, s32 dBm_targetpower, in wlc_phy_cal_txgainctrl_nphy() argument
18290 if (NREV_GE(pi->pubpi.phy_rev, 7)) in wlc_phy_cal_txgainctrl_nphy()
18295 if (CHSPEC_IS40(pi->radio_chanspec)) in wlc_phy_cal_txgainctrl_nphy()
18300 wlc_phy_txpwr_index_nphy(pi, 1, pi->nphy_cal_orig_pwr_idx[0], true); in wlc_phy_cal_txgainctrl_nphy()
18301 wlc_phy_txpwr_index_nphy(pi, 2, pi->nphy_cal_orig_pwr_idx[1], true); in wlc_phy_cal_txgainctrl_nphy()
18303 if (pi->phyhang_avoid) in wlc_phy_cal_txgainctrl_nphy()
18304 wlc_phy_stay_in_carriersearch_nphy(pi, true); in wlc_phy_cal_txgainctrl_nphy()
18306 phyhang_avoid_state = pi->phyhang_avoid; in wlc_phy_cal_txgainctrl_nphy()
18307 pi->phyhang_avoid = false; in wlc_phy_cal_txgainctrl_nphy()
18309 phy_saveregs[0] = read_phy_reg(pi, 0x91); in wlc_phy_cal_txgainctrl_nphy()
18310 phy_saveregs[1] = read_phy_reg(pi, 0x92); in wlc_phy_cal_txgainctrl_nphy()
18311 phy_saveregs[2] = read_phy_reg(pi, 0xe7); in wlc_phy_cal_txgainctrl_nphy()
18312 phy_saveregs[3] = read_phy_reg(pi, 0xec); in wlc_phy_cal_txgainctrl_nphy()
18313 wlc_phy_rfctrlintc_override_nphy(pi, NPHY_RfctrlIntc_override_PA, 1, in wlc_phy_cal_txgainctrl_nphy()
18318 wlc_phy_rfctrlintc_override_nphy(pi, in wlc_phy_cal_txgainctrl_nphy()
18321 wlc_phy_rfctrlintc_override_nphy(pi, in wlc_phy_cal_txgainctrl_nphy()
18325 wlc_phy_rfctrlintc_override_nphy(pi, in wlc_phy_cal_txgainctrl_nphy()
18328 wlc_phy_rfctrlintc_override_nphy(pi, in wlc_phy_cal_txgainctrl_nphy()
18333 orig_BBConfig = read_phy_reg(pi, 0x01); in wlc_phy_cal_txgainctrl_nphy()
18334 mod_phy_reg(pi, 0x01, (0x1 << 15), 0); in wlc_phy_cal_txgainctrl_nphy()
18336 wlc_phy_table_read_nphy(pi, 15, 1, 87, 16, &m0m1); in wlc_phy_cal_txgainctrl_nphy()
18338 for (core = 0; core < pi->pubpi.phy_corenum; core++) { in wlc_phy_cal_txgainctrl_nphy()
18339 txpwrindex = (s32) pi->nphy_cal_orig_pwr_idx[core]; in wlc_phy_cal_txgainctrl_nphy()
18343 wlc_phy_tx_tone_nphy(pi, freq_test, ampl_test, 0, 0, in wlc_phy_cal_txgainctrl_nphy()
18351 wlc_phy_table_write_nphy(pi, 15, 1, 87, 16, &curr_m0m1); in wlc_phy_cal_txgainctrl_nphy()
18352 wlc_phy_table_write_nphy(pi, 15, 1, 95, 16, &curr_m0m1); in wlc_phy_cal_txgainctrl_nphy()
18356 wlc_phy_est_tonepwr_nphy(pi, qdBm_power, in wlc_phy_cal_txgainctrl_nphy()
18359 pi->nphy_bb_mult_save = 0; in wlc_phy_cal_txgainctrl_nphy()
18360 wlc_phy_stopplayback_nphy(pi); in wlc_phy_cal_txgainctrl_nphy()
18370 if (CHSPEC_IS5G(pi->radio_chanspec)) { in wlc_phy_cal_txgainctrl_nphy()
18371 if (NREV_IS(pi->pubpi.phy_rev, 4) && in wlc_phy_cal_txgainctrl_nphy()
18372 (pi->srom_fem5g.extpagain == 3)) { in wlc_phy_cal_txgainctrl_nphy()
18377 if (NREV_GE(pi->pubpi.phy_rev, 5) && in wlc_phy_cal_txgainctrl_nphy()
18378 (pi->srom_fem2g.extpagain == 3)) { in wlc_phy_cal_txgainctrl_nphy()
18384 wlc_phy_txpwr_index_nphy(pi, (1 << core), in wlc_phy_cal_txgainctrl_nphy()
18388 pi->nphy_txcal_pwr_idx[core] = (u8) txpwrindex; in wlc_phy_cal_txgainctrl_nphy()
18394 wlc_phy_table_read_nphy(pi, 15, 1, 87, 16, &dbg_m0m1); in wlc_phy_cal_txgainctrl_nphy()
18396 wlc_phy_tx_tone_nphy(pi, freq_test, ampl_test, 0, 0, in wlc_phy_cal_txgainctrl_nphy()
18399 wlc_phy_table_write_nphy(pi, 15, 1, 87, 16, &dbg_m0m1); in wlc_phy_cal_txgainctrl_nphy()
18400 wlc_phy_table_write_nphy(pi, 15, 1, 95, 16, &dbg_m0m1); in wlc_phy_cal_txgainctrl_nphy()
18404 wlc_phy_est_tonepwr_nphy(pi, qdBm_power, in wlc_phy_cal_txgainctrl_nphy()
18407 wlc_phy_table_read_nphy(pi, 7, 1, (0x110 + core), 16, in wlc_phy_cal_txgainctrl_nphy()
18411 pi->nphy_bb_mult_save = 0; in wlc_phy_cal_txgainctrl_nphy()
18412 wlc_phy_stopplayback_nphy(pi); in wlc_phy_cal_txgainctrl_nphy()
18416 wlc_phy_txpwr_index_nphy(pi, 1, pi->nphy_txcal_pwr_idx[0], true); in wlc_phy_cal_txgainctrl_nphy()
18417 wlc_phy_txpwr_index_nphy(pi, 2, pi->nphy_txcal_pwr_idx[1], true); in wlc_phy_cal_txgainctrl_nphy()
18419 wlc_phy_table_read_nphy(pi, 15, 1, 87, 16, &pi->nphy_txcal_bbmult); in wlc_phy_cal_txgainctrl_nphy()
18421 write_phy_reg(pi, 0x01, orig_BBConfig); in wlc_phy_cal_txgainctrl_nphy()
18423 write_phy_reg(pi, 0x91, phy_saveregs[0]); in wlc_phy_cal_txgainctrl_nphy()
18424 write_phy_reg(pi, 0x92, phy_saveregs[1]); in wlc_phy_cal_txgainctrl_nphy()
18425 write_phy_reg(pi, 0xe7, phy_saveregs[2]); in wlc_phy_cal_txgainctrl_nphy()
18426 write_phy_reg(pi, 0xec, phy_saveregs[3]); in wlc_phy_cal_txgainctrl_nphy()
18428 pi->phyhang_avoid = phyhang_avoid_state; in wlc_phy_cal_txgainctrl_nphy()
18430 if (pi->phyhang_avoid) in wlc_phy_cal_txgainctrl_nphy()
18431 wlc_phy_stay_in_carriersearch_nphy(pi, false); in wlc_phy_cal_txgainctrl_nphy()
18434 static void wlc_phy_savecal_nphy(struct brcms_phy *pi) in wlc_phy_savecal_nphy() argument
18440 if (pi->phyhang_avoid) in wlc_phy_savecal_nphy()
18441 wlc_phy_stay_in_carriersearch_nphy(pi, true); in wlc_phy_savecal_nphy()
18443 if (CHSPEC_IS2G(pi->radio_chanspec)) { in wlc_phy_savecal_nphy()
18445 wlc_phy_rx_iq_coeffs_nphy(pi, 0, in wlc_phy_savecal_nphy()
18446 &pi->calibration_cache. in wlc_phy_savecal_nphy()
18449 if (NREV_GE(pi->pubpi.phy_rev, 7)) { in wlc_phy_savecal_nphy()
18451 pi->calibration_cache.txcal_radio_regs_2G; in wlc_phy_savecal_nphy()
18452 } else if (NREV_GE(pi->pubpi.phy_rev, 3)) { in wlc_phy_savecal_nphy()
18454 pi->calibration_cache.txcal_radio_regs_2G[0] = in wlc_phy_savecal_nphy()
18455 read_radio_reg(pi, in wlc_phy_savecal_nphy()
18458 pi->calibration_cache.txcal_radio_regs_2G[1] = in wlc_phy_savecal_nphy()
18459 read_radio_reg(pi, in wlc_phy_savecal_nphy()
18462 pi->calibration_cache.txcal_radio_regs_2G[2] = in wlc_phy_savecal_nphy()
18463 read_radio_reg(pi, in wlc_phy_savecal_nphy()
18466 pi->calibration_cache.txcal_radio_regs_2G[3] = in wlc_phy_savecal_nphy()
18467 read_radio_reg(pi, in wlc_phy_savecal_nphy()
18471 pi->calibration_cache.txcal_radio_regs_2G[4] = in wlc_phy_savecal_nphy()
18472 read_radio_reg(pi, in wlc_phy_savecal_nphy()
18475 pi->calibration_cache.txcal_radio_regs_2G[5] = in wlc_phy_savecal_nphy()
18476 read_radio_reg(pi, in wlc_phy_savecal_nphy()
18479 pi->calibration_cache.txcal_radio_regs_2G[6] = in wlc_phy_savecal_nphy()
18480 read_radio_reg(pi, in wlc_phy_savecal_nphy()
18483 pi->calibration_cache.txcal_radio_regs_2G[7] = in wlc_phy_savecal_nphy()
18484 read_radio_reg(pi, in wlc_phy_savecal_nphy()
18488 pi->calibration_cache.txcal_radio_regs_2G[0] = in wlc_phy_savecal_nphy()
18489 read_radio_reg(pi, RADIO_2055_CORE1_TX_VOS_CNCL); in wlc_phy_savecal_nphy()
18490 pi->calibration_cache.txcal_radio_regs_2G[1] = in wlc_phy_savecal_nphy()
18491 read_radio_reg(pi, RADIO_2055_CORE2_TX_VOS_CNCL); in wlc_phy_savecal_nphy()
18492 pi->calibration_cache.txcal_radio_regs_2G[2] = in wlc_phy_savecal_nphy()
18493 read_radio_reg(pi, RADIO_2055_CORE1_TX_BB_MXGM); in wlc_phy_savecal_nphy()
18494 pi->calibration_cache.txcal_radio_regs_2G[3] = in wlc_phy_savecal_nphy()
18495 read_radio_reg(pi, RADIO_2055_CORE2_TX_BB_MXGM); in wlc_phy_savecal_nphy()
18498 pi->nphy_iqcal_chanspec_2G = pi->radio_chanspec; in wlc_phy_savecal_nphy()
18499 tbl_ptr = pi->calibration_cache.txcal_coeffs_2G; in wlc_phy_savecal_nphy()
18502 wlc_phy_rx_iq_coeffs_nphy(pi, 0, in wlc_phy_savecal_nphy()
18503 &pi->calibration_cache. in wlc_phy_savecal_nphy()
18506 if (NREV_GE(pi->pubpi.phy_rev, 7)) { in wlc_phy_savecal_nphy()
18508 pi->calibration_cache.txcal_radio_regs_5G; in wlc_phy_savecal_nphy()
18509 } else if (NREV_GE(pi->pubpi.phy_rev, 3)) { in wlc_phy_savecal_nphy()
18511 pi->calibration_cache.txcal_radio_regs_5G[0] = in wlc_phy_savecal_nphy()
18512 read_radio_reg(pi, in wlc_phy_savecal_nphy()
18515 pi->calibration_cache.txcal_radio_regs_5G[1] = in wlc_phy_savecal_nphy()
18516 read_radio_reg(pi, in wlc_phy_savecal_nphy()
18519 pi->calibration_cache.txcal_radio_regs_5G[2] = in wlc_phy_savecal_nphy()
18520 read_radio_reg(pi, in wlc_phy_savecal_nphy()
18523 pi->calibration_cache.txcal_radio_regs_5G[3] = in wlc_phy_savecal_nphy()
18524 read_radio_reg(pi, in wlc_phy_savecal_nphy()
18528 pi->calibration_cache.txcal_radio_regs_5G[4] = in wlc_phy_savecal_nphy()
18529 read_radio_reg(pi, in wlc_phy_savecal_nphy()
18532 pi->calibration_cache.txcal_radio_regs_5G[5] = in wlc_phy_savecal_nphy()
18533 read_radio_reg(pi, in wlc_phy_savecal_nphy()
18536 pi->calibration_cache.txcal_radio_regs_5G[6] = in wlc_phy_savecal_nphy()
18537 read_radio_reg(pi, in wlc_phy_savecal_nphy()
18540 pi->calibration_cache.txcal_radio_regs_5G[7] = in wlc_phy_savecal_nphy()
18541 read_radio_reg(pi, in wlc_phy_savecal_nphy()
18545 pi->calibration_cache.txcal_radio_regs_5G[0] = in wlc_phy_savecal_nphy()
18546 read_radio_reg(pi, RADIO_2055_CORE1_TX_VOS_CNCL); in wlc_phy_savecal_nphy()
18547 pi->calibration_cache.txcal_radio_regs_5G[1] = in wlc_phy_savecal_nphy()
18548 read_radio_reg(pi, RADIO_2055_CORE2_TX_VOS_CNCL); in wlc_phy_savecal_nphy()
18549 pi->calibration_cache.txcal_radio_regs_5G[2] = in wlc_phy_savecal_nphy()
18550 read_radio_reg(pi, RADIO_2055_CORE1_TX_BB_MXGM); in wlc_phy_savecal_nphy()
18551 pi->calibration_cache.txcal_radio_regs_5G[3] = in wlc_phy_savecal_nphy()
18552 read_radio_reg(pi, RADIO_2055_CORE2_TX_BB_MXGM); in wlc_phy_savecal_nphy()
18555 pi->nphy_iqcal_chanspec_5G = pi->radio_chanspec; in wlc_phy_savecal_nphy()
18556 tbl_ptr = pi->calibration_cache.txcal_coeffs_5G; in wlc_phy_savecal_nphy()
18558 if (NREV_GE(pi->pubpi.phy_rev, 7)) { in wlc_phy_savecal_nphy()
18562 READ_RADIO_REG3(pi, RADIO_2057, TX, coreNum, in wlc_phy_savecal_nphy()
18565 READ_RADIO_REG3(pi, RADIO_2057, TX, coreNum, in wlc_phy_savecal_nphy()
18569 READ_RADIO_REG3(pi, RADIO_2057, TX, coreNum, in wlc_phy_savecal_nphy()
18572 READ_RADIO_REG3(pi, RADIO_2057, TX, coreNum, in wlc_phy_savecal_nphy()
18577 wlc_phy_table_read_nphy(pi, NPHY_TBL_ID_IQLOCAL, 8, 80, 16, tbl_ptr); in wlc_phy_savecal_nphy()
18579 if (pi->phyhang_avoid) in wlc_phy_savecal_nphy()
18580 wlc_phy_stay_in_carriersearch_nphy(pi, false); in wlc_phy_savecal_nphy()
18583 static void wlc_phy_tx_iq_war_nphy(struct brcms_phy *pi) in wlc_phy_tx_iq_war_nphy() argument
18587 wlc_phy_table_read_nphy(pi, 15, 4, 0x50, 16, &tx_comp); in wlc_phy_tx_iq_war_nphy()
18589 wlapi_bmac_write_shm(pi->sh->physhim, M_20IN40_IQ, tx_comp.a0); in wlc_phy_tx_iq_war_nphy()
18590 wlapi_bmac_write_shm(pi->sh->physhim, M_20IN40_IQ + 2, tx_comp.b0); in wlc_phy_tx_iq_war_nphy()
18591 wlapi_bmac_write_shm(pi->sh->physhim, M_20IN40_IQ + 4, tx_comp.a1); in wlc_phy_tx_iq_war_nphy()
18592 wlapi_bmac_write_shm(pi->sh->physhim, M_20IN40_IQ + 6, tx_comp.b1); in wlc_phy_tx_iq_war_nphy()
18595 static void wlc_phy_restorecal_nphy(struct brcms_phy *pi) in wlc_phy_restorecal_nphy() argument
18603 if (CHSPEC_IS2G(pi->radio_chanspec)) { in wlc_phy_restorecal_nphy()
18604 if (pi->nphy_iqcal_chanspec_2G == 0) in wlc_phy_restorecal_nphy()
18607 tbl_ptr = pi->calibration_cache.txcal_coeffs_2G; in wlc_phy_restorecal_nphy()
18608 loft_comp = &pi->calibration_cache.txcal_coeffs_2G[5]; in wlc_phy_restorecal_nphy()
18610 if (pi->nphy_iqcal_chanspec_5G == 0) in wlc_phy_restorecal_nphy()
18613 tbl_ptr = pi->calibration_cache.txcal_coeffs_5G; in wlc_phy_restorecal_nphy()
18614 loft_comp = &pi->calibration_cache.txcal_coeffs_5G[5]; in wlc_phy_restorecal_nphy()
18617 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_IQLOCAL, 4, 80, 16, tbl_ptr); in wlc_phy_restorecal_nphy()
18619 if (NREV_GE(pi->pubpi.phy_rev, 3)) { in wlc_phy_restorecal_nphy()
18631 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_IQLOCAL, 4, 88, 16, in wlc_phy_restorecal_nphy()
18634 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_IQLOCAL, 2, 85, 16, loft_comp); in wlc_phy_restorecal_nphy()
18636 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_IQLOCAL, 2, 93, 16, loft_comp); in wlc_phy_restorecal_nphy()
18638 if (NREV_LT(pi->pubpi.phy_rev, 2)) in wlc_phy_restorecal_nphy()
18639 wlc_phy_tx_iq_war_nphy(pi); in wlc_phy_restorecal_nphy()
18641 if (CHSPEC_IS2G(pi->radio_chanspec)) { in wlc_phy_restorecal_nphy()
18642 if (NREV_GE(pi->pubpi.phy_rev, 7)) { in wlc_phy_restorecal_nphy()
18644 pi->calibration_cache.txcal_radio_regs_2G; in wlc_phy_restorecal_nphy()
18645 } else if (NREV_GE(pi->pubpi.phy_rev, 3)) { in wlc_phy_restorecal_nphy()
18647 write_radio_reg(pi, in wlc_phy_restorecal_nphy()
18650 pi->calibration_cache. in wlc_phy_restorecal_nphy()
18652 write_radio_reg(pi, in wlc_phy_restorecal_nphy()
18655 pi->calibration_cache. in wlc_phy_restorecal_nphy()
18657 write_radio_reg(pi, in wlc_phy_restorecal_nphy()
18660 pi->calibration_cache. in wlc_phy_restorecal_nphy()
18662 write_radio_reg(pi, in wlc_phy_restorecal_nphy()
18665 pi->calibration_cache. in wlc_phy_restorecal_nphy()
18668 write_radio_reg(pi, in wlc_phy_restorecal_nphy()
18671 pi->calibration_cache. in wlc_phy_restorecal_nphy()
18673 write_radio_reg(pi, in wlc_phy_restorecal_nphy()
18676 pi->calibration_cache. in wlc_phy_restorecal_nphy()
18678 write_radio_reg(pi, in wlc_phy_restorecal_nphy()
18681 pi->calibration_cache. in wlc_phy_restorecal_nphy()
18683 write_radio_reg(pi, in wlc_phy_restorecal_nphy()
18686 pi->calibration_cache. in wlc_phy_restorecal_nphy()
18689 write_radio_reg(pi, RADIO_2055_CORE1_TX_VOS_CNCL, in wlc_phy_restorecal_nphy()
18690 pi->calibration_cache. in wlc_phy_restorecal_nphy()
18692 write_radio_reg(pi, RADIO_2055_CORE2_TX_VOS_CNCL, in wlc_phy_restorecal_nphy()
18693 pi->calibration_cache. in wlc_phy_restorecal_nphy()
18695 write_radio_reg(pi, RADIO_2055_CORE1_TX_BB_MXGM, in wlc_phy_restorecal_nphy()
18696 pi->calibration_cache. in wlc_phy_restorecal_nphy()
18698 write_radio_reg(pi, RADIO_2055_CORE2_TX_BB_MXGM, in wlc_phy_restorecal_nphy()
18699 pi->calibration_cache. in wlc_phy_restorecal_nphy()
18703 wlc_phy_rx_iq_coeffs_nphy(pi, 1, in wlc_phy_restorecal_nphy()
18704 &pi->calibration_cache. in wlc_phy_restorecal_nphy()
18707 if (NREV_GE(pi->pubpi.phy_rev, 7)) { in wlc_phy_restorecal_nphy()
18709 pi->calibration_cache.txcal_radio_regs_5G; in wlc_phy_restorecal_nphy()
18710 } else if (NREV_GE(pi->pubpi.phy_rev, 3)) { in wlc_phy_restorecal_nphy()
18712 write_radio_reg(pi, in wlc_phy_restorecal_nphy()
18715 pi->calibration_cache. in wlc_phy_restorecal_nphy()
18717 write_radio_reg(pi, in wlc_phy_restorecal_nphy()
18720 pi->calibration_cache. in wlc_phy_restorecal_nphy()
18722 write_radio_reg(pi, in wlc_phy_restorecal_nphy()
18725 pi->calibration_cache. in wlc_phy_restorecal_nphy()
18727 write_radio_reg(pi, in wlc_phy_restorecal_nphy()
18730 pi->calibration_cache. in wlc_phy_restorecal_nphy()
18733 write_radio_reg(pi, in wlc_phy_restorecal_nphy()
18736 pi->calibration_cache. in wlc_phy_restorecal_nphy()
18738 write_radio_reg(pi, in wlc_phy_restorecal_nphy()
18741 pi->calibration_cache. in wlc_phy_restorecal_nphy()
18743 write_radio_reg(pi, in wlc_phy_restorecal_nphy()
18746 pi->calibration_cache. in wlc_phy_restorecal_nphy()
18748 write_radio_reg(pi, in wlc_phy_restorecal_nphy()
18751 pi->calibration_cache. in wlc_phy_restorecal_nphy()
18754 write_radio_reg(pi, RADIO_2055_CORE1_TX_VOS_CNCL, in wlc_phy_restorecal_nphy()
18755 pi->calibration_cache. in wlc_phy_restorecal_nphy()
18757 write_radio_reg(pi, RADIO_2055_CORE2_TX_VOS_CNCL, in wlc_phy_restorecal_nphy()
18758 pi->calibration_cache. in wlc_phy_restorecal_nphy()
18760 write_radio_reg(pi, RADIO_2055_CORE1_TX_BB_MXGM, in wlc_phy_restorecal_nphy()
18761 pi->calibration_cache. in wlc_phy_restorecal_nphy()
18763 write_radio_reg(pi, RADIO_2055_CORE2_TX_BB_MXGM, in wlc_phy_restorecal_nphy()
18764 pi->calibration_cache. in wlc_phy_restorecal_nphy()
18768 wlc_phy_rx_iq_coeffs_nphy(pi, 1, in wlc_phy_restorecal_nphy()
18769 &pi->calibration_cache. in wlc_phy_restorecal_nphy()
18773 if (NREV_GE(pi->pubpi.phy_rev, 7)) { in wlc_phy_restorecal_nphy()
18776 WRITE_RADIO_REG3(pi, RADIO_2057, TX, coreNum, in wlc_phy_restorecal_nphy()
18779 WRITE_RADIO_REG3(pi, RADIO_2057, TX, coreNum, in wlc_phy_restorecal_nphy()
18783 WRITE_RADIO_REG3(pi, RADIO_2057, TX, coreNum, in wlc_phy_restorecal_nphy()
18786 WRITE_RADIO_REG3(pi, RADIO_2057, TX, coreNum, in wlc_phy_restorecal_nphy()
18793 static void wlc_phy_txpwrctrl_coeff_setup_nphy(struct brcms_phy *pi) in wlc_phy_txpwrctrl_coeff_setup_nphy() argument
18803 if (pi->phyhang_avoid) in wlc_phy_txpwrctrl_coeff_setup_nphy()
18804 wlc_phy_stay_in_carriersearch_nphy(pi, true); in wlc_phy_txpwrctrl_coeff_setup_nphy()
18806 wlc_phy_table_read_nphy(pi, 15, 7, 80, 16, iqloCalbuf); in wlc_phy_txpwrctrl_coeff_setup_nphy()
18821 wlc_phy_table_write_nphy(pi, tbl_id, tbl_len, tbl_offset, 32, in wlc_phy_txpwrctrl_coeff_setup_nphy()
18834 if (NREV_GE(pi->pubpi.phy_rev, 3)) { in wlc_phy_txpwrctrl_coeff_setup_nphy()
18850 wlc_phy_table_write_nphy(pi, tbl_id, tbl_len, tbl_offset, 32, in wlc_phy_txpwrctrl_coeff_setup_nphy()
18854 if (NREV_LT(pi->pubpi.phy_rev, 2)) { in wlc_phy_txpwrctrl_coeff_setup_nphy()
18856 wlapi_bmac_write_shm(pi->sh->physhim, M_CURR_IDX1, 0xFFFF); in wlc_phy_txpwrctrl_coeff_setup_nphy()
18857 wlapi_bmac_write_shm(pi->sh->physhim, M_CURR_IDX2, 0xFFFF); in wlc_phy_txpwrctrl_coeff_setup_nphy()
18860 if (pi->phyhang_avoid) in wlc_phy_txpwrctrl_coeff_setup_nphy()
18861 wlc_phy_stay_in_carriersearch_nphy(pi, false); in wlc_phy_txpwrctrl_coeff_setup_nphy()
18864 static void wlc_phy_txlpfbw_nphy(struct brcms_phy *pi) in wlc_phy_txlpfbw_nphy() argument
18868 if (NREV_GE(pi->pubpi.phy_rev, 3) && NREV_LT(pi->pubpi.phy_rev, 7)) { in wlc_phy_txlpfbw_nphy()
18869 if (CHSPEC_IS40(pi->radio_chanspec)) in wlc_phy_txlpfbw_nphy()
18874 if (PHY_IPA(pi)) { in wlc_phy_txlpfbw_nphy()
18875 if (CHSPEC_IS40(pi->radio_chanspec)) in wlc_phy_txlpfbw_nphy()
18881 write_phy_reg(pi, 0xe8, in wlc_phy_txlpfbw_nphy()
18886 if (PHY_IPA(pi)) { in wlc_phy_txlpfbw_nphy()
18888 if (CHSPEC_IS40(pi->radio_chanspec)) in wlc_phy_txlpfbw_nphy()
18893 write_phy_reg(pi, 0xe9, in wlc_phy_txlpfbw_nphy()
18902 wlc_phy_adjust_rx_analpfbw_nphy(struct brcms_phy *pi, u16 reduction_factr) in wlc_phy_adjust_rx_analpfbw_nphy() argument
18904 if (NREV_GE(pi->pubpi.phy_rev, 3) && NREV_LT(pi->pubpi.phy_rev, 7)) { in wlc_phy_adjust_rx_analpfbw_nphy()
18905 if ((CHSPEC_CHANNEL(pi->radio_chanspec) == 11) && in wlc_phy_adjust_rx_analpfbw_nphy()
18906 CHSPEC_IS40(pi->radio_chanspec)) { in wlc_phy_adjust_rx_analpfbw_nphy()
18907 if (!pi->nphy_anarxlpf_adjusted) { in wlc_phy_adjust_rx_analpfbw_nphy()
18908 write_radio_reg(pi, in wlc_phy_adjust_rx_analpfbw_nphy()
18911 ((pi->nphy_rccal_value + in wlc_phy_adjust_rx_analpfbw_nphy()
18914 pi->nphy_anarxlpf_adjusted = true; in wlc_phy_adjust_rx_analpfbw_nphy()
18917 if (pi->nphy_anarxlpf_adjusted) { in wlc_phy_adjust_rx_analpfbw_nphy()
18918 write_radio_reg(pi, in wlc_phy_adjust_rx_analpfbw_nphy()
18921 (pi->nphy_rccal_value | 0x80)); in wlc_phy_adjust_rx_analpfbw_nphy()
18923 pi->nphy_anarxlpf_adjusted = false; in wlc_phy_adjust_rx_analpfbw_nphy()
18930 wlc_phy_adjust_min_noisevar_nphy(struct brcms_phy *pi, int ntones, in wlc_phy_adjust_min_noisevar_nphy() argument
18937 CHSPEC_IS40(pi->radio_chanspec) ? in wlc_phy_adjust_min_noisevar_nphy()
18940 if (pi->nphy_noisevars_adjusted) { in wlc_phy_adjust_min_noisevar_nphy()
18941 for (i = 0; i < pi->nphy_saved_noisevars.bufcount; i++) { in wlc_phy_adjust_min_noisevar_nphy()
18942 tone_id = pi->nphy_saved_noisevars.tone_id[i]; in wlc_phy_adjust_min_noisevar_nphy()
18947 pi, NPHY_TBL_ID_NOISEVAR, 1, in wlc_phy_adjust_min_noisevar_nphy()
18949 &pi->nphy_saved_noisevars.min_noise_vars[i]); in wlc_phy_adjust_min_noisevar_nphy()
18952 pi->nphy_saved_noisevars.bufcount = 0; in wlc_phy_adjust_min_noisevar_nphy()
18953 pi->nphy_noisevars_adjusted = false; in wlc_phy_adjust_min_noisevar_nphy()
18957 pi->nphy_saved_noisevars.bufcount = 0; in wlc_phy_adjust_min_noisevar_nphy()
18964 pi->nphy_saved_noisevars.tone_id[i] = tone_id; in wlc_phy_adjust_min_noisevar_nphy()
18965 wlc_phy_table_read_nphy(pi, NPHY_TBL_ID_NOISEVAR, 1, in wlc_phy_adjust_min_noisevar_nphy()
18967 &pi->nphy_saved_noisevars. in wlc_phy_adjust_min_noisevar_nphy()
18969 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_NOISEVAR, 1, in wlc_phy_adjust_min_noisevar_nphy()
18971 pi->nphy_saved_noisevars.bufcount++; in wlc_phy_adjust_min_noisevar_nphy()
18974 pi->nphy_noisevars_adjusted = true; in wlc_phy_adjust_min_noisevar_nphy()
18978 static void wlc_phy_adjust_crsminpwr_nphy(struct brcms_phy *pi, u8 minpwr) in wlc_phy_adjust_crsminpwr_nphy() argument
18982 if (NREV_GE(pi->pubpi.phy_rev, 3)) { in wlc_phy_adjust_crsminpwr_nphy()
18983 if ((CHSPEC_CHANNEL(pi->radio_chanspec) == 11) && in wlc_phy_adjust_crsminpwr_nphy()
18984 CHSPEC_IS40(pi->radio_chanspec)) { in wlc_phy_adjust_crsminpwr_nphy()
18985 if (!pi->nphy_crsminpwr_adjusted) { in wlc_phy_adjust_crsminpwr_nphy()
18986 regval = read_phy_reg(pi, 0x27d); in wlc_phy_adjust_crsminpwr_nphy()
18987 pi->nphy_crsminpwr[0] = regval & 0xff; in wlc_phy_adjust_crsminpwr_nphy()
18990 write_phy_reg(pi, 0x27d, regval); in wlc_phy_adjust_crsminpwr_nphy()
18992 regval = read_phy_reg(pi, 0x280); in wlc_phy_adjust_crsminpwr_nphy()
18993 pi->nphy_crsminpwr[1] = regval & 0xff; in wlc_phy_adjust_crsminpwr_nphy()
18996 write_phy_reg(pi, 0x280, regval); in wlc_phy_adjust_crsminpwr_nphy()
18998 regval = read_phy_reg(pi, 0x283); in wlc_phy_adjust_crsminpwr_nphy()
18999 pi->nphy_crsminpwr[2] = regval & 0xff; in wlc_phy_adjust_crsminpwr_nphy()
19002 write_phy_reg(pi, 0x283, regval); in wlc_phy_adjust_crsminpwr_nphy()
19004 pi->nphy_crsminpwr_adjusted = true; in wlc_phy_adjust_crsminpwr_nphy()
19007 if (pi->nphy_crsminpwr_adjusted) { in wlc_phy_adjust_crsminpwr_nphy()
19008 regval = read_phy_reg(pi, 0x27d); in wlc_phy_adjust_crsminpwr_nphy()
19010 regval |= pi->nphy_crsminpwr[0]; in wlc_phy_adjust_crsminpwr_nphy()
19011 write_phy_reg(pi, 0x27d, regval); in wlc_phy_adjust_crsminpwr_nphy()
19013 regval = read_phy_reg(pi, 0x280); in wlc_phy_adjust_crsminpwr_nphy()
19015 regval |= pi->nphy_crsminpwr[1]; in wlc_phy_adjust_crsminpwr_nphy()
19016 write_phy_reg(pi, 0x280, regval); in wlc_phy_adjust_crsminpwr_nphy()
19018 regval = read_phy_reg(pi, 0x283); in wlc_phy_adjust_crsminpwr_nphy()
19020 regval |= pi->nphy_crsminpwr[2]; in wlc_phy_adjust_crsminpwr_nphy()
19021 write_phy_reg(pi, 0x283, regval); in wlc_phy_adjust_crsminpwr_nphy()
19023 pi->nphy_crsminpwr_adjusted = false; in wlc_phy_adjust_crsminpwr_nphy()
19029 static void wlc_phy_spurwar_nphy(struct brcms_phy *pi) in wlc_phy_spurwar_nphy() argument
19037 if (NREV_GE(pi->pubpi.phy_rev, 3)) { in wlc_phy_spurwar_nphy()
19038 if (pi->phyhang_avoid) in wlc_phy_spurwar_nphy()
19039 wlc_phy_stay_in_carriersearch_nphy(pi, true); in wlc_phy_spurwar_nphy()
19041 cur_channel = CHSPEC_CHANNEL(pi->radio_chanspec); in wlc_phy_spurwar_nphy()
19043 if (pi->nphy_gband_spurwar_en) { in wlc_phy_spurwar_nphy()
19046 pi, in wlc_phy_spurwar_nphy()
19049 if (CHSPEC_IS2G(pi->radio_chanspec)) { in wlc_phy_spurwar_nphy()
19051 && CHSPEC_IS40(pi->radio_chanspec)) in wlc_phy_spurwar_nphy()
19053 pi, 2, in wlc_phy_spurwar_nphy()
19057 wlc_phy_adjust_min_noisevar_nphy(pi, 0, in wlc_phy_spurwar_nphy()
19062 wlc_phy_adjust_crsminpwr_nphy(pi, in wlc_phy_spurwar_nphy()
19066 if ((pi->nphy_gband_spurwar2_en) in wlc_phy_spurwar_nphy()
19067 && CHSPEC_IS2G(pi->radio_chanspec)) { in wlc_phy_spurwar_nphy()
19069 if (CHSPEC_IS40(pi->radio_chanspec)) { in wlc_phy_spurwar_nphy()
19137 pi, in wlc_phy_spurwar_nphy()
19142 wlc_phy_adjust_min_noisevar_nphy(pi, 0, NULL, in wlc_phy_spurwar_nphy()
19147 if ((pi->nphy_aband_spurwar_en) && in wlc_phy_spurwar_nphy()
19148 (CHSPEC_IS5G(pi->radio_chanspec))) { in wlc_phy_spurwar_nphy()
19157 if ((pi->sh->chip == BCMA_CHIP_ID_BCM4716) && in wlc_phy_spurwar_nphy()
19158 (pi->sh->chippkg == BCMA_PKG_ID_BCM4717)) { in wlc_phy_spurwar_nphy()
19188 pi, 1, in wlc_phy_spurwar_nphy()
19192 wlc_phy_adjust_min_noisevar_nphy(pi, 0, NULL, in wlc_phy_spurwar_nphy()
19196 if (pi->phyhang_avoid) in wlc_phy_spurwar_nphy()
19197 wlc_phy_stay_in_carriersearch_nphy(pi, false); in wlc_phy_spurwar_nphy()
19201 void wlc_phy_init_nphy(struct brcms_phy *pi) in wlc_phy_init_nphy() argument
19214 if (!(pi->measure_hold & PHY_HOLD_FOR_SCAN)) in wlc_phy_init_nphy()
19215 pi->measure_hold |= PHY_HOLD_FOR_NOT_ASSOC; in wlc_phy_init_nphy()
19217 if ((ISNPHY(pi)) && (NREV_GE(pi->pubpi.phy_rev, 5)) && in wlc_phy_init_nphy()
19218 ((pi->sh->chippkg == BCMA_PKG_ID_BCM4717) || in wlc_phy_init_nphy()
19219 (pi->sh->chippkg == BCMA_PKG_ID_BCM4718))) { in wlc_phy_init_nphy()
19220 if ((pi->sh->boardflags & BFL_EXTLNA) && in wlc_phy_init_nphy()
19221 (CHSPEC_IS2G(pi->radio_chanspec))) in wlc_phy_init_nphy()
19222 bcma_cc_set32(&pi->d11core->bus->drv_cc, in wlc_phy_init_nphy()
19226 if ((!PHY_IPA(pi)) && (pi->sh->chip == BCMA_CHIP_ID_BCM5357)) in wlc_phy_init_nphy()
19227 bcma_chipco_chipctl_maskset(&pi->d11core->bus->drv_cc, 1, in wlc_phy_init_nphy()
19230 if ((pi->nphy_gband_spurwar2_en) && CHSPEC_IS2G(pi->radio_chanspec) && in wlc_phy_init_nphy()
19231 CHSPEC_IS40(pi->radio_chanspec)) { in wlc_phy_init_nphy()
19233 d11_clk_ctl_st = bcma_read32(pi->d11core, in wlc_phy_init_nphy()
19235 bcma_mask32(pi->d11core, D11REGOFFS(clk_ctl_st), in wlc_phy_init_nphy()
19238 bcma_write32(pi->d11core, D11REGOFFS(clk_ctl_st), in wlc_phy_init_nphy()
19242 pi->use_int_tx_iqlo_cal_nphy = in wlc_phy_init_nphy()
19243 (PHY_IPA(pi) || in wlc_phy_init_nphy()
19244 (NREV_GE(pi->pubpi.phy_rev, 7) || in wlc_phy_init_nphy()
19245 (NREV_GE(pi->pubpi.phy_rev, 5) in wlc_phy_init_nphy()
19246 && pi->sh->boardflags2 & BFL2_INTERNDET_TXIQCAL))); in wlc_phy_init_nphy()
19248 pi->internal_tx_iqlo_cal_tapoff_intpa_nphy = false; in wlc_phy_init_nphy()
19250 pi->nphy_deaf_count = 0; in wlc_phy_init_nphy()
19252 wlc_phy_tbl_init_nphy(pi); in wlc_phy_init_nphy()
19254 pi->nphy_crsminpwr_adjusted = false; in wlc_phy_init_nphy()
19255 pi->nphy_noisevars_adjusted = false; in wlc_phy_init_nphy()
19257 if (NREV_GE(pi->pubpi.phy_rev, 3)) { in wlc_phy_init_nphy()
19258 write_phy_reg(pi, 0xe7, 0); in wlc_phy_init_nphy()
19259 write_phy_reg(pi, 0xec, 0); in wlc_phy_init_nphy()
19260 if (NREV_GE(pi->pubpi.phy_rev, 7)) { in wlc_phy_init_nphy()
19261 write_phy_reg(pi, 0x342, 0); in wlc_phy_init_nphy()
19262 write_phy_reg(pi, 0x343, 0); in wlc_phy_init_nphy()
19263 write_phy_reg(pi, 0x346, 0); in wlc_phy_init_nphy()
19264 write_phy_reg(pi, 0x347, 0); in wlc_phy_init_nphy()
19266 write_phy_reg(pi, 0xe5, 0); in wlc_phy_init_nphy()
19267 write_phy_reg(pi, 0xe6, 0); in wlc_phy_init_nphy()
19269 write_phy_reg(pi, 0xec, 0); in wlc_phy_init_nphy()
19272 write_phy_reg(pi, 0x91, 0); in wlc_phy_init_nphy()
19273 write_phy_reg(pi, 0x92, 0); in wlc_phy_init_nphy()
19274 if (NREV_LT(pi->pubpi.phy_rev, 6)) { in wlc_phy_init_nphy()
19275 write_phy_reg(pi, 0x93, 0); in wlc_phy_init_nphy()
19276 write_phy_reg(pi, 0x94, 0); in wlc_phy_init_nphy()
19279 and_phy_reg(pi, 0xa1, ~3); in wlc_phy_init_nphy()
19281 if (NREV_GE(pi->pubpi.phy_rev, 3)) { in wlc_phy_init_nphy()
19282 write_phy_reg(pi, 0x8f, 0); in wlc_phy_init_nphy()
19283 write_phy_reg(pi, 0xa5, 0); in wlc_phy_init_nphy()
19285 write_phy_reg(pi, 0xa5, 0); in wlc_phy_init_nphy()
19288 if (NREV_IS(pi->pubpi.phy_rev, 2)) in wlc_phy_init_nphy()
19289 mod_phy_reg(pi, 0xdc, 0x00ff, 0x3b); in wlc_phy_init_nphy()
19290 else if (NREV_LT(pi->pubpi.phy_rev, 2)) in wlc_phy_init_nphy()
19291 mod_phy_reg(pi, 0xdc, 0x00ff, 0x40); in wlc_phy_init_nphy()
19293 write_phy_reg(pi, 0x203, 32); in wlc_phy_init_nphy()
19294 write_phy_reg(pi, 0x201, 32); in wlc_phy_init_nphy()
19296 if (pi->sh->boardflags2 & BFL2_SKWRKFEM_BRD) in wlc_phy_init_nphy()
19297 write_phy_reg(pi, 0x20d, 160); in wlc_phy_init_nphy()
19299 write_phy_reg(pi, 0x20d, 184); in wlc_phy_init_nphy()
19301 write_phy_reg(pi, 0x13a, 200); in wlc_phy_init_nphy()
19303 write_phy_reg(pi, 0x70, 80); in wlc_phy_init_nphy()
19305 write_phy_reg(pi, 0x1ff, 48); in wlc_phy_init_nphy()
19307 if (NREV_LT(pi->pubpi.phy_rev, 8)) in wlc_phy_init_nphy()
19308 wlc_phy_update_mimoconfig_nphy(pi, pi->n_preamble_override); in wlc_phy_init_nphy()
19310 wlc_phy_stf_chain_upd_nphy(pi); in wlc_phy_init_nphy()
19312 if (NREV_LT(pi->pubpi.phy_rev, 2)) { in wlc_phy_init_nphy()
19313 write_phy_reg(pi, 0x180, 0xaa8); in wlc_phy_init_nphy()
19314 write_phy_reg(pi, 0x181, 0x9a4); in wlc_phy_init_nphy()
19317 if (PHY_IPA(pi)) { in wlc_phy_init_nphy()
19318 for (core = 0; core < pi->pubpi.phy_corenum; core++) { in wlc_phy_init_nphy()
19320 mod_phy_reg(pi, (core == PHY_CORE_0) ? 0x297 : in wlc_phy_init_nphy()
19323 mod_phy_reg(pi, (core == PHY_CORE_0) ? 0x298 : in wlc_phy_init_nphy()
19325 (pi->nphy_papd_epsilon_offset[core]) << 7); in wlc_phy_init_nphy()
19329 wlc_phy_ipa_set_tx_digi_filts_nphy(pi); in wlc_phy_init_nphy()
19330 } else if (NREV_GE(pi->pubpi.phy_rev, 5)) { in wlc_phy_init_nphy()
19331 wlc_phy_extpa_set_tx_digi_filts_nphy(pi); in wlc_phy_init_nphy()
19334 wlc_phy_workarounds_nphy(pi); in wlc_phy_init_nphy()
19336 wlapi_bmac_phyclk_fgc(pi->sh->physhim, ON); in wlc_phy_init_nphy()
19338 val = read_phy_reg(pi, 0x01); in wlc_phy_init_nphy()
19339 write_phy_reg(pi, 0x01, val | BBCFG_RESETCCA); in wlc_phy_init_nphy()
19340 write_phy_reg(pi, 0x01, val & (~BBCFG_RESETCCA)); in wlc_phy_init_nphy()
19341 wlapi_bmac_phyclk_fgc(pi->sh->physhim, OFF); in wlc_phy_init_nphy()
19343 wlapi_bmac_macphyclk_set(pi->sh->physhim, ON); in wlc_phy_init_nphy()
19345 wlc_phy_pa_override_nphy(pi, OFF); in wlc_phy_init_nphy()
19346 wlc_phy_force_rfseq_nphy(pi, NPHY_RFSEQ_RX2TX); in wlc_phy_init_nphy()
19347 wlc_phy_force_rfseq_nphy(pi, NPHY_RFSEQ_RESET2RX); in wlc_phy_init_nphy()
19348 wlc_phy_pa_override_nphy(pi, ON); in wlc_phy_init_nphy()
19350 wlc_phy_classifier_nphy(pi, 0, 0); in wlc_phy_init_nphy()
19351 wlc_phy_clip_det_nphy(pi, 0, clip1_ths); in wlc_phy_init_nphy()
19353 if (CHSPEC_IS2G(pi->radio_chanspec)) in wlc_phy_init_nphy()
19354 wlc_phy_bphy_init_nphy(pi); in wlc_phy_init_nphy()
19356 tx_pwr_ctrl_state = pi->nphy_txpwrctrl; in wlc_phy_init_nphy()
19357 wlc_phy_txpwrctrl_enable_nphy(pi, PHY_TPC_HW_OFF); in wlc_phy_init_nphy()
19359 wlc_phy_txpwr_fixpower_nphy(pi); in wlc_phy_init_nphy()
19361 wlc_phy_txpwrctrl_idle_tssi_nphy(pi); in wlc_phy_init_nphy()
19363 wlc_phy_txpwrctrl_pwr_setup_nphy(pi); in wlc_phy_init_nphy()
19365 if (NREV_GE(pi->pubpi.phy_rev, 3)) { in wlc_phy_init_nphy()
19372 if (PHY_IPA(pi)) { in wlc_phy_init_nphy()
19373 tx_pwrctrl_tbl = wlc_phy_get_ipa_gaintbl_nphy(pi); in wlc_phy_init_nphy()
19375 if (CHSPEC_IS5G(pi->radio_chanspec)) { in wlc_phy_init_nphy()
19376 if (NREV_IS(pi->pubpi.phy_rev, 3)) in wlc_phy_init_nphy()
19379 else if (NREV_IS(pi->pubpi.phy_rev, 4)) in wlc_phy_init_nphy()
19381 (pi->srom_fem5g.extpagain == in wlc_phy_init_nphy()
19389 if (NREV_GE(pi->pubpi.phy_rev, 7)) { in wlc_phy_init_nphy()
19390 if (pi->pubpi.radiorev == 5) in wlc_phy_init_nphy()
19393 else if (pi->pubpi.radiorev == 3) in wlc_phy_init_nphy()
19397 if (NREV_GE(pi->pubpi.phy_rev, 5) && in wlc_phy_init_nphy()
19398 (pi->srom_fem2g.extpagain == 3)) in wlc_phy_init_nphy()
19408 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_CORE1TXPWRCTL, 128, in wlc_phy_init_nphy()
19410 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_CORE2TXPWRCTL, 128, in wlc_phy_init_nphy()
19413 pi->nphy_gmval = (u16) ((*tx_pwrctrl_tbl >> 16) & 0x7000); in wlc_phy_init_nphy()
19415 if (NREV_GE(pi->pubpi.phy_rev, 7)) { in wlc_phy_init_nphy()
19420 rfpwr_offset = get_rf_pwr_offset(pi, pga_gn, in wlc_phy_init_nphy()
19423 pi, in wlc_phy_init_nphy()
19428 pi, in wlc_phy_init_nphy()
19437 if (CHSPEC_IS2G(pi->radio_chanspec)) in wlc_phy_init_nphy()
19447 pi, in wlc_phy_init_nphy()
19452 pi, in wlc_phy_init_nphy()
19461 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_CORE1TXPWRCTL, 128, in wlc_phy_init_nphy()
19463 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_CORE2TXPWRCTL, 128, in wlc_phy_init_nphy()
19467 if (pi->sh->phyrxchain != 0x3) in wlc_phy_init_nphy()
19468 wlc_phy_rxcore_setstate_nphy((struct brcms_phy_pub *) pi, in wlc_phy_init_nphy()
19469 pi->sh->phyrxchain); in wlc_phy_init_nphy()
19471 if (PHY_PERICAL_MPHASE_PENDING(pi)) in wlc_phy_init_nphy()
19472 wlc_phy_cal_perical_mphase_restart(pi); in wlc_phy_init_nphy()
19474 if (NREV_GE(pi->pubpi.phy_rev, 3)) { in wlc_phy_init_nphy()
19475 do_rssi_cal = (CHSPEC_IS2G(pi->radio_chanspec)) ? in wlc_phy_init_nphy()
19476 (pi->nphy_rssical_chanspec_2G == 0) : in wlc_phy_init_nphy()
19477 (pi->nphy_rssical_chanspec_5G == 0); in wlc_phy_init_nphy()
19480 wlc_phy_rssi_cal_nphy(pi); in wlc_phy_init_nphy()
19482 wlc_phy_restore_rssical_nphy(pi); in wlc_phy_init_nphy()
19484 wlc_phy_rssi_cal_nphy(pi); in wlc_phy_init_nphy()
19487 if (!SCAN_RM_IN_PROGRESS(pi)) in wlc_phy_init_nphy()
19488 do_nphy_cal = (CHSPEC_IS2G(pi->radio_chanspec)) ? in wlc_phy_init_nphy()
19489 (pi->nphy_iqcal_chanspec_2G == 0) : in wlc_phy_init_nphy()
19490 (pi->nphy_iqcal_chanspec_5G == 0); in wlc_phy_init_nphy()
19492 if (!pi->do_initcal) in wlc_phy_init_nphy()
19497 target_gain = wlc_phy_get_tx_gain_nphy(pi); in wlc_phy_init_nphy()
19499 if (pi->antsel_type == ANTSEL_2x3) in wlc_phy_init_nphy()
19500 wlc_phy_antsel_init((struct brcms_phy_pub *) pi, in wlc_phy_init_nphy()
19503 if (pi->nphy_perical != PHY_PERICAL_MPHASE) { in wlc_phy_init_nphy()
19504 wlc_phy_rssi_cal_nphy(pi); in wlc_phy_init_nphy()
19506 if (NREV_GE(pi->pubpi.phy_rev, 3)) { in wlc_phy_init_nphy()
19507 pi->nphy_cal_orig_pwr_idx[0] = in wlc_phy_init_nphy()
19508 pi->nphy_txpwrindex[PHY_CORE_0] in wlc_phy_init_nphy()
19511 pi->nphy_cal_orig_pwr_idx[1] = in wlc_phy_init_nphy()
19512 pi->nphy_txpwrindex[PHY_CORE_1] in wlc_phy_init_nphy()
19516 wlc_phy_precal_txgain_nphy(pi); in wlc_phy_init_nphy()
19518 wlc_phy_get_tx_gain_nphy(pi); in wlc_phy_init_nphy()
19522 (pi, target_gain, true, in wlc_phy_init_nphy()
19525 (pi, target_gain, 2, in wlc_phy_init_nphy()
19527 wlc_phy_savecal_nphy(pi); in wlc_phy_init_nphy()
19530 } else if (pi->mphase_cal_phase_id == in wlc_phy_init_nphy()
19532 wlc_phy_cal_perical((struct brcms_phy_pub *) pi, in wlc_phy_init_nphy()
19536 wlc_phy_restorecal_nphy(pi); in wlc_phy_init_nphy()
19539 wlc_phy_txpwrctrl_coeff_setup_nphy(pi); in wlc_phy_init_nphy()
19541 wlc_phy_txpwrctrl_enable_nphy(pi, tx_pwr_ctrl_state); in wlc_phy_init_nphy()
19543 wlc_phy_nphy_tkip_rifs_war(pi, pi->sh->_rifs_phy); in wlc_phy_init_nphy()
19545 if (NREV_GE(pi->pubpi.phy_rev, 3) && NREV_LE(pi->pubpi.phy_rev, 6)) in wlc_phy_init_nphy()
19547 write_phy_reg(pi, 0x70, 50); in wlc_phy_init_nphy()
19549 wlc_phy_txlpfbw_nphy(pi); in wlc_phy_init_nphy()
19551 wlc_phy_spurwar_nphy(pi); in wlc_phy_init_nphy()
19555 static void wlc_phy_resetcca_nphy(struct brcms_phy *pi) in wlc_phy_resetcca_nphy() argument
19559 wlapi_bmac_phyclk_fgc(pi->sh->physhim, ON); in wlc_phy_resetcca_nphy()
19561 val = read_phy_reg(pi, 0x01); in wlc_phy_resetcca_nphy()
19562 write_phy_reg(pi, 0x01, val | BBCFG_RESETCCA); in wlc_phy_resetcca_nphy()
19564 write_phy_reg(pi, 0x01, val & (~BBCFG_RESETCCA)); in wlc_phy_resetcca_nphy()
19566 wlapi_bmac_phyclk_fgc(pi->sh->physhim, OFF); in wlc_phy_resetcca_nphy()
19568 wlc_phy_force_rfseq_nphy(pi, NPHY_RFSEQ_RESET2RX); in wlc_phy_resetcca_nphy()
19571 void wlc_phy_pa_override_nphy(struct brcms_phy *pi, bool en) in wlc_phy_pa_override_nphy() argument
19577 pi->rfctrlIntc1_save = read_phy_reg(pi, 0x91); in wlc_phy_pa_override_nphy()
19578 pi->rfctrlIntc2_save = read_phy_reg(pi, 0x92); in wlc_phy_pa_override_nphy()
19580 if (NREV_GE(pi->pubpi.phy_rev, 7)) in wlc_phy_pa_override_nphy()
19582 else if (NREV_GE(pi->pubpi.phy_rev, 3)) in wlc_phy_pa_override_nphy()
19584 CHSPEC_IS5G(pi->radio_chanspec) ? 0x600 : 0x480; in wlc_phy_pa_override_nphy()
19587 CHSPEC_IS5G(pi->radio_chanspec) ? 0x180 : 0x120; in wlc_phy_pa_override_nphy()
19589 write_phy_reg(pi, 0x91, rfctrlintc_override_val); in wlc_phy_pa_override_nphy()
19590 write_phy_reg(pi, 0x92, rfctrlintc_override_val); in wlc_phy_pa_override_nphy()
19592 write_phy_reg(pi, 0x91, pi->rfctrlIntc1_save); in wlc_phy_pa_override_nphy()
19593 write_phy_reg(pi, 0x92, pi->rfctrlIntc2_save); in wlc_phy_pa_override_nphy()
19598 void wlc_phy_stf_chain_upd_nphy(struct brcms_phy *pi) in wlc_phy_stf_chain_upd_nphy() argument
19605 if (pi->nphy_txrx_chain == BRCMS_N_TXRX_CHAIN0) { in wlc_phy_stf_chain_upd_nphy()
19609 if (NREV_LE(pi->pubpi.phy_rev, 2)) in wlc_phy_stf_chain_upd_nphy()
19610 and_phy_reg(pi, 0xa0, ~0x20); in wlc_phy_stf_chain_upd_nphy()
19611 } else if (pi->nphy_txrx_chain == BRCMS_N_TXRX_CHAIN1) { in wlc_phy_stf_chain_upd_nphy()
19615 if (NREV_LE(pi->pubpi.phy_rev, 2)) in wlc_phy_stf_chain_upd_nphy()
19616 or_phy_reg(pi, 0xa0, 0x20); in wlc_phy_stf_chain_upd_nphy()
19619 mod_phy_reg(pi, 0xa2, ((0xf << 0) | (0xf << 4)), txrx_chain); in wlc_phy_stf_chain_upd_nphy()
19622 pi->nphy_perical = PHY_PERICAL_DISABLE; in wlc_phy_stf_chain_upd_nphy()
19623 or_phy_reg(pi, 0xa1, NPHY_RfseqMode_CoreActv_override); in wlc_phy_stf_chain_upd_nphy()
19625 pi->nphy_perical = PHY_PERICAL_MPHASE; in wlc_phy_stf_chain_upd_nphy()
19626 and_phy_reg(pi, 0xa1, ~NPHY_RfseqMode_CoreActv_override); in wlc_phy_stf_chain_upd_nphy()
19635 struct brcms_phy *pi = container_of(pih, struct brcms_phy, pubpi_ro); in wlc_phy_rxcore_setstate_nphy() local
19639 pi->sh->phyrxchain = rxcore_bitmask; in wlc_phy_rxcore_setstate_nphy()
19641 if (!pi->sh->clk) in wlc_phy_rxcore_setstate_nphy()
19644 suspend = (0 == (bcma_read32(pi->d11core, D11REGOFFS(maccontrol)) & in wlc_phy_rxcore_setstate_nphy()
19647 wlapi_suspend_mac_and_wait(pi->sh->physhim); in wlc_phy_rxcore_setstate_nphy()
19649 if (pi->phyhang_avoid) in wlc_phy_rxcore_setstate_nphy()
19650 wlc_phy_stay_in_carriersearch_nphy(pi, true); in wlc_phy_rxcore_setstate_nphy()
19652 regval = read_phy_reg(pi, 0xa2); in wlc_phy_rxcore_setstate_nphy()
19655 write_phy_reg(pi, 0xa2, regval); in wlc_phy_rxcore_setstate_nphy()
19659 write_phy_reg(pi, 0x20e, 1); in wlc_phy_rxcore_setstate_nphy()
19661 if (NREV_GE(pi->pubpi.phy_rev, 3)) { in wlc_phy_rxcore_setstate_nphy()
19662 if (pi->rx2tx_biasentry == -1) { in wlc_phy_rxcore_setstate_nphy()
19663 wlc_phy_table_read_nphy(pi, NPHY_TBL_ID_RFSEQ, in wlc_phy_rxcore_setstate_nphy()
19670 pi->rx2tx_biasentry = (u8) i; in wlc_phy_rxcore_setstate_nphy()
19674 pi, in wlc_phy_rxcore_setstate_nphy()
19688 write_phy_reg(pi, 0x20e, 30); in wlc_phy_rxcore_setstate_nphy()
19690 if (NREV_GE(pi->pubpi.phy_rev, 3)) { in wlc_phy_rxcore_setstate_nphy()
19691 if (pi->rx2tx_biasentry != -1) { in wlc_phy_rxcore_setstate_nphy()
19693 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_RFSEQ, in wlc_phy_rxcore_setstate_nphy()
19694 1, pi->rx2tx_biasentry, in wlc_phy_rxcore_setstate_nphy()
19696 pi->rx2tx_biasentry = -1; in wlc_phy_rxcore_setstate_nphy()
19701 wlc_phy_force_rfseq_nphy(pi, NPHY_RFSEQ_RESET2RX); in wlc_phy_rxcore_setstate_nphy()
19703 if (pi->phyhang_avoid) in wlc_phy_rxcore_setstate_nphy()
19704 wlc_phy_stay_in_carriersearch_nphy(pi, false); in wlc_phy_rxcore_setstate_nphy()
19707 wlapi_enable_mac(pi->sh->physhim); in wlc_phy_rxcore_setstate_nphy()
19713 struct brcms_phy *pi = container_of(pih, struct brcms_phy, pubpi_ro); in wlc_phy_rxcore_getstate_nphy() local
19715 regval = read_phy_reg(pi, 0xa2); in wlc_phy_rxcore_getstate_nphy()
19721 bool wlc_phy_n_txpower_ipa_ison(struct brcms_phy *pi) in wlc_phy_n_txpower_ipa_ison() argument
19723 return PHY_IPA(pi); in wlc_phy_n_txpower_ipa_ison()
19726 void wlc_phy_cal_init_nphy(struct brcms_phy *pi) in wlc_phy_cal_init_nphy() argument
19730 static void wlc_phy_radio_preinit_205x(struct brcms_phy *pi) in wlc_phy_radio_preinit_205x() argument
19733 and_phy_reg(pi, 0x78, ~RFCC_CHIP0_PU); in wlc_phy_radio_preinit_205x()
19734 and_phy_reg(pi, 0x78, RFCC_OE_POR_FORCE); in wlc_phy_radio_preinit_205x()
19736 or_phy_reg(pi, 0x78, ~RFCC_OE_POR_FORCE); in wlc_phy_radio_preinit_205x()
19737 or_phy_reg(pi, 0x78, RFCC_CHIP0_PU); in wlc_phy_radio_preinit_205x()
19741 static void wlc_phy_radio_init_2057(struct brcms_phy *pi) in wlc_phy_radio_init_2057() argument
19745 if (NREV_IS(pi->pubpi.phy_rev, 7)) { in wlc_phy_radio_init_2057()
19747 } else if (NREV_IS(pi->pubpi.phy_rev, 8) in wlc_phy_radio_init_2057()
19748 || NREV_IS(pi->pubpi.phy_rev, 9)) { in wlc_phy_radio_init_2057()
19749 switch (pi->pubpi.radiorev) { in wlc_phy_radio_init_2057()
19752 if (NREV_IS(pi->pubpi.phy_rev, 8)) in wlc_phy_radio_init_2057()
19754 else if (NREV_IS(pi->pubpi.phy_rev, 9)) in wlc_phy_radio_init_2057()
19773 wlc_phy_init_radio_regs_allbands(pi, regs_2057_ptr); in wlc_phy_radio_init_2057()
19776 static u16 wlc_phy_radio205x_rcal(struct brcms_phy *pi) in wlc_phy_radio205x_rcal() argument
19781 if (NREV_GE(pi->pubpi.phy_rev, 7)) { in wlc_phy_radio205x_rcal()
19783 if (pi->pubpi.radiorev == 5) { in wlc_phy_radio205x_rcal()
19785 and_phy_reg(pi, 0x342, ~(0x1 << 1)); in wlc_phy_radio205x_rcal()
19789 mod_radio_reg(pi, RADIO_2057_IQTEST_SEL_PU, 0x1, 0x1); in wlc_phy_radio205x_rcal()
19790 mod_radio_reg(pi, RADIO_2057v7_IQTEST_SEL_PU2, 0x2, in wlc_phy_radio205x_rcal()
19793 mod_radio_reg(pi, RADIO_2057_RCAL_CONFIG, 0x1, 0x1); in wlc_phy_radio205x_rcal()
19797 mod_radio_reg(pi, RADIO_2057_RCAL_CONFIG, 0x3, 0x3); in wlc_phy_radio205x_rcal()
19800 rcal_reg = read_radio_reg(pi, RADIO_2057_RCAL_STATUS); in wlc_phy_radio205x_rcal()
19811 mod_radio_reg(pi, RADIO_2057_RCAL_CONFIG, 0x2, 0x0); in wlc_phy_radio205x_rcal()
19813 rcal_reg = read_radio_reg(pi, RADIO_2057_RCAL_STATUS) & 0x3e; in wlc_phy_radio205x_rcal()
19815 mod_radio_reg(pi, RADIO_2057_RCAL_CONFIG, 0x1, 0x0); in wlc_phy_radio205x_rcal()
19816 if (pi->pubpi.radiorev == 5) { in wlc_phy_radio205x_rcal()
19818 mod_radio_reg(pi, RADIO_2057_IQTEST_SEL_PU, 0x1, 0x0); in wlc_phy_radio205x_rcal()
19819 mod_radio_reg(pi, RADIO_2057v7_IQTEST_SEL_PU2, 0x2, in wlc_phy_radio205x_rcal()
19823 if ((pi->pubpi.radiorev <= 4) || (pi->pubpi.radiorev == 6)) { in wlc_phy_radio205x_rcal()
19825 mod_radio_reg(pi, RADIO_2057_TEMPSENSE_CONFIG, 0x3c, in wlc_phy_radio205x_rcal()
19827 mod_radio_reg(pi, RADIO_2057_BANDGAP_RCAL_TRIM, 0xf0, in wlc_phy_radio205x_rcal()
19831 } else if (NREV_IS(pi->pubpi.phy_rev, 3)) { in wlc_phy_radio205x_rcal()
19836 pi, in wlc_phy_radio205x_rcal()
19839 write_radio_reg(pi, RADIO_2056_SYN_PLL_MAST2 | RADIO_2056_SYN, in wlc_phy_radio205x_rcal()
19843 write_radio_reg(pi, RADIO_2056_SYN_RCAL_MASTER | RADIO_2056_SYN, in wlc_phy_radio205x_rcal()
19847 write_radio_reg(pi, RADIO_2056_SYN_RCAL_MASTER | RADIO_2056_SYN, in wlc_phy_radio205x_rcal()
19852 pi, in wlc_phy_radio205x_rcal()
19865 write_radio_reg(pi, RADIO_2056_SYN_RCAL_MASTER | RADIO_2056_SYN, in wlc_phy_radio205x_rcal()
19869 read_radio_reg(pi, in wlc_phy_radio205x_rcal()
19873 write_radio_reg(pi, RADIO_2056_SYN_RCAL_MASTER | RADIO_2056_SYN, in wlc_phy_radio205x_rcal()
19876 write_radio_reg(pi, RADIO_2056_SYN_PLL_MAST2 | RADIO_2056_SYN, in wlc_phy_radio205x_rcal()
19884 static u16 wlc_phy_radio2057_rccal(struct brcms_phy *pi) in wlc_phy_radio2057_rccal() argument
19890 chip43226_6362A0 = ((pi->pubpi.radiorev == 3) in wlc_phy_radio2057_rccal()
19891 || (pi->pubpi.radiorev == 4) in wlc_phy_radio2057_rccal()
19892 || (pi->pubpi.radiorev == 6)); in wlc_phy_radio2057_rccal()
19896 write_radio_reg(pi, RADIO_2057_RCCAL_MASTER, 0x61); in wlc_phy_radio2057_rccal()
19897 write_radio_reg(pi, RADIO_2057_RCCAL_TRC0, 0xc0); in wlc_phy_radio2057_rccal()
19899 write_radio_reg(pi, RADIO_2057v7_RCCAL_MASTER, 0x61); in wlc_phy_radio2057_rccal()
19901 write_radio_reg(pi, RADIO_2057_RCCAL_TRC0, 0xe9); in wlc_phy_radio2057_rccal()
19903 write_radio_reg(pi, RADIO_2057_RCCAL_X1, 0x6e); in wlc_phy_radio2057_rccal()
19904 write_radio_reg(pi, RADIO_2057_RCCAL_START_R1_Q1_P1, 0x55); in wlc_phy_radio2057_rccal()
19907 rccal_valid = read_radio_reg(pi, RADIO_2057_RCCAL_DONE_OSCCAP); in wlc_phy_radio2057_rccal()
19914 write_radio_reg(pi, RADIO_2057_RCCAL_START_R1_Q1_P1, 0x15); in wlc_phy_radio2057_rccal()
19918 write_radio_reg(pi, RADIO_2057_RCCAL_MASTER, 0x69); in wlc_phy_radio2057_rccal()
19919 write_radio_reg(pi, RADIO_2057_RCCAL_TRC0, 0xb0); in wlc_phy_radio2057_rccal()
19921 write_radio_reg(pi, RADIO_2057v7_RCCAL_MASTER, 0x69); in wlc_phy_radio2057_rccal()
19923 write_radio_reg(pi, RADIO_2057_RCCAL_TRC0, 0xd5); in wlc_phy_radio2057_rccal()
19925 write_radio_reg(pi, RADIO_2057_RCCAL_X1, 0x6e); in wlc_phy_radio2057_rccal()
19926 write_radio_reg(pi, RADIO_2057_RCCAL_START_R1_Q1_P1, 0x55); in wlc_phy_radio2057_rccal()
19929 rccal_valid = read_radio_reg(pi, RADIO_2057_RCCAL_DONE_OSCCAP); in wlc_phy_radio2057_rccal()
19936 write_radio_reg(pi, RADIO_2057_RCCAL_START_R1_Q1_P1, 0x15); in wlc_phy_radio2057_rccal()
19940 write_radio_reg(pi, RADIO_2057_RCCAL_MASTER, 0x73); in wlc_phy_radio2057_rccal()
19942 write_radio_reg(pi, RADIO_2057_RCCAL_X1, 0x28); in wlc_phy_radio2057_rccal()
19943 write_radio_reg(pi, RADIO_2057_RCCAL_TRC0, 0xb0); in wlc_phy_radio2057_rccal()
19945 write_radio_reg(pi, RADIO_2057v7_RCCAL_MASTER, 0x73); in wlc_phy_radio2057_rccal()
19946 write_radio_reg(pi, RADIO_2057_RCCAL_X1, 0x6e); in wlc_phy_radio2057_rccal()
19947 write_radio_reg(pi, RADIO_2057_RCCAL_TRC0, 0x99); in wlc_phy_radio2057_rccal()
19949 write_radio_reg(pi, RADIO_2057_RCCAL_START_R1_Q1_P1, 0x55); in wlc_phy_radio2057_rccal()
19952 rccal_valid = read_radio_reg(pi, RADIO_2057_RCCAL_DONE_OSCCAP); in wlc_phy_radio2057_rccal()
19962 write_radio_reg(pi, RADIO_2057_RCCAL_START_R1_Q1_P1, 0x15); in wlc_phy_radio2057_rccal()
19967 static void wlc_phy_radio_postinit_2057(struct brcms_phy *pi) in wlc_phy_radio_postinit_2057() argument
19970 mod_radio_reg(pi, RADIO_2057_XTALPUOVR_PINCTRL, 0x1, 0x1); in wlc_phy_radio_postinit_2057()
19972 mod_radio_reg(pi, RADIO_2057_RFPLL_MISC_CAL_RESETN, 0x78, 0x78); in wlc_phy_radio_postinit_2057()
19973 mod_radio_reg(pi, RADIO_2057_XTAL_CONFIG2, 0x80, 0x80); in wlc_phy_radio_postinit_2057()
19975 mod_radio_reg(pi, RADIO_2057_RFPLL_MISC_CAL_RESETN, 0x78, 0x0); in wlc_phy_radio_postinit_2057()
19976 mod_radio_reg(pi, RADIO_2057_XTAL_CONFIG2, 0x80, 0x0); in wlc_phy_radio_postinit_2057()
19978 if (pi->phy_init_por) { in wlc_phy_radio_postinit_2057()
19979 wlc_phy_radio205x_rcal(pi); in wlc_phy_radio_postinit_2057()
19980 wlc_phy_radio2057_rccal(pi); in wlc_phy_radio_postinit_2057()
19983 mod_radio_reg(pi, RADIO_2057_RFPLL_MASTER, 0x8, 0x0); in wlc_phy_radio_postinit_2057()
19986 static void wlc_phy_radio_init_2056(struct brcms_phy *pi) in wlc_phy_radio_init_2056() argument
19992 if (NREV_IS(pi->pubpi.phy_rev, 3)) { in wlc_phy_radio_init_2056()
19996 } else if (NREV_IS(pi->pubpi.phy_rev, 4)) { in wlc_phy_radio_init_2056()
20001 switch (pi->pubpi.radiorev) { in wlc_phy_radio_init_2056()
20038 wlc_phy_init_radio_regs(pi, regs_SYN_2056_ptr, (u16) RADIO_2056_SYN); in wlc_phy_radio_init_2056()
20040 wlc_phy_init_radio_regs(pi, regs_TX_2056_ptr, (u16) RADIO_2056_TX0); in wlc_phy_radio_init_2056()
20042 wlc_phy_init_radio_regs(pi, regs_TX_2056_ptr, (u16) RADIO_2056_TX1); in wlc_phy_radio_init_2056()
20044 wlc_phy_init_radio_regs(pi, regs_RX_2056_ptr, (u16) RADIO_2056_RX0); in wlc_phy_radio_init_2056()
20046 wlc_phy_init_radio_regs(pi, regs_RX_2056_ptr, (u16) RADIO_2056_RX1); in wlc_phy_radio_init_2056()
20049 static void wlc_phy_radio_postinit_2056(struct brcms_phy *pi) in wlc_phy_radio_postinit_2056() argument
20051 mod_radio_reg(pi, RADIO_2056_SYN_COM_CTRL, 0xb, 0xb); in wlc_phy_radio_postinit_2056()
20053 mod_radio_reg(pi, RADIO_2056_SYN_COM_PU, 0x2, 0x2); in wlc_phy_radio_postinit_2056()
20054 mod_radio_reg(pi, RADIO_2056_SYN_COM_RESET, 0x2, 0x2); in wlc_phy_radio_postinit_2056()
20056 mod_radio_reg(pi, RADIO_2056_SYN_COM_RESET, 0x2, 0x0); in wlc_phy_radio_postinit_2056()
20058 if ((pi->sh->boardflags2 & BFL2_LEGACY) in wlc_phy_radio_postinit_2056()
20059 || (pi->sh->boardflags2 & BFL2_XTALBUFOUTEN)) in wlc_phy_radio_postinit_2056()
20060 mod_radio_reg(pi, RADIO_2056_SYN_PLL_MAST2, 0xf4, 0x0); in wlc_phy_radio_postinit_2056()
20062 mod_radio_reg(pi, RADIO_2056_SYN_PLL_MAST2, 0xfc, 0x0); in wlc_phy_radio_postinit_2056()
20064 mod_radio_reg(pi, RADIO_2056_SYN_RCCAL_CTRL0, 0x1, 0x0); in wlc_phy_radio_postinit_2056()
20066 if (pi->phy_init_por) in wlc_phy_radio_postinit_2056()
20067 wlc_phy_radio205x_rcal(pi); in wlc_phy_radio_postinit_2056()
20070 static void wlc_phy_radio_preinit_2055(struct brcms_phy *pi) in wlc_phy_radio_preinit_2055() argument
20073 and_phy_reg(pi, 0x78, ~RFCC_POR_FORCE); in wlc_phy_radio_preinit_2055()
20074 or_phy_reg(pi, 0x78, RFCC_CHIP0_PU | RFCC_OE_POR_FORCE); in wlc_phy_radio_preinit_2055()
20076 or_phy_reg(pi, 0x78, RFCC_POR_FORCE); in wlc_phy_radio_preinit_2055()
20079 static void wlc_phy_radio_init_2055(struct brcms_phy *pi) in wlc_phy_radio_init_2055() argument
20081 wlc_phy_init_radio_regs(pi, regs_2055, RADIO_DEFAULT_CORE); in wlc_phy_radio_init_2055()
20084 static void wlc_phy_radio_postinit_2055(struct brcms_phy *pi) in wlc_phy_radio_postinit_2055() argument
20087 and_radio_reg(pi, RADIO_2055_MASTER_CNTRL1, in wlc_phy_radio_postinit_2055()
20090 if (((pi->sh->sromrev >= 4) in wlc_phy_radio_postinit_2055()
20091 && !(pi->sh->boardflags2 & BFL2_RXBB_INT_REG_DIS)) in wlc_phy_radio_postinit_2055()
20092 || ((pi->sh->sromrev < 4))) { in wlc_phy_radio_postinit_2055()
20093 and_radio_reg(pi, RADIO_2055_CORE1_RXBB_REGULATOR, 0x7F); in wlc_phy_radio_postinit_2055()
20094 and_radio_reg(pi, RADIO_2055_CORE2_RXBB_REGULATOR, 0x7F); in wlc_phy_radio_postinit_2055()
20097 mod_radio_reg(pi, RADIO_2055_RRCCAL_N_OPT_SEL, 0x3F, 0x2C); in wlc_phy_radio_postinit_2055()
20098 write_radio_reg(pi, RADIO_2055_CAL_MISC, 0x3C); in wlc_phy_radio_postinit_2055()
20100 and_radio_reg(pi, RADIO_2055_CAL_MISC, in wlc_phy_radio_postinit_2055()
20103 or_radio_reg(pi, RADIO_2055_CAL_LPO_CNTRL, RADIO_2055_CAL_LPO_ENABLE); in wlc_phy_radio_postinit_2055()
20105 or_radio_reg(pi, RADIO_2055_CAL_MISC, RADIO_2055_RRCAL_RST_N); in wlc_phy_radio_postinit_2055()
20109 or_radio_reg(pi, RADIO_2055_CAL_MISC, RADIO_2055_RRCAL_START); in wlc_phy_radio_postinit_2055()
20111 SPINWAIT(((read_radio_reg(pi, RADIO_2055_CAL_COUNTER_OUT2) & in wlc_phy_radio_postinit_2055()
20114 if (WARN((read_radio_reg(pi, RADIO_2055_CAL_COUNTER_OUT2) & in wlc_phy_radio_postinit_2055()
20119 and_radio_reg(pi, RADIO_2055_CAL_LPO_CNTRL, in wlc_phy_radio_postinit_2055()
20122 wlc_phy_chanspec_set((struct brcms_phy_pub *) pi, pi->radio_chanspec); in wlc_phy_radio_postinit_2055()
20124 write_radio_reg(pi, RADIO_2055_CORE1_RXBB_LPF, 9); in wlc_phy_radio_postinit_2055()
20125 write_radio_reg(pi, RADIO_2055_CORE2_RXBB_LPF, 9); in wlc_phy_radio_postinit_2055()
20127 write_radio_reg(pi, RADIO_2055_CORE1_RXBB_MIDAC_HIPAS, 0x83); in wlc_phy_radio_postinit_2055()
20128 write_radio_reg(pi, RADIO_2055_CORE2_RXBB_MIDAC_HIPAS, 0x83); in wlc_phy_radio_postinit_2055()
20130 mod_radio_reg(pi, RADIO_2055_CORE1_LNA_GAINBST, in wlc_phy_radio_postinit_2055()
20132 mod_radio_reg(pi, RADIO_2055_CORE2_LNA_GAINBST, in wlc_phy_radio_postinit_2055()
20134 if (pi->nphy_gain_boost) { in wlc_phy_radio_postinit_2055()
20135 and_radio_reg(pi, RADIO_2055_CORE1_RXRF_SPC1, in wlc_phy_radio_postinit_2055()
20137 and_radio_reg(pi, RADIO_2055_CORE2_RXRF_SPC1, in wlc_phy_radio_postinit_2055()
20140 or_radio_reg(pi, RADIO_2055_CORE1_RXRF_SPC1, in wlc_phy_radio_postinit_2055()
20142 or_radio_reg(pi, RADIO_2055_CORE2_RXRF_SPC1, in wlc_phy_radio_postinit_2055()
20149 void wlc_phy_switch_radio_nphy(struct brcms_phy *pi, bool on) in wlc_phy_switch_radio_nphy() argument
20152 if (NREV_GE(pi->pubpi.phy_rev, 7)) { in wlc_phy_switch_radio_nphy()
20153 if (!pi->radio_is_on) { in wlc_phy_switch_radio_nphy()
20154 wlc_phy_radio_preinit_205x(pi); in wlc_phy_switch_radio_nphy()
20155 wlc_phy_radio_init_2057(pi); in wlc_phy_switch_radio_nphy()
20156 wlc_phy_radio_postinit_2057(pi); in wlc_phy_switch_radio_nphy()
20159 wlc_phy_chanspec_set((struct brcms_phy_pub *) pi, in wlc_phy_switch_radio_nphy()
20160 pi->radio_chanspec); in wlc_phy_switch_radio_nphy()
20161 } else if (NREV_GE(pi->pubpi.phy_rev, 3)) { in wlc_phy_switch_radio_nphy()
20162 wlc_phy_radio_preinit_205x(pi); in wlc_phy_switch_radio_nphy()
20163 wlc_phy_radio_init_2056(pi); in wlc_phy_switch_radio_nphy()
20164 wlc_phy_radio_postinit_2056(pi); in wlc_phy_switch_radio_nphy()
20166 wlc_phy_chanspec_set((struct brcms_phy_pub *) pi, in wlc_phy_switch_radio_nphy()
20167 pi->radio_chanspec); in wlc_phy_switch_radio_nphy()
20169 wlc_phy_radio_preinit_2055(pi); in wlc_phy_switch_radio_nphy()
20170 wlc_phy_radio_init_2055(pi); in wlc_phy_switch_radio_nphy()
20171 wlc_phy_radio_postinit_2055(pi); in wlc_phy_switch_radio_nphy()
20174 pi->radio_is_on = true; in wlc_phy_switch_radio_nphy()
20178 if (NREV_GE(pi->pubpi.phy_rev, 3) in wlc_phy_switch_radio_nphy()
20179 && NREV_LT(pi->pubpi.phy_rev, 7)) { in wlc_phy_switch_radio_nphy()
20180 and_phy_reg(pi, 0x78, ~RFCC_CHIP0_PU); in wlc_phy_switch_radio_nphy()
20181 mod_radio_reg(pi, RADIO_2056_SYN_COM_PU, 0x2, 0x0); in wlc_phy_switch_radio_nphy()
20183 write_radio_reg(pi, in wlc_phy_switch_radio_nphy()
20186 write_radio_reg(pi, in wlc_phy_switch_radio_nphy()
20189 write_radio_reg(pi, in wlc_phy_switch_radio_nphy()
20192 write_radio_reg(pi, in wlc_phy_switch_radio_nphy()
20195 mod_radio_reg(pi, in wlc_phy_switch_radio_nphy()
20198 write_radio_reg(pi, in wlc_phy_switch_radio_nphy()
20202 write_radio_reg(pi, in wlc_phy_switch_radio_nphy()
20205 write_radio_reg(pi, in wlc_phy_switch_radio_nphy()
20208 write_radio_reg(pi, in wlc_phy_switch_radio_nphy()
20211 write_radio_reg(pi, in wlc_phy_switch_radio_nphy()
20214 mod_radio_reg(pi, in wlc_phy_switch_radio_nphy()
20217 write_radio_reg(pi, in wlc_phy_switch_radio_nphy()
20221 pi->radio_is_on = false; in wlc_phy_switch_radio_nphy()
20224 if (NREV_GE(pi->pubpi.phy_rev, 8)) { in wlc_phy_switch_radio_nphy()
20225 and_phy_reg(pi, 0x78, ~RFCC_CHIP0_PU); in wlc_phy_switch_radio_nphy()
20226 pi->radio_is_on = false; in wlc_phy_switch_radio_nphy()
20233 wlc_phy_chan2freq_nphy(struct brcms_phy *pi, uint channel, int *f, in wlc_phy_chan2freq_nphy() argument
20247 if (NREV_GE(pi->pubpi.phy_rev, 7)) { in wlc_phy_chan2freq_nphy()
20249 if (NREV_IS(pi->pubpi.phy_rev, 7)) { in wlc_phy_chan2freq_nphy()
20254 } else if (NREV_IS(pi->pubpi.phy_rev, 8) in wlc_phy_chan2freq_nphy()
20255 || NREV_IS(pi->pubpi.phy_rev, 9)) { in wlc_phy_chan2freq_nphy()
20256 switch (pi->pubpi.radiorev) { in wlc_phy_chan2freq_nphy()
20260 if (pi->pubpi.radiover == 0x0) { in wlc_phy_chan2freq_nphy()
20267 } else if (pi->pubpi.radiover == 0x1) { in wlc_phy_chan2freq_nphy()
20294 } else if (NREV_IS(pi->pubpi.phy_rev, 16)) { in wlc_phy_chan2freq_nphy()
20303 if (pi->pubpi.radiorev == 5) { in wlc_phy_chan2freq_nphy()
20317 if (pi->pubpi.radiorev == 5) { in wlc_phy_chan2freq_nphy()
20325 } else if (NREV_GE(pi->pubpi.phy_rev, 3)) { in wlc_phy_chan2freq_nphy()
20326 if (NREV_IS(pi->pubpi.phy_rev, 3)) { in wlc_phy_chan2freq_nphy()
20329 } else if (NREV_IS(pi->pubpi.phy_rev, 4)) { in wlc_phy_chan2freq_nphy()
20332 } else if (NREV_IS(pi->pubpi.phy_rev, 5) in wlc_phy_chan2freq_nphy()
20333 || NREV_IS(pi->pubpi.phy_rev, 6)) { in wlc_phy_chan2freq_nphy()
20334 switch (pi->pubpi.radiorev) { in wlc_phy_chan2freq_nphy()
20394 u8 wlc_phy_get_chan_freq_range_nphy(struct brcms_phy *pi, uint channel) in wlc_phy_get_chan_freq_range_nphy() argument
20403 channel = CHSPEC_CHANNEL(pi->radio_chanspec); in wlc_phy_get_chan_freq_range_nphy()
20405 wlc_phy_chan2freq_nphy(pi, channel, &freq, &t0, &t1, &t2, &t3); in wlc_phy_get_chan_freq_range_nphy()
20407 if (CHSPEC_IS2G(pi->radio_chanspec)) in wlc_phy_get_chan_freq_range_nphy()
20419 wlc_phy_chanspec_radio2055_setup(struct brcms_phy *pi, in wlc_phy_chanspec_radio2055_setup() argument
20423 write_radio_reg(pi, RADIO_2055_PLL_REF, ci->RF_pll_ref); in wlc_phy_chanspec_radio2055_setup()
20424 write_radio_reg(pi, RADIO_2055_RF_PLL_MOD0, ci->RF_rf_pll_mod0); in wlc_phy_chanspec_radio2055_setup()
20425 write_radio_reg(pi, RADIO_2055_RF_PLL_MOD1, ci->RF_rf_pll_mod1); in wlc_phy_chanspec_radio2055_setup()
20426 write_radio_reg(pi, RADIO_2055_VCO_CAP_TAIL, ci->RF_vco_cap_tail); in wlc_phy_chanspec_radio2055_setup()
20428 BRCMS_PHY_WAR_PR51571(pi); in wlc_phy_chanspec_radio2055_setup()
20430 write_radio_reg(pi, RADIO_2055_VCO_CAL1, ci->RF_vco_cal1); in wlc_phy_chanspec_radio2055_setup()
20431 write_radio_reg(pi, RADIO_2055_VCO_CAL2, ci->RF_vco_cal2); in wlc_phy_chanspec_radio2055_setup()
20432 write_radio_reg(pi, RADIO_2055_PLL_LF_C1, ci->RF_pll_lf_c1); in wlc_phy_chanspec_radio2055_setup()
20433 write_radio_reg(pi, RADIO_2055_PLL_LF_R1, ci->RF_pll_lf_r1); in wlc_phy_chanspec_radio2055_setup()
20435 BRCMS_PHY_WAR_PR51571(pi); in wlc_phy_chanspec_radio2055_setup()
20437 write_radio_reg(pi, RADIO_2055_PLL_LF_C2, ci->RF_pll_lf_c2); in wlc_phy_chanspec_radio2055_setup()
20438 write_radio_reg(pi, RADIO_2055_LGBUF_CEN_BUF, ci->RF_lgbuf_cen_buf); in wlc_phy_chanspec_radio2055_setup()
20439 write_radio_reg(pi, RADIO_2055_LGEN_TUNE1, ci->RF_lgen_tune1); in wlc_phy_chanspec_radio2055_setup()
20440 write_radio_reg(pi, RADIO_2055_LGEN_TUNE2, ci->RF_lgen_tune2); in wlc_phy_chanspec_radio2055_setup()
20442 BRCMS_PHY_WAR_PR51571(pi); in wlc_phy_chanspec_radio2055_setup()
20444 write_radio_reg(pi, RADIO_2055_CORE1_LGBUF_A_TUNE, in wlc_phy_chanspec_radio2055_setup()
20446 write_radio_reg(pi, RADIO_2055_CORE1_LGBUF_G_TUNE, in wlc_phy_chanspec_radio2055_setup()
20448 write_radio_reg(pi, RADIO_2055_CORE1_RXRF_REG1, ci->RF_core1_rxrf_reg1); in wlc_phy_chanspec_radio2055_setup()
20449 write_radio_reg(pi, RADIO_2055_CORE1_TX_PGA_PAD_TN, in wlc_phy_chanspec_radio2055_setup()
20452 BRCMS_PHY_WAR_PR51571(pi); in wlc_phy_chanspec_radio2055_setup()
20454 write_radio_reg(pi, RADIO_2055_CORE1_TX_MX_BGTRIM, in wlc_phy_chanspec_radio2055_setup()
20456 write_radio_reg(pi, RADIO_2055_CORE2_LGBUF_A_TUNE, in wlc_phy_chanspec_radio2055_setup()
20458 write_radio_reg(pi, RADIO_2055_CORE2_LGBUF_G_TUNE, in wlc_phy_chanspec_radio2055_setup()
20460 write_radio_reg(pi, RADIO_2055_CORE2_RXRF_REG1, ci->RF_core2_rxrf_reg1); in wlc_phy_chanspec_radio2055_setup()
20462 BRCMS_PHY_WAR_PR51571(pi); in wlc_phy_chanspec_radio2055_setup()
20464 write_radio_reg(pi, RADIO_2055_CORE2_TX_PGA_PAD_TN, in wlc_phy_chanspec_radio2055_setup()
20466 write_radio_reg(pi, RADIO_2055_CORE2_TX_MX_BGTRIM, in wlc_phy_chanspec_radio2055_setup()
20471 write_radio_reg(pi, RADIO_2055_VCO_CAL10, 0x05); in wlc_phy_chanspec_radio2055_setup()
20472 write_radio_reg(pi, RADIO_2055_VCO_CAL10, 0x45); in wlc_phy_chanspec_radio2055_setup()
20474 BRCMS_PHY_WAR_PR51571(pi); in wlc_phy_chanspec_radio2055_setup()
20476 write_radio_reg(pi, RADIO_2055_VCO_CAL10, 0x65); in wlc_phy_chanspec_radio2055_setup()
20482 wlc_phy_chanspec_radio2056_setup(struct brcms_phy *pi, in wlc_phy_chanspec_radio2056_setup() argument
20487 write_radio_reg(pi, in wlc_phy_chanspec_radio2056_setup()
20490 write_radio_reg(pi, RADIO_2056_SYN_PLL_VCOCAL2 | RADIO_2056_SYN, in wlc_phy_chanspec_radio2056_setup()
20492 write_radio_reg(pi, RADIO_2056_SYN_PLL_REFDIV | RADIO_2056_SYN, in wlc_phy_chanspec_radio2056_setup()
20494 write_radio_reg(pi, RADIO_2056_SYN_PLL_MMD2 | RADIO_2056_SYN, in wlc_phy_chanspec_radio2056_setup()
20496 write_radio_reg(pi, RADIO_2056_SYN_PLL_MMD1 | RADIO_2056_SYN, in wlc_phy_chanspec_radio2056_setup()
20498 write_radio_reg(pi, RADIO_2056_SYN_PLL_LOOPFILTER1 | RADIO_2056_SYN, in wlc_phy_chanspec_radio2056_setup()
20500 write_radio_reg(pi, RADIO_2056_SYN_PLL_LOOPFILTER2 | RADIO_2056_SYN, in wlc_phy_chanspec_radio2056_setup()
20502 write_radio_reg(pi, RADIO_2056_SYN_PLL_LOOPFILTER3 | RADIO_2056_SYN, in wlc_phy_chanspec_radio2056_setup()
20504 write_radio_reg(pi, RADIO_2056_SYN_PLL_LOOPFILTER4 | RADIO_2056_SYN, in wlc_phy_chanspec_radio2056_setup()
20506 write_radio_reg(pi, RADIO_2056_SYN_PLL_LOOPFILTER5 | RADIO_2056_SYN, in wlc_phy_chanspec_radio2056_setup()
20508 write_radio_reg(pi, RADIO_2056_SYN_RESERVED_ADDR27 | RADIO_2056_SYN, in wlc_phy_chanspec_radio2056_setup()
20510 write_radio_reg(pi, RADIO_2056_SYN_RESERVED_ADDR28 | RADIO_2056_SYN, in wlc_phy_chanspec_radio2056_setup()
20512 write_radio_reg(pi, RADIO_2056_SYN_RESERVED_ADDR29 | RADIO_2056_SYN, in wlc_phy_chanspec_radio2056_setup()
20514 write_radio_reg(pi, RADIO_2056_SYN_LOGEN_VCOBUF1 | RADIO_2056_SYN, in wlc_phy_chanspec_radio2056_setup()
20516 write_radio_reg(pi, RADIO_2056_SYN_LOGEN_MIXER2 | RADIO_2056_SYN, in wlc_phy_chanspec_radio2056_setup()
20518 write_radio_reg(pi, RADIO_2056_SYN_LOGEN_BUF3 | RADIO_2056_SYN, in wlc_phy_chanspec_radio2056_setup()
20520 write_radio_reg(pi, RADIO_2056_SYN_LOGEN_BUF4 | RADIO_2056_SYN, in wlc_phy_chanspec_radio2056_setup()
20523 write_radio_reg(pi, in wlc_phy_chanspec_radio2056_setup()
20526 write_radio_reg(pi, RADIO_2056_RX_LNAG_TUNE | RADIO_2056_RX0, in wlc_phy_chanspec_radio2056_setup()
20528 write_radio_reg(pi, RADIO_2056_TX_INTPAA_BOOST_TUNE | RADIO_2056_TX0, in wlc_phy_chanspec_radio2056_setup()
20530 write_radio_reg(pi, RADIO_2056_TX_INTPAG_BOOST_TUNE | RADIO_2056_TX0, in wlc_phy_chanspec_radio2056_setup()
20532 write_radio_reg(pi, RADIO_2056_TX_PADA_BOOST_TUNE | RADIO_2056_TX0, in wlc_phy_chanspec_radio2056_setup()
20534 write_radio_reg(pi, RADIO_2056_TX_PADG_BOOST_TUNE | RADIO_2056_TX0, in wlc_phy_chanspec_radio2056_setup()
20536 write_radio_reg(pi, RADIO_2056_TX_PGAA_BOOST_TUNE | RADIO_2056_TX0, in wlc_phy_chanspec_radio2056_setup()
20538 write_radio_reg(pi, RADIO_2056_TX_PGAG_BOOST_TUNE | RADIO_2056_TX0, in wlc_phy_chanspec_radio2056_setup()
20540 write_radio_reg(pi, RADIO_2056_TX_MIXA_BOOST_TUNE | RADIO_2056_TX0, in wlc_phy_chanspec_radio2056_setup()
20542 write_radio_reg(pi, RADIO_2056_TX_MIXG_BOOST_TUNE | RADIO_2056_TX0, in wlc_phy_chanspec_radio2056_setup()
20545 write_radio_reg(pi, in wlc_phy_chanspec_radio2056_setup()
20548 write_radio_reg(pi, RADIO_2056_RX_LNAG_TUNE | RADIO_2056_RX1, in wlc_phy_chanspec_radio2056_setup()
20550 write_radio_reg(pi, RADIO_2056_TX_INTPAA_BOOST_TUNE | RADIO_2056_TX1, in wlc_phy_chanspec_radio2056_setup()
20552 write_radio_reg(pi, RADIO_2056_TX_INTPAG_BOOST_TUNE | RADIO_2056_TX1, in wlc_phy_chanspec_radio2056_setup()
20554 write_radio_reg(pi, RADIO_2056_TX_PADA_BOOST_TUNE | RADIO_2056_TX1, in wlc_phy_chanspec_radio2056_setup()
20556 write_radio_reg(pi, RADIO_2056_TX_PADG_BOOST_TUNE | RADIO_2056_TX1, in wlc_phy_chanspec_radio2056_setup()
20558 write_radio_reg(pi, RADIO_2056_TX_PGAA_BOOST_TUNE | RADIO_2056_TX1, in wlc_phy_chanspec_radio2056_setup()
20560 write_radio_reg(pi, RADIO_2056_TX_PGAG_BOOST_TUNE | RADIO_2056_TX1, in wlc_phy_chanspec_radio2056_setup()
20562 write_radio_reg(pi, RADIO_2056_TX_MIXA_BOOST_TUNE | RADIO_2056_TX1, in wlc_phy_chanspec_radio2056_setup()
20564 write_radio_reg(pi, RADIO_2056_TX_MIXG_BOOST_TUNE | RADIO_2056_TX1, in wlc_phy_chanspec_radio2056_setup()
20567 if (NREV_IS(pi->pubpi.phy_rev, 3)) in wlc_phy_chanspec_radio2056_setup()
20569 else if (NREV_IS(pi->pubpi.phy_rev, 4)) in wlc_phy_chanspec_radio2056_setup()
20572 switch (pi->pubpi.radiorev) { in wlc_phy_chanspec_radio2056_setup()
20591 if (CHSPEC_IS2G(pi->radio_chanspec)) in wlc_phy_chanspec_radio2056_setup()
20592 write_radio_reg(pi, RADIO_2056_SYN_PLL_CP2 | in wlc_phy_chanspec_radio2056_setup()
20596 write_radio_reg(pi, RADIO_2056_SYN_PLL_CP2 | in wlc_phy_chanspec_radio2056_setup()
20600 if (pi->sh->boardflags2 & BFL2_GPLL_WAR) { in wlc_phy_chanspec_radio2056_setup()
20601 if (CHSPEC_IS2G(pi->radio_chanspec)) { in wlc_phy_chanspec_radio2056_setup()
20602 write_radio_reg(pi, RADIO_2056_SYN_PLL_LOOPFILTER1 | in wlc_phy_chanspec_radio2056_setup()
20604 write_radio_reg(pi, RADIO_2056_SYN_PLL_LOOPFILTER2 | in wlc_phy_chanspec_radio2056_setup()
20607 if ((pi->sh->chip == BCMA_CHIP_ID_BCM4716) || in wlc_phy_chanspec_radio2056_setup()
20608 (pi->sh->chip == BCMA_CHIP_ID_BCM47162)) { in wlc_phy_chanspec_radio2056_setup()
20609 write_radio_reg(pi, in wlc_phy_chanspec_radio2056_setup()
20612 write_radio_reg(pi, in wlc_phy_chanspec_radio2056_setup()
20616 write_radio_reg(pi, in wlc_phy_chanspec_radio2056_setup()
20619 write_radio_reg(pi, in wlc_phy_chanspec_radio2056_setup()
20626 if ((pi->sh->boardflags2 & BFL2_GPLL_WAR2) && in wlc_phy_chanspec_radio2056_setup()
20627 (CHSPEC_IS2G(pi->radio_chanspec))) { in wlc_phy_chanspec_radio2056_setup()
20628 write_radio_reg(pi, in wlc_phy_chanspec_radio2056_setup()
20631 write_radio_reg(pi, in wlc_phy_chanspec_radio2056_setup()
20634 write_radio_reg(pi, in wlc_phy_chanspec_radio2056_setup()
20637 write_radio_reg(pi, RADIO_2056_SYN_PLL_CP2 | RADIO_2056_SYN, in wlc_phy_chanspec_radio2056_setup()
20641 if (pi->sh->boardflags2 & BFL2_APLL_WAR) { in wlc_phy_chanspec_radio2056_setup()
20642 if (CHSPEC_IS5G(pi->radio_chanspec)) { in wlc_phy_chanspec_radio2056_setup()
20643 write_radio_reg(pi, RADIO_2056_SYN_PLL_LOOPFILTER1 | in wlc_phy_chanspec_radio2056_setup()
20645 write_radio_reg(pi, RADIO_2056_SYN_PLL_LOOPFILTER2 | in wlc_phy_chanspec_radio2056_setup()
20647 write_radio_reg(pi, RADIO_2056_SYN_PLL_LOOPFILTER4 | in wlc_phy_chanspec_radio2056_setup()
20649 write_radio_reg(pi, RADIO_2056_SYN_PLL_CP2 | in wlc_phy_chanspec_radio2056_setup()
20654 if (PHY_IPA(pi) && CHSPEC_IS2G(pi->radio_chanspec)) { in wlc_phy_chanspec_radio2056_setup()
20662 for (core = 0; core < pi->pubpi.phy_corenum; core++) { in wlc_phy_chanspec_radio2056_setup()
20664 if (NREV_GE(pi->pubpi.phy_rev, 5)) { in wlc_phy_chanspec_radio2056_setup()
20666 WRITE_RADIO_REG2(pi, RADIO_2056, TX, core, in wlc_phy_chanspec_radio2056_setup()
20669 if ((pi->sh->chip == BCMA_CHIP_ID_BCM4716) || in wlc_phy_chanspec_radio2056_setup()
20670 (pi->sh->chip == BCMA_CHIP_ID_BCM47162)) { in wlc_phy_chanspec_radio2056_setup()
20681 if ((pi->sh->chip == BCMA_CHIP_ID_BCM43224 || in wlc_phy_chanspec_radio2056_setup()
20682 pi->sh->chip == BCMA_CHIP_ID_BCM43225) && in wlc_phy_chanspec_radio2056_setup()
20683 pi->sh->chippkg == BCMA_PKG_ID_BCM43224_FAB_SMIC) { in wlc_phy_chanspec_radio2056_setup()
20694 WRITE_RADIO_REG2(pi, RADIO_2056, TX, core, in wlc_phy_chanspec_radio2056_setup()
20696 WRITE_RADIO_REG2(pi, RADIO_2056, TX, core, in wlc_phy_chanspec_radio2056_setup()
20698 WRITE_RADIO_REG2(pi, RADIO_2056, TX, core, in wlc_phy_chanspec_radio2056_setup()
20701 WRITE_RADIO_REG2(pi, RADIO_2056, TX, core, in wlc_phy_chanspec_radio2056_setup()
20704 WRITE_RADIO_REG2(pi, RADIO_2056, TX, core, in wlc_phy_chanspec_radio2056_setup()
20707 WRITE_RADIO_REG2(pi, RADIO_2056, TX, core, in wlc_phy_chanspec_radio2056_setup()
20710 WRITE_RADIO_REG2(pi, RADIO_2056, TX, core, in wlc_phy_chanspec_radio2056_setup()
20715 bias = (pi->bw == WL_CHANSPEC_BW_40) ? in wlc_phy_chanspec_radio2056_setup()
20718 WRITE_RADIO_REG2(pi, RADIO_2056, TX, core, in wlc_phy_chanspec_radio2056_setup()
20720 WRITE_RADIO_REG2(pi, RADIO_2056, TX, core, in wlc_phy_chanspec_radio2056_setup()
20722 WRITE_RADIO_REG2(pi, RADIO_2056, TX, core, in wlc_phy_chanspec_radio2056_setup()
20725 WRITE_RADIO_REG2(pi, RADIO_2056, TX, core, PA_SPARE1, in wlc_phy_chanspec_radio2056_setup()
20730 if (PHY_IPA(pi) && NREV_IS(pi->pubpi.phy_rev, 6) in wlc_phy_chanspec_radio2056_setup()
20731 && CHSPEC_IS5G(pi->radio_chanspec)) { in wlc_phy_chanspec_radio2056_setup()
20739 freq = CHAN5G_FREQ(CHSPEC_CHANNEL(pi->radio_chanspec)); in wlc_phy_chanspec_radio2056_setup()
20771 for (core = 0; core < pi->pubpi.phy_corenum; core++) { in wlc_phy_chanspec_radio2056_setup()
20772 WRITE_RADIO_REG2(pi, RADIO_2056, TX, core, in wlc_phy_chanspec_radio2056_setup()
20774 WRITE_RADIO_REG2(pi, RADIO_2056, TX, core, in wlc_phy_chanspec_radio2056_setup()
20776 WRITE_RADIO_REG2(pi, RADIO_2056, TX, core, in wlc_phy_chanspec_radio2056_setup()
20778 WRITE_RADIO_REG2(pi, RADIO_2056, TX, core, in wlc_phy_chanspec_radio2056_setup()
20781 WRITE_RADIO_REG2(pi, RADIO_2056, TX, core, in wlc_phy_chanspec_radio2056_setup()
20783 WRITE_RADIO_REG2(pi, RADIO_2056, TX, core, in wlc_phy_chanspec_radio2056_setup()
20786 WRITE_RADIO_REG2(pi, RADIO_2056, TX, core, in wlc_phy_chanspec_radio2056_setup()
20791 if ((pi->sh->chip == BCMA_CHIP_ID_BCM43224 || in wlc_phy_chanspec_radio2056_setup()
20792 pi->sh->chip == BCMA_CHIP_ID_BCM43225) && in wlc_phy_chanspec_radio2056_setup()
20793 pi->sh->chippkg == BCMA_PKG_ID_BCM43224_FAB_SMIC) in wlc_phy_chanspec_radio2056_setup()
20796 pabias = (pi->phy_pabias == 0) ? 0x30 : pi->phy_pabias; in wlc_phy_chanspec_radio2056_setup()
20798 WRITE_RADIO_REG2(pi, RADIO_2056, TX, core, in wlc_phy_chanspec_radio2056_setup()
20800 WRITE_RADIO_REG2(pi, RADIO_2056, TX, core, in wlc_phy_chanspec_radio2056_setup()
20802 WRITE_RADIO_REG2(pi, RADIO_2056, TX, core, in wlc_phy_chanspec_radio2056_setup()
20809 wlc_phy_radio205x_vcocal_nphy(pi); in wlc_phy_chanspec_radio2056_setup()
20812 void wlc_phy_radio205x_vcocal_nphy(struct brcms_phy *pi) in wlc_phy_radio205x_vcocal_nphy() argument
20814 if (NREV_GE(pi->pubpi.phy_rev, 7)) { in wlc_phy_radio205x_vcocal_nphy()
20815 mod_radio_reg(pi, RADIO_2057_RFPLL_MISC_EN, 0x01, 0x0); in wlc_phy_radio205x_vcocal_nphy()
20816 mod_radio_reg(pi, RADIO_2057_RFPLL_MISC_CAL_RESETN, 0x04, 0x0); in wlc_phy_radio205x_vcocal_nphy()
20817 mod_radio_reg(pi, RADIO_2057_RFPLL_MISC_CAL_RESETN, 0x04, in wlc_phy_radio205x_vcocal_nphy()
20819 mod_radio_reg(pi, RADIO_2057_RFPLL_MISC_EN, 0x01, 0x01); in wlc_phy_radio205x_vcocal_nphy()
20820 } else if (NREV_GE(pi->pubpi.phy_rev, 3)) { in wlc_phy_radio205x_vcocal_nphy()
20821 write_radio_reg(pi, RADIO_2056_SYN_PLL_VCOCAL12, 0x0); in wlc_phy_radio205x_vcocal_nphy()
20822 write_radio_reg(pi, RADIO_2056_SYN_PLL_MAST3, 0x38); in wlc_phy_radio205x_vcocal_nphy()
20823 write_radio_reg(pi, RADIO_2056_SYN_PLL_MAST3, 0x18); in wlc_phy_radio205x_vcocal_nphy()
20824 write_radio_reg(pi, RADIO_2056_SYN_PLL_MAST3, 0x38); in wlc_phy_radio205x_vcocal_nphy()
20825 write_radio_reg(pi, RADIO_2056_SYN_PLL_MAST3, 0x39); in wlc_phy_radio205x_vcocal_nphy()
20833 struct brcms_phy *pi, in wlc_phy_chanspec_radio2057_setup() argument
20842 if (pi->pubpi.radiorev == 5) { in wlc_phy_chanspec_radio2057_setup()
20844 write_radio_reg(pi, in wlc_phy_chanspec_radio2057_setup()
20847 write_radio_reg(pi, RADIO_2057_VCOCAL_COUNTVAL1, in wlc_phy_chanspec_radio2057_setup()
20849 write_radio_reg(pi, RADIO_2057_RFPLL_REFMASTER_SPAREXTALSIZE, in wlc_phy_chanspec_radio2057_setup()
20851 write_radio_reg(pi, RADIO_2057_RFPLL_LOOPFILTER_R1, in wlc_phy_chanspec_radio2057_setup()
20853 write_radio_reg(pi, RADIO_2057_RFPLL_LOOPFILTER_C2, in wlc_phy_chanspec_radio2057_setup()
20855 write_radio_reg(pi, RADIO_2057_RFPLL_LOOPFILTER_C1, in wlc_phy_chanspec_radio2057_setup()
20857 write_radio_reg(pi, RADIO_2057_CP_KPD_IDAC, in wlc_phy_chanspec_radio2057_setup()
20859 write_radio_reg(pi, RADIO_2057_RFPLL_MMD0, ci2->RF_rfpll_mmd0); in wlc_phy_chanspec_radio2057_setup()
20860 write_radio_reg(pi, RADIO_2057_RFPLL_MMD1, ci2->RF_rfpll_mmd1); in wlc_phy_chanspec_radio2057_setup()
20861 write_radio_reg(pi, in wlc_phy_chanspec_radio2057_setup()
20863 write_radio_reg(pi, in wlc_phy_chanspec_radio2057_setup()
20866 write_radio_reg(pi, RADIO_2057_LOGEN_INDBUF2G_TUNE, in wlc_phy_chanspec_radio2057_setup()
20869 write_radio_reg(pi, in wlc_phy_chanspec_radio2057_setup()
20872 write_radio_reg(pi, in wlc_phy_chanspec_radio2057_setup()
20875 write_radio_reg(pi, RADIO_2057_LNA2G_TUNE_CORE0, in wlc_phy_chanspec_radio2057_setup()
20878 write_radio_reg(pi, in wlc_phy_chanspec_radio2057_setup()
20881 write_radio_reg(pi, in wlc_phy_chanspec_radio2057_setup()
20884 write_radio_reg(pi, RADIO_2057_LNA2G_TUNE_CORE1, in wlc_phy_chanspec_radio2057_setup()
20889 write_radio_reg(pi, in wlc_phy_chanspec_radio2057_setup()
20892 write_radio_reg(pi, RADIO_2057_VCOCAL_COUNTVAL1, in wlc_phy_chanspec_radio2057_setup()
20894 write_radio_reg(pi, RADIO_2057_RFPLL_REFMASTER_SPAREXTALSIZE, in wlc_phy_chanspec_radio2057_setup()
20896 write_radio_reg(pi, RADIO_2057_RFPLL_LOOPFILTER_R1, in wlc_phy_chanspec_radio2057_setup()
20898 write_radio_reg(pi, RADIO_2057_RFPLL_LOOPFILTER_C2, in wlc_phy_chanspec_radio2057_setup()
20900 write_radio_reg(pi, RADIO_2057_RFPLL_LOOPFILTER_C1, in wlc_phy_chanspec_radio2057_setup()
20902 write_radio_reg(pi, RADIO_2057_CP_KPD_IDAC, ci->RF_cp_kpd_idac); in wlc_phy_chanspec_radio2057_setup()
20903 write_radio_reg(pi, RADIO_2057_RFPLL_MMD0, ci->RF_rfpll_mmd0); in wlc_phy_chanspec_radio2057_setup()
20904 write_radio_reg(pi, RADIO_2057_RFPLL_MMD1, ci->RF_rfpll_mmd1); in wlc_phy_chanspec_radio2057_setup()
20905 write_radio_reg(pi, RADIO_2057_VCOBUF_TUNE, ci->RF_vcobuf_tune); in wlc_phy_chanspec_radio2057_setup()
20906 write_radio_reg(pi, in wlc_phy_chanspec_radio2057_setup()
20909 write_radio_reg(pi, RADIO_2057_LOGEN_MX5G_TUNE, in wlc_phy_chanspec_radio2057_setup()
20911 write_radio_reg(pi, RADIO_2057_LOGEN_INDBUF2G_TUNE, in wlc_phy_chanspec_radio2057_setup()
20913 write_radio_reg(pi, RADIO_2057_LOGEN_INDBUF5G_TUNE, in wlc_phy_chanspec_radio2057_setup()
20916 write_radio_reg(pi, in wlc_phy_chanspec_radio2057_setup()
20919 write_radio_reg(pi, in wlc_phy_chanspec_radio2057_setup()
20922 write_radio_reg(pi, RADIO_2057_PGA_BOOST_TUNE_CORE0, in wlc_phy_chanspec_radio2057_setup()
20924 write_radio_reg(pi, RADIO_2057_TXMIX5G_BOOST_TUNE_CORE0, in wlc_phy_chanspec_radio2057_setup()
20926 write_radio_reg(pi, RADIO_2057_PAD5G_TUNE_MISC_PUS_CORE0, in wlc_phy_chanspec_radio2057_setup()
20928 write_radio_reg(pi, RADIO_2057_LNA2G_TUNE_CORE0, in wlc_phy_chanspec_radio2057_setup()
20930 write_radio_reg(pi, RADIO_2057_LNA5G_TUNE_CORE0, in wlc_phy_chanspec_radio2057_setup()
20933 write_radio_reg(pi, in wlc_phy_chanspec_radio2057_setup()
20936 write_radio_reg(pi, in wlc_phy_chanspec_radio2057_setup()
20939 write_radio_reg(pi, RADIO_2057_PGA_BOOST_TUNE_CORE1, in wlc_phy_chanspec_radio2057_setup()
20941 write_radio_reg(pi, RADIO_2057_TXMIX5G_BOOST_TUNE_CORE1, in wlc_phy_chanspec_radio2057_setup()
20943 write_radio_reg(pi, RADIO_2057_PAD5G_TUNE_MISC_PUS_CORE1, in wlc_phy_chanspec_radio2057_setup()
20945 write_radio_reg(pi, RADIO_2057_LNA2G_TUNE_CORE1, in wlc_phy_chanspec_radio2057_setup()
20947 write_radio_reg(pi, RADIO_2057_LNA5G_TUNE_CORE1, in wlc_phy_chanspec_radio2057_setup()
20951 if ((pi->pubpi.radiorev <= 4) || (pi->pubpi.radiorev == 6)) { in wlc_phy_chanspec_radio2057_setup()
20953 if (CHSPEC_IS2G(pi->radio_chanspec)) { in wlc_phy_chanspec_radio2057_setup()
20954 write_radio_reg(pi, RADIO_2057_RFPLL_LOOPFILTER_R1, in wlc_phy_chanspec_radio2057_setup()
20956 write_radio_reg(pi, RADIO_2057_CP_KPD_IDAC, 0x3f); in wlc_phy_chanspec_radio2057_setup()
20957 write_radio_reg(pi, RADIO_2057_RFPLL_LOOPFILTER_C1, in wlc_phy_chanspec_radio2057_setup()
20959 write_radio_reg(pi, RADIO_2057_RFPLL_LOOPFILTER_C2, in wlc_phy_chanspec_radio2057_setup()
20962 write_radio_reg(pi, RADIO_2057_RFPLL_LOOPFILTER_R1, in wlc_phy_chanspec_radio2057_setup()
20964 write_radio_reg(pi, RADIO_2057_CP_KPD_IDAC, 0x3f); in wlc_phy_chanspec_radio2057_setup()
20965 write_radio_reg(pi, RADIO_2057_RFPLL_LOOPFILTER_C1, in wlc_phy_chanspec_radio2057_setup()
20967 write_radio_reg(pi, RADIO_2057_RFPLL_LOOPFILTER_C2, in wlc_phy_chanspec_radio2057_setup()
20970 } else if ((pi->pubpi.radiorev == 5) || (pi->pubpi.radiorev == 7) || in wlc_phy_chanspec_radio2057_setup()
20971 (pi->pubpi.radiorev == 8)) { in wlc_phy_chanspec_radio2057_setup()
20973 if (CHSPEC_IS2G(pi->radio_chanspec)) { in wlc_phy_chanspec_radio2057_setup()
20974 write_radio_reg(pi, RADIO_2057_RFPLL_LOOPFILTER_R1, in wlc_phy_chanspec_radio2057_setup()
20976 write_radio_reg(pi, RADIO_2057_CP_KPD_IDAC, 0x30); in wlc_phy_chanspec_radio2057_setup()
20977 write_radio_reg(pi, RADIO_2057_RFPLL_LOOPFILTER_C1, in wlc_phy_chanspec_radio2057_setup()
20979 write_radio_reg(pi, RADIO_2057_RFPLL_LOOPFILTER_C2, in wlc_phy_chanspec_radio2057_setup()
20982 write_radio_reg(pi, RADIO_2057_RFPLL_LOOPFILTER_R1, in wlc_phy_chanspec_radio2057_setup()
20984 write_radio_reg(pi, RADIO_2057_CP_KPD_IDAC, 0x3f); in wlc_phy_chanspec_radio2057_setup()
20985 write_radio_reg(pi, RADIO_2057_RFPLL_LOOPFILTER_C1, in wlc_phy_chanspec_radio2057_setup()
20987 write_radio_reg(pi, RADIO_2057_RFPLL_LOOPFILTER_C2, in wlc_phy_chanspec_radio2057_setup()
20993 if (CHSPEC_IS2G(pi->radio_chanspec)) { in wlc_phy_chanspec_radio2057_setup()
20994 if (PHY_IPA(pi)) { in wlc_phy_chanspec_radio2057_setup()
20995 if (pi->pubpi.radiorev == 3) in wlc_phy_chanspec_radio2057_setup()
20998 if (pi->pubpi.radiorev == 5) in wlc_phy_chanspec_radio2057_setup()
21002 if (pi->pubpi.radiorev != 5) { in wlc_phy_chanspec_radio2057_setup()
21012 WRITE_RADIO_REG4(pi, RADIO_2057, CORE, coreNum, in wlc_phy_chanspec_radio2057_setup()
21017 WRITE_RADIO_REG4(pi, RADIO_2057, CORE, coreNum, in wlc_phy_chanspec_radio2057_setup()
21025 wlc_phy_radio205x_vcocal_nphy(pi); in wlc_phy_chanspec_radio2057_setup()
21029 wlc_phy_chanspec_nphy_setup(struct brcms_phy *pi, u16 chanspec, in wlc_phy_chanspec_nphy_setup() argument
21034 val = read_phy_reg(pi, 0x09) & NPHY_BandControl_currentBand; in wlc_phy_chanspec_nphy_setup()
21037 val = bcma_read16(pi->d11core, D11REGOFFS(psm_phy_hdr_param)); in wlc_phy_chanspec_nphy_setup()
21038 bcma_write16(pi->d11core, D11REGOFFS(psm_phy_hdr_param), in wlc_phy_chanspec_nphy_setup()
21041 or_phy_reg(pi, (NPHY_TO_BPHY_OFF + BPHY_BB_CONFIG), in wlc_phy_chanspec_nphy_setup()
21044 bcma_write16(pi->d11core, D11REGOFFS(psm_phy_hdr_param), val); in wlc_phy_chanspec_nphy_setup()
21046 or_phy_reg(pi, 0x09, NPHY_BandControl_currentBand); in wlc_phy_chanspec_nphy_setup()
21049 and_phy_reg(pi, 0x09, ~NPHY_BandControl_currentBand); in wlc_phy_chanspec_nphy_setup()
21051 val = bcma_read16(pi->d11core, D11REGOFFS(psm_phy_hdr_param)); in wlc_phy_chanspec_nphy_setup()
21052 bcma_write16(pi->d11core, D11REGOFFS(psm_phy_hdr_param), in wlc_phy_chanspec_nphy_setup()
21055 and_phy_reg(pi, (NPHY_TO_BPHY_OFF + BPHY_BB_CONFIG), in wlc_phy_chanspec_nphy_setup()
21058 bcma_write16(pi->d11core, D11REGOFFS(psm_phy_hdr_param), val); in wlc_phy_chanspec_nphy_setup()
21061 write_phy_reg(pi, 0x1ce, ci->PHY_BW1a); in wlc_phy_chanspec_nphy_setup()
21062 write_phy_reg(pi, 0x1cf, ci->PHY_BW2); in wlc_phy_chanspec_nphy_setup()
21063 write_phy_reg(pi, 0x1d0, ci->PHY_BW3); in wlc_phy_chanspec_nphy_setup()
21065 write_phy_reg(pi, 0x1d1, ci->PHY_BW4); in wlc_phy_chanspec_nphy_setup()
21066 write_phy_reg(pi, 0x1d2, ci->PHY_BW5); in wlc_phy_chanspec_nphy_setup()
21067 write_phy_reg(pi, 0x1d3, ci->PHY_BW6); in wlc_phy_chanspec_nphy_setup()
21069 if (CHSPEC_CHANNEL(pi->radio_chanspec) == 14) { in wlc_phy_chanspec_nphy_setup()
21070 wlc_phy_classifier_nphy(pi, NPHY_ClassifierCtrl_ofdm_en, 0); in wlc_phy_chanspec_nphy_setup()
21072 or_phy_reg(pi, NPHY_TO_BPHY_OFF + BPHY_TEST, 0x800); in wlc_phy_chanspec_nphy_setup()
21074 wlc_phy_classifier_nphy(pi, NPHY_ClassifierCtrl_ofdm_en, in wlc_phy_chanspec_nphy_setup()
21078 and_phy_reg(pi, NPHY_TO_BPHY_OFF + BPHY_TEST, ~0x840); in wlc_phy_chanspec_nphy_setup()
21081 if (pi->nphy_txpwrctrl == PHY_TPC_HW_OFF) in wlc_phy_chanspec_nphy_setup()
21082 wlc_phy_txpwr_fixpower_nphy(pi); in wlc_phy_chanspec_nphy_setup()
21084 if (NREV_LT(pi->pubpi.phy_rev, 3)) in wlc_phy_chanspec_nphy_setup()
21085 wlc_phy_adjust_lnagaintbl_nphy(pi); in wlc_phy_chanspec_nphy_setup()
21087 wlc_phy_txlpfbw_nphy(pi); in wlc_phy_chanspec_nphy_setup()
21089 if (NREV_GE(pi->pubpi.phy_rev, 3) in wlc_phy_chanspec_nphy_setup()
21090 && (pi->phy_spuravoid != SPURAVOID_DISABLE)) { in wlc_phy_chanspec_nphy_setup()
21094 if (!CHSPEC_IS40(pi->radio_chanspec)) { in wlc_phy_chanspec_nphy_setup()
21095 if (NREV_GE(pi->pubpi.phy_rev, 7)) { in wlc_phy_chanspec_nphy_setup()
21102 } else if (NREV_GE(pi->pubpi.phy_rev, 7)) { in wlc_phy_chanspec_nphy_setup()
21105 } else if (pi->nphy_aband_spurwar_en && in wlc_phy_chanspec_nphy_setup()
21107 if ((pi->sh->chip == BCMA_CHIP_ID_BCM4716) in wlc_phy_chanspec_nphy_setup()
21108 && (pi->sh->chippkg == BCMA_PKG_ID_BCM4717)) { in wlc_phy_chanspec_nphy_setup()
21115 if (pi->phy_spuravoid == SPURAVOID_FORCEON) in wlc_phy_chanspec_nphy_setup()
21118 if ((pi->sh->chip == BCMA_CHIP_ID_BCM4716) || in wlc_phy_chanspec_nphy_setup()
21119 (pi->sh->chip == BCMA_CHIP_ID_BCM43225)) { in wlc_phy_chanspec_nphy_setup()
21120 bcma_pmu_spuravoid_pllupdate(&pi->d11core->bus->drv_cc, in wlc_phy_chanspec_nphy_setup()
21123 wlapi_bmac_core_phypll_ctl(pi->sh->physhim, false); in wlc_phy_chanspec_nphy_setup()
21124 bcma_pmu_spuravoid_pllupdate(&pi->d11core->bus->drv_cc, in wlc_phy_chanspec_nphy_setup()
21126 wlapi_bmac_core_phypll_ctl(pi->sh->physhim, true); in wlc_phy_chanspec_nphy_setup()
21129 if ((pi->sh->chip == BCMA_CHIP_ID_BCM43224) || in wlc_phy_chanspec_nphy_setup()
21130 (pi->sh->chip == BCMA_CHIP_ID_BCM43225)) { in wlc_phy_chanspec_nphy_setup()
21132 bcma_write16(pi->d11core, in wlc_phy_chanspec_nphy_setup()
21135 bcma_write16(pi->d11core, in wlc_phy_chanspec_nphy_setup()
21138 bcma_write16(pi->d11core, in wlc_phy_chanspec_nphy_setup()
21141 bcma_write16(pi->d11core, in wlc_phy_chanspec_nphy_setup()
21146 if (!((pi->sh->chip == BCMA_CHIP_ID_BCM4716) || in wlc_phy_chanspec_nphy_setup()
21147 (pi->sh->chip == BCMA_CHIP_ID_BCM47162))) in wlc_phy_chanspec_nphy_setup()
21148 wlapi_bmac_core_phypll_reset(pi->sh->physhim); in wlc_phy_chanspec_nphy_setup()
21150 mod_phy_reg(pi, 0x01, (0x1 << 15), in wlc_phy_chanspec_nphy_setup()
21153 wlc_phy_resetcca_nphy(pi); in wlc_phy_chanspec_nphy_setup()
21155 pi->phy_isspuravoid = (spuravoid > 0); in wlc_phy_chanspec_nphy_setup()
21158 if (NREV_LT(pi->pubpi.phy_rev, 7)) in wlc_phy_chanspec_nphy_setup()
21159 write_phy_reg(pi, 0x17e, 0x3830); in wlc_phy_chanspec_nphy_setup()
21161 wlc_phy_spurwar_nphy(pi); in wlc_phy_chanspec_nphy_setup()
21164 void wlc_phy_chanspec_set_nphy(struct brcms_phy *pi, u16 chanspec) in wlc_phy_chanspec_set_nphy() argument
21173 (pi, CHSPEC_CHANNEL(chanspec), &freq, &t0, &t1, &t2, &t3)) in wlc_phy_chanspec_set_nphy()
21176 wlc_phy_chanspec_radio_set((struct brcms_phy_pub *) pi, chanspec); in wlc_phy_chanspec_set_nphy()
21178 if (CHSPEC_BW(chanspec) != pi->bw) in wlc_phy_chanspec_set_nphy()
21179 wlapi_bmac_bw_set(pi->sh->physhim, CHSPEC_BW(chanspec)); in wlc_phy_chanspec_set_nphy()
21183 or_phy_reg(pi, 0xa0, BPHY_BAND_SEL_UP20); in wlc_phy_chanspec_set_nphy()
21184 if (NREV_GE(pi->pubpi.phy_rev, 7)) in wlc_phy_chanspec_set_nphy()
21185 or_phy_reg(pi, 0x310, PRIM_SEL_UP20); in wlc_phy_chanspec_set_nphy()
21187 and_phy_reg(pi, 0xa0, ~BPHY_BAND_SEL_UP20); in wlc_phy_chanspec_set_nphy()
21188 if (NREV_GE(pi->pubpi.phy_rev, 7)) in wlc_phy_chanspec_set_nphy()
21189 and_phy_reg(pi, 0x310, in wlc_phy_chanspec_set_nphy()
21194 if (NREV_GE(pi->pubpi.phy_rev, 3)) { in wlc_phy_chanspec_set_nphy()
21195 if (NREV_GE(pi->pubpi.phy_rev, 7)) { in wlc_phy_chanspec_set_nphy()
21197 if ((pi->pubpi.radiorev <= 4) in wlc_phy_chanspec_set_nphy()
21198 || (pi->pubpi.radiorev == 6)) { in wlc_phy_chanspec_set_nphy()
21199 mod_radio_reg(pi, RADIO_2057_TIA_CONFIG_CORE0, in wlc_phy_chanspec_set_nphy()
21203 mod_radio_reg(pi, RADIO_2057_TIA_CONFIG_CORE1, in wlc_phy_chanspec_set_nphy()
21209 wlc_phy_chanspec_radio2057_setup(pi, t0, t2); in wlc_phy_chanspec_set_nphy()
21210 wlc_phy_chanspec_nphy_setup(pi, chanspec, in wlc_phy_chanspec_set_nphy()
21211 (pi->pubpi.radiorev == 5) ? in wlc_phy_chanspec_set_nphy()
21217 mod_radio_reg(pi, in wlc_phy_chanspec_set_nphy()
21221 wlc_phy_chanspec_radio2056_setup(pi, t1); in wlc_phy_chanspec_set_nphy()
21223 wlc_phy_chanspec_nphy_setup(pi, chanspec, in wlc_phy_chanspec_set_nphy()
21229 mod_radio_reg(pi, RADIO_2055_MASTER_CNTRL1, 0x70, in wlc_phy_chanspec_set_nphy()
21233 wlc_phy_chanspec_radio2055_setup(pi, t3); in wlc_phy_chanspec_set_nphy()
21234 wlc_phy_chanspec_nphy_setup(pi, chanspec, in wlc_phy_chanspec_set_nphy()
21243 struct brcms_phy *pi = container_of(ppi, struct brcms_phy, pubpi_ro); in wlc_phy_antsel_init() local
21247 if (NREV_GE(pi->pubpi.phy_rev, 7)) in wlc_phy_antsel_init()
21250 if (NREV_GE(pi->pubpi.phy_rev, 3)) { in wlc_phy_antsel_init()
21256 if (pi->srom_fem2g.antswctrllut == 0) { in wlc_phy_antsel_init()
21257 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_ANTSWCTRLLUT, in wlc_phy_antsel_init()
21259 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_ANTSWCTRLLUT, in wlc_phy_antsel_init()
21261 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_ANTSWCTRLLUT, in wlc_phy_antsel_init()
21263 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_ANTSWCTRLLUT, in wlc_phy_antsel_init()
21267 if (pi->srom_fem5g.antswctrllut == 0) { in wlc_phy_antsel_init()
21268 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_ANTSWCTRLLUT, in wlc_phy_antsel_init()
21270 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_ANTSWCTRLLUT, in wlc_phy_antsel_init()
21272 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_ANTSWCTRLLUT, in wlc_phy_antsel_init()
21274 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_ANTSWCTRLLUT, in wlc_phy_antsel_init()
21279 write_phy_reg(pi, 0xc8, 0x0); in wlc_phy_antsel_init()
21280 write_phy_reg(pi, 0xc9, 0x0); in wlc_phy_antsel_init()
21282 bcma_chipco_gpio_control(&pi->d11core->bus->drv_cc, mask, mask); in wlc_phy_antsel_init()
21284 mc = bcma_read32(pi->d11core, D11REGOFFS(maccontrol)); in wlc_phy_antsel_init()
21286 bcma_write32(pi->d11core, D11REGOFFS(maccontrol), mc); in wlc_phy_antsel_init()
21288 bcma_set16(pi->d11core, D11REGOFFS(psm_gpio_oe), mask); in wlc_phy_antsel_init()
21290 bcma_mask16(pi->d11core, D11REGOFFS(psm_gpio_out), ~mask); in wlc_phy_antsel_init()
21293 write_phy_reg(pi, 0xf8, 0x02d8); in wlc_phy_antsel_init()
21294 write_phy_reg(pi, 0xf9, 0x0301); in wlc_phy_antsel_init()
21295 write_phy_reg(pi, 0xfa, 0x02d8); in wlc_phy_antsel_init()
21296 write_phy_reg(pi, 0xfb, 0x0301); in wlc_phy_antsel_init()
21301 u16 wlc_phy_classifier_nphy(struct brcms_phy *pi, u16 mask, u16 val) in wlc_phy_classifier_nphy() argument
21306 if (D11REV_IS(pi->sh->corerev, 16)) { in wlc_phy_classifier_nphy()
21307 suspended = (bcma_read32(pi->d11core, D11REGOFFS(maccontrol)) & in wlc_phy_classifier_nphy()
21310 wlapi_suspend_mac_and_wait(pi->sh->physhim); in wlc_phy_classifier_nphy()
21313 curr_ctl = read_phy_reg(pi, 0xb0) & (0x7 << 0); in wlc_phy_classifier_nphy()
21317 mod_phy_reg(pi, 0xb0, (0x7 << 0), new_ctl); in wlc_phy_classifier_nphy()
21319 if (D11REV_IS(pi->sh->corerev, 16) && !suspended) in wlc_phy_classifier_nphy()
21320 wlapi_enable_mac(pi->sh->physhim); in wlc_phy_classifier_nphy()
21325 void wlc_phy_force_rfseq_nphy(struct brcms_phy *pi, u8 cmd) in wlc_phy_force_rfseq_nphy() argument
21359 orig_RfseqCoreActv = read_phy_reg(pi, 0xa1); in wlc_phy_force_rfseq_nphy()
21360 or_phy_reg(pi, 0xa1, in wlc_phy_force_rfseq_nphy()
21363 or_phy_reg(pi, 0xa3, trigger_mask); in wlc_phy_force_rfseq_nphy()
21364 SPINWAIT((read_phy_reg(pi, 0xa4) & status_mask), 200000); in wlc_phy_force_rfseq_nphy()
21365 write_phy_reg(pi, 0xa1, orig_RfseqCoreActv); in wlc_phy_force_rfseq_nphy()
21366 WARN(read_phy_reg(pi, 0xa4) & status_mask, "HW error in rf"); in wlc_phy_force_rfseq_nphy()
21370 wlc_phy_rfctrl_override_1tomany_nphy(struct brcms_phy *pi, u16 cmd, u16 value, in wlc_phy_rfctrl_override_1tomany_nphy() argument
21376 if (NREV_GE(pi->pubpi.phy_rev, 7)) { in wlc_phy_rfctrl_override_1tomany_nphy()
21381 pi, (0x1 << 5), in wlc_phy_rfctrl_override_1tomany_nphy()
21385 pi, (0x1 << 4), value, in wlc_phy_rfctrl_override_1tomany_nphy()
21389 pi, (0x1 << 3), value, in wlc_phy_rfctrl_override_1tomany_nphy()
21395 pi, (0x1 << 2), in wlc_phy_rfctrl_override_1tomany_nphy()
21399 pi, (0x1 << 1), value, in wlc_phy_rfctrl_override_1tomany_nphy()
21403 pi, (0x1 << 0), value, in wlc_phy_rfctrl_override_1tomany_nphy()
21407 pi, (0x1 << 1), value, in wlc_phy_rfctrl_override_1tomany_nphy()
21411 pi, (0x1 << 11), 0, in wlc_phy_rfctrl_override_1tomany_nphy()
21417 pi, (0x1 << 2), in wlc_phy_rfctrl_override_1tomany_nphy()
21421 pi, (0x1 << 1), value, in wlc_phy_rfctrl_override_1tomany_nphy()
21425 pi, (0x1 << 0), value, in wlc_phy_rfctrl_override_1tomany_nphy()
21429 pi, (0x1 << 2), value, in wlc_phy_rfctrl_override_1tomany_nphy()
21433 pi, (0x1 << 11), 1, in wlc_phy_rfctrl_override_1tomany_nphy()
21443 pi, (0x1 << 11), in wlc_phy_rfctrl_override_1tomany_nphy()
21448 pi, (0x3 << 13), in wlc_phy_rfctrl_override_1tomany_nphy()
21459 pi, (0x1 << 12), in wlc_phy_rfctrl_override_1tomany_nphy()
21463 pi, (0x1 << 13), in wlc_phy_rfctrl_override_1tomany_nphy()
21473 wlc_phy_scale_offset_rssi_nphy(struct brcms_phy *pi, u16 scale, s8 offset, in wlc_phy_scale_offset_rssi_nphy() argument
21488 write_phy_reg(pi, 0x1a6, valuetostuff); in wlc_phy_scale_offset_rssi_nphy()
21493 write_phy_reg(pi, 0x1ac, valuetostuff); in wlc_phy_scale_offset_rssi_nphy()
21498 write_phy_reg(pi, 0x1b2, valuetostuff); in wlc_phy_scale_offset_rssi_nphy()
21503 write_phy_reg(pi, 0x1b8, valuetostuff); in wlc_phy_scale_offset_rssi_nphy()
21508 write_phy_reg(pi, 0x1a4, valuetostuff); in wlc_phy_scale_offset_rssi_nphy()
21513 write_phy_reg(pi, 0x1aa, valuetostuff); in wlc_phy_scale_offset_rssi_nphy()
21518 write_phy_reg(pi, 0x1b0, valuetostuff); in wlc_phy_scale_offset_rssi_nphy()
21523 write_phy_reg(pi, 0x1b6, valuetostuff); in wlc_phy_scale_offset_rssi_nphy()
21528 write_phy_reg(pi, 0x1a5, valuetostuff); in wlc_phy_scale_offset_rssi_nphy()
21532 write_phy_reg(pi, 0x1ab, valuetostuff); in wlc_phy_scale_offset_rssi_nphy()
21537 write_phy_reg(pi, 0x1b1, valuetostuff); in wlc_phy_scale_offset_rssi_nphy()
21542 write_phy_reg(pi, 0x1b7, valuetostuff); in wlc_phy_scale_offset_rssi_nphy()
21547 write_phy_reg(pi, 0x1a7, valuetostuff); in wlc_phy_scale_offset_rssi_nphy()
21551 write_phy_reg(pi, 0x1ad, valuetostuff); in wlc_phy_scale_offset_rssi_nphy()
21555 write_phy_reg(pi, 0x1b3, valuetostuff); in wlc_phy_scale_offset_rssi_nphy()
21559 write_phy_reg(pi, 0x1b9, valuetostuff); in wlc_phy_scale_offset_rssi_nphy()
21564 write_phy_reg(pi, 0x1a8, valuetostuff); in wlc_phy_scale_offset_rssi_nphy()
21569 write_phy_reg(pi, 0x1ae, valuetostuff); in wlc_phy_scale_offset_rssi_nphy()
21574 write_phy_reg(pi, 0x1b4, valuetostuff); in wlc_phy_scale_offset_rssi_nphy()
21579 write_phy_reg(pi, 0x1ba, valuetostuff); in wlc_phy_scale_offset_rssi_nphy()
21584 write_phy_reg(pi, 0x1a9, valuetostuff); in wlc_phy_scale_offset_rssi_nphy()
21588 write_phy_reg(pi, 0x1b5, valuetostuff); in wlc_phy_scale_offset_rssi_nphy()
21593 write_phy_reg(pi, 0x1af, valuetostuff); in wlc_phy_scale_offset_rssi_nphy()
21598 write_phy_reg(pi, 0x1bb, valuetostuff); in wlc_phy_scale_offset_rssi_nphy()
21601 static void brcms_phy_wr_tx_mux(struct brcms_phy *pi, u8 core) in brcms_phy_wr_tx_mux() argument
21603 if (PHY_IPA(pi)) { in brcms_phy_wr_tx_mux()
21604 if (NREV_GE(pi->pubpi.phy_rev, 7)) in brcms_phy_wr_tx_mux()
21605 write_radio_reg(pi, in brcms_phy_wr_tx_mux()
21609 (CHSPEC_IS5G(pi->radio_chanspec) ? in brcms_phy_wr_tx_mux()
21612 write_radio_reg(pi, in brcms_phy_wr_tx_mux()
21616 (CHSPEC_IS5G(pi->radio_chanspec) ? in brcms_phy_wr_tx_mux()
21619 if (NREV_GE(pi->pubpi.phy_rev, 7)) { in brcms_phy_wr_tx_mux()
21620 write_radio_reg(pi, in brcms_phy_wr_tx_mux()
21626 if (pi->pubpi.radioid == BCM2057_ID) in brcms_phy_wr_tx_mux()
21627 write_radio_reg(pi, in brcms_phy_wr_tx_mux()
21631 write_radio_reg(pi, in brcms_phy_wr_tx_mux()
21640 void wlc_phy_rssisel_nphy(struct brcms_phy *pi, u8 core_code, u8 rssi_type) in wlc_phy_rssisel_nphy() argument
21651 if (NREV_GE(pi->pubpi.phy_rev, 3)) { in wlc_phy_rssisel_nphy()
21653 mod_phy_reg(pi, 0x8f, (0x1 << 9), 0); in wlc_phy_rssisel_nphy()
21654 mod_phy_reg(pi, 0xa5, (0x1 << 9), 0); in wlc_phy_rssisel_nphy()
21656 mod_phy_reg(pi, 0xa6, (0x3 << 8), 0); in wlc_phy_rssisel_nphy()
21657 mod_phy_reg(pi, 0xa7, (0x3 << 8), 0); in wlc_phy_rssisel_nphy()
21659 mod_phy_reg(pi, 0xe5, (0x1 << 5), 0); in wlc_phy_rssisel_nphy()
21660 mod_phy_reg(pi, 0xe6, (0x1 << 5), 0); in wlc_phy_rssisel_nphy()
21664 mod_phy_reg(pi, 0xf9, mask, 0); in wlc_phy_rssisel_nphy()
21665 mod_phy_reg(pi, 0xfb, mask, 0); in wlc_phy_rssisel_nphy()
21668 for (core = 0; core < pi->pubpi.phy_corenum; core++) { in wlc_phy_rssisel_nphy()
21676 mod_phy_reg(pi, (core == PHY_CORE_0) ? in wlc_phy_rssisel_nphy()
21682 mod_phy_reg(pi, in wlc_phy_rssisel_nphy()
21690 mod_phy_reg(pi, in wlc_phy_rssisel_nphy()
21697 pi->radio_chanspec)) { in wlc_phy_rssisel_nphy()
21712 mod_phy_reg(pi, in wlc_phy_rssisel_nphy()
21719 mod_phy_reg(pi, (core == PHY_CORE_0) ? in wlc_phy_rssisel_nphy()
21725 mod_phy_reg(pi, in wlc_phy_rssisel_nphy()
21731 mod_phy_reg(pi, in wlc_phy_rssisel_nphy()
21739 mod_phy_reg(pi, in wlc_phy_rssisel_nphy()
21745 mod_phy_reg(pi, in wlc_phy_rssisel_nphy()
21752 mod_phy_reg(pi, in wlc_phy_rssisel_nphy()
21758 mod_phy_reg(pi, in wlc_phy_rssisel_nphy()
21762 brcms_phy_wr_tx_mux(pi, core); in wlc_phy_rssisel_nphy()
21764 mod_phy_reg(pi, in wlc_phy_rssisel_nphy()
21788 mod_phy_reg(pi, 0xa6, mask, val); in wlc_phy_rssisel_nphy()
21789 mod_phy_reg(pi, 0xa7, mask, val); in wlc_phy_rssisel_nphy()
21803 mod_phy_reg(pi, 0x7a, mask, val); in wlc_phy_rssisel_nphy()
21804 mod_phy_reg(pi, 0x7d, mask, val); in wlc_phy_rssisel_nphy()
21830 mod_phy_reg(pi, 0xa5, afectrlovr_rssi_mask, in wlc_phy_rssisel_nphy()
21849 mod_phy_reg(pi, 0x78, rfctrlcmd_mask, rfctrlcmd_val); in wlc_phy_rssisel_nphy()
21850 mod_phy_reg(pi, 0xec, rfctrlovr_mask, rfctrlovr_val); in wlc_phy_rssisel_nphy()
21852 mod_phy_reg(pi, 0x78, (0x1 << 0), (startseq << 0)); in wlc_phy_rssisel_nphy()
21855 mod_phy_reg(pi, 0xec, (0x1 << 0), 0); in wlc_phy_rssisel_nphy()
21861 wlc_phy_poll_rssi_nphy(struct brcms_phy *pi, u8 rssi_type, s32 *rssi_buf, in wlc_phy_poll_rssi_nphy() argument
21882 afectrlCore1_save = read_phy_reg(pi, 0xa6); in wlc_phy_poll_rssi_nphy()
21883 afectrlCore2_save = read_phy_reg(pi, 0xa7); in wlc_phy_poll_rssi_nphy()
21884 if (NREV_GE(pi->pubpi.phy_rev, 3)) { in wlc_phy_poll_rssi_nphy()
21885 rfctrlMiscReg1_save = read_phy_reg(pi, 0xf9); in wlc_phy_poll_rssi_nphy()
21886 rfctrlMiscReg2_save = read_phy_reg(pi, 0xfb); in wlc_phy_poll_rssi_nphy()
21887 afectrlOverride1_save = read_phy_reg(pi, 0x8f); in wlc_phy_poll_rssi_nphy()
21888 afectrlOverride2_save = read_phy_reg(pi, 0xa5); in wlc_phy_poll_rssi_nphy()
21889 rfctrlOverrideAux0_save = read_phy_reg(pi, 0xe5); in wlc_phy_poll_rssi_nphy()
21890 rfctrlOverrideAux1_save = read_phy_reg(pi, 0xe6); in wlc_phy_poll_rssi_nphy()
21892 afectrlOverride1_save = read_phy_reg(pi, 0xa5); in wlc_phy_poll_rssi_nphy()
21893 rfctrlcmd_save = read_phy_reg(pi, 0x78); in wlc_phy_poll_rssi_nphy()
21894 rfctrloverride_save = read_phy_reg(pi, 0xec); in wlc_phy_poll_rssi_nphy()
21895 rfctrlrssiothers1_save = read_phy_reg(pi, 0x7a); in wlc_phy_poll_rssi_nphy()
21896 rfctrlrssiothers2_save = read_phy_reg(pi, 0x7d); in wlc_phy_poll_rssi_nphy()
21899 wlc_phy_rssisel_nphy(pi, RADIO_MIMO_CORESEL_ALLRX, rssi_type); in wlc_phy_poll_rssi_nphy()
21901 gpiosel_orig = read_phy_reg(pi, 0xca); in wlc_phy_poll_rssi_nphy()
21902 if (NREV_LT(pi->pubpi.phy_rev, 2)) in wlc_phy_poll_rssi_nphy()
21903 write_phy_reg(pi, 0xca, 5); in wlc_phy_poll_rssi_nphy()
21909 if (NREV_LT(pi->pubpi.phy_rev, 2)) { in wlc_phy_poll_rssi_nphy()
21910 rssi0 = read_phy_reg(pi, 0x1c9); in wlc_phy_poll_rssi_nphy()
21911 rssi1 = read_phy_reg(pi, 0x1ca); in wlc_phy_poll_rssi_nphy()
21913 rssi0 = read_phy_reg(pi, 0x219); in wlc_phy_poll_rssi_nphy()
21914 rssi1 = read_phy_reg(pi, 0x21a); in wlc_phy_poll_rssi_nphy()
21933 if (NREV_LT(pi->pubpi.phy_rev, 2)) in wlc_phy_poll_rssi_nphy()
21934 write_phy_reg(pi, 0xca, gpiosel_orig); in wlc_phy_poll_rssi_nphy()
21936 write_phy_reg(pi, 0xa6, afectrlCore1_save); in wlc_phy_poll_rssi_nphy()
21937 write_phy_reg(pi, 0xa7, afectrlCore2_save); in wlc_phy_poll_rssi_nphy()
21938 if (NREV_GE(pi->pubpi.phy_rev, 3)) { in wlc_phy_poll_rssi_nphy()
21939 write_phy_reg(pi, 0xf9, rfctrlMiscReg1_save); in wlc_phy_poll_rssi_nphy()
21940 write_phy_reg(pi, 0xfb, rfctrlMiscReg2_save); in wlc_phy_poll_rssi_nphy()
21941 write_phy_reg(pi, 0x8f, afectrlOverride1_save); in wlc_phy_poll_rssi_nphy()
21942 write_phy_reg(pi, 0xa5, afectrlOverride2_save); in wlc_phy_poll_rssi_nphy()
21943 write_phy_reg(pi, 0xe5, rfctrlOverrideAux0_save); in wlc_phy_poll_rssi_nphy()
21944 write_phy_reg(pi, 0xe6, rfctrlOverrideAux1_save); in wlc_phy_poll_rssi_nphy()
21946 write_phy_reg(pi, 0xa5, afectrlOverride1_save); in wlc_phy_poll_rssi_nphy()
21947 write_phy_reg(pi, 0x78, rfctrlcmd_save); in wlc_phy_poll_rssi_nphy()
21948 write_phy_reg(pi, 0xec, rfctrloverride_save); in wlc_phy_poll_rssi_nphy()
21949 write_phy_reg(pi, 0x7a, rfctrlrssiothers1_save); in wlc_phy_poll_rssi_nphy()
21950 write_phy_reg(pi, 0x7d, rfctrlrssiothers2_save); in wlc_phy_poll_rssi_nphy()
21956 s16 wlc_phy_tempsense_nphy(struct brcms_phy *pi) in wlc_phy_tempsense_nphy() argument
21973 if (NREV_GE(pi->pubpi.phy_rev, 7)) { in wlc_phy_tempsense_nphy()
21984 read_radio_reg(pi, RADIO_2057_TEMPSENSE_CONFIG); in wlc_phy_tempsense_nphy()
21986 afectrlCore1_save = read_phy_reg(pi, 0xa6); in wlc_phy_tempsense_nphy()
21987 afectrlCore2_save = read_phy_reg(pi, 0xa7); in wlc_phy_tempsense_nphy()
21988 afectrlOverride_save = read_phy_reg(pi, 0x8f); in wlc_phy_tempsense_nphy()
21989 afectrlOverride2_save = read_phy_reg(pi, 0xa5); in wlc_phy_tempsense_nphy()
21990 RSSIMultCoef0QPowerDet_save = read_phy_reg(pi, 0x1ae); in wlc_phy_tempsense_nphy()
21991 RfctrlOverride5_save = read_phy_reg(pi, 0x346); in wlc_phy_tempsense_nphy()
21992 RfctrlOverride6_save = read_phy_reg(pi, 0x347); in wlc_phy_tempsense_nphy()
21993 RfctrlMiscReg5_save = read_phy_reg(pi, 0x344); in wlc_phy_tempsense_nphy()
21994 read_phy_reg(pi, 0x345); /* RfctrlMiscReg6_save */ in wlc_phy_tempsense_nphy()
21996 wlc_phy_table_read_nphy(pi, NPHY_TBL_ID_AFECTRL, 1, 0x0A, 16, in wlc_phy_tempsense_nphy()
21998 wlc_phy_table_read_nphy(pi, NPHY_TBL_ID_AFECTRL, 1, 0x0E, 16, in wlc_phy_tempsense_nphy()
22000 wlc_phy_table_read_nphy(pi, NPHY_TBL_ID_AFECTRL, 1, 0x02, 16, in wlc_phy_tempsense_nphy()
22002 wlc_phy_table_read_nphy(pi, NPHY_TBL_ID_AFECTRL, 1, 0x03, 16, in wlc_phy_tempsense_nphy()
22005 write_phy_reg(pi, 0x1ae, 0x0); in wlc_phy_tempsense_nphy()
22009 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 1, 0x02, 16, in wlc_phy_tempsense_nphy()
22011 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 1, 0x03, 16, in wlc_phy_tempsense_nphy()
22016 write_radio_reg(pi, RADIO_2057_TEMPSENSE_CONFIG, in wlc_phy_tempsense_nphy()
22019 wlc_phy_rfctrl_override_nphy_rev7(pi, (0x1 << 1), in wlc_phy_tempsense_nphy()
22022 mod_phy_reg(pi, 0xa6, (0x1 << 7), 0); in wlc_phy_tempsense_nphy()
22023 mod_phy_reg(pi, 0xa7, (0x1 << 7), 0); in wlc_phy_tempsense_nphy()
22024 mod_phy_reg(pi, 0x8f, (0x1 << 7), (0x1 << 7)); in wlc_phy_tempsense_nphy()
22025 mod_phy_reg(pi, 0xa5, (0x1 << 7), (0x1 << 7)); in wlc_phy_tempsense_nphy()
22027 mod_phy_reg(pi, 0xa6, (0x1 << 2), (0x1 << 2)); in wlc_phy_tempsense_nphy()
22028 mod_phy_reg(pi, 0xa7, (0x1 << 2), (0x1 << 2)); in wlc_phy_tempsense_nphy()
22029 mod_phy_reg(pi, 0x8f, (0x1 << 2), (0x1 << 2)); in wlc_phy_tempsense_nphy()
22030 mod_phy_reg(pi, 0xa5, (0x1 << 2), (0x1 << 2)); in wlc_phy_tempsense_nphy()
22032 mod_phy_reg(pi, 0xa6, (0x1 << 2), 0); in wlc_phy_tempsense_nphy()
22033 mod_phy_reg(pi, 0xa7, (0x1 << 2), 0); in wlc_phy_tempsense_nphy()
22034 mod_phy_reg(pi, 0xa6, (0x1 << 3), 0); in wlc_phy_tempsense_nphy()
22035 mod_phy_reg(pi, 0xa7, (0x1 << 3), 0); in wlc_phy_tempsense_nphy()
22036 mod_phy_reg(pi, 0x8f, (0x1 << 3), (0x1 << 3)); in wlc_phy_tempsense_nphy()
22037 mod_phy_reg(pi, 0xa5, (0x1 << 3), (0x1 << 3)); in wlc_phy_tempsense_nphy()
22038 mod_phy_reg(pi, 0xa6, (0x1 << 6), 0); in wlc_phy_tempsense_nphy()
22039 mod_phy_reg(pi, 0xa7, (0x1 << 6), 0); in wlc_phy_tempsense_nphy()
22040 mod_phy_reg(pi, 0x8f, (0x1 << 6), (0x1 << 6)); in wlc_phy_tempsense_nphy()
22041 mod_phy_reg(pi, 0xa5, (0x1 << 6), (0x1 << 6)); in wlc_phy_tempsense_nphy()
22045 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 1, 0x0A, 16, in wlc_phy_tempsense_nphy()
22047 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 1, 0x0E, 16, in wlc_phy_tempsense_nphy()
22052 wlc_phy_poll_rssi_nphy(pi, NPHY_RSSI_SEL_IQ, radio_temp, 1); in wlc_phy_tempsense_nphy()
22053 write_radio_reg(pi, RADIO_2057_TEMPSENSE_CONFIG, in wlc_phy_tempsense_nphy()
22057 wlc_phy_poll_rssi_nphy(pi, NPHY_RSSI_SEL_IQ, radio_temp2, 1); in wlc_phy_tempsense_nphy()
22074 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 1, 0x0A, 16, in wlc_phy_tempsense_nphy()
22076 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 1, 0x0E, 16, in wlc_phy_tempsense_nphy()
22081 wlc_phy_poll_rssi_nphy(pi, NPHY_RSSI_SEL_IQ, radio_temp2, 1); in wlc_phy_tempsense_nphy()
22082 write_radio_reg(pi, RADIO_2057_TEMPSENSE_CONFIG, in wlc_phy_tempsense_nphy()
22086 wlc_phy_poll_rssi_nphy(pi, NPHY_RSSI_SEL_IQ, radio_temp, 1); in wlc_phy_tempsense_nphy()
22088 write_radio_reg(pi, RADIO_2057_TEMPSENSE_CONFIG, in wlc_phy_tempsense_nphy()
22091 write_phy_reg(pi, 0xa6, afectrlCore1_save); in wlc_phy_tempsense_nphy()
22092 write_phy_reg(pi, 0xa7, afectrlCore2_save); in wlc_phy_tempsense_nphy()
22093 write_phy_reg(pi, 0x8f, afectrlOverride_save); in wlc_phy_tempsense_nphy()
22094 write_phy_reg(pi, 0xa5, afectrlOverride2_save); in wlc_phy_tempsense_nphy()
22095 write_phy_reg(pi, 0x1ae, RSSIMultCoef0QPowerDet_save); in wlc_phy_tempsense_nphy()
22096 write_phy_reg(pi, 0x346, RfctrlOverride5_save); in wlc_phy_tempsense_nphy()
22097 write_phy_reg(pi, 0x347, RfctrlOverride6_save); in wlc_phy_tempsense_nphy()
22098 write_phy_reg(pi, 0x344, RfctrlMiscReg5_save); in wlc_phy_tempsense_nphy()
22099 write_phy_reg(pi, 0x345, RfctrlMiscReg5_save); in wlc_phy_tempsense_nphy()
22101 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 1, 0x0A, 16, in wlc_phy_tempsense_nphy()
22103 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 1, 0x0E, 16, in wlc_phy_tempsense_nphy()
22105 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 1, 0x02, 16, in wlc_phy_tempsense_nphy()
22107 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 1, 0x03, 16, in wlc_phy_tempsense_nphy()
22110 if (pi->sh->chip == BCMA_CHIP_ID_BCM5357) { in wlc_phy_tempsense_nphy()
22120 offset = (s16) pi->phy_tempsense_offset; in wlc_phy_tempsense_nphy()
22122 } else if (NREV_GE(pi->pubpi.phy_rev, 3)) { in wlc_phy_tempsense_nphy()
22124 read_radio_reg(pi, RADIO_2056_SYN_TEMPPROCSENSE); in wlc_phy_tempsense_nphy()
22126 afectrlCore1_save = read_phy_reg(pi, 0xa6); in wlc_phy_tempsense_nphy()
22127 afectrlCore2_save = read_phy_reg(pi, 0xa7); in wlc_phy_tempsense_nphy()
22128 afectrlOverride_save = read_phy_reg(pi, 0x8f); in wlc_phy_tempsense_nphy()
22129 afectrlOverride2_save = read_phy_reg(pi, 0xa5); in wlc_phy_tempsense_nphy()
22130 gpioSel_save = read_phy_reg(pi, 0xca); in wlc_phy_tempsense_nphy()
22132 write_radio_reg(pi, RADIO_2056_SYN_TEMPPROCSENSE, 0x01); in wlc_phy_tempsense_nphy()
22134 wlc_phy_poll_rssi_nphy(pi, NPHY_RSSI_SEL_IQ, radio_temp, 1); in wlc_phy_tempsense_nphy()
22135 if (NREV_LT(pi->pubpi.phy_rev, 7)) in wlc_phy_tempsense_nphy()
22136 write_radio_reg(pi, RADIO_2056_SYN_TEMPPROCSENSE, 0x05); in wlc_phy_tempsense_nphy()
22138 wlc_phy_poll_rssi_nphy(pi, NPHY_RSSI_SEL_IQ, radio_temp2, 1); in wlc_phy_tempsense_nphy()
22139 if (NREV_GE(pi->pubpi.phy_rev, 7)) in wlc_phy_tempsense_nphy()
22140 write_radio_reg(pi, RADIO_2057_TEMPSENSE_CONFIG, 0x01); in wlc_phy_tempsense_nphy()
22142 write_radio_reg(pi, RADIO_2056_SYN_TEMPPROCSENSE, 0x01); in wlc_phy_tempsense_nphy()
22147 write_radio_reg(pi, RADIO_2056_SYN_TEMPPROCSENSE, in wlc_phy_tempsense_nphy()
22150 write_phy_reg(pi, 0xca, gpioSel_save); in wlc_phy_tempsense_nphy()
22151 write_phy_reg(pi, 0xa6, afectrlCore1_save); in wlc_phy_tempsense_nphy()
22152 write_phy_reg(pi, 0xa7, afectrlCore2_save); in wlc_phy_tempsense_nphy()
22153 write_phy_reg(pi, 0x8f, afectrlOverride_save); in wlc_phy_tempsense_nphy()
22154 write_phy_reg(pi, 0xa5, afectrlOverride2_save); in wlc_phy_tempsense_nphy()
22156 offset = (s16) pi->phy_tempsense_offset; in wlc_phy_tempsense_nphy()
22160 read_radio_reg(pi, RADIO_2055_PWRDET_RXTX_CORE1); in wlc_phy_tempsense_nphy()
22162 read_radio_reg(pi, RADIO_2055_PWRDET_RXTX_CORE2); in wlc_phy_tempsense_nphy()
22164 read_radio_reg(pi, RADIO_2055_CORE1_TXRF_IQCAL1); in wlc_phy_tempsense_nphy()
22166 read_radio_reg(pi, RADIO_2055_CORE1_TXRF_IQCAL2); in wlc_phy_tempsense_nphy()
22168 read_radio_reg(pi, RADIO_2055_CORE2_TXRF_IQCAL1); in wlc_phy_tempsense_nphy()
22170 read_radio_reg(pi, RADIO_2055_CORE2_TXRF_IQCAL2); in wlc_phy_tempsense_nphy()
22171 pd_pll_ts_save = read_radio_reg(pi, RADIO_2055_PD_PLL_TS); in wlc_phy_tempsense_nphy()
22173 afectrlCore1_save = read_phy_reg(pi, 0xa6); in wlc_phy_tempsense_nphy()
22174 afectrlCore2_save = read_phy_reg(pi, 0xa7); in wlc_phy_tempsense_nphy()
22175 afectrlOverride_save = read_phy_reg(pi, 0xa5); in wlc_phy_tempsense_nphy()
22176 gpioSel_save = read_phy_reg(pi, 0xca); in wlc_phy_tempsense_nphy()
22178 write_radio_reg(pi, RADIO_2055_CORE1_TXRF_IQCAL1, 0x01); in wlc_phy_tempsense_nphy()
22179 write_radio_reg(pi, RADIO_2055_CORE2_TXRF_IQCAL1, 0x01); in wlc_phy_tempsense_nphy()
22180 write_radio_reg(pi, RADIO_2055_CORE1_TXRF_IQCAL2, 0x08); in wlc_phy_tempsense_nphy()
22181 write_radio_reg(pi, RADIO_2055_CORE2_TXRF_IQCAL2, 0x08); in wlc_phy_tempsense_nphy()
22182 write_radio_reg(pi, RADIO_2055_PWRDET_RXTX_CORE1, 0x04); in wlc_phy_tempsense_nphy()
22183 write_radio_reg(pi, RADIO_2055_PWRDET_RXTX_CORE2, 0x04); in wlc_phy_tempsense_nphy()
22184 write_radio_reg(pi, RADIO_2055_PD_PLL_TS, 0x00); in wlc_phy_tempsense_nphy()
22186 wlc_phy_poll_rssi_nphy(pi, NPHY_RSSI_SEL_IQ, radio_temp, 1); in wlc_phy_tempsense_nphy()
22187 xor_radio_reg(pi, RADIO_2055_CAL_TS, 0x80); in wlc_phy_tempsense_nphy()
22189 wlc_phy_poll_rssi_nphy(pi, NPHY_RSSI_SEL_IQ, radio_temp, 1); in wlc_phy_tempsense_nphy()
22190 xor_radio_reg(pi, RADIO_2055_CAL_TS, 0x80); in wlc_phy_tempsense_nphy()
22192 wlc_phy_poll_rssi_nphy(pi, NPHY_RSSI_SEL_IQ, radio_temp2, 1); in wlc_phy_tempsense_nphy()
22193 xor_radio_reg(pi, RADIO_2055_CAL_TS, 0x80); in wlc_phy_tempsense_nphy()
22210 write_radio_reg(pi, RADIO_2055_PWRDET_RXTX_CORE1, in wlc_phy_tempsense_nphy()
22212 write_radio_reg(pi, RADIO_2055_PWRDET_RXTX_CORE2, in wlc_phy_tempsense_nphy()
22214 write_radio_reg(pi, RADIO_2055_CORE1_TXRF_IQCAL1, in wlc_phy_tempsense_nphy()
22216 write_radio_reg(pi, RADIO_2055_CORE2_TXRF_IQCAL1, in wlc_phy_tempsense_nphy()
22218 write_radio_reg(pi, RADIO_2055_CORE1_TXRF_IQCAL2, in wlc_phy_tempsense_nphy()
22220 write_radio_reg(pi, RADIO_2055_CORE2_TXRF_IQCAL2, in wlc_phy_tempsense_nphy()
22222 write_radio_reg(pi, RADIO_2055_PD_PLL_TS, pd_pll_ts_save); in wlc_phy_tempsense_nphy()
22224 write_phy_reg(pi, 0xca, gpioSel_save); in wlc_phy_tempsense_nphy()
22225 write_phy_reg(pi, 0xa6, afectrlCore1_save); in wlc_phy_tempsense_nphy()
22226 write_phy_reg(pi, 0xa7, afectrlCore2_save); in wlc_phy_tempsense_nphy()
22227 write_phy_reg(pi, 0xa5, afectrlOverride_save); in wlc_phy_tempsense_nphy()
22234 wlc_phy_set_rssi_2055_vcm(struct brcms_phy *pi, u8 rssi_type, u8 *vcm_buf) in wlc_phy_set_rssi_2055_vcm() argument
22238 for (core = 0; core < pi->pubpi.phy_corenum; core++) { in wlc_phy_set_rssi_2055_vcm()
22241 mod_radio_reg(pi, in wlc_phy_set_rssi_2055_vcm()
22247 mod_radio_reg(pi, in wlc_phy_set_rssi_2055_vcm()
22254 mod_radio_reg(pi, in wlc_phy_set_rssi_2055_vcm()
22260 mod_radio_reg(pi, in wlc_phy_set_rssi_2055_vcm()
22269 mod_radio_reg(pi, in wlc_phy_set_rssi_2055_vcm()
22276 mod_radio_reg(pi, in wlc_phy_set_rssi_2055_vcm()
22286 static void wlc_phy_rssi_cal_nphy_rev3(struct brcms_phy *pi) in wlc_phy_rssi_cal_nphy_rev3() argument
22337 classif_state = wlc_phy_classifier_nphy(pi, 0, 0); in wlc_phy_rssi_cal_nphy_rev3()
22338 wlc_phy_classifier_nphy(pi, (0x7 << 0), 4); in wlc_phy_rssi_cal_nphy_rev3()
22339 wlc_phy_clip_det_nphy(pi, 0, clip_state); in wlc_phy_rssi_cal_nphy_rev3()
22340 wlc_phy_clip_det_nphy(pi, 1, clip_off); in wlc_phy_rssi_cal_nphy_rev3()
22342 NPHY_Rfctrlintc1_save = read_phy_reg(pi, 0x91); in wlc_phy_rssi_cal_nphy_rev3()
22343 NPHY_Rfctrlintc2_save = read_phy_reg(pi, 0x92); in wlc_phy_rssi_cal_nphy_rev3()
22344 NPHY_AfectrlOverride1_save = read_phy_reg(pi, 0x8f); in wlc_phy_rssi_cal_nphy_rev3()
22345 NPHY_AfectrlOverride2_save = read_phy_reg(pi, 0xa5); in wlc_phy_rssi_cal_nphy_rev3()
22346 NPHY_AfectrlCore1_save = read_phy_reg(pi, 0xa6); in wlc_phy_rssi_cal_nphy_rev3()
22347 NPHY_AfectrlCore2_save = read_phy_reg(pi, 0xa7); in wlc_phy_rssi_cal_nphy_rev3()
22348 NPHY_RfctrlOverride0_save = read_phy_reg(pi, 0xe7); in wlc_phy_rssi_cal_nphy_rev3()
22349 NPHY_RfctrlOverride1_save = read_phy_reg(pi, 0xec); in wlc_phy_rssi_cal_nphy_rev3()
22350 if (NREV_GE(pi->pubpi.phy_rev, 7)) { in wlc_phy_rssi_cal_nphy_rev3()
22351 NPHY_REV7_RfctrlOverride3_save = read_phy_reg(pi, 0x342); in wlc_phy_rssi_cal_nphy_rev3()
22352 NPHY_REV7_RfctrlOverride4_save = read_phy_reg(pi, 0x343); in wlc_phy_rssi_cal_nphy_rev3()
22353 NPHY_REV7_RfctrlOverride5_save = read_phy_reg(pi, 0x346); in wlc_phy_rssi_cal_nphy_rev3()
22354 NPHY_REV7_RfctrlOverride6_save = read_phy_reg(pi, 0x347); in wlc_phy_rssi_cal_nphy_rev3()
22356 NPHY_RfctrlOverrideAux0_save = read_phy_reg(pi, 0xe5); in wlc_phy_rssi_cal_nphy_rev3()
22357 NPHY_RfctrlOverrideAux1_save = read_phy_reg(pi, 0xe6); in wlc_phy_rssi_cal_nphy_rev3()
22358 NPHY_RfctrlCmd_save = read_phy_reg(pi, 0x78); in wlc_phy_rssi_cal_nphy_rev3()
22359 NPHY_RfctrlMiscReg1_save = read_phy_reg(pi, 0xf9); in wlc_phy_rssi_cal_nphy_rev3()
22360 NPHY_RfctrlMiscReg2_save = read_phy_reg(pi, 0xfb); in wlc_phy_rssi_cal_nphy_rev3()
22361 if (NREV_GE(pi->pubpi.phy_rev, 7)) { in wlc_phy_rssi_cal_nphy_rev3()
22362 NPHY_REV7_RfctrlMiscReg3_save = read_phy_reg(pi, 0x340); in wlc_phy_rssi_cal_nphy_rev3()
22363 NPHY_REV7_RfctrlMiscReg4_save = read_phy_reg(pi, 0x341); in wlc_phy_rssi_cal_nphy_rev3()
22364 NPHY_REV7_RfctrlMiscReg5_save = read_phy_reg(pi, 0x344); in wlc_phy_rssi_cal_nphy_rev3()
22365 NPHY_REV7_RfctrlMiscReg6_save = read_phy_reg(pi, 0x345); in wlc_phy_rssi_cal_nphy_rev3()
22367 NPHY_RfctrlRSSIOTHERS1_save = read_phy_reg(pi, 0x7a); in wlc_phy_rssi_cal_nphy_rev3()
22368 NPHY_RfctrlRSSIOTHERS2_save = read_phy_reg(pi, 0x7d); in wlc_phy_rssi_cal_nphy_rev3()
22370 wlc_phy_rfctrlintc_override_nphy(pi, NPHY_RfctrlIntc_override_OFF, 0, in wlc_phy_rssi_cal_nphy_rev3()
22372 wlc_phy_rfctrlintc_override_nphy(pi, NPHY_RfctrlIntc_override_TRSW, 1, in wlc_phy_rssi_cal_nphy_rev3()
22375 if (NREV_GE(pi->pubpi.phy_rev, 7)) in wlc_phy_rssi_cal_nphy_rev3()
22377 pi, in wlc_phy_rssi_cal_nphy_rev3()
22381 wlc_phy_rfctrl_override_nphy(pi, (0x1 << 0), 0, 0, 0); in wlc_phy_rssi_cal_nphy_rev3()
22383 if (NREV_GE(pi->pubpi.phy_rev, 7)) in wlc_phy_rssi_cal_nphy_rev3()
22385 pi, in wlc_phy_rssi_cal_nphy_rev3()
22389 wlc_phy_rfctrl_override_nphy(pi, (0x1 << 1), 1, 0, 0); in wlc_phy_rssi_cal_nphy_rev3()
22391 if (NREV_GE(pi->pubpi.phy_rev, 7)) { in wlc_phy_rssi_cal_nphy_rev3()
22392 wlc_phy_rfctrl_override_nphy_rev7(pi, (0x1 << 7), in wlc_phy_rssi_cal_nphy_rev3()
22395 wlc_phy_rfctrl_override_nphy_rev7(pi, (0x1 << 6), 1, 0, 0, in wlc_phy_rssi_cal_nphy_rev3()
22398 wlc_phy_rfctrl_override_nphy(pi, (0x1 << 7), 1, 0, 0); in wlc_phy_rssi_cal_nphy_rev3()
22399 wlc_phy_rfctrl_override_nphy(pi, (0x1 << 6), 1, 0, 0); in wlc_phy_rssi_cal_nphy_rev3()
22402 if (CHSPEC_IS5G(pi->radio_chanspec)) { in wlc_phy_rssi_cal_nphy_rev3()
22403 if (NREV_GE(pi->pubpi.phy_rev, 7)) { in wlc_phy_rssi_cal_nphy_rev3()
22405 pi, (0x1 << 5), in wlc_phy_rssi_cal_nphy_rev3()
22409 pi, (0x1 << 4), 1, 0, in wlc_phy_rssi_cal_nphy_rev3()
22413 wlc_phy_rfctrl_override_nphy(pi, (0x1 << 5), 0, 0, 0); in wlc_phy_rssi_cal_nphy_rev3()
22414 wlc_phy_rfctrl_override_nphy(pi, (0x1 << 4), 1, 0, 0); in wlc_phy_rssi_cal_nphy_rev3()
22418 if (NREV_GE(pi->pubpi.phy_rev, 7)) { in wlc_phy_rssi_cal_nphy_rev3()
22420 pi, (0x1 << 4), in wlc_phy_rssi_cal_nphy_rev3()
22424 pi, (0x1 << 5), 1, 0, in wlc_phy_rssi_cal_nphy_rev3()
22428 wlc_phy_rfctrl_override_nphy(pi, (0x1 << 4), 0, 0, 0); in wlc_phy_rssi_cal_nphy_rev3()
22429 wlc_phy_rfctrl_override_nphy(pi, (0x1 << 5), 1, 0, 0); in wlc_phy_rssi_cal_nphy_rev3()
22434 (struct brcms_phy_pub *) pi); in wlc_phy_rssi_cal_nphy_rev3()
22438 for (core = 0; core < pi->pubpi.phy_corenum; core++) { in wlc_phy_rssi_cal_nphy_rev3()
22443 wlc_phy_scale_offset_rssi_nphy(pi, 0x0, 0x0, in wlc_phy_rssi_cal_nphy_rev3()
22449 wlc_phy_scale_offset_rssi_nphy(pi, 0x0, 0x0, in wlc_phy_rssi_cal_nphy_rev3()
22457 if (NREV_GE(pi->pubpi.phy_rev, 7)) in wlc_phy_rssi_cal_nphy_rev3()
22458 mod_radio_reg(pi, (core == PHY_CORE_0) ? in wlc_phy_rssi_cal_nphy_rev3()
22463 mod_radio_reg(pi, RADIO_2056_RX_RSSI_MISC | in wlc_phy_rssi_cal_nphy_rev3()
22470 wlc_phy_poll_rssi_nphy(pi, NPHY_RSSI_SEL_NB, in wlc_phy_rssi_cal_nphy_rev3()
22507 if (NREV_GE(pi->pubpi.phy_rev, 7)) in wlc_phy_rssi_cal_nphy_rev3()
22508 mod_radio_reg(pi, (core == PHY_CORE_0) ? in wlc_phy_rssi_cal_nphy_rev3()
22513 mod_radio_reg(pi, RADIO_2056_RX_RSSI_MISC | in wlc_phy_rssi_cal_nphy_rev3()
22550 pi, 0x0, in wlc_phy_rssi_cal_nphy_rev3()
22565 for (core = 0; core < pi->pubpi.phy_corenum; core++) { in wlc_phy_rssi_cal_nphy_rev3()
22579 wlc_phy_scale_offset_rssi_nphy(pi, 0x0, 0x0, in wlc_phy_rssi_cal_nphy_rev3()
22586 wlc_phy_scale_offset_rssi_nphy(pi, 0x0, 0x0, in wlc_phy_rssi_cal_nphy_rev3()
22594 wlc_phy_poll_rssi_nphy(pi, rssi_type, poll_result_core, in wlc_phy_rssi_cal_nphy_rev3()
22626 pi, 0x0, in wlc_phy_rssi_cal_nphy_rev3()
22644 write_phy_reg(pi, 0x91, NPHY_Rfctrlintc1_save); in wlc_phy_rssi_cal_nphy_rev3()
22645 write_phy_reg(pi, 0x92, NPHY_Rfctrlintc2_save); in wlc_phy_rssi_cal_nphy_rev3()
22647 wlc_phy_force_rfseq_nphy(pi, NPHY_RFSEQ_RESET2RX); in wlc_phy_rssi_cal_nphy_rev3()
22649 mod_phy_reg(pi, 0xe7, (0x1 << 0), 1 << 0); in wlc_phy_rssi_cal_nphy_rev3()
22650 mod_phy_reg(pi, 0x78, (0x1 << 0), 1 << 0); in wlc_phy_rssi_cal_nphy_rev3()
22651 mod_phy_reg(pi, 0xe7, (0x1 << 0), 0); in wlc_phy_rssi_cal_nphy_rev3()
22653 mod_phy_reg(pi, 0xec, (0x1 << 0), 1 << 0); in wlc_phy_rssi_cal_nphy_rev3()
22654 mod_phy_reg(pi, 0x78, (0x1 << 1), 1 << 1); in wlc_phy_rssi_cal_nphy_rev3()
22655 mod_phy_reg(pi, 0xec, (0x1 << 0), 0); in wlc_phy_rssi_cal_nphy_rev3()
22657 write_phy_reg(pi, 0x8f, NPHY_AfectrlOverride1_save); in wlc_phy_rssi_cal_nphy_rev3()
22658 write_phy_reg(pi, 0xa5, NPHY_AfectrlOverride2_save); in wlc_phy_rssi_cal_nphy_rev3()
22659 write_phy_reg(pi, 0xa6, NPHY_AfectrlCore1_save); in wlc_phy_rssi_cal_nphy_rev3()
22660 write_phy_reg(pi, 0xa7, NPHY_AfectrlCore2_save); in wlc_phy_rssi_cal_nphy_rev3()
22661 write_phy_reg(pi, 0xe7, NPHY_RfctrlOverride0_save); in wlc_phy_rssi_cal_nphy_rev3()
22662 write_phy_reg(pi, 0xec, NPHY_RfctrlOverride1_save); in wlc_phy_rssi_cal_nphy_rev3()
22663 if (NREV_GE(pi->pubpi.phy_rev, 7)) { in wlc_phy_rssi_cal_nphy_rev3()
22664 write_phy_reg(pi, 0x342, NPHY_REV7_RfctrlOverride3_save); in wlc_phy_rssi_cal_nphy_rev3()
22665 write_phy_reg(pi, 0x343, NPHY_REV7_RfctrlOverride4_save); in wlc_phy_rssi_cal_nphy_rev3()
22666 write_phy_reg(pi, 0x346, NPHY_REV7_RfctrlOverride5_save); in wlc_phy_rssi_cal_nphy_rev3()
22667 write_phy_reg(pi, 0x347, NPHY_REV7_RfctrlOverride6_save); in wlc_phy_rssi_cal_nphy_rev3()
22669 write_phy_reg(pi, 0xe5, NPHY_RfctrlOverrideAux0_save); in wlc_phy_rssi_cal_nphy_rev3()
22670 write_phy_reg(pi, 0xe6, NPHY_RfctrlOverrideAux1_save); in wlc_phy_rssi_cal_nphy_rev3()
22671 write_phy_reg(pi, 0x78, NPHY_RfctrlCmd_save); in wlc_phy_rssi_cal_nphy_rev3()
22672 write_phy_reg(pi, 0xf9, NPHY_RfctrlMiscReg1_save); in wlc_phy_rssi_cal_nphy_rev3()
22673 write_phy_reg(pi, 0xfb, NPHY_RfctrlMiscReg2_save); in wlc_phy_rssi_cal_nphy_rev3()
22674 if (NREV_GE(pi->pubpi.phy_rev, 7)) { in wlc_phy_rssi_cal_nphy_rev3()
22675 write_phy_reg(pi, 0x340, NPHY_REV7_RfctrlMiscReg3_save); in wlc_phy_rssi_cal_nphy_rev3()
22676 write_phy_reg(pi, 0x341, NPHY_REV7_RfctrlMiscReg4_save); in wlc_phy_rssi_cal_nphy_rev3()
22677 write_phy_reg(pi, 0x344, NPHY_REV7_RfctrlMiscReg5_save); in wlc_phy_rssi_cal_nphy_rev3()
22678 write_phy_reg(pi, 0x345, NPHY_REV7_RfctrlMiscReg6_save); in wlc_phy_rssi_cal_nphy_rev3()
22680 write_phy_reg(pi, 0x7a, NPHY_RfctrlRSSIOTHERS1_save); in wlc_phy_rssi_cal_nphy_rev3()
22681 write_phy_reg(pi, 0x7d, NPHY_RfctrlRSSIOTHERS2_save); in wlc_phy_rssi_cal_nphy_rev3()
22683 if (CHSPEC_IS2G(pi->radio_chanspec)) { in wlc_phy_rssi_cal_nphy_rev3()
22684 if (NREV_GE(pi->pubpi.phy_rev, 7)) { in wlc_phy_rssi_cal_nphy_rev3()
22685 pi->rssical_cache.rssical_radio_regs_2G[0] = in wlc_phy_rssi_cal_nphy_rev3()
22686 read_radio_reg(pi, RADIO_2057_NB_MASTER_CORE0); in wlc_phy_rssi_cal_nphy_rev3()
22687 pi->rssical_cache.rssical_radio_regs_2G[1] = in wlc_phy_rssi_cal_nphy_rev3()
22688 read_radio_reg(pi, RADIO_2057_NB_MASTER_CORE1); in wlc_phy_rssi_cal_nphy_rev3()
22690 pi->rssical_cache.rssical_radio_regs_2G[0] = in wlc_phy_rssi_cal_nphy_rev3()
22691 read_radio_reg(pi, in wlc_phy_rssi_cal_nphy_rev3()
22694 pi->rssical_cache.rssical_radio_regs_2G[1] = in wlc_phy_rssi_cal_nphy_rev3()
22695 read_radio_reg(pi, in wlc_phy_rssi_cal_nphy_rev3()
22700 pi->rssical_cache.rssical_phyregs_2G[0] = in wlc_phy_rssi_cal_nphy_rev3()
22701 read_phy_reg(pi, 0x1a6); in wlc_phy_rssi_cal_nphy_rev3()
22702 pi->rssical_cache.rssical_phyregs_2G[1] = in wlc_phy_rssi_cal_nphy_rev3()
22703 read_phy_reg(pi, 0x1ac); in wlc_phy_rssi_cal_nphy_rev3()
22704 pi->rssical_cache.rssical_phyregs_2G[2] = in wlc_phy_rssi_cal_nphy_rev3()
22705 read_phy_reg(pi, 0x1b2); in wlc_phy_rssi_cal_nphy_rev3()
22706 pi->rssical_cache.rssical_phyregs_2G[3] = in wlc_phy_rssi_cal_nphy_rev3()
22707 read_phy_reg(pi, 0x1b8); in wlc_phy_rssi_cal_nphy_rev3()
22708 pi->rssical_cache.rssical_phyregs_2G[4] = in wlc_phy_rssi_cal_nphy_rev3()
22709 read_phy_reg(pi, 0x1a4); in wlc_phy_rssi_cal_nphy_rev3()
22710 pi->rssical_cache.rssical_phyregs_2G[5] = in wlc_phy_rssi_cal_nphy_rev3()
22711 read_phy_reg(pi, 0x1aa); in wlc_phy_rssi_cal_nphy_rev3()
22712 pi->rssical_cache.rssical_phyregs_2G[6] = in wlc_phy_rssi_cal_nphy_rev3()
22713 read_phy_reg(pi, 0x1b0); in wlc_phy_rssi_cal_nphy_rev3()
22714 pi->rssical_cache.rssical_phyregs_2G[7] = in wlc_phy_rssi_cal_nphy_rev3()
22715 read_phy_reg(pi, 0x1b6); in wlc_phy_rssi_cal_nphy_rev3()
22716 pi->rssical_cache.rssical_phyregs_2G[8] = in wlc_phy_rssi_cal_nphy_rev3()
22717 read_phy_reg(pi, 0x1a5); in wlc_phy_rssi_cal_nphy_rev3()
22718 pi->rssical_cache.rssical_phyregs_2G[9] = in wlc_phy_rssi_cal_nphy_rev3()
22719 read_phy_reg(pi, 0x1ab); in wlc_phy_rssi_cal_nphy_rev3()
22720 pi->rssical_cache.rssical_phyregs_2G[10] = in wlc_phy_rssi_cal_nphy_rev3()
22721 read_phy_reg(pi, 0x1b1); in wlc_phy_rssi_cal_nphy_rev3()
22722 pi->rssical_cache.rssical_phyregs_2G[11] = in wlc_phy_rssi_cal_nphy_rev3()
22723 read_phy_reg(pi, 0x1b7); in wlc_phy_rssi_cal_nphy_rev3()
22725 pi->nphy_rssical_chanspec_2G = pi->radio_chanspec; in wlc_phy_rssi_cal_nphy_rev3()
22727 if (NREV_GE(pi->pubpi.phy_rev, 7)) { in wlc_phy_rssi_cal_nphy_rev3()
22728 pi->rssical_cache.rssical_radio_regs_5G[0] = in wlc_phy_rssi_cal_nphy_rev3()
22729 read_radio_reg(pi, RADIO_2057_NB_MASTER_CORE0); in wlc_phy_rssi_cal_nphy_rev3()
22730 pi->rssical_cache.rssical_radio_regs_5G[1] = in wlc_phy_rssi_cal_nphy_rev3()
22731 read_radio_reg(pi, RADIO_2057_NB_MASTER_CORE1); in wlc_phy_rssi_cal_nphy_rev3()
22733 pi->rssical_cache.rssical_radio_regs_5G[0] = in wlc_phy_rssi_cal_nphy_rev3()
22734 read_radio_reg(pi, in wlc_phy_rssi_cal_nphy_rev3()
22737 pi->rssical_cache.rssical_radio_regs_5G[1] = in wlc_phy_rssi_cal_nphy_rev3()
22738 read_radio_reg(pi, in wlc_phy_rssi_cal_nphy_rev3()
22743 pi->rssical_cache.rssical_phyregs_5G[0] = in wlc_phy_rssi_cal_nphy_rev3()
22744 read_phy_reg(pi, 0x1a6); in wlc_phy_rssi_cal_nphy_rev3()
22745 pi->rssical_cache.rssical_phyregs_5G[1] = in wlc_phy_rssi_cal_nphy_rev3()
22746 read_phy_reg(pi, 0x1ac); in wlc_phy_rssi_cal_nphy_rev3()
22747 pi->rssical_cache.rssical_phyregs_5G[2] = in wlc_phy_rssi_cal_nphy_rev3()
22748 read_phy_reg(pi, 0x1b2); in wlc_phy_rssi_cal_nphy_rev3()
22749 pi->rssical_cache.rssical_phyregs_5G[3] = in wlc_phy_rssi_cal_nphy_rev3()
22750 read_phy_reg(pi, 0x1b8); in wlc_phy_rssi_cal_nphy_rev3()
22751 pi->rssical_cache.rssical_phyregs_5G[4] = in wlc_phy_rssi_cal_nphy_rev3()
22752 read_phy_reg(pi, 0x1a4); in wlc_phy_rssi_cal_nphy_rev3()
22753 pi->rssical_cache.rssical_phyregs_5G[5] = in wlc_phy_rssi_cal_nphy_rev3()
22754 read_phy_reg(pi, 0x1aa); in wlc_phy_rssi_cal_nphy_rev3()
22755 pi->rssical_cache.rssical_phyregs_5G[6] = in wlc_phy_rssi_cal_nphy_rev3()
22756 read_phy_reg(pi, 0x1b0); in wlc_phy_rssi_cal_nphy_rev3()
22757 pi->rssical_cache.rssical_phyregs_5G[7] = in wlc_phy_rssi_cal_nphy_rev3()
22758 read_phy_reg(pi, 0x1b6); in wlc_phy_rssi_cal_nphy_rev3()
22759 pi->rssical_cache.rssical_phyregs_5G[8] = in wlc_phy_rssi_cal_nphy_rev3()
22760 read_phy_reg(pi, 0x1a5); in wlc_phy_rssi_cal_nphy_rev3()
22761 pi->rssical_cache.rssical_phyregs_5G[9] = in wlc_phy_rssi_cal_nphy_rev3()
22762 read_phy_reg(pi, 0x1ab); in wlc_phy_rssi_cal_nphy_rev3()
22763 pi->rssical_cache.rssical_phyregs_5G[10] = in wlc_phy_rssi_cal_nphy_rev3()
22764 read_phy_reg(pi, 0x1b1); in wlc_phy_rssi_cal_nphy_rev3()
22765 pi->rssical_cache.rssical_phyregs_5G[11] = in wlc_phy_rssi_cal_nphy_rev3()
22766 read_phy_reg(pi, 0x1b7); in wlc_phy_rssi_cal_nphy_rev3()
22768 pi->nphy_rssical_chanspec_5G = pi->radio_chanspec; in wlc_phy_rssi_cal_nphy_rev3()
22771 wlc_phy_classifier_nphy(pi, (0x7 << 0), classif_state); in wlc_phy_rssi_cal_nphy_rev3()
22772 wlc_phy_clip_det_nphy(pi, 1, clip_state); in wlc_phy_rssi_cal_nphy_rev3()
22775 static void wlc_phy_rssi_cal_nphy_rev2(struct brcms_phy *pi, u8 rssi_type) in wlc_phy_rssi_cal_nphy_rev2() argument
22819 classif_state = wlc_phy_classifier_nphy(pi, 0, 0); in wlc_phy_rssi_cal_nphy_rev2()
22820 wlc_phy_classifier_nphy(pi, (0x7 << 0), 4); in wlc_phy_rssi_cal_nphy_rev2()
22821 wlc_phy_clip_det_nphy(pi, 0, clip_state); in wlc_phy_rssi_cal_nphy_rev2()
22822 wlc_phy_clip_det_nphy(pi, 1, clip_off); in wlc_phy_rssi_cal_nphy_rev2()
22826 CHSPEC_IS5G(pi->radio_chanspec) ? 0x140 : 0x110; in wlc_phy_rssi_cal_nphy_rev2()
22828 rfctrlintc_state[0] = read_phy_reg(pi, 0x91); in wlc_phy_rssi_cal_nphy_rev2()
22829 rfpdcorerxtx_state[0] = read_radio_reg(pi, RADIO_2055_PD_CORE1_RXTX); in wlc_phy_rssi_cal_nphy_rev2()
22830 write_phy_reg(pi, 0x91, rfctrlintc_override_val); in wlc_phy_rssi_cal_nphy_rev2()
22831 write_radio_reg(pi, RADIO_2055_PD_CORE1_RXTX, rf_pd_val); in wlc_phy_rssi_cal_nphy_rev2()
22833 rfctrlintc_state[1] = read_phy_reg(pi, 0x92); in wlc_phy_rssi_cal_nphy_rev2()
22834 rfpdcorerxtx_state[1] = read_radio_reg(pi, RADIO_2055_PD_CORE2_RXTX); in wlc_phy_rssi_cal_nphy_rev2()
22835 write_phy_reg(pi, 0x92, rfctrlintc_override_val); in wlc_phy_rssi_cal_nphy_rev2()
22836 write_radio_reg(pi, RADIO_2055_PD_CORE2_RXTX, rf_pd_val); in wlc_phy_rssi_cal_nphy_rev2()
22841 read_radio_reg(pi, RADIO_2055_PD_CORE1_RSSI_MISC) & pd_mask; in wlc_phy_rssi_cal_nphy_rev2()
22843 read_radio_reg(pi, RADIO_2055_PD_CORE2_RSSI_MISC) & pd_mask; in wlc_phy_rssi_cal_nphy_rev2()
22844 mod_radio_reg(pi, RADIO_2055_PD_CORE1_RSSI_MISC, pd_mask, 0); in wlc_phy_rssi_cal_nphy_rev2()
22845 mod_radio_reg(pi, RADIO_2055_PD_CORE2_RSSI_MISC, pd_mask, 0); in wlc_phy_rssi_cal_nphy_rev2()
22849 read_radio_reg(pi, RADIO_2055_SP_RSSI_CORE1) & rssi_ctrl_mask; in wlc_phy_rssi_cal_nphy_rev2()
22851 read_radio_reg(pi, RADIO_2055_SP_RSSI_CORE2) & rssi_ctrl_mask; in wlc_phy_rssi_cal_nphy_rev2()
22852 wlc_phy_rssisel_nphy(pi, RADIO_MIMO_CORESEL_ALLRX, rssi_type); in wlc_phy_rssi_cal_nphy_rev2()
22854 wlc_phy_scale_offset_rssi_nphy(pi, 0x0, 0x0, RADIO_MIMO_CORESEL_ALLRX, in wlc_phy_rssi_cal_nphy_rev2()
22856 wlc_phy_scale_offset_rssi_nphy(pi, 0x0, 0x0, RADIO_MIMO_CORESEL_ALLRX, in wlc_phy_rssi_cal_nphy_rev2()
22863 wlc_phy_set_rssi_2055_vcm(pi, rssi_type, vcm_tmp); in wlc_phy_rssi_cal_nphy_rev2()
22865 wlc_phy_poll_rssi_nphy(pi, rssi_type, &poll_results[vcm][0], in wlc_phy_rssi_cal_nphy_rev2()
22898 wlc_phy_set_rssi_2055_vcm(pi, rssi_type, vcm_final); in wlc_phy_rssi_cal_nphy_rev2()
22923 wlc_phy_scale_offset_rssi_nphy(pi, 0x0, in wlc_phy_rssi_cal_nphy_rev2()
22934 mod_radio_reg(pi, RADIO_2055_PD_CORE1_RSSI_MISC, pd_mask, pd_state[0]); in wlc_phy_rssi_cal_nphy_rev2()
22935 mod_radio_reg(pi, RADIO_2055_PD_CORE2_RSSI_MISC, pd_mask, pd_state[1]); in wlc_phy_rssi_cal_nphy_rev2()
22937 wlc_phy_rssisel_nphy(pi, RADIO_MIMO_CORESEL_CORE1, in wlc_phy_rssi_cal_nphy_rev2()
22940 wlc_phy_rssisel_nphy(pi, RADIO_MIMO_CORESEL_CORE1, in wlc_phy_rssi_cal_nphy_rev2()
22943 wlc_phy_rssisel_nphy(pi, RADIO_MIMO_CORESEL_CORE1, in wlc_phy_rssi_cal_nphy_rev2()
22946 wlc_phy_rssisel_nphy(pi, RADIO_MIMO_CORESEL_CORE2, in wlc_phy_rssi_cal_nphy_rev2()
22949 wlc_phy_rssisel_nphy(pi, RADIO_MIMO_CORESEL_CORE2, in wlc_phy_rssi_cal_nphy_rev2()
22952 wlc_phy_rssisel_nphy(pi, RADIO_MIMO_CORESEL_CORE2, in wlc_phy_rssi_cal_nphy_rev2()
22954 wlc_phy_rssisel_nphy(pi, RADIO_MIMO_CORESEL_OFF, rssi_type); in wlc_phy_rssi_cal_nphy_rev2()
22956 write_phy_reg(pi, 0x91, rfctrlintc_state[0]); in wlc_phy_rssi_cal_nphy_rev2()
22957 write_radio_reg(pi, RADIO_2055_PD_CORE1_RXTX, rfpdcorerxtx_state[0]); in wlc_phy_rssi_cal_nphy_rev2()
22958 write_phy_reg(pi, 0x92, rfctrlintc_state[1]); in wlc_phy_rssi_cal_nphy_rev2()
22959 write_radio_reg(pi, RADIO_2055_PD_CORE2_RXTX, rfpdcorerxtx_state[1]); in wlc_phy_rssi_cal_nphy_rev2()
22961 wlc_phy_classifier_nphy(pi, (0x7 << 0), classif_state); in wlc_phy_rssi_cal_nphy_rev2()
22962 wlc_phy_clip_det_nphy(pi, 1, clip_state); in wlc_phy_rssi_cal_nphy_rev2()
22964 wlc_phy_resetcca_nphy(pi); in wlc_phy_rssi_cal_nphy_rev2()
22967 void wlc_phy_rssi_cal_nphy(struct brcms_phy *pi) in wlc_phy_rssi_cal_nphy() argument
22969 if (NREV_GE(pi->pubpi.phy_rev, 3)) { in wlc_phy_rssi_cal_nphy()
22970 wlc_phy_rssi_cal_nphy_rev3(pi); in wlc_phy_rssi_cal_nphy()
22972 wlc_phy_rssi_cal_nphy_rev2(pi, NPHY_RSSI_SEL_NB); in wlc_phy_rssi_cal_nphy()
22973 wlc_phy_rssi_cal_nphy_rev2(pi, NPHY_RSSI_SEL_W1); in wlc_phy_rssi_cal_nphy()
22974 wlc_phy_rssi_cal_nphy_rev2(pi, NPHY_RSSI_SEL_W2); in wlc_phy_rssi_cal_nphy()
22979 wlc_phy_rssi_compute_nphy(struct brcms_phy *pi, struct d11rxhdr *rxh) in wlc_phy_rssi_compute_nphy() argument
23002 if (pi->sh->rssi_mode == RSSI_ANT_MERGE_MAX) in wlc_phy_rssi_compute_nphy()
23004 else if (pi->sh->rssi_mode == RSSI_ANT_MERGE_MIN) in wlc_phy_rssi_compute_nphy()
23006 else if (pi->sh->rssi_mode == RSSI_ANT_MERGE_AVG) in wlc_phy_rssi_compute_nphy()
23013 wlc_phy_loadsampletable_nphy(struct brcms_phy *pi, struct cordic_iq *tone_buf, in wlc_phy_loadsampletable_nphy() argument
23023 if (pi->phyhang_avoid) in wlc_phy_loadsampletable_nphy()
23024 wlc_phy_stay_in_carriersearch_nphy(pi, true); in wlc_phy_loadsampletable_nphy()
23029 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_SAMPLEPLAY, num_samps, 0, 32, in wlc_phy_loadsampletable_nphy()
23034 if (pi->phyhang_avoid) in wlc_phy_loadsampletable_nphy()
23035 wlc_phy_stay_in_carriersearch_nphy(pi, false); in wlc_phy_loadsampletable_nphy()
23039 wlc_phy_gen_load_samples_nphy(struct brcms_phy *pi, u32 f_kHz, u16 max_val, in wlc_phy_gen_load_samples_nphy() argument
23048 is_phybw40 = CHSPEC_IS40(pi->radio_chanspec); in wlc_phy_gen_load_samples_nphy()
23053 spur = read_phy_reg(pi, 0x01); in wlc_phy_gen_load_samples_nphy()
23080 wlc_phy_loadsampletable_nphy(pi, tone_buf, num_samps); in wlc_phy_gen_load_samples_nphy()
23088 wlc_phy_runsamples_nphy(struct brcms_phy *pi, u16 num_samps, u16 loops, in wlc_phy_runsamples_nphy() argument
23097 if (pi->phyhang_avoid) in wlc_phy_runsamples_nphy()
23098 wlc_phy_stay_in_carriersearch_nphy(pi, true); in wlc_phy_runsamples_nphy()
23101 if (CHSPEC_IS40(pi->radio_chanspec)) in wlc_phy_runsamples_nphy()
23104 if (NREV_GE(pi->pubpi.phy_rev, 7)) { in wlc_phy_runsamples_nphy()
23106 lpf_bw_ctl_override3 = read_phy_reg(pi, 0x342) & (0x1 << 7); in wlc_phy_runsamples_nphy()
23107 lpf_bw_ctl_override4 = read_phy_reg(pi, 0x343) & (0x1 << 7); in wlc_phy_runsamples_nphy()
23110 pi, in wlc_phy_runsamples_nphy()
23113 (pi, in wlc_phy_runsamples_nphy()
23117 pi->nphy_sample_play_lpf_bw_ctl_ovr = true; in wlc_phy_runsamples_nphy()
23119 read_phy_reg(pi, 0x340); /* lpf_bw_ctl_miscreg3 */ in wlc_phy_runsamples_nphy()
23120 read_phy_reg(pi, 0x341); /* lpf_bw_ctl_miscreg4 */ in wlc_phy_runsamples_nphy()
23123 if ((pi->nphy_bb_mult_save & BB_MULT_VALID_MASK) == 0) { in wlc_phy_runsamples_nphy()
23125 wlc_phy_table_read_nphy(pi, NPHY_TBL_ID_IQLOCAL, 1, 87, 16, in wlc_phy_runsamples_nphy()
23127 pi->nphy_bb_mult_save = in wlc_phy_runsamples_nphy()
23134 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_IQLOCAL, 1, 87, 16, in wlc_phy_runsamples_nphy()
23138 if (pi->phyhang_avoid) in wlc_phy_runsamples_nphy()
23139 wlc_phy_stay_in_carriersearch_nphy(pi, false); in wlc_phy_runsamples_nphy()
23141 write_phy_reg(pi, 0xc6, num_samps - 1); in wlc_phy_runsamples_nphy()
23144 write_phy_reg(pi, 0xc4, loops - 1); in wlc_phy_runsamples_nphy()
23146 write_phy_reg(pi, 0xc4, loops); in wlc_phy_runsamples_nphy()
23148 write_phy_reg(pi, 0xc5, wait); in wlc_phy_runsamples_nphy()
23150 orig_RfseqCoreActv = read_phy_reg(pi, 0xa1); in wlc_phy_runsamples_nphy()
23151 or_phy_reg(pi, 0xa1, NPHY_RfseqMode_CoreActv_override); in wlc_phy_runsamples_nphy()
23154 and_phy_reg(pi, 0xc2, 0x7FFF); in wlc_phy_runsamples_nphy()
23156 or_phy_reg(pi, 0xc2, 0x8000); in wlc_phy_runsamples_nphy()
23160 write_phy_reg(pi, 0xc3, sample_cmd); in wlc_phy_runsamples_nphy()
23163 SPINWAIT(((read_phy_reg(pi, 0xa4) & 0x1) == 1), 1000); in wlc_phy_runsamples_nphy()
23165 write_phy_reg(pi, 0xa1, orig_RfseqCoreActv); in wlc_phy_runsamples_nphy()
23169 wlc_phy_tx_tone_nphy(struct brcms_phy *pi, u32 f_kHz, u16 max_val, in wlc_phy_tx_tone_nphy() argument
23176 num_samps = wlc_phy_gen_load_samples_nphy(pi, f_kHz, max_val, in wlc_phy_tx_tone_nphy()
23181 wlc_phy_runsamples_nphy(pi, num_samps, loops, wait, iqmode, in wlc_phy_tx_tone_nphy()
23187 void wlc_phy_stopplayback_nphy(struct brcms_phy *pi) in wlc_phy_stopplayback_nphy() argument
23192 if (pi->phyhang_avoid) in wlc_phy_stopplayback_nphy()
23193 wlc_phy_stay_in_carriersearch_nphy(pi, true); in wlc_phy_stopplayback_nphy()
23195 playback_status = read_phy_reg(pi, 0xc7); in wlc_phy_stopplayback_nphy()
23197 or_phy_reg(pi, 0xc3, NPHY_sampleCmd_STOP); in wlc_phy_stopplayback_nphy()
23199 and_phy_reg(pi, 0xc2, in wlc_phy_stopplayback_nphy()
23202 and_phy_reg(pi, 0xc3, (u16) ~(0x1 << 2)); in wlc_phy_stopplayback_nphy()
23204 if ((pi->nphy_bb_mult_save & BB_MULT_VALID_MASK) != 0) { in wlc_phy_stopplayback_nphy()
23206 bb_mult = pi->nphy_bb_mult_save & BB_MULT_MASK; in wlc_phy_stopplayback_nphy()
23207 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_IQLOCAL, 1, 87, 16, in wlc_phy_stopplayback_nphy()
23210 pi->nphy_bb_mult_save = 0; in wlc_phy_stopplayback_nphy()
23213 if (NREV_IS(pi->pubpi.phy_rev, 7) || NREV_GE(pi->pubpi.phy_rev, 8)) { in wlc_phy_stopplayback_nphy()
23214 if (pi->nphy_sample_play_lpf_bw_ctl_ovr) { in wlc_phy_stopplayback_nphy()
23216 pi, in wlc_phy_stopplayback_nphy()
23220 pi->nphy_sample_play_lpf_bw_ctl_ovr = false; in wlc_phy_stopplayback_nphy()
23224 if (pi->phyhang_avoid) in wlc_phy_stopplayback_nphy()
23225 wlc_phy_stay_in_carriersearch_nphy(pi, false); in wlc_phy_stopplayback_nphy()
23228 static u32 *brcms_phy_get_tx_pwrctrl_tbl(struct brcms_phy *pi) in brcms_phy_get_tx_pwrctrl_tbl() argument
23231 uint phyrev = pi->pubpi.phy_rev; in brcms_phy_get_tx_pwrctrl_tbl()
23233 if (PHY_IPA(pi)) { in brcms_phy_get_tx_pwrctrl_tbl()
23235 wlc_phy_get_ipa_gaintbl_nphy(pi); in brcms_phy_get_tx_pwrctrl_tbl()
23237 if (CHSPEC_IS5G(pi->radio_chanspec)) { in brcms_phy_get_tx_pwrctrl_tbl()
23242 (pi->srom_fem5g.extpagain == 3) ? in brcms_phy_get_tx_pwrctrl_tbl()
23249 if (pi->pubpi.radiorev == 3) in brcms_phy_get_tx_pwrctrl_tbl()
23252 else if (pi->pubpi.radiorev == 5) in brcms_phy_get_tx_pwrctrl_tbl()
23257 (pi->srom_fem2g.extpagain == 3)) in brcms_phy_get_tx_pwrctrl_tbl()
23269 struct nphy_txgains wlc_phy_get_tx_gain_nphy(struct brcms_phy *pi) in wlc_phy_get_tx_gain_nphy() argument
23276 if (pi->nphy_txpwrctrl == PHY_TPC_HW_OFF) { in wlc_phy_get_tx_gain_nphy()
23277 if (pi->phyhang_avoid) in wlc_phy_get_tx_gain_nphy()
23278 wlc_phy_stay_in_carriersearch_nphy(pi, true); in wlc_phy_get_tx_gain_nphy()
23280 wlc_phy_table_read_nphy(pi, NPHY_TBL_ID_RFSEQ, 2, 0x110, 16, in wlc_phy_get_tx_gain_nphy()
23283 if (pi->phyhang_avoid) in wlc_phy_get_tx_gain_nphy()
23284 wlc_phy_stay_in_carriersearch_nphy(pi, false); in wlc_phy_get_tx_gain_nphy()
23287 if (NREV_GE(pi->pubpi.phy_rev, 7)) { in wlc_phy_get_tx_gain_nphy()
23298 } else if (NREV_GE(pi->pubpi.phy_rev, 3)) { in wlc_phy_get_tx_gain_nphy()
23319 uint phyrev = pi->pubpi.phy_rev; in wlc_phy_get_tx_gain_nphy()
23321 base_idx[0] = (read_phy_reg(pi, 0x1ed) >> 8) & 0x7f; in wlc_phy_get_tx_gain_nphy()
23322 base_idx[1] = (read_phy_reg(pi, 0x1ee) >> 8) & 0x7f; in wlc_phy_get_tx_gain_nphy()
23326 brcms_phy_get_tx_pwrctrl_tbl(pi); in wlc_phy_get_tx_gain_nphy()
23387 wlc_phy_iqcal_gainparams_nphy(struct brcms_phy *pi, u16 core_no, in wlc_phy_iqcal_gainparams_nphy() argument
23393 u8 band_idx = (CHSPEC_IS5G(pi->radio_chanspec) ? 1 : 0); in wlc_phy_iqcal_gainparams_nphy()
23395 if (NREV_GE(pi->pubpi.phy_rev, 3)) { in wlc_phy_iqcal_gainparams_nphy()
23396 if (NREV_GE(pi->pubpi.phy_rev, 7)) in wlc_phy_iqcal_gainparams_nphy()
23403 if (NREV_GE(pi->pubpi.phy_rev, 7)) in wlc_phy_iqcal_gainparams_nphy()
23442 static void wlc_phy_txcal_radio_setup_nphy(struct brcms_phy *pi) in wlc_phy_txcal_radio_setup_nphy() argument
23446 if (NREV_GE(pi->pubpi.phy_rev, 7)) { in wlc_phy_txcal_radio_setup_nphy()
23450 pi->tx_rx_cal_radio_saveregs[(core * 11) + 0] = in wlc_phy_txcal_radio_setup_nphy()
23451 READ_RADIO_REG3(pi, RADIO_2057, TX, core, in wlc_phy_txcal_radio_setup_nphy()
23454 pi->tx_rx_cal_radio_saveregs[(core * 11) + 1] = in wlc_phy_txcal_radio_setup_nphy()
23455 READ_RADIO_REG3(pi, RADIO_2057, TX, core, in wlc_phy_txcal_radio_setup_nphy()
23458 pi->tx_rx_cal_radio_saveregs[(core * 11) + 2] = in wlc_phy_txcal_radio_setup_nphy()
23459 READ_RADIO_REG3(pi, RADIO_2057, TX, core, in wlc_phy_txcal_radio_setup_nphy()
23462 pi->tx_rx_cal_radio_saveregs[(core * 11) + 3] = in wlc_phy_txcal_radio_setup_nphy()
23463 READ_RADIO_REG3(pi, RADIO_2057, TX, core, in wlc_phy_txcal_radio_setup_nphy()
23466 pi->tx_rx_cal_radio_saveregs[(core * 11) + 4] = 0; in wlc_phy_txcal_radio_setup_nphy()
23468 pi->tx_rx_cal_radio_saveregs[(core * 11) + 5] = in wlc_phy_txcal_radio_setup_nphy()
23469 READ_RADIO_REG3(pi, RADIO_2057, TX, core, in wlc_phy_txcal_radio_setup_nphy()
23472 if (pi->pubpi.radiorev != 5) in wlc_phy_txcal_radio_setup_nphy()
23473 pi->tx_rx_cal_radio_saveregs[(core * 11) + 6] = in wlc_phy_txcal_radio_setup_nphy()
23474 READ_RADIO_REG3(pi, RADIO_2057, TX, in wlc_phy_txcal_radio_setup_nphy()
23478 pi->tx_rx_cal_radio_saveregs[(core * 11) + 7] = in wlc_phy_txcal_radio_setup_nphy()
23479 READ_RADIO_REG3(pi, RADIO_2057, TX, core, TSSIG); in wlc_phy_txcal_radio_setup_nphy()
23481 pi->tx_rx_cal_radio_saveregs[(core * 11) + 8] = in wlc_phy_txcal_radio_setup_nphy()
23482 READ_RADIO_REG3(pi, RADIO_2057, TX, core, in wlc_phy_txcal_radio_setup_nphy()
23485 if (CHSPEC_IS5G(pi->radio_chanspec)) { in wlc_phy_txcal_radio_setup_nphy()
23486 WRITE_RADIO_REG3(pi, RADIO_2057, TX, core, in wlc_phy_txcal_radio_setup_nphy()
23488 WRITE_RADIO_REG3(pi, RADIO_2057, TX, core, in wlc_phy_txcal_radio_setup_nphy()
23490 WRITE_RADIO_REG3(pi, RADIO_2057, TX, core, in wlc_phy_txcal_radio_setup_nphy()
23492 WRITE_RADIO_REG3(pi, RADIO_2057, TX, core, in wlc_phy_txcal_radio_setup_nphy()
23494 WRITE_RADIO_REG3(pi, RADIO_2057, TX, core, in wlc_phy_txcal_radio_setup_nphy()
23496 if (pi->use_int_tx_iqlo_cal_nphy) { in wlc_phy_txcal_radio_setup_nphy()
23497 WRITE_RADIO_REG3(pi, RADIO_2057, TX, in wlc_phy_txcal_radio_setup_nphy()
23499 if (!(pi-> in wlc_phy_txcal_radio_setup_nphy()
23501 WRITE_RADIO_REG3(pi, RADIO_2057, in wlc_phy_txcal_radio_setup_nphy()
23505 WRITE_RADIO_REG3(pi, RADIO_2057, in wlc_phy_txcal_radio_setup_nphy()
23509 WRITE_RADIO_REG3(pi, RADIO_2057, TX, core, in wlc_phy_txcal_radio_setup_nphy()
23512 WRITE_RADIO_REG3(pi, RADIO_2057, TX, core, in wlc_phy_txcal_radio_setup_nphy()
23514 WRITE_RADIO_REG3(pi, RADIO_2057, TX, core, in wlc_phy_txcal_radio_setup_nphy()
23516 WRITE_RADIO_REG3(pi, RADIO_2057, TX, core, in wlc_phy_txcal_radio_setup_nphy()
23518 WRITE_RADIO_REG3(pi, RADIO_2057, TX, core, in wlc_phy_txcal_radio_setup_nphy()
23521 if (pi->pubpi.radiorev != 5) in wlc_phy_txcal_radio_setup_nphy()
23522 WRITE_RADIO_REG3(pi, RADIO_2057, TX, in wlc_phy_txcal_radio_setup_nphy()
23524 if (pi->use_int_tx_iqlo_cal_nphy) { in wlc_phy_txcal_radio_setup_nphy()
23525 WRITE_RADIO_REG3(pi, RADIO_2057, TX, in wlc_phy_txcal_radio_setup_nphy()
23528 if (!(pi-> in wlc_phy_txcal_radio_setup_nphy()
23530 WRITE_RADIO_REG3(pi, RADIO_2057, in wlc_phy_txcal_radio_setup_nphy()
23534 WRITE_RADIO_REG3(pi, RADIO_2057, in wlc_phy_txcal_radio_setup_nphy()
23538 WRITE_RADIO_REG3(pi, RADIO_2057, TX, core, in wlc_phy_txcal_radio_setup_nphy()
23542 } else if (NREV_GE(pi->pubpi.phy_rev, 3)) { in wlc_phy_txcal_radio_setup_nphy()
23549 pi->tx_rx_cal_radio_saveregs[(core * 11) + 0] = in wlc_phy_txcal_radio_setup_nphy()
23550 read_radio_reg(pi, in wlc_phy_txcal_radio_setup_nphy()
23554 pi->tx_rx_cal_radio_saveregs[(core * 11) + 1] = in wlc_phy_txcal_radio_setup_nphy()
23555 read_radio_reg(pi, in wlc_phy_txcal_radio_setup_nphy()
23559 pi->tx_rx_cal_radio_saveregs[(core * 11) + 2] = in wlc_phy_txcal_radio_setup_nphy()
23560 read_radio_reg(pi, in wlc_phy_txcal_radio_setup_nphy()
23564 pi->tx_rx_cal_radio_saveregs[(core * 11) + 3] = in wlc_phy_txcal_radio_setup_nphy()
23566 pi, in wlc_phy_txcal_radio_setup_nphy()
23570 pi->tx_rx_cal_radio_saveregs[(core * 11) + 4] = in wlc_phy_txcal_radio_setup_nphy()
23571 read_radio_reg(pi, in wlc_phy_txcal_radio_setup_nphy()
23575 pi->tx_rx_cal_radio_saveregs[(core * 11) + 5] = in wlc_phy_txcal_radio_setup_nphy()
23576 read_radio_reg(pi, in wlc_phy_txcal_radio_setup_nphy()
23580 pi->tx_rx_cal_radio_saveregs[(core * 11) + 6] = in wlc_phy_txcal_radio_setup_nphy()
23581 read_radio_reg(pi, in wlc_phy_txcal_radio_setup_nphy()
23584 pi->tx_rx_cal_radio_saveregs[(core * 11) + 7] = in wlc_phy_txcal_radio_setup_nphy()
23585 read_radio_reg(pi, in wlc_phy_txcal_radio_setup_nphy()
23588 pi->tx_rx_cal_radio_saveregs[(core * 11) + 8] = in wlc_phy_txcal_radio_setup_nphy()
23589 read_radio_reg(pi, in wlc_phy_txcal_radio_setup_nphy()
23593 pi->tx_rx_cal_radio_saveregs[(core * 11) + 9] = in wlc_phy_txcal_radio_setup_nphy()
23594 read_radio_reg(pi, in wlc_phy_txcal_radio_setup_nphy()
23598 pi->tx_rx_cal_radio_saveregs[(core * 11) + 10] = in wlc_phy_txcal_radio_setup_nphy()
23599 read_radio_reg(pi, in wlc_phy_txcal_radio_setup_nphy()
23603 if (CHSPEC_IS5G(pi->radio_chanspec)) { in wlc_phy_txcal_radio_setup_nphy()
23604 write_radio_reg(pi, in wlc_phy_txcal_radio_setup_nphy()
23607 write_radio_reg(pi, in wlc_phy_txcal_radio_setup_nphy()
23610 write_radio_reg(pi, in wlc_phy_txcal_radio_setup_nphy()
23613 write_radio_reg(pi, in wlc_phy_txcal_radio_setup_nphy()
23616 write_radio_reg(pi, in wlc_phy_txcal_radio_setup_nphy()
23620 if (PHY_IPA(pi)) { in wlc_phy_txcal_radio_setup_nphy()
23622 pi, in wlc_phy_txcal_radio_setup_nphy()
23625 write_radio_reg(pi, in wlc_phy_txcal_radio_setup_nphy()
23630 pi, in wlc_phy_txcal_radio_setup_nphy()
23633 write_radio_reg(pi, in wlc_phy_txcal_radio_setup_nphy()
23637 write_radio_reg(pi, in wlc_phy_txcal_radio_setup_nphy()
23640 write_radio_reg(pi, in wlc_phy_txcal_radio_setup_nphy()
23644 write_radio_reg(pi, in wlc_phy_txcal_radio_setup_nphy()
23647 write_radio_reg(pi, in wlc_phy_txcal_radio_setup_nphy()
23651 write_radio_reg(pi, in wlc_phy_txcal_radio_setup_nphy()
23654 write_radio_reg(pi, in wlc_phy_txcal_radio_setup_nphy()
23657 write_radio_reg(pi, in wlc_phy_txcal_radio_setup_nphy()
23660 write_radio_reg(pi, in wlc_phy_txcal_radio_setup_nphy()
23663 write_radio_reg(pi, in wlc_phy_txcal_radio_setup_nphy()
23666 write_radio_reg(pi, in wlc_phy_txcal_radio_setup_nphy()
23670 if (PHY_IPA(pi)) { in wlc_phy_txcal_radio_setup_nphy()
23673 pi, in wlc_phy_txcal_radio_setup_nphy()
23676 if (NREV_LT(pi->pubpi.phy_rev, 5)) in wlc_phy_txcal_radio_setup_nphy()
23678 pi, in wlc_phy_txcal_radio_setup_nphy()
23684 pi, in wlc_phy_txcal_radio_setup_nphy()
23690 pi, in wlc_phy_txcal_radio_setup_nphy()
23693 write_radio_reg(pi, in wlc_phy_txcal_radio_setup_nphy()
23698 write_radio_reg(pi, in wlc_phy_txcal_radio_setup_nphy()
23701 write_radio_reg(pi, in wlc_phy_txcal_radio_setup_nphy()
23704 write_radio_reg(pi, in wlc_phy_txcal_radio_setup_nphy()
23711 pi->tx_rx_cal_radio_saveregs[0] = in wlc_phy_txcal_radio_setup_nphy()
23712 read_radio_reg(pi, RADIO_2055_CORE1_TXRF_IQCAL1); in wlc_phy_txcal_radio_setup_nphy()
23713 write_radio_reg(pi, RADIO_2055_CORE1_TXRF_IQCAL1, 0x29); in wlc_phy_txcal_radio_setup_nphy()
23714 pi->tx_rx_cal_radio_saveregs[1] = in wlc_phy_txcal_radio_setup_nphy()
23715 read_radio_reg(pi, RADIO_2055_CORE1_TXRF_IQCAL2); in wlc_phy_txcal_radio_setup_nphy()
23716 write_radio_reg(pi, RADIO_2055_CORE1_TXRF_IQCAL2, 0x54); in wlc_phy_txcal_radio_setup_nphy()
23718 pi->tx_rx_cal_radio_saveregs[2] = in wlc_phy_txcal_radio_setup_nphy()
23719 read_radio_reg(pi, RADIO_2055_CORE2_TXRF_IQCAL1); in wlc_phy_txcal_radio_setup_nphy()
23720 write_radio_reg(pi, RADIO_2055_CORE2_TXRF_IQCAL1, 0x29); in wlc_phy_txcal_radio_setup_nphy()
23721 pi->tx_rx_cal_radio_saveregs[3] = in wlc_phy_txcal_radio_setup_nphy()
23722 read_radio_reg(pi, RADIO_2055_CORE2_TXRF_IQCAL2); in wlc_phy_txcal_radio_setup_nphy()
23723 write_radio_reg(pi, RADIO_2055_CORE2_TXRF_IQCAL2, 0x54); in wlc_phy_txcal_radio_setup_nphy()
23725 pi->tx_rx_cal_radio_saveregs[4] = in wlc_phy_txcal_radio_setup_nphy()
23726 read_radio_reg(pi, RADIO_2055_PWRDET_RXTX_CORE1); in wlc_phy_txcal_radio_setup_nphy()
23727 pi->tx_rx_cal_radio_saveregs[5] = in wlc_phy_txcal_radio_setup_nphy()
23728 read_radio_reg(pi, RADIO_2055_PWRDET_RXTX_CORE2); in wlc_phy_txcal_radio_setup_nphy()
23730 if ((read_phy_reg(pi, 0x09) & NPHY_BandControl_currentBand) == in wlc_phy_txcal_radio_setup_nphy()
23733 write_radio_reg(pi, RADIO_2055_PWRDET_RXTX_CORE1, 0x04); in wlc_phy_txcal_radio_setup_nphy()
23734 write_radio_reg(pi, RADIO_2055_PWRDET_RXTX_CORE2, 0x04); in wlc_phy_txcal_radio_setup_nphy()
23737 write_radio_reg(pi, RADIO_2055_PWRDET_RXTX_CORE1, 0x20); in wlc_phy_txcal_radio_setup_nphy()
23738 write_radio_reg(pi, RADIO_2055_PWRDET_RXTX_CORE2, 0x20); in wlc_phy_txcal_radio_setup_nphy()
23741 if (NREV_LT(pi->pubpi.phy_rev, 2)) { in wlc_phy_txcal_radio_setup_nphy()
23743 or_radio_reg(pi, RADIO_2055_CORE1_TX_BB_MXGM, 0x20); in wlc_phy_txcal_radio_setup_nphy()
23744 or_radio_reg(pi, RADIO_2055_CORE2_TX_BB_MXGM, 0x20); in wlc_phy_txcal_radio_setup_nphy()
23747 and_radio_reg(pi, RADIO_2055_CORE1_TX_BB_MXGM, 0xdf); in wlc_phy_txcal_radio_setup_nphy()
23748 and_radio_reg(pi, RADIO_2055_CORE2_TX_BB_MXGM, 0xdf); in wlc_phy_txcal_radio_setup_nphy()
23753 static void wlc_phy_txcal_radio_cleanup_nphy(struct brcms_phy *pi) in wlc_phy_txcal_radio_cleanup_nphy() argument
23757 if (NREV_GE(pi->pubpi.phy_rev, 7)) { in wlc_phy_txcal_radio_cleanup_nphy()
23760 WRITE_RADIO_REG3(pi, RADIO_2057, TX, core, in wlc_phy_txcal_radio_cleanup_nphy()
23762 pi-> in wlc_phy_txcal_radio_cleanup_nphy()
23766 WRITE_RADIO_REG3(pi, RADIO_2057, TX, core, IQCAL_VCM_HG, in wlc_phy_txcal_radio_cleanup_nphy()
23767 pi-> in wlc_phy_txcal_radio_cleanup_nphy()
23771 WRITE_RADIO_REG3(pi, RADIO_2057, TX, core, IQCAL_IDAC, in wlc_phy_txcal_radio_cleanup_nphy()
23772 pi-> in wlc_phy_txcal_radio_cleanup_nphy()
23776 WRITE_RADIO_REG3(pi, RADIO_2057, TX, core, TSSI_VCM, in wlc_phy_txcal_radio_cleanup_nphy()
23777 pi-> in wlc_phy_txcal_radio_cleanup_nphy()
23781 WRITE_RADIO_REG3(pi, RADIO_2057, TX, core, TX_SSI_MUX, in wlc_phy_txcal_radio_cleanup_nphy()
23782 pi-> in wlc_phy_txcal_radio_cleanup_nphy()
23786 if (pi->pubpi.radiorev != 5) in wlc_phy_txcal_radio_cleanup_nphy()
23787 WRITE_RADIO_REG3(pi, RADIO_2057, TX, core, in wlc_phy_txcal_radio_cleanup_nphy()
23789 pi->tx_rx_cal_radio_saveregs in wlc_phy_txcal_radio_cleanup_nphy()
23792 WRITE_RADIO_REG3(pi, RADIO_2057, TX, core, TSSIG, in wlc_phy_txcal_radio_cleanup_nphy()
23793 pi-> in wlc_phy_txcal_radio_cleanup_nphy()
23797 WRITE_RADIO_REG3(pi, RADIO_2057, TX, core, TSSI_MISC1, in wlc_phy_txcal_radio_cleanup_nphy()
23798 pi-> in wlc_phy_txcal_radio_cleanup_nphy()
23802 } else if (NREV_GE(pi->pubpi.phy_rev, 3)) { in wlc_phy_txcal_radio_cleanup_nphy()
23807 write_radio_reg(pi, in wlc_phy_txcal_radio_cleanup_nphy()
23809 pi-> in wlc_phy_txcal_radio_cleanup_nphy()
23813 write_radio_reg(pi, in wlc_phy_txcal_radio_cleanup_nphy()
23815 pi-> in wlc_phy_txcal_radio_cleanup_nphy()
23819 write_radio_reg(pi, in wlc_phy_txcal_radio_cleanup_nphy()
23821 pi-> in wlc_phy_txcal_radio_cleanup_nphy()
23825 write_radio_reg(pi, RADIO_2056_TX_TSSI_VCM | jtag_core, in wlc_phy_txcal_radio_cleanup_nphy()
23826 pi-> in wlc_phy_txcal_radio_cleanup_nphy()
23830 write_radio_reg(pi, in wlc_phy_txcal_radio_cleanup_nphy()
23832 pi-> in wlc_phy_txcal_radio_cleanup_nphy()
23836 write_radio_reg(pi, in wlc_phy_txcal_radio_cleanup_nphy()
23838 pi-> in wlc_phy_txcal_radio_cleanup_nphy()
23842 write_radio_reg(pi, RADIO_2056_TX_TSSIA | jtag_core, in wlc_phy_txcal_radio_cleanup_nphy()
23843 pi-> in wlc_phy_txcal_radio_cleanup_nphy()
23847 write_radio_reg(pi, RADIO_2056_TX_TSSIG | jtag_core, in wlc_phy_txcal_radio_cleanup_nphy()
23848 pi-> in wlc_phy_txcal_radio_cleanup_nphy()
23852 write_radio_reg(pi, in wlc_phy_txcal_radio_cleanup_nphy()
23854 pi-> in wlc_phy_txcal_radio_cleanup_nphy()
23858 write_radio_reg(pi, in wlc_phy_txcal_radio_cleanup_nphy()
23860 pi-> in wlc_phy_txcal_radio_cleanup_nphy()
23864 write_radio_reg(pi, in wlc_phy_txcal_radio_cleanup_nphy()
23866 pi-> in wlc_phy_txcal_radio_cleanup_nphy()
23872 write_radio_reg(pi, RADIO_2055_CORE1_TXRF_IQCAL1, in wlc_phy_txcal_radio_cleanup_nphy()
23873 pi->tx_rx_cal_radio_saveregs[0]); in wlc_phy_txcal_radio_cleanup_nphy()
23874 write_radio_reg(pi, RADIO_2055_CORE1_TXRF_IQCAL2, in wlc_phy_txcal_radio_cleanup_nphy()
23875 pi->tx_rx_cal_radio_saveregs[1]); in wlc_phy_txcal_radio_cleanup_nphy()
23876 write_radio_reg(pi, RADIO_2055_CORE2_TXRF_IQCAL1, in wlc_phy_txcal_radio_cleanup_nphy()
23877 pi->tx_rx_cal_radio_saveregs[2]); in wlc_phy_txcal_radio_cleanup_nphy()
23878 write_radio_reg(pi, RADIO_2055_CORE2_TXRF_IQCAL2, in wlc_phy_txcal_radio_cleanup_nphy()
23879 pi->tx_rx_cal_radio_saveregs[3]); in wlc_phy_txcal_radio_cleanup_nphy()
23880 write_radio_reg(pi, RADIO_2055_PWRDET_RXTX_CORE1, in wlc_phy_txcal_radio_cleanup_nphy()
23881 pi->tx_rx_cal_radio_saveregs[4]); in wlc_phy_txcal_radio_cleanup_nphy()
23882 write_radio_reg(pi, RADIO_2055_PWRDET_RXTX_CORE2, in wlc_phy_txcal_radio_cleanup_nphy()
23883 pi->tx_rx_cal_radio_saveregs[5]); in wlc_phy_txcal_radio_cleanup_nphy()
23887 static void wlc_phy_txcal_physetup_nphy(struct brcms_phy *pi) in wlc_phy_txcal_physetup_nphy() argument
23891 if (NREV_GE(pi->pubpi.phy_rev, 3)) { in wlc_phy_txcal_physetup_nphy()
23892 pi->tx_rx_cal_phy_saveregs[0] = read_phy_reg(pi, 0xa6); in wlc_phy_txcal_physetup_nphy()
23893 pi->tx_rx_cal_phy_saveregs[1] = read_phy_reg(pi, 0xa7); in wlc_phy_txcal_physetup_nphy()
23898 mod_phy_reg(pi, 0xa6, mask, val); in wlc_phy_txcal_physetup_nphy()
23899 mod_phy_reg(pi, 0xa7, mask, val); in wlc_phy_txcal_physetup_nphy()
23901 val = read_phy_reg(pi, 0x8f); in wlc_phy_txcal_physetup_nphy()
23902 pi->tx_rx_cal_phy_saveregs[2] = val; in wlc_phy_txcal_physetup_nphy()
23904 write_phy_reg(pi, 0x8f, val); in wlc_phy_txcal_physetup_nphy()
23906 val = read_phy_reg(pi, 0xa5); in wlc_phy_txcal_physetup_nphy()
23907 pi->tx_rx_cal_phy_saveregs[3] = val; in wlc_phy_txcal_physetup_nphy()
23909 write_phy_reg(pi, 0xa5, val); in wlc_phy_txcal_physetup_nphy()
23911 pi->tx_rx_cal_phy_saveregs[4] = read_phy_reg(pi, 0x01); in wlc_phy_txcal_physetup_nphy()
23912 mod_phy_reg(pi, 0x01, (0x1 << 15), 0); in wlc_phy_txcal_physetup_nphy()
23914 wlc_phy_table_read_nphy(pi, NPHY_TBL_ID_AFECTRL, 1, 3, 16, in wlc_phy_txcal_physetup_nphy()
23916 pi->tx_rx_cal_phy_saveregs[5] = val; in wlc_phy_txcal_physetup_nphy()
23918 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 1, 3, 16, in wlc_phy_txcal_physetup_nphy()
23921 wlc_phy_table_read_nphy(pi, NPHY_TBL_ID_AFECTRL, 1, 19, 16, in wlc_phy_txcal_physetup_nphy()
23923 pi->tx_rx_cal_phy_saveregs[6] = val; in wlc_phy_txcal_physetup_nphy()
23925 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 1, 19, 16, in wlc_phy_txcal_physetup_nphy()
23928 pi->tx_rx_cal_phy_saveregs[7] = read_phy_reg(pi, 0x91); in wlc_phy_txcal_physetup_nphy()
23929 pi->tx_rx_cal_phy_saveregs[8] = read_phy_reg(pi, 0x92); in wlc_phy_txcal_physetup_nphy()
23931 if (!(pi->use_int_tx_iqlo_cal_nphy)) in wlc_phy_txcal_physetup_nphy()
23933 pi, in wlc_phy_txcal_physetup_nphy()
23941 pi, in wlc_phy_txcal_physetup_nphy()
23948 wlc_phy_rfctrlintc_override_nphy(pi, in wlc_phy_txcal_physetup_nphy()
23951 wlc_phy_rfctrlintc_override_nphy(pi, in wlc_phy_txcal_physetup_nphy()
23955 pi->tx_rx_cal_phy_saveregs[9] = read_phy_reg(pi, 0x297); in wlc_phy_txcal_physetup_nphy()
23956 pi->tx_rx_cal_phy_saveregs[10] = read_phy_reg(pi, 0x29b); in wlc_phy_txcal_physetup_nphy()
23957 mod_phy_reg(pi, (0 == PHY_CORE_0) ? 0x297 : in wlc_phy_txcal_physetup_nphy()
23960 mod_phy_reg(pi, (1 == PHY_CORE_0) ? 0x297 : in wlc_phy_txcal_physetup_nphy()
23963 if (NREV_IS(pi->pubpi.phy_rev, 7) in wlc_phy_txcal_physetup_nphy()
23964 || NREV_GE(pi->pubpi.phy_rev, 8)) in wlc_phy_txcal_physetup_nphy()
23966 pi, (0x1 << 7), in wlc_phy_txcal_physetup_nphy()
23968 (pi, in wlc_phy_txcal_physetup_nphy()
23972 if (pi->use_int_tx_iqlo_cal_nphy in wlc_phy_txcal_physetup_nphy()
23973 && !(pi->internal_tx_iqlo_cal_tapoff_intpa_nphy)) { in wlc_phy_txcal_physetup_nphy()
23975 if (NREV_IS(pi->pubpi.phy_rev, 7)) { in wlc_phy_txcal_physetup_nphy()
23977 mod_radio_reg(pi, RADIO_2057_OVR_REG0, 1 << 4, in wlc_phy_txcal_physetup_nphy()
23980 if (CHSPEC_IS2G(pi->radio_chanspec)) { in wlc_phy_txcal_physetup_nphy()
23982 pi, in wlc_phy_txcal_physetup_nphy()
23986 pi, in wlc_phy_txcal_physetup_nphy()
23991 pi, in wlc_phy_txcal_physetup_nphy()
23995 pi, in wlc_phy_txcal_physetup_nphy()
23999 } else if (NREV_GE(pi->pubpi.phy_rev, 8)) { in wlc_phy_txcal_physetup_nphy()
24001 pi, in wlc_phy_txcal_physetup_nphy()
24008 pi->tx_rx_cal_phy_saveregs[0] = read_phy_reg(pi, 0xa6); in wlc_phy_txcal_physetup_nphy()
24009 pi->tx_rx_cal_phy_saveregs[1] = read_phy_reg(pi, 0xa7); in wlc_phy_txcal_physetup_nphy()
24014 mod_phy_reg(pi, 0xa6, mask, val); in wlc_phy_txcal_physetup_nphy()
24015 mod_phy_reg(pi, 0xa7, mask, val); in wlc_phy_txcal_physetup_nphy()
24017 val = read_phy_reg(pi, 0xa5); in wlc_phy_txcal_physetup_nphy()
24018 pi->tx_rx_cal_phy_saveregs[2] = val; in wlc_phy_txcal_physetup_nphy()
24020 write_phy_reg(pi, 0xa5, val); in wlc_phy_txcal_physetup_nphy()
24022 wlc_phy_table_read_nphy(pi, NPHY_TBL_ID_AFECTRL, 1, 2, 16, in wlc_phy_txcal_physetup_nphy()
24024 pi->tx_rx_cal_phy_saveregs[3] = val; in wlc_phy_txcal_physetup_nphy()
24026 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 1, 2, 16, in wlc_phy_txcal_physetup_nphy()
24029 wlc_phy_table_read_nphy(pi, NPHY_TBL_ID_AFECTRL, 1, 18, 16, in wlc_phy_txcal_physetup_nphy()
24031 pi->tx_rx_cal_phy_saveregs[4] = val; in wlc_phy_txcal_physetup_nphy()
24033 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 1, 18, 16, in wlc_phy_txcal_physetup_nphy()
24036 pi->tx_rx_cal_phy_saveregs[5] = read_phy_reg(pi, 0x91); in wlc_phy_txcal_physetup_nphy()
24037 pi->tx_rx_cal_phy_saveregs[6] = read_phy_reg(pi, 0x92); in wlc_phy_txcal_physetup_nphy()
24038 val = CHSPEC_IS5G(pi->radio_chanspec) ? 0x180 : 0x120; in wlc_phy_txcal_physetup_nphy()
24039 write_phy_reg(pi, 0x91, val); in wlc_phy_txcal_physetup_nphy()
24040 write_phy_reg(pi, 0x92, val); in wlc_phy_txcal_physetup_nphy()
24044 static void wlc_phy_txcal_phycleanup_nphy(struct brcms_phy *pi) in wlc_phy_txcal_phycleanup_nphy() argument
24048 if (NREV_GE(pi->pubpi.phy_rev, 3)) { in wlc_phy_txcal_phycleanup_nphy()
24049 write_phy_reg(pi, 0xa6, pi->tx_rx_cal_phy_saveregs[0]); in wlc_phy_txcal_phycleanup_nphy()
24050 write_phy_reg(pi, 0xa7, pi->tx_rx_cal_phy_saveregs[1]); in wlc_phy_txcal_phycleanup_nphy()
24051 write_phy_reg(pi, 0x8f, pi->tx_rx_cal_phy_saveregs[2]); in wlc_phy_txcal_phycleanup_nphy()
24052 write_phy_reg(pi, 0xa5, pi->tx_rx_cal_phy_saveregs[3]); in wlc_phy_txcal_phycleanup_nphy()
24053 write_phy_reg(pi, 0x01, pi->tx_rx_cal_phy_saveregs[4]); in wlc_phy_txcal_phycleanup_nphy()
24055 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 1, 3, 16, in wlc_phy_txcal_phycleanup_nphy()
24056 &pi->tx_rx_cal_phy_saveregs[5]); in wlc_phy_txcal_phycleanup_nphy()
24057 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 1, 19, 16, in wlc_phy_txcal_phycleanup_nphy()
24058 &pi->tx_rx_cal_phy_saveregs[6]); in wlc_phy_txcal_phycleanup_nphy()
24060 write_phy_reg(pi, 0x91, pi->tx_rx_cal_phy_saveregs[7]); in wlc_phy_txcal_phycleanup_nphy()
24061 write_phy_reg(pi, 0x92, pi->tx_rx_cal_phy_saveregs[8]); in wlc_phy_txcal_phycleanup_nphy()
24063 write_phy_reg(pi, 0x297, pi->tx_rx_cal_phy_saveregs[9]); in wlc_phy_txcal_phycleanup_nphy()
24064 write_phy_reg(pi, 0x29b, pi->tx_rx_cal_phy_saveregs[10]); in wlc_phy_txcal_phycleanup_nphy()
24066 if (NREV_IS(pi->pubpi.phy_rev, 7) in wlc_phy_txcal_phycleanup_nphy()
24067 || NREV_GE(pi->pubpi.phy_rev, 8)) in wlc_phy_txcal_phycleanup_nphy()
24069 pi, (0x1 << 7), 0, 0, in wlc_phy_txcal_phycleanup_nphy()
24073 wlc_phy_resetcca_nphy(pi); in wlc_phy_txcal_phycleanup_nphy()
24075 if (pi->use_int_tx_iqlo_cal_nphy in wlc_phy_txcal_phycleanup_nphy()
24076 && !(pi->internal_tx_iqlo_cal_tapoff_intpa_nphy)) { in wlc_phy_txcal_phycleanup_nphy()
24078 if (NREV_IS(pi->pubpi.phy_rev, 7)) { in wlc_phy_txcal_phycleanup_nphy()
24079 if (CHSPEC_IS2G(pi->radio_chanspec)) { in wlc_phy_txcal_phycleanup_nphy()
24081 pi, in wlc_phy_txcal_phycleanup_nphy()
24085 pi, in wlc_phy_txcal_phycleanup_nphy()
24090 pi, in wlc_phy_txcal_phycleanup_nphy()
24094 pi, in wlc_phy_txcal_phycleanup_nphy()
24099 mod_radio_reg(pi, RADIO_2057_OVR_REG0, 1 << 4, in wlc_phy_txcal_phycleanup_nphy()
24101 } else if (NREV_GE(pi->pubpi.phy_rev, 8)) { in wlc_phy_txcal_phycleanup_nphy()
24103 pi, in wlc_phy_txcal_phycleanup_nphy()
24111 mod_phy_reg(pi, 0xa6, mask, pi->tx_rx_cal_phy_saveregs[0]); in wlc_phy_txcal_phycleanup_nphy()
24112 mod_phy_reg(pi, 0xa7, mask, pi->tx_rx_cal_phy_saveregs[1]); in wlc_phy_txcal_phycleanup_nphy()
24113 write_phy_reg(pi, 0xa5, pi->tx_rx_cal_phy_saveregs[2]); in wlc_phy_txcal_phycleanup_nphy()
24115 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 1, 2, 16, in wlc_phy_txcal_phycleanup_nphy()
24116 &pi->tx_rx_cal_phy_saveregs[3]); in wlc_phy_txcal_phycleanup_nphy()
24118 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 1, 18, 16, in wlc_phy_txcal_phycleanup_nphy()
24119 &pi->tx_rx_cal_phy_saveregs[4]); in wlc_phy_txcal_phycleanup_nphy()
24121 write_phy_reg(pi, 0x91, pi->tx_rx_cal_phy_saveregs[5]); in wlc_phy_txcal_phycleanup_nphy()
24122 write_phy_reg(pi, 0x92, pi->tx_rx_cal_phy_saveregs[6]); in wlc_phy_txcal_phycleanup_nphy()
24127 wlc_phy_est_tonepwr_nphy(struct brcms_phy *pi, s32 *qdBm_pwrbuf, u8 num_samps) in wlc_phy_est_tonepwr_nphy() argument
24136 tssi_reg = read_phy_reg(pi, 0x1e9); in wlc_phy_est_tonepwr_nphy()
24145 CHSPEC_IS5G(pi->radio_chanspec) ? in wlc_phy_est_tonepwr_nphy()
24148 wlc_phy_poll_rssi_nphy(pi, tssi_type, rssi_buf, num_samps); in wlc_phy_est_tonepwr_nphy()
24166 wlc_phy_table_read_nphy(pi, NPHY_TBL_ID_CORE1TXPWRCTL, 1, in wlc_phy_est_tonepwr_nphy()
24168 wlc_phy_table_read_nphy(pi, NPHY_TBL_ID_CORE2TXPWRCTL, 1, in wlc_phy_est_tonepwr_nphy()
24172 static void wlc_phy_update_txcal_ladder_nphy(struct brcms_phy *pi, u16 core) in wlc_phy_update_txcal_ladder_nphy() argument
24192 ((pi->nphy_txcal_bbmult >> 8) & 0xff) : in wlc_phy_update_txcal_ladder_nphy()
24193 (pi->nphy_txcal_bbmult & 0xff); in wlc_phy_update_txcal_ladder_nphy()
24201 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_IQLOCAL, 1, index, 16, in wlc_phy_update_txcal_ladder_nphy()
24209 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_IQLOCAL, 1, index + 32, in wlc_phy_update_txcal_ladder_nphy()
24214 static u8 wlc_phy_txpwr_idx_cur_get_nphy(struct brcms_phy *pi, u8 core) in wlc_phy_txpwr_idx_cur_get_nphy() argument
24217 tmp = read_phy_reg(pi, ((core == PHY_CORE_0) ? 0x1ed : 0x1ee)); in wlc_phy_txpwr_idx_cur_get_nphy()
24224 wlc_phy_txpwr_idx_cur_set_nphy(struct brcms_phy *pi, u8 idx0, u8 idx1) in wlc_phy_txpwr_idx_cur_set_nphy() argument
24226 mod_phy_reg(pi, 0x1e7, (0x7f << 0), idx0); in wlc_phy_txpwr_idx_cur_set_nphy()
24228 if (NREV_GT(pi->pubpi.phy_rev, 1)) in wlc_phy_txpwr_idx_cur_set_nphy()
24229 mod_phy_reg(pi, 0x222, (0xff << 0), idx1); in wlc_phy_txpwr_idx_cur_set_nphy()
24232 static u16 wlc_phy_ipa_get_bbmult_nphy(struct brcms_phy *pi) in wlc_phy_ipa_get_bbmult_nphy() argument
24236 wlc_phy_table_read_nphy(pi, 15, 1, 87, 16, &m0m1); in wlc_phy_ipa_get_bbmult_nphy()
24241 static void wlc_phy_ipa_set_bbmult_nphy(struct brcms_phy *pi, u8 m0, u8 m1) in wlc_phy_ipa_set_bbmult_nphy() argument
24245 wlc_phy_table_write_nphy(pi, 15, 1, 87, 16, &m0m1); in wlc_phy_ipa_set_bbmult_nphy()
24246 wlc_phy_table_write_nphy(pi, 15, 1, 95, 16, &m0m1); in wlc_phy_ipa_set_bbmult_nphy()
24250 wlc_phy_papd_cal_setup_nphy(struct brcms_phy *pi, in wlc_phy_papd_cal_setup_nphy() argument
24258 if (NREV_GE(pi->pubpi.phy_rev, 7)) { in wlc_phy_papd_cal_setup_nphy()
24260 if (NREV_IS(pi->pubpi.phy_rev, 7) in wlc_phy_papd_cal_setup_nphy()
24261 || NREV_GE(pi->pubpi.phy_rev, 8)) in wlc_phy_papd_cal_setup_nphy()
24263 pi, (0x1 << 7), in wlc_phy_papd_cal_setup_nphy()
24265 (pi, in wlc_phy_papd_cal_setup_nphy()
24269 if (CHSPEC_IS2G(pi->radio_chanspec)) { in wlc_phy_papd_cal_setup_nphy()
24270 if (pi->pubpi.radiorev == 5) in wlc_phy_papd_cal_setup_nphy()
24272 else if ((pi->pubpi.radiorev == 7) in wlc_phy_papd_cal_setup_nphy()
24273 || (pi->pubpi.radiorev == 8)) in wlc_phy_papd_cal_setup_nphy()
24275 else if ((pi->pubpi.radiorev <= 4) in wlc_phy_papd_cal_setup_nphy()
24276 || (pi->pubpi.radiorev == 6)) in wlc_phy_papd_cal_setup_nphy()
24279 if ((pi->pubpi.radiorev == 4) || in wlc_phy_papd_cal_setup_nphy()
24280 (pi->pubpi.radiorev == 6)) in wlc_phy_papd_cal_setup_nphy()
24282 else if ((pi->pubpi.radiorev == 3) in wlc_phy_papd_cal_setup_nphy()
24283 || (pi->pubpi.radiorev == 7) in wlc_phy_papd_cal_setup_nphy()
24284 || (pi->pubpi.radiorev == 8)) in wlc_phy_papd_cal_setup_nphy()
24288 wlc_phy_rfctrl_override_nphy_rev7(pi, (0x1 << 11), in wlc_phy_papd_cal_setup_nphy()
24293 pi, in wlc_phy_papd_cal_setup_nphy()
24297 pi, in wlc_phy_papd_cal_setup_nphy()
24301 wlc_phy_rfctrl_override_nphy_rev7(pi, (0x1 << 3), in wlc_phy_papd_cal_setup_nphy()
24304 wlc_phy_rfctrl_override_nphy_rev7(pi, (0x1 << 2), 1, in wlc_phy_papd_cal_setup_nphy()
24307 wlc_phy_rfctrl_override_nphy_rev7(pi, (0x1 << 0), 0, in wlc_phy_papd_cal_setup_nphy()
24310 wlc_phy_rfctrl_override_nphy_rev7(pi, (0x1 << 1), 1, in wlc_phy_papd_cal_setup_nphy()
24313 wlc_phy_rfctrl_override_nphy_rev7(pi, (0x1 << 8), 0, in wlc_phy_papd_cal_setup_nphy()
24316 wlc_phy_rfctrl_override_nphy_rev7(pi, (0x1 << 9), 1, in wlc_phy_papd_cal_setup_nphy()
24319 wlc_phy_rfctrl_override_nphy_rev7(pi, (0x1 << 10), 0, in wlc_phy_papd_cal_setup_nphy()
24322 wlc_phy_rfctrl_override_nphy_rev7(pi, (0x1 << 3), 1, in wlc_phy_papd_cal_setup_nphy()
24326 wlc_phy_rfctrl_override_nphy_rev7(pi, (0x1 << 5), in wlc_phy_papd_cal_setup_nphy()
24329 wlc_phy_rfctrl_override_nphy_rev7(pi, (0x1 << 4), 0, in wlc_phy_papd_cal_setup_nphy()
24333 state->afectrl[core] = read_phy_reg(pi, (core == PHY_CORE_0) ? in wlc_phy_papd_cal_setup_nphy()
24336 read_phy_reg(pi, (core == PHY_CORE_0) ? 0x8f : 0xa5); in wlc_phy_papd_cal_setup_nphy()
24338 read_phy_reg(pi, (core == PHY_CORE_0) ? 0xa7 : 0xa6); in wlc_phy_papd_cal_setup_nphy()
24340 read_phy_reg(pi, (core == PHY_CORE_0) ? 0xa5 : 0x8f); in wlc_phy_papd_cal_setup_nphy()
24342 mod_phy_reg(pi, ((core == PHY_CORE_0) ? 0xa6 : 0xa7), in wlc_phy_papd_cal_setup_nphy()
24344 mod_phy_reg(pi, ((core == PHY_CORE_0) ? 0x8f : in wlc_phy_papd_cal_setup_nphy()
24347 mod_phy_reg(pi, ((core == PHY_CORE_0) ? 0xa7 : 0xa6), in wlc_phy_papd_cal_setup_nphy()
24349 mod_phy_reg(pi, ((core == PHY_CORE_0) ? 0xa5 : in wlc_phy_papd_cal_setup_nphy()
24352 if (CHSPEC_IS2G(pi->radio_chanspec)) { in wlc_phy_papd_cal_setup_nphy()
24354 READ_RADIO_REG3(pi, RADIO_2057, TX, core, in wlc_phy_papd_cal_setup_nphy()
24357 READ_RADIO_REG3(pi, RADIO_2057, TX, core, in wlc_phy_papd_cal_setup_nphy()
24360 READ_RADIO_REG3(pi, RADIO_2057, TX, off_core, in wlc_phy_papd_cal_setup_nphy()
24363 READ_RADIO_REG3(pi, RADIO_2057, TX, off_core, in wlc_phy_papd_cal_setup_nphy()
24366 WRITE_RADIO_REG3(pi, RADIO_2057, TX, core, in wlc_phy_papd_cal_setup_nphy()
24369 if ((pi->pubpi.radiorev == 3) || in wlc_phy_papd_cal_setup_nphy()
24370 (pi->pubpi.radiorev == 4) || in wlc_phy_papd_cal_setup_nphy()
24371 (pi->pubpi.radiorev == 6)) in wlc_phy_papd_cal_setup_nphy()
24372 WRITE_RADIO_REG3(pi, RADIO_2057, TX, core, in wlc_phy_papd_cal_setup_nphy()
24374 else if (pi->pubpi.radiorev == 5) in wlc_phy_papd_cal_setup_nphy()
24375 WRITE_RADIO_REG3(pi, RADIO_2057, TX, core, in wlc_phy_papd_cal_setup_nphy()
24378 else if ((pi->pubpi.radiorev == 7) in wlc_phy_papd_cal_setup_nphy()
24379 || (pi->pubpi.radiorev == 8)) in wlc_phy_papd_cal_setup_nphy()
24380 WRITE_RADIO_REG3(pi, RADIO_2057, TX, core, in wlc_phy_papd_cal_setup_nphy()
24383 WRITE_RADIO_REG3(pi, RADIO_2057, TX, off_core, in wlc_phy_papd_cal_setup_nphy()
24385 WRITE_RADIO_REG3(pi, RADIO_2057, TX, off_core, in wlc_phy_papd_cal_setup_nphy()
24389 READ_RADIO_REG3(pi, RADIO_2057, TX, core, in wlc_phy_papd_cal_setup_nphy()
24392 READ_RADIO_REG3(pi, RADIO_2057, TX, core, in wlc_phy_papd_cal_setup_nphy()
24395 READ_RADIO_REG3(pi, RADIO_2057, TX, off_core, in wlc_phy_papd_cal_setup_nphy()
24398 READ_RADIO_REG3(pi, RADIO_2057, TX, off_core, in wlc_phy_papd_cal_setup_nphy()
24401 WRITE_RADIO_REG3(pi, RADIO_2057, TX, core, in wlc_phy_papd_cal_setup_nphy()
24404 if ((pi->pubpi.radiorev == 7) in wlc_phy_papd_cal_setup_nphy()
24405 || (pi->pubpi.radiorev == 8)) in wlc_phy_papd_cal_setup_nphy()
24406 WRITE_RADIO_REG3(pi, RADIO_2057, TX, core, in wlc_phy_papd_cal_setup_nphy()
24410 WRITE_RADIO_REG3(pi, RADIO_2057, TX, core, in wlc_phy_papd_cal_setup_nphy()
24413 WRITE_RADIO_REG3(pi, RADIO_2057, TX, off_core, in wlc_phy_papd_cal_setup_nphy()
24415 WRITE_RADIO_REG3(pi, RADIO_2057, TX, off_core, in wlc_phy_papd_cal_setup_nphy()
24421 wlc_phy_tx_tone_nphy(pi, tone_freq, 181, 0, 0, false); in wlc_phy_papd_cal_setup_nphy()
24423 mod_phy_reg(pi, (core == PHY_CORE_0) ? 0x297 : in wlc_phy_papd_cal_setup_nphy()
24426 mod_phy_reg(pi, (core == PHY_CORE_0) ? 0x2a3 : in wlc_phy_papd_cal_setup_nphy()
24429 mod_phy_reg(pi, (off_core == PHY_CORE_0) ? 0x297 : in wlc_phy_papd_cal_setup_nphy()
24432 mod_phy_reg(pi, (off_core == PHY_CORE_0) ? 0x2a3 : in wlc_phy_papd_cal_setup_nphy()
24437 wlc_phy_rfctrl_override_nphy(pi, (0x1 << 12), 0, 0x3, 0); in wlc_phy_papd_cal_setup_nphy()
24439 wlc_phy_rfctrl_override_nphy(pi, (0x1 << 3), 1, 0, 0); in wlc_phy_papd_cal_setup_nphy()
24441 wlc_phy_rfctrl_override_nphy(pi, (0x1 << 0), 0, 0x3, 0); in wlc_phy_papd_cal_setup_nphy()
24443 wlc_phy_rfctrl_override_nphy(pi, (0x1 << 2), 1, 0x3, 0); in wlc_phy_papd_cal_setup_nphy()
24444 wlc_phy_rfctrl_override_nphy(pi, (0x1 << 1), 1, 0x3, 0); in wlc_phy_papd_cal_setup_nphy()
24446 state->afectrl[core] = read_phy_reg(pi, (core == PHY_CORE_0) ? in wlc_phy_papd_cal_setup_nphy()
24449 read_phy_reg(pi, (core == PHY_CORE_0) ? 0x8f : 0xa5); in wlc_phy_papd_cal_setup_nphy()
24451 mod_phy_reg(pi, ((core == PHY_CORE_0) ? 0xa6 : 0xa7), in wlc_phy_papd_cal_setup_nphy()
24453 mod_phy_reg(pi, ((core == PHY_CORE_0) ? 0x8f : in wlc_phy_papd_cal_setup_nphy()
24460 READ_RADIO_REG2(pi, RADIO_2056, RX, core, VGA_MASTER); in wlc_phy_papd_cal_setup_nphy()
24461 WRITE_RADIO_REG2(pi, RADIO_2056, RX, core, VGA_MASTER, 0x2b); in wlc_phy_papd_cal_setup_nphy()
24462 if (CHSPEC_IS2G(pi->radio_chanspec)) { in wlc_phy_papd_cal_setup_nphy()
24464 READ_RADIO_REG2(pi, RADIO_2056, RX, core, in wlc_phy_papd_cal_setup_nphy()
24467 READ_RADIO_REG2(pi, RADIO_2056, TX, core, in wlc_phy_papd_cal_setup_nphy()
24470 WRITE_RADIO_REG2(pi, RADIO_2056, RX, core, TXFBMIX_G, in wlc_phy_papd_cal_setup_nphy()
24472 WRITE_RADIO_REG2(pi, RADIO_2056, TX, core, in wlc_phy_papd_cal_setup_nphy()
24476 READ_RADIO_REG2(pi, RADIO_2056, RX, core, in wlc_phy_papd_cal_setup_nphy()
24479 READ_RADIO_REG2(pi, RADIO_2056, TX, core, in wlc_phy_papd_cal_setup_nphy()
24482 WRITE_RADIO_REG2(pi, RADIO_2056, RX, core, TXFBMIX_A, in wlc_phy_papd_cal_setup_nphy()
24484 WRITE_RADIO_REG2(pi, RADIO_2056, TX, core, in wlc_phy_papd_cal_setup_nphy()
24491 wlc_phy_tx_tone_nphy(pi, tone_freq, 181, 0, 0, false); in wlc_phy_papd_cal_setup_nphy()
24493 mod_phy_reg(pi, (core == PHY_CORE_0) ? 0x297 : in wlc_phy_papd_cal_setup_nphy()
24496 mod_phy_reg(pi, (off_core == PHY_CORE_0) ? 0x297 : in wlc_phy_papd_cal_setup_nphy()
24499 wlc_phy_rfctrl_override_nphy(pi, (0x1 << 3), 0, 0x3, 0); in wlc_phy_papd_cal_setup_nphy()
24504 wlc_phy_papd_cal_cleanup_nphy(struct brcms_phy *pi, in wlc_phy_papd_cal_cleanup_nphy() argument
24509 wlc_phy_stopplayback_nphy(pi); in wlc_phy_papd_cal_cleanup_nphy()
24511 if (NREV_GE(pi->pubpi.phy_rev, 7)) { in wlc_phy_papd_cal_cleanup_nphy()
24513 for (core = 0; core < pi->pubpi.phy_corenum; core++) { in wlc_phy_papd_cal_cleanup_nphy()
24515 if (CHSPEC_IS2G(pi->radio_chanspec)) { in wlc_phy_papd_cal_cleanup_nphy()
24516 WRITE_RADIO_REG3(pi, RADIO_2057, TX, core, in wlc_phy_papd_cal_cleanup_nphy()
24518 WRITE_RADIO_REG3(pi, RADIO_2057, TX, core, in wlc_phy_papd_cal_cleanup_nphy()
24522 WRITE_RADIO_REG3(pi, RADIO_2057, TX, core, in wlc_phy_papd_cal_cleanup_nphy()
24524 WRITE_RADIO_REG3(pi, RADIO_2057, TX, core, in wlc_phy_papd_cal_cleanup_nphy()
24530 if ((pi->pubpi.radiorev == 4) || (pi->pubpi.radiorev == 6)) in wlc_phy_papd_cal_cleanup_nphy()
24532 pi, (0x1 << 2), in wlc_phy_papd_cal_cleanup_nphy()
24537 pi, (0x1 << 2), in wlc_phy_papd_cal_cleanup_nphy()
24541 wlc_phy_rfctrl_override_nphy_rev7(pi, (0x1 << 1), in wlc_phy_papd_cal_cleanup_nphy()
24544 wlc_phy_rfctrl_override_nphy_rev7(pi, (0x1 << 0), 0, 0x3, 1, in wlc_phy_papd_cal_cleanup_nphy()
24546 wlc_phy_rfctrl_override_nphy_rev7(pi, (0x1 << 2), 0, 0x3, 1, in wlc_phy_papd_cal_cleanup_nphy()
24548 wlc_phy_rfctrl_override_nphy_rev7(pi, (0x1 << 11), 1, 0x3, 1, in wlc_phy_papd_cal_cleanup_nphy()
24550 wlc_phy_rfctrl_override_nphy_rev7(pi, (0x1 << 3), 0, 0x3, 1, in wlc_phy_papd_cal_cleanup_nphy()
24552 wlc_phy_rfctrl_override_nphy_rev7(pi, (0x1 << 11), 0, 0x3, 1, in wlc_phy_papd_cal_cleanup_nphy()
24554 wlc_phy_rfctrl_override_nphy_rev7(pi, (0x1 << 12), 0, 0x3, 1, in wlc_phy_papd_cal_cleanup_nphy()
24556 wlc_phy_rfctrl_override_nphy_rev7(pi, (0x1 << 2), 1, 0x3, 1, in wlc_phy_papd_cal_cleanup_nphy()
24558 wlc_phy_rfctrl_override_nphy_rev7(pi, (0x1 << 0), 0, 0x3, 1, in wlc_phy_papd_cal_cleanup_nphy()
24560 wlc_phy_rfctrl_override_nphy_rev7(pi, (0x1 << 1), 1, 0x3, 1, in wlc_phy_papd_cal_cleanup_nphy()
24562 wlc_phy_rfctrl_override_nphy_rev7(pi, (0x1 << 8), 0, 0x3, 1, in wlc_phy_papd_cal_cleanup_nphy()
24564 wlc_phy_rfctrl_override_nphy_rev7(pi, (0x1 << 9), 1, 0x3, 1, in wlc_phy_papd_cal_cleanup_nphy()
24566 wlc_phy_rfctrl_override_nphy_rev7(pi, (0x1 << 10), 0, 0x3, 1, in wlc_phy_papd_cal_cleanup_nphy()
24568 wlc_phy_rfctrl_override_nphy_rev7(pi, (0x1 << 3), 1, 0x3, 1, in wlc_phy_papd_cal_cleanup_nphy()
24570 wlc_phy_rfctrl_override_nphy_rev7(pi, (0x1 << 5), 0, 0x3, 1, in wlc_phy_papd_cal_cleanup_nphy()
24572 wlc_phy_rfctrl_override_nphy_rev7(pi, (0x1 << 4), 0, 0x3, 1, in wlc_phy_papd_cal_cleanup_nphy()
24575 for (core = 0; core < pi->pubpi.phy_corenum; core++) { in wlc_phy_papd_cal_cleanup_nphy()
24577 write_phy_reg(pi, (core == PHY_CORE_0) ? in wlc_phy_papd_cal_cleanup_nphy()
24579 write_phy_reg(pi, (core == PHY_CORE_0) ? 0x8f : in wlc_phy_papd_cal_cleanup_nphy()
24583 wlc_phy_ipa_set_bbmult_nphy(pi, (state->mm >> 8) & 0xff, in wlc_phy_papd_cal_cleanup_nphy()
24586 if (NREV_IS(pi->pubpi.phy_rev, 7) in wlc_phy_papd_cal_cleanup_nphy()
24587 || NREV_GE(pi->pubpi.phy_rev, 8)) in wlc_phy_papd_cal_cleanup_nphy()
24589 pi, (0x1 << 7), 0, 0, in wlc_phy_papd_cal_cleanup_nphy()
24593 wlc_phy_rfctrl_override_nphy(pi, (0x1 << 12), 0, 0x3, 1); in wlc_phy_papd_cal_cleanup_nphy()
24594 wlc_phy_rfctrl_override_nphy(pi, (0x1 << 13), 0, 0x3, 1); in wlc_phy_papd_cal_cleanup_nphy()
24595 wlc_phy_rfctrl_override_nphy(pi, (0x1 << 0), 0, 0x3, 1); in wlc_phy_papd_cal_cleanup_nphy()
24597 wlc_phy_rfctrl_override_nphy(pi, (0x1 << 2), 0, 0x3, 1); in wlc_phy_papd_cal_cleanup_nphy()
24598 wlc_phy_rfctrl_override_nphy(pi, (0x1 << 1), 0, 0x3, 1); in wlc_phy_papd_cal_cleanup_nphy()
24600 for (core = 0; core < pi->pubpi.phy_corenum; core++) { in wlc_phy_papd_cal_cleanup_nphy()
24602 WRITE_RADIO_REG2(pi, RADIO_2056, RX, core, VGA_MASTER, in wlc_phy_papd_cal_cleanup_nphy()
24604 if (CHSPEC_IS2G(pi->radio_chanspec)) { in wlc_phy_papd_cal_cleanup_nphy()
24605 WRITE_RADIO_REG2(pi, RADIO_2056, RX, core, in wlc_phy_papd_cal_cleanup_nphy()
24607 WRITE_RADIO_REG2(pi, RADIO_2056, TX, core, in wlc_phy_papd_cal_cleanup_nphy()
24611 WRITE_RADIO_REG2(pi, RADIO_2056, RX, core, in wlc_phy_papd_cal_cleanup_nphy()
24613 WRITE_RADIO_REG2(pi, RADIO_2056, TX, core, in wlc_phy_papd_cal_cleanup_nphy()
24618 write_phy_reg(pi, (core == PHY_CORE_0) ? in wlc_phy_papd_cal_cleanup_nphy()
24620 write_phy_reg(pi, (core == PHY_CORE_0) ? 0x8f : in wlc_phy_papd_cal_cleanup_nphy()
24624 wlc_phy_ipa_set_bbmult_nphy(pi, (state->mm >> 8) & 0xff, in wlc_phy_papd_cal_cleanup_nphy()
24627 wlc_phy_rfctrl_override_nphy(pi, (0x1 << 3), 0, 0x3, 1); in wlc_phy_papd_cal_cleanup_nphy()
24632 wlc_phy_a1_nphy(struct brcms_phy *pi, u8 core, u32 winsz, u32 start, in wlc_phy_a1_nphy() argument
24646 wlc_phy_table_read_nphy(pi, in wlc_phy_a1_nphy()
24675 wlc_phy_table_write_nphy(pi, in wlc_phy_a1_nphy()
24684 wlc_phy_a2_nphy(struct brcms_phy *pi, struct nphy_ipa_txcalgains *txgains, in wlc_phy_a2_nphy() argument
24693 if (NREV_LT(pi->pubpi.phy_rev, 3)) in wlc_phy_a2_nphy()
24698 if (NREV_GE(pi->pubpi.phy_rev, 7)) { in wlc_phy_a2_nphy()
24700 phy_a9 = wlc_phy_get_tx_gain_nphy(pi); in wlc_phy_a2_nphy()
24702 if (CHSPEC_IS2G(pi->radio_chanspec)) in wlc_phy_a2_nphy()
24715 pi, in wlc_phy_a2_nphy()
24719 if (CHSPEC_IS2G(pi->radio_chanspec)) { in wlc_phy_a2_nphy()
24720 if ((pi->pubpi.radiorev <= 4) in wlc_phy_a2_nphy()
24721 || (pi->pubpi.radiorev == 6)) in wlc_phy_a2_nphy()
24722 m[core] = (pi->bw == WL_CHANSPEC_BW_40) ? in wlc_phy_a2_nphy()
24725 m[core] = (pi->bw == WL_CHANSPEC_BW_40) ? in wlc_phy_a2_nphy()
24728 m[core] = (pi->bw == WL_CHANSPEC_BW_40) ? 75 : 107; in wlc_phy_a2_nphy()
24732 wlc_phy_ipa_set_bbmult_nphy(pi, m[0], m[1]); in wlc_phy_a2_nphy()
24736 if (CHSPEC_IS2G(pi->radio_chanspec)) { in wlc_phy_a2_nphy()
24737 if ((pi->pubpi.radiorev == 4) in wlc_phy_a2_nphy()
24738 || (pi->pubpi.radiorev == 6)) { in wlc_phy_a2_nphy()
24746 if ((pi->pubpi.radiorev == 5) in wlc_phy_a2_nphy()
24747 || (pi->pubpi.radiorev == 7) in wlc_phy_a2_nphy()
24748 || (pi->pubpi.radiorev == 8)) { in wlc_phy_a2_nphy()
24758 if ((pi->pubpi.radiorev == 5) in wlc_phy_a2_nphy()
24759 && (CHSPEC_IS2G(pi->radio_chanspec))) in wlc_phy_a2_nphy()
24761 else if (((pi->pubpi.radiorev == 7) && in wlc_phy_a2_nphy()
24762 (CHSPEC_IS2G(pi->radio_chanspec))) || in wlc_phy_a2_nphy()
24763 ((pi->pubpi.radiorev == 8) && in wlc_phy_a2_nphy()
24764 (CHSPEC_IS2G(pi->radio_chanspec)))) in wlc_phy_a2_nphy()
24775 mod_phy_reg(pi, (core == PHY_CORE_0) ? 0x297 : in wlc_phy_a2_nphy()
24778 mod_phy_reg(pi, (phy_a7 == PHY_CORE_0) ? 0x297 : in wlc_phy_a2_nphy()
24781 mod_phy_reg(pi, (core == PHY_CORE_0) ? 0x2a3 : in wlc_phy_a2_nphy()
24784 mod_phy_reg(pi, (phy_a7 == PHY_CORE_0) ? 0x2a3 : in wlc_phy_a2_nphy()
24787 write_phy_reg(pi, 0x2a1, 0x80); in wlc_phy_a2_nphy()
24788 write_phy_reg(pi, 0x2a2, 0x100); in wlc_phy_a2_nphy()
24790 mod_phy_reg(pi, (core == PHY_CORE_0) ? 0x2a3 : in wlc_phy_a2_nphy()
24793 mod_phy_reg(pi, (core == PHY_CORE_0) ? 0x2a3 : in wlc_phy_a2_nphy()
24796 mod_phy_reg(pi, (core == PHY_CORE_0) ? 0x2a3 : in wlc_phy_a2_nphy()
24799 write_phy_reg(pi, 0x2e5, 0x20); in wlc_phy_a2_nphy()
24801 mod_phy_reg(pi, 0x2a0, (0x3f << 0), (phy_a3) << 0); in wlc_phy_a2_nphy()
24803 mod_phy_reg(pi, 0x29f, (0x3f << 0), (phy_a1) << 0); in wlc_phy_a2_nphy()
24805 mod_phy_reg(pi, 0x29f, (0x3f << 8), (phy_a2) << 8); in wlc_phy_a2_nphy()
24807 wlc_phy_rfctrl_override_nphy_rev7(pi, (0x1 << 3), in wlc_phy_a2_nphy()
24810 wlc_phy_rfctrl_override_nphy_rev7(pi, (0x1 << 3), in wlc_phy_a2_nphy()
24814 write_phy_reg(pi, 0x2be, 1); in wlc_phy_a2_nphy()
24815 SPINWAIT(read_phy_reg(pi, 0x2be), 10 * 1000 * 1000); in wlc_phy_a2_nphy()
24817 wlc_phy_rfctrl_override_nphy_rev7(pi, (0x1 << 3), in wlc_phy_a2_nphy()
24821 wlc_phy_table_write_nphy(pi, in wlc_phy_a2_nphy()
24828 if (CHSPEC_IS5G(pi->radio_chanspec)) in wlc_phy_a2_nphy()
24829 wlc_phy_a1_nphy(pi, core, 5, 0, 35); in wlc_phy_a2_nphy()
24833 pi, in wlc_phy_a2_nphy()
24842 if (CHSPEC_IS2G(pi->radio_chanspec)) { in wlc_phy_a2_nphy()
24843 if (NREV_GE(pi->pubpi.phy_rev, 6) && in wlc_phy_a2_nphy()
24844 pi->sh->chip == BCMA_CHIP_ID_BCM47162) { in wlc_phy_a2_nphy()
24846 } else if (NREV_GE(pi->pubpi.phy_rev, 6)) { in wlc_phy_a2_nphy()
24848 } else if (NREV_IS(pi->pubpi.phy_rev, 5)) { in wlc_phy_a2_nphy()
24856 wlc_phy_rfctrl_override_nphy(pi, in wlc_phy_a2_nphy()
24861 wlc_phy_rfctrl_override_nphy(pi, in wlc_phy_a2_nphy()
24868 if (CHSPEC_IS2G(pi->radio_chanspec)) in wlc_phy_a2_nphy()
24869 m[core] = (pi->bw == WL_CHANSPEC_BW_40) ? 45 : 64; in wlc_phy_a2_nphy()
24871 m[core] = (pi->bw == WL_CHANSPEC_BW_40) ? 75 : 107; in wlc_phy_a2_nphy()
24874 wlc_phy_ipa_set_bbmult_nphy(pi, m[0], m[1]); in wlc_phy_a2_nphy()
24893 mod_phy_reg(pi, (core == PHY_CORE_0) ? 0x297 : in wlc_phy_a2_nphy()
24896 mod_phy_reg(pi, (phy_a7 == PHY_CORE_0) ? 0x297 : in wlc_phy_a2_nphy()
24899 if (NREV_GE(pi->pubpi.phy_rev, 6)) { in wlc_phy_a2_nphy()
24900 mod_phy_reg(pi, (core == PHY_CORE_0) ? 0x2a3 : in wlc_phy_a2_nphy()
24903 mod_phy_reg(pi, (phy_a7 == PHY_CORE_0) ? 0x2a3 : in wlc_phy_a2_nphy()
24906 write_phy_reg(pi, 0x2a1, 0x20); in wlc_phy_a2_nphy()
24907 write_phy_reg(pi, 0x2a2, 0x60); in wlc_phy_a2_nphy()
24909 mod_phy_reg(pi, (core == PHY_CORE_0) ? 0x2a3 : in wlc_phy_a2_nphy()
24912 mod_phy_reg(pi, (core == PHY_CORE_0) ? 0x2a3 : in wlc_phy_a2_nphy()
24915 mod_phy_reg(pi, (core == PHY_CORE_0) ? 0x2a3 : in wlc_phy_a2_nphy()
24918 write_phy_reg(pi, 0x2e5, 0x20); in wlc_phy_a2_nphy()
24920 mod_phy_reg(pi, (core == PHY_CORE_0) ? 0x2a3 : in wlc_phy_a2_nphy()
24923 mod_phy_reg(pi, (phy_a7 == PHY_CORE_0) ? 0x2a3 : in wlc_phy_a2_nphy()
24926 write_phy_reg(pi, 0x2a1, 0x80); in wlc_phy_a2_nphy()
24927 write_phy_reg(pi, 0x2a2, 0x600); in wlc_phy_a2_nphy()
24929 mod_phy_reg(pi, (core == PHY_CORE_0) ? 0x2a3 : in wlc_phy_a2_nphy()
24932 mod_phy_reg(pi, (core == PHY_CORE_0) ? 0x2a3 : in wlc_phy_a2_nphy()
24935 mod_phy_reg(pi, (core == PHY_CORE_0) ? 0x2a3 : in wlc_phy_a2_nphy()
24938 mod_phy_reg(pi, 0x2a0, (0x3f << 8), (0x20) << 8); in wlc_phy_a2_nphy()
24942 mod_phy_reg(pi, 0x2a0, (0x3f << 0), (phy_a3) << 0); in wlc_phy_a2_nphy()
24944 mod_phy_reg(pi, 0x29f, (0x3f << 0), (phy_a1) << 0); in wlc_phy_a2_nphy()
24946 mod_phy_reg(pi, 0x29f, (0x3f << 8), (phy_a2) << 8); in wlc_phy_a2_nphy()
24948 wlc_phy_rfctrl_override_nphy(pi, (0x1 << 3), 1, 0x3, 0); in wlc_phy_a2_nphy()
24950 write_phy_reg(pi, 0x2be, 1); in wlc_phy_a2_nphy()
24951 SPINWAIT(read_phy_reg(pi, 0x2be), 10 * 1000 * 1000); in wlc_phy_a2_nphy()
24953 wlc_phy_rfctrl_override_nphy(pi, (0x1 << 3), 0, 0x3, 0); in wlc_phy_a2_nphy()
24955 wlc_phy_table_write_nphy(pi, in wlc_phy_a2_nphy()
24962 wlc_phy_a1_nphy(pi, core, 5, 0, 40); in wlc_phy_a2_nphy()
24966 static u8 wlc_phy_a3_nphy(struct brcms_phy *pi, u8 start_gain, u8 core) in wlc_phy_a3_nphy() argument
24985 if (NREV_GE(pi->pubpi.phy_rev, 7)) { in wlc_phy_a3_nphy()
24990 if (CHSPEC_IS2G(pi->radio_chanspec)) { in wlc_phy_a3_nphy()
24991 if (pi->pubpi.radiorev == 5) { in wlc_phy_a3_nphy()
24997 } else if ((pi->pubpi.radiorev == 7) in wlc_phy_a3_nphy()
24998 || (pi->pubpi.radiorev == 8)) { in wlc_phy_a3_nphy()
25020 if (CHSPEC_IS2G(pi->radio_chanspec)) in wlc_phy_a3_nphy()
25027 wlc_phy_a2_nphy(pi, &phy_a4, CAL_GCTRL, core); in wlc_phy_a3_nphy()
25029 wlc_phy_table_read_nphy(pi, in wlc_phy_a3_nphy()
25069 wlc_phy_a2_nphy(pi, &phy_a4, CAL_GCTRL, core); in wlc_phy_a3_nphy()
25071 wlc_phy_table_read_nphy(pi, in wlc_phy_a3_nphy()
25108 if (NREV_GE(pi->pubpi.phy_rev, 7)) in wlc_phy_a3_nphy()
25115 static void wlc_phy_a4(struct brcms_phy *pi, bool full_cal) in wlc_phy_a4() argument
25132 if (pi->nphy_papd_skip == 1) in wlc_phy_a4()
25135 phy_b3 = (0 == (bcma_read32(pi->d11core, D11REGOFFS(maccontrol)) & in wlc_phy_a4()
25138 wlapi_suspend_mac_and_wait(pi->sh->physhim); in wlc_phy_a4()
25140 wlc_phy_stay_in_carriersearch_nphy(pi, true); in wlc_phy_a4()
25142 pi->nphy_force_papd_cal = false; in wlc_phy_a4()
25144 for (phy_b5 = 0; phy_b5 < pi->pubpi.phy_corenum; phy_b5++) in wlc_phy_a4()
25145 pi->nphy_papd_tx_gain_at_last_cal[phy_b5] = in wlc_phy_a4()
25146 wlc_phy_txpwr_idx_cur_get_nphy(pi, phy_b5); in wlc_phy_a4()
25148 pi->nphy_papd_last_cal = pi->sh->now; in wlc_phy_a4()
25149 pi->nphy_papd_recal_counter++; in wlc_phy_a4()
25151 phy_b4 = pi->nphy_txpwrctrl; in wlc_phy_a4()
25152 wlc_phy_txpwrctrl_enable_nphy(pi, PHY_TPC_HW_OFF); in wlc_phy_a4()
25154 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_SCALARTBL0, 64, 0, 32, in wlc_phy_a4()
25156 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_SCALARTBL1, 64, 0, 32, in wlc_phy_a4()
25159 phy_b9 = read_phy_reg(pi, 0x01); in wlc_phy_a4()
25160 mod_phy_reg(pi, 0x01, (0x1 << 15), 0); in wlc_phy_a4()
25162 for (phy_b5 = 0; phy_b5 < pi->pubpi.phy_corenum; phy_b5++) { in wlc_phy_a4()
25165 wlc_phy_table_write_nphy(pi, in wlc_phy_a4()
25173 wlc_phy_ipa_restore_tx_digi_filts_nphy(pi); in wlc_phy_a4()
25175 phy_b2.mm = wlc_phy_ipa_get_bbmult_nphy(pi); in wlc_phy_a4()
25176 for (phy_b5 = 0; phy_b5 < pi->pubpi.phy_corenum; phy_b5++) { in wlc_phy_a4()
25177 wlc_phy_papd_cal_setup_nphy(pi, &phy_b2, phy_b5); in wlc_phy_a4()
25179 if (NREV_GE(pi->pubpi.phy_rev, 7)) { in wlc_phy_a4()
25180 if (CHSPEC_IS2G(pi->radio_chanspec)) { in wlc_phy_a4()
25181 if ((pi->pubpi.radiorev == 3) in wlc_phy_a4()
25182 || (pi->pubpi.radiorev == 4) in wlc_phy_a4()
25183 || (pi->pubpi.radiorev == 6)) { in wlc_phy_a4()
25184 pi->nphy_papd_cal_gain_index[phy_b5] = in wlc_phy_a4()
25186 } else if (pi->pubpi.radiorev == 5) { in wlc_phy_a4()
25187 pi->nphy_papd_cal_gain_index[phy_b5] = in wlc_phy_a4()
25189 pi->nphy_papd_cal_gain_index[phy_b5] = in wlc_phy_a4()
25191 pi, in wlc_phy_a4()
25192 pi-> in wlc_phy_a4()
25197 } else if ((pi->pubpi.radiorev == 7) in wlc_phy_a4()
25198 || (pi->pubpi.radiorev == 8)) { in wlc_phy_a4()
25200 pi->nphy_papd_cal_gain_index[phy_b5] = in wlc_phy_a4()
25202 pi->nphy_papd_cal_gain_index[phy_b5] = in wlc_phy_a4()
25204 pi, in wlc_phy_a4()
25205 pi-> in wlc_phy_a4()
25213 pi->nphy_papd_cal_gain_index[phy_b5]; in wlc_phy_a4()
25216 pi->nphy_papd_cal_gain_index[phy_b5] = 0; in wlc_phy_a4()
25217 pi->nphy_papd_cal_gain_index[phy_b5] = in wlc_phy_a4()
25219 pi, in wlc_phy_a4()
25220 pi-> in wlc_phy_a4()
25224 pi->nphy_papd_cal_gain_index[phy_b5]; in wlc_phy_a4()
25230 wlc_phy_a3_nphy(pi, phy_b1[phy_b5].index, in wlc_phy_a4()
25233 pi->nphy_papd_cal_gain_index[phy_b5] = in wlc_phy_a4()
25237 switch (pi->nphy_papd_cal_type) { in wlc_phy_a4()
25239 wlc_phy_a2_nphy(pi, &phy_b1[phy_b5], CAL_FULL, phy_b5); in wlc_phy_a4()
25242 wlc_phy_a2_nphy(pi, &phy_b1[phy_b5], CAL_SOFT, phy_b5); in wlc_phy_a4()
25246 if (NREV_GE(pi->pubpi.phy_rev, 7)) in wlc_phy_a4()
25247 wlc_phy_papd_cal_cleanup_nphy(pi, &phy_b2); in wlc_phy_a4()
25250 if (NREV_LT(pi->pubpi.phy_rev, 7)) in wlc_phy_a4()
25251 wlc_phy_papd_cal_cleanup_nphy(pi, &phy_b2); in wlc_phy_a4()
25253 for (phy_b5 = 0; phy_b5 < pi->pubpi.phy_corenum; phy_b5++) { in wlc_phy_a4()
25256 if (NREV_GE(pi->pubpi.phy_rev, 7)) { in wlc_phy_a4()
25257 if (CHSPEC_IS2G(pi->radio_chanspec)) { in wlc_phy_a4()
25258 if (pi->pubpi.radiorev == 3) in wlc_phy_a4()
25260 else if (pi->pubpi.radiorev == 5) in wlc_phy_a4()
25268 if (CHSPEC_IS2G(pi->radio_chanspec)) { in wlc_phy_a4()
25271 if ((pi->pubpi.radiorev == 3) || in wlc_phy_a4()
25272 (pi->pubpi.radiorev == 4) || in wlc_phy_a4()
25273 (pi->pubpi.radiorev == 6)) { in wlc_phy_a4()
25278 } else if (pi->pubpi.radiorev == 5) { in wlc_phy_a4()
25282 } else if ((pi->pubpi.radiorev == 7) || in wlc_phy_a4()
25283 (pi->pubpi.radiorev == 8)) { in wlc_phy_a4()
25290 if ((pi->pubpi.radiorev == 3) || in wlc_phy_a4()
25291 (pi->pubpi.radiorev == 4) || in wlc_phy_a4()
25292 (pi->pubpi.radiorev == 6)) in wlc_phy_a4()
25297 else if ((pi->pubpi.radiorev == 7) in wlc_phy_a4()
25298 || (pi->pubpi.radiorev == 8)) in wlc_phy_a4()
25306 if (CHSPEC_IS2G(pi->radio_chanspec)) in wlc_phy_a4()
25315 mod_phy_reg(pi, (phy_b5 == PHY_CORE_0) ? 0x298 : in wlc_phy_a4()
25318 pi->nphy_papd_epsilon_offset[phy_b5] = phy_b6; in wlc_phy_a4()
25320 if (NREV_LT(pi->pubpi.phy_rev, 5)) in wlc_phy_a4()
25327 if (CHSPEC_IS2G(pi->radio_chanspec)) { in wlc_phy_a4()
25343 mod_phy_reg(pi, (phy_b5 == PHY_CORE_0) ? 0x298 : in wlc_phy_a4()
25346 pi->nphy_papd_epsilon_offset[phy_b5] = phy_b6; in wlc_phy_a4()
25350 mod_phy_reg(pi, (0 == PHY_CORE_0) ? 0x297 : in wlc_phy_a4()
25353 mod_phy_reg(pi, (1 == PHY_CORE_0) ? 0x297 : in wlc_phy_a4()
25356 if (NREV_GE(pi->pubpi.phy_rev, 6)) { in wlc_phy_a4()
25357 mod_phy_reg(pi, (0 == PHY_CORE_0) ? 0x2a3 : in wlc_phy_a4()
25360 mod_phy_reg(pi, (1 == PHY_CORE_0) ? 0x2a3 : in wlc_phy_a4()
25364 mod_phy_reg(pi, (0 == PHY_CORE_0) ? 0x2a3 : in wlc_phy_a4()
25367 mod_phy_reg(pi, (1 == PHY_CORE_0) ? 0x2a3 : in wlc_phy_a4()
25371 pi->nphy_papdcomp = NPHY_PAPD_COMP_ON; in wlc_phy_a4()
25373 write_phy_reg(pi, 0x01, phy_b9); in wlc_phy_a4()
25375 wlc_phy_ipa_set_tx_digi_filts_nphy(pi); in wlc_phy_a4()
25377 wlc_phy_txpwrctrl_enable_nphy(pi, phy_b4); in wlc_phy_a4()
25379 wlc_phy_txpwr_index_nphy(pi, (1 << 0), in wlc_phy_a4()
25380 (s8) (pi->nphy_txpwrindex[0]. in wlc_phy_a4()
25382 wlc_phy_txpwr_index_nphy(pi, (1 << 1), in wlc_phy_a4()
25383 (s8) (pi->nphy_txpwrindex[1]. in wlc_phy_a4()
25387 wlc_phy_stay_in_carriersearch_nphy(pi, false); in wlc_phy_a4()
25390 wlapi_enable_mac(pi->sh->physhim); in wlc_phy_a4()
25393 void wlc_phy_cal_perical_nphy_run(struct brcms_phy *pi, u8 caltype) in wlc_phy_cal_perical_nphy_run() argument
25401 if (PHY_MUTED(pi)) in wlc_phy_cal_perical_nphy_run()
25405 fullcal = (pi->radio_chanspec != pi->nphy_txiqlocal_chanspec); in wlc_phy_cal_perical_nphy_run()
25409 if (pi->cal_type_override != PHY_PERICAL_AUTO) in wlc_phy_cal_perical_nphy_run()
25411 (pi->cal_type_override == in wlc_phy_cal_perical_nphy_run()
25414 if (pi->mphase_cal_phase_id > MPHASE_CAL_STATE_INIT) { in wlc_phy_cal_perical_nphy_run()
25415 if (pi->nphy_txiqlocal_chanspec != pi->radio_chanspec) in wlc_phy_cal_perical_nphy_run()
25416 wlc_phy_cal_perical_mphase_restart(pi); in wlc_phy_cal_perical_nphy_run()
25419 if (pi->mphase_cal_phase_id == MPHASE_CAL_STATE_RXCAL) in wlc_phy_cal_perical_nphy_run()
25420 wlapi_bmac_write_shm(pi->sh->physhim, M_CTS_DURATION, 10000); in wlc_phy_cal_perical_nphy_run()
25422 wlapi_suspend_mac_and_wait(pi->sh->physhim); in wlc_phy_cal_perical_nphy_run()
25424 wlc_phyreg_enter((struct brcms_phy_pub *) pi); in wlc_phy_cal_perical_nphy_run()
25426 if ((pi->mphase_cal_phase_id == MPHASE_CAL_STATE_IDLE) || in wlc_phy_cal_perical_nphy_run()
25427 (pi->mphase_cal_phase_id == MPHASE_CAL_STATE_INIT)) { in wlc_phy_cal_perical_nphy_run()
25428 pi->nphy_cal_orig_pwr_idx[0] = in wlc_phy_cal_perical_nphy_run()
25429 (u8) ((read_phy_reg(pi, 0x1ed) >> 8) & 0x7f); in wlc_phy_cal_perical_nphy_run()
25430 pi->nphy_cal_orig_pwr_idx[1] = in wlc_phy_cal_perical_nphy_run()
25431 (u8) ((read_phy_reg(pi, 0x1ee) >> 8) & 0x7f); in wlc_phy_cal_perical_nphy_run()
25433 if (pi->nphy_txpwrctrl != PHY_TPC_HW_OFF) { in wlc_phy_cal_perical_nphy_run()
25434 wlc_phy_table_read_nphy(pi, NPHY_TBL_ID_RFSEQ, 2, in wlc_phy_cal_perical_nphy_run()
25436 pi->nphy_cal_orig_tx_gain); in wlc_phy_cal_perical_nphy_run()
25438 pi->nphy_cal_orig_tx_gain[0] = 0; in wlc_phy_cal_perical_nphy_run()
25439 pi->nphy_cal_orig_tx_gain[1] = 0; in wlc_phy_cal_perical_nphy_run()
25442 target_gain = wlc_phy_get_tx_gain_nphy(pi); in wlc_phy_cal_perical_nphy_run()
25443 tx_pwr_ctrl_state = pi->nphy_txpwrctrl; in wlc_phy_cal_perical_nphy_run()
25444 wlc_phy_txpwrctrl_enable_nphy(pi, PHY_TPC_HW_OFF); in wlc_phy_cal_perical_nphy_run()
25446 if (pi->antsel_type == ANTSEL_2x3) in wlc_phy_cal_perical_nphy_run()
25447 wlc_phy_antsel_init((struct brcms_phy_pub *) pi, true); in wlc_phy_cal_perical_nphy_run()
25449 mphase = (pi->mphase_cal_phase_id != MPHASE_CAL_STATE_IDLE); in wlc_phy_cal_perical_nphy_run()
25452 if (NREV_GE(pi->pubpi.phy_rev, 3)) { in wlc_phy_cal_perical_nphy_run()
25453 wlc_phy_precal_txgain_nphy(pi); in wlc_phy_cal_perical_nphy_run()
25454 pi->nphy_cal_target_gain = wlc_phy_get_tx_gain_nphy(pi); in wlc_phy_cal_perical_nphy_run()
25457 target_gain = pi->nphy_cal_target_gain; in wlc_phy_cal_perical_nphy_run()
25460 wlc_phy_cal_txiqlo_nphy(pi, target_gain, fullcal, in wlc_phy_cal_perical_nphy_run()
25462 if (PHY_IPA(pi)) in wlc_phy_cal_perical_nphy_run()
25463 wlc_phy_a4(pi, true); in wlc_phy_cal_perical_nphy_run()
25465 wlc_phyreg_exit((struct brcms_phy_pub *) pi); in wlc_phy_cal_perical_nphy_run()
25466 wlapi_enable_mac(pi->sh->physhim); in wlc_phy_cal_perical_nphy_run()
25467 wlapi_bmac_write_shm(pi->sh->physhim, M_CTS_DURATION, in wlc_phy_cal_perical_nphy_run()
25469 wlapi_suspend_mac_and_wait(pi->sh->physhim); in wlc_phy_cal_perical_nphy_run()
25470 wlc_phyreg_enter((struct brcms_phy_pub *) pi); in wlc_phy_cal_perical_nphy_run()
25472 if (0 == wlc_phy_cal_rxiq_nphy(pi, target_gain, in wlc_phy_cal_perical_nphy_run()
25473 (pi->first_cal_after_assoc || in wlc_phy_cal_perical_nphy_run()
25474 (pi->cal_type_override == in wlc_phy_cal_perical_nphy_run()
25476 wlc_phy_savecal_nphy(pi); in wlc_phy_cal_perical_nphy_run()
25478 wlc_phy_txpwrctrl_coeff_setup_nphy(pi); in wlc_phy_cal_perical_nphy_run()
25480 pi->nphy_perical_last = pi->sh->now; in wlc_phy_cal_perical_nphy_run()
25484 wlc_phy_rssi_cal_nphy(pi); in wlc_phy_cal_perical_nphy_run()
25486 if (pi->first_cal_after_assoc in wlc_phy_cal_perical_nphy_run()
25487 || (pi->cal_type_override == PHY_PERICAL_FULL)) { in wlc_phy_cal_perical_nphy_run()
25488 pi->first_cal_after_assoc = false; in wlc_phy_cal_perical_nphy_run()
25489 wlc_phy_txpwrctrl_idle_tssi_nphy(pi); in wlc_phy_cal_perical_nphy_run()
25490 wlc_phy_txpwrctrl_pwr_setup_nphy(pi); in wlc_phy_cal_perical_nphy_run()
25493 if (NREV_GE(pi->pubpi.phy_rev, 3)) in wlc_phy_cal_perical_nphy_run()
25494 wlc_phy_radio205x_vcocal_nphy(pi); in wlc_phy_cal_perical_nphy_run()
25496 switch (pi->mphase_cal_phase_id) { in wlc_phy_cal_perical_nphy_run()
25498 pi->nphy_perical_last = pi->sh->now; in wlc_phy_cal_perical_nphy_run()
25499 pi->nphy_txiqlocal_chanspec = pi->radio_chanspec; in wlc_phy_cal_perical_nphy_run()
25501 if (NREV_GE(pi->pubpi.phy_rev, 3)) in wlc_phy_cal_perical_nphy_run()
25502 wlc_phy_precal_txgain_nphy(pi); in wlc_phy_cal_perical_nphy_run()
25504 pi->nphy_cal_target_gain = wlc_phy_get_tx_gain_nphy(pi); in wlc_phy_cal_perical_nphy_run()
25505 pi->mphase_cal_phase_id++; in wlc_phy_cal_perical_nphy_run()
25514 if ((pi->radar_percal_mask & 0x10) != 0) in wlc_phy_cal_perical_nphy_run()
25515 pi->nphy_rxcal_active = true; in wlc_phy_cal_perical_nphy_run()
25518 (pi, pi->nphy_cal_target_gain, fullcal, in wlc_phy_cal_perical_nphy_run()
25521 wlc_phy_cal_perical_mphase_reset(pi); in wlc_phy_cal_perical_nphy_run()
25525 if (NREV_LE(pi->pubpi.phy_rev, 2) && in wlc_phy_cal_perical_nphy_run()
25526 (pi->mphase_cal_phase_id == in wlc_phy_cal_perical_nphy_run()
25528 pi->mphase_cal_phase_id += 2; in wlc_phy_cal_perical_nphy_run()
25530 pi->mphase_cal_phase_id++; in wlc_phy_cal_perical_nphy_run()
25534 if ((pi->radar_percal_mask & 0x2) != 0) in wlc_phy_cal_perical_nphy_run()
25535 pi->nphy_rxcal_active = true; in wlc_phy_cal_perical_nphy_run()
25537 if (PHY_IPA(pi)) in wlc_phy_cal_perical_nphy_run()
25538 wlc_phy_a4(pi, true); in wlc_phy_cal_perical_nphy_run()
25540 pi->mphase_cal_phase_id++; in wlc_phy_cal_perical_nphy_run()
25544 if ((pi->radar_percal_mask & 0x1) != 0) in wlc_phy_cal_perical_nphy_run()
25545 pi->nphy_rxcal_active = true; in wlc_phy_cal_perical_nphy_run()
25546 if (wlc_phy_cal_rxiq_nphy(pi, target_gain, in wlc_phy_cal_perical_nphy_run()
25547 (pi->first_cal_after_assoc || in wlc_phy_cal_perical_nphy_run()
25548 (pi->cal_type_override == in wlc_phy_cal_perical_nphy_run()
25551 wlc_phy_savecal_nphy(pi); in wlc_phy_cal_perical_nphy_run()
25553 pi->mphase_cal_phase_id++; in wlc_phy_cal_perical_nphy_run()
25557 if ((pi->radar_percal_mask & 0x4) != 0) in wlc_phy_cal_perical_nphy_run()
25558 pi->nphy_rxcal_active = true; in wlc_phy_cal_perical_nphy_run()
25559 wlc_phy_txpwrctrl_coeff_setup_nphy(pi); in wlc_phy_cal_perical_nphy_run()
25560 wlc_phy_rssi_cal_nphy(pi); in wlc_phy_cal_perical_nphy_run()
25562 if (NREV_GE(pi->pubpi.phy_rev, 3)) in wlc_phy_cal_perical_nphy_run()
25563 wlc_phy_radio205x_vcocal_nphy(pi); in wlc_phy_cal_perical_nphy_run()
25567 if (pi->first_cal_after_assoc) in wlc_phy_cal_perical_nphy_run()
25568 pi->mphase_cal_phase_id++; in wlc_phy_cal_perical_nphy_run()
25570 wlc_phy_cal_perical_mphase_reset(pi); in wlc_phy_cal_perical_nphy_run()
25575 if ((pi->radar_percal_mask & 0x8) != 0) in wlc_phy_cal_perical_nphy_run()
25576 pi->nphy_rxcal_active = true; in wlc_phy_cal_perical_nphy_run()
25578 if (pi->first_cal_after_assoc) { in wlc_phy_cal_perical_nphy_run()
25579 pi->first_cal_after_assoc = false; in wlc_phy_cal_perical_nphy_run()
25580 wlc_phy_txpwrctrl_idle_tssi_nphy(pi); in wlc_phy_cal_perical_nphy_run()
25581 wlc_phy_txpwrctrl_pwr_setup_nphy(pi); in wlc_phy_cal_perical_nphy_run()
25584 wlc_phy_cal_perical_mphase_reset(pi); in wlc_phy_cal_perical_nphy_run()
25588 wlc_phy_cal_perical_mphase_reset(pi); in wlc_phy_cal_perical_nphy_run()
25593 if (NREV_GE(pi->pubpi.phy_rev, 3)) { in wlc_phy_cal_perical_nphy_run()
25597 wlc_phy_txpwr_index_nphy(pi, 1, in wlc_phy_cal_perical_nphy_run()
25598 pi-> in wlc_phy_cal_perical_nphy_run()
25601 wlc_phy_txpwr_index_nphy(pi, 2, in wlc_phy_cal_perical_nphy_run()
25602 pi-> in wlc_phy_cal_perical_nphy_run()
25606 pi->nphy_txpwrindex[0].index = -1; in wlc_phy_cal_perical_nphy_run()
25607 pi->nphy_txpwrindex[1].index = -1; in wlc_phy_cal_perical_nphy_run()
25609 wlc_phy_txpwr_index_nphy(pi, (1 << 0), in wlc_phy_cal_perical_nphy_run()
25610 (s8) (pi-> in wlc_phy_cal_perical_nphy_run()
25615 wlc_phy_txpwr_index_nphy(pi, (1 << 1), in wlc_phy_cal_perical_nphy_run()
25616 (s8) (pi-> in wlc_phy_cal_perical_nphy_run()
25625 wlc_phy_txpwrctrl_enable_nphy(pi, tx_pwr_ctrl_state); in wlc_phy_cal_perical_nphy_run()
25626 wlc_phyreg_exit((struct brcms_phy_pub *) pi); in wlc_phy_cal_perical_nphy_run()
25627 wlapi_enable_mac(pi->sh->physhim); in wlc_phy_cal_perical_nphy_run()
25631 wlc_phy_cal_txiqlo_nphy(struct brcms_phy *pi, struct nphy_txgains target_gain, in wlc_phy_cal_txiqlo_nphy() argument
25713 wlc_phy_stay_in_carriersearch_nphy(pi, true); in wlc_phy_cal_txiqlo_nphy()
25715 if (NREV_GE(pi->pubpi.phy_rev, 4)) { in wlc_phy_cal_txiqlo_nphy()
25716 phyhang_avoid_state = pi->phyhang_avoid; in wlc_phy_cal_txiqlo_nphy()
25717 pi->phyhang_avoid = false; in wlc_phy_cal_txiqlo_nphy()
25720 if (CHSPEC_IS40(pi->radio_chanspec)) in wlc_phy_cal_txiqlo_nphy()
25725 wlc_phy_table_read_nphy(pi, NPHY_TBL_ID_RFSEQ, 2, 0x110, 16, gain_save); in wlc_phy_cal_txiqlo_nphy()
25728 wlc_phy_iqcal_gainparams_nphy(pi, core_no, target_gain, in wlc_phy_cal_txiqlo_nphy()
25733 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_RFSEQ, 2, 0x110, 16, cal_gain); in wlc_phy_cal_txiqlo_nphy()
25735 wlc_phy_txcal_radio_setup_nphy(pi); in wlc_phy_cal_txiqlo_nphy()
25737 wlc_phy_txcal_physetup_nphy(pi); in wlc_phy_cal_txiqlo_nphy()
25740 if (!(NREV_GE(pi->pubpi.phy_rev, 6) || in wlc_phy_cal_txiqlo_nphy()
25741 (NREV_IS(pi->pubpi.phy_rev, 5) && PHY_IPA(pi) in wlc_phy_cal_txiqlo_nphy()
25742 && (CHSPEC_IS2G(pi->radio_chanspec))))) { in wlc_phy_cal_txiqlo_nphy()
25751 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_IQLOCAL, tbl_len, 0, in wlc_phy_cal_txiqlo_nphy()
25761 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_IQLOCAL, tbl_len, 32, in wlc_phy_cal_txiqlo_nphy()
25765 if (NREV_GE(pi->pubpi.phy_rev, 7)) in wlc_phy_cal_txiqlo_nphy()
25766 write_phy_reg(pi, 0xc2, 0x8ad9); in wlc_phy_cal_txiqlo_nphy()
25768 write_phy_reg(pi, 0xc2, 0x8aa9); in wlc_phy_cal_txiqlo_nphy()
25773 if (pi->mphase_cal_phase_id > MPHASE_CAL_STATE_TXPHASE0) { in wlc_phy_cal_txiqlo_nphy()
25774 wlc_phy_runsamples_nphy(pi, phy_bw * 8, 0xffff, 0, 1, 0, false); in wlc_phy_cal_txiqlo_nphy()
25778 wlc_phy_tx_tone_nphy(pi, tone_freq, max_val, 1, 0, in wlc_phy_cal_txiqlo_nphy()
25784 if (pi->mphase_cal_phase_id > MPHASE_CAL_STATE_TXPHASE0) { in wlc_phy_cal_txiqlo_nphy()
25785 tbl_ptr = pi->mphase_txcal_bestcoeffs; in wlc_phy_cal_txiqlo_nphy()
25786 tbl_len = ARRAY_SIZE(pi->mphase_txcal_bestcoeffs); in wlc_phy_cal_txiqlo_nphy()
25787 if (NREV_LT(pi->pubpi.phy_rev, 3)) in wlc_phy_cal_txiqlo_nphy()
25790 if ((!fullcal) && (pi->nphy_txiqlocal_coeffsvalid)) { in wlc_phy_cal_txiqlo_nphy()
25792 tbl_ptr = pi->nphy_txiqlocal_bestc; in wlc_phy_cal_txiqlo_nphy()
25793 tbl_len = ARRAY_SIZE(pi->nphy_txiqlocal_bestc); in wlc_phy_cal_txiqlo_nphy()
25794 if (NREV_LT(pi->pubpi.phy_rev, 3)) in wlc_phy_cal_txiqlo_nphy()
25800 if (NREV_GE(pi->pubpi.phy_rev, 3)) { in wlc_phy_cal_txiqlo_nphy()
25812 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_IQLOCAL, tbl_len, 64, in wlc_phy_cal_txiqlo_nphy()
25816 max_cal_cmds = (NREV_GE(pi->pubpi.phy_rev, 3)) ? in wlc_phy_cal_txiqlo_nphy()
25821 max_cal_cmds = (NREV_GE(pi->pubpi.phy_rev, 3)) ? in wlc_phy_cal_txiqlo_nphy()
25828 cal_cnt = pi->mphase_txcal_cmdidx; in wlc_phy_cal_txiqlo_nphy()
25829 if ((cal_cnt + pi->mphase_txcal_numcmds) < max_cal_cmds) in wlc_phy_cal_txiqlo_nphy()
25830 num_cals = cal_cnt + pi->mphase_txcal_numcmds; in wlc_phy_cal_txiqlo_nphy()
25841 cal_cmd = (NREV_GE(pi->pubpi.phy_rev, 3)) ? in wlc_phy_cal_txiqlo_nphy()
25846 cal_cmd = (NREV_GE(pi->pubpi.phy_rev, 3)) ? in wlc_phy_cal_txiqlo_nphy()
25855 if (NREV_GE(pi->pubpi.phy_rev, 6) || in wlc_phy_cal_txiqlo_nphy()
25856 (NREV_IS(pi->pubpi.phy_rev, 5) && in wlc_phy_cal_txiqlo_nphy()
25857 PHY_IPA(pi) in wlc_phy_cal_txiqlo_nphy()
25858 && (CHSPEC_IS2G(pi->radio_chanspec)))) { in wlc_phy_cal_txiqlo_nphy()
25861 pi, in wlc_phy_cal_txiqlo_nphy()
25870 write_phy_reg(pi, 0xc1, val); in wlc_phy_cal_txiqlo_nphy()
25875 wlc_phy_table_read_nphy(pi, NPHY_TBL_ID_IQLOCAL, in wlc_phy_cal_txiqlo_nphy()
25882 wlc_phy_table_write_nphy(pi, in wlc_phy_cal_txiqlo_nphy()
25888 write_phy_reg(pi, 0xc0, cal_cmd); in wlc_phy_cal_txiqlo_nphy()
25890 SPINWAIT(((read_phy_reg(pi, 0xc0) & 0xc000) != 0), in wlc_phy_cal_txiqlo_nphy()
25892 if (WARN(read_phy_reg(pi, 0xc0) & 0xc000, in wlc_phy_cal_txiqlo_nphy()
25896 wlc_phy_table_read_nphy(pi, NPHY_TBL_ID_IQLOCAL, in wlc_phy_cal_txiqlo_nphy()
25898 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_IQLOCAL, in wlc_phy_cal_txiqlo_nphy()
25911 pi->mphase_txcal_cmdidx = num_cals; in wlc_phy_cal_txiqlo_nphy()
25912 if (pi->mphase_txcal_cmdidx >= max_cal_cmds) in wlc_phy_cal_txiqlo_nphy()
25913 pi->mphase_txcal_cmdidx = 0; in wlc_phy_cal_txiqlo_nphy()
25917 (NREV_LE(pi->pubpi.phy_rev, 2)) ? in wlc_phy_cal_txiqlo_nphy()
25921 || (pi->mphase_cal_phase_id == mphase_cal_lastphase)) { in wlc_phy_cal_txiqlo_nphy()
25923 wlc_phy_table_read_nphy(pi, NPHY_TBL_ID_IQLOCAL, 4, 96, in wlc_phy_cal_txiqlo_nphy()
25925 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_IQLOCAL, 4, 80, in wlc_phy_cal_txiqlo_nphy()
25928 if (NREV_LT(pi->pubpi.phy_rev, 2)) { in wlc_phy_cal_txiqlo_nphy()
25936 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_IQLOCAL, 4, 88, in wlc_phy_cal_txiqlo_nphy()
25939 wlc_phy_table_read_nphy(pi, NPHY_TBL_ID_IQLOCAL, 2, 101, in wlc_phy_cal_txiqlo_nphy()
25941 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_IQLOCAL, 2, 85, in wlc_phy_cal_txiqlo_nphy()
25944 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_IQLOCAL, 2, 93, in wlc_phy_cal_txiqlo_nphy()
25947 tbl_len = ARRAY_SIZE(pi->nphy_txiqlocal_bestc); in wlc_phy_cal_txiqlo_nphy()
25948 if (NREV_LT(pi->pubpi.phy_rev, 3)) in wlc_phy_cal_txiqlo_nphy()
25951 wlc_phy_table_read_nphy(pi, NPHY_TBL_ID_IQLOCAL, in wlc_phy_cal_txiqlo_nphy()
25953 pi->nphy_txiqlocal_bestc); in wlc_phy_cal_txiqlo_nphy()
25955 pi->nphy_txiqlocal_coeffsvalid = true; in wlc_phy_cal_txiqlo_nphy()
25956 pi->nphy_txiqlocal_chanspec = pi->radio_chanspec; in wlc_phy_cal_txiqlo_nphy()
25958 tbl_len = ARRAY_SIZE(pi->mphase_txcal_bestcoeffs); in wlc_phy_cal_txiqlo_nphy()
25959 if (NREV_LT(pi->pubpi.phy_rev, 3)) in wlc_phy_cal_txiqlo_nphy()
25962 wlc_phy_table_read_nphy(pi, NPHY_TBL_ID_IQLOCAL, in wlc_phy_cal_txiqlo_nphy()
25964 pi->mphase_txcal_bestcoeffs); in wlc_phy_cal_txiqlo_nphy()
25967 wlc_phy_stopplayback_nphy(pi); in wlc_phy_cal_txiqlo_nphy()
25969 write_phy_reg(pi, 0xc2, 0x0000); in wlc_phy_cal_txiqlo_nphy()
25973 wlc_phy_txcal_phycleanup_nphy(pi); in wlc_phy_cal_txiqlo_nphy()
25975 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_RFSEQ, 2, 0x110, 16, in wlc_phy_cal_txiqlo_nphy()
25978 wlc_phy_txcal_radio_cleanup_nphy(pi); in wlc_phy_cal_txiqlo_nphy()
25980 if (NREV_LT(pi->pubpi.phy_rev, 2)) { in wlc_phy_cal_txiqlo_nphy()
25982 || (pi->mphase_cal_phase_id == mphase_cal_lastphase)) in wlc_phy_cal_txiqlo_nphy()
25983 wlc_phy_tx_iq_war_nphy(pi); in wlc_phy_cal_txiqlo_nphy()
25986 if (NREV_GE(pi->pubpi.phy_rev, 4)) in wlc_phy_cal_txiqlo_nphy()
25987 pi->phyhang_avoid = phyhang_avoid_state; in wlc_phy_cal_txiqlo_nphy()
25989 wlc_phy_stay_in_carriersearch_nphy(pi, false); in wlc_phy_cal_txiqlo_nphy()
25994 static void wlc_phy_reapply_txcal_coeffs_nphy(struct brcms_phy *pi) in wlc_phy_reapply_txcal_coeffs_nphy() argument
25998 if ((pi->nphy_txiqlocal_chanspec == pi->radio_chanspec) && in wlc_phy_reapply_txcal_coeffs_nphy()
25999 (pi->nphy_txiqlocal_coeffsvalid)) { in wlc_phy_reapply_txcal_coeffs_nphy()
26000 wlc_phy_table_read_nphy(pi, NPHY_TBL_ID_IQLOCAL, in wlc_phy_reapply_txcal_coeffs_nphy()
26003 if ((pi->nphy_txiqlocal_bestc[0] != tbl_buf[0]) || in wlc_phy_reapply_txcal_coeffs_nphy()
26004 (pi->nphy_txiqlocal_bestc[1] != tbl_buf[1]) || in wlc_phy_reapply_txcal_coeffs_nphy()
26005 (pi->nphy_txiqlocal_bestc[2] != tbl_buf[2]) || in wlc_phy_reapply_txcal_coeffs_nphy()
26006 (pi->nphy_txiqlocal_bestc[3] != tbl_buf[3])) { in wlc_phy_reapply_txcal_coeffs_nphy()
26008 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_IQLOCAL, 4, 80, in wlc_phy_reapply_txcal_coeffs_nphy()
26009 16, pi->nphy_txiqlocal_bestc); in wlc_phy_reapply_txcal_coeffs_nphy()
26015 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_IQLOCAL, 4, 88, in wlc_phy_reapply_txcal_coeffs_nphy()
26018 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_IQLOCAL, 2, 85, in wlc_phy_reapply_txcal_coeffs_nphy()
26020 &pi->nphy_txiqlocal_bestc[5]); in wlc_phy_reapply_txcal_coeffs_nphy()
26022 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_IQLOCAL, 2, 93, in wlc_phy_reapply_txcal_coeffs_nphy()
26024 &pi->nphy_txiqlocal_bestc[5]); in wlc_phy_reapply_txcal_coeffs_nphy()
26030 wlc_phy_rx_iq_coeffs_nphy(struct brcms_phy *pi, u8 write, in wlc_phy_rx_iq_coeffs_nphy() argument
26034 write_phy_reg(pi, 0x9a, pcomp->a0); in wlc_phy_rx_iq_coeffs_nphy()
26035 write_phy_reg(pi, 0x9b, pcomp->b0); in wlc_phy_rx_iq_coeffs_nphy()
26036 write_phy_reg(pi, 0x9c, pcomp->a1); in wlc_phy_rx_iq_coeffs_nphy()
26037 write_phy_reg(pi, 0x9d, pcomp->b1); in wlc_phy_rx_iq_coeffs_nphy()
26039 pcomp->a0 = read_phy_reg(pi, 0x9a); in wlc_phy_rx_iq_coeffs_nphy()
26040 pcomp->b0 = read_phy_reg(pi, 0x9b); in wlc_phy_rx_iq_coeffs_nphy()
26041 pcomp->a1 = read_phy_reg(pi, 0x9c); in wlc_phy_rx_iq_coeffs_nphy()
26042 pcomp->b1 = read_phy_reg(pi, 0x9d); in wlc_phy_rx_iq_coeffs_nphy()
26047 wlc_phy_rx_iq_est_nphy(struct brcms_phy *pi, struct phy_iq_est *est, in wlc_phy_rx_iq_est_nphy() argument
26052 write_phy_reg(pi, 0x12b, num_samps); in wlc_phy_rx_iq_est_nphy()
26053 mod_phy_reg(pi, 0x12a, (0xff << 0), (wait_time << 0)); in wlc_phy_rx_iq_est_nphy()
26054 mod_phy_reg(pi, 0x129, NPHY_IqestCmd_iqMode, in wlc_phy_rx_iq_est_nphy()
26057 mod_phy_reg(pi, 0x129, NPHY_IqestCmd_iqstart, NPHY_IqestCmd_iqstart); in wlc_phy_rx_iq_est_nphy()
26059 SPINWAIT(((read_phy_reg(pi, 0x129) & NPHY_IqestCmd_iqstart) != 0), in wlc_phy_rx_iq_est_nphy()
26061 if (WARN(read_phy_reg(pi, 0x129) & NPHY_IqestCmd_iqstart, in wlc_phy_rx_iq_est_nphy()
26065 if ((read_phy_reg(pi, 0x129) & NPHY_IqestCmd_iqstart) == 0) { in wlc_phy_rx_iq_est_nphy()
26066 for (core = 0; core < pi->pubpi.phy_corenum; core++) { in wlc_phy_rx_iq_est_nphy()
26068 (read_phy_reg(pi, in wlc_phy_rx_iq_est_nphy()
26070 | read_phy_reg(pi, NPHY_IqestipwrAccLo(core)); in wlc_phy_rx_iq_est_nphy()
26072 (read_phy_reg(pi, in wlc_phy_rx_iq_est_nphy()
26074 | read_phy_reg(pi, NPHY_IqestqpwrAccLo(core)); in wlc_phy_rx_iq_est_nphy()
26076 (read_phy_reg(pi, in wlc_phy_rx_iq_est_nphy()
26078 read_phy_reg(pi, NPHY_IqestIqAccLo(core)); in wlc_phy_rx_iq_est_nphy()
26084 static void wlc_phy_calc_rx_iq_comp_nphy(struct brcms_phy *pi, u8 core_mask) in wlc_phy_calc_rx_iq_comp_nphy() argument
26099 wlc_phy_rx_iq_coeffs_nphy(pi, 0, &old_comp); in wlc_phy_calc_rx_iq_comp_nphy()
26101 wlc_phy_rx_iq_coeffs_nphy(pi, 1, &new_comp); in wlc_phy_calc_rx_iq_comp_nphy()
26104 wlc_phy_rx_iq_est_nphy(pi, est, 0x4000, 32, 0); in wlc_phy_calc_rx_iq_comp_nphy()
26108 for (curr_core = 0; curr_core < pi->pubpi.phy_corenum; curr_core++) { in wlc_phy_calc_rx_iq_comp_nphy()
26171 if (NREV_GE(pi->pubpi.phy_rev, 3)) { in wlc_phy_calc_rx_iq_comp_nphy()
26181 if (NREV_GE(pi->pubpi.phy_rev, 3)) { in wlc_phy_calc_rx_iq_comp_nphy()
26203 wlc_phy_rx_iq_coeffs_nphy(pi, 1, &new_comp); in wlc_phy_calc_rx_iq_comp_nphy()
26206 static void wlc_phy_rxcal_radio_setup_nphy(struct brcms_phy *pi, u8 rx_core) in wlc_phy_rxcal_radio_setup_nphy() argument
26212 if (NREV_GE(pi->pubpi.phy_rev, 7)) { in wlc_phy_rxcal_radio_setup_nphy()
26214 if (CHSPEC_IS5G(pi->radio_chanspec)) { in wlc_phy_rxcal_radio_setup_nphy()
26215 pi->tx_rx_cal_radio_saveregs[0] = in wlc_phy_rxcal_radio_setup_nphy()
26216 read_radio_reg(pi, in wlc_phy_rxcal_radio_setup_nphy()
26218 pi->tx_rx_cal_radio_saveregs[1] = in wlc_phy_rxcal_radio_setup_nphy()
26219 read_radio_reg(pi, in wlc_phy_rxcal_radio_setup_nphy()
26222 write_radio_reg(pi, in wlc_phy_rxcal_radio_setup_nphy()
26225 write_radio_reg(pi, in wlc_phy_rxcal_radio_setup_nphy()
26230 pi->tx_rx_cal_radio_saveregs[0] = in wlc_phy_rxcal_radio_setup_nphy()
26231 read_radio_reg(pi, in wlc_phy_rxcal_radio_setup_nphy()
26233 pi->tx_rx_cal_radio_saveregs[1] = in wlc_phy_rxcal_radio_setup_nphy()
26234 read_radio_reg(pi, in wlc_phy_rxcal_radio_setup_nphy()
26238 pi, in wlc_phy_rxcal_radio_setup_nphy()
26242 pi, in wlc_phy_rxcal_radio_setup_nphy()
26248 if (CHSPEC_IS5G(pi->radio_chanspec)) { in wlc_phy_rxcal_radio_setup_nphy()
26249 pi->tx_rx_cal_radio_saveregs[0] = in wlc_phy_rxcal_radio_setup_nphy()
26250 read_radio_reg(pi, in wlc_phy_rxcal_radio_setup_nphy()
26252 pi->tx_rx_cal_radio_saveregs[1] = in wlc_phy_rxcal_radio_setup_nphy()
26253 read_radio_reg(pi, in wlc_phy_rxcal_radio_setup_nphy()
26257 pi, in wlc_phy_rxcal_radio_setup_nphy()
26261 pi, in wlc_phy_rxcal_radio_setup_nphy()
26266 pi->tx_rx_cal_radio_saveregs[0] = in wlc_phy_rxcal_radio_setup_nphy()
26267 read_radio_reg(pi, in wlc_phy_rxcal_radio_setup_nphy()
26269 pi->tx_rx_cal_radio_saveregs[1] = in wlc_phy_rxcal_radio_setup_nphy()
26270 read_radio_reg(pi, in wlc_phy_rxcal_radio_setup_nphy()
26273 write_radio_reg(pi, in wlc_phy_rxcal_radio_setup_nphy()
26276 write_radio_reg(pi, in wlc_phy_rxcal_radio_setup_nphy()
26284 pi->tx_rx_cal_radio_saveregs[0] = in wlc_phy_rxcal_radio_setup_nphy()
26285 read_radio_reg(pi, in wlc_phy_rxcal_radio_setup_nphy()
26288 pi->tx_rx_cal_radio_saveregs[1] = in wlc_phy_rxcal_radio_setup_nphy()
26289 read_radio_reg(pi, in wlc_phy_rxcal_radio_setup_nphy()
26293 if (pi->pubpi.radiorev >= 5) { in wlc_phy_rxcal_radio_setup_nphy()
26294 pi->tx_rx_cal_radio_saveregs[2] = in wlc_phy_rxcal_radio_setup_nphy()
26295 read_radio_reg(pi, in wlc_phy_rxcal_radio_setup_nphy()
26298 pi->tx_rx_cal_radio_saveregs[3] = in wlc_phy_rxcal_radio_setup_nphy()
26299 read_radio_reg(pi, in wlc_phy_rxcal_radio_setup_nphy()
26304 if (CHSPEC_IS5G(pi->radio_chanspec)) { in wlc_phy_rxcal_radio_setup_nphy()
26306 if (pi->pubpi.radiorev >= 5) { in wlc_phy_rxcal_radio_setup_nphy()
26307 pi->tx_rx_cal_radio_saveregs[4] = in wlc_phy_rxcal_radio_setup_nphy()
26308 read_radio_reg(pi, in wlc_phy_rxcal_radio_setup_nphy()
26313 pi, in wlc_phy_rxcal_radio_setup_nphy()
26317 write_radio_reg(pi, in wlc_phy_rxcal_radio_setup_nphy()
26321 write_radio_reg(pi, in wlc_phy_rxcal_radio_setup_nphy()
26325 pi->tx_rx_cal_radio_saveregs[4] = in wlc_phy_rxcal_radio_setup_nphy()
26326 read_radio_reg(pi, in wlc_phy_rxcal_radio_setup_nphy()
26331 (pi->tx_rx_cal_radio_saveregs in wlc_phy_rxcal_radio_setup_nphy()
26336 mod_radio_reg(pi, in wlc_phy_rxcal_radio_setup_nphy()
26342 write_radio_reg(pi, in wlc_phy_rxcal_radio_setup_nphy()
26345 write_radio_reg(pi, in wlc_phy_rxcal_radio_setup_nphy()
26349 if (pi->pubpi.radiorev >= 5) { in wlc_phy_rxcal_radio_setup_nphy()
26350 pi->tx_rx_cal_radio_saveregs[4] = in wlc_phy_rxcal_radio_setup_nphy()
26352 pi, in wlc_phy_rxcal_radio_setup_nphy()
26357 pi, in wlc_phy_rxcal_radio_setup_nphy()
26362 pi, in wlc_phy_rxcal_radio_setup_nphy()
26368 pi, in wlc_phy_rxcal_radio_setup_nphy()
26374 pi->tx_rx_cal_radio_saveregs[4] = in wlc_phy_rxcal_radio_setup_nphy()
26376 pi, in wlc_phy_rxcal_radio_setup_nphy()
26381 (pi-> in wlc_phy_rxcal_radio_setup_nphy()
26387 mod_radio_reg(pi, in wlc_phy_rxcal_radio_setup_nphy()
26393 write_radio_reg(pi, in wlc_phy_rxcal_radio_setup_nphy()
26396 write_radio_reg(pi, in wlc_phy_rxcal_radio_setup_nphy()
26402 pi->tx_rx_cal_radio_saveregs[0] = in wlc_phy_rxcal_radio_setup_nphy()
26403 read_radio_reg(pi, in wlc_phy_rxcal_radio_setup_nphy()
26406 pi->tx_rx_cal_radio_saveregs[1] = in wlc_phy_rxcal_radio_setup_nphy()
26407 read_radio_reg(pi, in wlc_phy_rxcal_radio_setup_nphy()
26411 if (pi->pubpi.radiorev >= 5) { in wlc_phy_rxcal_radio_setup_nphy()
26412 pi->tx_rx_cal_radio_saveregs[2] = in wlc_phy_rxcal_radio_setup_nphy()
26413 read_radio_reg(pi, in wlc_phy_rxcal_radio_setup_nphy()
26416 pi->tx_rx_cal_radio_saveregs[3] = in wlc_phy_rxcal_radio_setup_nphy()
26417 read_radio_reg(pi, in wlc_phy_rxcal_radio_setup_nphy()
26422 if (CHSPEC_IS5G(pi->radio_chanspec)) { in wlc_phy_rxcal_radio_setup_nphy()
26424 if (pi->pubpi.radiorev >= 5) { in wlc_phy_rxcal_radio_setup_nphy()
26425 pi->tx_rx_cal_radio_saveregs[4] = in wlc_phy_rxcal_radio_setup_nphy()
26427 pi, in wlc_phy_rxcal_radio_setup_nphy()
26432 pi, in wlc_phy_rxcal_radio_setup_nphy()
26437 pi, in wlc_phy_rxcal_radio_setup_nphy()
26443 pi, in wlc_phy_rxcal_radio_setup_nphy()
26448 pi->tx_rx_cal_radio_saveregs[4] = in wlc_phy_rxcal_radio_setup_nphy()
26450 pi, in wlc_phy_rxcal_radio_setup_nphy()
26455 (pi-> in wlc_phy_rxcal_radio_setup_nphy()
26461 mod_radio_reg(pi, in wlc_phy_rxcal_radio_setup_nphy()
26467 write_radio_reg(pi, in wlc_phy_rxcal_radio_setup_nphy()
26470 write_radio_reg(pi, in wlc_phy_rxcal_radio_setup_nphy()
26474 if (pi->pubpi.radiorev >= 5) { in wlc_phy_rxcal_radio_setup_nphy()
26475 pi->tx_rx_cal_radio_saveregs[4] = in wlc_phy_rxcal_radio_setup_nphy()
26477 pi, in wlc_phy_rxcal_radio_setup_nphy()
26482 pi, in wlc_phy_rxcal_radio_setup_nphy()
26487 pi, in wlc_phy_rxcal_radio_setup_nphy()
26493 pi, in wlc_phy_rxcal_radio_setup_nphy()
26498 pi->tx_rx_cal_radio_saveregs[4] = in wlc_phy_rxcal_radio_setup_nphy()
26500 pi, in wlc_phy_rxcal_radio_setup_nphy()
26505 (pi-> in wlc_phy_rxcal_radio_setup_nphy()
26511 mod_radio_reg(pi, in wlc_phy_rxcal_radio_setup_nphy()
26517 write_radio_reg(pi, in wlc_phy_rxcal_radio_setup_nphy()
26520 write_radio_reg(pi, in wlc_phy_rxcal_radio_setup_nphy()
26528 static void wlc_phy_rxcal_radio_cleanup_nphy(struct brcms_phy *pi, u8 rx_core) in wlc_phy_rxcal_radio_cleanup_nphy() argument
26530 if (NREV_GE(pi->pubpi.phy_rev, 7)) { in wlc_phy_rxcal_radio_cleanup_nphy()
26532 if (CHSPEC_IS5G(pi->radio_chanspec)) { in wlc_phy_rxcal_radio_cleanup_nphy()
26534 pi, in wlc_phy_rxcal_radio_cleanup_nphy()
26536 pi-> in wlc_phy_rxcal_radio_cleanup_nphy()
26539 pi, in wlc_phy_rxcal_radio_cleanup_nphy()
26541 pi-> in wlc_phy_rxcal_radio_cleanup_nphy()
26546 pi, in wlc_phy_rxcal_radio_cleanup_nphy()
26548 pi-> in wlc_phy_rxcal_radio_cleanup_nphy()
26551 pi, in wlc_phy_rxcal_radio_cleanup_nphy()
26553 pi-> in wlc_phy_rxcal_radio_cleanup_nphy()
26558 if (CHSPEC_IS5G(pi->radio_chanspec)) { in wlc_phy_rxcal_radio_cleanup_nphy()
26560 pi, in wlc_phy_rxcal_radio_cleanup_nphy()
26562 pi-> in wlc_phy_rxcal_radio_cleanup_nphy()
26565 pi, in wlc_phy_rxcal_radio_cleanup_nphy()
26567 pi-> in wlc_phy_rxcal_radio_cleanup_nphy()
26572 pi, in wlc_phy_rxcal_radio_cleanup_nphy()
26574 pi-> in wlc_phy_rxcal_radio_cleanup_nphy()
26577 pi, in wlc_phy_rxcal_radio_cleanup_nphy()
26579 pi-> in wlc_phy_rxcal_radio_cleanup_nphy()
26586 write_radio_reg(pi, in wlc_phy_rxcal_radio_cleanup_nphy()
26589 pi->tx_rx_cal_radio_saveregs[0]); in wlc_phy_rxcal_radio_cleanup_nphy()
26591 write_radio_reg(pi, in wlc_phy_rxcal_radio_cleanup_nphy()
26594 pi->tx_rx_cal_radio_saveregs[1]); in wlc_phy_rxcal_radio_cleanup_nphy()
26596 if (pi->pubpi.radiorev >= 5) { in wlc_phy_rxcal_radio_cleanup_nphy()
26597 write_radio_reg(pi, in wlc_phy_rxcal_radio_cleanup_nphy()
26600 pi-> in wlc_phy_rxcal_radio_cleanup_nphy()
26603 write_radio_reg(pi, in wlc_phy_rxcal_radio_cleanup_nphy()
26606 pi-> in wlc_phy_rxcal_radio_cleanup_nphy()
26610 if (CHSPEC_IS5G(pi->radio_chanspec)) { in wlc_phy_rxcal_radio_cleanup_nphy()
26611 if (pi->pubpi.radiorev >= 5) in wlc_phy_rxcal_radio_cleanup_nphy()
26613 pi, in wlc_phy_rxcal_radio_cleanup_nphy()
26616 pi-> in wlc_phy_rxcal_radio_cleanup_nphy()
26621 pi, in wlc_phy_rxcal_radio_cleanup_nphy()
26624 pi-> in wlc_phy_rxcal_radio_cleanup_nphy()
26628 if (pi->pubpi.radiorev >= 5) in wlc_phy_rxcal_radio_cleanup_nphy()
26630 pi, in wlc_phy_rxcal_radio_cleanup_nphy()
26633 pi-> in wlc_phy_rxcal_radio_cleanup_nphy()
26638 pi, in wlc_phy_rxcal_radio_cleanup_nphy()
26641 pi-> in wlc_phy_rxcal_radio_cleanup_nphy()
26647 write_radio_reg(pi, in wlc_phy_rxcal_radio_cleanup_nphy()
26650 pi->tx_rx_cal_radio_saveregs[0]); in wlc_phy_rxcal_radio_cleanup_nphy()
26652 write_radio_reg(pi, in wlc_phy_rxcal_radio_cleanup_nphy()
26655 pi->tx_rx_cal_radio_saveregs[1]); in wlc_phy_rxcal_radio_cleanup_nphy()
26657 if (pi->pubpi.radiorev >= 5) { in wlc_phy_rxcal_radio_cleanup_nphy()
26658 write_radio_reg(pi, in wlc_phy_rxcal_radio_cleanup_nphy()
26661 pi-> in wlc_phy_rxcal_radio_cleanup_nphy()
26664 write_radio_reg(pi, in wlc_phy_rxcal_radio_cleanup_nphy()
26667 pi-> in wlc_phy_rxcal_radio_cleanup_nphy()
26671 if (CHSPEC_IS5G(pi->radio_chanspec)) { in wlc_phy_rxcal_radio_cleanup_nphy()
26672 if (pi->pubpi.radiorev >= 5) in wlc_phy_rxcal_radio_cleanup_nphy()
26674 pi, in wlc_phy_rxcal_radio_cleanup_nphy()
26677 pi-> in wlc_phy_rxcal_radio_cleanup_nphy()
26682 pi, in wlc_phy_rxcal_radio_cleanup_nphy()
26685 pi-> in wlc_phy_rxcal_radio_cleanup_nphy()
26689 if (pi->pubpi.radiorev >= 5) in wlc_phy_rxcal_radio_cleanup_nphy()
26691 pi, in wlc_phy_rxcal_radio_cleanup_nphy()
26694 pi-> in wlc_phy_rxcal_radio_cleanup_nphy()
26699 pi, in wlc_phy_rxcal_radio_cleanup_nphy()
26702 pi-> in wlc_phy_rxcal_radio_cleanup_nphy()
26710 static void wlc_phy_rxcal_physetup_nphy(struct brcms_phy *pi, u8 rx_core) in wlc_phy_rxcal_physetup_nphy() argument
26715 if (NREV_GE(pi->pubpi.phy_rev, 7)) in wlc_phy_rxcal_physetup_nphy()
26720 pi->tx_rx_cal_phy_saveregs[0] = read_phy_reg(pi, 0xa2); in wlc_phy_rxcal_physetup_nphy()
26721 pi->tx_rx_cal_phy_saveregs[1] = in wlc_phy_rxcal_physetup_nphy()
26722 read_phy_reg(pi, (rx_core == PHY_CORE_0) ? 0xa6 : 0xa7); in wlc_phy_rxcal_physetup_nphy()
26723 pi->tx_rx_cal_phy_saveregs[2] = in wlc_phy_rxcal_physetup_nphy()
26724 read_phy_reg(pi, (rx_core == PHY_CORE_0) ? 0x8f : 0xa5); in wlc_phy_rxcal_physetup_nphy()
26725 pi->tx_rx_cal_phy_saveregs[3] = read_phy_reg(pi, 0x91); in wlc_phy_rxcal_physetup_nphy()
26726 pi->tx_rx_cal_phy_saveregs[4] = read_phy_reg(pi, 0x92); in wlc_phy_rxcal_physetup_nphy()
26727 pi->tx_rx_cal_phy_saveregs[5] = read_phy_reg(pi, 0x7a); in wlc_phy_rxcal_physetup_nphy()
26728 pi->tx_rx_cal_phy_saveregs[6] = read_phy_reg(pi, 0x7d); in wlc_phy_rxcal_physetup_nphy()
26729 pi->tx_rx_cal_phy_saveregs[7] = read_phy_reg(pi, 0xe7); in wlc_phy_rxcal_physetup_nphy()
26730 pi->tx_rx_cal_phy_saveregs[8] = read_phy_reg(pi, 0xec); in wlc_phy_rxcal_physetup_nphy()
26731 if (NREV_GE(pi->pubpi.phy_rev, 7)) { in wlc_phy_rxcal_physetup_nphy()
26732 pi->tx_rx_cal_phy_saveregs[11] = read_phy_reg(pi, 0x342); in wlc_phy_rxcal_physetup_nphy()
26733 pi->tx_rx_cal_phy_saveregs[12] = read_phy_reg(pi, 0x343); in wlc_phy_rxcal_physetup_nphy()
26734 pi->tx_rx_cal_phy_saveregs[13] = read_phy_reg(pi, 0x346); in wlc_phy_rxcal_physetup_nphy()
26735 pi->tx_rx_cal_phy_saveregs[14] = read_phy_reg(pi, 0x347); in wlc_phy_rxcal_physetup_nphy()
26738 pi->tx_rx_cal_phy_saveregs[9] = read_phy_reg(pi, 0x297); in wlc_phy_rxcal_physetup_nphy()
26739 pi->tx_rx_cal_phy_saveregs[10] = read_phy_reg(pi, 0x29b); in wlc_phy_rxcal_physetup_nphy()
26740 mod_phy_reg(pi, (0 == PHY_CORE_0) ? 0x297 : in wlc_phy_rxcal_physetup_nphy()
26743 mod_phy_reg(pi, (1 == PHY_CORE_0) ? 0x297 : in wlc_phy_rxcal_physetup_nphy()
26746 if (NREV_GE(pi->pubpi.phy_rev, 7)) { in wlc_phy_rxcal_physetup_nphy()
26748 mod_phy_reg(pi, 0xa2, (0xf << 0), (1 << tx_core) << 0); in wlc_phy_rxcal_physetup_nphy()
26750 mod_phy_reg(pi, 0xa2, (0xf << 12), (1 << (1 - rx_core)) << 12); in wlc_phy_rxcal_physetup_nphy()
26754 mod_phy_reg(pi, 0xa2, (0xf << 12), (1 << tx_core) << 12); in wlc_phy_rxcal_physetup_nphy()
26755 mod_phy_reg(pi, 0xa2, (0xf << 0), (1 << tx_core) << 0); in wlc_phy_rxcal_physetup_nphy()
26756 mod_phy_reg(pi, 0xa2, (0xf << 4), (1 << rx_core) << 4); in wlc_phy_rxcal_physetup_nphy()
26757 mod_phy_reg(pi, 0xa2, (0xf << 8), (1 << rx_core) << 8); in wlc_phy_rxcal_physetup_nphy()
26760 mod_phy_reg(pi, ((rx_core == PHY_CORE_0) ? 0xa6 : 0xa7), (0x1 << 2), 0); in wlc_phy_rxcal_physetup_nphy()
26761 mod_phy_reg(pi, (rx_core == PHY_CORE_0) ? 0x8f : 0xa5, in wlc_phy_rxcal_physetup_nphy()
26763 if (NREV_LT(pi->pubpi.phy_rev, 7)) { in wlc_phy_rxcal_physetup_nphy()
26764 mod_phy_reg(pi, ((rx_core == PHY_CORE_0) ? 0xa6 : 0xa7), in wlc_phy_rxcal_physetup_nphy()
26766 mod_phy_reg(pi, (rx_core == PHY_CORE_0) ? in wlc_phy_rxcal_physetup_nphy()
26771 wlc_phy_rfctrlintc_override_nphy(pi, NPHY_RfctrlIntc_override_PA, 0, in wlc_phy_rxcal_physetup_nphy()
26775 if (NREV_GE(pi->pubpi.phy_rev, 7)) { in wlc_phy_rxcal_physetup_nphy()
26776 wlc_phy_rfctrl_override_nphy_rev7(pi, (0x1 << 3), in wlc_phy_rxcal_physetup_nphy()
26779 wlc_phy_rfctrl_override_nphy_rev7(pi, (0x1 << 9), 0, 0, 0, in wlc_phy_rxcal_physetup_nphy()
26781 wlc_phy_rfctrl_override_nphy_rev7(pi, (0x1 << 10), 1, 0, 0, in wlc_phy_rxcal_physetup_nphy()
26783 wlc_phy_rfctrl_override_nphy_rev7(pi, (0x1 << 0), 1, 0, 0, in wlc_phy_rxcal_physetup_nphy()
26785 wlc_phy_rfctrl_override_nphy_rev7(pi, (0x1 << 1), 1, 0, 0, in wlc_phy_rxcal_physetup_nphy()
26787 wlc_phy_rfctrl_override_nphy_rev7(pi, (0x1 << 11), 0, 0, 0, in wlc_phy_rxcal_physetup_nphy()
26789 if (CHSPEC_IS40(pi->radio_chanspec)) in wlc_phy_rxcal_physetup_nphy()
26791 pi, in wlc_phy_rxcal_physetup_nphy()
26797 pi, in wlc_phy_rxcal_physetup_nphy()
26802 wlc_phy_rfctrl_override_nphy_rev7(pi, (0x1 << 7), in wlc_phy_rxcal_physetup_nphy()
26805 wlc_phy_rfctrl_override_nphy_rev7(pi, (0x1 << 5), 0, 0, 0, in wlc_phy_rxcal_physetup_nphy()
26808 wlc_phy_rfctrl_override_nphy(pi, (0x1 << 3), 0, 3, 0); in wlc_phy_rxcal_physetup_nphy()
26811 wlc_phy_force_rfseq_nphy(pi, NPHY_RFSEQ_RX2TX); in wlc_phy_rxcal_physetup_nphy()
26813 if (NREV_GE(pi->pubpi.phy_rev, 7)) { in wlc_phy_rxcal_physetup_nphy()
26815 wlc_phy_rfctrlintc_override_nphy(pi, in wlc_phy_rxcal_physetup_nphy()
26828 wlc_phy_rfctrlintc_override_nphy(pi, in wlc_phy_rxcal_physetup_nphy()
26831 wlc_phy_rfctrlintc_override_nphy(pi, in wlc_phy_rxcal_physetup_nphy()
26837 static void wlc_phy_rxcal_phycleanup_nphy(struct brcms_phy *pi, u8 rx_core) in wlc_phy_rxcal_phycleanup_nphy() argument
26840 write_phy_reg(pi, 0xa2, pi->tx_rx_cal_phy_saveregs[0]); in wlc_phy_rxcal_phycleanup_nphy()
26841 write_phy_reg(pi, (rx_core == PHY_CORE_0) ? 0xa6 : 0xa7, in wlc_phy_rxcal_phycleanup_nphy()
26842 pi->tx_rx_cal_phy_saveregs[1]); in wlc_phy_rxcal_phycleanup_nphy()
26843 write_phy_reg(pi, (rx_core == PHY_CORE_0) ? 0x8f : 0xa5, in wlc_phy_rxcal_phycleanup_nphy()
26844 pi->tx_rx_cal_phy_saveregs[2]); in wlc_phy_rxcal_phycleanup_nphy()
26845 write_phy_reg(pi, 0x91, pi->tx_rx_cal_phy_saveregs[3]); in wlc_phy_rxcal_phycleanup_nphy()
26846 write_phy_reg(pi, 0x92, pi->tx_rx_cal_phy_saveregs[4]); in wlc_phy_rxcal_phycleanup_nphy()
26848 write_phy_reg(pi, 0x7a, pi->tx_rx_cal_phy_saveregs[5]); in wlc_phy_rxcal_phycleanup_nphy()
26849 write_phy_reg(pi, 0x7d, pi->tx_rx_cal_phy_saveregs[6]); in wlc_phy_rxcal_phycleanup_nphy()
26850 write_phy_reg(pi, 0xe7, pi->tx_rx_cal_phy_saveregs[7]); in wlc_phy_rxcal_phycleanup_nphy()
26851 write_phy_reg(pi, 0xec, pi->tx_rx_cal_phy_saveregs[8]); in wlc_phy_rxcal_phycleanup_nphy()
26852 if (NREV_GE(pi->pubpi.phy_rev, 7)) { in wlc_phy_rxcal_phycleanup_nphy()
26853 write_phy_reg(pi, 0x342, pi->tx_rx_cal_phy_saveregs[11]); in wlc_phy_rxcal_phycleanup_nphy()
26854 write_phy_reg(pi, 0x343, pi->tx_rx_cal_phy_saveregs[12]); in wlc_phy_rxcal_phycleanup_nphy()
26855 write_phy_reg(pi, 0x346, pi->tx_rx_cal_phy_saveregs[13]); in wlc_phy_rxcal_phycleanup_nphy()
26856 write_phy_reg(pi, 0x347, pi->tx_rx_cal_phy_saveregs[14]); in wlc_phy_rxcal_phycleanup_nphy()
26859 write_phy_reg(pi, 0x297, pi->tx_rx_cal_phy_saveregs[9]); in wlc_phy_rxcal_phycleanup_nphy()
26860 write_phy_reg(pi, 0x29b, pi->tx_rx_cal_phy_saveregs[10]); in wlc_phy_rxcal_phycleanup_nphy()
26864 wlc_phy_rxcal_gainctrl_nphy_rev5(struct brcms_phy *pi, u8 rx_core, in wlc_phy_rxcal_gainctrl_nphy_rev5() argument
26886 if (NREV_GE(pi->pubpi.phy_rev, 7)) in wlc_phy_rxcal_gainctrl_nphy_rev5()
26894 wlc_phy_rx_iq_coeffs_nphy(pi, 0, &save_comp); in wlc_phy_rxcal_gainctrl_nphy_rev5()
26896 wlc_phy_rx_iq_coeffs_nphy(pi, 1, &zero_comp); in wlc_phy_rxcal_gainctrl_nphy_rev5()
26898 if (CHSPEC_IS5G(pi->radio_chanspec)) { in wlc_phy_rxcal_gainctrl_nphy_rev5()
26899 if (NREV_GE(pi->pubpi.phy_rev, 7)) in wlc_phy_rxcal_gainctrl_nphy_rev5()
26901 else if (NREV_GE(pi->pubpi.phy_rev, 4)) in wlc_phy_rxcal_gainctrl_nphy_rev5()
26905 if (NREV_GE(pi->pubpi.phy_rev, 7)) in wlc_phy_rxcal_gainctrl_nphy_rev5()
26910 if (NREV_GE(pi->pubpi.phy_rev, 7)) in wlc_phy_rxcal_gainctrl_nphy_rev5()
26918 hpvga = (NREV_GE(pi->pubpi.phy_rev, 7)) ? in wlc_phy_rxcal_gainctrl_nphy_rev5()
26926 if (NREV_GE(pi->pubpi.phy_rev, 7)) in wlc_phy_rxcal_gainctrl_nphy_rev5()
26928 pi, in wlc_phy_rxcal_gainctrl_nphy_rev5()
26935 wlc_phy_rfctrl_override_nphy(pi, (0x1 << 12), in wlc_phy_rxcal_gainctrl_nphy_rev5()
26943 pi->nphy_rxcal_pwr_idx[tx_core] = txpwrindex; in wlc_phy_rxcal_gainctrl_nphy_rev5()
26946 nphy_rxcal_txgain[0] = 0x8ff0 | pi->nphy_gmval; in wlc_phy_rxcal_gainctrl_nphy_rev5()
26947 nphy_rxcal_txgain[1] = 0x8ff0 | pi->nphy_gmval; in wlc_phy_rxcal_gainctrl_nphy_rev5()
26948 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_RFSEQ, in wlc_phy_rxcal_gainctrl_nphy_rev5()
26952 wlc_phy_txpwr_index_nphy(pi, tx_core + 1, txpwrindex, in wlc_phy_rxcal_gainctrl_nphy_rev5()
26956 wlc_phy_tx_tone_nphy(pi, (CHSPEC_IS40(pi->radio_chanspec)) ? in wlc_phy_rxcal_gainctrl_nphy_rev5()
26961 wlc_phy_rx_iq_est_nphy(pi, est, num_samps, 32, 0); in wlc_phy_rxcal_gainctrl_nphy_rev5()
27014 wlc_phy_stopplayback_nphy(pi); in wlc_phy_rxcal_gainctrl_nphy_rev5()
27027 if (NREV_GE(pi->pubpi.phy_rev, 7)) { in wlc_phy_rxcal_gainctrl_nphy_rev5()
27036 pi, in wlc_phy_rxcal_gainctrl_nphy_rev5()
27045 wlc_phy_rfctrl_override_nphy(pi, (0x1 << 12), in wlc_phy_rxcal_gainctrl_nphy_rev5()
27063 wlc_phy_rx_iq_coeffs_nphy(pi, 1, &save_comp); in wlc_phy_rxcal_gainctrl_nphy_rev5()
27067 wlc_phy_rxcal_gainctrl_nphy(struct brcms_phy *pi, u8 rx_core, u16 *rxgain, in wlc_phy_rxcal_gainctrl_nphy() argument
27070 wlc_phy_rxcal_gainctrl_nphy_rev5(pi, rx_core, rxgain, cal_type); in wlc_phy_rxcal_gainctrl_nphy()
27074 wlc_phy_rc_sweep_nphy(struct brcms_phy *pi, u8 core_idx, u8 loopback_type) in wlc_phy_rc_sweep_nphy() argument
27108 if (NREV_GE(pi->pubpi.phy_rev, 7)) in wlc_phy_rc_sweep_nphy()
27113 if (CHSPEC_IS40(pi->radio_chanspec)) { in wlc_phy_rc_sweep_nphy()
27136 read_radio_reg(pi, in wlc_phy_rc_sweep_nphy()
27140 read_radio_reg(pi, in wlc_phy_rc_sweep_nphy()
27144 orig_dcBypass = ((read_phy_reg(pi, 0x48) >> 8) & 1); in wlc_phy_rc_sweep_nphy()
27146 orig_RxStrnFilt40Num[0] = read_phy_reg(pi, 0x267); in wlc_phy_rc_sweep_nphy()
27147 orig_RxStrnFilt40Num[1] = read_phy_reg(pi, 0x268); in wlc_phy_rc_sweep_nphy()
27148 orig_RxStrnFilt40Num[2] = read_phy_reg(pi, 0x269); in wlc_phy_rc_sweep_nphy()
27149 orig_RxStrnFilt40Den[0] = read_phy_reg(pi, 0x26a); in wlc_phy_rc_sweep_nphy()
27150 orig_RxStrnFilt40Den[1] = read_phy_reg(pi, 0x26b); in wlc_phy_rc_sweep_nphy()
27151 orig_RxStrnFilt40Num[3] = read_phy_reg(pi, 0x26c); in wlc_phy_rc_sweep_nphy()
27152 orig_RxStrnFilt40Num[4] = read_phy_reg(pi, 0x26d); in wlc_phy_rc_sweep_nphy()
27153 orig_RxStrnFilt40Num[5] = read_phy_reg(pi, 0x26e); in wlc_phy_rc_sweep_nphy()
27154 orig_RxStrnFilt40Den[2] = read_phy_reg(pi, 0x26f); in wlc_phy_rc_sweep_nphy()
27155 orig_RxStrnFilt40Den[3] = read_phy_reg(pi, 0x270); in wlc_phy_rc_sweep_nphy()
27157 orig_rfctrloverride[0] = read_phy_reg(pi, 0xe7); in wlc_phy_rc_sweep_nphy()
27158 orig_rfctrloverride[1] = read_phy_reg(pi, 0xec); in wlc_phy_rc_sweep_nphy()
27159 orig_rfctrlauxreg[0] = read_phy_reg(pi, 0xf8); in wlc_phy_rc_sweep_nphy()
27160 orig_rfctrlauxreg[1] = read_phy_reg(pi, 0xfa); in wlc_phy_rc_sweep_nphy()
27161 orig_rfctrlrssiothers = read_phy_reg(pi, (core_idx == 0) ? 0x7a : 0x7d); in wlc_phy_rc_sweep_nphy()
27163 write_radio_reg(pi, (RADIO_2056_TX_TXLPF_RCCAL | radio_addr_offset_tx), in wlc_phy_rc_sweep_nphy()
27166 write_radio_reg(pi, in wlc_phy_rc_sweep_nphy()
27170 mod_phy_reg(pi, 0x48, (0x1 << 8), (0x1 << 8)); in wlc_phy_rc_sweep_nphy()
27172 write_phy_reg(pi, 0x267, 0x02d4); in wlc_phy_rc_sweep_nphy()
27173 write_phy_reg(pi, 0x268, 0x0000); in wlc_phy_rc_sweep_nphy()
27174 write_phy_reg(pi, 0x269, 0x0000); in wlc_phy_rc_sweep_nphy()
27175 write_phy_reg(pi, 0x26a, 0x0000); in wlc_phy_rc_sweep_nphy()
27176 write_phy_reg(pi, 0x26b, 0x0000); in wlc_phy_rc_sweep_nphy()
27177 write_phy_reg(pi, 0x26c, 0x02d4); in wlc_phy_rc_sweep_nphy()
27178 write_phy_reg(pi, 0x26d, 0x0000); in wlc_phy_rc_sweep_nphy()
27179 write_phy_reg(pi, 0x26e, 0x0000); in wlc_phy_rc_sweep_nphy()
27180 write_phy_reg(pi, 0x26f, 0x0000); in wlc_phy_rc_sweep_nphy()
27181 write_phy_reg(pi, 0x270, 0x0000); in wlc_phy_rc_sweep_nphy()
27183 or_phy_reg(pi, (core_idx == 0) ? 0xe7 : 0xec, (0x1 << 8)); in wlc_phy_rc_sweep_nphy()
27184 or_phy_reg(pi, (core_idx == 0) ? 0xec : 0xe7, (0x1 << 15)); in wlc_phy_rc_sweep_nphy()
27185 or_phy_reg(pi, (core_idx == 0) ? 0xe7 : 0xec, (0x1 << 9)); in wlc_phy_rc_sweep_nphy()
27186 or_phy_reg(pi, (core_idx == 0) ? 0xe7 : 0xec, (0x1 << 10)); in wlc_phy_rc_sweep_nphy()
27188 mod_phy_reg(pi, (core_idx == 0) ? 0xfa : 0xf8, in wlc_phy_rc_sweep_nphy()
27190 mod_phy_reg(pi, (core_idx == 0) ? 0xf8 : 0xfa, in wlc_phy_rc_sweep_nphy()
27192 mod_phy_reg(pi, (core_idx == 0) ? 0xf8 : 0xfa, in wlc_phy_rc_sweep_nphy()
27194 mod_phy_reg(pi, (core_idx == 0) ? 0x7a : 0x7d, in wlc_phy_rc_sweep_nphy()
27201 write_radio_reg(pi, in wlc_phy_rc_sweep_nphy()
27207 wlc_phy_tx_tone_nphy(pi, ref_tone, NPHY_RXCAL_TONEAMP, in wlc_phy_rc_sweep_nphy()
27211 wlc_phy_rx_iq_est_nphy(pi, est, num_samps, 32, 0); in wlc_phy_rc_sweep_nphy()
27226 wlc_phy_tx_tone_nphy(pi, target_bw, NPHY_RXCAL_TONEAMP, in wlc_phy_rc_sweep_nphy()
27231 wlc_phy_rx_iq_est_nphy(pi, est, num_samps, 32, 0); in wlc_phy_rc_sweep_nphy()
27264 if (CHSPEC_IS40(pi->radio_chanspec)) { in wlc_phy_rc_sweep_nphy()
27274 write_radio_reg(pi, in wlc_phy_rc_sweep_nphy()
27280 wlc_phy_stopplayback_nphy(pi); in wlc_phy_rc_sweep_nphy()
27282 write_radio_reg(pi, (RADIO_2056_TX_TXLPF_RCCAL | radio_addr_offset_tx), in wlc_phy_rc_sweep_nphy()
27284 write_radio_reg(pi, in wlc_phy_rc_sweep_nphy()
27288 mod_phy_reg(pi, 0x48, (0x1 << 8), (orig_dcBypass << 8)); in wlc_phy_rc_sweep_nphy()
27290 write_phy_reg(pi, 0x267, orig_RxStrnFilt40Num[0]); in wlc_phy_rc_sweep_nphy()
27291 write_phy_reg(pi, 0x268, orig_RxStrnFilt40Num[1]); in wlc_phy_rc_sweep_nphy()
27292 write_phy_reg(pi, 0x269, orig_RxStrnFilt40Num[2]); in wlc_phy_rc_sweep_nphy()
27293 write_phy_reg(pi, 0x26a, orig_RxStrnFilt40Den[0]); in wlc_phy_rc_sweep_nphy()
27294 write_phy_reg(pi, 0x26b, orig_RxStrnFilt40Den[1]); in wlc_phy_rc_sweep_nphy()
27295 write_phy_reg(pi, 0x26c, orig_RxStrnFilt40Num[3]); in wlc_phy_rc_sweep_nphy()
27296 write_phy_reg(pi, 0x26d, orig_RxStrnFilt40Num[4]); in wlc_phy_rc_sweep_nphy()
27297 write_phy_reg(pi, 0x26e, orig_RxStrnFilt40Num[5]); in wlc_phy_rc_sweep_nphy()
27298 write_phy_reg(pi, 0x26f, orig_RxStrnFilt40Den[2]); in wlc_phy_rc_sweep_nphy()
27299 write_phy_reg(pi, 0x270, orig_RxStrnFilt40Den[3]); in wlc_phy_rc_sweep_nphy()
27301 write_phy_reg(pi, 0xe7, orig_rfctrloverride[0]); in wlc_phy_rc_sweep_nphy()
27302 write_phy_reg(pi, 0xec, orig_rfctrloverride[1]); in wlc_phy_rc_sweep_nphy()
27303 write_phy_reg(pi, 0xf8, orig_rfctrlauxreg[0]); in wlc_phy_rc_sweep_nphy()
27304 write_phy_reg(pi, 0xfa, orig_rfctrlauxreg[1]); in wlc_phy_rc_sweep_nphy()
27305 write_phy_reg(pi, (core_idx == 0) ? 0x7a : 0x7d, orig_rfctrlrssiothers); in wlc_phy_rc_sweep_nphy()
27307 pi->nphy_anarxlpf_adjusted = false; in wlc_phy_rc_sweep_nphy()
27313 static int wlc_phy_cal_rxiq_nphy_rev3(struct brcms_phy *pi, in wlc_phy_cal_rxiq_nphy_rev3() argument
27329 orig_BBConfig = read_phy_reg(pi, 0x01); in wlc_phy_cal_rxiq_nphy_rev3()
27330 mod_phy_reg(pi, 0x01, (0x1 << 15), 0); in wlc_phy_cal_rxiq_nphy_rev3()
27332 wlc_phy_stay_in_carriersearch_nphy(pi, true); in wlc_phy_cal_rxiq_nphy_rev3()
27334 if (NREV_GE(pi->pubpi.phy_rev, 4)) { in wlc_phy_cal_rxiq_nphy_rev3()
27335 phyhang_avoid_state = pi->phyhang_avoid; in wlc_phy_cal_rxiq_nphy_rev3()
27336 pi->phyhang_avoid = false; in wlc_phy_cal_rxiq_nphy_rev3()
27339 wlc_phy_table_read_nphy(pi, NPHY_TBL_ID_RFSEQ, 2, 0x110, 16, gain_save); in wlc_phy_cal_rxiq_nphy_rev3()
27342 wlc_phy_iqcal_gainparams_nphy(pi, core_no, target_gain, in wlc_phy_cal_rxiq_nphy_rev3()
27347 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_RFSEQ, 2, 0x110, 16, cal_gain); in wlc_phy_cal_rxiq_nphy_rev3()
27350 (struct brcms_phy_pub *) pi); in wlc_phy_cal_rxiq_nphy_rev3()
27352 for (rx_core = 0; rx_core < pi->pubpi.phy_corenum; rx_core++) { in wlc_phy_cal_rxiq_nphy_rev3()
27357 wlc_phy_rxcal_physetup_nphy(pi, rx_core); in wlc_phy_cal_rxiq_nphy_rev3()
27359 wlc_phy_rxcal_radio_setup_nphy(pi, rx_core); in wlc_phy_cal_rxiq_nphy_rev3()
27363 wlc_phy_rxcal_gainctrl_nphy(pi, rx_core, NULL, 0); in wlc_phy_cal_rxiq_nphy_rev3()
27365 wlc_phy_tx_tone_nphy(pi, in wlc_phy_cal_rxiq_nphy_rev3()
27367 pi->radio_chanspec)) ? in wlc_phy_cal_rxiq_nphy_rev3()
27376 wlc_phy_calc_rx_iq_comp_nphy(pi, rx_core + 1); in wlc_phy_cal_rxiq_nphy_rev3()
27377 wlc_phy_stopplayback_nphy(pi); in wlc_phy_cal_rxiq_nphy_rev3()
27381 && NREV_LT(pi->pubpi.phy_rev, 7)) { in wlc_phy_cal_rxiq_nphy_rev3()
27387 (struct brcms_phy_pub *) pi, 3); in wlc_phy_cal_rxiq_nphy_rev3()
27389 wlc_phy_rxcal_gainctrl_nphy(pi, rx_core, NULL, in wlc_phy_cal_rxiq_nphy_rev3()
27393 wlc_phy_rc_sweep_nphy(pi, rx_core, 1); in wlc_phy_cal_rxiq_nphy_rev3()
27394 pi->nphy_rccal_value = best_rccal[rx_core]; in wlc_phy_cal_rxiq_nphy_rev3()
27398 (struct brcms_phy_pub *) pi, in wlc_phy_cal_rxiq_nphy_rev3()
27403 wlc_phy_rxcal_radio_cleanup_nphy(pi, rx_core); in wlc_phy_cal_rxiq_nphy_rev3()
27405 wlc_phy_rxcal_phycleanup_nphy(pi, rx_core); in wlc_phy_cal_rxiq_nphy_rev3()
27406 wlc_phy_force_rfseq_nphy(pi, NPHY_RFSEQ_RESET2RX); in wlc_phy_cal_rxiq_nphy_rev3()
27412 write_radio_reg(pi, in wlc_phy_cal_rxiq_nphy_rev3()
27416 for (rx_core = 0; rx_core < pi->pubpi.phy_corenum; rx_core++) { in wlc_phy_cal_rxiq_nphy_rev3()
27421 if (PHY_IPA(pi)) { in wlc_phy_cal_rxiq_nphy_rev3()
27423 (pi->bw == WL_CHANSPEC_BW_40) ? 24 : 12; in wlc_phy_cal_rxiq_nphy_rev3()
27424 txlpf_idac = (pi->bw == WL_CHANSPEC_BW_40) ? in wlc_phy_cal_rxiq_nphy_rev3()
27426 WRITE_RADIO_REG2(pi, RADIO_2056, TX, rx_core, in wlc_phy_cal_rxiq_nphy_rev3()
27435 write_radio_reg(pi, (RADIO_2056_RX_RXLPF_RCCAL_HPC | in wlc_phy_cal_rxiq_nphy_rev3()
27441 write_radio_reg(pi, (RADIO_2056_TX_TXLPF_RCCAL | in wlc_phy_cal_rxiq_nphy_rev3()
27449 write_phy_reg(pi, 0x01, orig_BBConfig); in wlc_phy_cal_rxiq_nphy_rev3()
27451 wlc_phy_resetcca_nphy(pi); in wlc_phy_cal_rxiq_nphy_rev3()
27453 if (NREV_GE(pi->pubpi.phy_rev, 7)) in wlc_phy_cal_rxiq_nphy_rev3()
27455 pi, in wlc_phy_cal_rxiq_nphy_rev3()
27459 wlc_phy_rfctrl_override_nphy(pi, (0x1 << 12), 0, 0x3, 1); in wlc_phy_cal_rxiq_nphy_rev3()
27461 wlc_phy_force_rfseq_nphy(pi, NPHY_RFSEQ_RESET2RX); in wlc_phy_cal_rxiq_nphy_rev3()
27463 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_RFSEQ, 2, 0x110, 16, in wlc_phy_cal_rxiq_nphy_rev3()
27466 if (NREV_GE(pi->pubpi.phy_rev, 4)) in wlc_phy_cal_rxiq_nphy_rev3()
27467 pi->phyhang_avoid = phyhang_avoid_state; in wlc_phy_cal_rxiq_nphy_rev3()
27469 wlc_phy_stay_in_carriersearch_nphy(pi, false); in wlc_phy_cal_rxiq_nphy_rev3()
27475 wlc_phy_cal_rxiq_nphy_rev2(struct brcms_phy *pi, in wlc_phy_cal_rxiq_nphy_rev2() argument
27499 wlc_phy_stay_in_carriersearch_nphy(pi, true); in wlc_phy_cal_rxiq_nphy_rev2()
27501 if (NREV_LT(pi->pubpi.phy_rev, 2)) in wlc_phy_cal_rxiq_nphy_rev2()
27502 wlc_phy_reapply_txcal_coeffs_nphy(pi); in wlc_phy_cal_rxiq_nphy_rev2()
27504 wlc_phy_table_read_nphy(pi, NPHY_TBL_ID_RFSEQ, 2, 0x110, 16, gain_save); in wlc_phy_cal_rxiq_nphy_rev2()
27507 wlc_phy_iqcal_gainparams_nphy(pi, core_no, target_gain, in wlc_phy_cal_rxiq_nphy_rev2()
27512 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_RFSEQ, 2, 0x110, 16, cal_gain); in wlc_phy_cal_rxiq_nphy_rev2()
27522 orig_RfseqCoreActv = read_phy_reg(pi, 0xa2); in wlc_phy_cal_rxiq_nphy_rev2()
27523 orig_AfectrlCore = read_phy_reg(pi, (rx_core == PHY_CORE_0) ? in wlc_phy_cal_rxiq_nphy_rev2()
27525 orig_AfectrlOverride = read_phy_reg(pi, 0xa5); in wlc_phy_cal_rxiq_nphy_rev2()
27526 orig_RfctrlIntcRx = read_phy_reg(pi, (rx_core == PHY_CORE_0) ? in wlc_phy_cal_rxiq_nphy_rev2()
27528 orig_RfctrlIntcTx = read_phy_reg(pi, (tx_core == PHY_CORE_0) ? in wlc_phy_cal_rxiq_nphy_rev2()
27531 mod_phy_reg(pi, 0xa2, (0xf << 12), (1 << tx_core) << 12); in wlc_phy_cal_rxiq_nphy_rev2()
27532 mod_phy_reg(pi, 0xa2, (0xf << 0), (1 << tx_core) << 0); in wlc_phy_cal_rxiq_nphy_rev2()
27534 or_phy_reg(pi, ((rx_core == PHY_CORE_0) ? 0xa6 : 0xa7), in wlc_phy_cal_rxiq_nphy_rev2()
27536 or_phy_reg(pi, 0xa5, ((0x1 << 1) | (0x1 << 2))); in wlc_phy_cal_rxiq_nphy_rev2()
27538 if (((pi->nphy_rxcalparams) & 0xff000000)) in wlc_phy_cal_rxiq_nphy_rev2()
27539 write_phy_reg(pi, in wlc_phy_cal_rxiq_nphy_rev2()
27541 (CHSPEC_IS5G(pi->radio_chanspec) ? in wlc_phy_cal_rxiq_nphy_rev2()
27544 write_phy_reg(pi, in wlc_phy_cal_rxiq_nphy_rev2()
27546 (CHSPEC_IS5G(pi->radio_chanspec) ? in wlc_phy_cal_rxiq_nphy_rev2()
27549 write_phy_reg(pi, (tx_core == PHY_CORE_0) ? 0x91 : 0x92, in wlc_phy_cal_rxiq_nphy_rev2()
27550 (CHSPEC_IS5G(pi->radio_chanspec) ? 0x148 : in wlc_phy_cal_rxiq_nphy_rev2()
27562 if ((pi->nphy_rxcalparams & 0x10000)) { in wlc_phy_cal_rxiq_nphy_rev2()
27563 mod_radio_reg(pi, RADIO_2055_CORE1_GEN_SPARE2, mask, in wlc_phy_cal_rxiq_nphy_rev2()
27565 mod_radio_reg(pi, RADIO_2055_CORE2_GEN_SPARE2, mask, in wlc_phy_cal_rxiq_nphy_rev2()
27619 wlc_phy_rfctrl_override_nphy(pi, (0x1 << 10), in wlc_phy_cal_rxiq_nphy_rev2()
27623 wlc_phy_force_rfseq_nphy(pi, NPHY_RFSEQ_RESET2RX); in wlc_phy_cal_rxiq_nphy_rev2()
27625 wlc_phy_stopplayback_nphy(pi); in wlc_phy_cal_rxiq_nphy_rev2()
27628 bcmerror = wlc_phy_tx_tone_nphy(pi, 4000, in wlc_phy_cal_rxiq_nphy_rev2()
27629 (u16) (pi->nphy_rxcalparams & in wlc_phy_cal_rxiq_nphy_rev2()
27633 phy_bw = (CHSPEC_IS40(pi->radio_chanspec)) ? in wlc_phy_cal_rxiq_nphy_rev2()
27635 wlc_phy_runsamples_nphy(pi, phy_bw * 8, 0xffff, in wlc_phy_cal_rxiq_nphy_rev2()
27642 wlc_phy_rx_iq_est_nphy(pi, est, in wlc_phy_cal_rxiq_nphy_rev2()
27652 wlc_phy_calc_rx_iq_comp_nphy(pi, in wlc_phy_cal_rxiq_nphy_rev2()
27657 wlc_phy_stopplayback_nphy(pi); in wlc_phy_cal_rxiq_nphy_rev2()
27664 and_radio_reg(pi, RADIO_2055_CORE1_GEN_SPARE2, ~mask); in wlc_phy_cal_rxiq_nphy_rev2()
27665 and_radio_reg(pi, RADIO_2055_CORE2_GEN_SPARE2, ~mask); in wlc_phy_cal_rxiq_nphy_rev2()
27667 write_phy_reg(pi, (tx_core == PHY_CORE_0) ? 0x91 : in wlc_phy_cal_rxiq_nphy_rev2()
27669 write_phy_reg(pi, (rx_core == PHY_CORE_0) ? 0x91 : in wlc_phy_cal_rxiq_nphy_rev2()
27671 write_phy_reg(pi, 0xa5, orig_AfectrlOverride); in wlc_phy_cal_rxiq_nphy_rev2()
27672 write_phy_reg(pi, (rx_core == PHY_CORE_0) ? 0xa6 : in wlc_phy_cal_rxiq_nphy_rev2()
27674 write_phy_reg(pi, 0xa2, orig_RfseqCoreActv); in wlc_phy_cal_rxiq_nphy_rev2()
27680 wlc_phy_rfctrl_override_nphy(pi, (0x1 << 10), 0, 0x3, 1); in wlc_phy_cal_rxiq_nphy_rev2()
27681 wlc_phy_force_rfseq_nphy(pi, NPHY_RFSEQ_RESET2RX); in wlc_phy_cal_rxiq_nphy_rev2()
27683 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_RFSEQ, 2, 0x110, 16, in wlc_phy_cal_rxiq_nphy_rev2()
27686 wlc_phy_stay_in_carriersearch_nphy(pi, false); in wlc_phy_cal_rxiq_nphy_rev2()
27692 wlc_phy_cal_rxiq_nphy(struct brcms_phy *pi, struct nphy_txgains target_gain, in wlc_phy_cal_rxiq_nphy() argument
27695 if (NREV_GE(pi->pubpi.phy_rev, 7)) in wlc_phy_cal_rxiq_nphy()
27698 if (NREV_GE(pi->pubpi.phy_rev, 3)) in wlc_phy_cal_rxiq_nphy()
27699 return wlc_phy_cal_rxiq_nphy_rev3(pi, target_gain, cal_type, in wlc_phy_cal_rxiq_nphy()
27702 return wlc_phy_cal_rxiq_nphy_rev2(pi, target_gain, debug); in wlc_phy_cal_rxiq_nphy()
27705 void wlc_phy_txpwr_fixpower_nphy(struct brcms_phy *pi) in wlc_phy_txpwr_fixpower_nphy() argument
27713 if (pi->phyhang_avoid) in wlc_phy_txpwr_fixpower_nphy()
27714 wlc_phy_stay_in_carriersearch_nphy(pi, true); in wlc_phy_txpwr_fixpower_nphy()
27716 if (pi->sh->sromrev < 4) { in wlc_phy_txpwr_fixpower_nphy()
27720 chan_freq_range = wlc_phy_get_chan_freq_range_nphy(pi, 0); in wlc_phy_txpwr_fixpower_nphy()
27735 if (NREV_GE(pi->pubpi.phy_rev, 7)) in wlc_phy_txpwr_fixpower_nphy()
27737 else if (NREV_GE(pi->pubpi.phy_rev, 3)) in wlc_phy_txpwr_fixpower_nphy()
27740 if (NREV_LT(pi->pubpi.phy_rev, 7)) { in wlc_phy_txpwr_fixpower_nphy()
27747 pi->nphy_txpwrindex[PHY_CORE_0].index_internal = txpi[0]; in wlc_phy_txpwr_fixpower_nphy()
27748 pi->nphy_txpwrindex[PHY_CORE_1].index_internal = txpi[1]; in wlc_phy_txpwr_fixpower_nphy()
27749 pi->nphy_txpwrindex[PHY_CORE_0].index_internal_save = txpi[0]; in wlc_phy_txpwr_fixpower_nphy()
27750 pi->nphy_txpwrindex[PHY_CORE_1].index_internal_save = txpi[1]; in wlc_phy_txpwr_fixpower_nphy()
27752 for (core = 0; core < pi->pubpi.phy_corenum; core++) { in wlc_phy_txpwr_fixpower_nphy()
27753 uint phyrev = pi->pubpi.phy_rev; in wlc_phy_txpwr_fixpower_nphy()
27756 if (PHY_IPA(pi)) { in wlc_phy_txpwr_fixpower_nphy()
27758 wlc_phy_get_ipa_gaintbl_nphy(pi); in wlc_phy_txpwr_fixpower_nphy()
27761 if (CHSPEC_IS5G(pi->radio_chanspec)) { in wlc_phy_txpwr_fixpower_nphy()
27768 pi->srom_fem5g.extpagain == in wlc_phy_txpwr_fixpower_nphy()
27781 (pi->srom_fem2g.extpagain == 3)) { in wlc_phy_txpwr_fixpower_nphy()
27808 mod_phy_reg(pi, ((core == PHY_CORE_0) ? 0x8f : in wlc_phy_txpwr_fixpower_nphy()
27811 mod_phy_reg(pi, 0xa5, (0x1 << 14), (0x1 << 14)); in wlc_phy_txpwr_fixpower_nphy()
27813 write_phy_reg(pi, (core == PHY_CORE_0) ? 0xaa : 0xab, dac_gain); in wlc_phy_txpwr_fixpower_nphy()
27815 wlc_phy_table_write_nphy(pi, 7, 1, (0x110 + core), 16, in wlc_phy_txpwr_fixpower_nphy()
27818 wlc_phy_table_read_nphy(pi, 15, 1, 87, 16, &m1m2); in wlc_phy_txpwr_fixpower_nphy()
27821 wlc_phy_table_write_nphy(pi, 15, 1, 87, 16, &m1m2); in wlc_phy_txpwr_fixpower_nphy()
27823 if (PHY_IPA(pi)) { in wlc_phy_txpwr_fixpower_nphy()
27824 wlc_phy_table_read_nphy(pi, in wlc_phy_txpwr_fixpower_nphy()
27832 mod_phy_reg(pi, (core == PHY_CORE_0) ? 0x297 : in wlc_phy_txpwr_fixpower_nphy()
27836 mod_phy_reg(pi, (core == PHY_CORE_0) ? 0x297 : in wlc_phy_txpwr_fixpower_nphy()
27842 and_phy_reg(pi, 0xbf, (u16) (~(0x1f << 0))); in wlc_phy_txpwr_fixpower_nphy()
27844 if (pi->phyhang_avoid) in wlc_phy_txpwr_fixpower_nphy()
27845 wlc_phy_stay_in_carriersearch_nphy(pi, false); in wlc_phy_txpwr_fixpower_nphy()
27904 void wlc_phy_txpwr_apply_nphy(struct brcms_phy *pi) in wlc_phy_txpwr_apply_nphy() argument
27917 tmp_max_pwr = min(pi->nphy_pwrctrl_info[0].max_pwr_2g, in wlc_phy_txpwr_apply_nphy()
27918 pi->nphy_pwrctrl_info[1].max_pwr_2g); in wlc_phy_txpwr_apply_nphy()
27920 pwr_offsets1[0] = pi->cck2gpo; in wlc_phy_txpwr_apply_nphy()
27921 wlc_phy_txpwr_nphy_srom_convert(pi->tx_srom_max_rate_2g, in wlc_phy_txpwr_apply_nphy()
27927 pwr_offsets1[0] = (u16) (pi->ofdm2gpo & 0xffff); in wlc_phy_txpwr_apply_nphy()
27929 (u16) (pi->ofdm2gpo >> 16) & 0xffff; in wlc_phy_txpwr_apply_nphy()
27931 pwr_offsets2 = pi->mcs2gpo; in wlc_phy_txpwr_apply_nphy()
27933 tmp_cddpo = pi->cdd2gpo; in wlc_phy_txpwr_apply_nphy()
27934 tmp_stbcpo = pi->stbc2gpo; in wlc_phy_txpwr_apply_nphy()
27935 tmp_bw40po = pi->bw402gpo; in wlc_phy_txpwr_apply_nphy()
27937 tx_srom_max_rate = pi->tx_srom_max_rate_2g; in wlc_phy_txpwr_apply_nphy()
27941 tmp_max_pwr = min(pi->nphy_pwrctrl_info[0].max_pwr_5gm, in wlc_phy_txpwr_apply_nphy()
27942 pi->nphy_pwrctrl_info[1].max_pwr_5gm); in wlc_phy_txpwr_apply_nphy()
27944 pwr_offsets1[0] = (u16) (pi->ofdm5gpo & 0xffff); in wlc_phy_txpwr_apply_nphy()
27946 (u16) (pi->ofdm5gpo >> 16) & 0xffff; in wlc_phy_txpwr_apply_nphy()
27948 pwr_offsets2 = pi->mcs5gpo; in wlc_phy_txpwr_apply_nphy()
27950 tmp_cddpo = pi->cdd5gpo; in wlc_phy_txpwr_apply_nphy()
27951 tmp_stbcpo = pi->stbc5gpo; in wlc_phy_txpwr_apply_nphy()
27952 tmp_bw40po = pi->bw405gpo; in wlc_phy_txpwr_apply_nphy()
27954 tx_srom_max_rate = pi->tx_srom_max_rate_5g_mid; in wlc_phy_txpwr_apply_nphy()
27958 tmp_max_pwr = min(pi->nphy_pwrctrl_info[0].max_pwr_5gl, in wlc_phy_txpwr_apply_nphy()
27959 pi->nphy_pwrctrl_info[1].max_pwr_5gl); in wlc_phy_txpwr_apply_nphy()
27961 pwr_offsets1[0] = (u16) (pi->ofdm5glpo & 0xffff); in wlc_phy_txpwr_apply_nphy()
27963 (u16) (pi->ofdm5glpo >> 16) & 0xffff; in wlc_phy_txpwr_apply_nphy()
27965 pwr_offsets2 = pi->mcs5glpo; in wlc_phy_txpwr_apply_nphy()
27967 tmp_cddpo = pi->cdd5glpo; in wlc_phy_txpwr_apply_nphy()
27968 tmp_stbcpo = pi->stbc5glpo; in wlc_phy_txpwr_apply_nphy()
27969 tmp_bw40po = pi->bw405glpo; in wlc_phy_txpwr_apply_nphy()
27971 tx_srom_max_rate = pi->tx_srom_max_rate_5g_low; in wlc_phy_txpwr_apply_nphy()
27975 tmp_max_pwr = min(pi->nphy_pwrctrl_info[0].max_pwr_5gh, in wlc_phy_txpwr_apply_nphy()
27976 pi->nphy_pwrctrl_info[1].max_pwr_5gh); in wlc_phy_txpwr_apply_nphy()
27978 pwr_offsets1[0] = (u16) (pi->ofdm5ghpo & 0xffff); in wlc_phy_txpwr_apply_nphy()
27980 (u16) (pi->ofdm5ghpo >> 16) & 0xffff; in wlc_phy_txpwr_apply_nphy()
27982 pwr_offsets2 = pi->mcs5ghpo; in wlc_phy_txpwr_apply_nphy()
27984 tmp_cddpo = pi->cdd5ghpo; in wlc_phy_txpwr_apply_nphy()
27985 tmp_stbcpo = pi->stbc5ghpo; in wlc_phy_txpwr_apply_nphy()
27986 tmp_bw40po = pi->bw405ghpo; in wlc_phy_txpwr_apply_nphy()
27988 tx_srom_max_rate = pi->tx_srom_max_rate_5g_hi; in wlc_phy_txpwr_apply_nphy()
28006 if (NREV_GE(pi->pubpi.phy_rev, 3)) in wlc_phy_txpwr_apply_nphy()
28021 if (NREV_GE(pi->pubpi.phy_rev, 3)) in wlc_phy_txpwr_apply_nphy()
28086 if (NREV_GE(pi->pubpi.phy_rev, 3)) in wlc_phy_txpwr_apply_nphy()
28099 void wlc_phy_txpower_recalc_target_nphy(struct brcms_phy *pi) in wlc_phy_txpower_recalc_target_nphy() argument
28102 wlc_phy_txpwr_limit_to_tbl_nphy(pi); in wlc_phy_txpower_recalc_target_nphy()
28103 wlc_phy_txpwrctrl_pwr_setup_nphy(pi); in wlc_phy_txpower_recalc_target_nphy()
28105 tx_pwr_ctrl_state = pi->nphy_txpwrctrl; in wlc_phy_txpower_recalc_target_nphy()
28107 if (D11REV_IS(pi->sh->corerev, 11) || D11REV_IS(pi->sh->corerev, 12)) { in wlc_phy_txpower_recalc_target_nphy()
28108 wlapi_bmac_mctrl(pi->sh->physhim, MCTL_PHYLOCK, MCTL_PHYLOCK); in wlc_phy_txpower_recalc_target_nphy()
28109 (void)bcma_read32(pi->d11core, D11REGOFFS(maccontrol)); in wlc_phy_txpower_recalc_target_nphy()
28113 wlc_phy_txpwrctrl_enable_nphy(pi, tx_pwr_ctrl_state); in wlc_phy_txpower_recalc_target_nphy()
28115 if (D11REV_IS(pi->sh->corerev, 11) || D11REV_IS(pi->sh->corerev, 12)) in wlc_phy_txpower_recalc_target_nphy()
28116 wlapi_bmac_mctrl(pi->sh->physhim, MCTL_PHYLOCK, 0); in wlc_phy_txpower_recalc_target_nphy()
28119 static bool wlc_phy_txpwr_ison_nphy(struct brcms_phy *pi) in wlc_phy_txpwr_ison_nphy() argument
28121 return read_phy_reg((pi), 0x1e7) & ((0x1 << 15) | in wlc_phy_txpwr_ison_nphy()
28125 u16 wlc_phy_txpwr_idx_get_nphy(struct brcms_phy *pi) in wlc_phy_txpwr_idx_get_nphy() argument
28130 if (wlc_phy_txpwr_ison_nphy(pi)) { in wlc_phy_txpwr_idx_get_nphy()
28131 pwr_idx[0] = wlc_phy_txpwr_idx_cur_get_nphy(pi, PHY_CORE_0); in wlc_phy_txpwr_idx_get_nphy()
28132 pwr_idx[1] = wlc_phy_txpwr_idx_cur_get_nphy(pi, PHY_CORE_1); in wlc_phy_txpwr_idx_get_nphy()
28136 tmp = ((pi->nphy_txpwrindex[PHY_CORE_0].index_internal & 0xff) in wlc_phy_txpwr_idx_get_nphy()
28138 (pi->nphy_txpwrindex[PHY_CORE_1].index_internal & 0xff); in wlc_phy_txpwr_idx_get_nphy()
28144 void wlc_phy_txpwr_papd_cal_nphy(struct brcms_phy *pi) in wlc_phy_txpwr_papd_cal_nphy() argument
28146 if (PHY_IPA(pi) in wlc_phy_txpwr_papd_cal_nphy()
28147 && (pi->nphy_force_papd_cal in wlc_phy_txpwr_papd_cal_nphy()
28148 || (wlc_phy_txpwr_ison_nphy(pi) in wlc_phy_txpwr_papd_cal_nphy()
28151 abs(wlc_phy_txpwr_idx_cur_get_nphy(pi, 0) - in wlc_phy_txpwr_papd_cal_nphy()
28152 pi->nphy_papd_tx_gain_at_last_cal[0]) >= 4) in wlc_phy_txpwr_papd_cal_nphy()
28154 abs(wlc_phy_txpwr_idx_cur_get_nphy(pi, 1) - in wlc_phy_txpwr_papd_cal_nphy()
28155 pi->nphy_papd_tx_gain_at_last_cal[1]) >= 4))))) in wlc_phy_txpwr_papd_cal_nphy()
28156 wlc_phy_a4(pi, true); in wlc_phy_txpwr_papd_cal_nphy()
28159 void wlc_phy_txpwrctrl_enable_nphy(struct brcms_phy *pi, u8 ctrl_type) in wlc_phy_txpwrctrl_enable_nphy() argument
28168 if (pi->phyhang_avoid) in wlc_phy_txpwrctrl_enable_nphy()
28169 wlc_phy_stay_in_carriersearch_nphy(pi, true); in wlc_phy_txpwrctrl_enable_nphy()
28174 pi->nphy_txpwrctrl = ctrl_type; in wlc_phy_txpwrctrl_enable_nphy()
28181 if (NREV_GE(pi->pubpi.phy_rev, 3)) { in wlc_phy_txpwrctrl_enable_nphy()
28183 if (wlc_phy_txpwr_ison_nphy(pi)) { in wlc_phy_txpwrctrl_enable_nphy()
28184 for (core = 0; core < pi->pubpi.phy_corenum; in wlc_phy_txpwrctrl_enable_nphy()
28186 pi->nphy_txpwr_idx[core] = in wlc_phy_txpwrctrl_enable_nphy()
28188 pi, in wlc_phy_txpwrctrl_enable_nphy()
28198 wlc_phy_table_write_nphy(pi, 26, tbl_len, tbl_offset, 16, in wlc_phy_txpwrctrl_enable_nphy()
28200 wlc_phy_table_write_nphy(pi, 27, tbl_len, tbl_offset, 16, in wlc_phy_txpwrctrl_enable_nphy()
28203 if (NREV_GE(pi->pubpi.phy_rev, 3)) in wlc_phy_txpwrctrl_enable_nphy()
28204 and_phy_reg(pi, 0x1e7, in wlc_phy_txpwrctrl_enable_nphy()
28208 and_phy_reg(pi, 0x1e7, in wlc_phy_txpwrctrl_enable_nphy()
28211 if (NREV_GE(pi->pubpi.phy_rev, 3)) { in wlc_phy_txpwrctrl_enable_nphy()
28212 or_phy_reg(pi, 0x8f, (0x1 << 8)); in wlc_phy_txpwrctrl_enable_nphy()
28213 or_phy_reg(pi, 0xa5, (0x1 << 8)); in wlc_phy_txpwrctrl_enable_nphy()
28215 or_phy_reg(pi, 0xa5, (0x1 << 14)); in wlc_phy_txpwrctrl_enable_nphy()
28218 if (NREV_IS(pi->pubpi.phy_rev, 2)) in wlc_phy_txpwrctrl_enable_nphy()
28219 mod_phy_reg(pi, 0xdc, 0x00ff, 0x53); in wlc_phy_txpwrctrl_enable_nphy()
28220 else if (NREV_LT(pi->pubpi.phy_rev, 2)) in wlc_phy_txpwrctrl_enable_nphy()
28221 mod_phy_reg(pi, 0xdc, 0x00ff, 0x5a); in wlc_phy_txpwrctrl_enable_nphy()
28223 if (NREV_LT(pi->pubpi.phy_rev, 2) && in wlc_phy_txpwrctrl_enable_nphy()
28224 pi->bw == WL_CHANSPEC_BW_40) in wlc_phy_txpwrctrl_enable_nphy()
28225 wlapi_bmac_mhf(pi->sh->physhim, MHF1, MHF1_IQSWAP_WAR, in wlc_phy_txpwrctrl_enable_nphy()
28230 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_CORE1TXPWRCTL, 84, 64, in wlc_phy_txpwrctrl_enable_nphy()
28231 8, pi->adj_pwr_tbl_nphy); in wlc_phy_txpwrctrl_enable_nphy()
28232 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_CORE2TXPWRCTL, 84, 64, in wlc_phy_txpwrctrl_enable_nphy()
28233 8, pi->adj_pwr_tbl_nphy); in wlc_phy_txpwrctrl_enable_nphy()
28239 if (NREV_GE(pi->pubpi.phy_rev, 3)) { in wlc_phy_txpwrctrl_enable_nphy()
28244 mod_phy_reg(pi, 0x1e7, mask, val); in wlc_phy_txpwrctrl_enable_nphy()
28246 if (CHSPEC_IS5G(pi->radio_chanspec)) { in wlc_phy_txpwrctrl_enable_nphy()
28247 if (NREV_GE(pi->pubpi.phy_rev, 7)) { in wlc_phy_txpwrctrl_enable_nphy()
28248 mod_phy_reg(pi, 0x1e7, (0x7f << 0), 0x32); in wlc_phy_txpwrctrl_enable_nphy()
28249 mod_phy_reg(pi, 0x222, (0xff << 0), 0x32); in wlc_phy_txpwrctrl_enable_nphy()
28251 mod_phy_reg(pi, 0x1e7, (0x7f << 0), 0x64); in wlc_phy_txpwrctrl_enable_nphy()
28252 if (NREV_GT(pi->pubpi.phy_rev, 1)) in wlc_phy_txpwrctrl_enable_nphy()
28253 mod_phy_reg(pi, 0x222, in wlc_phy_txpwrctrl_enable_nphy()
28258 if (NREV_GE(pi->pubpi.phy_rev, 3)) { in wlc_phy_txpwrctrl_enable_nphy()
28259 if ((pi->nphy_txpwr_idx[0] != 128) in wlc_phy_txpwrctrl_enable_nphy()
28260 && (pi->nphy_txpwr_idx[1] != 128)) in wlc_phy_txpwrctrl_enable_nphy()
28261 wlc_phy_txpwr_idx_cur_set_nphy(pi, in wlc_phy_txpwrctrl_enable_nphy()
28262 pi-> in wlc_phy_txpwrctrl_enable_nphy()
28265 pi-> in wlc_phy_txpwrctrl_enable_nphy()
28270 if (NREV_GE(pi->pubpi.phy_rev, 3)) { in wlc_phy_txpwrctrl_enable_nphy()
28271 and_phy_reg(pi, 0x8f, ~(0x1 << 8)); in wlc_phy_txpwrctrl_enable_nphy()
28272 and_phy_reg(pi, 0xa5, ~(0x1 << 8)); in wlc_phy_txpwrctrl_enable_nphy()
28274 and_phy_reg(pi, 0xa5, ~(0x1 << 14)); in wlc_phy_txpwrctrl_enable_nphy()
28277 if (NREV_IS(pi->pubpi.phy_rev, 2)) in wlc_phy_txpwrctrl_enable_nphy()
28278 mod_phy_reg(pi, 0xdc, 0x00ff, 0x3b); in wlc_phy_txpwrctrl_enable_nphy()
28279 else if (NREV_LT(pi->pubpi.phy_rev, 2)) in wlc_phy_txpwrctrl_enable_nphy()
28280 mod_phy_reg(pi, 0xdc, 0x00ff, 0x40); in wlc_phy_txpwrctrl_enable_nphy()
28282 if (NREV_LT(pi->pubpi.phy_rev, 2) && in wlc_phy_txpwrctrl_enable_nphy()
28283 pi->bw == WL_CHANSPEC_BW_40) in wlc_phy_txpwrctrl_enable_nphy()
28284 wlapi_bmac_mhf(pi->sh->physhim, MHF1, MHF1_IQSWAP_WAR, in wlc_phy_txpwrctrl_enable_nphy()
28287 if (PHY_IPA(pi)) { in wlc_phy_txpwrctrl_enable_nphy()
28288 mod_phy_reg(pi, (0 == PHY_CORE_0) ? 0x297 : in wlc_phy_txpwrctrl_enable_nphy()
28291 mod_phy_reg(pi, (1 == PHY_CORE_0) ? 0x297 : in wlc_phy_txpwrctrl_enable_nphy()
28298 if (pi->phyhang_avoid) in wlc_phy_txpwrctrl_enable_nphy()
28299 wlc_phy_stay_in_carriersearch_nphy(pi, false); in wlc_phy_txpwrctrl_enable_nphy()
28303 wlc_phy_txpwr_index_nphy(struct brcms_phy *pi, u8 core_mask, s8 txpwrindex, in wlc_phy_txpwr_index_nphy() argument
28320 if (pi->phyhang_avoid) in wlc_phy_txpwr_index_nphy()
28321 wlc_phy_stay_in_carriersearch_nphy(pi, true); in wlc_phy_txpwr_index_nphy()
28327 for (core = 0; core < pi->pubpi.phy_corenum; core++) { in wlc_phy_txpwr_index_nphy()
28335 if (pi->nphy_txpwrindex[core].index < 0) in wlc_phy_txpwr_index_nphy()
28338 if (NREV_GE(pi->pubpi.phy_rev, 3)) { in wlc_phy_txpwr_index_nphy()
28339 mod_phy_reg(pi, 0x8f, in wlc_phy_txpwr_index_nphy()
28341 pi->nphy_txpwrindex[core]. in wlc_phy_txpwr_index_nphy()
28343 mod_phy_reg(pi, 0xa5, (0x1 << 8), in wlc_phy_txpwr_index_nphy()
28344 pi->nphy_txpwrindex[core]. in wlc_phy_txpwr_index_nphy()
28347 mod_phy_reg(pi, 0xa5, in wlc_phy_txpwr_index_nphy()
28349 pi->nphy_txpwrindex[core]. in wlc_phy_txpwr_index_nphy()
28353 write_phy_reg(pi, (core == PHY_CORE_0) ? in wlc_phy_txpwr_index_nphy()
28355 pi->nphy_txpwrindex[core].AfeCtrlDacGain); in wlc_phy_txpwr_index_nphy()
28357 wlc_phy_table_write_nphy(pi, 7, 1, (0x110 + core), 16, in wlc_phy_txpwr_index_nphy()
28358 &pi->nphy_txpwrindex[core]. in wlc_phy_txpwr_index_nphy()
28361 wlc_phy_table_read_nphy(pi, 15, 1, 87, 16, &m1m2); in wlc_phy_txpwr_index_nphy()
28364 (pi->nphy_txpwrindex[core].bbmult << 8) : in wlc_phy_txpwr_index_nphy()
28365 (pi->nphy_txpwrindex[core].bbmult << 0)); in wlc_phy_txpwr_index_nphy()
28366 wlc_phy_table_write_nphy(pi, 15, 1, 87, 16, &m1m2); in wlc_phy_txpwr_index_nphy()
28370 pi, 15, 2, (80 + 2 * core), 16, in wlc_phy_txpwr_index_nphy()
28371 &pi->nphy_txpwrindex[core].iqcomp_a); in wlc_phy_txpwr_index_nphy()
28373 pi, 15, 1, (85 + core), 16, in wlc_phy_txpwr_index_nphy()
28374 &pi->nphy_txpwrindex[core].locomp); in wlc_phy_txpwr_index_nphy()
28376 pi, 15, 1, (93 + core), 16, in wlc_phy_txpwr_index_nphy()
28377 &pi->nphy_txpwrindex[core].locomp); in wlc_phy_txpwr_index_nphy()
28380 wlc_phy_txpwrctrl_enable_nphy(pi, pi->nphy_txpwrctrl); in wlc_phy_txpwr_index_nphy()
28382 pi->nphy_txpwrindex[core].index_internal = in wlc_phy_txpwr_index_nphy()
28383 pi->nphy_txpwrindex[core].index_internal_save; in wlc_phy_txpwr_index_nphy()
28386 if (pi->nphy_txpwrindex[core].index < 0) { in wlc_phy_txpwr_index_nphy()
28388 if (NREV_GE(pi->pubpi.phy_rev, 3)) { in wlc_phy_txpwr_index_nphy()
28389 mod_phy_reg(pi, 0x8f, in wlc_phy_txpwr_index_nphy()
28391 pi->nphy_txpwrindex[core]. in wlc_phy_txpwr_index_nphy()
28393 mod_phy_reg(pi, 0xa5, (0x1 << 8), in wlc_phy_txpwr_index_nphy()
28394 pi->nphy_txpwrindex[core]. in wlc_phy_txpwr_index_nphy()
28397 pi->nphy_txpwrindex[core]. in wlc_phy_txpwr_index_nphy()
28399 read_phy_reg(pi, 0xa5); in wlc_phy_txpwr_index_nphy()
28402 pi->nphy_txpwrindex[core].AfeCtrlDacGain = in wlc_phy_txpwr_index_nphy()
28403 read_phy_reg(pi, (core == PHY_CORE_0) ? in wlc_phy_txpwr_index_nphy()
28406 wlc_phy_table_read_nphy(pi, 7, 1, in wlc_phy_txpwr_index_nphy()
28408 &pi-> in wlc_phy_txpwr_index_nphy()
28412 wlc_phy_table_read_nphy(pi, 15, 1, 87, 16, in wlc_phy_txpwr_index_nphy()
28416 pi->nphy_txpwrindex[core].bbmult = (u8) tmpval; in wlc_phy_txpwr_index_nphy()
28418 wlc_phy_table_read_nphy(pi, 15, 2, in wlc_phy_txpwr_index_nphy()
28420 &pi-> in wlc_phy_txpwr_index_nphy()
28424 wlc_phy_table_read_nphy(pi, 15, 1, (85 + core), in wlc_phy_txpwr_index_nphy()
28426 &pi-> in wlc_phy_txpwr_index_nphy()
28430 pi->nphy_txpwrindex[core].index_internal_save = in wlc_phy_txpwr_index_nphy()
28431 pi->nphy_txpwrindex[core]. in wlc_phy_txpwr_index_nphy()
28435 tx_pwr_ctrl_state = pi->nphy_txpwrctrl; in wlc_phy_txpwr_index_nphy()
28436 wlc_phy_txpwrctrl_enable_nphy(pi, PHY_TPC_HW_OFF); in wlc_phy_txpwr_index_nphy()
28438 if (NREV_IS(pi->pubpi.phy_rev, 1)) in wlc_phy_txpwr_index_nphy()
28439 wlapi_bmac_phyclk_fgc(pi->sh->physhim, ON); in wlc_phy_txpwr_index_nphy()
28441 wlc_phy_table_read_nphy(pi, txpwrctl_tbl, 1, in wlc_phy_txpwr_index_nphy()
28445 if (NREV_GE(pi->pubpi.phy_rev, 3)) in wlc_phy_txpwr_index_nphy()
28455 if (NREV_GE(pi->pubpi.phy_rev, 3)) in wlc_phy_txpwr_index_nphy()
28456 mod_phy_reg(pi, ((core == PHY_CORE_0) ? 0x8f : in wlc_phy_txpwr_index_nphy()
28459 mod_phy_reg(pi, 0xa5, (0x1 << 14), (0x1 << 14)); in wlc_phy_txpwr_index_nphy()
28461 write_phy_reg(pi, (core == PHY_CORE_0) ? in wlc_phy_txpwr_index_nphy()
28464 wlc_phy_table_write_nphy(pi, 7, 1, (0x110 + core), 16, in wlc_phy_txpwr_index_nphy()
28467 wlc_phy_table_read_nphy(pi, 15, 1, 87, 16, &m1m2); in wlc_phy_txpwr_index_nphy()
28472 wlc_phy_table_write_nphy(pi, 15, 1, 87, 16, &m1m2); in wlc_phy_txpwr_index_nphy()
28474 wlc_phy_table_read_nphy(pi, txpwrctl_tbl, 1, in wlc_phy_txpwr_index_nphy()
28483 wlc_phy_table_write_nphy(pi, 15, 2, in wlc_phy_txpwr_index_nphy()
28488 wlc_phy_table_read_nphy(pi, txpwrctl_tbl, 1, in wlc_phy_txpwr_index_nphy()
28492 wlc_phy_table_write_nphy(pi, 15, 1, (85 + core), in wlc_phy_txpwr_index_nphy()
28495 if (NREV_IS(pi->pubpi.phy_rev, 1)) in wlc_phy_txpwr_index_nphy()
28496 wlapi_bmac_phyclk_fgc(pi->sh->physhim, OFF); in wlc_phy_txpwr_index_nphy()
28498 if (PHY_IPA(pi)) { in wlc_phy_txpwr_index_nphy()
28499 wlc_phy_table_read_nphy(pi, in wlc_phy_txpwr_index_nphy()
28506 mod_phy_reg(pi, (core == PHY_CORE_0) ? 0x297 : in wlc_phy_txpwr_index_nphy()
28510 mod_phy_reg(pi, (core == PHY_CORE_0) ? 0x297 : in wlc_phy_txpwr_index_nphy()
28515 wlc_phy_txpwrctrl_enable_nphy(pi, tx_pwr_ctrl_state); in wlc_phy_txpwr_index_nphy()
28518 pi->nphy_txpwrindex[core].index = txpwrindex; in wlc_phy_txpwr_index_nphy()
28521 if (pi->phyhang_avoid) in wlc_phy_txpwr_index_nphy()
28522 wlc_phy_stay_in_carriersearch_nphy(pi, false); in wlc_phy_txpwr_index_nphy()
28526 wlc_phy_txpower_sromlimit_get_nphy(struct brcms_phy *pi, uint chan, u8 *max_pwr, in wlc_phy_txpower_sromlimit_get_nphy() argument
28531 chan_freq_range = wlc_phy_get_chan_freq_range_nphy(pi, chan); in wlc_phy_txpower_sromlimit_get_nphy()
28534 *max_pwr = pi->tx_srom_max_rate_2g[txp_rate_idx]; in wlc_phy_txpower_sromlimit_get_nphy()
28537 *max_pwr = pi->tx_srom_max_rate_5g_mid[txp_rate_idx]; in wlc_phy_txpower_sromlimit_get_nphy()
28540 *max_pwr = pi->tx_srom_max_rate_5g_low[txp_rate_idx]; in wlc_phy_txpower_sromlimit_get_nphy()
28543 *max_pwr = pi->tx_srom_max_rate_5g_hi[txp_rate_idx]; in wlc_phy_txpower_sromlimit_get_nphy()
28546 *max_pwr = pi->tx_srom_max_rate_2g[txp_rate_idx]; in wlc_phy_txpower_sromlimit_get_nphy()
28553 void wlc_phy_stay_in_carriersearch_nphy(struct brcms_phy *pi, bool enable) in wlc_phy_stay_in_carriersearch_nphy() argument
28558 if (pi->nphy_deaf_count == 0) { in wlc_phy_stay_in_carriersearch_nphy()
28559 pi->classifier_state = in wlc_phy_stay_in_carriersearch_nphy()
28560 wlc_phy_classifier_nphy(pi, 0, 0); in wlc_phy_stay_in_carriersearch_nphy()
28561 wlc_phy_classifier_nphy(pi, (0x7 << 0), 4); in wlc_phy_stay_in_carriersearch_nphy()
28562 wlc_phy_clip_det_nphy(pi, 0, pi->clip_state); in wlc_phy_stay_in_carriersearch_nphy()
28563 wlc_phy_clip_det_nphy(pi, 1, clip_off); in wlc_phy_stay_in_carriersearch_nphy()
28566 pi->nphy_deaf_count++; in wlc_phy_stay_in_carriersearch_nphy()
28568 wlc_phy_resetcca_nphy(pi); in wlc_phy_stay_in_carriersearch_nphy()
28571 pi->nphy_deaf_count--; in wlc_phy_stay_in_carriersearch_nphy()
28573 if (pi->nphy_deaf_count == 0) { in wlc_phy_stay_in_carriersearch_nphy()
28574 wlc_phy_classifier_nphy(pi, (0x7 << 0), in wlc_phy_stay_in_carriersearch_nphy()
28575 pi->classifier_state); in wlc_phy_stay_in_carriersearch_nphy()
28576 wlc_phy_clip_det_nphy(pi, 1, pi->clip_state); in wlc_phy_stay_in_carriersearch_nphy()
28581 void wlc_nphy_deaf_mode(struct brcms_phy *pi, bool mode) in wlc_nphy_deaf_mode() argument
28583 wlapi_suspend_mac_and_wait(pi->sh->physhim); in wlc_nphy_deaf_mode()
28586 if (pi->nphy_deaf_count == 0) in wlc_nphy_deaf_mode()
28587 wlc_phy_stay_in_carriersearch_nphy(pi, true); in wlc_nphy_deaf_mode()
28588 } else if (pi->nphy_deaf_count > 0) { in wlc_nphy_deaf_mode()
28589 wlc_phy_stay_in_carriersearch_nphy(pi, false); in wlc_nphy_deaf_mode()
28592 wlapi_enable_mac(pi->sh->physhim); in wlc_nphy_deaf_mode()