All of lore.kernel.org
 help / color / mirror / Atom feed
From: dave.martin@linaro.org (Dave Martin)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/5] ARM: vexpress: Get rid of MMIO_P2V
Date: Wed, 16 Nov 2011 17:28:15 +0000	[thread overview]
Message-ID: <20111116172815.GF2073@localhost.localdomain> (raw)
In-Reply-To: <1321460205.3137.352.camel@hornet.cambridge.arm.com>

On Wed, Nov 16, 2011 at 04:16:45PM +0000, Pawel Moll wrote:
> On Wed, 2011-11-16 at 15:35 +0000, Dave Martin wrote:
> > On Fri, Nov 11, 2011 at 06:27:02PM +0000, Pawel Moll wrote:
> > > This patch gets rid of the MMIO_P2V and __MMPIO_P2V macros,
> > > defining constant virtual base for motherboard and tile
> > > peripherals instead.
> > > 
> > > Additionally, in preparation for the new motherboard memory
> > > map, the motherboard peripherals are using base pointers
> > > calculated in runtime, instead of compile-time calculated
> > > values.
> > > 
> > > Signed-off-by: Pawel Moll <pawel.moll@arm.com>
> > > ---
> > >  arch/arm/include/asm/hardware/arm_timer.h         |    5 ++
> > >  arch/arm/mach-vexpress/core.h                     |   12 +++-
> > >  arch/arm/mach-vexpress/ct-ca9x4.c                 |   52 ++++-------------
> > >  arch/arm/mach-vexpress/include/mach/ct-ca9x4.h    |   13 ++---
> > >  arch/arm/mach-vexpress/include/mach/motherboard.h |   53 ++++++++---------
> > >  arch/arm/mach-vexpress/platsmp.c                  |    4 +-
> > >  arch/arm/mach-vexpress/v2m.c                      |   64 ++++++++++++++-------
> > >  7 files changed, 100 insertions(+), 103 deletions(-)
> > 
> > [...]
> > 
> > > diff --git a/arch/arm/mach-vexpress/ct-ca9x4.c b/arch/arm/mach-vexpress/ct-ca9x4.c
> > > index 2b1e836..47c0733 100644
> > > --- a/arch/arm/mach-vexpress/ct-ca9x4.c
> > > +++ b/arch/arm/mach-vexpress/ct-ca9x4.c
> > > @@ -30,57 +30,26 @@
> > >  
> > >  #include <plat/clcd.h>
> > >  
> > > -#define V2M_PA_CS7	0x10000000
> > > -
> > >  static struct map_desc ct_ca9x4_io_desc[] __initdata = {
> > >  	{
> > > -		.virtual	= __MMIO_P2V(CT_CA9X4_MPIC),
> > > -		.pfn		= __phys_to_pfn(CT_CA9X4_MPIC),
> > > -		.length		= SZ_16K,
> > > -		.type		= MT_DEVICE,
> > > +		.virtual        = V2T_PERIPH,
> > > +		.pfn            = __phys_to_pfn(CT_CA9X4_MPIC),
> > > +		.length         = SZ_8K,
> >
> > Can you explain the size change?
> 
> The SCU's "Private memory region" is 8K big, not 16:
> 
> http://infocenter.arm.com/help/topic/com.arm.doc.ddi0407g/CACCJFCJ.html
> http://infocenter.arm.com/help/topic/com.arm.doc.dui0448e/CHDCBJCB.html

OK, so that's just tidyup of an oversized mapping.  Fair enough.

> 
> > > diff --git a/arch/arm/mach-vexpress/v2m.c b/arch/arm/mach-vexpress/v2m.c
> > > index 1fafc32..b84fa45 100644
> > > --- a/arch/arm/mach-vexpress/v2m.c
> > > +++ b/arch/arm/mach-vexpress/v2m.c
> > 
> > [...]
> > 
> > > @@ -413,6 +431,10 @@ static void __init v2m_populate_ct_desc(void)
> > >  static void __init v2m_map_io(void)
> > >  {
> > >  	iotable_init(v2m_io_desc, ARRAY_SIZE(v2m_io_desc));
> > > +
> > > +	/* Will become an ioremap() when possible */
> > > +	v2m_sysreg_base = V2M_PERIPH_P2V(V2M_SYSREGS);
> > 
> > linux/of_fdt.h has functions for manipulating the flattened device tree
> > blob.
> > 
> > Could that solve our problem?  We just need to get the root node compatible
> > property out.
> 
> What do you exaclty mean? This function is non-DT related. It's not used
> by DT platform at all...

I failed to notice that-- if this function isn't used at all for the DT case,
then I guess this isn't important.

> > Is there anything else blocking the building of legacy and RS1 memory
> > maps into a single kernel?
> > (I'm still hazy on how all the remapping stuff works, myself.)
> 
> This works now - I have a single binary kernel that works on both A9 and
> A5 coretiles. Of course the ATAG-based support works with A9 only.

Cool -- we should get Ryan and Tixy to try it out, if they haven't already.
I don't have an A5 handy...

Cheers
---Dave

WARNING: multiple messages have this Message-ID (diff)
From: Dave Martin <dave.martin-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
To: Pawel Moll <pawel.moll-5wv7dgnIgG8@public.gmane.org>
Cc: "devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org"
	<devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org>,
	"linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>
Subject: Re: [PATCH 1/5] ARM: vexpress: Get rid of MMIO_P2V
Date: Wed, 16 Nov 2011 17:28:15 +0000	[thread overview]
Message-ID: <20111116172815.GF2073@localhost.localdomain> (raw)
In-Reply-To: <1321460205.3137.352.camel-okZbbLrgpR/YkXV2EHHjLW3o5bpOHsLO@public.gmane.org>

On Wed, Nov 16, 2011 at 04:16:45PM +0000, Pawel Moll wrote:
> On Wed, 2011-11-16 at 15:35 +0000, Dave Martin wrote:
> > On Fri, Nov 11, 2011 at 06:27:02PM +0000, Pawel Moll wrote:
> > > This patch gets rid of the MMIO_P2V and __MMPIO_P2V macros,
> > > defining constant virtual base for motherboard and tile
> > > peripherals instead.
> > > 
> > > Additionally, in preparation for the new motherboard memory
> > > map, the motherboard peripherals are using base pointers
> > > calculated in runtime, instead of compile-time calculated
> > > values.
> > > 
> > > Signed-off-by: Pawel Moll <pawel.moll-5wv7dgnIgG8@public.gmane.org>
> > > ---
> > >  arch/arm/include/asm/hardware/arm_timer.h         |    5 ++
> > >  arch/arm/mach-vexpress/core.h                     |   12 +++-
> > >  arch/arm/mach-vexpress/ct-ca9x4.c                 |   52 ++++-------------
> > >  arch/arm/mach-vexpress/include/mach/ct-ca9x4.h    |   13 ++---
> > >  arch/arm/mach-vexpress/include/mach/motherboard.h |   53 ++++++++---------
> > >  arch/arm/mach-vexpress/platsmp.c                  |    4 +-
> > >  arch/arm/mach-vexpress/v2m.c                      |   64 ++++++++++++++-------
> > >  7 files changed, 100 insertions(+), 103 deletions(-)
> > 
> > [...]
> > 
> > > diff --git a/arch/arm/mach-vexpress/ct-ca9x4.c b/arch/arm/mach-vexpress/ct-ca9x4.c
> > > index 2b1e836..47c0733 100644
> > > --- a/arch/arm/mach-vexpress/ct-ca9x4.c
> > > +++ b/arch/arm/mach-vexpress/ct-ca9x4.c
> > > @@ -30,57 +30,26 @@
> > >  
> > >  #include <plat/clcd.h>
> > >  
> > > -#define V2M_PA_CS7	0x10000000
> > > -
> > >  static struct map_desc ct_ca9x4_io_desc[] __initdata = {
> > >  	{
> > > -		.virtual	= __MMIO_P2V(CT_CA9X4_MPIC),
> > > -		.pfn		= __phys_to_pfn(CT_CA9X4_MPIC),
> > > -		.length		= SZ_16K,
> > > -		.type		= MT_DEVICE,
> > > +		.virtual        = V2T_PERIPH,
> > > +		.pfn            = __phys_to_pfn(CT_CA9X4_MPIC),
> > > +		.length         = SZ_8K,
> >
> > Can you explain the size change?
> 
> The SCU's "Private memory region" is 8K big, not 16:
> 
> http://infocenter.arm.com/help/topic/com.arm.doc.ddi0407g/CACCJFCJ.html
> http://infocenter.arm.com/help/topic/com.arm.doc.dui0448e/CHDCBJCB.html

OK, so that's just tidyup of an oversized mapping.  Fair enough.

> 
> > > diff --git a/arch/arm/mach-vexpress/v2m.c b/arch/arm/mach-vexpress/v2m.c
> > > index 1fafc32..b84fa45 100644
> > > --- a/arch/arm/mach-vexpress/v2m.c
> > > +++ b/arch/arm/mach-vexpress/v2m.c
> > 
> > [...]
> > 
> > > @@ -413,6 +431,10 @@ static void __init v2m_populate_ct_desc(void)
> > >  static void __init v2m_map_io(void)
> > >  {
> > >  	iotable_init(v2m_io_desc, ARRAY_SIZE(v2m_io_desc));
> > > +
> > > +	/* Will become an ioremap() when possible */
> > > +	v2m_sysreg_base = V2M_PERIPH_P2V(V2M_SYSREGS);
> > 
> > linux/of_fdt.h has functions for manipulating the flattened device tree
> > blob.
> > 
> > Could that solve our problem?  We just need to get the root node compatible
> > property out.
> 
> What do you exaclty mean? This function is non-DT related. It's not used
> by DT platform at all...

I failed to notice that-- if this function isn't used at all for the DT case,
then I guess this isn't important.

> > Is there anything else blocking the building of legacy and RS1 memory
> > maps into a single kernel?
> > (I'm still hazy on how all the remapping stuff works, myself.)
> 
> This works now - I have a single binary kernel that works on both A9 and
> A5 coretiles. Of course the ATAG-based support works with A9 only.

Cool -- we should get Ryan and Tixy to try it out, if they haven't already.
I don't have an A5 handy...

Cheers
---Dave

  reply	other threads:[~2011-11-16 17:28 UTC|newest]

Thread overview: 98+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-11 18:27 [PATCH 0/5] Versatile Express DT support, take 2 Pawel Moll
2011-11-11 18:27 ` Pawel Moll
2011-11-11 18:27 ` [PATCH 1/5] ARM: vexpress: Get rid of MMIO_P2V Pawel Moll
2011-11-11 18:27   ` Pawel Moll
2011-11-16 15:35   ` Dave Martin
2011-11-16 15:35     ` Dave Martin
2011-11-16 16:16     ` Pawel Moll
2011-11-16 16:16       ` Pawel Moll
2011-11-16 17:28       ` Dave Martin [this message]
2011-11-16 17:28         ` Dave Martin
2011-11-16 17:30         ` Pawel Moll
2011-11-16 17:30           ` Pawel Moll
2011-11-17  7:02           ` Ryan Harkin
2011-11-17  7:02             ` Ryan Harkin
2011-11-17 15:43   ` Russell King - ARM Linux
2011-11-17 15:43     ` Russell King - ARM Linux
2011-11-18 12:20     ` Pawel Moll
2011-11-18 12:20       ` Pawel Moll
2011-11-18 17:44       ` Russell King - ARM Linux
2011-11-18 17:44         ` Russell King - ARM Linux
2011-11-11 18:27 ` [PATCH 2/5] ARM: vexpress: Remove platform SMP functions from ct_desc Pawel Moll
2011-11-11 18:27   ` Pawel Moll
2011-11-17 15:31   ` Russell King - ARM Linux
2011-11-17 15:31     ` Russell King - ARM Linux
2011-11-18 12:20     ` Pawel Moll
2011-11-18 12:20       ` Pawel Moll
2011-11-11 18:27 ` [PATCH 3/5] ARM: vexpress: Add DT support in v2m Pawel Moll
2011-11-11 18:27   ` Pawel Moll
2011-11-16 15:44   ` Dave Martin
2011-11-16 15:44     ` Dave Martin
2011-11-16 16:26     ` Rob Herring
2011-11-16 16:26       ` Rob Herring
2011-11-16 16:37       ` Pawel Moll
2011-11-16 16:37         ` Pawel Moll
2011-11-16 16:59         ` Rob Herring
2011-11-16 16:59           ` Rob Herring
2011-11-16 17:07           ` Pawel Moll
2011-11-16 17:07             ` Pawel Moll
2011-11-16 17:37             ` Pawel Moll
2011-11-16 17:37               ` Pawel Moll
2011-11-16 19:14               ` Dave Martin
2011-11-16 19:14                 ` Dave Martin
2011-11-16 17:39             ` Dave Martin
2011-11-16 17:39               ` Dave Martin
2011-11-16 17:50               ` Dave Martin
2011-11-16 17:50                 ` Dave Martin
2011-11-16 17:55                 ` Pawel Moll
2011-11-16 17:55                   ` Pawel Moll
2011-11-17 15:53             ` Russell King - ARM Linux
2011-11-17 15:53               ` Russell King - ARM Linux
2011-11-18 12:20               ` Pawel Moll
2011-11-18 12:20                 ` Pawel Moll
2011-11-18 17:49                 ` Russell King - ARM Linux
2011-11-18 17:49                   ` Russell King - ARM Linux
2011-11-16 16:35     ` Pawel Moll
2011-11-16 16:35       ` Pawel Moll
2011-11-16 17:57       ` Dave Martin
2011-11-16 17:57         ` Dave Martin
2011-11-17 13:50         ` Pawel Moll
2011-11-17 13:50           ` Pawel Moll
2011-11-17 14:41           ` Dave Martin
2011-11-17 14:41             ` Dave Martin
2011-11-17 16:05   ` Russell King - ARM Linux
2011-11-17 16:05     ` Russell King - ARM Linux
2011-11-17 18:37     ` Dave Martin
2011-11-17 18:37       ` Dave Martin
2011-11-18 17:52       ` Russell King - ARM Linux
2011-11-18 17:52         ` Russell King - ARM Linux
2011-11-18 12:20     ` Pawel Moll
2011-11-18 12:20       ` Pawel Moll
2011-11-11 18:27 ` [PATCH 4/5] ARM: vexpress: Initial RS1 memory map support Pawel Moll
2011-11-11 18:27   ` Pawel Moll
2011-11-16 15:42   ` Dave Martin
2011-11-16 15:42     ` Dave Martin
2011-11-16 16:28     ` Pawel Moll
2011-11-16 16:28       ` Pawel Moll
2011-11-16 18:03       ` Dave Martin
2011-11-16 18:03         ` Dave Martin
2011-11-17 15:36   ` Russell King - ARM Linux
2011-11-17 15:36     ` Russell King - ARM Linux
2011-11-18 12:20     ` Pawel Moll
2011-11-18 12:20       ` Pawel Moll
2011-11-18 17:56       ` Russell King - ARM Linux
2011-11-18 17:56         ` Russell King - ARM Linux
2011-11-11 18:27 ` [PATCH 5/5] ARM: vexpress: DT-based support for CoreTiles Express A5x2 and A9x4 Pawel Moll
2011-11-11 18:27   ` Pawel Moll
2011-11-11 22:30   ` Rob Herring
2011-11-11 22:30     ` Rob Herring
2011-11-11 22:54     ` Pawel Moll
2011-11-11 22:54       ` Pawel Moll
2011-11-16 15:36   ` Dave Martin
2011-11-16 15:36     ` Dave Martin
2011-11-16 16:22     ` Pawel Moll
2011-11-16 16:22       ` Pawel Moll
2011-11-16 18:17       ` Dave Martin
2011-11-16 18:17         ` Dave Martin
2011-11-16 15:33 ` [PATCH 0/5] Versatile Express DT support, take 2 Dave Martin
2011-11-16 15:33   ` Dave Martin

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=20111116172815.GF2073@localhost.localdomain \
    --to=dave.martin@linaro.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.