Re: DT vs ARM static mappings

2011-09-23 Thread Arnd Bergmann
On Thursday 22 September 2011, Pawel Moll wrote: > Executive summary: > > * I have second map_desc with pfn for RS1 memory map, but using the same > virtual address as the legacy one. The legacy one is used if root of the > tree is compatible with "arm,vexpress-legacy". > > * The devices I need t

Re: DT vs ARM static mappings

2011-09-22 Thread Pawel Moll
> - map the entire I/O area in map_io(), depending on the board > - have an __iomem pointer for the sysreg > - populate that pointer using of_iomap from the device tree address > before you first access it. Ok, so what I came with is below... It's based more-or-less on top of Dave's patch (it's

Re: DT vs ARM static mappings

2011-09-22 Thread Pawel Moll
> > Ok, what I did was grepping for all .map_io-s. Then I sorted the list > > and had a look at first 100 and about 50% of them were doing more than > > just creating mappings. > > The answer to that is: they shouldn't be now that we have the init_early > hook. The only remainder for .map_io is w

Re: DT vs ARM static mappings

2011-09-22 Thread Russell King - ARM Linux
On Thu, Sep 22, 2011 at 02:04:56PM +0100, Pawel Moll wrote: > > > ARM machine description contains a "map_io" method, which is used to > > > create static memory mappings (using iotable_init() function) for things > > > like peripherals or SRAMs. At least that's the theory, because most of > > > th

Re: DT vs ARM static mappings

2011-09-22 Thread Pawel Moll
> > ARM machine description contains a "map_io" method, which is used to > > create static memory mappings (using iotable_init() function) for things > > like peripherals or SRAMs. At least that's the theory, because most of > > the platforms are doing much more stuff there, like clocking/GPIOs/UAR

Re: DT vs ARM static mappings

2011-09-21 Thread Nicolas Pitre
On Tue, 20 Sep 2011, Pawel Moll wrote: > ARM machine description contains a "map_io" method, which is used to > create static memory mappings (using iotable_init() function) for things > like peripherals or SRAMs. At least that's the theory, because most of > the platforms are doing much more stuf

Re: DT vs ARM static mappings

2011-09-21 Thread Pawel Moll
> I won't attempt to modify the rest of the patch yet, but we can roll > changes in when you've decided on a way forward. > > Alternatively, the requisite changes can be done as patches on top of > the basic patch -- since the initial patch doesn't attempt to support > multiple core tiles anyway.

Re: DT vs ARM static mappings

2011-09-21 Thread Pawel Moll
> > 2. Single DT_MACHINE_START matching (the most generic) "arm,vexpress" > > and doing (rougly) this in v2m_map_io: > > > > of_scan_flat_dt(v2m_dt_iotable_init, NULL); > > > > v2m_dt_iotable_init(...) > > { > > if (depth != 0) > > return 0; > > if (of_flat_dt_is_compatible(no

Re: DT vs ARM static mappings

2011-09-21 Thread Pawel Moll
On Tue, 2011-09-20 at 15:37 +0100, Rob Herring wrote > > My point is that we should be able to handle _all_ of them using one > > DT_MACHINE_START with a single compat value "arm,vexpress". The only > > problem with this (so far) is the mapping. > > Yes, you should have 1 DT_MACHINE_START, but arm

Re: DT vs ARM static mappings

2011-09-21 Thread Pawel Moll
> > Of course the simplest solution would be to define two different > > compatible values, eg. "arm,vexpress-legacy" would execute the current > > map_io implementation, while "arm,vexpress-rs1" would use different one, > > setting up the other map_desc (the MMIO_P2V macro must die of course, > >

DT vs ARM static mappings

2011-09-21 Thread Pawel Moll
Hi All, Apologies for the length of the text below, but the problem is complex... (or at least it seems to be) While working on DT support for ARM Versatile Express I faced an interesting problem... Some background first, to set a common ground and test my understanding of the problem ;-) ARM ma

Re: DT vs ARM static mappings

2011-09-21 Thread Dave Martin
On Wed, Sep 21, 2011 at 10:41:49AM +0100, Pawel Moll wrote: > > > 2. Single DT_MACHINE_START matching (the most generic) "arm,vexpress" > > > and doing (rougly) this in v2m_map_io: > > > > > > of_scan_flat_dt(v2m_dt_iotable_init, NULL); > > > > > > v2m_dt_iotable_init(...) > > > { > > > if (dep

Re: DT vs ARM static mappings

2011-09-20 Thread Arnd Bergmann
On Tuesday 20 September 2011, Pawel Moll wrote: > On Tue, 2011-09-20 at 15:37 +0100, Rob Herring wrote > > > My point is that we should be able to handle _all_ of them using one > > > DT_MACHINE_START with a single compat value "arm,vexpress". The only > > > problem with this (so far) is the mappin

Re: DT vs ARM static mappings

2011-09-20 Thread Rob Herring
Pawel, On 09/20/2011 09:02 AM, Pawel Moll wrote: >>> Of course the simplest solution would be to define two different >>> compatible values, eg. "arm,vexpress-legacy" would execute the current >>> map_io implementation, while "arm,vexpress-rs1" would use different one, >>> setting up the other map

Re: DT vs ARM static mappings

2011-09-20 Thread Rob Herring
Pawel, On 09/20/2011 06:51 AM, Pawel Moll wrote: > Hi All, > > Apologies for the length of the text below, but the problem is > complex... (or at least it seems to be) > > While working on DT support for ARM Versatile Express I faced an > interesting problem... Some background first, to set a co