Path: blob/main/sys/contrib/dev/athk/ath11k/pci.c
106845 views
// SPDX-License-Identifier: BSD-3-Clause-Clear1/*2* Copyright (c) 2019-2020 The Linux Foundation. All rights reserved.3* Copyright (c) 2021-2025 Qualcomm Innovation Center, Inc. All rights reserved.4*/56#include <linux/module.h>7#include <linux/msi.h>8#include <linux/pci.h>9#if defined(CONFIG_OF)10#include <linux/of.h>11#endif12#if defined(__FreeBSD__)13#include <linux/delay.h>14#include <linux/cpu.h>15#endif16#include <linux/time.h>17#include <linux/vmalloc.h>1819#include "pci.h"20#include "core.h"21#include "hif.h"22#include "mhi.h"23#include "debug.h"24#include "pcic.h"25#include "qmi.h"2627#define ATH11K_PCI_BAR_NUM 028#define ATH11K_PCI_DMA_MASK 3629#define ATH11K_PCI_COHERENT_DMA_MASK 323031#define TCSR_SOC_HW_VERSION 0x022432#define TCSR_SOC_HW_VERSION_MAJOR_MASK GENMASK(11, 8)33#define TCSR_SOC_HW_VERSION_MINOR_MASK GENMASK(7, 0)3435#define QCA6390_DEVICE_ID 0x110136#define QCN9074_DEVICE_ID 0x110437#define WCN6855_DEVICE_ID 0x11033839#define TCSR_SOC_HW_SUB_VER 0x19100104041static const struct pci_device_id ath11k_pci_id_table[] = {42{ PCI_VDEVICE(QCOM, QCA6390_DEVICE_ID) },43{ PCI_VDEVICE(QCOM, WCN6855_DEVICE_ID) },44{ PCI_VDEVICE(QCOM, QCN9074_DEVICE_ID) },45{}46};4748MODULE_DEVICE_TABLE(pci, ath11k_pci_id_table);4950static int ath11k_pci_bus_wake_up(struct ath11k_base *ab)51{52struct ath11k_pci *ab_pci = ath11k_pci_priv(ab);5354return mhi_device_get_sync(ab_pci->mhi_ctrl->mhi_dev);55}5657static void ath11k_pci_bus_release(struct ath11k_base *ab)58{59struct ath11k_pci *ab_pci = ath11k_pci_priv(ab);6061mhi_device_put(ab_pci->mhi_ctrl->mhi_dev);62}6364static u32 ath11k_pci_get_window_start(struct ath11k_base *ab, u32 offset)65{66if (!ab->hw_params.static_window_map)67return ATH11K_PCI_WINDOW_START;6869if ((offset ^ HAL_SEQ_WCSS_UMAC_OFFSET) < ATH11K_PCI_WINDOW_RANGE_MASK)70/* if offset lies within DP register range, use 3rd window */71return 3 * ATH11K_PCI_WINDOW_START;72else if ((offset ^ HAL_SEQ_WCSS_UMAC_CE0_SRC_REG(ab)) <73ATH11K_PCI_WINDOW_RANGE_MASK)74/* if offset lies within CE register range, use 2nd window */75return 2 * ATH11K_PCI_WINDOW_START;76else77return ATH11K_PCI_WINDOW_START;78}7980static inline void ath11k_pci_select_window(struct ath11k_pci *ab_pci, u32 offset)81{82struct ath11k_base *ab = ab_pci->ab;8384u32 window = FIELD_GET(ATH11K_PCI_WINDOW_VALUE_MASK, offset);8586lockdep_assert_held(&ab_pci->window_lock);8788if (window != ab_pci->register_window) {89#if defined(__linux__)90iowrite32(ATH11K_PCI_WINDOW_ENABLE_BIT | window,91ab->mem + ATH11K_PCI_WINDOW_REG_ADDRESS);92ioread32(ab->mem + ATH11K_PCI_WINDOW_REG_ADDRESS);93#elif defined(__FreeBSD__)94iowrite32(ATH11K_PCI_WINDOW_ENABLE_BIT | window,95(char *)ab->mem + ATH11K_PCI_WINDOW_REG_ADDRESS);96ioread32((char *)ab->mem + ATH11K_PCI_WINDOW_REG_ADDRESS);97#endif98ab_pci->register_window = window;99}100}101102static void103ath11k_pci_window_write32(struct ath11k_base *ab, u32 offset, u32 value)104{105struct ath11k_pci *ab_pci = ath11k_pci_priv(ab);106u32 window_start;107108window_start = ath11k_pci_get_window_start(ab, offset);109110if (window_start == ATH11K_PCI_WINDOW_START) {111spin_lock_bh(&ab_pci->window_lock);112ath11k_pci_select_window(ab_pci, offset);113#if defined(__linux__)114iowrite32(value, ab->mem + window_start +115#elif defined(__FreeBSD__)116iowrite32(value, (char *)ab->mem + window_start +117#endif118(offset & ATH11K_PCI_WINDOW_RANGE_MASK));119spin_unlock_bh(&ab_pci->window_lock);120} else {121#if defined(__linux__)122iowrite32(value, ab->mem + window_start +123#elif defined(__FreeBSD__)124iowrite32(value, (char *)ab->mem + window_start +125#endif126(offset & ATH11K_PCI_WINDOW_RANGE_MASK));127}128}129130static u32 ath11k_pci_window_read32(struct ath11k_base *ab, u32 offset)131{132struct ath11k_pci *ab_pci = ath11k_pci_priv(ab);133u32 window_start, val;134135window_start = ath11k_pci_get_window_start(ab, offset);136137if (window_start == ATH11K_PCI_WINDOW_START) {138spin_lock_bh(&ab_pci->window_lock);139ath11k_pci_select_window(ab_pci, offset);140#if defined(__linux__)141val = ioread32(ab->mem + window_start +142#elif defined(__FreeBSD__)143val = ioread32((char *)ab->mem + window_start +144#endif145(offset & ATH11K_PCI_WINDOW_RANGE_MASK));146spin_unlock_bh(&ab_pci->window_lock);147} else {148#if defined(__linux__)149val = ioread32(ab->mem + window_start +150#elif defined(__FreeBSD__)151val = ioread32((char *)ab->mem + window_start +152#endif153(offset & ATH11K_PCI_WINDOW_RANGE_MASK));154}155156return val;157}158159int ath11k_pci_get_msi_irq(struct ath11k_base *ab, unsigned int vector)160{161struct pci_dev *pci_dev = to_pci_dev(ab->dev);162163return pci_irq_vector(pci_dev, vector);164}165166static const struct ath11k_pci_ops ath11k_pci_ops_qca6390 = {167.wakeup = ath11k_pci_bus_wake_up,168.release = ath11k_pci_bus_release,169.get_msi_irq = ath11k_pci_get_msi_irq,170.window_write32 = ath11k_pci_window_write32,171.window_read32 = ath11k_pci_window_read32,172};173174static const struct ath11k_pci_ops ath11k_pci_ops_qcn9074 = {175.wakeup = NULL,176.release = NULL,177.get_msi_irq = ath11k_pci_get_msi_irq,178.window_write32 = ath11k_pci_window_write32,179.window_read32 = ath11k_pci_window_read32,180};181182static const struct ath11k_msi_config msi_config_one_msi = {183.total_vectors = 1,184.total_users = 4,185.users = (struct ath11k_msi_user[]) {186{ .name = "MHI", .num_vectors = 3, .base_vector = 0 },187{ .name = "CE", .num_vectors = 1, .base_vector = 0 },188{ .name = "WAKE", .num_vectors = 1, .base_vector = 0 },189{ .name = "DP", .num_vectors = 1, .base_vector = 0 },190},191};192193static inline void ath11k_pci_select_static_window(struct ath11k_pci *ab_pci)194{195u32 umac_window;196u32 ce_window;197u32 window;198199umac_window = FIELD_GET(ATH11K_PCI_WINDOW_VALUE_MASK, HAL_SEQ_WCSS_UMAC_OFFSET);200ce_window = FIELD_GET(ATH11K_PCI_WINDOW_VALUE_MASK, HAL_CE_WFSS_CE_REG_BASE);201window = (umac_window << 12) | (ce_window << 6);202203iowrite32(ATH11K_PCI_WINDOW_ENABLE_BIT | window,204#if defined(__linux__)205ab_pci->ab->mem + ATH11K_PCI_WINDOW_REG_ADDRESS);206#elif defined(__FreeBSD__)207(char *)ab_pci->ab->mem + ATH11K_PCI_WINDOW_REG_ADDRESS);208#endif209}210211static void ath11k_pci_soc_global_reset(struct ath11k_base *ab)212{213u32 val, delay;214215val = ath11k_pcic_read32(ab, PCIE_SOC_GLOBAL_RESET);216217val |= PCIE_SOC_GLOBAL_RESET_V;218219ath11k_pcic_write32(ab, PCIE_SOC_GLOBAL_RESET, val);220221/* TODO: exact time to sleep is uncertain */222delay = 10;223mdelay(delay);224225/* Need to toggle V bit back otherwise stuck in reset status */226val &= ~PCIE_SOC_GLOBAL_RESET_V;227228ath11k_pcic_write32(ab, PCIE_SOC_GLOBAL_RESET, val);229230mdelay(delay);231232val = ath11k_pcic_read32(ab, PCIE_SOC_GLOBAL_RESET);233if (val == 0xffffffff)234ath11k_warn(ab, "link down error during global reset\n");235}236237static void ath11k_pci_clear_dbg_registers(struct ath11k_base *ab)238{239u32 val;240241/* read cookie */242val = ath11k_pcic_read32(ab, PCIE_Q6_COOKIE_ADDR);243ath11k_dbg(ab, ATH11K_DBG_PCI, "pcie_q6_cookie_addr 0x%x\n", val);244245val = ath11k_pcic_read32(ab, WLAON_WARM_SW_ENTRY);246ath11k_dbg(ab, ATH11K_DBG_PCI, "wlaon_warm_sw_entry 0x%x\n", val);247248/* TODO: exact time to sleep is uncertain */249mdelay(10);250251/* write 0 to WLAON_WARM_SW_ENTRY to prevent Q6 from252* continuing warm path and entering dead loop.253*/254ath11k_pcic_write32(ab, WLAON_WARM_SW_ENTRY, 0);255mdelay(10);256257val = ath11k_pcic_read32(ab, WLAON_WARM_SW_ENTRY);258ath11k_dbg(ab, ATH11K_DBG_PCI, "wlaon_warm_sw_entry 0x%x\n", val);259260/* A read clear register. clear the register to prevent261* Q6 from entering wrong code path.262*/263val = ath11k_pcic_read32(ab, WLAON_SOC_RESET_CAUSE_REG);264ath11k_dbg(ab, ATH11K_DBG_PCI, "soc reset cause %d\n", val);265}266267static int ath11k_pci_set_link_reg(struct ath11k_base *ab,268u32 offset, u32 value, u32 mask)269{270u32 v;271int i;272273v = ath11k_pcic_read32(ab, offset);274if ((v & mask) == value)275return 0;276277for (i = 0; i < 10; i++) {278ath11k_pcic_write32(ab, offset, (v & ~mask) | value);279280v = ath11k_pcic_read32(ab, offset);281if ((v & mask) == value)282return 0;283284mdelay(2);285}286287ath11k_warn(ab, "failed to set pcie link register 0x%08x: 0x%08x != 0x%08x\n",288offset, v & mask, value);289290return -ETIMEDOUT;291}292293static int ath11k_pci_fix_l1ss(struct ath11k_base *ab)294{295int ret;296297ret = ath11k_pci_set_link_reg(ab,298PCIE_QSERDES_COM_SYSCLK_EN_SEL_REG(ab),299PCIE_QSERDES_COM_SYSCLK_EN_SEL_VAL,300PCIE_QSERDES_COM_SYSCLK_EN_SEL_MSK);301if (ret) {302ath11k_warn(ab, "failed to set sysclk: %d\n", ret);303return ret;304}305306ret = ath11k_pci_set_link_reg(ab,307PCIE_PCS_OSC_DTCT_CONFIG1_REG(ab),308PCIE_PCS_OSC_DTCT_CONFIG1_VAL,309PCIE_PCS_OSC_DTCT_CONFIG_MSK);310if (ret) {311ath11k_warn(ab, "failed to set dtct config1 error: %d\n", ret);312return ret;313}314315ret = ath11k_pci_set_link_reg(ab,316PCIE_PCS_OSC_DTCT_CONFIG2_REG(ab),317PCIE_PCS_OSC_DTCT_CONFIG2_VAL,318PCIE_PCS_OSC_DTCT_CONFIG_MSK);319if (ret) {320ath11k_warn(ab, "failed to set dtct config2: %d\n", ret);321return ret;322}323324ret = ath11k_pci_set_link_reg(ab,325PCIE_PCS_OSC_DTCT_CONFIG4_REG(ab),326PCIE_PCS_OSC_DTCT_CONFIG4_VAL,327PCIE_PCS_OSC_DTCT_CONFIG_MSK);328if (ret) {329ath11k_warn(ab, "failed to set dtct config4: %d\n", ret);330return ret;331}332333return 0;334}335336static void ath11k_pci_enable_ltssm(struct ath11k_base *ab)337{338u32 val;339int i;340341val = ath11k_pcic_read32(ab, PCIE_PCIE_PARF_LTSSM);342343/* PCIE link seems very unstable after the Hot Reset*/344for (i = 0; val != PARM_LTSSM_VALUE && i < 5; i++) {345if (val == 0xffffffff)346mdelay(5);347348ath11k_pcic_write32(ab, PCIE_PCIE_PARF_LTSSM, PARM_LTSSM_VALUE);349val = ath11k_pcic_read32(ab, PCIE_PCIE_PARF_LTSSM);350}351352ath11k_dbg(ab, ATH11K_DBG_PCI, "ltssm 0x%x\n", val);353354val = ath11k_pcic_read32(ab, GCC_GCC_PCIE_HOT_RST);355val |= GCC_GCC_PCIE_HOT_RST_VAL;356ath11k_pcic_write32(ab, GCC_GCC_PCIE_HOT_RST, val);357val = ath11k_pcic_read32(ab, GCC_GCC_PCIE_HOT_RST);358359ath11k_dbg(ab, ATH11K_DBG_PCI, "pcie_hot_rst 0x%x\n", val);360361mdelay(5);362}363364static void ath11k_pci_clear_all_intrs(struct ath11k_base *ab)365{366/* This is a WAR for PCIE Hotreset.367* When target receive Hotreset, but will set the interrupt.368* So when download SBL again, SBL will open Interrupt and369* receive it, and crash immediately.370*/371ath11k_pcic_write32(ab, PCIE_PCIE_INT_ALL_CLEAR, PCIE_INT_CLEAR_ALL);372}373374static void ath11k_pci_set_wlaon_pwr_ctrl(struct ath11k_base *ab)375{376u32 val;377378val = ath11k_pcic_read32(ab, WLAON_QFPROM_PWR_CTRL_REG);379val &= ~QFPROM_PWR_CTRL_VDD4BLOW_MASK;380ath11k_pcic_write32(ab, WLAON_QFPROM_PWR_CTRL_REG, val);381}382383static void ath11k_pci_force_wake(struct ath11k_base *ab)384{385ath11k_pcic_write32(ab, PCIE_SOC_WAKE_PCIE_LOCAL_REG, 1);386mdelay(5);387}388389static void ath11k_pci_sw_reset(struct ath11k_base *ab, bool power_on)390{391mdelay(100);392393if (power_on) {394ath11k_pci_enable_ltssm(ab);395ath11k_pci_clear_all_intrs(ab);396ath11k_pci_set_wlaon_pwr_ctrl(ab);397if (ab->hw_params.fix_l1ss)398ath11k_pci_fix_l1ss(ab);399}400401ath11k_mhi_clear_vector(ab);402ath11k_pci_clear_dbg_registers(ab);403ath11k_pci_soc_global_reset(ab);404ath11k_mhi_set_mhictrl_reset(ab);405}406407static void ath11k_pci_init_qmi_ce_config(struct ath11k_base *ab)408{409struct ath11k_qmi_ce_cfg *cfg = &ab->qmi.ce_cfg;410411cfg->tgt_ce = ab->hw_params.target_ce_config;412cfg->tgt_ce_len = ab->hw_params.target_ce_count;413414cfg->svc_to_ce_map = ab->hw_params.svc_to_ce_map;415cfg->svc_to_ce_map_len = ab->hw_params.svc_to_ce_map_len;416ab->qmi.service_ins_id = ab->hw_params.qmi_service_ins_id;417418ath11k_ce_get_shadow_config(ab, &cfg->shadow_reg_v2,419&cfg->shadow_reg_v2_len);420}421422static void ath11k_pci_msi_config(struct ath11k_pci *ab_pci, bool enable)423{424struct pci_dev *dev = ab_pci->pdev;425u16 control;426427pci_read_config_word(dev, dev->msi_cap + PCI_MSI_FLAGS, &control);428429if (enable)430control |= PCI_MSI_FLAGS_ENABLE;431else432control &= ~PCI_MSI_FLAGS_ENABLE;433434pci_write_config_word(dev, dev->msi_cap + PCI_MSI_FLAGS, control);435}436437static void ath11k_pci_msi_enable(struct ath11k_pci *ab_pci)438{439ath11k_pci_msi_config(ab_pci, true);440}441442static void ath11k_pci_msi_disable(struct ath11k_pci *ab_pci)443{444ath11k_pci_msi_config(ab_pci, false);445}446447static int ath11k_pci_alloc_msi(struct ath11k_pci *ab_pci)448{449struct ath11k_base *ab = ab_pci->ab;450const struct ath11k_msi_config *msi_config = ab->pci.msi.config;451struct pci_dev *pci_dev = ab_pci->pdev;452struct msi_desc *msi_desc;453int num_vectors;454int ret;455456num_vectors = pci_alloc_irq_vectors(pci_dev,457msi_config->total_vectors,458msi_config->total_vectors,459PCI_IRQ_MSI);460if (num_vectors == msi_config->total_vectors) {461set_bit(ATH11K_FLAG_MULTI_MSI_VECTORS, &ab->dev_flags);462} else {463num_vectors = pci_alloc_irq_vectors(ab_pci->pdev,4641,4651,466PCI_IRQ_MSI);467if (num_vectors < 0) {468ret = -EINVAL;469goto reset_msi_config;470}471clear_bit(ATH11K_FLAG_MULTI_MSI_VECTORS, &ab->dev_flags);472ab->pci.msi.config = &msi_config_one_msi;473ath11k_dbg(ab, ATH11K_DBG_PCI, "request one msi vector\n");474}475ath11k_info(ab, "MSI vectors: %d\n", num_vectors);476477ath11k_pci_msi_disable(ab_pci);478479msi_desc = irq_get_msi_desc(ab_pci->pdev->irq);480if (!msi_desc) {481ath11k_err(ab, "msi_desc is NULL!\n");482ret = -EINVAL;483goto free_msi_vector;484}485486ab->pci.msi.ep_base_data = msi_desc->msg.data;487488pci_read_config_dword(pci_dev, pci_dev->msi_cap + PCI_MSI_ADDRESS_LO,489&ab->pci.msi.addr_lo);490491if (msi_desc->pci.msi_attrib.is_64) {492pci_read_config_dword(pci_dev, pci_dev->msi_cap + PCI_MSI_ADDRESS_HI,493&ab->pci.msi.addr_hi);494} else {495ab->pci.msi.addr_hi = 0;496}497498ath11k_dbg(ab, ATH11K_DBG_PCI, "msi base data is %d\n", ab->pci.msi.ep_base_data);499500return 0;501502free_msi_vector:503pci_free_irq_vectors(ab_pci->pdev);504505reset_msi_config:506return ret;507}508509static void ath11k_pci_free_msi(struct ath11k_pci *ab_pci)510{511pci_free_irq_vectors(ab_pci->pdev);512}513514static int ath11k_pci_config_msi_data(struct ath11k_pci *ab_pci)515{516struct msi_desc *msi_desc;517518msi_desc = irq_get_msi_desc(ab_pci->pdev->irq);519if (!msi_desc) {520ath11k_err(ab_pci->ab, "msi_desc is NULL!\n");521pci_free_irq_vectors(ab_pci->pdev);522return -EINVAL;523}524525ab_pci->ab->pci.msi.ep_base_data = msi_desc->msg.data;526527ath11k_dbg(ab_pci->ab, ATH11K_DBG_PCI, "after request_irq msi_ep_base_data %d\n",528ab_pci->ab->pci.msi.ep_base_data);529530return 0;531}532533static int ath11k_pci_claim(struct ath11k_pci *ab_pci, struct pci_dev *pdev)534{535struct ath11k_base *ab = ab_pci->ab;536u16 device_id;537int ret = 0;538539pci_read_config_word(pdev, PCI_DEVICE_ID, &device_id);540if (device_id != ab_pci->dev_id) {541ath11k_err(ab, "pci device id mismatch: 0x%x 0x%x\n",542device_id, ab_pci->dev_id);543ret = -EIO;544goto out;545}546547ret = pci_assign_resource(pdev, ATH11K_PCI_BAR_NUM);548if (ret) {549ath11k_err(ab, "failed to assign pci resource: %d\n", ret);550goto out;551}552553ret = pci_enable_device(pdev);554if (ret) {555ath11k_err(ab, "failed to enable pci device: %d\n", ret);556goto out;557}558559ret = pci_request_region(pdev, ATH11K_PCI_BAR_NUM, "ath11k_pci");560if (ret) {561ath11k_err(ab, "failed to request pci region: %d\n", ret);562goto disable_device;563}564565ret = dma_set_mask(&pdev->dev,566DMA_BIT_MASK(ATH11K_PCI_DMA_MASK));567if (ret) {568ath11k_err(ab, "failed to set pci dma mask to %d: %d\n",569ATH11K_PCI_DMA_MASK, ret);570goto release_region;571}572573ab_pci->dma_mask = DMA_BIT_MASK(ATH11K_PCI_DMA_MASK);574575ret = dma_set_coherent_mask(&pdev->dev,576DMA_BIT_MASK(ATH11K_PCI_COHERENT_DMA_MASK));577if (ret) {578ath11k_err(ab, "failed to set pci coherent dma mask to %d: %d\n",579ATH11K_PCI_COHERENT_DMA_MASK, ret);580goto release_region;581}582583pci_set_master(pdev);584585ab->mem_len = pci_resource_len(pdev, ATH11K_PCI_BAR_NUM);586ab->mem = pci_iomap(pdev, ATH11K_PCI_BAR_NUM, 0);587if (!ab->mem) {588ath11k_err(ab, "failed to map pci bar %d\n", ATH11K_PCI_BAR_NUM);589ret = -EIO;590goto release_region;591}592593ab->mem_ce = ab->mem;594595ath11k_dbg(ab, ATH11K_DBG_BOOT, "pci_mem 0x%p\n", ab->mem);596return 0;597598release_region:599pci_release_region(pdev, ATH11K_PCI_BAR_NUM);600disable_device:601pci_disable_device(pdev);602out:603return ret;604}605606static void ath11k_pci_free_region(struct ath11k_pci *ab_pci)607{608struct ath11k_base *ab = ab_pci->ab;609struct pci_dev *pci_dev = ab_pci->pdev;610611pci_iounmap(pci_dev, ab->mem);612ab->mem = NULL;613pci_release_region(pci_dev, ATH11K_PCI_BAR_NUM);614if (pci_is_enabled(pci_dev))615pci_disable_device(pci_dev);616}617618static void ath11k_pci_aspm_disable(struct ath11k_pci *ab_pci)619{620struct ath11k_base *ab = ab_pci->ab;621622pcie_capability_read_word(ab_pci->pdev, PCI_EXP_LNKCTL,623&ab_pci->link_ctl);624625ath11k_dbg(ab, ATH11K_DBG_PCI, "link_ctl 0x%04x L0s %d L1 %d\n",626ab_pci->link_ctl,627u16_get_bits(ab_pci->link_ctl, PCI_EXP_LNKCTL_ASPM_L0S),628u16_get_bits(ab_pci->link_ctl, PCI_EXP_LNKCTL_ASPM_L1));629630/* disable L0s and L1 */631pcie_capability_clear_word(ab_pci->pdev, PCI_EXP_LNKCTL,632PCI_EXP_LNKCTL_ASPMC);633634set_bit(ATH11K_PCI_ASPM_RESTORE, &ab_pci->flags);635}636637static void ath11k_pci_aspm_restore(struct ath11k_pci *ab_pci)638{639if (test_and_clear_bit(ATH11K_PCI_ASPM_RESTORE, &ab_pci->flags))640pcie_capability_clear_and_set_word(ab_pci->pdev, PCI_EXP_LNKCTL,641PCI_EXP_LNKCTL_ASPMC,642ab_pci->link_ctl &643PCI_EXP_LNKCTL_ASPMC);644}645646#ifdef CONFIG_DEV_COREDUMP647static int ath11k_pci_coredump_calculate_size(struct ath11k_base *ab, u32 *dump_seg_sz)648{649struct ath11k_pci *ab_pci = ath11k_pci_priv(ab);650struct mhi_controller *mhi_ctrl = ab_pci->mhi_ctrl;651struct image_info *rddm_img, *fw_img;652struct ath11k_tlv_dump_data *dump_tlv;653enum ath11k_fw_crash_dump_type mem_type;654u32 len = 0, rddm_tlv_sz = 0, paging_tlv_sz = 0;655struct ath11k_dump_file_data *file_data;656int i;657658rddm_img = mhi_ctrl->rddm_image;659if (!rddm_img) {660ath11k_err(ab, "No RDDM dump found\n");661return 0;662}663664fw_img = mhi_ctrl->fbc_image;665666for (i = 0; i < fw_img->entries ; i++) {667if (!fw_img->mhi_buf[i].buf)668continue;669670paging_tlv_sz += fw_img->mhi_buf[i].len;671}672dump_seg_sz[FW_CRASH_DUMP_PAGING_DATA] = paging_tlv_sz;673674for (i = 0; i < rddm_img->entries; i++) {675if (!rddm_img->mhi_buf[i].buf)676continue;677678rddm_tlv_sz += rddm_img->mhi_buf[i].len;679}680dump_seg_sz[FW_CRASH_DUMP_RDDM_DATA] = rddm_tlv_sz;681682for (i = 0; i < ab->qmi.mem_seg_count; i++) {683mem_type = ath11k_coredump_get_dump_type(ab->qmi.target_mem[i].type);684685if (mem_type == FW_CRASH_DUMP_NONE)686continue;687688if (mem_type == FW_CRASH_DUMP_TYPE_MAX) {689ath11k_dbg(ab, ATH11K_DBG_PCI,690"target mem region type %d not supported",691ab->qmi.target_mem[i].type);692continue;693}694695if (!ab->qmi.target_mem[i].anyaddr)696continue;697698dump_seg_sz[mem_type] += ab->qmi.target_mem[i].size;699}700701for (i = 0; i < FW_CRASH_DUMP_TYPE_MAX; i++) {702if (!dump_seg_sz[i])703continue;704705len += sizeof(*dump_tlv) + dump_seg_sz[i];706}707708if (len)709len += sizeof(*file_data);710711return len;712}713714static void ath11k_pci_coredump_download(struct ath11k_base *ab)715{716struct ath11k_pci *ab_pci = ath11k_pci_priv(ab);717struct mhi_controller *mhi_ctrl = ab_pci->mhi_ctrl;718struct image_info *rddm_img, *fw_img;719struct timespec64 timestamp;720int i, len, mem_idx;721enum ath11k_fw_crash_dump_type mem_type;722struct ath11k_dump_file_data *file_data;723struct ath11k_tlv_dump_data *dump_tlv;724size_t hdr_len = sizeof(*file_data);725void *buf;726u32 dump_seg_sz[FW_CRASH_DUMP_TYPE_MAX] = {};727728ath11k_mhi_coredump(mhi_ctrl, false);729730len = ath11k_pci_coredump_calculate_size(ab, dump_seg_sz);731if (!len) {732ath11k_warn(ab, "No crash dump data found for devcoredump");733return;734}735736rddm_img = mhi_ctrl->rddm_image;737fw_img = mhi_ctrl->fbc_image;738739/* dev_coredumpv() requires vmalloc data */740buf = vzalloc(len);741if (!buf)742return;743744ab->dump_data = buf;745ab->ath11k_coredump_len = len;746file_data = ab->dump_data;747strscpy(file_data->df_magic, "ATH11K-FW-DUMP", sizeof(file_data->df_magic));748file_data->len = cpu_to_le32(len);749file_data->version = cpu_to_le32(ATH11K_FW_CRASH_DUMP_V2);750file_data->chip_id = cpu_to_le32(ab_pci->dev_id);751file_data->qrtr_id = cpu_to_le32(ab_pci->ab->qmi.service_ins_id);752file_data->bus_id = cpu_to_le32(pci_domain_nr(ab_pci->pdev->bus));753guid_gen(&file_data->guid);754ktime_get_real_ts64(×tamp);755file_data->tv_sec = cpu_to_le64(timestamp.tv_sec);756file_data->tv_nsec = cpu_to_le64(timestamp.tv_nsec);757buf += hdr_len;758dump_tlv = buf;759dump_tlv->type = cpu_to_le32(FW_CRASH_DUMP_PAGING_DATA);760dump_tlv->tlv_len = cpu_to_le32(dump_seg_sz[FW_CRASH_DUMP_PAGING_DATA]);761buf += COREDUMP_TLV_HDR_SIZE;762763/* append all segments together as they are all part of a single contiguous764* block of memory765*/766for (i = 0; i < fw_img->entries ; i++) {767if (!fw_img->mhi_buf[i].buf)768continue;769770memcpy_fromio(buf, (void const __iomem *)fw_img->mhi_buf[i].buf,771fw_img->mhi_buf[i].len);772buf += fw_img->mhi_buf[i].len;773}774775dump_tlv = buf;776dump_tlv->type = cpu_to_le32(FW_CRASH_DUMP_RDDM_DATA);777dump_tlv->tlv_len = cpu_to_le32(dump_seg_sz[FW_CRASH_DUMP_RDDM_DATA]);778buf += COREDUMP_TLV_HDR_SIZE;779780/* append all segments together as they are all part of a single contiguous781* block of memory782*/783for (i = 0; i < rddm_img->entries; i++) {784if (!rddm_img->mhi_buf[i].buf)785continue;786787memcpy_fromio(buf, (void const __iomem *)rddm_img->mhi_buf[i].buf,788rddm_img->mhi_buf[i].len);789buf += rddm_img->mhi_buf[i].len;790}791792mem_idx = FW_CRASH_DUMP_REMOTE_MEM_DATA;793for (; mem_idx < FW_CRASH_DUMP_TYPE_MAX; mem_idx++) {794if (mem_idx == FW_CRASH_DUMP_NONE)795continue;796797for (i = 0; i < ab->qmi.mem_seg_count; i++) {798mem_type = ath11k_coredump_get_dump_type799(ab->qmi.target_mem[i].type);800801if (mem_type != mem_idx)802continue;803804if (!ab->qmi.target_mem[i].anyaddr) {805ath11k_dbg(ab, ATH11K_DBG_PCI,806"Skipping mem region type %d",807ab->qmi.target_mem[i].type);808continue;809}810811dump_tlv = buf;812dump_tlv->type = cpu_to_le32(mem_idx);813dump_tlv->tlv_len = cpu_to_le32(dump_seg_sz[mem_idx]);814buf += COREDUMP_TLV_HDR_SIZE;815816memcpy_fromio(buf, ab->qmi.target_mem[i].iaddr,817ab->qmi.target_mem[i].size);818819buf += ab->qmi.target_mem[i].size;820}821}822823queue_work(ab->workqueue, &ab->dump_work);824}825#endif826827static int ath11k_pci_power_up(struct ath11k_base *ab)828{829struct ath11k_pci *ab_pci = ath11k_pci_priv(ab);830int ret;831832ab_pci->register_window = 0;833clear_bit(ATH11K_FLAG_DEVICE_INIT_DONE, &ab->dev_flags);834ath11k_pci_sw_reset(ab_pci->ab, true);835836/* Disable ASPM during firmware download due to problems switching837* to AMSS state.838*/839ath11k_pci_aspm_disable(ab_pci);840841ath11k_pci_msi_enable(ab_pci);842843ret = ath11k_mhi_start(ab_pci);844if (ret) {845ath11k_err(ab, "failed to start mhi: %d\n", ret);846return ret;847}848849if (ab->hw_params.static_window_map)850ath11k_pci_select_static_window(ab_pci);851852return 0;853}854855static void ath11k_pci_power_down(struct ath11k_base *ab, bool is_suspend)856{857struct ath11k_pci *ab_pci = ath11k_pci_priv(ab);858859/* restore aspm in case firmware bootup fails */860ath11k_pci_aspm_restore(ab_pci);861862ath11k_pci_force_wake(ab_pci->ab);863864ath11k_pci_msi_disable(ab_pci);865866ath11k_mhi_stop(ab_pci, is_suspend);867clear_bit(ATH11K_FLAG_DEVICE_INIT_DONE, &ab->dev_flags);868ath11k_pci_sw_reset(ab_pci->ab, false);869}870871static int ath11k_pci_hif_suspend(struct ath11k_base *ab)872{873struct ath11k_pci *ar_pci = ath11k_pci_priv(ab);874875return ath11k_mhi_suspend(ar_pci);876}877878static int ath11k_pci_hif_resume(struct ath11k_base *ab)879{880struct ath11k_pci *ar_pci = ath11k_pci_priv(ab);881882return ath11k_mhi_resume(ar_pci);883}884885static void ath11k_pci_hif_ce_irq_enable(struct ath11k_base *ab)886{887ath11k_pcic_ce_irqs_enable(ab);888}889890static void ath11k_pci_hif_ce_irq_disable(struct ath11k_base *ab)891{892ath11k_pcic_ce_irq_disable_sync(ab);893}894895static int ath11k_pci_start(struct ath11k_base *ab)896{897struct ath11k_pci *ab_pci = ath11k_pci_priv(ab);898899/* TODO: for now don't restore ASPM in case of single MSI900* vector as MHI register reading in M2 causes system hang.901*/902if (test_bit(ATH11K_FLAG_MULTI_MSI_VECTORS, &ab->dev_flags))903ath11k_pci_aspm_restore(ab_pci);904else905ath11k_info(ab, "leaving PCI ASPM disabled to avoid MHI M2 problems\n");906907ath11k_pcic_start(ab);908909return 0;910}911912static const struct ath11k_hif_ops ath11k_pci_hif_ops = {913.start = ath11k_pci_start,914.stop = ath11k_pcic_stop,915.read32 = ath11k_pcic_read32,916.write32 = ath11k_pcic_write32,917.read = ath11k_pcic_read,918.power_down = ath11k_pci_power_down,919.power_up = ath11k_pci_power_up,920.suspend = ath11k_pci_hif_suspend,921.resume = ath11k_pci_hif_resume,922.irq_enable = ath11k_pcic_ext_irq_enable,923.irq_disable = ath11k_pcic_ext_irq_disable,924.get_msi_address = ath11k_pcic_get_msi_address,925.get_user_msi_vector = ath11k_pcic_get_user_msi_assignment,926.map_service_to_pipe = ath11k_pcic_map_service_to_pipe,927.ce_irq_enable = ath11k_pci_hif_ce_irq_enable,928.ce_irq_disable = ath11k_pci_hif_ce_irq_disable,929.get_ce_msi_idx = ath11k_pcic_get_ce_msi_idx,930#ifdef CONFIG_DEV_COREDUMP931.coredump_download = ath11k_pci_coredump_download,932#endif933};934935static void ath11k_pci_read_hw_version(struct ath11k_base *ab, u32 *major, u32 *minor)936{937u32 soc_hw_version;938939soc_hw_version = ath11k_pcic_read32(ab, TCSR_SOC_HW_VERSION);940*major = FIELD_GET(TCSR_SOC_HW_VERSION_MAJOR_MASK,941soc_hw_version);942*minor = FIELD_GET(TCSR_SOC_HW_VERSION_MINOR_MASK,943soc_hw_version);944945ath11k_dbg(ab, ATH11K_DBG_PCI, "tcsr_soc_hw_version major %d minor %d\n",946*major, *minor);947}948949static int ath11k_pci_set_irq_affinity_hint(struct ath11k_pci *ab_pci,950#if defined(__linux__)951const struct cpumask *m)952#elif defined(__FreeBSD__)953const cpumask_t *m)954#endif955{956if (test_bit(ATH11K_FLAG_MULTI_MSI_VECTORS, &ab_pci->ab->dev_flags))957return 0;958959return irq_set_affinity_and_hint(ab_pci->pdev->irq, m);960}961962static int ath11k_pci_probe(struct pci_dev *pdev,963const struct pci_device_id *pci_dev)964{965struct ath11k_base *ab;966struct ath11k_pci *ab_pci;967u32 soc_hw_version_major, soc_hw_version_minor;968const struct ath11k_pci_ops *pci_ops;969int ret;970u32 sub_version;971972ab = ath11k_core_alloc(&pdev->dev, sizeof(*ab_pci), ATH11K_BUS_PCI);973974if (!ab) {975dev_err(&pdev->dev, "failed to allocate ath11k base\n");976return -ENOMEM;977}978979ab->dev = &pdev->dev;980pci_set_drvdata(pdev, ab);981ab_pci = ath11k_pci_priv(ab);982ab_pci->dev_id = pci_dev->device;983ab_pci->ab = ab;984ab_pci->pdev = pdev;985ab->hif.ops = &ath11k_pci_hif_ops;986ab->fw_mode = ATH11K_FIRMWARE_MODE_NORMAL;987pci_set_drvdata(pdev, ab);988spin_lock_init(&ab_pci->window_lock);989990/* Set fixed_mem_region to true for platforms support reserved memory991* from DT. If memory is reserved from DT for FW, ath11k driver need not992* allocate memory.993*/994#if defined(__linux__)995if (of_property_present(ab->dev->of_node, "memory-region"))996set_bit(ATH11K_FLAG_FIXED_MEM_RGN, &ab->dev_flags);997#endif998999ret = ath11k_pci_claim(ab_pci, pdev);1000if (ret) {1001ath11k_err(ab, "failed to claim device: %d\n", ret);1002goto err_free_core;1003}10041005ath11k_dbg(ab, ATH11K_DBG_BOOT, "pci probe %04x:%04x %04x:%04x\n",1006pdev->vendor, pdev->device,1007pdev->subsystem_vendor, pdev->subsystem_device);10081009ab->id.vendor = pdev->vendor;1010ab->id.device = pdev->device;1011ab->id.subsystem_vendor = pdev->subsystem_vendor;1012ab->id.subsystem_device = pdev->subsystem_device;10131014switch (pci_dev->device) {1015case QCA6390_DEVICE_ID:1016ret = ath11k_pcic_register_pci_ops(ab, &ath11k_pci_ops_qca6390);1017if (ret) {1018ath11k_err(ab, "failed to register PCI ops: %d\n", ret);1019goto err_pci_free_region;1020}10211022ath11k_pci_read_hw_version(ab, &soc_hw_version_major,1023&soc_hw_version_minor);1024switch (soc_hw_version_major) {1025case 2:1026ab->hw_rev = ATH11K_HW_QCA6390_HW20;1027break;1028default:1029dev_err(&pdev->dev, "Unsupported QCA6390 SOC hardware version: %d %d\n",1030soc_hw_version_major, soc_hw_version_minor);1031ret = -EOPNOTSUPP;1032goto err_pci_free_region;1033}10341035break;1036case QCN9074_DEVICE_ID:1037ret = ath11k_pcic_register_pci_ops(ab, &ath11k_pci_ops_qcn9074);1038if (ret) {1039ath11k_err(ab, "failed to register PCI ops: %d\n", ret);1040goto err_pci_free_region;1041}1042ab->hw_rev = ATH11K_HW_QCN9074_HW10;1043break;1044case WCN6855_DEVICE_ID:1045ret = ath11k_pcic_register_pci_ops(ab, &ath11k_pci_ops_qca6390);1046if (ret) {1047ath11k_err(ab, "failed to register PCI ops: %d\n", ret);1048goto err_pci_free_region;1049}1050ab->id.bdf_search = ATH11K_BDF_SEARCH_BUS_AND_BOARD;1051ath11k_pci_read_hw_version(ab, &soc_hw_version_major,1052&soc_hw_version_minor);1053switch (soc_hw_version_major) {1054case 2:1055switch (soc_hw_version_minor) {1056case 0x00:1057case 0x01:1058ab->hw_rev = ATH11K_HW_WCN6855_HW20;1059break;1060case 0x10:1061case 0x11:1062sub_version = ath11k_pcic_read32(ab, TCSR_SOC_HW_SUB_VER);1063ath11k_dbg(ab, ATH11K_DBG_PCI, "sub_version 0x%x\n",1064sub_version);1065switch (sub_version) {1066case 0x1019A0E1:1067case 0x1019B0E1:1068case 0x1019C0E1:1069case 0x1019D0E1:1070ab->hw_rev = ATH11K_HW_QCA2066_HW21;1071break;1072case 0x001e60e1:1073ab->hw_rev = ATH11K_HW_QCA6698AQ_HW21;1074break;1075default:1076ab->hw_rev = ATH11K_HW_WCN6855_HW21;1077}1078break;1079default:1080goto unsupported_wcn6855_soc;1081}1082break;1083default:1084unsupported_wcn6855_soc:1085dev_err(&pdev->dev, "Unsupported WCN6855 SOC hardware version: %d %d\n",1086soc_hw_version_major, soc_hw_version_minor);1087ret = -EOPNOTSUPP;1088goto err_pci_free_region;1089}10901091break;1092default:1093dev_err(&pdev->dev, "Unknown PCI device found: 0x%x\n",1094pci_dev->device);1095ret = -EOPNOTSUPP;1096goto err_pci_free_region;1097}10981099ret = ath11k_pcic_init_msi_config(ab);1100if (ret) {1101ath11k_err(ab, "failed to init msi config: %d\n", ret);1102goto err_pci_free_region;1103}11041105ret = ath11k_pci_alloc_msi(ab_pci);1106if (ret) {1107ath11k_err(ab, "failed to enable msi: %d\n", ret);1108goto err_pci_free_region;1109}11101111ret = ath11k_core_pre_init(ab);1112if (ret)1113goto err_pci_disable_msi;11141115ret = ath11k_pci_set_irq_affinity_hint(ab_pci, cpumask_of(0));1116if (ret) {1117ath11k_err(ab, "failed to set irq affinity %d\n", ret);1118goto err_pci_disable_msi;1119}11201121ret = ath11k_mhi_register(ab_pci);1122if (ret) {1123ath11k_err(ab, "failed to register mhi: %d\n", ret);1124goto err_irq_affinity_cleanup;1125}11261127ret = ath11k_hal_srng_init(ab);1128if (ret)1129goto err_mhi_unregister;11301131ret = ath11k_ce_alloc_pipes(ab);1132if (ret) {1133ath11k_err(ab, "failed to allocate ce pipes: %d\n", ret);1134goto err_hal_srng_deinit;1135}11361137ath11k_pci_init_qmi_ce_config(ab);11381139ret = ath11k_pcic_config_irq(ab);1140if (ret) {1141ath11k_err(ab, "failed to config irq: %d\n", ret);1142goto err_ce_free;1143}11441145/* kernel may allocate a dummy vector before request_irq and1146* then allocate a real vector when request_irq is called.1147* So get msi_data here again to avoid spurious interrupt1148* as msi_data will configured to srngs.1149*/1150ret = ath11k_pci_config_msi_data(ab_pci);1151if (ret) {1152ath11k_err(ab, "failed to config msi_data: %d\n", ret);1153goto err_free_irq;1154}11551156ret = ath11k_core_init(ab);1157if (ret) {1158ath11k_err(ab, "failed to init core: %d\n", ret);1159goto err_free_irq;1160}1161ath11k_qmi_fwreset_from_cold_boot(ab);1162return 0;11631164err_free_irq:1165/* __free_irq() expects the caller to have cleared the affinity hint */1166ath11k_pci_set_irq_affinity_hint(ab_pci, NULL);1167ath11k_pcic_free_irq(ab);11681169err_ce_free:1170ath11k_ce_free_pipes(ab);11711172err_hal_srng_deinit:1173ath11k_hal_srng_deinit(ab);11741175err_mhi_unregister:1176ath11k_mhi_unregister(ab_pci);11771178err_irq_affinity_cleanup:1179ath11k_pci_set_irq_affinity_hint(ab_pci, NULL);11801181err_pci_disable_msi:1182ath11k_pci_free_msi(ab_pci);11831184err_pci_free_region:1185ath11k_pci_free_region(ab_pci);11861187err_free_core:1188ath11k_core_free(ab);11891190return ret;1191}11921193static void ath11k_pci_remove(struct pci_dev *pdev)1194{1195struct ath11k_base *ab = pci_get_drvdata(pdev);1196struct ath11k_pci *ab_pci = ath11k_pci_priv(ab);11971198ath11k_pci_set_irq_affinity_hint(ab_pci, NULL);11991200if (test_bit(ATH11K_FLAG_QMI_FAIL, &ab->dev_flags)) {1201ath11k_pci_power_down(ab, false);1202ath11k_debugfs_soc_destroy(ab);1203ath11k_qmi_deinit_service(ab);1204ath11k_core_pm_notifier_unregister(ab);1205goto qmi_fail;1206}12071208set_bit(ATH11K_FLAG_UNREGISTERING, &ab->dev_flags);12091210cancel_work_sync(&ab->reset_work);1211cancel_work_sync(&ab->dump_work);1212ath11k_core_deinit(ab);12131214qmi_fail:1215ath11k_fw_destroy(ab);1216ath11k_mhi_unregister(ab_pci);12171218ath11k_pcic_free_irq(ab);1219ath11k_pci_free_msi(ab_pci);1220ath11k_pci_free_region(ab_pci);12211222ath11k_hal_srng_deinit(ab);1223ath11k_ce_free_pipes(ab);1224ath11k_core_free(ab);1225}12261227static void ath11k_pci_shutdown(struct pci_dev *pdev)1228{1229struct ath11k_base *ab = pci_get_drvdata(pdev);1230struct ath11k_pci *ab_pci = ath11k_pci_priv(ab);12311232ath11k_pci_set_irq_affinity_hint(ab_pci, NULL);1233ath11k_pci_power_down(ab, false);1234}12351236#ifdef CONFIG_PM1237static __maybe_unused int ath11k_pci_pm_suspend(struct device *dev)1238{1239struct ath11k_base *ab = dev_get_drvdata(dev);1240int ret;12411242if (test_bit(ATH11K_FLAG_QMI_FAIL, &ab->dev_flags)) {1243ath11k_dbg(ab, ATH11K_DBG_BOOT, "boot skipping pci suspend as qmi is not initialised\n");1244return 0;1245}12461247ret = ath11k_core_suspend(ab);1248if (ret)1249ath11k_warn(ab, "failed to suspend core: %d\n", ret);12501251return 0;1252}12531254static __maybe_unused int ath11k_pci_pm_resume(struct device *dev)1255{1256struct ath11k_base *ab = dev_get_drvdata(dev);1257int ret;12581259if (test_bit(ATH11K_FLAG_QMI_FAIL, &ab->dev_flags)) {1260ath11k_dbg(ab, ATH11K_DBG_BOOT, "boot skipping pci resume as qmi is not initialised\n");1261return 0;1262}12631264ret = ath11k_core_resume(ab);1265if (ret)1266ath11k_warn(ab, "failed to resume core: %d\n", ret);12671268return ret;1269}12701271static SIMPLE_DEV_PM_OPS(ath11k_pci_pm_ops,1272ath11k_pci_pm_suspend,1273ath11k_pci_pm_resume);1274#endif12751276static struct pci_driver ath11k_pci_driver = {1277.name = "ath11k_pci",1278.id_table = ath11k_pci_id_table,1279.probe = ath11k_pci_probe,1280.remove = ath11k_pci_remove,1281.shutdown = ath11k_pci_shutdown,1282#ifdef CONFIG_PM1283.driver.pm = &ath11k_pci_pm_ops,1284#endif1285};12861287static int ath11k_pci_init(void)1288{1289int ret;12901291ret = pci_register_driver(&ath11k_pci_driver);1292if (ret)1293pr_err("failed to register ath11k pci driver: %d\n",1294ret);12951296return ret;1297}1298module_init(ath11k_pci_init);12991300static void ath11k_pci_exit(void)1301{1302pci_unregister_driver(&ath11k_pci_driver);1303}13041305module_exit(ath11k_pci_exit);13061307MODULE_DESCRIPTION("Driver support for Qualcomm Technologies PCIe 802.11ax WLAN devices");1308MODULE_LICENSE("Dual BSD/GPL");1309#if defined(__FreeBSD__)1310MODULE_VERSION(ath11k_pci, 1);1311MODULE_DEPEND(ath11k_pci, linuxkpi, 1, 1, 1);1312MODULE_DEPEND(ath11k_pci, linuxkpi_wlan, 1, 1, 1);1313MODULE_DEPEND(ath11k_pci, athk_common, 1, 1, 1);1314#ifdef CONFIG_ATH11K_DEBUGFS1315MODULE_DEPEND(ath11k_pci, debugfs, 1, 1, 1);1316#endif1317#endif13181319/* firmware files */1320MODULE_FIRMWARE(ATH11K_FW_DIR "/QCA6390/hw2.0/*");1321MODULE_FIRMWARE(ATH11K_FW_DIR "/QCN9074/hw1.0/*");1322MODULE_FIRMWARE(ATH11K_FW_DIR "/WCN6855/hw2.0/*");1323MODULE_FIRMWARE(ATH11K_FW_DIR "/WCN6855/hw2.1/*");132413251326