Message ID | 20201117134714.3456446-1-thara.gopinath@linaro.org |
---|---|
Headers | show |
Series | Enable Qualcomm Crypto Engine on sdm845 | expand |
On Tue, Nov 17, 2020 at 08:47:08AM -0500, Thara Gopinath wrote: > Qualcomm crypto engine supports hardware accelerated algorithms for > encryption and authentication. Enable support for aes,des,3des encryption > algorithms and sha1,sha256, hmac(sha1),hmac(sha256) authentication > algorithms on sdm845.The patch series has been tested using the kernel > crypto testing module tcrypto.ko. Did you do this testing with CONFIG_CRYPTO_MANAGER_EXTRA_TESTS enabled? Do all tests pass with it enabled? - Eric
On 11/17/20 11:57 AM, Eric Biggers wrote: > On Tue, Nov 17, 2020 at 08:47:08AM -0500, Thara Gopinath wrote: >> Qualcomm crypto engine supports hardware accelerated algorithms for >> encryption and authentication. Enable support for aes,des,3des encryption >> algorithms and sha1,sha256, hmac(sha1),hmac(sha256) authentication >> algorithms on sdm845.The patch series has been tested using the kernel >> crypto testing module tcrypto.ko. > > Did you do this testing with CONFIG_CRYPTO_MANAGER_EXTRA_TESTS enabled? > Do all tests pass with it enabled? No I have not. This is in my todo list though. I am trying to enable AEAD algorithms on the crypto engine right now. I will try to test it out with that set. > > - Eric >
On Tue 17 Nov 07:47 CST 2020, Thara Gopinath wrote: > Qualcomm CE clock resource that is managed by BCM is required > by crypto driver to access the core clock. > ' ' after ':' in $subject With that Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Regards, bjorn > Signed-off-by: Thara Gopinath <thara.gopinath@linaro.org> > --- > drivers/clk/qcom/clk-rpmh.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/clk/qcom/clk-rpmh.c b/drivers/clk/qcom/clk-rpmh.c > index e2c669b08aff..7e2a4a9b9bf6 100644 > --- a/drivers/clk/qcom/clk-rpmh.c > +++ b/drivers/clk/qcom/clk-rpmh.c > @@ -349,6 +349,7 @@ DEFINE_CLK_RPMH_VRM(sdm845, rf_clk2, rf_clk2_ao, "rfclka2", 1); > DEFINE_CLK_RPMH_VRM(sdm845, rf_clk3, rf_clk3_ao, "rfclka3", 1); > DEFINE_CLK_RPMH_VRM(sm8150, rf_clk3, rf_clk3_ao, "rfclka3", 1); > DEFINE_CLK_RPMH_BCM(sdm845, ipa, "IP0"); > +DEFINE_CLK_RPMH_BCM(sdm845, ce, "CE0"); > > static struct clk_hw *sdm845_rpmh_clocks[] = { > [RPMH_CXO_CLK] = &sdm845_bi_tcxo.hw, > @@ -364,6 +365,7 @@ static struct clk_hw *sdm845_rpmh_clocks[] = { > [RPMH_RF_CLK3] = &sdm845_rf_clk3.hw, > [RPMH_RF_CLK3_A] = &sdm845_rf_clk3_ao.hw, > [RPMH_IPA_CLK] = &sdm845_ipa.hw, > + [RPMH_CE_CLK] = &sdm845_ce.hw, > }; > > static const struct clk_rpmh_desc clk_rpmh_sdm845 = { > -- > 2.25.1 >
On Tue 17 Nov 07:47 CST 2020, Thara Gopinath wrote: > Add compatible string to support v5.4 crypto engine. > > Signed-off-by: Thara Gopinath <thara.gopinath@linaro.org> $subject should be "dt-bindings: crypto: ..." and you should try to stay within 50 chars for the subject. So how about something like: "dt-bindings: crypto: qcom-qce: Add v5.4 to binding" With something like that: Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Regards, Bjorn > --- > Documentation/devicetree/bindings/crypto/qcom-qce.txt | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/Documentation/devicetree/bindings/crypto/qcom-qce.txt b/Documentation/devicetree/bindings/crypto/qcom-qce.txt > index fdd53b184ba8..ed1ede9c0acc 100644 > --- a/Documentation/devicetree/bindings/crypto/qcom-qce.txt > +++ b/Documentation/devicetree/bindings/crypto/qcom-qce.txt > @@ -2,7 +2,9 @@ Qualcomm crypto engine driver > > Required properties: > > -- compatible : should be "qcom,crypto-v5.1" > +- compatible : should be > + "qcom,crypto-v5.1" for ipq6018 > + "qcom,crypto-v5.4" for sdm845 > - reg : specifies base physical address and size of the registers map > - clocks : phandle to clock-controller plus clock-specifier pair > - clock-names : "iface" clocks register interface > -- > 2.25.1 >
On Tue 17 Nov 07:47 CST 2020, Thara Gopinath wrote: > Add crypto engine (CE) and CE BAM related nodes and definitions to > "sdm845.dtsi". > > Signed-off-by: Thara Gopinath <thara.gopinath@linaro.org> > --- > arch/arm64/boot/dts/qcom/sdm845.dtsi | 30 ++++++++++++++++++++++++++++ > 1 file changed, 30 insertions(+) > > diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi > index 40e8c11f23ab..b5b2ea97681f 100644 > --- a/arch/arm64/boot/dts/qcom/sdm845.dtsi > +++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi > @@ -2138,6 +2138,36 @@ ufs_mem_phy_lanes: lanes@1d87400 { > }; > }; > > + cryptobam: dma@1dc4000 { > + compatible = "qcom,bam-v1.7.0"; > + reg = <0 0x01dc4000 0 0x24000>; > + interrupts = <GIC_SPI 272 IRQ_TYPE_LEVEL_HIGH>; > + clocks = <&rpmhcc RPMH_CE_CLK>; > + clock-names = "bam_clk"; > + #dma-cells = <1>; > + qcom,ee = <0>; > + qcom,controlled-remotely = <1>; > + iommus = <&apps_smmu 0x704 0x1>, > + <&apps_smmu 0x706 0x1>, > + <&apps_smmu 0x714 0x1>, > + <&apps_smmu 0x716 0x1>; Can you confirm that this can't be written as: iommus = <&apps_smmu 0x704 0x3>, <&apps_smmu 0x714 0x3>; (and same below). Regards, Bjorn > + }; > + > + crypto: crypto@1dfa000 { > + compatible = "qcom,crypto-v5.4"; > + reg = <0 0x01dfa000 0 0x6000>; > + clocks = <&gcc GCC_CE1_AHB_CLK>, > + <&gcc GCC_CE1_AHB_CLK>, > + <&rpmhcc RPMH_CE_CLK>; > + clock-names = "iface", "bus", "core"; > + dmas = <&cryptobam 6>, <&cryptobam 7>; > + dma-names = "rx", "tx"; > + iommus = <&apps_smmu 0x704 0x1>, > + <&apps_smmu 0x706 0x1>, > + <&apps_smmu 0x714 0x1>, > + <&apps_smmu 0x716 0x1>; > + }; > + > ipa: ipa@1e40000 { > compatible = "qcom,sdm845-ipa"; > > -- > 2.25.1 >