From nobody Tue Dec 16 21:16:36 2025 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 61F082FF66A; Thu, 11 Dec 2025 10:09:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765447796; cv=none; b=qa0/PtRg+idjS4VYT0t/9Ow5jgsP+qRDjNAyaftIyHHQzkikRJO9+vG6vs6JnYbGZWJloSjF5mzzUDtzY/VNc5d3ddr1nQVndZ8OzrvU3Gp7whu6Rxv8jNof395ES7fJ6hfCp43J2t67gF+JZTXZEUvbBiwY2D2gWDiHBbXPcPQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765447796; c=relaxed/simple; bh=1bhxSf2/Y8D86Y6DHpiNlB7iFuF07Jb5dJFEFzkWFTQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=nBacADbfbHOfV06xP8d/pu+5ppqiBc4eorP9/goiaZe9OgrQj6wNvcnFSHWGMICXgbY1MbrF/FZvQt6vz4OKYmS6TJ9DnxZFluQfHBK7jV8S/aR22Rb9b/SPFwecMB3rRATR2G3YoWS04OoeCTVYCc9oQEJ4q8situla/vVF1LQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=j2dFDH62; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="j2dFDH62" Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 5BB9ZREE1054833; Thu, 11 Dec 2025 10:09:49 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=iiYtERK5lDS jU0f7TnMrdUzOzeVIfDyXuyD3Ay+56Fk=; b=j2dFDH62SWidfTwwYK+uRupV80O +ICsjsjWNnRD7eJXS6u1gUeBnS79XHt7IwnJJhsHzPEo9rFHhe0VXxTYMk+3shHT p5/RYwxwLkRxMtfkWMtxEQ6NPs1pIyGX3YnpMDJoZLGptr8hYIgcNlg9sEUrkkiQ Vt4A6UVtTldPmOFrIUBZIXl0bczdRmJLpTjOLoF7J9RQw+wmj7t0PbZZX4q+EPsf D5UzcOwHkBCOWXczzNNd2wRPiliaMJjk+tbrLtEfaMQGMlUrqCaW1f/Y6BauGGHX 64h36SyU2fqGzSKo23cUOQ2oXJHa5XGD5znj4qz1Wzb1eel1UjsHp/7A5rg== Received: from apblrppmta01.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4aygsx1yav-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 11 Dec 2025 10:09:49 +0000 (GMT) Received: from pps.filterd (APBLRPPMTA01.qualcomm.com [127.0.0.1]) by APBLRPPMTA01.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTP id 5BBA9kaV013920; Thu, 11 Dec 2025 10:09:46 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA01.qualcomm.com (PPS) with ESMTPS id 4avdjnuppp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 11 Dec 2025 10:09:46 +0000 Received: from APBLRPPMTA01.qualcomm.com (APBLRPPMTA01.qualcomm.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 5BBA9kKr013904; Thu, 11 Dec 2025 10:09:46 GMT Received: from hu-devc-hyd-u22-c.qualcomm.com (hu-kpallavi-hyd.qualcomm.com [10.147.243.7]) by APBLRPPMTA01.qualcomm.com (PPS) with ESMTPS id 5BBA9jwA013896 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 11 Dec 2025 10:09:46 +0000 Received: by hu-devc-hyd-u22-c.qualcomm.com (Postfix, from userid 4720299) id A6DD756A; Thu, 11 Dec 2025 15:39:44 +0530 (+0530) From: Kumari Pallavi To: kpallavi@qti.qualcomm.com, srini@kernel.org, amahesh@qti.qualcomm.com, arnd@arndb.de, gregkh@linuxfoundation.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org Cc: Kumari Pallavi , quic_bkumar@quicinc.com, ekansh.gupta@oss.qualcomm.com, linux-kernel@vger.kernel.org, quic_chennak@quicinc.com, dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, jingyi.wang@oss.qualcomm.com, aiqun.yu@oss.qualcomm.com, ktadakam@qti.qualcomm.com Subject: [PATCH v6 4/4] misc: fastrpc: Update dma_bits for CDSP support on Kaanapali SoC Date: Thu, 11 Dec 2025 15:39:33 +0530 Message-Id: <20251211100933.1285093-5-kumari.pallavi@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20251211100933.1285093-1-kumari.pallavi@oss.qualcomm.com> References: <20251211100933.1285093-1-kumari.pallavi@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-QCInternal: smtphost X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: r9lxgX0muM-eLe9b-Ua8Suynkwm33XWk X-Authority-Analysis: v=2.4 cv=d974CBjE c=1 sm=1 tr=0 ts=693a986d cx=c_pps a=Ou0eQOY4+eZoSc0qltEV5Q==:117 a=Ou0eQOY4+eZoSc0qltEV5Q==:17 a=wP3pNCr1ah4A:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=pfE1wiWnY1F2L3mdSfMA:9 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMjExMDA3NyBTYWx0ZWRfX7g28sQSf5yvk pUJ8L3wid5/PpsB0PD6EIPLTHLKndsiw55KKIaf+TgNdHMdhyx2vc0jIyrcLDz8ptwCgFjdLeRx GVW800EIOXM7rxrJjMWLOsO8xZLRuZz5bezjELi5ODcldmVd1C6GPkA0w6fClxJJAlBE5LRGwPQ QKDIgTBmClsrMXkBukOKvTBP3mvHUFOUjSRYKa1gUS9svNeF3h5AwvsizPPXFRb8TTZ4iuReIay aRe6K9JEwT3TpDDPOKrfC2vC9ttq6JEwOg78YY7HVHikrlrymJ6OpdGXvpQJ4tBQIKzZbhiv5PY d54xKSkQkUrwp/+Qp5hek5I1t1Q9CEReTdpUflNoBb8hyweVG2rJp1Ug0jbOHZ1uUwf1l2P9Wzw KCtXtU6LtWfBfWH8YSHvSAfns+J39g== X-Proofpoint-ORIG-GUID: r9lxgX0muM-eLe9b-Ua8Suynkwm33XWk X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2025-12-10_03,2025-12-09_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 bulkscore=0 impostorscore=0 spamscore=0 priorityscore=1501 adultscore=0 lowpriorityscore=0 malwarescore=0 clxscore=1015 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2510240001 definitions=main-2512110077 Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Dmitry Baryshkov --- drivers/misc/fastrpc.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c index af92876f1cc1..333be4c4f10b 100644 --- a/drivers/misc/fastrpc.c +++ b/drivers/misc/fastrpc.c @@ -276,6 +276,8 @@ struct fastrpc_session_ctx { =20 struct fastrpc_soc_data { u32 sid_pos; + u32 dma_addr_bits_cdsp; + u32 dma_addr_bits_default; }; =20 struct fastrpc_channel_ctx { @@ -2202,6 +2204,7 @@ static int fastrpc_cb_probe(struct platform_device *p= dev) int i, sessions =3D 0; unsigned long flags; int rc; + u32 dma_bits; =20 cctx =3D dev_get_drvdata(dev->parent); if (!cctx) @@ -2215,12 +2218,16 @@ static int fastrpc_cb_probe(struct platform_device = *pdev) spin_unlock_irqrestore(&cctx->lock, flags); return -ENOSPC; } + dma_bits =3D cctx->soc_data->dma_addr_bits_default; sess =3D &cctx->session[cctx->sesscount++]; sess->used =3D false; sess->valid =3D true; sess->dev =3D dev; dev_set_drvdata(dev, sess); =20 + if (cctx->domain_id =3D=3D CDSP_DOMAIN_ID) + dma_bits =3D 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"); =20 @@ -2235,9 +2242,9 @@ static int fastrpc_cb_probe(struct platform_device *p= dev) } } spin_unlock_irqrestore(&cctx->lock, flags); - rc =3D dma_set_mask(dev, DMA_BIT_MASK(32)); + rc =3D 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; } =20 @@ -2324,10 +2331,14 @@ static int fastrpc_get_domain_id(const char *domain) =20 static const struct fastrpc_soc_data kaanapali_soc_data =3D { .sid_pos =3D 56, + .dma_addr_bits_cdsp =3D 34, + .dma_addr_bits_default =3D 32, }; =20 static const struct fastrpc_soc_data default_soc_data =3D { .sid_pos =3D 32, + .dma_addr_bits_cdsp =3D 32, + .dma_addr_bits_default =3D 32, }; =20 static int fastrpc_rpmsg_probe(struct rpmsg_device *rpdev) --=20 2.34.1