public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Magnus Damm <magnus.damm@gmail.com>
Cc: linux-arm-kernel@lists.infradead.org, linux@arm.linux.org.uk,
	linux-sh@vger.kernel.org, lethal@linux-sh.org,
	linux-kernel@vger.kernel.org, rjw@sisk.pl, horms@verge.net.au,
	olof@lixom.net
Subject: Re: [PATCH 01/02] mach-shmobile: Emma Mobile EV2 SoC base support
Date: Fri, 4 May 2012 19:47:38 +0000	[thread overview]
Message-ID: <201205041947.38375.arnd@arndb.de> (raw)
In-Reply-To: <201205041307.46080.arnd@arndb.de>

On Friday 04 May 2012, Arnd Bergmann wrote:
> 
> On Thursday 03 May 2012, Magnus Damm wrote:
> 
> > +
> > +/* EMEV2 SMU registers */
> > +#define USIAU0_RSTCTRL 0xe0110094
> > +#define USIBU1_RSTCTRL 0xe01100ac
> > +#define USIBU2_RSTCTRL 0xe01100b0
> > +#define USIBU3_RSTCTRL 0xe01100b4
> > +#define STI_RSTCTRL 0xe0110124
> > +#define USIAU0GCLKCTRL 0xe01104a0
> > +#define USIBU1GCLKCTRL 0xe01104b8
> > +#define USIBU2GCLKCTRL 0xe01104bc
> > +#define USIBU3GCLKCTRL 0xe01104c0
> > +#define STIGCLKCTRL 0xe0110528
> > +#define USIAU0SCLKDIV 0xe011061c
> > +#define USIB2SCLKDIV 0xe011065c
> > +#define USIB3SCLKDIV 0xe0110660
> > +#define STI_CLKSEL 0xe0110688
> 
> Please cast to __iomem* here, e.g. using the IOMEM() macro, as these are
> virtual addresses.

I should revise that: there is no excuse to hardcode these virtual address
here at all. Just use call ioremap() on the physical address for the
clock registers (0xe0110000) and use the resulting pointer with an
offset that you define locally in this file.

It is safe to call ioremap when you get to emev2_clock_init()
and you will still get a large page mapping with the recent
code reworks for map_desc.

Regarding the iotable that is currently defined as

+static struct map_desc emev2_io_desc[] __initdata = {
+       /* 128K entity map for 0xe0020000 (GIC) */
+       {
+               .virtual        = 0xe0020000,
+               .pfn            = __phys_to_pfn(0xe0020000),
+               .length         = SZ_128K,
+               .type           = MT_UNCACHED
+       },
+       /* 128K entity map for 0xe0100000 (SMU) */
+       {
+               .virtual        = 0xe0100000,
+               .pfn            = __phys_to_pfn(0xe0100000),
+               .length         = SZ_128K,
+               .type           = MT_DEVICE
+       },
+};

I would recommend just mapping the entire 16MB page around this, or at least
2 MB, so you can benefit from the larger mappings. If you don't do that,
better remove the entire iotable registration and rely on ioremap, the
result will be the same and you can be prevent any hacks from creeping in
that rely on the virtual address being the same as the physical address.

	Arnd

  reply	other threads:[~2012-05-04 19:48 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-03 14:46 [PATCH 00/02] mach-shmobile: Emma Mobile EV2 - first shot Magnus Damm
2012-05-03 14:46 ` [PATCH 01/02] mach-shmobile: Emma Mobile EV2 SoC base support Magnus Damm
2012-05-04 13:07   ` Arnd Bergmann
2012-05-04 19:47     ` Arnd Bergmann [this message]
2012-05-08 16:56     ` Magnus Damm
2012-05-08 19:35       ` Arnd Bergmann
2012-05-03 14:47 ` [PATCH 02/02] mach-shmobile: KZM9D board prototype support Magnus Damm
2012-05-04 13:14   ` Arnd Bergmann
2012-05-03 19:23 ` [PATCH 00/02] mach-shmobile: Emma Mobile EV2 - first shot Rafael J. Wysocki
2012-05-04 19:57 ` Arnd Bergmann
2012-05-04 21:16   ` Rafael J. Wysocki
2012-05-05  7:22     ` Arnd Bergmann
2012-05-05 19:08       ` Rafael J. Wysocki
2012-05-05 19:21         ` Arnd Bergmann
2012-05-05 19:30           ` Rafael J. Wysocki
2012-05-05 19:50             ` Arnd Bergmann
2012-05-06 14:23           ` Magnus Damm
2012-05-08 20:12             ` Arnd Bergmann
2012-05-09  7:57           ` Geert Uytterhoeven
2012-05-09  8:12             ` Magnus Damm

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=201205041947.38375.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=horms@verge.net.au \
    --cc=lethal@linux-sh.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=magnus.damm@gmail.com \
    --cc=olof@lixom.net \
    --cc=rjw@sisk.pl \
    /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