All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thara Gopinath <thara.gopinath@linaro.org>
To: agross@kernel.org, bjorn.andersson@linaro.org,
	herbert@gondor.apana.org.au, davem@davemloft.net,
	robh+dt@kernel.org, sboyd@kernel.org, mturquette@baylibre.com
Cc: linux-arm-msm@vger.kernel.org, linux-crypto@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-clk@vger.kernel.org
Subject: [Patch v2 3/6] drivers: crypto: qce: Enable support for crypto engine on sdm845.
Date: Thu, 19 Nov 2020 10:52:30 -0500	[thread overview]
Message-ID: <20201119155233.3974286-4-thara.gopinath@linaro.org> (raw)
In-Reply-To: <20201119155233.3974286-1-thara.gopinath@linaro.org>

Add support Qualcomm Crypto Engine accelerated encryption and
authentication algorithms on sdm845.

Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Thara Gopinath <thara.gopinath@linaro.org>
---
 drivers/crypto/qce/core.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/drivers/crypto/qce/core.c b/drivers/crypto/qce/core.c
index ea616b7259ae..67c3ca13e55b 100644
--- a/drivers/crypto/qce/core.c
+++ b/drivers/crypto/qce/core.c
@@ -160,7 +160,21 @@ static int qce_check_version(struct qce_device *qce)
 		return -ENODEV;
 
 	qce->burst_size = QCE_BAM_BURST_SIZE;
-	qce->pipe_pair_id = 1;
+
+	/*
+	 * Rx and tx pipes are treated as a pair inside CE.
+	 * Pipe pair number depends on the actual BAM dma pipe
+	 * that is used for transfers. The BAM dma pipes are passed
+	 * from the device tree and used to derive the pipe pair
+	 * id in the CE driver as follows.
+	 * 	BAM dma pipes(rx, tx)		CE pipe pair id
+	 *		0,1				0
+	 *		2,3				1
+	 *		4,5				2
+	 *		6,7				3
+	 *		...
+	 */
+	qce->pipe_pair_id = qce->dma.rxchan->chan_id >> 1;
 
 	dev_dbg(qce->dev, "Crypto device found, version %d.%d.%d\n",
 		major, minor, step);
@@ -261,6 +275,7 @@ static int qce_crypto_remove(struct platform_device *pdev)
 
 static const struct of_device_id qce_crypto_of_match[] = {
 	{ .compatible = "qcom,crypto-v5.1", },
+	{ .compatible = "qcom,crypto-v5.4", },
 	{}
 };
 MODULE_DEVICE_TABLE(of, qce_crypto_of_match);
-- 
2.25.1


  parent reply	other threads:[~2020-11-19 15:52 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-19 15:52 [Patch v2 0/6] Enable Qualcomm Crypto Engine on sdm845 Thara Gopinath
2020-11-19 15:52 ` [Patch v2 1/6] dt-bindings: clock: Add entry for crypto engine RPMH clock resource Thara Gopinath
2020-11-25  2:05   ` Stephen Boyd
2020-11-19 15:52 ` [Patch v2 2/6] clk: qcom: rpmh: Add CE clock on sdm845 Thara Gopinath
2020-11-25  2:05   ` Stephen Boyd
2020-11-19 15:52 ` Thara Gopinath [this message]
2020-11-19 15:52 ` [Patch v2 4/6] drivers: crypto: qce: Fix SHA result buffer corruption issues Thara Gopinath
2020-11-25  2:05   ` Stephen Boyd
2020-11-19 15:52 ` [Patch v2 5/6] dts: qcom: sdm845: Add dt entries to support crypto engine Thara Gopinath
2020-11-19 15:52 ` [Patch v2 6/6] dt-bindings: crypto: qcom-qce: Add v5.4 to binding Thara Gopinath
2020-12-07 22:09   ` Rob Herring
2020-12-12 15:25     ` Thara Gopinath
2020-11-19 22:44 ` [Patch v2 0/6] Enable Qualcomm Crypto Engine on sdm845 Eric Biggers
2020-11-24  2:42   ` Thara Gopinath
2020-11-27  6:25 ` Herbert Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201119155233.3974286-4-thara.gopinath@linaro.org \
    --to=thara.gopinath@linaro.org \
    --cc=agross@kernel.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=robh+dt@kernel.org \
    --cc=sboyd@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.