From: Torin Cooper-Bennun <torin@maxiluxsystems.com>
To: linux-can@vger.kernel.org
Cc: Marc Kleine-Budde <mkl@pengutronix.de>,
Pankaj Sharma <pankj.sharma@samsung.com>,
Torin Cooper-Bennun <torin@maxiluxsystems.com>
Subject: [PATCH 2/4] can: m_can: clean up CCCR reg defs, order by revs
Date: Tue, 4 May 2021 12:20:33 +0100 [thread overview]
Message-ID: <20210504112035.336424-3-torin@maxiluxsystems.com> (raw)
In-Reply-To: <20210504112035.336424-1-torin@maxiluxsystems.com>
Ensures that the different CCCR regmasks for m_can revs 3.0.x, 3.1.x,
3.2.x and 3.3.x are clearly distinguishable. Removes incorrect
CCCR_CANFD define. Adds bit fields UTSU and WMM for rev 3.3.x, for
completeness.
---
drivers/net/can/m_can/m_can.c | 23 +++++++++++++----------
1 file changed, 13 insertions(+), 10 deletions(-)
diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c
index f402a250e24f..c85f064de4a0 100644
--- a/drivers/net/can/m_can/m_can.c
+++ b/drivers/net/can/m_can/m_can.c
@@ -102,14 +102,6 @@ enum m_can_reg {
#define TEST_LBCK BIT(4)
/* CC Control Register(CCCR) */
-#define CCCR_CMR_MASK GENMASK(11, 10)
-#define CCCR_CMR_CANFD 0x1
-#define CCCR_CMR_CANFD_BRS 0x2
-#define CCCR_CMR_CAN 0x3
-#define CCCR_CME_MASK GENMASK(9, 8)
-#define CCCR_CME_CAN 0
-#define CCCR_CME_CANFD 0x1
-#define CCCR_CME_CANFD_BRS 0x2
#define CCCR_TXP BIT(14)
#define CCCR_TEST BIT(7)
#define CCCR_DAR BIT(6)
@@ -119,14 +111,25 @@ enum m_can_reg {
#define CCCR_ASM BIT(2)
#define CCCR_CCE BIT(1)
#define CCCR_INIT BIT(0)
-#define CCCR_CANFD BIT(4)
+/* for version 3.0.x */
+#define CCCR_CMR_MASK GENMASK(11, 10)
+#define CCCR_CMR_CANFD 0x1
+#define CCCR_CMR_CANFD_BRS 0x2
+#define CCCR_CMR_CAN 0x3
+#define CCCR_CME_MASK GENMASK(9, 8)
+#define CCCR_CME_CAN 0
+#define CCCR_CME_CANFD 0x1
+#define CCCR_CME_CANFD_BRS 0x2
/* for version >=3.1.x */
#define CCCR_EFBI BIT(13)
#define CCCR_PXHD BIT(12)
#define CCCR_BRSE BIT(9)
#define CCCR_FDOE BIT(8)
-/* only for version >=3.2.x */
+/* for version >=3.2.x */
#define CCCR_NISO BIT(15)
+/* for version >=3.3.x */
+#define CCCR_WMM BIT(11)
+#define CCCR_UTSU BIT(10)
/* Nominal Bit Timing & Prescaler Register (NBTP) */
#define NBTP_NSJW_MASK GENMASK(31, 25)
--
2.30.2
next prev parent reply other threads:[~2021-05-04 11:21 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-04 11:20 PATCH [0/4] can: m_can: various regmask-related cleanup Torin Cooper-Bennun
2021-05-04 11:20 ` [PATCH 1/4] can: m_can: use bits.h macros for all regmasks Torin Cooper-Bennun
2021-05-04 11:20 ` Torin Cooper-Bennun [this message]
2021-05-04 11:20 ` [PATCH 3/4] can: m_can: make TXESC, RXESC config more explicit Torin Cooper-Bennun
2021-05-04 11:20 ` [PATCH 4/4] can: m_can: fix whitespace in a few comments Torin Cooper-Bennun
2021-05-04 11:27 ` PATCH [0/4] can: m_can: various regmask-related cleanup Marc Kleine-Budde
2021-05-04 11:39 ` Torin Cooper-Bennun
2021-05-04 11:48 [REPOST PATCH 0/4] " Torin Cooper-Bennun
2021-05-04 11:48 ` [PATCH 2/4] can: m_can: clean up CCCR reg defs, order by revs Torin Cooper-Bennun
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=20210504112035.336424-3-torin@maxiluxsystems.com \
--to=torin@maxiluxsystems.com \
--cc=linux-can@vger.kernel.org \
--cc=mkl@pengutronix.de \
--cc=pankj.sharma@samsung.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).