linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: alexandre.belloni@free-electrons.com (Alexandre Belloni)
To: linux-arm-kernel@lists.infradead.org
Subject: regmap-mmio and paged registers
Date: Wed, 9 Dec 2015 23:26:13 +0100	[thread overview]
Message-ID: <20151209222613.GI3515@piout.net> (raw)
In-Reply-To: <20151209221036.GK5727@sirena.org.uk>

On 09/12/2015 at 22:10:36 +0000, Mark Brown wrote :
> On Wed, Dec 09, 2015 at 10:41:50PM +0100, Alexandre Belloni wrote:
> 
> > 	/* It is possible to have selector register inside data window.
> > 	   In that case, selector register is located on every page and
> > 	   it needs no page switching, when accessed alone. */
> > 	if (val_num > 1 ||
> > 	    range->window_start + win_offset != range->selector_reg) {
> 
> > So it ends up never writing the page number in the register.
> 
> > One possible solution would be to implement our own .read and .write to
> > handle that paging but maybe you can think of something else.
> 
> So to be explicit about the actual issue the problem here is that you
> have data bits in the same register as your selector and indeed the
> register map you're trying to page is a single register.  That's pretty
> pathological.
> 
> Honestly looking at the register I'm not even convinced it is a paged
> regmap, it looks more like a mailbox for communication with a
> coprocessor than anything else (the fact that the selector is named PID,
> the fact that the bitfields include CMD...).  Are you sure that it's a
> good idea to represent this as a regmap at all?

Yeah, I was probably not clear enough but the regmap actually covers the
whole PMC range and include that particular register. We have to do that
because this range is used by multiple drivers.

This register, PMC_PCR is also used by multiple drivers so it is
important to properly lock between the page selection and the following
read or write.

-- 
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

  reply	other threads:[~2015-12-09 22:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-09 21:41 regmap-mmio and paged registers Alexandre Belloni
2015-12-09 22:10 ` Mark Brown
2015-12-09 22:26   ` Alexandre Belloni [this message]
2015-12-16 11:38     ` Mark Brown

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=20151209222613.GI3515@piout.net \
    --to=alexandre.belloni@free-electrons.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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).