summaryrefslogtreecommitdiff
path: root/drivers/misc
diff options
context:
space:
mode:
authorKumari Pallavi <kumari.pallavi@oss.qualcomm.com>2025-12-26 12:35:34 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-12-29 12:17:19 +0100
commit8314d2c28d3369bc879af8e848f810292b16d0af (patch)
treee938e0338c7f3cb83343b715bb8e620b0251d50a /drivers/misc
parent1d94ce8996d71d77e2d649db9e5c205f423e2c17 (diff)
misc: fastrpc: Update dma_bits for CDSP support on Kaanapali SoC
DSP currently supports 32-bit IOVA (32-bit PA + 4-bit SID) for both Q6 and user DMA (uDMA) access. This is being upgraded to 34-bit PA + 4-bit SID due to a hardware revision in CDSP for Kaanapali SoC, which expands the DMA addressable range. Update DMA bits configuration in the driver to support CDSP on Kaanapali SoC. Set the default `dma_bits` to 32-bit and update it to 34-bit based on CDSP and OF matching on the fastrpc node. Signed-off-by: Kumari Pallavi <kumari.pallavi@oss.qualcomm.com> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Link: https://patch.msgid.link/20251226070534.602021-5-kumari.pallavi@oss.qualcomm.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/fastrpc.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c
index fcc80206b7c4..4f5a79c50f58 100644
--- a/drivers/misc/fastrpc.c
+++ b/drivers/misc/fastrpc.c
@@ -259,6 +259,8 @@ struct fastrpc_session_ctx {
struct fastrpc_soc_data {
u32 sid_pos;
+ u32 dma_addr_bits_cdsp;
+ u32 dma_addr_bits_default;
};
struct fastrpc_channel_ctx {
@@ -2197,6 +2199,7 @@ static int fastrpc_cb_probe(struct platform_device *pdev)
int i, sessions = 0;
unsigned long flags;
int rc;
+ u32 dma_bits;
cctx = dev_get_drvdata(dev->parent);
if (!cctx)
@@ -2210,12 +2213,16 @@ static int fastrpc_cb_probe(struct platform_device *pdev)
spin_unlock_irqrestore(&cctx->lock, flags);
return -ENOSPC;
}
+ dma_bits = cctx->soc_data->dma_addr_bits_default;
sess = &cctx->session[cctx->sesscount++];
sess->used = false;
sess->valid = true;
sess->dev = dev;
dev_set_drvdata(dev, sess);
+ if (cctx->domain_id == CDSP_DOMAIN_ID)
+ dma_bits = cctx->soc_data->dma_addr_bits_cdsp;
+
if (of_property_read_u32(dev->of_node, "reg", &sess->sid))
dev_info(dev, "FastRPC Session ID not specified in DT\n");
@@ -2230,9 +2237,9 @@ static int fastrpc_cb_probe(struct platform_device *pdev)
}
}
spin_unlock_irqrestore(&cctx->lock, flags);
- rc = dma_set_mask(dev, DMA_BIT_MASK(32));
+ rc = dma_set_mask(dev, DMA_BIT_MASK(dma_bits));
if (rc) {
- dev_err(dev, "32-bit DMA enable failed\n");
+ dev_err(dev, "%u-bit DMA enable failed\n", dma_bits);
return rc;
}
@@ -2319,10 +2326,14 @@ static int fastrpc_get_domain_id(const char *domain)
static const struct fastrpc_soc_data kaanapali_soc_data = {
.sid_pos = 56,
+ .dma_addr_bits_cdsp = 34,
+ .dma_addr_bits_default = 32,
};
static const struct fastrpc_soc_data default_soc_data = {
.sid_pos = 32,
+ .dma_addr_bits_cdsp = 32,
+ .dma_addr_bits_default = 32,
};
static int fastrpc_rpmsg_probe(struct rpmsg_device *rpdev)