From: Bartosz Golaszewski <brgl@bgdev.pl>
To: Thara Gopinath <thara.gopinath@gmail.com>,
Herbert Xu <herbert@gondor.apana.org.au>,
"David S. Miller" <davem@davemloft.net>,
Vinod Koul <vkoul@kernel.org>, Jonathan Corbet <corbet@lwn.net>,
Md Sadre Alam <quic_mdalam@quicinc.com>,
Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: linux-crypto@vger.kernel.org, linux-arm-msm@vger.kernel.org,
linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org,
linux-doc@vger.kernel.org,
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Subject: [PATCH v7 3/8] dmaengine: qcom: bam_dma: add bam_pipe_lock flag support
Date: Tue, 11 Mar 2025 10:25:34 +0100 [thread overview]
Message-ID: <20250311-qce-cmd-descr-v7-3-db613f5d9c9f@linaro.org> (raw)
In-Reply-To: <20250311-qce-cmd-descr-v7-0-db613f5d9c9f@linaro.org>
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Extend the device match data with a flag indicating whether the IP
supports the BAM lock/unlock feature. Set it to true on BAM IP versions
1.4.0 and above.
Co-developed-by: Md Sadre Alam <quic_mdalam@quicinc.com>
Signed-off-by: Md Sadre Alam <quic_mdalam@quicinc.com>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
drivers/dma/qcom/bam_dma.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/drivers/dma/qcom/bam_dma.c b/drivers/dma/qcom/bam_dma.c
index 8861245314b1..737fce396c2e 100644
--- a/drivers/dma/qcom/bam_dma.c
+++ b/drivers/dma/qcom/bam_dma.c
@@ -58,6 +58,8 @@ struct bam_desc_hw {
#define DESC_FLAG_EOB BIT(13)
#define DESC_FLAG_NWD BIT(12)
#define DESC_FLAG_CMD BIT(11)
+#define DESC_FLAG_LOCK BIT(10)
+#define DESC_FLAG_UNLOCK BIT(9)
struct bam_async_desc {
struct virt_dma_desc vd;
@@ -113,6 +115,7 @@ struct reg_offset_data {
struct bam_device_data {
const struct reg_offset_data *reg_info;
+ bool bam_pipe_lock;
};
static const struct reg_offset_data bam_v1_3_reg_info[] = {
@@ -179,6 +182,7 @@ static const struct reg_offset_data bam_v1_4_reg_info[] = {
static const struct bam_device_data bam_v1_4_data = {
.reg_info = bam_v1_4_reg_info,
+ .bam_pipe_lock = true,
};
static const struct reg_offset_data bam_v1_7_reg_info[] = {
@@ -212,6 +216,7 @@ static const struct reg_offset_data bam_v1_7_reg_info[] = {
static const struct bam_device_data bam_v1_7_data = {
.reg_info = bam_v1_7_reg_info,
+ .bam_pipe_lock = true,
};
/* BAM CTRL */
@@ -707,8 +712,15 @@ static struct dma_async_tx_descriptor *bam_prep_slave_sg(struct dma_chan *chan,
unsigned int curr_offset = 0;
do {
- if (flags & DMA_PREP_CMD)
+ if (flags & DMA_PREP_CMD) {
desc->flags |= cpu_to_le16(DESC_FLAG_CMD);
+ if (bdev->dev_data->bam_pipe_lock) {
+ if (flags & DMA_PREP_LOCK)
+ desc->flags |= cpu_to_le16(DESC_FLAG_LOCK);
+ else if (flags & DMA_PREP_UNLOCK)
+ desc->flags |= cpu_to_le16(DESC_FLAG_UNLOCK);
+ }
+ }
desc->addr = cpu_to_le32(sg_dma_address(sg) +
curr_offset);
--
2.45.2
next prev parent reply other threads:[~2025-03-11 9:25 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-11 9:25 [PATCH v7 0/8] dmaengine: qcom: bam_dma: add command descriptor support Bartosz Golaszewski
2025-03-11 9:25 ` [PATCH v7 1/8] dmaengine: add DMA_PREP_LOCK and DMA_PREP_UNLOCK flag Bartosz Golaszewski
2025-03-11 15:59 ` Dmitry Baryshkov
2025-03-30 16:20 ` Vinod Koul
2025-03-11 9:25 ` [PATCH v7 2/8] dmaengine: qcom: bam_dma: extend the driver's device match data Bartosz Golaszewski
2025-03-11 16:00 ` Dmitry Baryshkov
2025-03-11 9:25 ` Bartosz Golaszewski [this message]
2025-03-11 16:02 ` [PATCH v7 3/8] dmaengine: qcom: bam_dma: add bam_pipe_lock flag support Dmitry Baryshkov
2025-03-30 16:22 ` Vinod Koul
2025-03-11 9:25 ` [PATCH v7 4/8] crypto: qce - use devres to allocate the result buffer Bartosz Golaszewski
2025-03-11 9:25 ` [PATCH v7 5/8] crypto: qce - Map crypto memory for DMA Bartosz Golaszewski
2025-03-11 9:25 ` [PATCH v7 6/8] crypto: qce - Add BAM DMA support for crypto register I/O Bartosz Golaszewski
2025-03-11 9:25 ` [PATCH v7 7/8] crypto: qce - Switch to using DMA Bartosz Golaszewski
2025-03-11 9:25 ` [PATCH v7 8/8] crypto: qce - Add support for BAM locking Bartosz Golaszewski
2025-03-21 9:06 ` [PATCH v7 0/8] dmaengine: qcom: bam_dma: add command descriptor support 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=20250311-qce-cmd-descr-v7-3-db613f5d9c9f@linaro.org \
--to=brgl@bgdev.pl \
--cc=bartosz.golaszewski@linaro.org \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=dmaengine@vger.kernel.org \
--cc=herbert@gondor.apana.org.au \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=quic_mdalam@quicinc.com \
--cc=srinivas.kandagatla@linaro.org \
--cc=thara.gopinath@gmail.com \
--cc=vkoul@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 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).