Patch "ath10k: fix reading sram contents for QCA4019" has been added to the 4.9-stable tree
Subsystems (2)
This is a note to let you know that I've just added the patch titled
ath10k: fix reading sram contents for QCA4019
to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
ath10k-fix-reading-sram-contents-for-qca4019.patch
and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From foo@baz Mon Nov 6 10:07:35 CET 2017
From: Ashok Raj Nagarajan <[email protected]>
Date: Sat, 7 Oct 2017 22:36:52 +0000
Subject: ath10k: fix reading sram contents for QCA4019
From: Ashok Raj Nagarajan <[email protected]>
[ Upstream commit 7f622593cc5add77a99cd39404e8a851be9de792 ]
With QCA4019 platform, SRAM address can be accessed directly from host but currently, we are assuming sram addresses cannot be accessed directly and hence we convert the addresses.
While there, clean up growing hw checks during conversion of target CPU address to CE address. Now we have function pointer pertaining to different chips.
--- drivers/net/wireless/ath/ath10k/ahb.c | 23 +++++++++++++++ drivers/net/wireless/ath/ath10k/pci.c | 51 +++++++++++++++++++++------------- drivers/net/wireless/ath/ath10k/pci.h | 5 +++ 3 files changed, 60 insertions(+), 19 deletions(-)
drivers/net/wireless/ath/ath10k/ahb.c +23 -0
@@ -33,6 +33,9 @@ static const struct of_device_id ath10k_MODULE_DEVICE_TABLE (of, ath10k_ahb_of_match); +#define QCA4019_SRAM_ADDR 0x000C0000 +#define QCA4019_SRAM_LEN 0x00040000/* 256 kb */ +static inline struct ath10k_ahb *ath10k_ahb_priv (struct ath10k *ar) {return &((struct ath10k_pci *)ar->drv_priv)->ahb[0 ];
@@ -699,6 +702,25 @@ out:return ret; } +static u32 ath10k_ahb_qca4019_targ_cpu_to_ce_addr (struct ath10k *ar,u32 addr) +{ +u32 val =0 , region = addr &0xfffff ; + + val =ath10k_pci_read32 (ar,PCIE_BAR_REG_ADDRESS ); + +if (region >=QCA4019_SRAM_ADDR && region <= + (QCA4019_SRAM_ADDR +QCA4019_SRAM_LEN )) { +/* SRAM contents for QCA4019 can be directly accessed and +* no conversions are required +*/ + val |= region; + }else { + val |=0x100000 | region; + } + +return val; +} +static const struct ath10k_hif_ops ath10k_ahb_hif_ops = { .tx_sg = ath10k_pci_hif_tx_sg, .diag_read = ath10k_pci_hif_diag_read,
@@ -766,6 +788,7 @@ static int ath10k_ahb_probe(struct platf ar_pci->mem_len = ar_ahb->mem_len; ar_pci->ar = ar; ar_pci->bus_ops = &ath10k_ahb_bus_ops; + ar_pci->targ_cpu_to_ce_addr = ath10k_ahb_qca4019_targ_cpu_to_ce_addr; ret =ath10k_pci_setup_resource (ar);if (ret) {
drivers/net/wireless/ath/ath10k/pci.c +32 -19
117 lines not on this page · raw message
drivers/net/wireless/ath/ath10k/pci.h +5 -0
@@ -238,6 +238,11 @@ struct ath10k_pci {/* Chip specific pci full reset function */ int (*pci_hard_reset)(struct ath10k *ar); +/* chip specific methods for converting target CPU virtual address +* space to CE address space +*/ +u32 (*targ_cpu_to_ce_addr)(struct ath10k *ar,u32 addr); +/* Keep this entry in the last, memory for struct ath10k_ahb is * allocated (ahb support enabled case) in the continuation of * this struct.
Patches currently in stable-queue which might be from [email protected] are
queue-4.9/ath10k-fix-reading-sram-contents-for-qca4019.patch