summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/ath/ath11k/ahb.c
diff options
context:
space:
mode:
authorGovindaraj Saminathan <gsamin@codeaurora.org>2020-10-16 18:28:31 +0300
committerKalle Valo <kvalo@codeaurora.org>2020-11-07 11:01:46 +0300
commit02f9d3c1b918a631be369350ffcaaab6cde95b22 (patch)
tree6d5e2b4d363b2bd3e1907fb843c3300075c71b82 /drivers/net/wireless/ath/ath11k/ahb.c
parent14f43c5fca57810e7a3788468aee482c85ab37a6 (diff)
downloadlinux-02f9d3c1b918a631be369350ffcaaab6cde95b22.tar.xz
ath11k: cold boot calibration support
cold boot calibration is the process to calibrate all the channels during the boot-up to avoid the calibration delay during the channel change. During the boot-up, firmware started in cold boot calibration mode Firmware calibrate all channels and generate CalDb(DDR). Subsequent wifi bringup will reuse the same CalDb. Firmware is restarted in normal mode to continue the normal operation. caldb memory address send to firmware through the QMI message.Firmware use this address to store the caldb data and use it until next reboot. This will give the improvement during the channel change. But it is increasing the boot-up time(up to 15sec depend on number of radios). So if the user want to reduce the boot-up time and accepting for channel change delay, user can disable this feature using the module param cold_boot_cal=0. Tested-on: IPQ8074 WLAN.HK.2.4.0.1-01162-QCAHKSWPL_SILICONZ-1 Signed-off-by: Govindaraj Saminathan <gsamin@codeaurora.org> Co-developed-by: Sowmiya Sree Elavalagan <ssreeela@codeaurora.org> Signed-off-by: Sowmiya Sree Elavalagan <ssreeela@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/1602862111-14063-1-git-send-email-ssreeela@codeaurora.org
Diffstat (limited to 'drivers/net/wireless/ath/ath11k/ahb.c')
-rw-r--r--drivers/net/wireless/ath/ath11k/ahb.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath11k/ahb.c b/drivers/net/wireless/ath/ath11k/ahb.c
index 430723c64adc..c7843f461dd2 100644
--- a/drivers/net/wireless/ath/ath11k/ahb.c
+++ b/drivers/net/wireless/ath/ath11k/ahb.c
@@ -340,6 +340,31 @@ static void ath11k_ahb_power_down(struct ath11k_base *ab)
rproc_shutdown(ab_ahb->tgt_rproc);
}
+static int ath11k_ahb_fwreset_from_cold_boot(struct ath11k_base *ab)
+{
+ int timeout;
+
+ if (ath11k_cold_boot_cal == 0 || ab->qmi.cal_done ||
+ ab->hw_params.cold_boot_calib == 0)
+ return 0;
+
+ ath11k_dbg(ab, ATH11K_DBG_AHB, "wait for cold boot done\n");
+ timeout = wait_event_timeout(ab->qmi.cold_boot_waitq,
+ (ab->qmi.cal_done == 1),
+ ATH11K_COLD_BOOT_FW_RESET_DELAY);
+ if (timeout <= 0) {
+ ath11k_cold_boot_cal = 0;
+ ath11k_warn(ab, "Coldboot Calibration failed timed out\n");
+ }
+
+ /* reset the firmware */
+ ath11k_ahb_power_down(ab);
+ ath11k_ahb_power_up(ab);
+
+ ath11k_dbg(ab, ATH11K_DBG_AHB, "exited from cold boot mode\n");
+ return 0;
+}
+
static void ath11k_ahb_init_qmi_ce_config(struct ath11k_base *ab)
{
struct ath11k_qmi_ce_cfg *cfg = &ab->qmi.ce_cfg;
@@ -700,6 +725,8 @@ static int ath11k_ahb_probe(struct platform_device *pdev)
goto err_ce_free;
}
+ ath11k_ahb_fwreset_from_cold_boot(ab);
+
return 0;
err_ce_free: