From 9f83993e1a92ba19fcee635e4aff823a72a18d0c Mon Sep 17 00:00:00 2001 From: Tamizh Chelvam Date: Tue, 28 Jan 2020 00:48:56 +0530 Subject: ath10k: Add support to read btcoex related data from DT BTCOEX feature is not supported by all QCA4019 chipsets. Since btcoex enabled by default in firmware, host needs to enable COEX support depends on the hardware. Enabling it by default in unsupported hardware will cause some feature disabled in hardware. This patch will read btcoex_support flag and wlan priority gpio pin number from DT. Depends on the btcoex_support flag value host will expose BTCOEX support and wlan priority gpio pin number to target. Testing: * Tested HW : QCA4019 * Tested FW : 10.4-3.2.1.1-00017 Signed-off-by: Tamizh Chelvam Signed-off-by: Kalle Valo --- drivers/net/wireless/ath/ath10k/core.c | 44 +++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) (limited to 'drivers/net/wireless/ath/ath10k/core.c') diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c index 5ec16ce19b69..5712e283e2d7 100644 --- a/drivers/net/wireless/ath/ath10k/core.c +++ b/drivers/net/wireless/ath/ath10k/core.c @@ -2119,6 +2119,40 @@ done: return 0; } +static void ath10k_core_fetch_btcoex_dt(struct ath10k *ar) +{ + struct device_node *node; + u8 coex_support = 0; + int ret; + + node = ar->dev->of_node; + if (!node) + goto out; + + ret = of_property_read_u8(node, "qcom,coexist-support", &coex_support); + if (ret) { + ar->coex_support = true; + goto out; + } + + if (coex_support) { + ar->coex_support = true; + } else { + ar->coex_support = false; + ar->coex_gpio_pin = -1; + goto out; + } + + ret = of_property_read_u32(node, "qcom,coexist-gpio-pin", + &ar->coex_gpio_pin); + if (ret) + ar->coex_gpio_pin = -1; + +out: + ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot coex_support %d coex_gpio_pin %d\n", + ar->coex_support, ar->coex_gpio_pin); +} + static int ath10k_init_uart(struct ath10k *ar) { int ret; @@ -2696,14 +2730,22 @@ int ath10k_core_start(struct ath10k *ar, enum ath10k_firmware_mode mode, if (test_bit(WMI_SERVICE_BSS_CHANNEL_INFO_64, ar->wmi.svc_map)) val |= WMI_10_4_BSS_CHANNEL_INFO_64; + ath10k_core_fetch_btcoex_dt(ar); + /* 10.4 firmware supports BT-Coex without reloading firmware * via pdev param. To support Bluetooth coexistence pdev param, * WMI_COEX_GPIO_SUPPORT of extended resource config should be * enabled always. + * + * We can still enable BTCOEX if firmware has the support + * eventhough btceox_support value is + * ATH10K_DT_BTCOEX_NOT_FOUND */ + if (test_bit(WMI_SERVICE_COEX_GPIO, ar->wmi.svc_map) && test_bit(ATH10K_FW_FEATURE_BTCOEX_PARAM, - ar->running_fw->fw_file.fw_features)) + ar->running_fw->fw_file.fw_features) && + ar->coex_support) val |= WMI_10_4_COEX_GPIO_SUPPORT; if (test_bit(WMI_SERVICE_TDLS_EXPLICIT_MODE_ONLY, -- cgit v1.2.3 From a4b9f641e858d69fcc7b53f7cea8a99a24b269f5 Mon Sep 17 00:00:00 2001 From: Vikas Patel Date: Tue, 7 Jan 2020 11:53:15 +0530 Subject: ath10k: avoid consecutive OTP download to reduce boot time Currently, OTP is downloaded twice in case of "pre-cal-dt" and "pre-cal-file" to fetch the board ID and takes around ~2 sec more boot uptime. First OTP download happens in "ath10k_core_probe_fw" and second in ath10k_core_start. First boot does not need OTP download in core start when valid board id acquired. The second OTP download is required upon core stop/start. This patch skips the OTP download when first OTP download has acquired a valid board id. This patch also marks board id invalid in "ath10k_core_stop", which will force the OTP download in ath10k_core_start and fetches valid board id. Tested HW: QCA9984 Tested FW: 10.4-3.6-00104 Signed-off-by: Vikas Patel Signed-off-by: Maharaja Kennadyrajan Signed-off-by: Kalle Valo --- drivers/net/wireless/ath/ath10k/core.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'drivers/net/wireless/ath/ath10k/core.c') diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c index 5712e283e2d7..f561b8b4660e 100644 --- a/drivers/net/wireless/ath/ath10k/core.c +++ b/drivers/net/wireless/ath/ath10k/core.c @@ -874,6 +874,13 @@ static int ath10k_core_get_board_id_from_otp(struct ath10k *ar) return -ENODATA; } + if (ar->id.bmi_ids_valid) { + ath10k_dbg(ar, ATH10K_DBG_BOOT, + "boot already acquired valid otp board id,skip download, board_id %d chip_id %d\n", + ar->id.bmi_board_id, ar->id.bmi_chip_id); + goto skip_otp_download; + } + ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot upload otp to 0x%x len %zd for board id\n", address, ar->normal_mode_fw.fw_file.otp_len); @@ -921,6 +928,8 @@ static int ath10k_core_get_board_id_from_otp(struct ath10k *ar) ar->id.bmi_board_id = board_id; ar->id.bmi_chip_id = chip_id; +skip_otp_download: + return 0; } @@ -2905,6 +2914,8 @@ void ath10k_core_stop(struct ath10k *ar) ath10k_htt_tx_stop(&ar->htt); ath10k_htt_rx_free(&ar->htt); ath10k_wmi_detach(ar); + + ar->id.bmi_ids_valid = false; } EXPORT_SYMBOL(ath10k_core_stop); -- cgit v1.2.3 From 6e51b0e4913ca2c93059f73ca477ca30ea95b6a0 Mon Sep 17 00:00:00 2001 From: Erik Stromdahl Date: Thu, 26 Sep 2019 17:24:27 +0300 Subject: ath10k: add QCA9377 sdio hw_param item Add hardware parameters for QCA9377 sdio devices, it's now properly supported. Signed-off-by: Erik Stromdahl Signed-off-by: Kalle Valo --- drivers/net/wireless/ath/ath10k/core.c | 27 +++++++++++++++++++++++++++ drivers/net/wireless/ath/ath10k/hw.h | 3 +++ 2 files changed, 30 insertions(+) (limited to 'drivers/net/wireless/ath/ath10k/core.c') diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c index f561b8b4660e..70f3bae92a85 100644 --- a/drivers/net/wireless/ath/ath10k/core.c +++ b/drivers/net/wireless/ath/ath10k/core.c @@ -540,6 +540,33 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .fw_diag_ce_download = true, .tx_stats_over_pktlog = false, }, + { + .id = QCA9377_HW_1_1_DEV_VERSION, + .dev_id = QCA9377_1_0_DEVICE_ID, + .bus = ATH10K_BUS_SDIO, + .name = "qca9377 hw1.1 sdio", + .patch_load_addr = QCA9377_HW_1_0_PATCH_LOAD_ADDR, + .uart_pin = 19, + .otp_exe_param = 0, + .channel_counters_freq_hz = 88000, + .max_probe_resp_desc_thres = 0, + .cal_data_len = 8124, + .fw = { + .dir = QCA9377_HW_1_0_FW_DIR, + .board = QCA9377_HW_1_0_BOARD_DATA_FILE, + .board_size = QCA9377_BOARD_DATA_SZ, + .board_ext_size = QCA9377_BOARD_EXT_DATA_SZ, + }, + .hw_ops = &qca6174_ops, + .hw_clk = qca6174_clk, + .target_cpu_freq = 176000000, + .decap_align_bytes = 4, + .n_cipher_suites = 8, + .num_peers = TARGET_QCA9377_HL_NUM_PEERS, + .ast_skid_limit = 0x10, + .num_wds_entries = 0x20, + .uart_pin_workaround = true, + }, { .id = QCA4019_HW_1_0_DEV_VERSION, .dev_id = 0, diff --git a/drivers/net/wireless/ath/ath10k/hw.h b/drivers/net/wireless/ath/ath10k/hw.h index 775fd62fb92d..970c736ac6bb 100644 --- a/drivers/net/wireless/ath/ath10k/hw.h +++ b/drivers/net/wireless/ath/ath10k/hw.h @@ -774,6 +774,9 @@ ath10k_is_rssi_enable(struct ath10k_hw_params *hw, #define TARGET_HL_TLV_AST_SKID_LIMIT 16 #define TARGET_HL_TLV_NUM_WDS_ENTRIES 2 +/* Target specific defines for QCA9377 high latency firmware */ +#define TARGET_QCA9377_HL_NUM_PEERS 15 + /* Diagnostic Window */ #define CE_DIAG_PIPE 7 -- cgit v1.2.3