summaryrefslogtreecommitdiff
path: root/drivers/net/ipa/ipa_mem.c
diff options
context:
space:
mode:
authorAlex Elder <elder@linaro.org>2021-03-24 08:15:26 -0500
committerDavid S. Miller <davem@davemloft.net>2021-03-24 16:52:47 -0700
commite6e49e435512c8bcf104e594d3cc34b8f3818492 (patch)
treebb667c353bfa02c0e871b7986974e4e767326661 /drivers/net/ipa/ipa_mem.c
parent647a05f3ae98ba98b87dc1177a54d205fbaa1b66 (diff)
downloadlwn-e6e49e435512c8bcf104e594d3cc34b8f3818492.tar.gz
lwn-e6e49e435512c8bcf104e594d3cc34b8f3818492.zip
net: ipa: limit local processing context address
Not all of the bits of the LOCAL_PKT_PROC_CNTXT register are valid. Until IPA v4.5, there are 17 valid bits (though the bottom three must be zero). Starting with IPA v4.5, 18 bits are valid. Introduce proc_cntxt_base_addr_encoded() to encode the base address for use in the register using only the valid bits. Shorten the name of the register (omit "_BASE") to avoid the need to wrap the line in the one place it's used. Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ipa/ipa_mem.c')
-rw-r--r--drivers/net/ipa/ipa_mem.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/ipa/ipa_mem.c b/drivers/net/ipa/ipa_mem.c
index f25029b9ec85..32907dde5dc6 100644
--- a/drivers/net/ipa/ipa_mem.c
+++ b/drivers/net/ipa/ipa_mem.c
@@ -61,6 +61,7 @@ int ipa_mem_setup(struct ipa *ipa)
struct gsi_trans *trans;
u32 offset;
u16 size;
+ u32 val;
/* Get a transaction to define the header memory region and to zero
* the processing context and modem memory regions.
@@ -89,8 +90,9 @@ int ipa_mem_setup(struct ipa *ipa)
gsi_trans_commit_wait(trans);
/* Tell the hardware where the processing context area is located */
- iowrite32(ipa->mem_offset + ipa->mem[IPA_MEM_MODEM_PROC_CTX].offset,
- ipa->reg_virt + IPA_REG_LOCAL_PKT_PROC_CNTXT_BASE_OFFSET);
+ offset = ipa->mem_offset + ipa->mem[IPA_MEM_MODEM_PROC_CTX].offset;
+ val = proc_cntxt_base_addr_encoded(ipa->version, offset);
+ iowrite32(val, ipa->reg_virt + IPA_REG_LOCAL_PKT_PROC_CNTXT_OFFSET);
return 0;
}