Message ID | 20230405072836.1690248-9-bhupesh.sharma@linaro.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp123622vqo; Wed, 5 Apr 2023 00:50:01 -0700 (PDT) X-Google-Smtp-Source: AKy350Y1nLgmumFgji5nCU6AtSZRGzAFhUzwJYg6cMHQerJSsXGcz3O7Ecgm9+VPB2rc4VwVvqYa X-Received: by 2002:a17:906:1741:b0:92a:77dd:f6f with SMTP id d1-20020a170906174100b0092a77dd0f6fmr1673913eje.73.1680681001444; Wed, 05 Apr 2023 00:50:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680681001; cv=none; d=google.com; s=arc-20160816; b=Ttl6VElcNEwziuKQFv+RkC3ZPD4q/h+mbV15HCmBB0qJn3nS0ZB7OiLryhj6/F+sRu pW71cXeJubKUg9AKEbnpWUM/qh7fWMSvla9pSwioTLOl1MGUvJ3ixM+ecdIe6Q/cYvCO 7gqlqGaVamK1pe28zyX9Akh6uWlYzhp4krFOj9dKi9gGMscKe+IU8UhGvuVqJLeSVYTP ynasn9TSQtS8LENCNJtAcdF5L/KWb1GJeS/odLKXCiG4BU/mammuiowmiO5xnIeLtukb kkLZsD+xefUZUnCR6+eP9Z/P01eXXnjA3X8Ug9KpvSth84HDjuLQQdjRNSlBAtboW5VT RJNw== 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=3MVums2xGimULwLAksXbnkYaopPwvTqx5iwZKEFGpjA=; b=WNU8Q7CIbQxN0SNF6jiLlNpWatl+kdThfaxBzwX4Vsv9KP9HA7GMbUCKBHBHhW+XSe o8o2t2vve2pY8zpNAnzoMo88RBp7mMPm36GJ9yuEHnpDFrvtwGHKEcaJRffoVI/yITof GtccLFJIIWrI6+zTUslZvHNp1JvGBAMlckEN1qaD407OUIzcbFSlA6+osOmxVuUEt+y+ ZKuvDiVBzaAmW5yaDZF3cG9mZHHOcR9PyGoXY4+302xK5gg13SXx5FRxfZN9EGXEprBu YAwFE6qiojf0onok+kw9tL+/rAzdIjpuu4dilbFrgoAte+KthcHqSKFyapHjyYamCXTq S/wQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zGOdeyUu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a21-20020a1709063a5500b008b223aa7a2dsi2571810ejf.734.2023.04.05.00.49.37; Wed, 05 Apr 2023 00:50:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zGOdeyUu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237109AbjDEHc2 (ORCPT <rfc822;lkml4gm@gmail.com> + 99 others); Wed, 5 Apr 2023 03:32:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45490 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237190AbjDEHb7 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 5 Apr 2023 03:31:59 -0400 Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3693159FF for <linux-kernel@vger.kernel.org>; Wed, 5 Apr 2023 00:31:29 -0700 (PDT) Received: by mail-pj1-x102d.google.com with SMTP id h12-20020a17090aea8c00b0023d1311fab3so36429936pjz.1 for <linux-kernel@vger.kernel.org>; Wed, 05 Apr 2023 00:31:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680679889; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3MVums2xGimULwLAksXbnkYaopPwvTqx5iwZKEFGpjA=; b=zGOdeyUuHbssOQ7Z1mPYifIrImzF0vUnQh4Iw+uFJy5hY8QkDtGxFIGiG3kQuaTxhm u56fsLmTn4sJoiDloYF0AozECkkKzxU4bafTT7eZ39jiA8sOR1uJLdIRWyBBb8K3inQG U6WBpxN3cYIoOt3D8JP6Be5owOmPe147i0mbAtgAph5yWGWSUS4W7KFToxkkbixIceV7 E7ksTM/lHtxEIRW2e7aeep3WgvtpLn6ituYfGV4kuUNPSEXITCTdqivik/x6DJ1UMdXe SnJDBCcNMRVTjDXLGEniSeo8qelBz7zYsciLArvf/ii48/h7WcXJTOmyVW/riM56MsGU Ib0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680679889; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3MVums2xGimULwLAksXbnkYaopPwvTqx5iwZKEFGpjA=; b=3BtfrUQO8v95XHb3sxzFalrB1hcBmDaqiH81PUHtpvi91LiV3EaUoPpkVRJCP7bUFZ n/lq76wUcV5JOTiDbxZoLqt/vCEu0JtOhVHZ/t7pXvSrODo+cGfK7f4w3J3iD/AcP3OO 7OkRGnXjaAsLXoUK0GbIeVjJVAVRq9sntsnGWFpFNeKmCzrva3fCBwvzhSM/9QhJv7u1 6XiaN6CcDX59J+69txmiiwMRsxofWc9otD239rseFPaZjkvl2D4dl/og560ndUprcPIS sKpzpXSSAO3rpQy2VqfkrjD9ex3rCHePrXUBYZZ5BeEl4s2ZvcisQS6sr3Pz385cXjSc mnpg== X-Gm-Message-State: AAQBX9e1EY6Vtf7YLkV0JZ+t1ImqgnpEmT2b2Vf6IMQBfIQBFjIUwYpw ZEwg/H1xKgt7i8p5hXj4HGfU1g== X-Received: by 2002:a05:6a20:4b16:b0:d9:162d:98e4 with SMTP id fp22-20020a056a204b1600b000d9162d98e4mr4000483pzb.54.1680679888795; Wed, 05 Apr 2023 00:31:28 -0700 (PDT) Received: from localhost.localdomain ([223.233.67.41]) by smtp.gmail.com with ESMTPSA id l7-20020a635b47000000b004facdf070d6sm8781507pgm.39.2023.04.05.00.31.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Apr 2023 00:31:28 -0700 (PDT) From: Bhupesh Sharma <bhupesh.sharma@linaro.org> To: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org Cc: agross@kernel.org, linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, andersson@kernel.org, bhupesh.sharma@linaro.org, bhupesh.linux@gmail.com, krzysztof.kozlowski@linaro.org, robh+dt@kernel.org, konrad.dybcio@linaro.org, vladimir.zapolskiy@linaro.org, rfoss@kernel.org, neil.armstrong@linaro.org, djakov@kernel.org Subject: [PATCH v6 08/11] arm64: dts: qcom: sm8150: Add Crypto Engine support Date: Wed, 5 Apr 2023 12:58:33 +0530 Message-Id: <20230405072836.1690248-9-bhupesh.sharma@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230405072836.1690248-1-bhupesh.sharma@linaro.org> References: <20230405072836.1690248-1-bhupesh.sharma@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762321761779349593?= X-GMAIL-MSGID: =?utf-8?q?1762321761779349593?= |
Series |
arm64: qcom: Enable Crypto Engine for a few Qualcomm SoCs
|
|
Commit Message
Bhupesh Sharma
April 5, 2023, 7:28 a.m. UTC
Add crypto engine (CE) and CE BAM related nodes and definitions to
'sm8150.dtsi'.
Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
---
arch/arm64/boot/dts/qcom/sm8150.dtsi | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
Comments
On 5.04.2023 09:28, Bhupesh Sharma wrote: > Add crypto engine (CE) and CE BAM related nodes and definitions to > 'sm8150.dtsi'. > > Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org> > --- > arch/arm64/boot/dts/qcom/sm8150.dtsi | 22 ++++++++++++++++++++++ > 1 file changed, 22 insertions(+) > > diff --git a/arch/arm64/boot/dts/qcom/sm8150.dtsi b/arch/arm64/boot/dts/qcom/sm8150.dtsi > index 9491be4a6bf0..c104d0b12dc6 100644 > --- a/arch/arm64/boot/dts/qcom/sm8150.dtsi > +++ b/arch/arm64/boot/dts/qcom/sm8150.dtsi > @@ -2081,6 +2081,28 @@ ufs_mem_phy_lanes: phy@1d87400 { > }; > }; > > + cryptobam: dma-controller@1dc4000 { > + compatible = "qcom,bam-v1.7.4", "qcom,bam-v1.7.0"; > + reg = <0 0x01dc4000 0 0x24000>; > + interrupts = <GIC_SPI 272 IRQ_TYPE_LEVEL_HIGH>; > + #dma-cells = <1>; > + qcom,ee = <0>; > + qcom,controlled-remotely; > + iommus = <&apps_smmu 0x514 0x0011>, > + <&apps_smmu 0x516 0x0011>; > + }; > + > + crypto: crypto@1dfa000 { > + compatible = "qcom,sm8150-qce", "qcom,qce"; > + reg = <0 0x01dfa000 0 0x6000>; > + dmas = <&cryptobam 4>, <&cryptobam 5>; > + dma-names = "rx", "tx"; > + iommus = <&apps_smmu 0x514 0x0011>, > + <&apps_smmu 0x516 0x0011>; Downstream uses these (sid, mask) combos: qcedev: 0x0506 0x0011 0x0516 0x0011 // equal to 0x506 0x11 qcom_cedev_ns_cb: 0x512 0 0x518 0 0x519 0 0x51f 0 Shouldn't we use them too? Konrad > + interconnects = <&aggre2_noc MASTER_CRYPTO_CORE_0 &mc_virt SLAVE_EBI_CH0>; > + interconnect-names = "memory"; > + }; > + > tcsr_mutex: hwlock@1f40000 { > compatible = "qcom,tcsr-mutex"; > reg = <0x0 0x01f40000 0x0 0x20000>;
Hi Konrad, Sorry for the late reply, but I wanted to look at the latest downstream code before responding. On Thu, 6 Apr 2023 at 19:28, Konrad Dybcio <konrad.dybcio@linaro.org> wrote: > > On 5.04.2023 09:28, Bhupesh Sharma wrote: > > Add crypto engine (CE) and CE BAM related nodes and definitions to > > 'sm8150.dtsi'. > > > > Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org> > > --- > > arch/arm64/boot/dts/qcom/sm8150.dtsi | 22 ++++++++++++++++++++++ > > 1 file changed, 22 insertions(+) > > > > diff --git a/arch/arm64/boot/dts/qcom/sm8150.dtsi b/arch/arm64/boot/dts/qcom/sm8150.dtsi > > index 9491be4a6bf0..c104d0b12dc6 100644 > > --- a/arch/arm64/boot/dts/qcom/sm8150.dtsi > > +++ b/arch/arm64/boot/dts/qcom/sm8150.dtsi > > @@ -2081,6 +2081,28 @@ ufs_mem_phy_lanes: phy@1d87400 { > > }; > > }; > > > > + cryptobam: dma-controller@1dc4000 { > > + compatible = "qcom,bam-v1.7.4", "qcom,bam-v1.7.0"; > > + reg = <0 0x01dc4000 0 0x24000>; > > + interrupts = <GIC_SPI 272 IRQ_TYPE_LEVEL_HIGH>; > > + #dma-cells = <1>; > > + qcom,ee = <0>; > > + qcom,controlled-remotely; > > + iommus = <&apps_smmu 0x514 0x0011>, > > + <&apps_smmu 0x516 0x0011>; > > + }; > > + > > + crypto: crypto@1dfa000 { > > + compatible = "qcom,sm8150-qce", "qcom,qce"; > > + reg = <0 0x01dfa000 0 0x6000>; > > + dmas = <&cryptobam 4>, <&cryptobam 5>; > > + dma-names = "rx", "tx"; > > + iommus = <&apps_smmu 0x514 0x0011>, > > + <&apps_smmu 0x516 0x0011>; > Downstream uses these (sid, mask) combos: > > qcedev: > 0x0506 0x0011 > 0x0516 0x0011 // equal to 0x506 0x11 > > qcom_cedev_ns_cb: > 0x512 0 > 0x518 0 > 0x519 0 > 0x51f 0 > > Shouldn't we use them too? Sure, but the following are the latest values used in the downstream .dtsi, so I used them in the latest version and tested with the same on sa8115p-adp and sm8150-mtp without any issues: qcedev: 0x0502 0x0641 0x0504 0x0011 qcom_cedev_ns_cb: 0x0506 0x0011 0x0508 0x0011 0x0512 0x0000 I dropped: 0x0514 0x0011 // equal to 0x504 0x11 0x0516 0x0011 // equal to 0x506 0x11 0x0518 0x0011 // equal to 0x508 0x11 Thanks for pointing this out. Regards, Bhupesh
diff --git a/arch/arm64/boot/dts/qcom/sm8150.dtsi b/arch/arm64/boot/dts/qcom/sm8150.dtsi index 9491be4a6bf0..c104d0b12dc6 100644 --- a/arch/arm64/boot/dts/qcom/sm8150.dtsi +++ b/arch/arm64/boot/dts/qcom/sm8150.dtsi @@ -2081,6 +2081,28 @@ ufs_mem_phy_lanes: phy@1d87400 { }; }; + cryptobam: dma-controller@1dc4000 { + compatible = "qcom,bam-v1.7.4", "qcom,bam-v1.7.0"; + reg = <0 0x01dc4000 0 0x24000>; + interrupts = <GIC_SPI 272 IRQ_TYPE_LEVEL_HIGH>; + #dma-cells = <1>; + qcom,ee = <0>; + qcom,controlled-remotely; + iommus = <&apps_smmu 0x514 0x0011>, + <&apps_smmu 0x516 0x0011>; + }; + + crypto: crypto@1dfa000 { + compatible = "qcom,sm8150-qce", "qcom,qce"; + reg = <0 0x01dfa000 0 0x6000>; + dmas = <&cryptobam 4>, <&cryptobam 5>; + dma-names = "rx", "tx"; + iommus = <&apps_smmu 0x514 0x0011>, + <&apps_smmu 0x516 0x0011>; + interconnects = <&aggre2_noc MASTER_CRYPTO_CORE_0 &mc_virt SLAVE_EBI_CH0>; + interconnect-names = "memory"; + }; + tcsr_mutex: hwlock@1f40000 { compatible = "qcom,tcsr-mutex"; reg = <0x0 0x01f40000 0x0 0x20000>;