From: Anatolij Gustschin <agust@denx.de>
To: Wolfgang Grandegger <wg@grandegger.com>,
Marc Kleine-Budde <mkl@pengutronix.de>
Cc: Gerhard Sittig <gsi@denx.de>,
linux-can@vger.kernel.org, netdev@vger.kernel.org
Subject: [PATCH RESEND next 1/2] net: can: mscan: add a comment on reg to idx mapping
Date: Fri, 23 Aug 2013 13:09:02 +0200 [thread overview]
Message-ID: <1377256144-4173-1-git-send-email-agust@denx.de> (raw)
From: Gerhard Sittig <gsi@denx.de>
add a comment about the magic of deriving an MSCAN component index
from the peripheral's physical address / register offset
Cc: linux-can@vger.kernel.org
Cc: netdev@vger.kernel.org
Signed-off-by: Gerhard Sittig <gsi@denx.de>
Signed-off-by: Anatolij Gustschin <agust@denx.de>
---
drivers/net/can/mscan/mpc5xxx_can.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/can/mscan/mpc5xxx_can.c b/drivers/net/can/mscan/mpc5xxx_can.c
index 5b0ee8e..bc422ba 100644
--- a/drivers/net/can/mscan/mpc5xxx_can.c
+++ b/drivers/net/can/mscan/mpc5xxx_can.c
@@ -148,7 +148,10 @@ static u32 mpc512x_can_get_clock(struct platform_device *ofdev,
goto exit_put;
}
- /* Determine the MSCAN device index from the physical address */
+ /* Determine the MSCAN device index from the peripheral's
+ * physical address. Register address offsets against the
+ * IMMR base are: 0x1300, 0x1380, 0x2300, 0x2380
+ */
pval = of_get_property(ofdev->dev.of_node, "reg", &plen);
BUG_ON(!pval || plen < sizeof(*pval));
clockidx = (*pval & 0x80) ? 1 : 0;
--
1.7.9.5
next reply other threads:[~2013-08-23 11:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-23 11:09 Anatolij Gustschin [this message]
2013-08-23 11:09 ` [PATCH RESEND next 2/2] net: can: mscan: improve clock API use Anatolij Gustschin
2013-08-23 11:29 ` [PATCH RESEND next 1/2] net: can: mscan: add a comment on reg to idx mapping Marc Kleine-Budde
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=1377256144-4173-1-git-send-email-agust@denx.de \
--to=agust@denx.de \
--cc=gsi@denx.de \
--cc=linux-can@vger.kernel.org \
--cc=mkl@pengutronix.de \
--cc=netdev@vger.kernel.org \
--cc=wg@grandegger.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).