linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Enable Qualcomm Crypto Engine on sm8150
@ 2021-10-13 16:58 Bhupesh Sharma
  2021-10-13 16:58 ` [PATCH 1/2] crypto: qce: Add 'sm8150-qce' compatible string check Bhupesh Sharma
  2021-10-13 16:58 ` [PATCH 2/2] arm64/dts: qcom: sm8150: Add dt entries to support crypto engine Bhupesh Sharma
  0 siblings, 2 replies; 6+ messages in thread
From: Bhupesh Sharma @ 2021-10-13 16:58 UTC (permalink / raw)
  To: linux-arm-msm, linux-crypto
  Cc: bhupesh.sharma, bhupesh.linux, linux-kernel, devicetree, robh+dt,
	agross, herbert, davem, Thara Gopinath, Bjorn Andersson

Qualcomm crypto engine is available on sm8150 SoC as well.
It supports hardware accelerated algorithms for encryption
and authentication. It also provides support for aes, des, 3des
encryption algorithms and sha1, sha256, hmac(sha1), hmac(sha256)
authentication algorithms.

Tested the enabled crypto algorithms with cryptsetup test utilities
on sm8150-mtp and sa8155p-adp boards (see [1]) and also with crypto self-tests,
including the fuzz tests (CONFIG_CRYPTO_MANAGER_EXTRA_TESTS=y).

Note that this series is rebased on the corresponding 
crypto engine enablement series for sm8250 SoCs (see [2]).

[1]. https://linux.die.net/man/8/cryptsetup
[2]. https://lore.kernel.org/lkml/20211013105541.68045-1-bhupesh.sharma@linaro.org/T/#t 

Cc: Thara Gopinath <thara.gopinath@linaro.org>
Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: Rob Herring <robh+dt@kernel.org>

Bhupesh Sharma (2):
  crypto: qce: Add 'sm8150-qce' compatible string check
  arm64/dts: qcom: sm8150: Add dt entries to support crypto engine.

 arch/arm64/boot/dts/qcom/sm8150.dtsi | 28 ++++++++++++++++++++++++++++
 drivers/crypto/qce/core.c            |  1 +
 2 files changed, 29 insertions(+)

-- 
2.31.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/2] crypto: qce: Add 'sm8150-qce' compatible string check
  2021-10-13 16:58 [PATCH 0/2] Enable Qualcomm Crypto Engine on sm8150 Bhupesh Sharma
@ 2021-10-13 16:58 ` Bhupesh Sharma
  2021-10-24 17:18   ` Bjorn Andersson
  2021-10-13 16:58 ` [PATCH 2/2] arm64/dts: qcom: sm8150: Add dt entries to support crypto engine Bhupesh Sharma
  1 sibling, 1 reply; 6+ messages in thread
From: Bhupesh Sharma @ 2021-10-13 16:58 UTC (permalink / raw)
  To: linux-arm-msm, linux-crypto
  Cc: bhupesh.sharma, bhupesh.linux, linux-kernel, devicetree, robh+dt,
	agross, herbert, davem, Thara Gopinath, Bjorn Andersson

Add 'sm8150-qce' compatible string check in qce crypto
driver as we add support for sm8150 crypto device in the
device-tree in the subsequent patch.

Cc: Thara Gopinath <thara.gopinath@linaro.org>
Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
---
 drivers/crypto/qce/core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/crypto/qce/core.c b/drivers/crypto/qce/core.c
index 4c55eceb4e7f..ecbe9f7c6c0a 100644
--- a/drivers/crypto/qce/core.c
+++ b/drivers/crypto/qce/core.c
@@ -306,6 +306,7 @@ static int qce_crypto_remove(struct platform_device *pdev)
 static const struct of_device_id qce_crypto_of_match[] = {
 	{ .compatible = "qcom,ipq6018-qce", },
 	{ .compatible = "qcom,sdm845-qce", },
+	{ .compatible = "qcom,sm8150-qce", },
 	{ .compatible = "qcom,sm8250-qce", },
 	{}
 };
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] arm64/dts: qcom: sm8150: Add dt entries to support crypto engine.
  2021-10-13 16:58 [PATCH 0/2] Enable Qualcomm Crypto Engine on sm8150 Bhupesh Sharma
  2021-10-13 16:58 ` [PATCH 1/2] crypto: qce: Add 'sm8150-qce' compatible string check Bhupesh Sharma
@ 2021-10-13 16:58 ` Bhupesh Sharma
  1 sibling, 0 replies; 6+ messages in thread
From: Bhupesh Sharma @ 2021-10-13 16:58 UTC (permalink / raw)
  To: linux-arm-msm, linux-crypto
  Cc: bhupesh.sharma, bhupesh.linux, linux-kernel, devicetree, robh+dt,
	agross, herbert, davem, Thara Gopinath, Bjorn Andersson

Add crypto engine (CE) and CE BAM related nodes and definitions to
"sm8150.dtsi".

Cc: Thara Gopinath <thara.gopinath@linaro.org>
Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: Rob Herring <robh+dt@kernel.org>
Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
---
 arch/arm64/boot/dts/qcom/sm8150.dtsi | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sm8150.dtsi b/arch/arm64/boot/dts/qcom/sm8150.dtsi
index ef0232c2cf45..2f7ce1fdad55 100644
--- a/arch/arm64/boot/dts/qcom/sm8150.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm8150.dtsi
@@ -3549,6 +3549,34 @@ wifi: wifi@18800000 {
 			iommus = <&apps_smmu 0x0640 0x1>;
 			status = "disabled";
 		};
+
+		cryptobam: dma-controller@1dc4000 {
+			compatible = "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 0x504 0x0011>,
+				 <&apps_smmu 0x506 0x0011>,
+				 <&apps_smmu 0x514 0x0011>,
+				 <&apps_smmu 0x516 0x0011>;
+			interconnects = <&aggre2_noc MASTER_CRYPTO_CORE_0 &mc_virt SLAVE_EBI_CH0>;
+			interconnect-names = "memory";
+		};
+
+		crypto: crypto@1dfa000 {
+			compatible = "qcom,sm8150-qce";
+			reg = <0 0x01dfa000 0 0x6000>;
+			dmas = <&cryptobam 4>, <&cryptobam 5>;
+			dma-names = "rx", "tx";
+			iommus = <&apps_smmu 0x504 0x0011>,
+				 <&apps_smmu 0x506 0x0011>,
+				 <&apps_smmu 0x514 0x0011>,
+				 <&apps_smmu 0x516 0x0011>;
+			interconnects = <&aggre2_noc MASTER_CRYPTO_CORE_0 &mc_virt SLAVE_EBI_CH0>;
+			interconnect-names = "memory";
+		};
 	};
 
 	timer {
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] crypto: qce: Add 'sm8150-qce' compatible string check
  2021-10-13 16:58 ` [PATCH 1/2] crypto: qce: Add 'sm8150-qce' compatible string check Bhupesh Sharma
@ 2021-10-24 17:18   ` Bjorn Andersson
  2021-10-24 17:59     ` Bhupesh Sharma
  0 siblings, 1 reply; 6+ messages in thread
From: Bjorn Andersson @ 2021-10-24 17:18 UTC (permalink / raw)
  To: Bhupesh Sharma
  Cc: linux-arm-msm, linux-crypto, bhupesh.linux, linux-kernel,
	devicetree, robh+dt, agross, herbert, davem, Thara Gopinath

On Wed 13 Oct 11:58 CDT 2021, Bhupesh Sharma wrote:

> Add 'sm8150-qce' compatible string check in qce crypto
> driver as we add support for sm8150 crypto device in the
> device-tree in the subsequent patch.
> 
> Cc: Thara Gopinath <thara.gopinath@linaro.org>
> Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
> Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
> ---
>  drivers/crypto/qce/core.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/crypto/qce/core.c b/drivers/crypto/qce/core.c
> index 4c55eceb4e7f..ecbe9f7c6c0a 100644
> --- a/drivers/crypto/qce/core.c
> +++ b/drivers/crypto/qce/core.c
> @@ -306,6 +306,7 @@ static int qce_crypto_remove(struct platform_device *pdev)
>  static const struct of_device_id qce_crypto_of_match[] = {
>  	{ .compatible = "qcom,ipq6018-qce", },
>  	{ .compatible = "qcom,sdm845-qce", },
> +	{ .compatible = "qcom,sm8150-qce", },
>  	{ .compatible = "qcom,sm8250-qce", },

When I look at linux-next I see qce_crypto_of_match defined as:

static const struct of_device_id qce_crypto_of_match[] = {
	{ .compatible = "qcom,crypto-v5.1", },
	{ .compatible = "qcom,crypto-v5.4", },
	{}
};

Can you please help me understand what I'm doing wrong?

Thanks,
Bjorn

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] crypto: qce: Add 'sm8150-qce' compatible string check
  2021-10-24 17:18   ` Bjorn Andersson
@ 2021-10-24 17:59     ` Bhupesh Sharma
  2021-10-24 23:19       ` Bjorn Andersson
  0 siblings, 1 reply; 6+ messages in thread
From: Bhupesh Sharma @ 2021-10-24 17:59 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: MSM, linux-crypto, bhupesh.linux, Linux Kernel Mailing List,
	devicetree, Rob Herring, Andy Gross, Herbert Xu,
	David S . Miller, Thara Gopinath

Hi Bjorn,

On Sun, 24 Oct 2021 at 22:48, Bjorn Andersson
<bjorn.andersson@linaro.org> wrote:
>
> On Wed 13 Oct 11:58 CDT 2021, Bhupesh Sharma wrote:
>
> > Add 'sm8150-qce' compatible string check in qce crypto
> > driver as we add support for sm8150 crypto device in the
> > device-tree in the subsequent patch.
> >
> > Cc: Thara Gopinath <thara.gopinath@linaro.org>
> > Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
> > Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
> > ---
> >  drivers/crypto/qce/core.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/crypto/qce/core.c b/drivers/crypto/qce/core.c
> > index 4c55eceb4e7f..ecbe9f7c6c0a 100644
> > --- a/drivers/crypto/qce/core.c
> > +++ b/drivers/crypto/qce/core.c
> > @@ -306,6 +306,7 @@ static int qce_crypto_remove(struct platform_device *pdev)
> >  static const struct of_device_id qce_crypto_of_match[] = {
> >       { .compatible = "qcom,ipq6018-qce", },
> >       { .compatible = "qcom,sdm845-qce", },
> > +     { .compatible = "qcom,sm8150-qce", },
> >       { .compatible = "qcom,sm8250-qce", },
>
> When I look at linux-next I see qce_crypto_of_match defined as:
>
> static const struct of_device_id qce_crypto_of_match[] = {
>         { .compatible = "qcom,crypto-v5.1", },
>         { .compatible = "qcom,crypto-v5.4", },
>         {}
> };
>
> Can you please help me understand what I'm doing wrong?

Oh, you have missed [PATCH 15/20] from the sm8250 qce crypto addition
series (see [1])

This series is dependent on the sm8250 qce enablement series, as I
noted in the cover letter (see [2]).

However, Thara and Vladimir pointed out backward compatibility issues
with PATCH 15/20 of the first series. So I will send a v5 to fix the
same along with other issues pointed in the v4.

Sorry for any confusion caused.

[1]. https://lore.kernel.org/linux-arm-msm/20211013105541.68045-1-bhupesh.sharma@linaro.org/T/#m566546d32d8da7ee94822dfba625e98fd3496d17
[2]. https://www.spinics.net/lists/linux-arm-msm/msg96053.html

Regards,
Bhupesh

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] crypto: qce: Add 'sm8150-qce' compatible string check
  2021-10-24 17:59     ` Bhupesh Sharma
@ 2021-10-24 23:19       ` Bjorn Andersson
  0 siblings, 0 replies; 6+ messages in thread
From: Bjorn Andersson @ 2021-10-24 23:19 UTC (permalink / raw)
  To: Bhupesh Sharma
  Cc: MSM, linux-crypto, bhupesh.linux, Linux Kernel Mailing List,
	devicetree, Rob Herring, Andy Gross, Herbert Xu,
	David S . Miller, Thara Gopinath

On Sun 24 Oct 12:59 CDT 2021, Bhupesh Sharma wrote:

> Hi Bjorn,
> 
> On Sun, 24 Oct 2021 at 22:48, Bjorn Andersson
> <bjorn.andersson@linaro.org> wrote:
> >
> > On Wed 13 Oct 11:58 CDT 2021, Bhupesh Sharma wrote:
> >
> > > Add 'sm8150-qce' compatible string check in qce crypto
> > > driver as we add support for sm8150 crypto device in the
> > > device-tree in the subsequent patch.
> > >
> > > Cc: Thara Gopinath <thara.gopinath@linaro.org>
> > > Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
> > > Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
> > > ---
> > >  drivers/crypto/qce/core.c | 1 +
> > >  1 file changed, 1 insertion(+)
> > >
> > > diff --git a/drivers/crypto/qce/core.c b/drivers/crypto/qce/core.c
> > > index 4c55eceb4e7f..ecbe9f7c6c0a 100644
> > > --- a/drivers/crypto/qce/core.c
> > > +++ b/drivers/crypto/qce/core.c
> > > @@ -306,6 +306,7 @@ static int qce_crypto_remove(struct platform_device *pdev)
> > >  static const struct of_device_id qce_crypto_of_match[] = {
> > >       { .compatible = "qcom,ipq6018-qce", },
> > >       { .compatible = "qcom,sdm845-qce", },
> > > +     { .compatible = "qcom,sm8150-qce", },
> > >       { .compatible = "qcom,sm8250-qce", },
> >
> > When I look at linux-next I see qce_crypto_of_match defined as:
> >
> > static const struct of_device_id qce_crypto_of_match[] = {
> >         { .compatible = "qcom,crypto-v5.1", },
> >         { .compatible = "qcom,crypto-v5.4", },
> >         {}
> > };
> >
> > Can you please help me understand what I'm doing wrong?
> 
> Oh, you have missed [PATCH 15/20] from the sm8250 qce crypto addition
> series (see [1])
> 
> This series is dependent on the sm8250 qce enablement series, as I
> noted in the cover letter (see [2]).
> 

Ah, now I see. Thanks for the pointer!

> However, Thara and Vladimir pointed out backward compatibility issues
> with PATCH 15/20 of the first series. So I will send a v5 to fix the
> same along with other issues pointed in the v4.
> 
> Sorry for any confusion caused.
> 

No worries. Could you include these two patches in v5 of the other
series, to clarify the dependency?

Thanks,
Bjorn

> [1]. https://lore.kernel.org/linux-arm-msm/20211013105541.68045-1-bhupesh.sharma@linaro.org/T/#m566546d32d8da7ee94822dfba625e98fd3496d17
> [2]. https://www.spinics.net/lists/linux-arm-msm/msg96053.html
> 
> Regards,
> Bhupesh

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-10-24 23:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-13 16:58 [PATCH 0/2] Enable Qualcomm Crypto Engine on sm8150 Bhupesh Sharma
2021-10-13 16:58 ` [PATCH 1/2] crypto: qce: Add 'sm8150-qce' compatible string check Bhupesh Sharma
2021-10-24 17:18   ` Bjorn Andersson
2021-10-24 17:59     ` Bhupesh Sharma
2021-10-24 23:19       ` Bjorn Andersson
2021-10-13 16:58 ` [PATCH 2/2] arm64/dts: qcom: sm8150: Add dt entries to support crypto engine Bhupesh Sharma

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).