From: "J. German Rivera" <German.Rivera@freescale.com>
To: <gregkh@linuxfoundation.org>, <arnd@arndb.de>,
<devel@driverdev.osuosl.org>, <linux-kernel@vger.kernel.org>
Cc: <stuart.yoder@freescale.com>, <itai.katz@freescale.com>,
<leoli@freescale.com>, <scottwood@freescale.com>, <agraf@suse.de>,
<bhamciu1@freescale.com>, <R89243@freescale.com>,
<bhupesh.sharma@freescale.com>, <nir.erez@freescale.com>,
<richard.schmitt@freescale.com>, <dan.carpenter@oracle.com>,
"J. German Rivera" <German.Rivera@freescale.com>
Subject: [PATCH v2 1/6] staging: fsl-mc: Add new flags field to MC command header
Date: Tue, 22 Sep 2015 18:08:54 -0500 [thread overview]
Message-ID: <1442963339-32084-2-git-send-email-German.Rivera@freescale.com> (raw)
In-Reply-To: <1442963339-32084-1-git-send-email-German.Rivera@freescale.com>
The Management Complex (MC) binary interface added a new "flags"
field to the command header.
Add the definitions for this field in preparation for adding the
new cmd_flags parameter to all MC interface APIs.
Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
---
drivers/staging/fsl-mc/include/mc-cmd.h | 30 ++++++++++++++++++++++++------
1 file changed, 24 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/fsl-mc/include/mc-cmd.h b/drivers/staging/fsl-mc/include/mc-cmd.h
index 32501e0..af7de6e 100644
--- a/drivers/staging/fsl-mc/include/mc-cmd.h
+++ b/drivers/staging/fsl-mc/include/mc-cmd.h
@@ -67,14 +67,31 @@ enum mc_cmd_status {
MC_CMD_STATUS_INVALID_STATE = 0xC /* Invalid state */
};
+/*
+ * MC command flags
+ */
+
+/* High priority flag */
+#define MC_CMD_FLAG_PRI 0x00008000
+/* Command completion flag */
+#define MC_CMD_FLAG_INTR_DIS 0x01000000
+
+/*
+ * TODO Remove following two defines after completion of flib 8.0.0
+ * integration
+ */
+#define MC_CMD_PRI_LOW 0 /*!< Low Priority command indication */
+#define MC_CMD_PRI_HIGH 1 /*!< High Priority command indication */
+
#define MC_CMD_HDR_CMDID_O 52 /* Command ID field offset */
#define MC_CMD_HDR_CMDID_S 12 /* Command ID field size */
#define MC_CMD_HDR_TOKEN_O 38 /* Token field offset */
#define MC_CMD_HDR_TOKEN_S 10 /* Token field size */
#define MC_CMD_HDR_STATUS_O 16 /* Status field offset */
#define MC_CMD_HDR_STATUS_S 8 /* Status field size*/
-#define MC_CMD_HDR_PRI_O 15 /* Priority field offset */
-#define MC_CMD_HDR_PRI_S 1 /* Priority field size */
+#define MC_CMD_HDR_FLAGS_O 0 /* Flags field offset */
+#define MC_CMD_HDR_FLAGS_S 32 /* Flags field size*/
+#define MC_CMD_HDR_FLAGS_MASK 0xFF00FF00 /* Command flags mask */
#define MC_CMD_HDR_READ_STATUS(_hdr) \
((enum mc_cmd_status)mc_dec((_hdr), \
@@ -83,8 +100,8 @@ enum mc_cmd_status {
#define MC_CMD_HDR_READ_TOKEN(_hdr) \
((uint16_t)mc_dec((_hdr), MC_CMD_HDR_TOKEN_O, MC_CMD_HDR_TOKEN_S))
-#define MC_CMD_PRI_LOW 0 /* Low Priority command indication */
-#define MC_CMD_PRI_HIGH 1 /* High Priority command indication */
+#define MC_CMD_HDR_READ_FLAGS(_hdr) \
+ ((uint32_t)mc_dec((_hdr), MC_CMD_HDR_FLAGS_O, MC_CMD_HDR_FLAGS_S))
#define MC_EXT_OP(_ext, _param, _offset, _width, _type, _arg) \
((_ext)[_param] |= mc_enc((_offset), (_width), _arg))
@@ -96,14 +113,15 @@ enum mc_cmd_status {
(_arg = (_type)mc_dec(_cmd.params[_param], (_offset), (_width)))
static inline uint64_t mc_encode_cmd_header(uint16_t cmd_id,
- uint8_t priority,
+ uint32_t cmd_flags,
uint16_t token)
{
uint64_t hdr;
hdr = mc_enc(MC_CMD_HDR_CMDID_O, MC_CMD_HDR_CMDID_S, cmd_id);
+ hdr |= mc_enc(MC_CMD_HDR_FLAGS_O, MC_CMD_HDR_FLAGS_S,
+ (cmd_flags & MC_CMD_HDR_FLAGS_MASK));
hdr |= mc_enc(MC_CMD_HDR_TOKEN_O, MC_CMD_HDR_TOKEN_S, token);
- hdr |= mc_enc(MC_CMD_HDR_PRI_O, MC_CMD_HDR_PRI_S, priority);
hdr |= mc_enc(MC_CMD_HDR_STATUS_O, MC_CMD_HDR_STATUS_S,
MC_CMD_STATUS_READY);
--
2.3.3
next prev parent reply other threads:[~2015-09-22 23:23 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-22 23:08 [PATCH v2 0/6] staging: fsl-mc: up-rev version of MC interface code J. German Rivera
2015-09-22 23:08 ` J. German Rivera [this message]
2015-09-22 23:08 ` [PATCH v2 2/6] staging: fsl-mc: uprev dpmng binary interface to v8.0 J. German Rivera
2015-09-22 23:08 ` [PATCH v2 3/6] staging: fsl-mc: up-rev dpbp binary interface to v2.0 J. German Rivera
2015-09-23 3:08 ` Greg KH
2015-09-22 23:08 ` [PATCH v2 4/6] staging: fsl-mc: up-rev dpmcp " J. German Rivera
2015-09-22 23:08 ` [PATCH v2 5/6] staging: fsl-mc: up-rev dpcon " J. German Rivera
2015-09-22 23:08 ` [PATCH v2 6/6] staging: fsl-mc: up-rev dprc binary interface to v4.0 J. German Rivera
2015-09-23 9:26 ` Dan Carpenter
2015-09-24 18:39 ` Jose Rivera
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=1442963339-32084-2-git-send-email-German.Rivera@freescale.com \
--to=german.rivera@freescale.com \
--cc=R89243@freescale.com \
--cc=agraf@suse.de \
--cc=arnd@arndb.de \
--cc=bhamciu1@freescale.com \
--cc=bhupesh.sharma@freescale.com \
--cc=dan.carpenter@oracle.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=itai.katz@freescale.com \
--cc=leoli@freescale.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nir.erez@freescale.com \
--cc=richard.schmitt@freescale.com \
--cc=scottwood@freescale.com \
--cc=stuart.yoder@freescale.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
all inboxes | Powered by JetHome®