From patchwork Thu Dec 14 11:42:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Md Sadre Alam X-Patchwork-Id: 178686 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp8478831dys; Thu, 14 Dec 2023 03:43:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IEZ7yzP3rYSUDdi3pSb4kK2F/kqedvWqMvWydWx2+2s8Igo5hA0sIUns/poO1q61iWzwC0L X-Received: by 2002:a17:903:22cd:b0:1d0:6ffd:e2ce with SMTP id y13-20020a17090322cd00b001d06ffde2cemr12255789plg.104.1702554216262; Thu, 14 Dec 2023 03:43:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702554216; cv=none; d=google.com; s=arc-20160816; b=nUL9rbZb+prRraSONSpa6NK6R4PoCGM6yjvGHsomezmZ/V1+uAp7Qw4+Irr5dFJCuh Dqq2kSmObKR5A2RCBVoxqiuQlivzJnOqnvfIzDjWdI7N98iiw+fEgO6EnQ7x+QVZTOWn Yo2/KefqHdHzLvS6INWBJKJi7wfs8Y8sTfwkPEFaX71VLFaYICEdFP9sBt8RJ9J2406D TOsET0yNMEEEccEOPP9uFd4+rvM+mBp/xtZxL2h8TsgjIQfrVnDOYrvr05RPtAegbAda d94p92OVdf1qWS51wVkId6Mb+pR7l3qAs4/aR7C8cyr0p4KnKpG5tLMDEIBRWhYopGBw 40/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=anCtqsKtp1i+md8JEX235h4zBk/DBMhkbb/Ttd52B3c=; fh=TEn06IatapHMgkFhNRCYXHrnqycBlFaJECTG22CvvEc=; b=SwuQ41xScijl/Og9ehp11G1ZSkKQOrhmwYaH7VlE8+WNrhIhRzSJ5rGdodaFh3LXHJ c4h+SdpTHq2nShUx6+BNfD9RbTOktCONHygnX7AAzx+1bwBCo1Nk+WSBxzPACbDbVO6Z QCY5aQpVqQRnQV+bdv+AR5NzmVtAfod+rkJLbMOyBtdFr4lJgcJ+JoT6tA18VVWWucCO ffBos7EC4VScKIqvyGdGq7FJH5R3OgLI2OXaUQ7QQ8h259dluue1bJW4KfOr3HXE7thP tCI7SpZU/Juy8b/++kBm/a1163sdXoG4Oesi8baqMcNHDdw+ELW6zp/k5CMx1CqTXuN/ ybGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=fRT1Yy8t; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id l11-20020a170902d34b00b001d376259533si210581plk.199.2023.12.14.03.43.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 03:43:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=fRT1Yy8t; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id E2A2780267C9; Thu, 14 Dec 2023 03:43:29 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1444193AbjLNLnT (ORCPT + 99 others); Thu, 14 Dec 2023 06:43:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1444050AbjLNLmw (ORCPT ); Thu, 14 Dec 2023 06:42:52 -0500 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B203E11B; Thu, 14 Dec 2023 03:42:58 -0800 (PST) Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 3BE4hZql022533; Thu, 14 Dec 2023 11:42:48 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=qcppdkim1; bh=anCtqsK tp1i+md8JEX235h4zBk/DBMhkbb/Ttd52B3c=; b=fRT1Yy8tVVrti6oeoNB7sfP Mwij9J1qlDvp+9WHaWW0MOa6Y/SLDaeMpYAMDjSXBERO2Bt0451gjf7BDTy2SQuF 5q1Ha49O4iHXtWpIaZ6YKPh4ah9N5jQlRkBwdkhuOEkuJkbW/l4AL+lE1F0Aob5v CGeNHvk8kfya/zfIN9deQPjUpcJNdUgbXL3tUfMa1shHZzVt7BuysuzsasPoASej 09zNXT72szu89a1ktxWjbYdUavtex8o2SAxmDxwpvTUrvtfpR3n393uJxZmFU1/U PhNV7VptqUh2ue88JNWHcDKPryfnFECMUPFh1E1EHJvMYLE1tcnVhDIkokBL+yQ= = Received: from apblrppmta02.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3uyp0p9a39-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 Dec 2023 11:42:48 +0000 (GMT) Received: from pps.filterd (APBLRPPMTA02.qualcomm.com [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTP id 3BEBghuX003051; Thu, 14 Dec 2023 11:42:43 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTPS id 3uvhaktcgf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 Dec 2023 11:42:43 +0000 Received: from APBLRPPMTA02.qualcomm.com (APBLRPPMTA02.qualcomm.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 3BEBghQJ002911; Thu, 14 Dec 2023 11:42:43 GMT Received: from hu-devc-blr-u22-a.qualcomm.com (hu-mdalam-blr.qualcomm.com [10.131.36.157]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTPS id 3BEBghwb002830 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 Dec 2023 11:42:43 +0000 Received: by hu-devc-blr-u22-a.qualcomm.com (Postfix, from userid 466583) id 838C34127D; Thu, 14 Dec 2023 17:12:42 +0530 (+0530) From: Md Sadre Alam To: thara.gopinath@gmail.com, herbert@gondor.apana.org.au, davem@davemloft.net, agross@kernel.org, andersson@kernel.org, konrad.dybcio@linaro.org, vkoul@kernel.org, linux-crypto@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org, quic_srichara@quicinc.com, quic_varada@quicinc.com Cc: quic_mdalam@quicinc.com Subject: [PATCH 01/11] crypto: qce - Add support for crypto address read Date: Thu, 14 Dec 2023 17:12:29 +0530 Message-Id: <20231214114239.2635325-2-quic_mdalam@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231214114239.2635325-1-quic_mdalam@quicinc.com> References: <20231214114239.2635325-1-quic_mdalam@quicinc.com> MIME-Version: 1.0 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-ORIG-GUID: dm_cbDhlAO8voiFCninNWp50cObObTB4 X-Proofpoint-GUID: dm_cbDhlAO8voiFCninNWp50cObObTB4 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-09_02,2023-12-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 mlxlogscore=999 mlxscore=0 priorityscore=1501 phishscore=0 impostorscore=0 clxscore=1015 malwarescore=0 lowpriorityscore=0 adultscore=0 bulkscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2312140080 X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 14 Dec 2023 03:43:30 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785257489800550169 X-GMAIL-MSGID: 1785257489800550169 Get crypto base address from DT. This will use for command descriptor support for crypto register r/w via BAM/DMA Signed-off-by: Md Sadre Alam --- drivers/crypto/qce/core.c | 9 +++++++++ drivers/crypto/qce/core.h | 1 + 2 files changed, 10 insertions(+) diff --git a/drivers/crypto/qce/core.c b/drivers/crypto/qce/core.c index 28b5fd823827..5af0dc40738a 100644 --- a/drivers/crypto/qce/core.c +++ b/drivers/crypto/qce/core.c @@ -192,6 +192,7 @@ static int qce_crypto_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct qce_device *qce; + struct resource *res; int ret; qce = devm_kzalloc(dev, sizeof(*qce), GFP_KERNEL); @@ -205,6 +206,14 @@ static int qce_crypto_probe(struct platform_device *pdev) if (IS_ERR(qce->base)) return PTR_ERR(qce->base); + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + if (!res) + return -ENOMEM; + qce->base_dma = dma_map_resource(dev, res->start, resource_size(res), + DMA_BIDIRECTIONAL, 0); + if (dma_mapping_error(dev, qce->base_dma)) + return -ENXIO; + ret = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(32)); if (ret < 0) return ret; diff --git a/drivers/crypto/qce/core.h b/drivers/crypto/qce/core.h index 228fcd69ec51..25e2af45c047 100644 --- a/drivers/crypto/qce/core.h +++ b/drivers/crypto/qce/core.h @@ -39,6 +39,7 @@ struct qce_device { struct qce_dma_data dma; int burst_size; unsigned int pipe_pair_id; + dma_addr_t base_dma; int (*async_req_enqueue)(struct qce_device *qce, struct crypto_async_request *req); void (*async_req_done)(struct qce_device *qce, int ret);