From: srinivas.kandagatla@linaro.org
To: gregkh@linuxfoundation.org, broonie@kernel.org,
alsa-devel@alsa-project.org
Cc: sdharia@codeaurora.org, bp@suse.de, poeschel@lemonage.de,
treding@nvidia.com, andreas.noever@gmail.com,
alan@linux.intel.com, mathieu.poirier@linaro.org,
daniel@ffwll.ch, jkosina@suse.cz, sharon.dvir1@mail.huji.ac.il,
joe@perches.com, davem@davemloft.net, james.hogan@imgtec.com,
michael.opdenacker@free-electrons.com, robh+dt@kernel.org,
pawel.moll@arm.com, mark.rutland@arm.com,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-msm@vger.kernel.org, vinod.koul@intel.com,
arnd@arndb.de, srinivas.kandagatla@linaro.org
Subject: [PATCH v8 09/13] slimbus: core: add common defines required for controllers
Date: Thu, 30 Nov 2017 17:41:56 +0000 [thread overview]
Message-ID: <20171130174200.6684-10-srinivas.kandagatla@linaro.org> (raw)
In-Reply-To: <20171130174200.6684-1-srinivas.kandagatla@linaro.org>
From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
This patch adds some common constant defines which are required
for qcom slim controller driver.
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
drivers/slimbus/slimbus.h | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)
diff --git a/drivers/slimbus/slimbus.h b/drivers/slimbus/slimbus.h
index e0ae7bb1ba47..d278c951ddbf 100644
--- a/drivers/slimbus/slimbus.h
+++ b/drivers/slimbus/slimbus.h
@@ -18,9 +18,38 @@
#include <linux/completion.h>
#include <linux/slimbus.h>
+/* Standard values per SLIMbus spec needed by controllers and devices */
+#define SLIM_CL_PER_SUPERFRAME 6144
+#define SLIM_CL_PER_SUPERFRAME_DIV8 (SLIM_CL_PER_SUPERFRAME >> 3)
+
/* SLIMbus message types. Related to interpretation of message code. */
#define SLIM_MSG_MT_CORE 0x0
+/*
+ * SLIM Broadcast header format
+ * BYTE 0: MT[7:5] RL[4:0]
+ * BYTE 1: RSVD[7] MC[6:0]
+ * BYTE 2: RSVD[7:6] DT[5:4] PI[3:0]
+ */
+#define SLIM_MSG_MT_MASK GENMASK(2, 0)
+#define SLIM_MSG_MT_SHIFT 5
+#define SLIM_MSG_RL_MASK GENMASK(4, 0)
+#define SLIM_MSG_RL_SHIFT 0
+#define SLIM_MSG_MC_MASK GENMASK(6, 0)
+#define SLIM_MSG_MC_SHIFT 0
+#define SLIM_MSG_DT_MASK GENMASK(1, 0)
+#define SLIM_MSG_DT_SHIFT 4
+
+#define SLIM_HEADER_GET_MT(b) ((b >> SLIM_MSG_MT_SHIFT) & SLIM_MSG_MT_MASK)
+#define SLIM_HEADER_GET_RL(b) ((b >> SLIM_MSG_RL_SHIFT) & SLIM_MSG_RL_MASK)
+#define SLIM_HEADER_GET_MC(b) ((b >> SLIM_MSG_MC_SHIFT) & SLIM_MSG_MC_MASK)
+#define SLIM_HEADER_GET_DT(b) ((b >> SLIM_MSG_DT_SHIFT) & SLIM_MSG_DT_MASK)
+
+/* Device management messages used by this framework */
+#define SLIM_MSG_MC_REPORT_PRESENT 0x1
+#define SLIM_MSG_MC_ASSIGN_LOGICAL_ADDRESS 0x2
+#define SLIM_MSG_MC_REPORT_ABSENT 0xF
+
/* Clock pause Reconfiguration messages */
#define SLIM_MSG_MC_BEGIN_RECONFIGURATION 0x40
#define SLIM_MSG_MC_NEXT_PAUSE_CLOCK 0x4A
@@ -101,6 +130,10 @@ struct slim_msg_txn {
#define DEFINE_SLIM_BCAST_TXN(name, mc, rl, la, msg) \
struct slim_msg_txn name = { rl, 0, mc, SLIM_MSG_DEST_BROADCAST, 0,\
0, la, msg, }
+
+#define DEFINE_SLIM_EDEST_TXN(name, mc, rl, la, msg) \
+ struct slim_msg_txn name = { rl, 0, mc, SLIM_MSG_DEST_ENUMADDR, 0,\
+ 0, la, msg, }
/**
* enum slim_clk_state: SLIMbus controller's clock state used internally for
* maintaining current clock state.
--
2.15.0
next prev parent reply other threads:[~2017-11-30 17:41 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-30 17:41 [PATCH v8 00/13] Introduce framework for SLIMbus device driver srinivas.kandagatla
2017-11-30 17:41 ` [PATCH v8 01/13] Documentation: Add SLIMbus summary srinivas.kandagatla
2017-12-01 10:27 ` Jonathan Neuschäfer
2017-12-05 22:01 ` Srinivas Kandagatla
2017-11-30 17:41 ` [PATCH v8 02/13] dt-bindings: Add SLIMbus bindings srinivas.kandagatla
2017-11-30 17:41 ` [PATCH v8 03/13] slimbus: Add SLIMbus bus type srinivas.kandagatla
2017-11-30 17:41 ` [PATCH v8 04/13] slimbus: core: Add slim controllers support srinivas.kandagatla
2017-11-30 17:41 ` [PATCH v8 05/13] slimbus: core: add support to device tree helper srinivas.kandagatla
2017-11-30 17:41 ` [PATCH v8 06/13] slimbus: Add messaging APIs to slimbus framework srinivas.kandagatla
2017-11-30 17:41 ` [PATCH v8 07/13] slimbus: Add support for 'clock-pause' feature srinivas.kandagatla
2017-11-30 19:25 ` Philippe Ombredanne
2017-12-01 9:51 ` Greg Kroah-Hartman
2017-12-01 9:54 ` Srinivas Kandagatla
2017-11-30 17:41 ` [PATCH v8 08/13] regmap: add SLIMbus support srinivas.kandagatla
2017-11-30 17:41 ` srinivas.kandagatla [this message]
2017-11-30 17:41 ` [PATCH v8 10/13] dt-bindings: Add qcom slimbus controller bindings srinivas.kandagatla
[not found] ` <20171130174200.6684-11-srinivas.kandagatla-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2017-12-04 21:28 ` Rob Herring
2017-12-05 22:03 ` Srinivas Kandagatla
2017-11-30 17:41 ` [PATCH v8 11/13] slimbus: qcom: Add Qualcomm Slimbus controller driver srinivas.kandagatla
2017-11-30 17:41 ` [PATCH v8 12/13] slimbus: qcom: Add runtime-pm support using clock-pause srinivas.kandagatla
2017-11-30 17:42 ` [PATCH v8 13/13] MAINTAINERS: Add SLIMbus maintainer srinivas.kandagatla
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=20171130174200.6684-10-srinivas.kandagatla@linaro.org \
--to=srinivas.kandagatla@linaro.org \
--cc=alan@linux.intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=andreas.noever@gmail.com \
--cc=arnd@arndb.de \
--cc=bp@suse.de \
--cc=broonie@kernel.org \
--cc=daniel@ffwll.ch \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=james.hogan@imgtec.com \
--cc=jkosina@suse.cz \
--cc=joe@perches.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mathieu.poirier@linaro.org \
--cc=michael.opdenacker@free-electrons.com \
--cc=pawel.moll@arm.com \
--cc=poeschel@lemonage.de \
--cc=robh+dt@kernel.org \
--cc=sdharia@codeaurora.org \
--cc=sharon.dvir1@mail.huji.ac.il \
--cc=treding@nvidia.com \
--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).