Commit 011e5a30 authored by Seevalamuthu Mariappan's avatar Seevalamuthu Mariappan Committed by Kalle Valo

wifi: ath11k: Split coldboot calibration hw_param

QCN9074 enables coldboot calibration only in Factory Test Mode (FTM).
Hence, split cold_boot_calib to two hw_params for mission and FTM
mode.

Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
Signed-off-by: default avatarSeevalamuthu Mariappan <quic_seevalam@quicinc.com>
Signed-off-by: default avatarRaj Kumar Bhagat <quic_rajkbhag@quicinc.com>
Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20230726141032.3061-2-quic_rajkbhag@quicinc.com
parent 6f092c98
...@@ -423,8 +423,7 @@ static int ath11k_ahb_fwreset_from_cold_boot(struct ath11k_base *ab) ...@@ -423,8 +423,7 @@ static int ath11k_ahb_fwreset_from_cold_boot(struct ath11k_base *ab)
{ {
int timeout; int timeout;
if (ath11k_cold_boot_cal == 0 || ab->qmi.cal_done || if (!ath11k_core_coldboot_cal_support(ab) || ab->qmi.cal_done ||
ab->hw_params.cold_boot_calib == 0 ||
ab->hw_params.cbcal_restart_fw == 0) ab->hw_params.cbcal_restart_fw == 0)
return 0; return 0;
......
...@@ -86,7 +86,8 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { ...@@ -86,7 +86,8 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
.supports_shadow_regs = false, .supports_shadow_regs = false,
.idle_ps = false, .idle_ps = false,
.supports_sta_ps = false, .supports_sta_ps = false,
.cold_boot_calib = true, .coldboot_cal_mm = true,
.coldboot_cal_ftm = true,
.cbcal_restart_fw = true, .cbcal_restart_fw = true,
.fw_mem_mode = 0, .fw_mem_mode = 0,
.num_vdevs = 16 + 1, .num_vdevs = 16 + 1,
...@@ -167,7 +168,8 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { ...@@ -167,7 +168,8 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
.supports_shadow_regs = false, .supports_shadow_regs = false,
.idle_ps = false, .idle_ps = false,
.supports_sta_ps = false, .supports_sta_ps = false,
.cold_boot_calib = true, .coldboot_cal_mm = true,
.coldboot_cal_ftm = true,
.cbcal_restart_fw = true, .cbcal_restart_fw = true,
.fw_mem_mode = 0, .fw_mem_mode = 0,
.num_vdevs = 16 + 1, .num_vdevs = 16 + 1,
...@@ -248,7 +250,8 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { ...@@ -248,7 +250,8 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
.supports_shadow_regs = true, .supports_shadow_regs = true,
.idle_ps = true, .idle_ps = true,
.supports_sta_ps = true, .supports_sta_ps = true,
.cold_boot_calib = false, .coldboot_cal_mm = false,
.coldboot_cal_ftm = false,
.cbcal_restart_fw = false, .cbcal_restart_fw = false,
.fw_mem_mode = 0, .fw_mem_mode = 0,
.num_vdevs = 16 + 1, .num_vdevs = 16 + 1,
...@@ -332,7 +335,8 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { ...@@ -332,7 +335,8 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
.supports_shadow_regs = false, .supports_shadow_regs = false,
.idle_ps = false, .idle_ps = false,
.supports_sta_ps = false, .supports_sta_ps = false,
.cold_boot_calib = false, .coldboot_cal_mm = false,
.coldboot_cal_ftm = false,
.cbcal_restart_fw = false, .cbcal_restart_fw = false,
.fw_mem_mode = 2, .fw_mem_mode = 2,
.num_vdevs = 8, .num_vdevs = 8,
...@@ -413,7 +417,8 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { ...@@ -413,7 +417,8 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
.supports_shadow_regs = true, .supports_shadow_regs = true,
.idle_ps = true, .idle_ps = true,
.supports_sta_ps = true, .supports_sta_ps = true,
.cold_boot_calib = false, .coldboot_cal_mm = false,
.coldboot_cal_ftm = false,
.cbcal_restart_fw = false, .cbcal_restart_fw = false,
.fw_mem_mode = 0, .fw_mem_mode = 0,
.num_vdevs = 16 + 1, .num_vdevs = 16 + 1,
...@@ -495,7 +500,8 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { ...@@ -495,7 +500,8 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
.supports_shadow_regs = true, .supports_shadow_regs = true,
.idle_ps = true, .idle_ps = true,
.supports_sta_ps = true, .supports_sta_ps = true,
.cold_boot_calib = false, .coldboot_cal_mm = false,
.coldboot_cal_ftm = false,
.cbcal_restart_fw = false, .cbcal_restart_fw = false,
.fw_mem_mode = 0, .fw_mem_mode = 0,
.num_vdevs = 16 + 1, .num_vdevs = 16 + 1,
...@@ -578,7 +584,8 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { ...@@ -578,7 +584,8 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
.supports_shadow_regs = true, .supports_shadow_regs = true,
.idle_ps = true, .idle_ps = true,
.supports_sta_ps = true, .supports_sta_ps = true,
.cold_boot_calib = true, .coldboot_cal_mm = true,
.coldboot_cal_ftm = true,
.cbcal_restart_fw = false, .cbcal_restart_fw = false,
.fw_mem_mode = 0, .fw_mem_mode = 0,
.num_vdevs = 16 + 1, .num_vdevs = 16 + 1,
...@@ -667,7 +674,8 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { ...@@ -667,7 +674,8 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
.supports_suspend = false, .supports_suspend = false,
.hal_params = &ath11k_hw_hal_params_ipq8074, .hal_params = &ath11k_hw_hal_params_ipq8074,
.single_pdev_only = false, .single_pdev_only = false,
.cold_boot_calib = true, .coldboot_cal_mm = true,
.coldboot_cal_ftm = true,
.cbcal_restart_fw = true, .cbcal_restart_fw = true,
.fix_l1ss = true, .fix_l1ss = true,
.supports_dynamic_smps_6ghz = false, .supports_dynamic_smps_6ghz = false,
...@@ -749,6 +757,18 @@ void ath11k_fw_stats_free(struct ath11k_fw_stats *stats) ...@@ -749,6 +757,18 @@ void ath11k_fw_stats_free(struct ath11k_fw_stats *stats)
ath11k_fw_stats_bcn_free(&stats->bcn); ath11k_fw_stats_bcn_free(&stats->bcn);
} }
bool ath11k_core_coldboot_cal_support(struct ath11k_base *ab)
{
if (!ath11k_cold_boot_cal)
return false;
if (ath11k_ftm_mode)
return ab->hw_params.coldboot_cal_ftm;
else
return ab->hw_params.coldboot_cal_mm;
}
int ath11k_core_suspend(struct ath11k_base *ab) int ath11k_core_suspend(struct ath11k_base *ab)
{ {
int ret; int ret;
......
...@@ -1186,6 +1186,7 @@ void ath11k_core_halt(struct ath11k *ar); ...@@ -1186,6 +1186,7 @@ void ath11k_core_halt(struct ath11k *ar);
int ath11k_core_resume(struct ath11k_base *ab); int ath11k_core_resume(struct ath11k_base *ab);
int ath11k_core_suspend(struct ath11k_base *ab); int ath11k_core_suspend(struct ath11k_base *ab);
void ath11k_core_pre_reconfigure_recovery(struct ath11k_base *ab); void ath11k_core_pre_reconfigure_recovery(struct ath11k_base *ab);
bool ath11k_core_coldboot_cal_support(struct ath11k_base *ab);
const struct firmware *ath11k_core_firmware_request(struct ath11k_base *ab, const struct firmware *ath11k_core_firmware_request(struct ath11k_base *ab,
const char *filename); const char *filename);
......
...@@ -187,7 +187,8 @@ struct ath11k_hw_params { ...@@ -187,7 +187,8 @@ struct ath11k_hw_params {
bool supports_shadow_regs; bool supports_shadow_regs;
bool idle_ps; bool idle_ps;
bool supports_sta_ps; bool supports_sta_ps;
bool cold_boot_calib; bool coldboot_cal_mm;
bool coldboot_cal_ftm;
bool cbcal_restart_fw; bool cbcal_restart_fw;
int fw_mem_mode; int fw_mem_mode;
u32 num_vdevs; u32 num_vdevs;
......
...@@ -2079,7 +2079,7 @@ static int ath11k_qmi_assign_target_mem_chunk(struct ath11k_base *ab) ...@@ -2079,7 +2079,7 @@ static int ath11k_qmi_assign_target_mem_chunk(struct ath11k_base *ab)
return -EINVAL; return -EINVAL;
} }
if (ath11k_cold_boot_cal && ab->hw_params.cold_boot_calib) { if (ath11k_core_coldboot_cal_support(ab)) {
if (hremote_node) { if (hremote_node) {
ab->qmi.target_mem[idx].paddr = ab->qmi.target_mem[idx].paddr =
res.start + host_ddr_sz; res.start + host_ddr_sz;
...@@ -3209,8 +3209,8 @@ static void ath11k_qmi_driver_event_work(struct work_struct *work) ...@@ -3209,8 +3209,8 @@ static void ath11k_qmi_driver_event_work(struct work_struct *work)
break; break;
} }
if (ath11k_cold_boot_cal && ab->qmi.cal_done == 0 && if (ab->qmi.cal_done == 0 &&
ab->hw_params.cold_boot_calib) { ath11k_core_coldboot_cal_support(ab)) {
ath11k_qmi_process_coldboot_calibration(ab); ath11k_qmi_process_coldboot_calibration(ab);
} else { } else {
clear_bit(ATH11K_FLAG_CRASH_FLUSH, clear_bit(ATH11K_FLAG_CRASH_FLUSH,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment