linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Joachim Eastwood <manabian@gmail.com>
Cc: linux-omap@vger.kernel.org
Subject: Re: [PATCH] ARM: dts: Correct offset in OMAP4_WKUP_IOPAD macro
Date: Mon, 21 Apr 2014 08:35:40 -0700	[thread overview]
Message-ID: <20140421153539.GB23945@atomide.com> (raw)
In-Reply-To: <CAGhQ9VwU_BjrD+c9uJn9FBwo6v_BOMUCKwiOW-7eqOu056a79A@mail.gmail.com>

* Joachim Eastwood <manabian@gmail.com> [140419 09:25]:
> On 19 April 2014 18:14, Joachim Eastwood <manabian@gmail.com> wrote:
> > This was introduced in 43a348ea53eb5fd79 but hasn't caused
> > any harm since it don't have any users yet.
> 
> Or maybe I am confused about this macro.
> 
> Tony which offset from the OMAP4 TRM should be used?
> 
> Under section 18.6.8 there are is a column with address offset. Is
> this the number you want in the macro?

Oh I see, the offsets in the TRM in this case are from the base
of the wkup module padconf base instead of listing the physical
address for the register. Ideally the value would be what the
documentation lists in the "Table 18-9. Device Wake-Up Control
Module Pad Configuration Register Fields" with 2 added to it for
the upper registers as we're using 16-bit register address.
In any case something that's relatively easy to verify against
the documentation. But that seems to vary between the physical
address and the offset, so we need to specify some mask there.

Something like below (untested) should do the trick as long as
we never have padconf reg areas larger than 0xfff. We may want to
allow defining a custom mask for the macro if needed depending
how the documentation is defining the mux tables for.

--- a/include/dt-bindings/pinctrl/omap.h
+++ b/include/dt-bindings/pinctrl/omap.h
@@ -51,9 +51,9 @@
 
 /*
  * Macros to allow using the absolute physical address instead of the
- * padconf registers instead of the offset from padconf base.
+ * padconf register offset from padconf register base.
  */
-#define OMAP_IOPAD_OFFSET(pa, offset)	(((pa) & 0xffff) - (offset))
+#define OMAP_IOPAD_OFFSET(pa, offset)   (((pa) & 0xfff) - ((offset) & 0xfff))
 
 #define OMAP2420_CORE_IOPAD(pa, val)	OMAP_IOPAD_OFFSET((pa), 0x0030) (val)
 #define OMAP2430_CORE_IOPAD(pa, val)	OMAP_IOPAD_OFFSET((pa), 0x2030) (val)

  reply	other threads:[~2014-04-21 15:35 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-19 16:14 [PATCH] ARM: dts: Correct offset in OMAP4_WKUP_IOPAD macro Joachim Eastwood
2014-04-19 16:25 ` Joachim Eastwood
2014-04-21 15:35   ` Tony Lindgren [this message]
2014-04-21 16:12     ` Joachim Eastwood
2014-04-21 16:16       ` Joachim Eastwood
2014-05-06  0:12         ` Tony Lindgren
2014-05-09 12:57           ` Joachim Eastwood
2014-05-09 16:07             ` Tony Lindgren
2014-05-11 17:27               ` Joachim Eastwood
2014-05-12 16:16                 ` Tony Lindgren
2014-05-12 16:26                   ` Joachim Eastwood
2014-05-12 16:36                     ` Tony Lindgren

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=20140421153539.GB23945@atomide.com \
    --to=tony@atomide.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=manabian@gmail.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).