Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Kumari Pallavi and committed by
Greg Kroah-Hartman
8314d2c2 1d94ce89

+13 -2
+13 -2
drivers/misc/fastrpc.c
··· 259 259 260 260 struct fastrpc_soc_data { 261 261 u32 sid_pos; 262 + u32 dma_addr_bits_cdsp; 263 + u32 dma_addr_bits_default; 262 264 }; 263 265 264 266 struct fastrpc_channel_ctx { ··· 2199 2197 int i, sessions = 0; 2200 2198 unsigned long flags; 2201 2199 int rc; 2200 + u32 dma_bits; 2202 2201 2203 2202 cctx = dev_get_drvdata(dev->parent); 2204 2203 if (!cctx) ··· 2213 2210 spin_unlock_irqrestore(&cctx->lock, flags); 2214 2211 return -ENOSPC; 2215 2212 } 2213 + dma_bits = cctx->soc_data->dma_addr_bits_default; 2216 2214 sess = &cctx->session[cctx->sesscount++]; 2217 2215 sess->used = false; 2218 2216 sess->valid = true; 2219 2217 sess->dev = dev; 2220 2218 dev_set_drvdata(dev, sess); 2219 + 2220 + if (cctx->domain_id == CDSP_DOMAIN_ID) 2221 + dma_bits = cctx->soc_data->dma_addr_bits_cdsp; 2221 2222 2222 2223 if (of_property_read_u32(dev->of_node, "reg", &sess->sid)) 2223 2224 dev_info(dev, "FastRPC Session ID not specified in DT\n"); ··· 2237 2230 } 2238 2231 } 2239 2232 spin_unlock_irqrestore(&cctx->lock, flags); 2240 - rc = dma_set_mask(dev, DMA_BIT_MASK(32)); 2233 + rc = dma_set_mask(dev, DMA_BIT_MASK(dma_bits)); 2241 2234 if (rc) { 2242 - dev_err(dev, "32-bit DMA enable failed\n"); 2235 + dev_err(dev, "%u-bit DMA enable failed\n", dma_bits); 2243 2236 return rc; 2244 2237 } 2245 2238 ··· 2326 2319 2327 2320 static const struct fastrpc_soc_data kaanapali_soc_data = { 2328 2321 .sid_pos = 56, 2322 + .dma_addr_bits_cdsp = 34, 2323 + .dma_addr_bits_default = 32, 2329 2324 }; 2330 2325 2331 2326 static const struct fastrpc_soc_data default_soc_data = { 2332 2327 .sid_pos = 32, 2328 + .dma_addr_bits_cdsp = 32, 2329 + .dma_addr_bits_default = 32, 2333 2330 }; 2334 2331 2335 2332 static int fastrpc_rpmsg_probe(struct rpmsg_device *rpdev)