Lines Matching full:efuse

15 #include "efuse.h"
34 struct rtw_efuse *efuse = &rtwdev->efuse; in rtw8812a_read_amplifier_type() local
36 efuse->ext_pa_2g = (efuse->pa_type_2g & BIT(5)) && in rtw8812a_read_amplifier_type()
37 (efuse->pa_type_2g & BIT(4)); in rtw8812a_read_amplifier_type()
38 efuse->ext_lna_2g = (efuse->lna_type_2g & BIT(7)) && in rtw8812a_read_amplifier_type()
39 (efuse->lna_type_2g & BIT(3)); in rtw8812a_read_amplifier_type()
41 efuse->ext_pa_5g = (efuse->pa_type_5g & BIT(1)) && in rtw8812a_read_amplifier_type()
42 (efuse->pa_type_5g & BIT(0)); in rtw8812a_read_amplifier_type()
43 efuse->ext_lna_5g = (efuse->lna_type_5g & BIT(7)) && in rtw8812a_read_amplifier_type()
44 (efuse->lna_type_5g & BIT(3)); in rtw8812a_read_amplifier_type()
47 if (efuse->ext_pa_2g) { in rtw8812a_read_amplifier_type()
48 u8 ext_type_pa_2g_a = u8_get_bits(efuse->lna_type_2g, BIT(2)); in rtw8812a_read_amplifier_type()
49 u8 ext_type_pa_2g_b = u8_get_bits(efuse->lna_type_2g, BIT(6)); in rtw8812a_read_amplifier_type()
51 efuse->gpa_type = (ext_type_pa_2g_b << 2) | ext_type_pa_2g_a; in rtw8812a_read_amplifier_type()
54 if (efuse->ext_pa_5g) { in rtw8812a_read_amplifier_type()
55 u8 ext_type_pa_5g_a = u8_get_bits(efuse->lna_type_5g, BIT(2)); in rtw8812a_read_amplifier_type()
56 u8 ext_type_pa_5g_b = u8_get_bits(efuse->lna_type_5g, BIT(6)); in rtw8812a_read_amplifier_type()
58 efuse->apa_type = (ext_type_pa_5g_b << 2) | ext_type_pa_5g_a; in rtw8812a_read_amplifier_type()
61 if (efuse->ext_lna_2g) { in rtw8812a_read_amplifier_type()
62 u8 ext_type_lna_2g_a = u8_get_bits(efuse->lna_type_2g, in rtw8812a_read_amplifier_type()
64 u8 ext_type_lna_2g_b = u8_get_bits(efuse->lna_type_2g, in rtw8812a_read_amplifier_type()
67 efuse->glna_type = (ext_type_lna_2g_b << 2) | ext_type_lna_2g_a; in rtw8812a_read_amplifier_type()
70 if (efuse->ext_lna_5g) { in rtw8812a_read_amplifier_type()
71 u8 ext_type_lna_5g_a = u8_get_bits(efuse->lna_type_5g, in rtw8812a_read_amplifier_type()
73 u8 ext_type_lna_5g_b = u8_get_bits(efuse->lna_type_5g, in rtw8812a_read_amplifier_type()
76 efuse->alna_type = (ext_type_lna_5g_b << 2) | ext_type_lna_5g_a; in rtw8812a_read_amplifier_type()
83 struct rtw_efuse *efuse = &rtwdev->efuse; in rtw8812a_read_rfe_type() local
87 efuse->rfe_option = 0; in rtw8812a_read_rfe_type()
89 efuse->rfe_option = 2; in rtw8812a_read_rfe_type()
91 efuse->rfe_option = 4; in rtw8812a_read_rfe_type()
93 if (efuse->ext_lna_5g) { in rtw8812a_read_rfe_type()
94 if (efuse->ext_pa_5g) { in rtw8812a_read_rfe_type()
95 if (efuse->ext_lna_2g && efuse->ext_pa_2g) in rtw8812a_read_rfe_type()
96 efuse->rfe_option = 3; in rtw8812a_read_rfe_type()
98 efuse->rfe_option = 0; in rtw8812a_read_rfe_type()
100 efuse->rfe_option = 2; in rtw8812a_read_rfe_type()
103 efuse->rfe_option = 4; in rtw8812a_read_rfe_type()
106 efuse->rfe_option = map->rfe_option & 0x3f; in rtw8812a_read_rfe_type()
108 /* Due to other customer already use incorrect EFUSE map for in rtw8812a_read_rfe_type()
113 if (efuse->rfe_option == 4 && in rtw8812a_read_rfe_type()
114 (efuse->ext_pa_5g || efuse->ext_pa_2g || in rtw8812a_read_rfe_type()
115 efuse->ext_lna_5g || efuse->ext_lna_2g)) { in rtw8812a_read_rfe_type()
117 efuse->rfe_option = 0; in rtw8812a_read_rfe_type()
119 efuse->rfe_option = 2; in rtw8812a_read_rfe_type()
126 struct rtw_efuse *efuse = &rtwdev->efuse; in rtw88xxa_read_usb_type() local
132 efuse->hw_cap.bw = BIT(RTW_CHANNEL_WIDTH_20) | in rtw88xxa_read_usb_type()
135 efuse->hw_cap.ptcl = EFUSE_HW_CAP_PTCL_VHT; in rtw88xxa_read_usb_type()
138 efuse->hw_cap.nss = 1; in rtw88xxa_read_usb_type()
140 efuse->hw_cap.nss = 2; in rtw88xxa_read_usb_type()
167 efuse->hw_cap.nss = 1; in rtw88xxa_read_usb_type()
175 efuse->hw_cap.nss = 2; in rtw88xxa_read_usb_type()
188 efuse->hw_cap.ptcl = 1; in rtw88xxa_read_usb_type()
189 efuse->hw_cap.bw &= ~BIT(RTW_CHANNEL_WIDTH_80); in rtw88xxa_read_usb_type()
196 efuse->hw_cap.hci, efuse->hw_cap.bw, efuse->hw_cap.ptcl, in rtw88xxa_read_usb_type()
197 efuse->hw_cap.ant_num, efuse->hw_cap.nss); in rtw88xxa_read_usb_type()
203 struct rtw_efuse *efuse = &rtwdev->efuse; in rtw88xxa_read_efuse() local
216 efuse->rf_board_option = map->rf_board_option; in rtw88xxa_read_efuse()
217 efuse->crystal_cap = map->xtal_k; in rtw88xxa_read_efuse()
218 if (efuse->crystal_cap == 0xff) in rtw88xxa_read_efuse()
219 efuse->crystal_cap = 0x20; in rtw88xxa_read_efuse()
220 efuse->pa_type_2g = map->pa_type; in rtw88xxa_read_efuse()
221 efuse->pa_type_5g = map->pa_type; in rtw88xxa_read_efuse()
222 efuse->lna_type_2g = map->lna_type_2g; in rtw88xxa_read_efuse()
223 efuse->lna_type_5g = map->lna_type_5g; in rtw88xxa_read_efuse()
228 efuse->usb_mode_switch = u8_get_bits(map->usb_mode, BIT(1)); in rtw88xxa_read_efuse()
230 efuse->channel_plan = map->channel_plan; in rtw88xxa_read_efuse()
231 efuse->country_code[0] = map->country_code[0]; in rtw88xxa_read_efuse()
232 efuse->country_code[1] = map->country_code[1]; in rtw88xxa_read_efuse()
233 efuse->bt_setting = map->rf_bt_setting; in rtw88xxa_read_efuse()
234 efuse->regd = map->rf_board_option & 0x7; in rtw88xxa_read_efuse()
235 efuse->thermal_meter[0] = map->thermal_meter; in rtw88xxa_read_efuse()
236 efuse->thermal_meter[1] = map->thermal_meter; in rtw88xxa_read_efuse()
237 efuse->thermal_meter_k = map->thermal_meter; in rtw88xxa_read_efuse()
238 efuse->tx_bb_swing_setting_2g = map->tx_bb_swing_setting_2g; in rtw88xxa_read_efuse()
239 efuse->tx_bb_swing_setting_5g = map->tx_bb_swing_setting_5g; in rtw88xxa_read_efuse()
244 efuse->btcoex = rtw_read32_mask(rtwdev, REG_WL_BT_PWR_CTRL, in rtw88xxa_read_efuse()
247 efuse->btcoex = (map->rf_board_option & 0xe0) == 0x20; in rtw88xxa_read_efuse()
248 efuse->share_ant = !!(efuse->bt_setting & BIT(0)); in rtw88xxa_read_efuse()
251 efuse->ant_div_cfg = 0; in rtw88xxa_read_efuse()
253 efuse->ant_div_type = map->rf_antenna_option; in rtw88xxa_read_efuse()
254 if (efuse->ant_div_type == 0xff) in rtw88xxa_read_efuse()
255 efuse->ant_div_type = 0x3; in rtw88xxa_read_efuse()
258 efuse->txpwr_idx_table[i] = map->txpwr_idx_table[i]; in rtw88xxa_read_efuse()
263 ether_addr_copy(efuse->addr, map->rtw8821au.mac_addr); in rtw88xxa_read_efuse()
265 ether_addr_copy(efuse->addr, map->rtw8812au.mac_addr); in rtw88xxa_read_efuse()
562 if (rtwdev->efuse.btcoex) in rtw88xxa_init_beacon_parameters()
593 crystal_cap = rtwdev->efuse.crystal_cap & 0x3F; in rtw88xxa_phy_bb_config()
645 struct rtw_efuse *efuse = &rtwdev->efuse; in rtw88xxa_get_bb_swing() local
649 tx_bb_swing = efuse->tx_bb_swing_setting_2g; in rtw88xxa_get_bb_swing()
651 tx_bb_swing = efuse->tx_bb_swing_setting_5g; in rtw88xxa_get_bb_swing()
697 dm_info->thermal_meter_k = rtwdev->efuse.thermal_meter_k; in rtw88xxa_pwrtrack_init()
716 if (!rtwdev->efuse.btcoex) in rtw88xxa_power_off()
728 if (rtwdev->efuse.btcoex) in rtw88xxa_power_off()
781 struct rtw_efuse *efuse = &rtwdev->efuse; in rtw8821a_phy_set_rfe_reg_24g() local
790 if (efuse->ext_lna_2g) { in rtw8821a_phy_set_rfe_reg_24g()
823 switch (rtwdev->efuse.rfe_option) { in rtw8812a_phy_set_rfe_reg_24g()
832 if (rtwdev->efuse.btcoex) { in rtw8812a_phy_set_rfe_reg_24g()
876 switch (rtwdev->efuse.rfe_option) { in rtw8812a_phy_set_rfe_reg_5g()
884 if (rtwdev->efuse.btcoex) { in rtw8812a_phy_set_rfe_reg_5g()
935 if (chip->id == RTW_CHIP_TYPE_8821A && !rtwdev->efuse.btcoex && in rtw88xxa_switch_band()
936 rtwdev->efuse.ant_div_cfg == 0) in rtw88xxa_switch_band()
952 !rtwdev->efuse.ext_lna_2g) in rtw88xxa_switch_band()
1010 struct rtw_efuse *efuse = &rtwdev->efuse; in rtw88xxa_power_on() local
1019 efuse->btcoex = rtw_read32_mask(rtwdev, REG_WL_BT_PWR_CTRL, in rtw88xxa_power_on()
1228 if (efuse->btcoex) { in rtw88xxa_power_on()
1897 if (rtwdev->efuse.thermal_meter[0] == 0xff) { in rtw88xxa_phy_pwrtrack()
1898 pr_err_once("efuse thermal meter is 0xff\n"); in rtw88xxa_phy_pwrtrack()