From: Abhishek Sahu <absahu@codeaurora.org>
To: vinod.koul@intel.com, dan.j.williams@intel.com, andy.gross@linaro.org
Cc: stanimir.varbanov@linaro.org, mcgrof@suse.com,
okaya@codeaurora.org, pramod.gurav@linaro.org, arnd@arndb.de,
linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org,
linux-arm-msm@vger.kernel.org,
Abhishek Sahu <absahu@codeaurora.org>
Subject: [PATCH 5/5] dmaengine: qca: bam_dma: implement command descriptor
Date: Thu, 15 Dec 2016 15:25:55 +0530 [thread overview]
Message-ID: <1481795755-15302-6-git-send-email-absahu@codeaurora.org> (raw)
In-Reply-To: <1481795755-15302-1-git-send-email-absahu@codeaurora.org>
QCA BAM also support command descriptor which allows the SW to
create descriptors of type command which does not generate any
data transmissions but configures registers in the peripheral.
In command descriptor the 32bit address point to the start of
the command block which holds the command elements and the
16bit size define the size of the command block.
Each Command Element is structured by 4 words:
Write command: address + cmd
register data
register mask
reserved
Read command: address + cmd
read data result address,
reserved
reserved
Signed-off-by: Abhishek Sahu <absahu@codeaurora.org>
---
include/linux/dma/qcom_bam_dma.h | 46 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 46 insertions(+)
diff --git a/include/linux/dma/qcom_bam_dma.h b/include/linux/dma/qcom_bam_dma.h
index 46344cf..7e317d7 100644
--- a/include/linux/dma/qcom_bam_dma.h
+++ b/include/linux/dma/qcom_bam_dma.h
@@ -23,6 +23,7 @@
#define DESC_FLAG_EOT BIT(14)
#define DESC_FLAG_EOB BIT(13)
#define DESC_FLAG_NWD BIT(12)
+#define DESC_FLAG_CMD BIT(11)
/*
* QCOM BAM DMA SGL struct
@@ -49,6 +50,34 @@ struct qcom_bam_custom_data {
};
/*
+ * This data type corresponds to the native Command Element
+ * supported by BAM DMA Engine.
+ *
+ * @addr - register address.
+ * @command - command type.
+ * @data - for write command: content to be written into peripheral register.
+ * for read command: dest addr to write peripheral register value to.
+ * @mask - register mask.
+ * @reserved - for future usage.
+ *
+ */
+struct bam_cmd_element {
+ __le32 addr:24;
+ __le32 command:8;
+ __le32 data;
+ __le32 mask;
+ __le32 reserved;
+};
+
+/*
+ * This enum indicates the command type in a command element
+ */
+enum bam_command_type {
+ BAM_WRITE_COMMAND = 0,
+ BAM_READ_COMMAND,
+};
+
+/*
* qcom_bam_sg_init_table - Init QCOM BAM SGL
* @bam_sgl: bam sgl
* @nents: number of entries in bam sgl
@@ -113,4 +142,21 @@ static inline int qcom_bam_map_sg(struct device *dev,
return ret;
}
+
+/*
+ * qcom_prep_bam_ce - Wrapper function to prepare a single BAM command element
+ * with the data that is passed to this function.
+ * @bam_ce: bam command element
+ * @addr: target address
+ * @command: command in bam_command_type
+ * @data: actual data for write and dest addr for read
+ */
+static inline void qcom_prep_bam_ce(struct bam_cmd_element *bam_ce,
+ uint32_t addr, uint32_t command, uint32_t data)
+{
+ bam_ce->addr = cpu_to_le32(addr);
+ bam_ce->command = cpu_to_le32(command);
+ bam_ce->data = cpu_to_le32(data);
+ bam_ce->mask = 0xFFFFFFFF;
+}
#endif
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
prev parent reply other threads:[~2016-12-15 9:55 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-15 9:55 [PATCH 0/5] Support for QCA BAM DMA command descriptor Abhishek Sahu
2016-12-15 9:55 ` [PATCH 1/5] dmaengine: qca: bam_dma: Add header file for bam driver Abhishek Sahu
2016-12-15 9:55 ` [PATCH 2/5] dmaengine: Add support for custom data mapping Abhishek Sahu
2016-12-18 16:26 ` Vinod Koul
2016-12-19 5:06 ` Andy Gross
2016-12-19 15:49 ` Vinod Koul
2016-12-19 17:52 ` Andy Gross
2016-12-20 19:28 ` Abhishek Sahu
2016-12-20 20:25 ` Andy Gross
2016-12-21 19:34 ` Abhishek Sahu
2016-12-29 17:54 ` Andy Gross
2017-01-02 14:25 ` Abhishek Sahu
2017-01-02 16:12 ` Andy Gross
2017-01-19 5:01 ` Vinod Koul
2017-01-19 14:13 ` Andy Gross
2017-01-19 14:57 ` Abhishek Sahu
2017-01-20 16:56 ` Vinod Koul
2017-04-07 13:58 ` Abhishek Sahu
2016-12-15 9:55 ` [PATCH 3/5] dmaengine: qca: bam_dma: Add support for bam sgl Abhishek Sahu
2016-12-15 9:55 ` [PATCH 4/5] dmaengine: qca: bam_dma: implement custom data mapping Abhishek Sahu
2016-12-15 9:55 ` Abhishek Sahu [this message]
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=1481795755-15302-6-git-send-email-absahu@codeaurora.org \
--to=absahu@codeaurora.org \
--cc=andy.gross@linaro.org \
--cc=arnd@arndb.de \
--cc=dan.j.williams@intel.com \
--cc=dmaengine@vger.kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mcgrof@suse.com \
--cc=okaya@codeaurora.org \
--cc=pramod.gurav@linaro.org \
--cc=stanimir.varbanov@linaro.org \
--cc=vinod.koul@intel.com \
/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).