* DT vs ARM static mappings
@ 2011-09-20 11:51 Pawel Moll
[not found] ` <1316519479.4611.150.camel-okZbbLrgpR/YkXV2EHHjLW3o5bpOHsLO@public.gmane.org>
0 siblings, 1 reply; 16+ messages in thread
From: Pawel Moll @ 2011-09-20 11:51 UTC (permalink / raw)
To: devicetree-discuss; +Cc: linux-arm-kernel
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 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/UARTs
initialization, hardware probing etc.
Now the Versatile Express platform: it consists of a motherboard with a
set of peripherals and a processor daughterboard (core tile), both
connected via a static memory bus, which is mapped into processor's
physical address space. The motherboard can be shared between different
types of the tiles (eg. A9, A5, A15 etc.). The present one is probed byt
he motherboard firmware and exposed in "system registers".
Everything is fine so far. The interesting part starts here:
http://infocenter.arm.com/help/topic/com.arm.doc.dui0447e/CACIHGFE.html
In brief, depending on the configuration, the system can have one of
two, totally different, memory maps (please, do spare me the "but why
did they do that" comments - not my idea nor decision, I just have to
live with this ;-), depending on the core tile being used.
In result, the static mapping as defined currently in
arch/arm/mach-vexpress/v2m.c for A9 variant:
#define V2M_PA_CS7 0x10000000
static struct map_desc v2m_io_desc[] __initdata = {
{
.virtual = __MMIO_P2V(V2M_PA_CS7),
.pfn = __phys_to_pfn(V2M_PA_CS7),
.length = SZ_128K,
.type = MT_DEVICE,
},
};
is no longer valid for A5/A15. It would rather look like this:
#define V2M_PA_CS3 0x1c000000
static struct map_desc v2m_io_desc[] __initdata = {
{
.virtual = __MMIO_P2V(V2M_PA_CS3),
.pfn = __phys_to_pfn(V2M_PA_CS3),
.length = SZ_2M,
.type = MT_DEVICE,
},
};
Not only the peripherals base address is changed but also "internal"
alignment, thus offsets to peripherals. Some of them are not being
ioremap()ed, but directly used via the static mapping and MMIO_P2V macro
(like "readl(MMIO_P2V(V2M_SYS_PROCID0))" in v2m_populate_ct_desc(void)
function). For example, these two:
#define V2M_SYSREGS (V2M_PA_CS7 + 0x00000000)
#define V2M_SYSCTL (V2M_PA_CS7 + 0x00001000)
would have to become:
#define V2M_SYSREGS (V2M_PA_CS3 + 0x00010000)
#define V2M_SYSCTL (V2M_PA_CS3 + 0x00020000)
My current DTS for the original memory map looks like that (fragments):
{
motherboard {
ranges = <7 0 0x10000000 0x00020000>;
#address-cells = <2>; // SMB chipselect number and offset
#size-cells = <1>;
peripherals@7 {
ranges = <0 7 0 0x20000>;
#address-cells = <1>;
#size-cells = <1>;
sysreg@00000 {
reg = <0x00000 0x1000>;
};
sysctl@01000 {
reg = <0x01000 0x1000>;
};
}
}
}
DTS for the second memory map would just have the addresses changed.
Unfortunately, because of the static mappings being hardcoded in the
board support file, one kernel won't Just Work (TM) with different DTBs.
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,
replaced with a runtime-defined virtual base address for the
peripherals).
If you believe that's what I should do, say it and stop reading :-)
To my mind it looked like the whole mechanism was not flexible enough,
so I wanted to explore other options...
The obvious one was to describe the required static mapping in the DTS.
I don't like this idea, though. It can hardly be called "hardware
description". Besides, what node would carry such data? "chosen"?
Hardly...
Would it contain a "regs" property with the physical address and
"virtual-reg" with the virtual one? Again, doesn't sound right to me
(especially the virtual bit, however the virtual address could be common
between different variants and be defined in the board support code, not
the DTS).
I have considered a reference (phandle or an alias?) to the node to be
mapped ("peripherals" in my case), but where to define this reference?
Any ideas?
There is an additional problem here... The "map_io" is executed before
the tree is un-flattened, so:
1. One can't simply use "of_find_matching_node()" (as in the latest l2x0
patches) to find the interesting nodes - the only way of going through
the tree is raw of_scan_flat_dt() function. Therefore any conditions
more complex then string comparison with the (full) node name are
problematic.
2. The tree mappings (ranges) are not resolved yet, so one can't simply
get the effective address of a node. Only "raw" properties are
available, so all one can get scanning for "peripherals@7" node is "0 7
0 0x20000" array, instead of the "0x10000000 0x00020000" that is really
important.
Initially I wanted to find the mentioned devices and create individual
mappings for them, so the MMIO_P2V would be still valid (if slightly
"abused"), but I failed due to the problems mentioned above. And I can't
delay this operation till the tree is un-flattened, as the core tile
must be probed (via sysreg) in map_io (tile's specific code must be able
to create its own mappings):
static void __init v2m_map_io(void)
{
iotable_init(v2m_io_desc, ARRAY_SIZE(v2m_io_desc));
v2m_populate_ct_desc();
ct_desc->map_io();
}
Any comments, ideas and suggestions how to tackle this situation are
more than welcome.
Cheers!
Paweł
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: DT vs ARM static mappings
[not found] ` <1316519479.4611.150.camel-okZbbLrgpR/YkXV2EHHjLW3o5bpOHsLO@public.gmane.org>
@ 2011-09-20 12:58 ` Rob Herring
2011-09-20 14:02 ` Pawel Moll
2011-09-21 17:49 ` Nicolas Pitre
1 sibling, 1 reply; 16+ messages in thread
From: Rob Herring @ 2011-09-20 12:58 UTC (permalink / raw)
To: Pawel Moll
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
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 common ground and
> test my understanding of the problem ;-)
>
> 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/UARTs
> initialization, hardware probing etc.
>
> Now the Versatile Express platform: it consists of a motherboard with a
> set of peripherals and a processor daughterboard (core tile), both
> connected via a static memory bus, which is mapped into processor's
> physical address space. The motherboard can be shared between different
> types of the tiles (eg. A9, A5, A15 etc.). The present one is probed byt
> he motherboard firmware and exposed in "system registers".
>
> Everything is fine so far. The interesting part starts here:
>
> http://infocenter.arm.com/help/topic/com.arm.doc.dui0447e/CACIHGFE.html
>
> In brief, depending on the configuration, the system can have one of
> two, totally different, memory maps (please, do spare me the "but why
> did they do that" comments - not my idea nor decision, I just have to
> live with this ;-), depending on the core tile being used.
>
> In result, the static mapping as defined currently in
> arch/arm/mach-vexpress/v2m.c for A9 variant:
>
> #define V2M_PA_CS7 0x10000000
>
> static struct map_desc v2m_io_desc[] __initdata = {
> {
> .virtual = __MMIO_P2V(V2M_PA_CS7),
> .pfn = __phys_to_pfn(V2M_PA_CS7),
> .length = SZ_128K,
> .type = MT_DEVICE,
> },
> };
>
> is no longer valid for A5/A15. It would rather look like this:
>
> #define V2M_PA_CS3 0x1c000000
>
> static struct map_desc v2m_io_desc[] __initdata = {
> {
> .virtual = __MMIO_P2V(V2M_PA_CS3),
> .pfn = __phys_to_pfn(V2M_PA_CS3),
> .length = SZ_2M,
> .type = MT_DEVICE,
> },
> };
>
> Not only the peripherals base address is changed but also "internal"
> alignment, thus offsets to peripherals. Some of them are not being
> ioremap()ed, but directly used via the static mapping and MMIO_P2V macro
> (like "readl(MMIO_P2V(V2M_SYS_PROCID0))" in v2m_populate_ct_desc(void)
> function). For example, these two:
>
> #define V2M_SYSREGS (V2M_PA_CS7 + 0x00000000)
> #define V2M_SYSCTL (V2M_PA_CS7 + 0x00001000)
>
> would have to become:
>
> #define V2M_SYSREGS (V2M_PA_CS3 + 0x00010000)
> #define V2M_SYSCTL (V2M_PA_CS3 + 0x00020000)
>
> My current DTS for the original memory map looks like that (fragments):
>
> {
> motherboard {
> ranges = <7 0 0x10000000 0x00020000>;
> #address-cells = <2>; // SMB chipselect number and offset
> #size-cells = <1>;
>
> peripherals@7 {
> ranges = <0 7 0 0x20000>;
> #address-cells = <1>;
> #size-cells = <1>;
>
> sysreg@00000 {
> reg = <0x00000 0x1000>;
> };
>
> sysctl@01000 {
> reg = <0x01000 0x1000>;
> };
> }
> }
> }
>
> DTS for the second memory map would just have the addresses changed.
> Unfortunately, because of the static mappings being hardcoded in the
> board support file, one kernel won't Just Work (TM) with different DTBs.
>
> 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,
> replaced with a runtime-defined virtual base address for the
> peripherals).
>
> If you believe that's what I should do, say it and stop reading :-)
>
Yes. Different tiles are fundamentally different boards, so they should
have different DTs. Using includes should help minimize duplication though.
Think about it this way. How would you solve this without DT? You would
have a bunch of duplicated data in the kernel for the different configs.
So you're not any worse off in this regard and still have the other
advantages of DT.
> To my mind it looked like the whole mechanism was not flexible enough,
> so I wanted to explore other options...
>
> The obvious one was to describe the required static mapping in the DTS.
> I don't like this idea, though. It can hardly be called "hardware
> description". Besides, what node would carry such data? "chosen"?
> Hardly...
>
> Would it contain a "regs" property with the physical address and
> "virtual-reg" with the virtual one? Again, doesn't sound right to me
> (especially the virtual bit, however the virtual address could be common
> between different variants and be defined in the board support code, not
> the DTS).
>
> I have considered a reference (phandle or an alias?) to the node to be
> mapped ("peripherals" in my case), but where to define this reference?
> Any ideas?
In "chosen" like the kernel command line would be the place, but I don't
think that is the right approach. Chosen is really for things that
change frequently and this doesn't really fall in that category.
>
> There is an additional problem here... The "map_io" is executed before
> the tree is un-flattened, so:
>
> 1. One can't simply use "of_find_matching_node()" (as in the latest l2x0
> patches) to find the interesting nodes - the only way of going through
> the tree is raw of_scan_flat_dt() function. Therefore any conditions
> more complex then string comparison with the (full) node name are
> problematic.
>
> 2. The tree mappings (ranges) are not resolved yet, so one can't simply
> get the effective address of a node. Only "raw" properties are
> available, so all one can get scanning for "peripherals@7" node is "0 7
> 0 0x20000" array, instead of the "0x10000000 0x00020000" that is really
> important.
>
If you add a compatible field to "motherboard" node, then you can read
the ranges.
> Initially I wanted to find the mentioned devices and create individual
> mappings for them, so the MMIO_P2V would be still valid (if slightly
> "abused"), but I failed due to the problems mentioned above. And I can't
> delay this operation till the tree is un-flattened, as the core tile
> must be probed (via sysreg) in map_io (tile's specific code must be able
> to create its own mappings):
Do you really need MMIO_P2V? If you have fixed virtual addresses in the
kernel and can pull the phys addresses from DT to populate the iotable,
is that sufficient?
>
> static void __init v2m_map_io(void)
> {
> iotable_init(v2m_io_desc, ARRAY_SIZE(v2m_io_desc));
> v2m_populate_ct_desc();
> ct_desc->map_io();
> }
>
> Any comments, ideas and suggestions how to tackle this situation are
> more than welcome.
>
Generally, the trend is to get rid of static mappings as much as
possible. Doing that first might simplify things.
Rob
> Cheers!
>
> Paweł
>
>
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
_______________________________________________
devicetree-discuss mailing list
devicetree-discuss@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/devicetree-discuss
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: DT vs ARM static mappings
2011-09-20 12:58 ` Rob Herring
@ 2011-09-20 14:02 ` Pawel Moll
[not found] ` <1316527365.4611.354.camel-okZbbLrgpR/YkXV2EHHjLW3o5bpOHsLO@public.gmane.org>
0 siblings, 1 reply; 16+ messages in thread
From: Pawel Moll @ 2011-09-20 14:02 UTC (permalink / raw)
To: Rob Herring
Cc: devicetree-discuss@lists.ozlabs.org,
linux-arm-kernel@lists.infradead.org
> > 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,
> > replaced with a runtime-defined virtual base address for the
> > peripherals).
> >
> > If you believe that's what I should do, say it and stop reading :-)
>
> Yes. Different tiles are fundamentally different boards, so they should
> have different DTs. Using includes should help minimize duplication though.
You've misunderstood me or (most likely ;-) probably I wasn't clear
enough.
There is no doubt the DTs will be different across the "portfolio".
We already have (patches soon) vexpress-v2p-ca9.dts that includes
vexpress-v2m-legacy.dtsi.
A5 will be vexpress-v2p-ca5p.dts+vexpress-v2m-rs1.dtsi, A15
vexpress-v2p-ca15.dts+vexpress-v2m-rs1.dtsi (notice that the A5/A15 are
sharing the v2m bit, as the motherboard is common).
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.
> Think about it this way. How would you solve this without DT? You
> would have a bunch of duplicated data in the kernel for the different
> configs. So you're not any worse off in this regard and still have the
> other advantages of DT.
Exactly my point :-) I want to have as little duplication as possible.
And the static mapping issue is in the way.
> > To my mind it looked like the whole mechanism was not flexible enough,
> > so I wanted to explore other options...
> >
> > The obvious one was to describe the required static mapping in the DTS.
> > I don't like this idea, though. It can hardly be called "hardware
> > description". Besides, what node would carry such data? "chosen"?
> > Hardly...
> >
> > Would it contain a "regs" property with the physical address and
> > "virtual-reg" with the virtual one? Again, doesn't sound right to me
> > (especially the virtual bit, however the virtual address could be common
> > between different variants and be defined in the board support code, not
> > the DTS).
> >
> > I have considered a reference (phandle or an alias?) to the node to be
> > mapped ("peripherals" in my case), but where to define this reference?
> > Any ideas?
>
> In "chosen" like the kernel command line would be the place, but I don't
> think that is the right approach. Chosen is really for things that
> change frequently and this doesn't really fall in that category.
Again, no argument from me here :-)
The question is - where should it be?
> > There is an additional problem here... The "map_io" is executed before
> > the tree is un-flattened, so:
> >
> > 1. One can't simply use "of_find_matching_node()" (as in the latest l2x0
> > patches) to find the interesting nodes - the only way of going through
> > the tree is raw of_scan_flat_dt() function. Therefore any conditions
> > more complex then string comparison with the (full) node name are
> > problematic.
> >
> > 2. The tree mappings (ranges) are not resolved yet, so one can't simply
> > get the effective address of a node. Only "raw" properties are
> > available, so all one can get scanning for "peripherals@7" node is "0 7
> > 0 0x20000" array, instead of the "0x10000000 0x00020000" that is really
> > important.
>
> If you add a compatible field to "motherboard" node, then you can read
> the ranges.
... and then and then scan for the sysregs, and add the offset and base
together... Sounds to me like duplication of the of_translate_*()?
> > Initially I wanted to find the mentioned devices and create individual
> > mappings for them, so the MMIO_P2V would be still valid (if slightly
> > "abused"), but I failed due to the problems mentioned above. And I can't
> > delay this operation till the tree is un-flattened, as the core tile
> > must be probed (via sysreg) in map_io (tile's specific code must be able
> > to create its own mappings):
>
> Do you really need MMIO_P2V? If you have fixed virtual addresses in the
> kernel and can pull the phys addresses from DT to populate the iotable,
> is that sufficient?
For the third time, 100% agree :-) Well, 90%.
What I need is:
1. Get the phys address from DT. But how? This is getting as back to my
complaints about still-flat tree and ranges, the node to be used to
describe the mapping.
2. The offset inside the mapping will be different (for sysregs it will
be 0 for old mapping, 0x10000 for the new one), so I have to work it out
from the tree as well. And as we are in map_io, the tree is still flat
and... read 1 :-)
> Generally, the trend is to get rid of static mappings as much as
> possible. Doing that first might simplify things.
You can't do ioremap() before kmalloc() is up and running (correct me if
I am wrong), at least you can't do this in map_io. So the static mapping
is a must sometimes. And actually, with the latest Nico's changes:
http://thread.gmane.org/gmane.linux.ports.arm.kernel/132762
it may even be preferred for peripherals (one mapping shared across all
users).
Cheers!
Paweł
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: DT vs ARM static mappings
[not found] ` <1316527365.4611.354.camel-okZbbLrgpR/YkXV2EHHjLW3o5bpOHsLO@public.gmane.org>
@ 2011-09-20 14:37 ` Rob Herring
2011-09-20 16:16 ` Pawel Moll
0 siblings, 1 reply; 16+ messages in thread
From: Rob Herring @ 2011-09-20 14:37 UTC (permalink / raw)
To: Pawel Moll
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
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_desc (the MMIO_P2V macro must die of course,
>>> replaced with a runtime-defined virtual base address for the
>>> peripherals).
>>>
>>> If you believe that's what I should do, say it and stop reading :-)
>>
>> Yes. Different tiles are fundamentally different boards, so they should
>> have different DTs. Using includes should help minimize duplication though.
>
> You've misunderstood me or (most likely ;-) probably I wasn't clear
> enough.
>
> There is no doubt the DTs will be different across the "portfolio".
>
> We already have (patches soon) vexpress-v2p-ca9.dts that includes
> vexpress-v2m-legacy.dtsi.
>
> A5 will be vexpress-v2p-ca5p.dts+vexpress-v2m-rs1.dtsi, A15
> vexpress-v2p-ca15.dts+vexpress-v2m-rs1.dtsi (notice that the A5/A15 are
> sharing the v2m bit, as the motherboard is common).
>
> 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,vexpress is too
generic. You can and should have a list of compatible strings for each
board/machine.
>> Think about it this way. How would you solve this without DT? You
>> would have a bunch of duplicated data in the kernel for the different
>> configs. So you're not any worse off in this regard and still have the
>> other advantages of DT.
>
> Exactly my point :-) I want to have as little duplication as possible.
> And the static mapping issue is in the way.
>
>>> To my mind it looked like the whole mechanism was not flexible enough,
>>> so I wanted to explore other options...
>>>
>>> The obvious one was to describe the required static mapping in the DTS.
>>> I don't like this idea, though. It can hardly be called "hardware
>>> description". Besides, what node would carry such data? "chosen"?
>>> Hardly...
>>>
>>> Would it contain a "regs" property with the physical address and
>>> "virtual-reg" with the virtual one? Again, doesn't sound right to me
>>> (especially the virtual bit, however the virtual address could be common
>>> between different variants and be defined in the board support code, not
>>> the DTS).
>>>
>>> I have considered a reference (phandle or an alias?) to the node to be
>>> mapped ("peripherals" in my case), but where to define this reference?
>>> Any ideas?
>>
>> In "chosen" like the kernel command line would be the place, but I don't
>> think that is the right approach. Chosen is really for things that
>> change frequently and this doesn't really fall in that category.
>
> Again, no argument from me here :-)
>
> The question is - where should it be?
>
Nowhere. It's an OS specific issue, not a h/w issue.
>>> There is an additional problem here... The "map_io" is executed before
>>> the tree is un-flattened, so:
>>>
>>> 1. One can't simply use "of_find_matching_node()" (as in the latest l2x0
>>> patches) to find the interesting nodes - the only way of going through
>>> the tree is raw of_scan_flat_dt() function. Therefore any conditions
>>> more complex then string comparison with the (full) node name are
>>> problematic.
>>>
>>> 2. The tree mappings (ranges) are not resolved yet, so one can't simply
>>> get the effective address of a node. Only "raw" properties are
>>> available, so all one can get scanning for "peripherals@7" node is "0 7
>>> 0 0x20000" array, instead of the "0x10000000 0x00020000" that is really
>>> important.
>>
>> If you add a compatible field to "motherboard" node, then you can read
>> the ranges.
>
> ... and then and then scan for the sysregs, and add the offset and base
> together... Sounds to me like duplication of the of_translate_*()?
>
>>> Initially I wanted to find the mentioned devices and create individual
>>> mappings for them, so the MMIO_P2V would be still valid (if slightly
>>> "abused"), but I failed due to the problems mentioned above. And I can't
>>> delay this operation till the tree is un-flattened, as the core tile
>>> must be probed (via sysreg) in map_io (tile's specific code must be able
>>> to create its own mappings):
>>
>> Do you really need MMIO_P2V? If you have fixed virtual addresses in the
>> kernel and can pull the phys addresses from DT to populate the iotable,
>> is that sufficient?
>
> For the third time, 100% agree :-) Well, 90%.
>
> What I need is:
>
> 1. Get the phys address from DT. But how? This is getting as back to my
> complaints about still-flat tree and ranges, the node to be used to
> describe the mapping.
>
> 2. The offset inside the mapping will be different (for sysregs it will
> be 0 for old mapping, 0x10000 for the new one), so I have to work it out
> from the tree as well. And as we are in map_io, the tree is still flat
> and... read 1 :-)
So create a mapping per peripheral rather than per chip select. Then the
virtual address can always be the same.
>
>> Generally, the trend is to get rid of static mappings as much as
>> possible. Doing that first might simplify things.
>
> You can't do ioremap() before kmalloc() is up and running (correct me if
> I am wrong), at least you can't do this in map_io. So the static mapping
> is a must sometimes. And actually, with the latest Nico's changes:
>
Correct. You can't do ioremap until init_irq. map_io and init_early are
too early. My point was if you can delay h/w access then you can remove
the static mappings. But yes, we generally can't remove them all. SCU
and LL debug uart are 2 examples.
For the short term, I would just have 2 static iotables and select the
right one based on the board's (or motherboard's) compatible string.
Long term, we should look into implementing a common early DT address
parsing function.
Rob
> http://thread.gmane.org/gmane.linux.ports.arm.kernel/132762
>
> it may even be preferred for peripherals (one mapping shared across all
> users).
>
> Cheers!
>
> Paweł
>
>
_______________________________________________
devicetree-discuss mailing list
devicetree-discuss@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/devicetree-discuss
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: DT vs ARM static mappings
2011-09-20 14:37 ` Rob Herring
@ 2011-09-20 16:16 ` Pawel Moll
[not found] ` <1316535403.4611.534.camel-okZbbLrgpR/YkXV2EHHjLW3o5bpOHsLO@public.gmane.org>
0 siblings, 1 reply; 16+ messages in thread
From: Pawel Moll @ 2011-09-20 16:16 UTC (permalink / raw)
To: Rob Herring
Cc: devicetree-discuss@lists.ozlabs.org,
linux-arm-kernel@lists.infradead.org
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,vexpress is too
> generic. You can and should have a list of compatible strings for each
> board/machine.
Our DTS has:
compatible = "arm,vexpress-v2p-ca9", "arm,vexpress";
and v2m.c:
static const char *v2m_dt_match[] __initconst = {
"arm,vexpress",
NULL,
};
DT_MACHINE_START(VEXPRESS_DT, "ARM Versatile Express")
.map_io = v2m_map_io,
.init_early = v2m_init_early,
.init_irq = v2m_init_irq,
.timer = &v2m_timer,
.init_machine = v2m_dt_init,
.dt_compat = v2m_dt_match,
MACHINE_END
Isn't it what you meant?
Essentially I see two ways of doing what we are discussing:
1. Two DT_MACHINE_START, one matching "arm,vexpress-legacy" with map_io
= v2m_map_io_legacy and second matching "arm,vexpress-rs1" with map_io =
v2m_map_io_rs1,
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(node, "arm,vexpress-legacy"))
iotable_init(v2m_io_desc_legacy);
else (of_flat_dt_is_compatible(node, "arm,vexpress-rs1"))
iotable_init(v2m_io_desc_rs1);
else
panic();
}
Neither of them seem particularly appealing... ;-)
> >> In "chosen" like the kernel command line would be the place, but I don't
> >> think that is the right approach. Chosen is really for things that
> >> change frequently and this doesn't really fall in that category.
> >
> > Again, no argument from me here :-)
> >
> > The question is - where should it be?
>
> Nowhere. It's an OS specific issue, not a h/w issue.
That's exactly why I didn't like this idea in the first place. This
doesn't change the fact that current infrastructure isn't really helpful
here.
> So create a mapping per peripheral rather than per chip select. Then the
> virtual address can always be the same.
As I said (see below) this is exactly what I wanted to do, but I was
defeated by the reality :-)
On Tue, 2011-09-20 at 12:51 +0100, Pawel Moll wrote:
> > > Initially I wanted to find the mentioned devices and create individual
> > > mappings for them, so the MMIO_P2V would be still valid (if slightly
> > > "abused"), but I failed due to the problems mentioned above. And I can't
> > > delay this operation till the tree is un-flattened, as the core tile
> > > must be probed (via sysreg) in map_io (tile's specific code must be able
> > > to create its own mappings):
> >> Generally, the trend is to get rid of static mappings as much as
> >> possible. Doing that first might simplify things.
> >
> > You can't do ioremap() before kmalloc() is up and running (correct me if
> > I am wrong), at least you can't do this in map_io. So the static mapping
> > is a must sometimes. And actually, with the latest Nico's changes:
> >
> Correct. You can't do ioremap until init_irq. map_io and init_early are
> too early. My point was if you can delay h/w access then you can remove
> the static mappings. But yes, we generally can't remove them all. SCU
> and LL debug uart are 2 examples.
In my case it's sysreg and sysctl. There are two more users of static
mappings: timer01 and timer23, but they could at some point do ioremap()
on their own (especially with Nico's changes).
> For the short term, I would just have 2 static iotables and select the
> right one based on the board's (or motherboard's) compatible string.
Yes, as mentioned above. This doesn't help with the sysreg offset
problem though. I may just scan the flat tree looking for their
particular names and getting raw offset from their regs... Sounds like a
hack, though.
> Long term, we should look into implementing a common early DT address
> parsing function.
Well, assuming that we want to have them at all. I'm not convinced,
frankly ;-)
Paweł
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: DT vs ARM static mappings
[not found] ` <1316535403.4611.534.camel-okZbbLrgpR/YkXV2EHHjLW3o5bpOHsLO@public.gmane.org>
@ 2011-09-20 19:28 ` Arnd Bergmann
2011-09-21 9:41 ` Pawel Moll
2011-09-22 16:23 ` Pawel Moll
0 siblings, 2 replies; 16+ messages in thread
From: Arnd Bergmann @ 2011-09-20 19:28 UTC (permalink / raw)
To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
Pawel Moll
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 mapping.
> >
> > Yes, you should have 1 DT_MACHINE_START, but arm,vexpress is too
> > generic. You can and should have a list of compatible strings for each
> > board/machine.
>
> Our DTS has:
>
> compatible = "arm,vexpress-v2p-ca9", "arm,vexpress";
>
> and v2m.c:
>
> static const char *v2m_dt_match[] __initconst = {
> "arm,vexpress",
> NULL,
> };
>
> DT_MACHINE_START(VEXPRESS_DT, "ARM Versatile Express")
> .map_io = v2m_map_io,
> .init_early = v2m_init_early,
> .init_irq = v2m_init_irq,
> .timer = &v2m_timer,
> .init_machine = v2m_dt_init,
> .dt_compat = v2m_dt_match,
> MACHINE_END
>
> Isn't it what you meant?
>
> Essentially I see two ways of doing what we are discussing:
>
> 1. Two DT_MACHINE_START, one matching "arm,vexpress-legacy" with map_io
> = v2m_map_io_legacy and second matching "arm,vexpress-rs1" with map_io =
> v2m_map_io_rs1,
>
> 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(node, "arm,vexpress-legacy"))
> iotable_init(v2m_io_desc_legacy);
> else (of_flat_dt_is_compatible(node, "arm,vexpress-rs1"))
> iotable_init(v2m_io_desc_rs1);
> else
> panic();
> }
>
> Neither of them seem particularly appealing... ;-)
But I think both ways would be acceptable in the end. It's not a lot
of extra code either way. In the second case, I would probably have
the legacy case as a special variant of the map_io function and have
all others be the default instead of falling back to panic though.
> > >> In "chosen" like the kernel command line would be the place, but I don't
> > >> think that is the right approach. Chosen is really for things that
> > >> change frequently and this doesn't really fall in that category.
> > >
> > > Again, no argument from me here :-)
> > >
> > > The question is - where should it be?
> >
> > Nowhere. It's an OS specific issue, not a h/w issue.
>
> That's exactly why I didn't like this idea in the first place. This
> doesn't change the fact that current infrastructure isn't really helpful
> here.
Agreed, I think that approach would be much worse.
> > >> Generally, the trend is to get rid of static mappings as much as
> > >> possible. Doing that first might simplify things.
> > >
> > > You can't do ioremap() before kmalloc() is up and running (correct me if
> > > I am wrong), at least you can't do this in map_io. So the static mapping
> > > is a must sometimes. And actually, with the latest Nico's changes:
> > >
> > Correct. You can't do ioremap until init_irq. map_io and init_early are
> > too early. My point was if you can delay h/w access then you can remove
> > the static mappings. But yes, we generally can't remove them all. SCU
> > and LL debug uart are 2 examples.
>
> In my case it's sysreg and sysctl. There are two more users of static
> mappings: timer01 and timer23, but they could at some point do ioremap()
> on their own (especially with Nico's changes).
Well, I think with Nico's cahnges, you /can/ actually do ioremap for
areas that have been mapped through the iotable before kmalloc is up.
IIRC, omap does this for a number of peripherals.
It's a bit of a hack, but I think it's much better than taking hardcoded
addresses.
> > For the short term, I would just have 2 static iotables and select the
> > right one based on the board's (or motherboard's) compatible string.
>
> Yes, as mentioned above. This doesn't help with the sysreg offset
> problem though. I may just scan the flat tree looking for their
> particular names and getting raw offset from their regs... Sounds like a
> hack, though.
With the combination of the points mentioned above, you should be
able to do:
- 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.
Do you think that would work?
Arnd
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: DT vs ARM static mappings
2011-09-20 19:28 ` Arnd Bergmann
@ 2011-09-21 9:41 ` Pawel Moll
[not found] ` <1316598109.4611.613.camel-okZbbLrgpR/YkXV2EHHjLW3o5bpOHsLO@public.gmane.org>
2011-09-22 16:23 ` Pawel Moll
1 sibling, 1 reply; 16+ messages in thread
From: Pawel Moll @ 2011-09-21 9:41 UTC (permalink / raw)
To: Arnd Bergmann
Cc: devicetree-discuss@lists.ozlabs.org,
linux-arm-kernel@lists.infradead.org
> > 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(node, "arm,vexpress-legacy"))
> > iotable_init(v2m_io_desc_legacy);
> > else (of_flat_dt_is_compatible(node, "arm,vexpress-rs1"))
> > iotable_init(v2m_io_desc_rs1);
> > else
> > panic();
> > }
> >
> > Neither of them seem particularly appealing... ;-)
>
> But I think both ways would be acceptable in the end. It's not a lot
> of extra code either way. In the second case, I would probably have
> the legacy case as a special variant of the map_io function and have
> all others be the default instead of falling back to panic though.
Ok, I'll go (roughly) that way.
> > In my case it's sysreg and sysctl. There are two more users of static
> > mappings: timer01 and timer23, but they could at some point do ioremap()
> > on their own (especially with Nico's changes).
>
> Well, I think with Nico's cahnges, you /can/ actually do ioremap for
> areas that have been mapped through the iotable before kmalloc is up.
> IIRC, omap does this for a number of peripherals.
>
> It's a bit of a hack, but I think it's much better than taking hardcoded
> addresses.
Yes, I was thinking about that last night. If you think it's acceptable
I'll do this (killing MMIO_P2V on the way ;-)
> With the combination of the points mentioned above, you should be
> able to do:
>
> - 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.
>
> Do you think that would work?
Yes, I suppose so. The last bit (getting the offset from DT) will be a
little ugly, I think, but let's wait till I get some code done.
Cheers!
Paweł
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: DT vs ARM static mappings
[not found] ` <1316598109.4611.613.camel-okZbbLrgpR/YkXV2EHHjLW3o5bpOHsLO@public.gmane.org>
@ 2011-09-21 9:59 ` Dave Martin
2011-09-21 10:02 ` Pawel Moll
0 siblings, 1 reply; 16+ messages in thread
From: Dave Martin @ 2011-09-21 9:59 UTC (permalink / raw)
To: Pawel Moll
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
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 (depth != 0)
> > > return 0;
> > > if (of_flat_dt_is_compatible(node, "arm,vexpress-legacy"))
> > > iotable_init(v2m_io_desc_legacy);
> > > else (of_flat_dt_is_compatible(node, "arm,vexpress-rs1"))
> > > iotable_init(v2m_io_desc_rs1);
> > > else
> > > panic();
> > > }
> > >
> > > Neither of them seem particularly appealing... ;-)
> >
> > But I think both ways would be acceptable in the end. It's not a lot
> > of extra code either way. In the second case, I would probably have
> > the legacy case as a special variant of the map_io function and have
> > all others be the default instead of falling back to panic though.
>
> Ok, I'll go (roughly) that way.
>
> > > In my case it's sysreg and sysctl. There are two more users of static
> > > mappings: timer01 and timer23, but they could at some point do ioremap()
> > > on their own (especially with Nico's changes).
> >
> > Well, I think with Nico's cahnges, you /can/ actually do ioremap for
> > areas that have been mapped through the iotable before kmalloc is up.
> > IIRC, omap does this for a number of peripherals.
> >
> > It's a bit of a hack, but I think it's much better than taking hardcoded
> > addresses.
>
> Yes, I was thinking about that last night. If you think it's acceptable
> I'll do this (killing MMIO_P2V on the way ;-)
>
> > With the combination of the points mentioned above, you should be
> > able to do:
> >
> > - 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.
> >
> > Do you think that would work?
>
> Yes, I suppose so. The last bit (getting the offset from DT) will be a
> little ugly, I think, but let's wait till I get some code done.
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.
Cheers
---Dave
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: DT vs ARM static mappings
2011-09-21 9:59 ` Dave Martin
@ 2011-09-21 10:02 ` Pawel Moll
0 siblings, 0 replies; 16+ messages in thread
From: Pawel Moll @ 2011-09-21 10:02 UTC (permalink / raw)
To: Dave Martin
Cc: devicetree-discuss@lists.ozlabs.org,
linux-arm-kernel@lists.infradead.org, Arnd Bergmann
> 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.
Sure thing - I'll work on top of your patch.
Paweł
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: DT vs ARM static mappings
[not found] ` <1316519479.4611.150.camel-okZbbLrgpR/YkXV2EHHjLW3o5bpOHsLO@public.gmane.org>
2011-09-20 12:58 ` Rob Herring
@ 2011-09-21 17:49 ` Nicolas Pitre
2011-09-22 13:04 ` Pawel Moll
1 sibling, 1 reply; 16+ messages in thread
From: Nicolas Pitre @ 2011-09-21 17:49 UTC (permalink / raw)
To: Pawel Moll
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
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 stuff there, like clocking/GPIOs/UARTs
> initialization, hardware probing etc.
No, most of them don't. Maybe a few cases do for historical reasons,
but there are other hooks now to link probing and initialization code
to.
The static mappings should be just that: static. Most things should be
dynamically mapped instead. With the series I'm working on, everybody
will get the benefit of a static mapping when one is available even if
the dynamic mapping interface like ioremap() is used. So having a bunch
of static mappings is not bad, especially if they are easy. But you
should defer as much hardware probing as possible after the memory is
initialized and the standard interfaces are available, keeping reliance
on direct access to static mappings as small as possible.
> Now the Versatile Express platform: it consists of a motherboard with a
> set of peripherals and a processor daughterboard (core tile), both
> connected via a static memory bus, which is mapped into processor's
> physical address space. The motherboard can be shared between different
> types of the tiles (eg. A9, A5, A15 etc.). The present one is probed byt
> he motherboard firmware and exposed in "system registers".
>
> Everything is fine so far. The interesting part starts here:
>
> http://infocenter.arm.com/help/topic/com.arm.doc.dui0447e/CACIHGFE.html
>
> In brief, depending on the configuration, the system can have one of
> two, totally different, memory maps (please, do spare me the "but why
> did they do that" comments - not my idea nor decision, I just have to
> live with this ;-), depending on the core tile being used.
>
> In result, the static mapping as defined currently in
> arch/arm/mach-vexpress/v2m.c for A9 variant:
>
> #define V2M_PA_CS7 0x10000000
>
> static struct map_desc v2m_io_desc[] __initdata = {
> {
> .virtual = __MMIO_P2V(V2M_PA_CS7),
> .pfn = __phys_to_pfn(V2M_PA_CS7),
> .length = SZ_128K,
> .type = MT_DEVICE,
> },
> };
>
> is no longer valid for A5/A15. It would rather look like this:
>
> #define V2M_PA_CS3 0x1c000000
>
> static struct map_desc v2m_io_desc[] __initdata = {
> {
> .virtual = __MMIO_P2V(V2M_PA_CS3),
> .pfn = __phys_to_pfn(V2M_PA_CS3),
> .length = SZ_2M,
> .type = MT_DEVICE,
> },
> };
>
> Not only the peripherals base address is changed but also "internal"
> alignment, thus offsets to peripherals. Some of them are not being
> ioremap()ed, but directly used via the static mapping and MMIO_P2V macro
> (like "readl(MMIO_P2V(V2M_SYS_PROCID0))" in v2m_populate_ct_desc(void)
> function). For example, these two:
>
> #define V2M_SYSREGS (V2M_PA_CS7 + 0x00000000)
> #define V2M_SYSCTL (V2M_PA_CS7 + 0x00001000)
>
> would have to become:
>
> #define V2M_SYSREGS (V2M_PA_CS3 + 0x00010000)
> #define V2M_SYSCTL (V2M_PA_CS3 + 0x00020000)
Your best bet would probably consist of keeping the virtual address
constant while the physical address is variable. Adjusting the .pfn
field in the v2m_io_desc table right before calling iotable_init()
should be fine. Alternatively you could have two such tables and select
the right one at run time. The io_p2v macro doesn't make any sense
anymore in that context so it should be eliminated, and keeping only a
minimum set of fixed virtual addresses for the peripherals that can't
wait until ioremap is available should be fine.
Of course you should use the largest alignment for the same peripheral
mapping.
[...]
> To my mind it looked like the whole mechanism was not flexible enough,
> so I wanted to explore other options...
>
> The obvious one was to describe the required static mapping in the DTS.
> I don't like this idea, though. It can hardly be called "hardware
> description". Besides, what node would carry such data? "chosen"?
> Hardly...
>
> Would it contain a "regs" property with the physical address and
> "virtual-reg" with the virtual one? Again, doesn't sound right to me
> (especially the virtual bit, however the virtual address could be common
> between different variants and be defined in the board support code, not
> the DTS).
That's what I'm suggesting: keep the virtual addresses constant, and
adjust the static mapping's physical address accordingly. But never
should virtual addresses be part of DT as this is just an implementation
detail.
And if static mappings are a problem, then try to live without them as
much as possible. Again there is no reason you should be doing too much
hardware probing at .map_io time.
Nicolas
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: DT vs ARM static mappings
2011-09-21 17:49 ` Nicolas Pitre
@ 2011-09-22 13:04 ` Pawel Moll
[not found] ` <1316696696.4611.844.camel-okZbbLrgpR/YkXV2EHHjLW3o5bpOHsLO@public.gmane.org>
0 siblings, 1 reply; 16+ messages in thread
From: Pawel Moll @ 2011-09-22 13:04 UTC (permalink / raw)
To: Nicolas Pitre
Cc: devicetree-discuss@lists.ozlabs.org,
linux-arm-kernel@lists.infradead.org
> > 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/UARTs
> > initialization, hardware probing etc.
>
> No, most of them don't. Maybe a few cases do for historical reasons,
> but there are other hooks now to link probing and initialization code
> to.
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.
Never mind - I'll rephrase myself to "many" instead of "most" :-)
> The static mappings should be just that: static. Most things should be
> dynamically mapped instead. With the series I'm working on, everybody
> will get the benefit of a static mapping when one is available even if
> the dynamic mapping interface like ioremap() is used. So having a bunch
> of static mappings is not bad, especially if they are easy. But you
> should defer as much hardware probing as possible after the memory is
> initialized and the standard interfaces are available, keeping reliance
> on direct access to static mappings as small as possible.
You won't get any argument from me here - my task would be easier
without the additional things happening in map_io...
> Your best bet would probably consist of keeping the virtual address
> constant while the physical address is variable. Adjusting the .pfn
> field in the v2m_io_desc table right before calling iotable_init()
> should be fine. Alternatively you could have two such tables and select
> the right one at run time. The io_p2v macro doesn't make any sense
> anymore in that context so it should be eliminated, and keeping only a
> minimum set of fixed virtual addresses for the peripherals that can't
> wait until ioremap is available should be fine.
Yep, that's (roughly) what my code is doing now. There is some hackery
involved (manual operations on pointers) that will disappear with your
changes.
And MMIO_P2V macro is dying - motherboard code is not using it any more,
the tile code will stop using it next week.
> And if static mappings are a problem, then try to live without them as
> much as possible. Again there is no reason you should be doing too much
> hardware probing at .map_io time.
Current implementation is doing very little (just probing tile ID and
calling tile's private map_io) but it's enough to be a pain in the neck.
Anyway, patch (on top of Dave's initial support) to follow soon.
Cheers!
Paweł
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: DT vs ARM static mappings
[not found] ` <1316696696.4611.844.camel-okZbbLrgpR/YkXV2EHHjLW3o5bpOHsLO@public.gmane.org>
@ 2011-09-22 13:13 ` Russell King - ARM Linux
2011-09-22 13:45 ` Pawel Moll
0 siblings, 1 reply; 16+ messages in thread
From: Russell King - ARM Linux @ 2011-09-22 13:13 UTC (permalink / raw)
To: Pawel Moll
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
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
> > > the platforms are doing much more stuff there, like clocking/GPIOs/UARTs
> > > initialization, hardware probing etc.
> >
> > No, most of them don't. Maybe a few cases do for historical reasons,
> > but there are other hooks now to link probing and initialization code
> > to.
>
> 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 where platforms make run-time
decisions about what to map based on some register value somewhere
(eg, Assabet vs Assabet+Neponset).
I do have a large patch series floating around in my git tree which tries
to clean up to all those map_io functions - the biggest stumbling block
to them is the Samsung stuff being indirected through its own tables.
Of course, with all the changes to .boot_params etc, the patches no longer
apply to current kernels.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: DT vs ARM static mappings
2011-09-22 13:13 ` Russell King - ARM Linux
@ 2011-09-22 13:45 ` Pawel Moll
[not found] ` <1316699153.4611.858.camel-okZbbLrgpR/YkXV2EHHjLW3o5bpOHsLO@public.gmane.org>
0 siblings, 1 reply; 16+ messages in thread
From: Pawel Moll @ 2011-09-22 13:45 UTC (permalink / raw)
To: Russell King - ARM Linux
Cc: devicetree-discuss@lists.ozlabs.org,
linux-arm-kernel@lists.infradead.org, Nicolas Pitre
> > 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 where platforms make run-time
> decisions about what to map based on some register value somewhere
> (eg, Assabet vs Assabet+Neponset).
>
> I do have a large patch series floating around in my git tree which tries
> to clean up to all those map_io functions - the biggest stumbling block
> to them is the Samsung stuff being indirected through its own tables.
Awesome. I'll work with an assumption that future map_io-s will only
create static mappings and nothing more then.
Cheers!
Paweł
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: DT vs ARM static mappings
[not found] ` <1316699153.4611.858.camel-okZbbLrgpR/YkXV2EHHjLW3o5bpOHsLO@public.gmane.org>
@ 2011-09-22 13:59 ` Russell King - ARM Linux
0 siblings, 0 replies; 16+ messages in thread
From: Russell King - ARM Linux @ 2011-09-22 13:59 UTC (permalink / raw)
To: Pawel Moll
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
On Thu, Sep 22, 2011 at 02:45:53PM +0100, Pawel Moll wrote:
> > > 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 where platforms make run-time
> > decisions about what to map based on some register value somewhere
> > (eg, Assabet vs Assabet+Neponset).
> >
> > I do have a large patch series floating around in my git tree which tries
> > to clean up to all those map_io functions - the biggest stumbling block
> > to them is the Samsung stuff being indirected through its own tables.
>
> Awesome. I'll work with an assumption that future map_io-s will only
> create static mappings and nothing more then.
That would be preferable, so people have some motivation to clean up after
themselves. Here's how the patch looked quite a while ago - it probably
no longer applies to modern kernels without severely breaking them:
arch/arm/include/asm/mach/arch.h | 3 +--
arch/arm/kernel/setup.c | 2 +-
arch/arm/mach-bcmring/arch.c | 4 ++--
arch/arm/mach-clps711x/clep7312.c | 3 +--
arch/arm/mach-clps711x/edb7211-arch.c | 3 +--
arch/arm/mach-clps711x/fortunet.c | 3 +--
arch/arm/mach-clps711x/p720t.c | 3 +--
arch/arm/mach-cns3xxx/cns3420vb.c | 4 ++++
arch/arm/mach-exynos4/cpu.c | 3 +++
arch/arm/mach-exynos4/mach-smdkc210.c | 6 ++++++
arch/arm/mach-exynos4/mach-smdkv310.c | 6 ++++++
arch/arm/mach-exynos4/mach-universal_c210.c | 5 +++++
| 3 +--
| 3 +--
arch/arm/mach-ixp2000/core.c | 3 +++
arch/arm/mach-ixp2000/enp2611.c | 1 +
arch/arm/mach-ixp2000/include/mach/platform.h | 1 +
arch/arm/mach-ixp2000/ixdp2400.c | 1 +
arch/arm/mach-ixp2000/ixdp2800.c | 1 +
arch/arm/mach-ixp2000/ixdp2x01.c | 3 +++
arch/arm/mach-ks8695/board-acs5k.c | 1 +
arch/arm/mach-ks8695/board-dsm320.c | 1 +
arch/arm/mach-ks8695/board-micrel.c | 1 +
arch/arm/mach-ks8695/cpu.c | 3 +++
arch/arm/mach-ks8695/generic.h | 1 +
arch/arm/mach-mmp/aspenite.c | 6 ++++--
arch/arm/mach-mmp/avengers_lite.c | 1 +
arch/arm/mach-mmp/common.c | 3 +++
arch/arm/mach-mmp/common.h | 1 +
arch/arm/mach-mmp/flint.c | 3 ++-
arch/arm/mach-mmp/jasper.c | 3 ++-
arch/arm/mach-mmp/tavorevb.c | 1 +
arch/arm/mach-mmp/teton_bga.c | 3 ++-
arch/arm/mach-mmp/ttc_dkb.c | 3 ++-
arch/arm/mach-msm/board-halibut.c | 10 +++++-----
arch/arm/mach-msm/board-mahimahi.c | 10 +++++-----
arch/arm/mach-msm/board-msm7x27.c | 15 +++++++++------
arch/arm/mach-msm/board-msm7x30.c | 12 +++++++-----
arch/arm/mach-msm/board-qsd8x50.c | 9 +++++----
arch/arm/mach-msm/board-sapphire.c | 9 +++++++--
arch/arm/mach-msm/board-trout.c | 8 ++++++--
arch/arm/mach-nuc93x/mach-nuc932evb.c | 6 +++---
arch/arm/mach-orion5x/common.c | 4 ++--
arch/arm/mach-orion5x/common.h | 4 +---
arch/arm/mach-pxa/cm-x2xx.c | 7 ++++++-
arch/arm/mach-pxa/cm-x300.c | 4 ++--
arch/arm/mach-pxa/corgi.c | 4 ++--
arch/arm/mach-pxa/eseries.c | 3 +--
arch/arm/mach-pxa/eseries.h | 3 +--
arch/arm/mach-pxa/lpd270.c | 6 +++++-
arch/arm/mach-pxa/lubbock.c | 6 +++++-
arch/arm/mach-pxa/mainstone.c | 6 +++++-
arch/arm/mach-pxa/pcm027.c | 7 +++----
arch/arm/mach-pxa/poodle.c | 4 ++--
arch/arm/mach-pxa/spitz.c | 4 ++--
arch/arm/mach-pxa/tosa.c | 4 ++--
arch/arm/mach-pxa/trizeps4.c | 9 +++++++--
arch/arm/mach-pxa/viper.c | 5 ++++-
arch/arm/mach-pxa/zeus.c | 7 +++++--
arch/arm/mach-realview/core.c | 3 +--
arch/arm/mach-realview/core.h | 4 ++--
arch/arm/mach-realview/realview_pb1176.c | 3 +--
arch/arm/mach-realview/realview_pbx.c | 6 +++---
arch/arm/mach-rpc/riscpc.c | 4 ++++
arch/arm/mach-s3c2410/mach-amlm5900.c | 6 ++++++
arch/arm/mach-s3c2410/mach-bast.c | 8 +++++++-
arch/arm/mach-s3c2410/mach-h1940.c | 8 +++++++-
arch/arm/mach-s3c2410/mach-n30.c | 15 +++++++++++----
arch/arm/mach-s3c2410/mach-otom.c | 6 ++++++
arch/arm/mach-s3c2410/mach-qt2410.c | 6 ++++++
arch/arm/mach-s3c2410/mach-smdk2410.c | 6 ++++++
arch/arm/mach-s3c2410/mach-tct_hammer.c | 6 ++++++
arch/arm/mach-s3c2410/mach-vr1000.c | 8 +++++++-
arch/arm/mach-s3c2410/s3c2410.c | 7 +++++--
arch/arm/mach-s3c2412/mach-jive.c | 8 +++++++-
arch/arm/mach-s3c2412/mach-smdk2413.c | 17 ++++++++++++-----
arch/arm/mach-s3c2412/mach-vstms.c | 13 +++++++++----
arch/arm/mach-s3c2412/s3c2412.c | 11 +++++++----
arch/arm/mach-s3c2416/mach-smdk2416.c | 8 +++++++-
arch/arm/mach-s3c2416/s3c2416.c | 7 +++++--
arch/arm/mach-s3c2440/mach-anubis.c | 8 +++++++-
arch/arm/mach-s3c2440/mach-at2440evb.c | 6 ++++++
arch/arm/mach-s3c2440/mach-gta02.c | 6 ++++++
arch/arm/mach-s3c2440/mach-mini2440.c | 8 +++++++-
arch/arm/mach-s3c2440/mach-nexcoder.c | 6 ++++++
arch/arm/mach-s3c2440/mach-osiris.c | 8 +++++++-
arch/arm/mach-s3c2440/mach-rx1950.c | 10 ++++++++--
arch/arm/mach-s3c2440/mach-rx3715.c | 8 +++++++-
arch/arm/mach-s3c2440/mach-smdk2440.c | 8 +++++++-
arch/arm/mach-s3c2440/s3c244x.c | 3 +++
arch/arm/mach-s3c2443/mach-smdk2443.c | 8 +++++++-
arch/arm/mach-s3c64xx/cpu.c | 4 ++--
arch/arm/mach-s3c64xx/include/mach/s3c6400.h | 4 ++--
arch/arm/mach-s3c64xx/include/mach/s3c6410.h | 4 ++--
arch/arm/mach-s3c64xx/mach-anw6410.c | 8 +++++++-
arch/arm/mach-s3c64xx/mach-hmt.c | 8 +++++++-
arch/arm/mach-s3c64xx/mach-mini6410.c | 10 ++++++++--
arch/arm/mach-s3c64xx/mach-ncp.c | 8 +++++++-
arch/arm/mach-s3c64xx/mach-real6410.c | 10 ++++++++--
arch/arm/mach-s3c64xx/mach-smartq.c | 5 +++++
arch/arm/mach-s3c64xx/mach-smartq.h | 1 +
arch/arm/mach-s3c64xx/mach-smartq5.c | 3 ++-
arch/arm/mach-s3c64xx/mach-smartq7.c | 3 ++-
arch/arm/mach-s3c64xx/mach-smdk6400.c | 8 +++++++-
arch/arm/mach-s3c64xx/mach-smdk6410.c | 10 ++++++++--
arch/arm/mach-s3c64xx/s3c6400.c | 2 +-
arch/arm/mach-s3c64xx/s3c6410.c | 2 +-
arch/arm/mach-s5p64x0/cpu.c | 14 ++++++++++----
arch/arm/mach-s5p64x0/mach-smdk6440.c | 8 +++++++-
arch/arm/mach-s5p64x0/mach-smdk6450.c | 8 +++++++-
arch/arm/mach-s5pc100/cpu.c | 3 +++
arch/arm/mach-s5pc100/mach-smdkc100.c | 8 +++++++-
arch/arm/mach-s5pv210/cpu.c | 3 +++
arch/arm/mach-s5pv210/mach-aquila.c | 8 +++++++-
arch/arm/mach-s5pv210/mach-goni.c | 8 +++++++-
arch/arm/mach-s5pv210/mach-smdkc110.c | 8 +++++++-
arch/arm/mach-s5pv210/mach-smdkv210.c | 8 +++++++-
arch/arm/mach-s5pv210/mach-torbreck.c | 8 +++++++-
arch/arm/mach-sa1100/assabet.c | 7 +++++--
arch/arm/mach-sa1100/badge4.c | 4 ++++
arch/arm/mach-sa1100/cerf.c | 4 ++++
arch/arm/mach-sa1100/collie.c | 4 ++++
arch/arm/mach-sa1100/h3100.c | 7 ++++---
arch/arm/mach-sa1100/h3600.c | 8 ++++----
arch/arm/mach-sa1100/h3xxx.c | 3 +++
arch/arm/mach-sa1100/hackkit.c | 6 ++++--
arch/arm/mach-sa1100/include/mach/h3xxx.h | 1 +
arch/arm/mach-sa1100/jornada720.c | 4 ++++
arch/arm/mach-sa1100/lart.c | 4 ++++
arch/arm/mach-sa1100/pleb.c | 7 +++----
arch/arm/mach-sa1100/shannon.c | 7 +++----
arch/arm/mach-sa1100/simpad.c | 4 ++++
arch/arm/mach-shmobile/board-ap4evb.c | 4 ++++
arch/arm/mach-shmobile/board-g3evm.c | 4 ++++
arch/arm/mach-shmobile/board-g4evm.c | 4 ++++
arch/arm/mach-spear3xx/include/mach/generic.h | 1 +
arch/arm/mach-spear3xx/spear300_evb.c | 1 +
arch/arm/mach-spear3xx/spear310_evb.c | 1 +
arch/arm/mach-spear3xx/spear320_evb.c | 1 +
arch/arm/mach-spear3xx/spear3xx.c | 3 +++
arch/arm/mach-spear6xx/include/mach/generic.h | 1 +
arch/arm/mach-spear6xx/spear600_evb.c | 1 +
arch/arm/mach-spear6xx/spear6xx.c | 3 +++
arch/arm/mach-tegra/board-harmony.c | 4 ++--
arch/arm/mach-w90x900/mach-nuc910evb.c | 9 ++-------
arch/arm/mach-w90x900/mach-nuc950evb.c | 9 ++-------
arch/arm/mach-w90x900/mach-nuc960evb.c | 9 ++-------
arch/arm/plat-s3c24xx/cpu.c | 9 +++++++++
arch/arm/plat-s3c24xx/include/plat/s3c2410.h | 3 ++-
arch/arm/plat-s3c24xx/include/plat/s3c2412.h | 3 ++-
arch/arm/plat-s3c24xx/include/plat/s3c2416.h | 3 ++-
arch/arm/plat-s3c24xx/include/plat/s3c244x.h | 3 ++-
arch/arm/plat-s5p/cpu.c | 5 +++++
arch/arm/plat-s5p/include/plat/exynos4.h | 2 ++
arch/arm/plat-s5p/include/plat/s5p6440.h | 2 ++
arch/arm/plat-s5p/include/plat/s5p6450.h | 2 ++
arch/arm/plat-s5p/include/plat/s5pc100.h | 2 ++
arch/arm/plat-s5p/include/plat/s5pv210.h | 2 ++
arch/arm/plat-samsung/include/plat/cpu.h | 2 ++
arch/arm/plat-samsung/init.c | 9 ++++++++-
160 files changed, 634 insertions(+), 209 deletions(-)
diff --git a/arch/arm/include/asm/mach/arch.h b/arch/arm/include/asm/mach/arch.h
index 946f4d7..da93a84 100644
--- a/arch/arm/include/asm/mach/arch.h
+++ b/arch/arm/include/asm/mach/arch.h
@@ -30,8 +30,7 @@ struct machine_desc {
unsigned int reserve_lp1 :1; /* never has lp1 */
unsigned int reserve_lp2 :1; /* never has lp2 */
unsigned int soft_reboot :1; /* soft reboot */
- void (*fixup)(struct machine_desc *,
- struct tag *, char **,
+ void (*fixup)(struct tag *, char **,
struct meminfo *);
void (*reserve)(void);/* reserve mem blocks */
void (*map_io)(void);/* IO mapping function */
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index ed11fb0..df75ea7 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -857,7 +857,7 @@ static struct machine_desc * __init setup_machine_tags(unsigned int nr)
}
if (mdesc->fixup)
- mdesc->fixup(mdesc, tags, &from, &meminfo);
+ mdesc->fixup(tags, &from, &meminfo);
if (tags->hdr.tag == ATAG_CORE) {
if (meminfo.nr_banks != 0)
diff --git a/arch/arm/mach-bcmring/arch.c b/arch/arm/mach-bcmring/arch.c
index a604b9e..31a1435 100644
--- a/arch/arm/mach-bcmring/arch.c
+++ b/arch/arm/mach-bcmring/arch.c
@@ -136,8 +136,8 @@ static void __init bcmring_init_machine(void)
*
*****************************************************************************/
-static void __init bcmring_fixup(struct machine_desc *desc,
- struct tag *t, char **cmdline, struct meminfo *mi) {
+static void __init bcmring_fixup(struct tag *t, char **cmdline,
+ struct meminfo *mi) {
#ifdef CONFIG_BLK_DEV_INITRD
printk(KERN_NOTICE "bcmring_fixup\n");
t->hdr.tag = ATAG_CORE;
diff --git a/arch/arm/mach-clps711x/clep7312.c b/arch/arm/mach-clps711x/clep7312.c
index 67b5abb4..0a2e74f 100644
--- a/arch/arm/mach-clps711x/clep7312.c
+++ b/arch/arm/mach-clps711x/clep7312.c
@@ -26,8 +26,7 @@
#include "common.h"
static void __init
-fixup_clep7312(struct machine_desc *desc, struct tag *tags,
- char **cmdline, struct meminfo *mi)
+fixup_clep7312(struct tag *tags, char **cmdline, struct meminfo *mi)
{
mi->nr_banks=1;
mi->bank[0].start = 0xc0000000;
diff --git a/arch/arm/mach-clps711x/edb7211-arch.c b/arch/arm/mach-clps711x/edb7211-arch.c
index 98ca5b2..725a7a5 100644
--- a/arch/arm/mach-clps711x/edb7211-arch.c
+++ b/arch/arm/mach-clps711x/edb7211-arch.c
@@ -37,8 +37,7 @@ static void __init edb7211_reserve(void)
}
static void __init
-fixup_edb7211(struct machine_desc *desc, struct tag *tags,
- char **cmdline, struct meminfo *mi)
+fixup_edb7211(struct tag *tags, char **cmdline, struct meminfo *mi)
{
/*
* Bank start addresses are not present in the information
diff --git a/arch/arm/mach-clps711x/fortunet.c b/arch/arm/mach-clps711x/fortunet.c
index b1cb479..1947b30 100644
--- a/arch/arm/mach-clps711x/fortunet.c
+++ b/arch/arm/mach-clps711x/fortunet.c
@@ -57,8 +57,7 @@ typedef struct tag_IMAGE_PARAMS
#define IMAGE_PARAMS_PHYS 0xC01F0000
static void __init
-fortunet_fixup(struct machine_desc *desc, struct tag *tags,
- char **cmdline, struct meminfo *mi)
+fortunet_fixup(struct tag *tags, char **cmdline, struct meminfo *mi)
{
IMAGE_PARAMS *ip = phys_to_virt(IMAGE_PARAMS_PHYS);
*cmdline = phys_to_virt(ip->command_line);
diff --git a/arch/arm/mach-clps711x/p720t.c b/arch/arm/mach-clps711x/p720t.c
index cefbce0..3f796e0 100644
--- a/arch/arm/mach-clps711x/p720t.c
+++ b/arch/arm/mach-clps711x/p720t.c
@@ -56,8 +56,7 @@ static struct map_desc p720t_io_desc[] __initdata = {
};
static void __init
-fixup_p720t(struct machine_desc *desc, struct tag *tag,
- char **cmdline, struct meminfo *mi)
+fixup_p720t(struct tag *tag, char **cmdline, struct meminfo *mi)
{
/*
* Our bootloader doesn't setup any tags (yet).
diff --git a/arch/arm/mach-cns3xxx/cns3420vb.c b/arch/arm/mach-cns3xxx/cns3420vb.c
index 08e5c87..a3b8bd8 100644
--- a/arch/arm/mach-cns3xxx/cns3420vb.c
+++ b/arch/arm/mach-cns3xxx/cns3420vb.c
@@ -191,13 +191,17 @@ static void __init cns3420_map_io(void)
{
cns3xxx_map_io();
iotable_init(cns3420_io_desc, ARRAY_SIZE(cns3420_io_desc));
+}
+static void __init cns3420_init_early(void)
+{
cns3420_early_serial_setup();
}
MACHINE_START(CNS3420VB, "Cavium Networks CNS3420 Validation Board")
.boot_params = 0x00000100,
.map_io = cns3420_map_io,
+ .init_early = cns3420_init_early,
.init_irq = cns3xxx_init_irq,
.timer = &cns3xxx_timer,
.init_machine = cns3420_init,
diff --git a/arch/arm/mach-exynos4/cpu.c b/arch/arm/mach-exynos4/cpu.c
index 08813a6..50cfd0c 100644
--- a/arch/arm/mach-exynos4/cpu.c
+++ b/arch/arm/mach-exynos4/cpu.c
@@ -121,7 +121,10 @@ static void exynos4_idle(void)
void __init exynos4_map_io(void)
{
iotable_init(exynos4_iodesc, ARRAY_SIZE(exynos4_iodesc));
+}
+void __init exynos4_init_early(void)
+{
/* initialize device information early */
exynos4_default_sdhci0();
exynos4_default_sdhci1();
diff --git a/arch/arm/mach-exynos4/mach-smdkc210.c b/arch/arm/mach-exynos4/mach-smdkc210.c
index e645f7a..f6793c5 100644
--- a/arch/arm/mach-exynos4/mach-smdkc210.c
+++ b/arch/arm/mach-exynos4/mach-smdkc210.c
@@ -194,6 +194,11 @@ static void __init smdkc210_smsc911x_init(void)
static void __init smdkc210_map_io(void)
{
s5p_init_io(NULL, 0, S5P_VA_CHIPID);
+}
+
+static void __init smdkc210_init_early(void)
+{
+ s3c_init_early();
s3c24xx_init_clocks(24000000);
s3c24xx_init_uarts(smdkc210_uartcfgs, ARRAY_SIZE(smdkc210_uartcfgs));
}
@@ -216,6 +221,7 @@ static void __init smdkc210_machine_init(void)
MACHINE_START(SMDKC210, "SMDKC210")
/* Maintainer: Kukjin Kim <kgene.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org> */
.boot_params = S5P_PA_SDRAM + 0x100,
+ .init_early = exynos4_init_early,
.init_irq = exynos4_init_irq,
.map_io = smdkc210_map_io,
.init_machine = smdkc210_machine_init,
diff --git a/arch/arm/mach-exynos4/mach-smdkv310.c b/arch/arm/mach-exynos4/mach-smdkv310.c
index 1526764..4e086dc 100644
--- a/arch/arm/mach-exynos4/mach-smdkv310.c
+++ b/arch/arm/mach-exynos4/mach-smdkv310.c
@@ -216,6 +216,11 @@ static void __init smdkv310_smsc911x_init(void)
static void __init smdkv310_map_io(void)
{
s5p_init_io(NULL, 0, S5P_VA_CHIPID);
+}
+
+static void __init smdkv310_init_early(void)
+{
+ s3c_init_early();
s3c24xx_init_clocks(24000000);
s3c24xx_init_uarts(smdkv310_uartcfgs, ARRAY_SIZE(smdkv310_uartcfgs));
}
@@ -241,6 +246,7 @@ MACHINE_START(SMDKV310, "SMDKV310")
/* Maintainer: Kukjin Kim <kgene.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org> */
/* Maintainer: Changhwan Youn <chaos.youn-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org> */
.boot_params = S5P_PA_SDRAM + 0x100,
+ .init_early = exynos4_init_early,
.init_irq = exynos4_init_irq,
.map_io = smdkv310_map_io,
.init_machine = smdkv310_machine_init,
diff --git a/arch/arm/mach-exynos4/mach-universal_c210.c b/arch/arm/mach-exynos4/mach-universal_c210.c
index 97d329f..9683d7e 100644
--- a/arch/arm/mach-exynos4/mach-universal_c210.c
+++ b/arch/arm/mach-exynos4/mach-universal_c210.c
@@ -622,6 +622,10 @@ static struct platform_device *universal_devices[] __initdata = {
static void __init universal_map_io(void)
{
s5p_init_io(NULL, 0, S5P_VA_CHIPID);
+}
+
+static void __init universal_init_early(void)
+{
s3c24xx_init_clocks(24000000);
s3c24xx_init_uarts(universal_uartcfgs, ARRAY_SIZE(universal_uartcfgs));
}
@@ -643,6 +647,7 @@ static void __init universal_machine_init(void)
MACHINE_START(UNIVERSAL_C210, "UNIVERSAL_C210")
/* Maintainer: Kyungmin Park <kyungmin.park-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org> */
.boot_params = S5P_PA_SDRAM + 0x100,
+ .init_early = universal_init_early,
.init_irq = exynos4_init_irq,
.map_io = universal_map_io,
.init_machine = universal_machine_init,
--git a/arch/arm/mach-footbridge/cats-hw.c b/arch/arm/mach-footbridge/cats-hw.c
index 5b1a8db..206ff2f 100644
--- a/arch/arm/mach-footbridge/cats-hw.c
+++ b/arch/arm/mach-footbridge/cats-hw.c
@@ -76,8 +76,7 @@ __initcall(cats_hw_init);
* hard reboots fail on early boards.
*/
static void __init
-fixup_cats(struct machine_desc *desc, struct tag *tags,
- char **cmdline, struct meminfo *mi)
+fixup_cats(struct tag *tags, char **cmdline, struct meminfo *mi)
{
screen_info.orig_video_lines = 25;
screen_info.orig_video_points = 16;
--git a/arch/arm/mach-footbridge/netwinder-hw.c b/arch/arm/mach-footbridge/netwinder-hw.c
index 06e514f..4cbc2e6 100644
--- a/arch/arm/mach-footbridge/netwinder-hw.c
+++ b/arch/arm/mach-footbridge/netwinder-hw.c
@@ -631,8 +631,7 @@ __initcall(nw_hw_init);
* the parameter page.
*/
static void __init
-fixup_netwinder(struct machine_desc *desc, struct tag *tags,
- char **cmdline, struct meminfo *mi)
+fixup_netwinder(struct tag *tags, char **cmdline, struct meminfo *mi)
{
#ifdef CONFIG_ISAPNP
extern int isapnp_disable;
diff --git a/arch/arm/mach-ixp2000/core.c b/arch/arm/mach-ixp2000/core.c
index 4068166..e071849 100644
--- a/arch/arm/mach-ixp2000/core.c
+++ b/arch/arm/mach-ixp2000/core.c
@@ -136,7 +136,10 @@ static struct map_desc ixp2000_io_desc[] __initdata = {
void __init ixp2000_map_io(void)
{
iotable_init(ixp2000_io_desc, ARRAY_SIZE(ixp2000_io_desc));
+}
+void __init ixp2000_init_early(void)
+{
/* Set slowport to 8-bit mode. */
ixp2000_reg_wrb(IXP2000_SLOWPORT_FRM, 1);
}
diff --git a/arch/arm/mach-ixp2000/enp2611.c b/arch/arm/mach-ixp2000/enp2611.c
index 88663ab..ad14d15 100644
--- a/arch/arm/mach-ixp2000/enp2611.c
+++ b/arch/arm/mach-ixp2000/enp2611.c
@@ -255,6 +255,7 @@ MACHINE_START(ENP2611, "Radisys ENP-2611 PCI network processor board")
/* Maintainer: Lennert Buytenhek <buytenh-OLH4Qvv75CYX/NnBR394Jw@public.gmane.org> */
.boot_params = 0x00000100,
.map_io = enp2611_map_io,
+ .init_early = ixp2000_init_early,
.init_irq = ixp2000_init_irq,
.timer = &enp2611_timer,
.init_machine = enp2611_init_machine,
diff --git a/arch/arm/mach-ixp2000/include/mach/platform.h b/arch/arm/mach-ixp2000/include/mach/platform.h
index 42182c79..e17b84f 100644
--- a/arch/arm/mach-ixp2000/include/mach/platform.h
+++ b/arch/arm/mach-ixp2000/include/mach/platform.h
@@ -120,6 +120,7 @@ static inline unsigned int ixp2000_is_pcimaster(void)
void ixp2000_map_io(void);
void ixp2000_uart_init(void);
+void ixp2000_init_early(void);
void ixp2000_init_irq(void);
void ixp2000_init_time(unsigned long);
unsigned long ixp2000_gettimeoffset(void);
diff --git a/arch/arm/mach-ixp2000/ixdp2400.c b/arch/arm/mach-ixp2000/ixdp2400.c
index dfffc1e..ea65f49 100644
--- a/arch/arm/mach-ixp2000/ixdp2400.c
+++ b/arch/arm/mach-ixp2000/ixdp2400.c
@@ -172,6 +172,7 @@ MACHINE_START(IXDP2400, "Intel IXDP2400 Development Platform")
/* Maintainer: MontaVista Software, Inc. */
.boot_params = 0x00000100,
.map_io = ixdp2x00_map_io,
+ .init_early = ixp2000_init_early,
.init_irq = ixdp2400_init_irq,
.timer = &ixdp2400_timer,
.init_machine = ixdp2x00_init_machine,
diff --git a/arch/arm/mach-ixp2000/ixdp2800.c b/arch/arm/mach-ixp2000/ixdp2800.c
index cd4c9bc..f9d8f8a 100644
--- a/arch/arm/mach-ixp2000/ixdp2800.c
+++ b/arch/arm/mach-ixp2000/ixdp2800.c
@@ -287,6 +287,7 @@ MACHINE_START(IXDP2800, "Intel IXDP2800 Development Platform")
/* Maintainer: MontaVista Software, Inc. */
.boot_params = 0x00000100,
.map_io = ixdp2x00_map_io,
+ .init_early = ixp2000_init_early,
.init_irq = ixdp2800_init_irq,
.timer = &ixdp2800_timer,
.init_machine = ixdp2x00_init_machine,
diff --git a/arch/arm/mach-ixp2000/ixdp2x01.c b/arch/arm/mach-ixp2000/ixdp2x01.c
index 84835b2..f1627af 100644
--- a/arch/arm/mach-ixp2000/ixdp2x01.c
+++ b/arch/arm/mach-ixp2000/ixdp2x01.c
@@ -418,6 +418,7 @@ MACHINE_START(IXDP2401, "Intel IXDP2401 Development Platform")
/* Maintainer: MontaVista Software, Inc. */
.boot_params = 0x00000100,
.map_io = ixdp2x01_map_io,
+ .init_early = ixp2000_init_early,
.init_irq = ixdp2x01_init_irq,
.timer = &ixdp2x01_timer,
.init_machine = ixdp2x01_init_machine,
@@ -429,6 +430,7 @@ MACHINE_START(IXDP2801, "Intel IXDP2801 Development Platform")
/* Maintainer: MontaVista Software, Inc. */
.boot_params = 0x00000100,
.map_io = ixdp2x01_map_io,
+ .init_early = ixp2000_init_early,
.init_irq = ixdp2x01_init_irq,
.timer = &ixdp2x01_timer,
.init_machine = ixdp2x01_init_machine,
@@ -442,6 +444,7 @@ MACHINE_START(IXDP28X5, "Intel IXDP2805/2855 Development Platform")
/* Maintainer: MontaVista Software, Inc. */
.boot_params = 0x00000100,
.map_io = ixdp2x01_map_io,
+ .init_early = ixp2000_init_early,
.init_irq = ixdp2x01_init_irq,
.timer = &ixdp2x01_timer,
.init_machine = ixdp2x01_init_machine,
diff --git a/arch/arm/mach-ks8695/board-acs5k.c b/arch/arm/mach-ks8695/board-acs5k.c
index 3ca4f8e..447689d 100644
--- a/arch/arm/mach-ks8695/board-acs5k.c
+++ b/arch/arm/mach-ks8695/board-acs5k.c
@@ -225,6 +225,7 @@ MACHINE_START(ACS5K, "Brivo Systems LLC ACS-5000 Master board")
/* Maintainer: Simtec Electronics. */
.boot_params = KS8695_SDRAM_PA + 0x100,
.map_io = ks8695_map_io,
+ .init_early = ks8695_init_early,
.init_irq = ks8695_init_irq,
.init_machine = acs5k_init,
.timer = &ks8695_timer,
diff --git a/arch/arm/mach-ks8695/board-dsm320.c b/arch/arm/mach-ks8695/board-dsm320.c
index ada92b6..fbc869f 100644
--- a/arch/arm/mach-ks8695/board-dsm320.c
+++ b/arch/arm/mach-ks8695/board-dsm320.c
@@ -123,6 +123,7 @@ MACHINE_START(DSM320, "D-Link DSM-320 Wireless Media Player")
/* Maintainer: Simtec Electronics. */
.boot_params = KS8695_SDRAM_PA + 0x100,
.map_io = ks8695_map_io,
+ .init_early = ks8695_init_early,
.init_irq = ks8695_init_irq,
.init_machine = dsm320_init,
.timer = &ks8695_timer,
diff --git a/arch/arm/mach-ks8695/board-micrel.c b/arch/arm/mach-ks8695/board-micrel.c
index c7ad09b..3b8c6c4 100644
--- a/arch/arm/mach-ks8695/board-micrel.c
+++ b/arch/arm/mach-ks8695/board-micrel.c
@@ -55,6 +55,7 @@ MACHINE_START(KS8695, "KS8695 Centaur Development Board")
/* Maintainer: Micrel Semiconductor Inc. */
.boot_params = KS8695_SDRAM_PA + 0x100,
.map_io = ks8695_map_io,
+ .init_early = ks8695_init_early,
.init_irq = ks8695_init_irq,
.init_machine = micrel_init,
.timer = &ks8695_timer,
diff --git a/arch/arm/mach-ks8695/cpu.c b/arch/arm/mach-ks8695/cpu.c
index 7f3f240..a30ff0f 100644
--- a/arch/arm/mach-ks8695/cpu.c
+++ b/arch/arm/mach-ks8695/cpu.c
@@ -67,7 +67,10 @@ static void __init ks8695_clock_info(void)
void __init ks8695_map_io(void)
{
iotable_init(ks8695_io_desc, ARRAY_SIZE(ks8695_io_desc));
+}
+void __init ks8695_init_early(void)
+{
ks8695_processor_info();
ks8695_clock_info();
}
diff --git a/arch/arm/mach-ks8695/generic.h b/arch/arm/mach-ks8695/generic.h
index 2fbfab8..3fc88d3 100644
--- a/arch/arm/mach-ks8695/generic.h
+++ b/arch/arm/mach-ks8695/generic.h
@@ -11,5 +11,6 @@
*/
extern __init void ks8695_map_io(void);
+extern void ks8695_init_early(void);
extern __init void ks8695_init_irq(void);
extern struct sys_timer ks8695_timer;
diff --git a/arch/arm/mach-mmp/aspenite.c b/arch/arm/mach-mmp/aspenite.c
index 06b5fa8..1240230 100644
--- a/arch/arm/mach-mmp/aspenite.c
+++ b/arch/arm/mach-mmp/aspenite.c
@@ -237,16 +237,18 @@ static void __init common_init(void)
}
MACHINE_START(ASPENITE, "PXA168-based Aspenite Development Platform")
- .map_io = mmp_map_io,
.nr_irqs = IRQ_BOARD_START,
+ .map_io = mmp_map_io,
+ .init_early = mmp_init_early,
.init_irq = pxa168_init_irq,
.timer = &pxa168_timer,
.init_machine = common_init,
MACHINE_END
MACHINE_START(ZYLONITE2, "PXA168-based Zylonite2 Development Platform")
- .map_io = mmp_map_io,
.nr_irqs = IRQ_BOARD_START,
+ .map_io = mmp_map_io,
+ .init_early = mmp_init_early,
.init_irq = pxa168_init_irq,
.timer = &pxa168_timer,
.init_machine = common_init,
diff --git a/arch/arm/mach-mmp/avengers_lite.c b/arch/arm/mach-mmp/avengers_lite.c
index 39f0878..c9bbab3 100644
--- a/arch/arm/mach-mmp/avengers_lite.c
+++ b/arch/arm/mach-mmp/avengers_lite.c
@@ -42,6 +42,7 @@ static void __init avengers_lite_init(void)
MACHINE_START(AVENGERS_LITE, "PXA168 Avengers lite Development Platform")
.map_io = mmp_map_io,
+ .init_early = mmp_init_early,
.init_irq = pxa168_init_irq,
.timer = &pxa168_timer,
.init_machine = avengers_lite_init,
diff --git a/arch/arm/mach-mmp/common.c b/arch/arm/mach-mmp/common.c
index 0ec0ca8..6ea9ba2 100644
--- a/arch/arm/mach-mmp/common.c
+++ b/arch/arm/mach-mmp/common.c
@@ -41,7 +41,10 @@ static struct map_desc standard_io_desc[] __initdata = {
void __init mmp_map_io(void)
{
iotable_init(standard_io_desc, ARRAY_SIZE(standard_io_desc));
+}
+void __init mmp_init_early(void)
+{
/* this is early, initialize mmp_chip_id here */
mmp_chip_id = __raw_readl(MMP_CHIPID);
}
diff --git a/arch/arm/mach-mmp/common.h b/arch/arm/mach-mmp/common.h
index ec8d65d..d82e20c 100644
--- a/arch/arm/mach-mmp/common.h
+++ b/arch/arm/mach-mmp/common.h
@@ -6,3 +6,4 @@ extern void timer_init(int irq);
extern void __init icu_init_irq(void);
extern void __init mmp_map_io(void);
+extern void __init mmp_init_early(void);
diff --git a/arch/arm/mach-mmp/flint.c b/arch/arm/mach-mmp/flint.c
index c4fd806..775ce3e 100644
--- a/arch/arm/mach-mmp/flint.c
+++ b/arch/arm/mach-mmp/flint.c
@@ -116,8 +116,9 @@ static void __init flint_init(void)
}
MACHINE_START(FLINT, "Flint Development Platform")
- .map_io = mmp_map_io,
.nr_irqs = FLINT_NR_IRQS,
+ .map_io = mmp_map_io,
+ .init_early = mmp_init_early,
.init_irq = mmp2_init_irq,
.timer = &mmp2_timer,
.init_machine = flint_init,
diff --git a/arch/arm/mach-mmp/jasper.c b/arch/arm/mach-mmp/jasper.c
index 24172a0..8815168 100644
--- a/arch/arm/mach-mmp/jasper.c
+++ b/arch/arm/mach-mmp/jasper.c
@@ -171,8 +171,9 @@ static void __init jasper_init(void)
}
MACHINE_START(MARVELL_JASPER, "Jasper Development Platform")
- .map_io = mmp_map_io,
.nr_irqs = JASPER_NR_IRQS,
+ .map_io = mmp_map_io,
+ .init_early = mmp_init_early,
.init_irq = mmp2_init_irq,
.timer = &mmp2_timer,
.init_machine = jasper_init,
diff --git a/arch/arm/mach-mmp/tavorevb.c b/arch/arm/mach-mmp/tavorevb.c
index c296b75..f8b34a6 100644
--- a/arch/arm/mach-mmp/tavorevb.c
+++ b/arch/arm/mach-mmp/tavorevb.c
@@ -100,6 +100,7 @@ static void __init tavorevb_init(void)
MACHINE_START(TAVOREVB, "PXA910 Evaluation Board (aka TavorEVB)")
.map_io = mmp_map_io,
+ .init_early = mmp_init_early,
.init_irq = pxa910_init_irq,
.timer = &pxa910_timer,
.init_machine = tavorevb_init,
diff --git a/arch/arm/mach-mmp/teton_bga.c b/arch/arm/mach-mmp/teton_bga.c
index bbe4727..1902fae 100644
--- a/arch/arm/mach-mmp/teton_bga.c
+++ b/arch/arm/mach-mmp/teton_bga.c
@@ -81,8 +81,9 @@ static void __init teton_bga_init(void)
}
MACHINE_START(TETON_BGA, "PXA168-based Teton BGA Development Platform")
- .map_io = mmp_map_io,
.nr_irqs = IRQ_BOARD_START,
+ .map_io = mmp_map_io,
+ .init_early = mmp_init_early,
.init_irq = pxa168_init_irq,
.timer = &pxa168_timer,
.init_machine = teton_bga_init,
diff --git a/arch/arm/mach-mmp/ttc_dkb.c b/arch/arm/mach-mmp/ttc_dkb.c
index e411039..2fe38a9 100644
--- a/arch/arm/mach-mmp/ttc_dkb.c
+++ b/arch/arm/mach-mmp/ttc_dkb.c
@@ -125,8 +125,9 @@ static void __init ttc_dkb_init(void)
}
MACHINE_START(TTC_DKB, "PXA910-based TTC_DKB Development Platform")
- .map_io = mmp_map_io,
.nr_irqs = TTCDKB_NR_IRQS,
+ .map_io = mmp_map_io,
+ .init_early = mmp_init_early,
.init_irq = pxa910_init_irq,
.timer = &pxa910_timer,
.init_machine = ttc_dkb_init,
diff --git a/arch/arm/mach-msm/board-halibut.c b/arch/arm/mach-msm/board-halibut.c
index 18a3c97..b00566e 100644
--- a/arch/arm/mach-msm/board-halibut.c
+++ b/arch/arm/mach-msm/board-halibut.c
@@ -78,24 +78,24 @@ static void __init halibut_init(void)
platform_add_devices(devices, ARRAY_SIZE(devices));
}
-static void __init halibut_fixup(struct machine_desc *desc, struct tag *tags,
- char **cmdline, struct meminfo *mi)
+static void __init halibut_fixup(struct tag *tags, char **cmdline,
+ struct meminfo *mi)
{
mi->nr_banks=1;
mi->bank[0].start = PHYS_OFFSET;
mi->bank[0].size = (101*1024*1024);
}
-static void __init halibut_map_io(void)
+static void __init halibut_init_early(void)
{
- msm_map_common_io();
msm_clock_init(msm_clocks_7x01a, msm_num_clocks_7x01a);
}
MACHINE_START(HALIBUT, "Halibut Board (QCT SURF7200A)")
.boot_params = 0x10000100,
.fixup = halibut_fixup,
- .map_io = halibut_map_io,
+ .map_io = msm_map_common_io,
+ .init_early = halibut_init_early,
.init_irq = halibut_init_irq,
.init_machine = halibut_init,
.timer = &msm_timer,
diff --git a/arch/arm/mach-msm/board-mahimahi.c b/arch/arm/mach-msm/board-mahimahi.c
index 7a9a03e..6c46098 100644
--- a/arch/arm/mach-msm/board-mahimahi.c
+++ b/arch/arm/mach-msm/board-mahimahi.c
@@ -53,8 +53,8 @@ static void __init mahimahi_init(void)
platform_add_devices(devices, ARRAY_SIZE(devices));
}
-static void __init mahimahi_fixup(struct machine_desc *desc, struct tag *tags,
- char **cmdline, struct meminfo *mi)
+static void __init mahimahi_fixup(struct tag *tags, char **cmdline,
+ struct meminfo *mi)
{
mi->nr_banks = 2;
mi->bank[0].start = PHYS_OFFSET;
@@ -65,9 +65,8 @@ static void __init mahimahi_fixup(struct machine_desc *desc, struct tag *tags,
mi->bank[1].size = MSM_HIGHMEM_SIZE;
}
-static void __init mahimahi_map_io(void)
+static void __init mahimahi_init_early(void)
{
- msm_map_common_io();
msm_clock_init();
}
@@ -76,7 +75,8 @@ extern struct sys_timer msm_timer;
MACHINE_START(MAHIMAHI, "mahimahi")
.boot_params = 0x20000100,
.fixup = mahimahi_fixup,
- .map_io = mahimahi_map_io,
+ .map_io = msm_map_common_io,
+ .init_early = mahimahi_init_early,
.init_irq = msm_init_irq,
.init_machine = mahimahi_init,
.timer = &msm_timer,
diff --git a/arch/arm/mach-msm/board-msm7x27.c b/arch/arm/mach-msm/board-msm7x27.c
index c03f269..a38f479 100644
--- a/arch/arm/mach-msm/board-msm7x27.c
+++ b/arch/arm/mach-msm/board-msm7x27.c
@@ -104,9 +104,8 @@ static void __init msm7x2x_init(void)
platform_add_devices(devices, ARRAY_SIZE(devices));
}
-static void __init msm7x2x_map_io(void)
+static void __init msm7x2x_init_early(void)
{
- msm_map_common_io();
/* Technically dependent on the SoC but using machine_is
* macros since socinfo is not available this early and there
* are plans to restructure the code which will eliminate the
@@ -131,7 +130,8 @@ static void __init msm7x2x_map_io(void)
MACHINE_START(MSM7X27_SURF, "QCT MSM7x27 SURF")
.boot_params = PLAT_PHYS_OFFSET + 0x100,
- .map_io = msm7x2x_map_io,
+ .map_io = msm_map_common_io,
+ .init_early = msm7x2x_init_early,
.init_irq = msm7x2x_init_irq,
.init_machine = msm7x2x_init,
.timer = &msm_timer,
@@ -139,7 +139,8 @@ MACHINE_END
MACHINE_START(MSM7X27_FFA, "QCT MSM7x27 FFA")
.boot_params = PLAT_PHYS_OFFSET + 0x100,
- .map_io = msm7x2x_map_io,
+ .map_io = msm_map_common_io,
+ .init_early = msm7x2x_init_early,
.init_irq = msm7x2x_init_irq,
.init_machine = msm7x2x_init,
.timer = &msm_timer,
@@ -147,7 +148,8 @@ MACHINE_END
MACHINE_START(MSM7X25_SURF, "QCT MSM7x25 SURF")
.boot_params = PLAT_PHYS_OFFSET + 0x100,
- .map_io = msm7x2x_map_io,
+ .map_io = msm_map_common_io,
+ .init_early = msm7x2x_init_early,
.init_irq = msm7x2x_init_irq,
.init_machine = msm7x2x_init,
.timer = &msm_timer,
@@ -155,7 +157,8 @@ MACHINE_END
MACHINE_START(MSM7X25_FFA, "QCT MSM7x25 FFA")
.boot_params = PLAT_PHYS_OFFSET + 0x100,
- .map_io = msm7x2x_map_io,
+ .map_io = msm_map_common_io,
+ .init_early = msm7x2x_init_early,
.init_irq = msm7x2x_init_irq,
.init_machine = msm7x2x_init,
.timer = &msm_timer,
diff --git a/arch/arm/mach-msm/board-msm7x30.c b/arch/arm/mach-msm/board-msm7x30.c
index b7a8496..dbc9037 100644
--- a/arch/arm/mach-msm/board-msm7x30.c
+++ b/arch/arm/mach-msm/board-msm7x30.c
@@ -99,15 +99,15 @@ static void __init msm7x30_init(void)
platform_add_devices(devices, ARRAY_SIZE(devices));
}
-static void __init msm7x30_map_io(void)
+static void __init msm7x30_init_early(void)
{
- msm_map_msm7x30_io();
msm_clock_init(msm_clocks_7x30, msm_num_clocks_7x30);
}
MACHINE_START(MSM7X30_SURF, "QCT MSM7X30 SURF")
.boot_params = PLAT_PHYS_OFFSET + 0x100,
- .map_io = msm7x30_map_io,
+ .map_io = msm_map_msm7x30_io,
+ .init_early = msm7x30_init_early,
.init_irq = msm7x30_init_irq,
.init_machine = msm7x30_init,
.timer = &msm_timer,
@@ -115,7 +115,8 @@ MACHINE_END
MACHINE_START(MSM7X30_FFA, "QCT MSM7X30 FFA")
.boot_params = PLAT_PHYS_OFFSET + 0x100,
- .map_io = msm7x30_map_io,
+ .map_io = msm_map_msm7x30_io,
+ .init_early = msm7x30_init_early,
.init_irq = msm7x30_init_irq,
.init_machine = msm7x30_init,
.timer = &msm_timer,
@@ -123,7 +124,8 @@ MACHINE_END
MACHINE_START(MSM7X30_FLUID, "QCT MSM7X30 FLUID")
.boot_params = PLAT_PHYS_OFFSET + 0x100,
- .map_io = msm7x30_map_io,
+ .map_io = msm_map_msm7x30_io,
+ .init_early = msm7x30_init_early,
.init_irq = msm7x30_init_irq,
.init_machine = msm7x30_init,
.timer = &msm_timer,
diff --git a/arch/arm/mach-msm/board-qsd8x50.c b/arch/arm/mach-msm/board-qsd8x50.c
index 6a96911..4a567d2 100644
--- a/arch/arm/mach-msm/board-qsd8x50.c
+++ b/arch/arm/mach-msm/board-qsd8x50.c
@@ -171,9 +171,8 @@ static void __init qsd8x50_init_mmc(void)
msm_add_sdcc(1, &qsd8x50_sdc1_data, 0, 0);
}
-static void __init qsd8x50_map_io(void)
+static void __init qsd8x50_init_early(void)
{
- msm_map_qsd8x50_io();
msm_clock_init(msm_clocks_8x50, msm_num_clocks_8x50);
}
@@ -194,7 +193,8 @@ static void __init qsd8x50_init(void)
MACHINE_START(QSD8X50_SURF, "QCT QSD8X50 SURF")
.boot_params = PLAT_PHYS_OFFSET + 0x100,
- .map_io = qsd8x50_map_io,
+ .map_io = msm_map_qsd8x50_io,
+ .init_early = qsd8x50_init_early,
.init_irq = qsd8x50_init_irq,
.init_machine = qsd8x50_init,
.timer = &msm_timer,
@@ -202,7 +202,8 @@ MACHINE_END
MACHINE_START(QSD8X50A_ST1_5, "QCT QSD8X50A ST1.5")
.boot_params = PLAT_PHYS_OFFSET + 0x100,
- .map_io = qsd8x50_map_io,
+ .map_io = msm_map_qsd8x50_io,
+ .init_early = qsd8x50_init_early,
.init_irq = qsd8x50_init_irq,
.init_machine = qsd8x50_init,
.timer = &msm_timer,
diff --git a/arch/arm/mach-msm/board-sapphire.c b/arch/arm/mach-msm/board-sapphire.c
index 68f930f..46186c4 100644
--- a/arch/arm/mach-msm/board-sapphire.c
+++ b/arch/arm/mach-msm/board-sapphire.c
@@ -77,8 +77,8 @@ static struct map_desc sapphire_io_desc[] __initdata = {
}
};
-static void __init sapphire_fixup(struct machine_desc *desc, struct tag *tags,
- char **cmdline, struct meminfo *mi)
+static void __init sapphire_fixup(struct tag *tags, char **cmdline,
+ struct meminfo *mi)
{
int smi_sz = parse_tag_smi((const struct tag *)tags);
@@ -100,6 +100,10 @@ static void __init sapphire_map_io(void)
{
msm_map_common_io();
iotable_init(sapphire_io_desc, ARRAY_SIZE(sapphire_io_desc));
+}
+
+static void __init sapphire_init_early(void)
+{
msm_clock_init();
}
@@ -108,6 +112,7 @@ MACHINE_START(SAPPHIRE, "sapphire")
.boot_params = PLAT_PHYS_OFFSET + 0x100,
.fixup = sapphire_fixup,
.map_io = sapphire_map_io,
+ .init_early = sapphire_init_early,
.init_irq = sapphire_init_irq,
.init_machine = sapphire_init,
.timer = &msm_timer,
diff --git a/arch/arm/mach-msm/board-trout.c b/arch/arm/mach-msm/board-trout.c
index 8143867..53f71cf 100644
--- a/arch/arm/mach-msm/board-trout.c
+++ b/arch/arm/mach-msm/board-trout.c
@@ -48,8 +48,8 @@ static void __init trout_init_irq(void)
msm_init_irq();
}
-static void __init trout_fixup(struct machine_desc *desc, struct tag *tags,
- char **cmdline, struct meminfo *mi)
+static void __init trout_fixup(struct tag *tags, char **cmdline,
+ struct meminfo *mi)
{
mi->nr_banks = 1;
mi->bank[0].start = PHYS_OFFSET;
@@ -83,7 +83,10 @@ static void __init trout_map_io(void)
{
msm_map_common_io();
iotable_init(trout_io_desc, ARRAY_SIZE(trout_io_desc));
+}
+static void __init trout_init_early(void)
+{
#ifdef CONFIG_MSM_DEBUG_UART3
/* route UART3 to the "H2W" extended usb connector */
writeb(0x80, TROUT_CPLD_BASE + 0x00);
@@ -96,6 +99,7 @@ MACHINE_START(TROUT, "HTC Dream")
.boot_params = 0x10000100,
.fixup = trout_fixup,
.map_io = trout_map_io,
+ .init_early = trout_init_early,
.init_irq = trout_init_irq,
.init_machine = trout_init,
.timer = &msm_timer,
diff --git a/arch/arm/mach-nuc93x/mach-nuc932evb.c b/arch/arm/mach-nuc93x/mach-nuc932evb.c
index d702570..54f9742 100644
--- a/arch/arm/mach-nuc93x/mach-nuc932evb.c
+++ b/arch/arm/mach-nuc93x/mach-nuc932evb.c
@@ -21,9 +21,8 @@
#include "nuc932.h"
-static void __init nuc932evb_map_io(void)
+static void __init nuc932evb_init_early(void)
{
- nuc932_map_io();
nuc932_init_clocks();
nuc932_init_uartclk();
}
@@ -36,7 +35,8 @@ static void __init nuc932evb_init(void)
MACHINE_START(NUC932EVB, "NUC932EVB")
/* Maintainer: Wan ZongShun */
.boot_params = 0,
- .map_io = nuc932evb_map_io,
+ .map_io = nuc932_map_io,
+ .init_early = nuc932evb_init_early,
.init_irq = nuc93x_init_irq,
.init_machine = nuc932evb_init,
.timer = &nuc93x_timer,
diff --git a/arch/arm/mach-orion5x/common.c b/arch/arm/mach-orion5x/common.c
index 0ab531d..22ace0b 100644
--- a/arch/arm/mach-orion5x/common.c
+++ b/arch/arm/mach-orion5x/common.c
@@ -308,8 +308,8 @@ void __init orion5x_init(void)
* Many orion-based systems have buggy bootloader implementations.
* This is a common fixup for bogus memory tags.
*/
-void __init tag_fixup_mem32(struct machine_desc *mdesc, struct tag *t,
- char **from, struct meminfo *meminfo)
+void __init tag_fixup_mem32(struct tag *t, char **from,
+ struct meminfo *meminfo)
{
for (; t->hdr.size; t = tag_next(t))
if (t->hdr.tag == ATAG_MEM &&
diff --git a/arch/arm/mach-orion5x/common.h b/arch/arm/mach-orion5x/common.h
index f2b2b35..fbd6c54 100644
--- a/arch/arm/mach-orion5x/common.h
+++ b/arch/arm/mach-orion5x/common.h
@@ -53,11 +53,9 @@ int orion5x_pci_sys_setup(int nr, struct pci_sys_data *sys);
struct pci_bus *orion5x_pci_sys_scan_bus(int nr, struct pci_sys_data *sys);
int orion5x_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin);
-struct machine_desc;
struct meminfo;
struct tag;
-extern void __init tag_fixup_mem32(struct machine_desc *, struct tag *,
- char **, struct meminfo *);
+extern void __init tag_fixup_mem32(struct tag *, char **, struct meminfo *);
#endif
diff --git a/arch/arm/mach-pxa/cm-x2xx.c b/arch/arm/mach-pxa/cm-x2xx.c
index a109967..1be9c7e 100644
--- a/arch/arm/mach-pxa/cm-x2xx.c
+++ b/arch/arm/mach-pxa/cm-x2xx.c
@@ -497,7 +497,10 @@ static void __init cmx2xx_map_io(void)
pxa27x_map_io();
iotable_init(cmx2xx_io_desc, ARRAY_SIZE(cmx2xx_io_desc));
+}
+static void __init cmx2xx_init_early(void)
+{
it8152_base_address = CMX2XX_IT8152_VIRT;
}
#else
@@ -509,12 +512,14 @@ static void __init cmx2xx_map_io(void)
if (cpu_is_pxa27x())
pxa27x_map_io();
}
+#define cmx2xx_init_early NULL
#endif
MACHINE_START(ARMCORE, "Compulab CM-X2XX")
.boot_params = 0xa0000100,
- .map_io = cmx2xx_map_io,
.nr_irqs = CMX2XX_NR_IRQS,
+ .map_io = cmx2xx_map_io,
+ .init_early = cmx2xx_init_early,
.init_irq = cmx2xx_init_irq,
.timer = &pxa_timer,
.init_machine = cmx2xx_init,
diff --git a/arch/arm/mach-pxa/cm-x300.c b/arch/arm/mach-pxa/cm-x300.c
index b2248e7..e87d373 100644
--- a/arch/arm/mach-pxa/cm-x300.c
+++ b/arch/arm/mach-pxa/cm-x300.c
@@ -843,8 +843,8 @@ static void __init cm_x300_init(void)
cm_x300_init_bl();
}
-static void __init cm_x300_fixup(struct machine_desc *mdesc, struct tag *tags,
- char **cmdline, struct meminfo *mi)
+static void __init cm_x300_fixup(struct tag *tags, char **cmdline,
+ struct meminfo *mi)
{
/* Make sure that mi->bank[0].start = PHYS_ADDR */
for (; tags->hdr.size; tags = tag_next(tags))
diff --git a/arch/arm/mach-pxa/corgi.c b/arch/arm/mach-pxa/corgi.c
index 3a5507e..249bd94 100644
--- a/arch/arm/mach-pxa/corgi.c
+++ b/arch/arm/mach-pxa/corgi.c
@@ -705,8 +705,8 @@ static void __init corgi_init(void)
platform_add_devices(devices, ARRAY_SIZE(devices));
}
-static void __init fixup_corgi(struct machine_desc *desc,
- struct tag *tags, char **cmdline, struct meminfo *mi)
+static void __init fixup_corgi(struct tag *tags, char **cmdline,
+ struct meminfo *mi)
{
sharpsl_save_param();
mi->nr_banks=1;
diff --git a/arch/arm/mach-pxa/eseries.c b/arch/arm/mach-pxa/eseries.c
index 2e3970f..1376929 100644
--- a/arch/arm/mach-pxa/eseries.c
+++ b/arch/arm/mach-pxa/eseries.c
@@ -41,8 +41,7 @@
#include "clock.h"
/* Only e800 has 128MB RAM */
-void __init eseries_fixup(struct machine_desc *desc,
- struct tag *tags, char **cmdline, struct meminfo *mi)
+void __init eseries_fixup(struct tag *tags, char **cmdline, struct meminfo *mi)
{
mi->nr_banks=1;
mi->bank[0].start = 0xa0000000;
diff --git a/arch/arm/mach-pxa/eseries.h b/arch/arm/mach-pxa/eseries.h
index 5930f5e..be92196 100644
--- a/arch/arm/mach-pxa/eseries.h
+++ b/arch/arm/mach-pxa/eseries.h
@@ -1,5 +1,4 @@
-void __init eseries_fixup(struct machine_desc *desc,
- struct tag *tags, char **cmdline, struct meminfo *mi);
+void __init eseries_fixup(struct tag *tags, char **cmdline, struct meminfo *mi);
extern struct pxa2xx_udc_mach_info e7xx_udc_mach_info;
extern struct pxaficp_platform_data e7xx_ficp_platform_data;
diff --git a/arch/arm/mach-pxa/lpd270.c b/arch/arm/mach-pxa/lpd270.c
index 6cf8180..dbaa105 100644
--- a/arch/arm/mach-pxa/lpd270.c
+++ b/arch/arm/mach-pxa/lpd270.c
@@ -491,7 +491,10 @@ static void __init lpd270_map_io(void)
{
pxa27x_map_io();
iotable_init(lpd270_io_desc, ARRAY_SIZE(lpd270_io_desc));
+}
+static void __init lpd270_init_early(void)
+{
/* for use I SRAM as framebuffer. */
PSLR |= 0x00000F04;
PCFR = 0x00000066;
@@ -500,8 +503,9 @@ static void __init lpd270_map_io(void)
MACHINE_START(LOGICPD_PXA270, "LogicPD PXA270 Card Engine")
/* Maintainer: Peter Barada */
.boot_params = 0xa0000100,
- .map_io = lpd270_map_io,
.nr_irqs = LPD270_NR_IRQS,
+ .map_io = lpd270_map_io,
+ .init_early = lpd270_init_early,
.init_irq = lpd270_init_irq,
.timer = &pxa_timer,
.init_machine = lpd270_init,
diff --git a/arch/arm/mach-pxa/lubbock.c b/arch/arm/mach-pxa/lubbock.c
index e10ddb8..167ce68 100644
--- a/arch/arm/mach-pxa/lubbock.c
+++ b/arch/arm/mach-pxa/lubbock.c
@@ -544,14 +544,18 @@ static void __init lubbock_map_io(void)
{
pxa25x_map_io();
iotable_init(lubbock_io_desc, ARRAY_SIZE(lubbock_io_desc));
+}
+static void __init lubbock_init_early(void)
+{
PCFR |= PCFR_OPDE;
}
MACHINE_START(LUBBOCK, "Intel DBPXA250 Development Platform (aka Lubbock)")
/* Maintainer: MontaVista Software Inc. */
- .map_io = lubbock_map_io,
.nr_irqs = LUBBOCK_NR_IRQS,
+ .map_io = lubbock_map_io,
+ .init_early = lubbock_init_early,
.init_irq = lubbock_init_irq,
.timer = &pxa_timer,
.init_machine = lubbock_init,
diff --git a/arch/arm/mach-pxa/mainstone.c b/arch/arm/mach-pxa/mainstone.c
index 3479e2b..25f0319 100644
--- a/arch/arm/mach-pxa/mainstone.c
+++ b/arch/arm/mach-pxa/mainstone.c
@@ -608,7 +608,10 @@ static void __init mainstone_map_io(void)
{
pxa27x_map_io();
iotable_init(mainstone_io_desc, ARRAY_SIZE(mainstone_io_desc));
+}
+static void __init mainstone_init_early(void)
+{
/* for use I SRAM as framebuffer. */
PSLR |= 0xF04;
PCFR = 0x66;
@@ -617,8 +620,9 @@ static void __init mainstone_map_io(void)
MACHINE_START(MAINSTONE, "Intel HCDDBBVA0 Development Platform (aka Mainstone)")
/* Maintainer: MontaVista Software Inc. */
.boot_params = 0xa0000100, /* BLOB boot parameter setting */
- .map_io = mainstone_map_io,
.nr_irqs = MAINSTONE_NR_IRQS,
+ .map_io = mainstone_map_io,
+ .init_early = mainstone_init_early,
.init_irq = mainstone_init_irq,
.timer = &pxa_timer,
.init_machine = mainstone_init,
diff --git a/arch/arm/mach-pxa/pcm027.c b/arch/arm/mach-pxa/pcm027.c
index 1fc8a66..df0aff9 100644
--- a/arch/arm/mach-pxa/pcm027.c
+++ b/arch/arm/mach-pxa/pcm027.c
@@ -242,10 +242,8 @@ static void __init pcm027_init(void)
spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
}
-static void __init pcm027_map_io(void)
+static void __init pcm027_init_early(void)
{
- pxa27x_map_io();
-
/* initialize sleep mode regs (wake-up sources, etc) */
PGSR0 = 0x01308000;
PGSR1 = 0x00CF0002;
@@ -259,8 +257,9 @@ static void __init pcm027_map_io(void)
MACHINE_START(PCM027, "Phytec Messtechnik GmbH phyCORE-PXA270")
/* Maintainer: Pengutronix */
.boot_params = 0xa0000100,
- .map_io = pcm027_map_io,
.nr_irqs = PCM027_NR_IRQS,
+ .map_io = pxa27x_map_io,
+ .init_early = pcm027_init_early,
.init_irq = pxa27x_init_irq,
.timer = &pxa_timer,
.init_machine = pcm027_init,
diff --git a/arch/arm/mach-pxa/poodle.c b/arch/arm/mach-pxa/poodle.c
index 16d14fd..10b1f76 100644
--- a/arch/arm/mach-pxa/poodle.c
+++ b/arch/arm/mach-pxa/poodle.c
@@ -454,8 +454,8 @@ static void __init poodle_init(void)
poodle_init_spi();
}
-static void __init fixup_poodle(struct machine_desc *desc,
- struct tag *tags, char **cmdline, struct meminfo *mi)
+static void __init fixup_poodle(struct tag *tags, char **cmdline,
+ struct meminfo *mi)
{
sharpsl_save_param();
mi->nr_banks=1;
diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c
index 01c5769..550143c 100644
--- a/arch/arm/mach-pxa/spitz.c
+++ b/arch/arm/mach-pxa/spitz.c
@@ -970,8 +970,8 @@ static void __init spitz_init(void)
spitz_i2c_init();
}
-static void __init spitz_fixup(struct machine_desc *desc,
- struct tag *tags, char **cmdline, struct meminfo *mi)
+static void __init spitz_fixup(struct tag *tags, char **cmdline,
+ struct meminfo *mi)
{
sharpsl_save_param();
mi->nr_banks = 1;
diff --git a/arch/arm/mach-pxa/tosa.c b/arch/arm/mach-pxa/tosa.c
index 5fa1457..0f96ee2 100644
--- a/arch/arm/mach-pxa/tosa.c
+++ b/arch/arm/mach-pxa/tosa.c
@@ -960,8 +960,8 @@ static void __init tosa_init(void)
platform_add_devices(devices, ARRAY_SIZE(devices));
}
-static void __init fixup_tosa(struct machine_desc *desc,
- struct tag *tags, char **cmdline, struct meminfo *mi)
+static void __init fixup_tosa(struct tag *tags, char **cmdline,
+ struct meminfo *mi)
{
sharpsl_save_param();
mi->nr_banks=1;
diff --git a/arch/arm/mach-pxa/trizeps4.c b/arch/arm/mach-pxa/trizeps4.c
index 687417a..5adfa4c 100644
--- a/arch/arm/mach-pxa/trizeps4.c
+++ b/arch/arm/mach-pxa/trizeps4.c
@@ -540,7 +540,10 @@ static void __init trizeps4_map_io(void)
{
pxa27x_map_io();
iotable_init(trizeps4_io_desc, ARRAY_SIZE(trizeps4_io_desc));
+}
+static void __init trizeps4_init_early(void)
+{
if ((__raw_readl(MSC0) & 0x8) && (__raw_readl(BOOT_DEF) & 0x1)) {
/* if flash is 16 bit wide its a Trizeps4 WL */
__machine_arch_type = MACH_TYPE_TRIZEPS4WL;
@@ -555,17 +558,19 @@ static void __init trizeps4_map_io(void)
MACHINE_START(TRIZEPS4, "Keith und Koep Trizeps IV module")
/* MAINTAINER("Jürgen Schindele") */
.boot_params = TRIZEPS4_SDRAM_BASE + 0x100,
- .init_machine = trizeps4_init,
.map_io = trizeps4_map_io,
+ .init_early = trizeps4_init_early,
.init_irq = pxa27x_init_irq,
+ .init_machine = trizeps4_init,
.timer = &pxa_timer,
MACHINE_END
MACHINE_START(TRIZEPS4WL, "Keith und Koep Trizeps IV-WL module")
/* MAINTAINER("Jürgen Schindele") */
.boot_params = TRIZEPS4_SDRAM_BASE + 0x100,
- .init_machine = trizeps4_init,
.map_io = trizeps4_map_io,
+ .init_early = trizeps4_init_early,
.init_irq = pxa27x_init_irq,
+ .init_machine = trizeps4_init,
.timer = &pxa_timer,
MACHINE_END
diff --git a/arch/arm/mach-pxa/viper.c b/arch/arm/mach-pxa/viper.c
index 903218e..3f257c1 100644
--- a/arch/arm/mach-pxa/viper.c
+++ b/arch/arm/mach-pxa/viper.c
@@ -984,9 +984,11 @@ static struct map_desc viper_io_desc[] __initdata = {
static void __init viper_map_io(void)
{
pxa25x_map_io();
-
iotable_init(viper_io_desc, ARRAY_SIZE(viper_io_desc));
+}
+static void __init viper_init_early(void)
+{
PCFR |= PCFR_OPDE;
}
@@ -994,6 +996,7 @@ MACHINE_START(VIPER, "Arcom/Eurotech VIPER SBC")
/* Maintainer: Marc Zyngier <maz-20xNzvSXLT6hUMvJH42dtQ@public.gmane.org> */
.boot_params = 0xa0000100,
.map_io = viper_map_io,
+ .init_early = viper_init_early,
.init_irq = viper_init_irq,
.timer = &pxa_timer,
.init_machine = viper_init,
diff --git a/arch/arm/mach-pxa/zeus.c b/arch/arm/mach-pxa/zeus.c
index 00363c7..5a17d91 100644
--- a/arch/arm/mach-pxa/zeus.c
+++ b/arch/arm/mach-pxa/zeus.c
@@ -888,9 +888,11 @@ static struct map_desc zeus_io_desc[] __initdata = {
static void __init zeus_map_io(void)
{
pxa27x_map_io();
-
iotable_init(zeus_io_desc, ARRAY_SIZE(zeus_io_desc));
+}
+static void __init zeus_init_early(void)
+{
/* Clear PSPR to ensure a full restart on wake-up. */
PMCR = PSPR = 0;
@@ -905,8 +907,9 @@ static void __init zeus_map_io(void)
MACHINE_START(ARCOM_ZEUS, "Arcom/Eurotech ZEUS")
/* Maintainer: Marc Zyngier <maz-20xNzvSXLT6hUMvJH42dtQ@public.gmane.org> */
.boot_params = 0xa0000100,
- .map_io = zeus_map_io,
.nr_irqs = ZEUS_NR_IRQS,
+ .map_io = zeus_map_io,
+ .init_early = zeus_init_early,
.init_irq = zeus_init_irq,
.timer = &pxa_timer,
.init_machine = zeus_init,
diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c
index 5c23450..d5ed5d4 100644
--- a/arch/arm/mach-realview/core.c
+++ b/arch/arm/mach-realview/core.c
@@ -517,8 +517,7 @@ void __init realview_timer_init(unsigned int timer_irq)
/*
* Setup the memory banks.
*/
-void realview_fixup(struct machine_desc *mdesc, struct tag *tags, char **from,
- struct meminfo *meminfo)
+void realview_fixup(struct tag *tags, char **from, struct meminfo *meminfo)
{
/*
* Most RealView platforms have 512MB contiguous RAM at 0x70000000.
diff --git a/arch/arm/mach-realview/core.h b/arch/arm/mach-realview/core.h
index 5c83d1e..47259c8 100644
--- a/arch/arm/mach-realview/core.h
+++ b/arch/arm/mach-realview/core.h
@@ -63,8 +63,8 @@ extern int realview_flash_register(struct resource *res, u32 num);
extern int realview_eth_register(const char *name, struct resource *res);
extern int realview_usb_register(struct resource *res);
extern void realview_init_early(void);
-extern void realview_fixup(struct machine_desc *mdesc, struct tag *tags,
- char **from, struct meminfo *meminfo);
+extern void realview_fixup(struct tag *tags, char **from,
+ struct meminfo *meminfo);
extern void (*realview_reset)(char);
#endif
diff --git a/arch/arm/mach-realview/realview_pb1176.c b/arch/arm/mach-realview/realview_pb1176.c
index eab6070..9f00be8 100644
--- a/arch/arm/mach-realview/realview_pb1176.c
+++ b/arch/arm/mach-realview/realview_pb1176.c
@@ -316,8 +316,7 @@ static void realview_pb1176_reset(char mode)
__raw_writel(REALVIEW_PB1176_SYS_SOFT_RESET, reset_ctrl);
}
-static void realview_pb1176_fixup(struct machine_desc *mdesc,
- struct tag *tags, char **from,
+static void realview_pb1176_fixup(struct tag *tags, char **from,
struct meminfo *meminfo)
{
/*
diff --git a/arch/arm/mach-realview/realview_pbx.c b/arch/arm/mach-realview/realview_pbx.c
index 92ace2c..27f199f 100644
--- a/arch/arm/mach-realview/realview_pbx.c
+++ b/arch/arm/mach-realview/realview_pbx.c
@@ -319,8 +319,8 @@ static struct sys_timer realview_pbx_timer = {
.init = realview_pbx_timer_init,
};
-static void realview_pbx_fixup(struct machine_desc *mdesc, struct tag *tags,
- char **from, struct meminfo *meminfo)
+static void realview_pbx_fixup(struct tag *tags, char **from,
+ struct meminfo *meminfo)
{
#ifdef CONFIG_SPARSEMEM
/*
@@ -335,7 +335,7 @@ static void realview_pbx_fixup(struct machine_desc *mdesc, struct tag *tags,
meminfo->bank[2].size = SZ_256M;
meminfo->nr_banks = 3;
#else
- realview_fixup(mdesc, tags, from, meminfo);
+ realview_fixup(tags, from, meminfo);
#endif
}
diff --git a/arch/arm/mach-rpc/riscpc.c b/arch/arm/mach-rpc/riscpc.c
index 580b3c7..6a0f96d 100644
--- a/arch/arm/mach-rpc/riscpc.c
+++ b/arch/arm/mach-rpc/riscpc.c
@@ -84,7 +84,10 @@ static struct map_desc rpc_io_desc[] __initdata = {
static void __init rpc_map_io(void)
{
iotable_init(rpc_io_desc, ARRAY_SIZE(rpc_io_desc));
+}
+static void __init rpc_init_early(void)
+{
/*
* Turn off floppy.
*/
@@ -222,6 +225,7 @@ MACHINE_START(RISCPC, "Acorn-RiscPC")
.reserve_lp0 = 1,
.reserve_lp1 = 1,
.map_io = rpc_map_io,
+ .init_early = rpc_init_early,
.init_irq = rpc_init_irq,
.timer = &ioc_timer,
MACHINE_END
diff --git a/arch/arm/mach-s3c2410/mach-amlm5900.c b/arch/arm/mach-s3c2410/mach-amlm5900.c
index dabc141..4f085ce 100644
--- a/arch/arm/mach-s3c2410/mach-amlm5900.c
+++ b/arch/arm/mach-s3c2410/mach-amlm5900.c
@@ -161,6 +161,11 @@ static struct platform_device *amlm5900_devices[] __initdata = {
static void __init amlm5900_map_io(void)
{
s3c24xx_init_io(amlm5900_iodesc, ARRAY_SIZE(amlm5900_iodesc));
+}
+
+static void __init amlm5900_init_early(void)
+{
+ s3c_init_early();
s3c24xx_init_clocks(0);
s3c24xx_init_uarts(amlm5900_uartcfgs, ARRAY_SIZE(amlm5900_uartcfgs));
}
@@ -238,6 +243,7 @@ static void __init amlm5900_init(void)
MACHINE_START(AML_M5900, "AML_M5900")
.boot_params = S3C2410_SDRAM_PA + 0x100,
.map_io = amlm5900_map_io,
+ .init_early = amlm5900_init_early,
.init_irq = s3c24xx_init_irq,
.init_machine = amlm5900_init,
.timer = &s3c24xx_timer,
diff --git a/arch/arm/mach-s3c2410/mach-bast.c b/arch/arm/mach-s3c2410/mach-bast.c
index 1e2d536..7100054 100644
--- a/arch/arm/mach-s3c2410/mach-bast.c
+++ b/arch/arm/mach-s3c2410/mach-bast.c
@@ -612,6 +612,11 @@ static struct s3c24xx_audio_simtec_pdata __initdata bast_audio = {
static void __init bast_map_io(void)
{
+ s3c24xx_init_io(bast_iodesc, ARRAY_SIZE(bast_iodesc));
+}
+
+static void __init bast_init_early(void)
+{
/* initialise the clocks */
s3c24xx_dclk0.parent = &clk_upll;
@@ -629,7 +634,7 @@ static void __init bast_map_io(void)
s3c_hwmon_set_platdata(&bast_hwmon_info);
- s3c24xx_init_io(bast_iodesc, ARRAY_SIZE(bast_iodesc));
+ s3c_init_early();
s3c24xx_init_clocks(0);
s3c24xx_init_uarts(bast_uartcfgs, ARRAY_SIZE(bast_uartcfgs));
}
@@ -659,6 +664,7 @@ MACHINE_START(BAST, "Simtec-BAST")
/* Maintainer: Ben Dooks <ben-Y5A6D6n0/KfQXOPxS62xeg@public.gmane.org> */
.boot_params = S3C2410_SDRAM_PA + 0x100,
.map_io = bast_map_io,
+ .init_early = bast_init_early,
.init_irq = s3c24xx_init_irq,
.init_machine = bast_init,
.timer = &s3c24xx_timer,
diff --git a/arch/arm/mach-s3c2410/mach-h1940.c b/arch/arm/mach-s3c2410/mach-h1940.c
index 2a2fa06..ec4a19a 100644
--- a/arch/arm/mach-s3c2410/mach-h1940.c
+++ b/arch/arm/mach-s3c2410/mach-h1940.c
@@ -652,6 +652,11 @@ static struct platform_device *h1940_devices[] __initdata = {
static void __init h1940_map_io(void)
{
s3c24xx_init_io(h1940_iodesc, ARRAY_SIZE(h1940_iodesc));
+}
+
+static void __init h1940_init_early(void)
+{
+ s3c_init_early();
s3c24xx_init_clocks(0);
s3c24xx_init_uarts(h1940_uartcfgs, ARRAY_SIZE(h1940_uartcfgs));
@@ -745,8 +750,9 @@ static void __init h1940_init(void)
MACHINE_START(H1940, "IPAQ-H1940")
/* Maintainer: Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org> */
.boot_params = S3C2410_SDRAM_PA + 0x100,
- .map_io = h1940_map_io,
.reserve = h1940_reserve,
+ .map_io = h1940_map_io,
+ .init_early = h1940_init_early,
.init_irq = h1940_init_irq,
.init_machine = h1940_init,
.timer = &s3c24xx_timer,
diff --git a/arch/arm/mach-s3c2410/mach-n30.c b/arch/arm/mach-s3c2410/mach-n30.c
index 079dcaa..51469cc 100644
--- a/arch/arm/mach-s3c2410/mach-n30.c
+++ b/arch/arm/mach-s3c2410/mach-n30.c
@@ -531,6 +531,11 @@ static void __init n30_hwinit(void)
static void __init n30_map_io(void)
{
s3c24xx_init_io(n30_iodesc, ARRAY_SIZE(n30_iodesc));
+}
+
+static void __init n30_init_early(void)
+{
+ s3c_init_early();
n30_hwinit();
s3c24xx_init_clocks(0);
s3c24xx_init_uarts(n30_uartcfgs, ARRAY_SIZE(n30_uartcfgs));
@@ -587,18 +592,20 @@ MACHINE_START(N30, "Acer-N30")
Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>
*/
.boot_params = S3C2410_SDRAM_PA + 0x100,
+ .map_io = n30_map_io,
+ .init_early = n30_init_early,
+ .init_irq = s3c24xx_init_irq,
.timer = &s3c24xx_timer,
.init_machine = n30_init,
- .init_irq = s3c24xx_init_irq,
- .map_io = n30_map_io,
MACHINE_END
MACHINE_START(N35, "Acer-N35")
/* Maintainer: Christer Weinigel <christer-rKHMIqA5R6gwFerOooGFRg@public.gmane.org>
*/
.boot_params = S3C2410_SDRAM_PA + 0x100,
+ .map_io = n30_map_io,
+ .init_early = n30_init_early,
+ .init_irq = s3c24xx_init_irq,
.timer = &s3c24xx_timer,
.init_machine = n30_init,
- .init_irq = s3c24xx_init_irq,
- .map_io = n30_map_io,
MACHINE_END
diff --git a/arch/arm/mach-s3c2410/mach-otom.c b/arch/arm/mach-s3c2410/mach-otom.c
index 0aa16cd..21951cd 100644
--- a/arch/arm/mach-s3c2410/mach-otom.c
+++ b/arch/arm/mach-s3c2410/mach-otom.c
@@ -104,6 +104,11 @@ static struct platform_device *otom11_devices[] __initdata = {
static void __init otom11_map_io(void)
{
s3c24xx_init_io(otom11_iodesc, ARRAY_SIZE(otom11_iodesc));
+}
+
+static void __init otom11_init_early(void)
+{
+ s3c_init_early();
s3c24xx_init_clocks(0);
s3c24xx_init_uarts(otom11_uartcfgs, ARRAY_SIZE(otom11_uartcfgs));
}
@@ -118,6 +123,7 @@ MACHINE_START(OTOM, "Nex Vision - Otom 1.1")
/* Maintainer: Guillaume GOURAT <guillaume.gourat-SG84m9Bk/uxjrEqMGRc/AA@public.gmane.org> */
.boot_params = S3C2410_SDRAM_PA + 0x100,
.map_io = otom11_map_io,
+ .init_early = otom11_init_early,
.init_machine = otom11_init,
.init_irq = s3c24xx_init_irq,
.timer = &s3c24xx_timer,
diff --git a/arch/arm/mach-s3c2410/mach-qt2410.c b/arch/arm/mach-s3c2410/mach-qt2410.c
index e8f49fe..d562857 100644
--- a/arch/arm/mach-s3c2410/mach-qt2410.c
+++ b/arch/arm/mach-s3c2410/mach-qt2410.c
@@ -326,6 +326,11 @@ __setup("tft=", qt2410_tft_setup);
static void __init qt2410_map_io(void)
{
s3c24xx_init_io(qt2410_iodesc, ARRAY_SIZE(qt2410_iodesc));
+}
+
+static void __init qt2410_init_early(void)
+{
+ s3c_init_early();
s3c24xx_init_clocks(12*1000*1000);
s3c24xx_init_uarts(smdk2410_uartcfgs, ARRAY_SIZE(smdk2410_uartcfgs));
}
@@ -364,6 +369,7 @@ static void __init qt2410_machine_init(void)
MACHINE_START(QT2410, "QT2410")
.boot_params = S3C2410_SDRAM_PA + 0x100,
.map_io = qt2410_map_io,
+ .init_early = qt2410_init_early,
.init_irq = s3c24xx_init_irq,
.init_machine = qt2410_machine_init,
.timer = &s3c24xx_timer,
diff --git a/arch/arm/mach-s3c2410/mach-smdk2410.c b/arch/arm/mach-s3c2410/mach-smdk2410.c
index e17f033..75822ea 100644
--- a/arch/arm/mach-s3c2410/mach-smdk2410.c
+++ b/arch/arm/mach-s3c2410/mach-smdk2410.c
@@ -97,6 +97,11 @@ static struct platform_device *smdk2410_devices[] __initdata = {
static void __init smdk2410_map_io(void)
{
s3c24xx_init_io(smdk2410_iodesc, ARRAY_SIZE(smdk2410_iodesc));
+}
+
+static void __init smdk2410_init_early(void)
+{
+ s3c_init_early();
s3c24xx_init_clocks(0);
s3c24xx_init_uarts(smdk2410_uartcfgs, ARRAY_SIZE(smdk2410_uartcfgs));
}
@@ -113,6 +118,7 @@ MACHINE_START(SMDK2410, "SMDK2410") /* @TODO: request a new identifier and switc
/* Maintainer: Jonas Dietsche */
.boot_params = S3C2410_SDRAM_PA + 0x100,
.map_io = smdk2410_map_io,
+ .init_early = smdk2410_init_early,
.init_irq = s3c24xx_init_irq,
.init_machine = smdk2410_init,
.timer = &s3c24xx_timer,
diff --git a/arch/arm/mach-s3c2410/mach-tct_hammer.c b/arch/arm/mach-s3c2410/mach-tct_hammer.c
index 43c2b83..e17213c 100644
--- a/arch/arm/mach-s3c2410/mach-tct_hammer.c
+++ b/arch/arm/mach-s3c2410/mach-tct_hammer.c
@@ -135,6 +135,11 @@ static struct platform_device *tct_hammer_devices[] __initdata = {
static void __init tct_hammer_map_io(void)
{
s3c24xx_init_io(tct_hammer_iodesc, ARRAY_SIZE(tct_hammer_iodesc));
+}
+
+static void __init tct_hammer_init_early(void)
+{
+ s3c_init_early();
s3c24xx_init_clocks(0);
s3c24xx_init_uarts(tct_hammer_uartcfgs, ARRAY_SIZE(tct_hammer_uartcfgs));
}
@@ -148,6 +153,7 @@ static void __init tct_hammer_init(void)
MACHINE_START(TCT_HAMMER, "TCT_HAMMER")
.boot_params = S3C2410_SDRAM_PA + 0x100,
.map_io = tct_hammer_map_io,
+ .init_early = tct_hammer_init_early,
.init_irq = s3c24xx_init_irq,
.init_machine = tct_hammer_init,
.timer = &s3c24xx_timer,
diff --git a/arch/arm/mach-s3c2410/mach-vr1000.c b/arch/arm/mach-s3c2410/mach-vr1000.c
index 6ccce5a..a58227d 100644
--- a/arch/arm/mach-s3c2410/mach-vr1000.c
+++ b/arch/arm/mach-s3c2410/mach-vr1000.c
@@ -362,6 +362,11 @@ static void vr1000_power_off(void)
static void __init vr1000_map_io(void)
{
+ s3c24xx_init_io(vr1000_iodesc, ARRAY_SIZE(vr1000_iodesc));
+}
+
+static void __init vr1000_init_early(void)
+{
/* initialise clock sources */
s3c24xx_dclk0.parent = &clk_upll;
@@ -379,7 +384,7 @@ static void __init vr1000_map_io(void)
pm_power_off = vr1000_power_off;
- s3c24xx_init_io(vr1000_iodesc, ARRAY_SIZE(vr1000_iodesc));
+ s3c_init_early();
s3c24xx_init_clocks(0);
s3c24xx_init_uarts(vr1000_uartcfgs, ARRAY_SIZE(vr1000_uartcfgs));
}
@@ -402,6 +407,7 @@ MACHINE_START(VR1000, "Thorcom-VR1000")
/* Maintainer: Ben Dooks <ben-Y5A6D6n0/KfQXOPxS62xeg@public.gmane.org> */
.boot_params = S3C2410_SDRAM_PA + 0x100,
.map_io = vr1000_map_io,
+ .init_early = vr1000_init_early,
.init_machine = vr1000_init,
.init_irq = s3c24xx_init_irq,
.timer = &s3c24xx_timer,
diff --git a/arch/arm/mach-s3c2410/s3c2410.c b/arch/arm/mach-s3c2410/s3c2410.c
index f1d3bd8..b33a795 100644
--- a/arch/arm/mach-s3c2410/s3c2410.c
+++ b/arch/arm/mach-s3c2410/s3c2410.c
@@ -72,10 +72,13 @@ void __init s3c2410_init_uarts(struct s3c2410_uartcfg *cfg, int no)
void __init s3c2410_map_io(void)
{
+ iotable_init(s3c2410_iodesc, ARRAY_SIZE(s3c2410_iodesc));
+}
+
+void __init s3c2410_init_early(void)
+{
s3c24xx_gpiocfg_default.set_pull = s3c_gpio_setpull_1up;
s3c24xx_gpiocfg_default.get_pull = s3c_gpio_getpull_1up;
-
- iotable_init(s3c2410_iodesc, ARRAY_SIZE(s3c2410_iodesc));
}
void __init_or_cpufreq s3c2410_setup_clocks(void)
diff --git a/arch/arm/mach-s3c2412/mach-jive.c b/arch/arm/mach-s3c2412/mach-jive.c
index 85dcaeb..86c0028 100644
--- a/arch/arm/mach-s3c2412/mach-jive.c
+++ b/arch/arm/mach-s3c2412/mach-jive.c
@@ -516,6 +516,11 @@ static struct syscore_ops jive_pm_syscore_ops = {
static void __init jive_map_io(void)
{
s3c24xx_init_io(jive_iodesc, ARRAY_SIZE(jive_iodesc));
+}
+
+static void __init jive_init_early(void)
+{
+ s3c_init_early();
s3c24xx_init_clocks(12000000);
s3c24xx_init_uarts(jive_uartcfgs, ARRAY_SIZE(jive_uartcfgs));
}
@@ -670,8 +675,9 @@ MACHINE_START(JIVE, "JIVE")
/* Maintainer: Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org> */
.boot_params = S3C2410_SDRAM_PA + 0x100,
- .init_irq = s3c24xx_init_irq,
.map_io = jive_map_io,
+ .init_early = jive_init_early,
+ .init_irq = s3c24xx_init_irq,
.init_machine = jive_machine_init,
.timer = &s3c24xx_timer,
MACHINE_END
diff --git a/arch/arm/mach-s3c2412/mach-smdk2413.c b/arch/arm/mach-s3c2412/mach-smdk2413.c
index 834cfb6..1600356 100644
--- a/arch/arm/mach-s3c2412/mach-smdk2413.c
+++ b/arch/arm/mach-s3c2412/mach-smdk2413.c
@@ -92,8 +92,7 @@ static struct platform_device *smdk2413_devices[] __initdata = {
&s3c_device_usbgadget,
};
-static void __init smdk2413_fixup(struct machine_desc *desc,
- struct tag *tags, char **cmdline,
+static void __init smdk2413_fixup(struct tag *tags, char **cmdline,
struct meminfo *mi)
{
if (tags != phys_to_virt(S3C2410_SDRAM_PA + 0x100)) {
@@ -106,6 +105,11 @@ static void __init smdk2413_fixup(struct machine_desc *desc,
static void __init smdk2413_map_io(void)
{
s3c24xx_init_io(smdk2413_iodesc, ARRAY_SIZE(smdk2413_iodesc));
+}
+
+static void __init smdk2413_init_early(void)
+{
+ s3c_init_early();
s3c24xx_init_clocks(12000000);
s3c24xx_init_uarts(smdk2413_uartcfgs, ARRAY_SIZE(smdk2413_uartcfgs));
}
@@ -131,8 +135,9 @@ MACHINE_START(S3C2413, "S3C2413")
.boot_params = S3C2410_SDRAM_PA + 0x100,
.fixup = smdk2413_fixup,
- .init_irq = s3c24xx_init_irq,
.map_io = smdk2413_map_io,
+ .init_early = smdk2413_init_early,
+ .init_irq = s3c24xx_init_irq,
.init_machine = smdk2413_machine_init,
.timer = &s3c24xx_timer,
MACHINE_END
@@ -142,8 +147,9 @@ MACHINE_START(SMDK2412, "SMDK2412")
.boot_params = S3C2410_SDRAM_PA + 0x100,
.fixup = smdk2413_fixup,
- .init_irq = s3c24xx_init_irq,
.map_io = smdk2413_map_io,
+ .init_early = smdk2413_init_early,
+ .init_irq = s3c24xx_init_irq,
.init_machine = smdk2413_machine_init,
.timer = &s3c24xx_timer,
MACHINE_END
@@ -153,8 +159,9 @@ MACHINE_START(SMDK2413, "SMDK2413")
.boot_params = S3C2410_SDRAM_PA + 0x100,
.fixup = smdk2413_fixup,
- .init_irq = s3c24xx_init_irq,
.map_io = smdk2413_map_io,
+ .init_early = smdk2413_init_early,
+ .init_irq = s3c24xx_init_irq,
.init_machine = smdk2413_machine_init,
.timer = &s3c24xx_timer,
MACHINE_END
diff --git a/arch/arm/mach-s3c2412/mach-vstms.c b/arch/arm/mach-s3c2412/mach-vstms.c
index 83544eb..f05f4a4 100644
--- a/arch/arm/mach-s3c2412/mach-vstms.c
+++ b/arch/arm/mach-s3c2412/mach-vstms.c
@@ -129,9 +129,8 @@ static struct platform_device *vstms_devices[] __initdata = {
&s3c_device_nand,
};
-static void __init vstms_fixup(struct machine_desc *desc,
- struct tag *tags, char **cmdline,
- struct meminfo *mi)
+static void __init vstms_fixup(struct tag *tags, char **cmdline,
+ struct meminfo *mi)
{
if (tags != phys_to_virt(S3C2410_SDRAM_PA + 0x100)) {
mi->nr_banks=1;
@@ -143,6 +142,11 @@ static void __init vstms_fixup(struct machine_desc *desc,
static void __init vstms_map_io(void)
{
s3c24xx_init_io(vstms_iodesc, ARRAY_SIZE(vstms_iodesc));
+}
+
+static void __init vstms_init_early(void)
+{
+ s3c_init_early();
s3c24xx_init_clocks(12000000);
s3c24xx_init_uarts(vstms_uartcfgs, ARRAY_SIZE(vstms_uartcfgs));
}
@@ -159,8 +163,9 @@ MACHINE_START(VSTMS, "VSTMS")
.boot_params = S3C2410_SDRAM_PA + 0x100,
.fixup = vstms_fixup,
+ .map_io = vstms_map_io,
+ .init_early = vstms_init_early,
.init_irq = s3c24xx_init_irq,
.init_machine = vstms_init,
- .map_io = vstms_map_io,
.timer = &s3c24xx_timer,
MACHINE_END
diff --git a/arch/arm/mach-s3c2412/s3c2412.c b/arch/arm/mach-s3c2412/s3c2412.c
index ef0958d..1704cda 100644
--- a/arch/arm/mach-s3c2412/s3c2412.c
+++ b/arch/arm/mach-s3c2412/s3c2412.c
@@ -156,6 +156,13 @@ static void s3c2412_hard_reset(void)
void __init s3c2412_map_io(void)
{
+ /* register our io-tables */
+
+ iotable_init(s3c2412_iodesc, ARRAY_SIZE(s3c2412_iodesc));
+}
+
+void __init s3c2412_init_early(void)
+{
/* move base of IO */
s3c2412_init_gpio2();
@@ -167,10 +174,6 @@ void __init s3c2412_map_io(void)
/* set custom reset hook */
s3c24xx_reset_hook = s3c2412_hard_reset;
-
- /* register our io-tables */
-
- iotable_init(s3c2412_iodesc, ARRAY_SIZE(s3c2412_iodesc));
}
void __init_or_cpufreq s3c2412_setup_clocks(void)
diff --git a/arch/arm/mach-s3c2416/mach-smdk2416.c b/arch/arm/mach-s3c2416/mach-smdk2416.c
index ac27ebb..2e540fb 100644
--- a/arch/arm/mach-s3c2416/mach-smdk2416.c
+++ b/arch/arm/mach-s3c2416/mach-smdk2416.c
@@ -216,6 +216,11 @@ static struct platform_device *smdk2416_devices[] __initdata = {
static void __init smdk2416_map_io(void)
{
s3c24xx_init_io(smdk2416_iodesc, ARRAY_SIZE(smdk2416_iodesc));
+}
+
+static void __init smdk2416_init_early(void)
+{
+ s3c_init_early();
s3c24xx_init_clocks(12000000);
s3c24xx_init_uarts(smdk2416_uartcfgs, ARRAY_SIZE(smdk2416_uartcfgs));
}
@@ -247,8 +252,9 @@ MACHINE_START(SMDK2416, "SMDK2416")
/* Maintainer: Yauhen Kharuzhy <jekhor-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> */
.boot_params = S3C2410_SDRAM_PA + 0x100,
- .init_irq = s3c24xx_init_irq,
.map_io = smdk2416_map_io,
+ .init_early = smdk2416_init_early,
+ .init_irq = s3c24xx_init_irq,
.init_machine = smdk2416_machine_init,
.timer = &s3c24xx_timer,
MACHINE_END
diff --git a/arch/arm/mach-s3c2416/s3c2416.c b/arch/arm/mach-s3c2416/s3c2416.c
index 494ce91..9e641d4 100644
--- a/arch/arm/mach-s3c2416/s3c2416.c
+++ b/arch/arm/mach-s3c2416/s3c2416.c
@@ -118,14 +118,17 @@ void __init s3c2416_init_uarts(struct s3c2410_uartcfg *cfg, int no)
void __init s3c2416_map_io(void)
{
+ iotable_init(s3c2416_iodesc, ARRAY_SIZE(s3c2416_iodesc));
+}
+
+void __init s3c2416_init_early(void)
+{
s3c24xx_gpiocfg_default.set_pull = s3c_gpio_setpull_updown;
s3c24xx_gpiocfg_default.get_pull = s3c_gpio_getpull_updown;
/* initialize device information early */
s3c2416_default_sdhci0();
s3c2416_default_sdhci1();
-
- iotable_init(s3c2416_iodesc, ARRAY_SIZE(s3c2416_iodesc));
}
/* need to register class before we actually register the device, and
diff --git a/arch/arm/mach-s3c2440/mach-anubis.c b/arch/arm/mach-s3c2440/mach-anubis.c
index d708678..1fe84849 100644
--- a/arch/arm/mach-s3c2440/mach-anubis.c
+++ b/arch/arm/mach-s3c2440/mach-anubis.c
@@ -451,6 +451,11 @@ static struct s3c24xx_audio_simtec_pdata __initdata anubis_audio = {
static void __init anubis_map_io(void)
{
+ s3c24xx_init_io(anubis_iodesc, ARRAY_SIZE(anubis_iodesc));
+}
+
+static void __init anubis_init_early(void)
+{
/* initialise the clocks */
s3c24xx_dclk0.parent = &clk_upll;
@@ -466,7 +471,7 @@ static void __init anubis_map_io(void)
s3c24xx_register_clocks(anubis_clocks, ARRAY_SIZE(anubis_clocks));
- s3c24xx_init_io(anubis_iodesc, ARRAY_SIZE(anubis_iodesc));
+ s3c_init_early();
s3c24xx_init_clocks(0);
s3c24xx_init_uarts(anubis_uartcfgs, ARRAY_SIZE(anubis_uartcfgs));
@@ -500,6 +505,7 @@ MACHINE_START(ANUBIS, "Simtec-Anubis")
/* Maintainer: Ben Dooks <ben-Y5A6D6n0/KfQXOPxS62xeg@public.gmane.org> */
.boot_params = S3C2410_SDRAM_PA + 0x100,
.map_io = anubis_map_io,
+ .init_early = anubis_init_early,
.init_machine = anubis_init,
.init_irq = s3c24xx_init_irq,
.timer = &s3c24xx_timer,
diff --git a/arch/arm/mach-s3c2440/mach-at2440evb.c b/arch/arm/mach-s3c2440/mach-at2440evb.c
index 6c98b78..d2512fd 100644
--- a/arch/arm/mach-s3c2440/mach-at2440evb.c
+++ b/arch/arm/mach-s3c2440/mach-at2440evb.c
@@ -217,6 +217,11 @@ static struct platform_device *at2440evb_devices[] __initdata = {
static void __init at2440evb_map_io(void)
{
s3c24xx_init_io(at2440evb_iodesc, ARRAY_SIZE(at2440evb_iodesc));
+}
+
+static void __init at2440evb_init_early(void)
+{
+ s3c_init_early();
s3c24xx_init_clocks(16934400);
s3c24xx_init_uarts(at2440evb_uartcfgs, ARRAY_SIZE(at2440evb_uartcfgs));
}
@@ -235,6 +240,7 @@ static void __init at2440evb_init(void)
MACHINE_START(AT2440EVB, "AT2440EVB")
.boot_params = S3C2410_SDRAM_PA + 0x100,
.map_io = at2440evb_map_io,
+ .init_early = at2440evb_init_early,
.init_machine = at2440evb_init,
.init_irq = s3c24xx_init_irq,
.timer = &s3c24xx_timer,
diff --git a/arch/arm/mach-s3c2440/mach-gta02.c b/arch/arm/mach-s3c2440/mach-gta02.c
index 7166620..9638e4c 100644
--- a/arch/arm/mach-s3c2440/mach-gta02.c
+++ b/arch/arm/mach-s3c2440/mach-gta02.c
@@ -509,6 +509,11 @@ static struct platform_device gta02_buttons_device = {
static void __init gta02_map_io(void)
{
s3c24xx_init_io(gta02_iodesc, ARRAY_SIZE(gta02_iodesc));
+}
+
+static void __init gta02_init_early(void)
+{
+ s3c_init_early();
s3c24xx_init_clocks(12000000);
s3c24xx_init_uarts(gta02_uartcfgs, ARRAY_SIZE(gta02_uartcfgs));
}
@@ -598,6 +603,7 @@ MACHINE_START(NEO1973_GTA02, "GTA02")
/* Maintainer: Nelson Castillo <arhuaco-pI7LgTZv5U2z2LnJBvBa6V6hYfS7NtTn@public.gmane.org> */
.boot_params = S3C2410_SDRAM_PA + 0x100,
.map_io = gta02_map_io,
+ .init_early = gta02_init_early,
.init_irq = s3c24xx_init_irq,
.init_machine = gta02_machine_init,
.timer = &s3c24xx_timer,
diff --git a/arch/arm/mach-s3c2440/mach-mini2440.c b/arch/arm/mach-s3c2440/mach-mini2440.c
index dd3120d..dffa92b 100644
--- a/arch/arm/mach-s3c2440/mach-mini2440.c
+++ b/arch/arm/mach-s3c2440/mach-mini2440.c
@@ -516,6 +516,11 @@ static struct platform_device *mini2440_devices[] __initdata = {
static void __init mini2440_map_io(void)
{
s3c24xx_init_io(mini2440_iodesc, ARRAY_SIZE(mini2440_iodesc));
+}
+
+static void __init mini2440_init_early(void)
+{
+ s3c_init_early();
s3c24xx_init_clocks(12000000);
s3c24xx_init_uarts(mini2440_uartcfgs, ARRAY_SIZE(mini2440_uartcfgs));
}
@@ -678,7 +683,8 @@ MACHINE_START(MINI2440, "MINI2440")
/* Maintainer: Michel Pollet <buserror-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> */
.boot_params = S3C2410_SDRAM_PA + 0x100,
.map_io = mini2440_map_io,
- .init_machine = mini2440_init,
+ .init_early = mini2440_init_early,
.init_irq = s3c24xx_init_irq,
+ .init_machine = mini2440_init,
.timer = &s3c24xx_timer,
MACHINE_END
diff --git a/arch/arm/mach-s3c2440/mach-nexcoder.c b/arch/arm/mach-s3c2440/mach-nexcoder.c
index 37dd306..07a2698 100644
--- a/arch/arm/mach-s3c2440/mach-nexcoder.c
+++ b/arch/arm/mach-s3c2440/mach-nexcoder.c
@@ -137,6 +137,11 @@ static void __init nexcoder_sensorboard_init(void)
static void __init nexcoder_map_io(void)
{
s3c24xx_init_io(nexcoder_iodesc, ARRAY_SIZE(nexcoder_iodesc));
+}
+
+static void __init nexcoder_init_early(void)
+{
+ s3c_init_early();
s3c24xx_init_clocks(0);
s3c24xx_init_uarts(nexcoder_uartcfgs, ARRAY_SIZE(nexcoder_uartcfgs));
@@ -153,6 +158,7 @@ MACHINE_START(NEXCODER_2440, "NexVision - Nexcoder 2440")
/* Maintainer: Guillaume GOURAT <guillaume.gourat-SG84m9Bk/uxjrEqMGRc/AA@public.gmane.org> */
.boot_params = S3C2410_SDRAM_PA + 0x100,
.map_io = nexcoder_map_io,
+ .init_early = nexcoder_init_early,
.init_machine = nexcoder_init,
.init_irq = s3c24xx_init_irq,
.timer = &s3c24xx_timer,
diff --git a/arch/arm/mach-s3c2440/mach-osiris.c b/arch/arm/mach-s3c2440/mach-osiris.c
index d885363..80370cc 100644
--- a/arch/arm/mach-s3c2440/mach-osiris.c
+++ b/arch/arm/mach-s3c2440/mach-osiris.c
@@ -390,6 +390,11 @@ static struct s3c_cpufreq_board __initdata osiris_cpufreq = {
static void __init osiris_map_io(void)
{
+ s3c24xx_init_io(osiris_iodesc, ARRAY_SIZE(osiris_iodesc));
+}
+
+static void __init osiris_init_early(void)
+{
unsigned long flags;
/* initialise the clocks */
@@ -407,7 +412,7 @@ static void __init osiris_map_io(void)
s3c24xx_register_clocks(osiris_clocks, ARRAY_SIZE(osiris_clocks));
- s3c24xx_init_io(osiris_iodesc, ARRAY_SIZE(osiris_iodesc));
+ s3c_init_early();
s3c24xx_init_clocks(0);
s3c24xx_init_uarts(osiris_uartcfgs, ARRAY_SIZE(osiris_uartcfgs));
@@ -449,6 +454,7 @@ MACHINE_START(OSIRIS, "Simtec-OSIRIS")
/* Maintainer: Ben Dooks <ben-Y5A6D6n0/KfQXOPxS62xeg@public.gmane.org> */
.boot_params = S3C2410_SDRAM_PA + 0x100,
.map_io = osiris_map_io,
+ .init_early = osiris_init_early,
.init_irq = s3c24xx_init_irq,
.init_machine = osiris_init,
.timer = &s3c24xx_timer,
diff --git a/arch/arm/mach-s3c2440/mach-rx1950.c b/arch/arm/mach-s3c2440/mach-rx1950.c
index 27ea950..27fcac0 100644
--- a/arch/arm/mach-s3c2440/mach-rx1950.c
+++ b/arch/arm/mach-s3c2440/mach-rx1950.c
@@ -750,12 +750,17 @@ static struct clk *rx1950_clocks[] __initdata = {
static void __init rx1950_map_io(void)
{
+ s3c24xx_init_io(rx1950_iodesc, ARRAY_SIZE(rx1950_iodesc));
+}
+
+static void __init rx1950_init_early(void)
+{
s3c24xx_clkout0.parent = &clk_h;
s3c24xx_clkout1.parent = &clk_f;
s3c24xx_register_clocks(rx1950_clocks, ARRAY_SIZE(rx1950_clocks));
- s3c24xx_init_io(rx1950_iodesc, ARRAY_SIZE(rx1950_iodesc));
+ s3c_init_early();
s3c24xx_init_clocks(16934000);
s3c24xx_init_uarts(rx1950_uartcfgs, ARRAY_SIZE(rx1950_uartcfgs));
@@ -826,8 +831,9 @@ static void __init rx1950_reserve(void)
MACHINE_START(RX1950, "HP iPAQ RX1950")
/* Maintainers: Vasily Khoruzhick */
.boot_params = S3C2410_SDRAM_PA + 0x100,
+ .reserve = rx1950_reserve,
.map_io = rx1950_map_io,
- .reserve = rx1950_reserve,
+ .init_early = rx1950_init_early,
.init_irq = s3c24xx_init_irq,
.init_machine = rx1950_init_machine,
.timer = &s3c24xx_timer,
diff --git a/arch/arm/mach-s3c2440/mach-rx3715.c b/arch/arm/mach-s3c2440/mach-rx3715.c
index 1472b1a..e3d5825 100644
--- a/arch/arm/mach-s3c2440/mach-rx3715.c
+++ b/arch/arm/mach-s3c2440/mach-rx3715.c
@@ -188,6 +188,11 @@ static struct platform_device *rx3715_devices[] __initdata = {
static void __init rx3715_map_io(void)
{
s3c24xx_init_io(rx3715_iodesc, ARRAY_SIZE(rx3715_iodesc));
+}
+
+static void __init rx3715_init_early(void)
+{
+ s3c_init_early();
s3c24xx_init_clocks(16934000);
s3c24xx_init_uarts(rx3715_uartcfgs, ARRAY_SIZE(rx3715_uartcfgs));
}
@@ -219,8 +224,9 @@ static void __init rx3715_init_machine(void)
MACHINE_START(RX3715, "IPAQ-RX3715")
/* Maintainer: Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org> */
.boot_params = S3C2410_SDRAM_PA + 0x100,
- .map_io = rx3715_map_io,
.reserve = rx3715_reserve,
+ .map_io = rx3715_map_io,
+ .init_early = rx3715_init_early,
.init_irq = rx3715_init_irq,
.init_machine = rx3715_init_machine,
.timer = &s3c24xx_timer,
diff --git a/arch/arm/mach-s3c2440/mach-smdk2440.c b/arch/arm/mach-s3c2440/mach-smdk2440.c
index eedfe0f..e7c3aee 100644
--- a/arch/arm/mach-s3c2440/mach-smdk2440.c
+++ b/arch/arm/mach-s3c2440/mach-smdk2440.c
@@ -160,6 +160,11 @@ static struct platform_device *smdk2440_devices[] __initdata = {
static void __init smdk2440_map_io(void)
{
s3c24xx_init_io(smdk2440_iodesc, ARRAY_SIZE(smdk2440_iodesc));
+}
+
+static void __init smdk2440_init_early(void)
+{
+ s3c_init_early();
s3c24xx_init_clocks(16934400);
s3c24xx_init_uarts(smdk2440_uartcfgs, ARRAY_SIZE(smdk2440_uartcfgs));
}
@@ -177,8 +182,9 @@ MACHINE_START(S3C2440, "SMDK2440")
/* Maintainer: Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org> */
.boot_params = S3C2410_SDRAM_PA + 0x100,
- .init_irq = s3c24xx_init_irq,
.map_io = smdk2440_map_io,
+ .init_early = smdk2440_init_early,
+ .init_irq = s3c24xx_init_irq,
.init_machine = smdk2440_machine_init,
.timer = &s3c24xx_timer,
MACHINE_END
diff --git a/arch/arm/mach-s3c2440/s3c244x.c b/arch/arm/mach-s3c2440/s3c244x.c
index 7e8a23d..51079de 100644
--- a/arch/arm/mach-s3c2440/s3c244x.c
+++ b/arch/arm/mach-s3c2440/s3c244x.c
@@ -65,7 +65,10 @@ void __init s3c244x_map_io(void)
/* register our io-tables */
iotable_init(s3c244x_iodesc, ARRAY_SIZE(s3c244x_iodesc));
+}
+void __init s3c244x_init_early(void)
+{
/* rename any peripherals used differing from the s3c2410 */
s3c_device_sdi.name = "s3c2440-sdi";
diff --git a/arch/arm/mach-s3c2443/mach-smdk2443.c b/arch/arm/mach-s3c2443/mach-smdk2443.c
index 514275e..e488490 100644
--- a/arch/arm/mach-s3c2443/mach-smdk2443.c
+++ b/arch/arm/mach-s3c2443/mach-smdk2443.c
@@ -121,6 +121,11 @@ static struct platform_device *smdk2443_devices[] __initdata = {
static void __init smdk2443_map_io(void)
{
s3c24xx_init_io(smdk2443_iodesc, ARRAY_SIZE(smdk2443_iodesc));
+}
+
+static void __init smdk2443_init_early(void)
+{
+ s3c_init_early();
s3c24xx_init_clocks(12000000);
s3c24xx_init_uarts(smdk2443_uartcfgs, ARRAY_SIZE(smdk2443_uartcfgs));
}
@@ -141,8 +146,9 @@ MACHINE_START(SMDK2443, "SMDK2443")
/* Maintainer: Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org> */
.boot_params = S3C2410_SDRAM_PA + 0x100,
- .init_irq = s3c24xx_init_irq,
.map_io = smdk2443_map_io,
+ .init_early = smdk2443_init_early,
+ .init_irq = s3c24xx_init_irq,
.init_machine = smdk2443_machine_init,
.timer = &s3c24xx_timer,
MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/cpu.c b/arch/arm/mach-s3c64xx/cpu.c
index 374e45e..7ea1014 100644
--- a/arch/arm/mach-s3c64xx/cpu.c
+++ b/arch/arm/mach-s3c64xx/cpu.c
@@ -45,7 +45,7 @@ static struct cpu_table cpu_ids[] __initdata = {
{
.idcode = 0x36400000,
.idmask = 0xfffff000,
- .map_io = s3c6400_map_io,
+ .init_early = s3c6400_init_early,
.init_clocks = s3c6400_init_clocks,
.init_uarts = s3c6400_init_uarts,
.init = s3c6400_init,
@@ -53,7 +53,7 @@ static struct cpu_table cpu_ids[] __initdata = {
}, {
.idcode = 0x36410100,
.idmask = 0xffffff00,
- .map_io = s3c6410_map_io,
+ .init_early = s3c6410_init_early,
.init_clocks = s3c6410_init_clocks,
.init_uarts = s3c6410_init_uarts,
.init = s3c6410_init,
diff --git a/arch/arm/mach-s3c64xx/include/mach/s3c6400.h b/arch/arm/mach-s3c64xx/include/mach/s3c6400.h
index f86958d..be18bc2 100644
--- a/arch/arm/mach-s3c64xx/include/mach/s3c6400.h
+++ b/arch/arm/mach-s3c64xx/include/mach/s3c6400.h
@@ -22,15 +22,15 @@ extern void s3c64xx_register_clocks(unsigned long xtal, unsigned armclk_limit);
#ifdef CONFIG_CPU_S3C6400
extern int s3c6400_init(void);
+extern void s3c6400_init_early(void);
extern void s3c6400_init_irq(void);
-extern void s3c6400_map_io(void);
extern void s3c6400_init_clocks(int xtal);
#define s3c6400_init_uarts s3c6400_common_init_uarts
#else
+#define s3c6400_init_early NULL
#define s3c6400_init_clocks NULL
#define s3c6400_init_uarts NULL
-#define s3c6400_map_io NULL
#define s3c6400_init NULL
#endif
diff --git a/arch/arm/mach-s3c64xx/include/mach/s3c6410.h b/arch/arm/mach-s3c64xx/include/mach/s3c6410.h
index 24f1141..23df174 100644
--- a/arch/arm/mach-s3c64xx/include/mach/s3c6410.h
+++ b/arch/arm/mach-s3c64xx/include/mach/s3c6410.h
@@ -15,15 +15,15 @@
#ifdef CONFIG_CPU_S3C6410
extern int s3c6410_init(void);
+extern void s3c6410_init_early(void);
extern void s3c6410_init_irq(void);
-extern void s3c6410_map_io(void);
extern void s3c6410_init_clocks(int xtal);
#define s3c6410_init_uarts s3c6400_common_init_uarts
#else
+#define s3c6410_init_early NULL
#define s3c6410_init_clocks NULL
#define s3c6410_init_uarts NULL
-#define s3c6410_map_io NULL
#define s3c6410_init NULL
#endif
diff --git a/arch/arm/mach-s3c64xx/mach-anw6410.c b/arch/arm/mach-s3c64xx/mach-anw6410.c
index a53cf14..5c7ed76 100644
--- a/arch/arm/mach-s3c64xx/mach-anw6410.c
+++ b/arch/arm/mach-s3c64xx/mach-anw6410.c
@@ -213,6 +213,11 @@ static struct platform_device *anw6410_devices[] __initdata = {
static void __init anw6410_map_io(void)
{
s3c64xx_init_io(anw6410_iodesc, ARRAY_SIZE(anw6410_iodesc));
+}
+
+static void __init anw6410_init_early(void)
+{
+ s3c_init_early();
s3c24xx_init_clocks(12000000);
s3c24xx_init_uarts(anw6410_uartcfgs, ARRAY_SIZE(anw6410_uartcfgs));
@@ -235,8 +240,9 @@ MACHINE_START(ANW6410, "A&W6410")
/* Maintainer: Kwangwoo Lee <kwangwoo.lee-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> */
.boot_params = S3C64XX_PA_SDRAM + 0x100,
- .init_irq = s3c6410_init_irq,
.map_io = anw6410_map_io,
+ .init_early = anw6410_init_early,
+ .init_irq = s3c6410_init_irq,
.init_machine = anw6410_machine_init,
.timer = &s3c24xx_timer,
MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-hmt.c b/arch/arm/mach-s3c64xx/mach-hmt.c
index b263958..aaaaa5e 100644
--- a/arch/arm/mach-s3c64xx/mach-hmt.c
+++ b/arch/arm/mach-s3c64xx/mach-hmt.c
@@ -241,6 +241,11 @@ static struct platform_device *hmt_devices[] __initdata = {
static void __init hmt_map_io(void)
{
s3c64xx_init_io(hmt_iodesc, ARRAY_SIZE(hmt_iodesc));
+}
+
+static void __init hmt_init_early(void)
+{
+ s3c_init_early();
s3c24xx_init_clocks(12000000);
s3c24xx_init_uarts(hmt_uartcfgs, ARRAY_SIZE(hmt_uartcfgs));
}
@@ -266,8 +271,9 @@ static void __init hmt_machine_init(void)
MACHINE_START(HMT, "Airgoo-HMT")
/* Maintainer: Peter Korsgaard <jacmet-OfajU3CKLf1/SzgSGea1oA@public.gmane.org> */
.boot_params = S3C64XX_PA_SDRAM + 0x100,
- .init_irq = s3c6410_init_irq,
.map_io = hmt_map_io,
+ .init_early = hmt_init_early,
+ .init_irq = s3c6410_init_irq,
.init_machine = hmt_machine_init,
.timer = &s3c24xx_timer,
MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-mini6410.c b/arch/arm/mach-s3c64xx/mach-mini6410.c
index 89f35e0..5e0d3d6 100644
--- a/arch/arm/mach-s3c64xx/mach-mini6410.c
+++ b/arch/arm/mach-s3c64xx/mach-mini6410.c
@@ -225,9 +225,14 @@ static struct platform_device *mini6410_devices[] __initdata = {
static void __init mini6410_map_io(void)
{
+ s3c64xx_init_io(NULL, 0);
+}
+
+static void __init mini6410_init_early(void)
+{
u32 tmp;
- s3c64xx_init_io(NULL, 0);
+ s3c_init_early();
s3c24xx_init_clocks(12000000);
s3c24xx_init_uarts(mini6410_uartcfgs, ARRAY_SIZE(mini6410_uartcfgs));
@@ -350,8 +355,9 @@ static void __init mini6410_machine_init(void)
MACHINE_START(MINI6410, "MINI6410")
/* Maintainer: Darius Augulis <augulis.darius-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> */
.boot_params = S3C64XX_PA_SDRAM + 0x100,
- .init_irq = s3c6410_init_irq,
.map_io = mini6410_map_io,
+ .init_early = mini6410_init_early,
+ .init_irq = s3c6410_init_irq,
.init_machine = mini6410_machine_init,
.timer = &s3c24xx_timer,
MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-ncp.c b/arch/arm/mach-s3c64xx/mach-ncp.c
index c498649..f00a136 100644
--- a/arch/arm/mach-s3c64xx/mach-ncp.c
+++ b/arch/arm/mach-s3c64xx/mach-ncp.c
@@ -84,6 +84,11 @@ static struct map_desc ncp_iodesc[] __initdata = {};
static void __init ncp_map_io(void)
{
s3c64xx_init_io(ncp_iodesc, ARRAY_SIZE(ncp_iodesc));
+}
+
+static void __init ncp_init_early(void)
+{
+ s3c_init_early();
s3c24xx_init_clocks(12000000);
s3c24xx_init_uarts(ncp_uartcfgs, ARRAY_SIZE(ncp_uartcfgs));
}
@@ -98,8 +103,9 @@ static void __init ncp_machine_init(void)
MACHINE_START(NCP, "NCP")
/* Maintainer: Samsung Electronics */
.boot_params = S3C64XX_PA_SDRAM + 0x100,
- .init_irq = s3c6410_init_irq,
.map_io = ncp_map_io,
+ .init_early = ncp_init_early,
+ .init_irq = s3c6410_init_irq,
.init_machine = ncp_machine_init,
.timer = &s3c24xx_timer,
MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-real6410.c b/arch/arm/mach-s3c64xx/mach-real6410.c
index 4957ab0..b722fd8 100644
--- a/arch/arm/mach-s3c64xx/mach-real6410.c
+++ b/arch/arm/mach-s3c64xx/mach-real6410.c
@@ -206,9 +206,14 @@ static struct s3c2410_ts_mach_info s3c_ts_platform __initdata = {
static void __init real6410_map_io(void)
{
+ s3c64xx_init_io(NULL, 0);
+}
+
+static void __init real6410_init_early(void)
+{
u32 tmp;
- s3c64xx_init_io(NULL, 0);
+ s3c_init_early();
s3c24xx_init_clocks(12000000);
s3c24xx_init_uarts(real6410_uartcfgs, ARRAY_SIZE(real6410_uartcfgs));
@@ -331,8 +336,9 @@ MACHINE_START(REAL6410, "REAL6410")
/* Maintainer: Darius Augulis <augulis.darius-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> */
.boot_params = S3C64XX_PA_SDRAM + 0x100,
- .init_irq = s3c6410_init_irq,
.map_io = real6410_map_io,
+ .init_early = real6410_init_early,
+ .init_irq = s3c6410_init_irq,
.init_machine = real6410_machine_init,
.timer = &s3c24xx_timer,
MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-smartq.c b/arch/arm/mach-s3c64xx/mach-smartq.c
index cb1ebeb..1c05c4e 100644
--- a/arch/arm/mach-s3c64xx/mach-smartq.c
+++ b/arch/arm/mach-s3c64xx/mach-smartq.c
@@ -372,6 +372,11 @@ static struct map_desc smartq_iodesc[] __initdata = {};
void __init smartq_map_io(void)
{
s3c64xx_init_io(smartq_iodesc, ARRAY_SIZE(smartq_iodesc));
+}
+
+void __init smartq_init_early(void)
+{
+ s3c_init_early();
s3c24xx_init_clocks(12000000);
s3c24xx_init_uarts(smartq_uartcfgs, ARRAY_SIZE(smartq_uartcfgs));
diff --git a/arch/arm/mach-s3c64xx/mach-smartq.h b/arch/arm/mach-s3c64xx/mach-smartq.h
index 8e8b693..3d1c73a 100644
--- a/arch/arm/mach-s3c64xx/mach-smartq.h
+++ b/arch/arm/mach-s3c64xx/mach-smartq.h
@@ -15,6 +15,7 @@
#include <linux/init.h>
extern void __init smartq_map_io(void);
+extern void __init smartq_init_early(void);
extern void __init smartq_machine_init(void);
#endif /* __MACH_SMARTQ_H */
diff --git a/arch/arm/mach-s3c64xx/mach-smartq5.c b/arch/arm/mach-s3c64xx/mach-smartq5.c
index 3a3e5ac..884aecd 100644
--- a/arch/arm/mach-s3c64xx/mach-smartq5.c
+++ b/arch/arm/mach-s3c64xx/mach-smartq5.c
@@ -147,8 +147,9 @@ static void __init smartq5_machine_init(void)
MACHINE_START(SMARTQ5, "SmartQ 5")
/* Maintainer: Maurus Cuelenaere <mcuelenaere AT gmail DOT com> */
.boot_params = S3C64XX_PA_SDRAM + 0x100,
- .init_irq = s3c6410_init_irq,
.map_io = smartq_map_io,
+ .init_early = smartq_init_early,
+ .init_irq = s3c6410_init_irq,
.init_machine = smartq5_machine_init,
.timer = &s3c24xx_timer,
MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-smartq7.c b/arch/arm/mach-s3c64xx/mach-smartq7.c
index e653758..b8978ed 100644
--- a/arch/arm/mach-s3c64xx/mach-smartq7.c
+++ b/arch/arm/mach-s3c64xx/mach-smartq7.c
@@ -163,8 +163,9 @@ static void __init smartq7_machine_init(void)
MACHINE_START(SMARTQ7, "SmartQ 7")
/* Maintainer: Maurus Cuelenaere <mcuelenaere AT gmail DOT com> */
.boot_params = S3C64XX_PA_SDRAM + 0x100,
- .init_irq = s3c6410_init_irq,
.map_io = smartq_map_io,
+ .init_early = smartq_init_early,
+ .init_irq = s3c6410_init_irq,
.init_machine = smartq7_machine_init,
.timer = &s3c24xx_timer,
MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-smdk6400.c b/arch/arm/mach-s3c64xx/mach-smdk6400.c
index 3cca642..2af88bc 100644
--- a/arch/arm/mach-s3c64xx/mach-smdk6400.c
+++ b/arch/arm/mach-s3c64xx/mach-smdk6400.c
@@ -63,6 +63,11 @@ static struct map_desc smdk6400_iodesc[] = {};
static void __init smdk6400_map_io(void)
{
s3c64xx_init_io(smdk6400_iodesc, ARRAY_SIZE(smdk6400_iodesc));
+}
+
+static void __init smdk6400_init_early(void)
+{
+ s3c_init_early();
s3c24xx_init_clocks(12000000);
s3c24xx_init_uarts(smdk6400_uartcfgs, ARRAY_SIZE(smdk6400_uartcfgs));
}
@@ -87,8 +92,9 @@ MACHINE_START(SMDK6400, "SMDK6400")
/* Maintainer: Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org> */
.boot_params = S3C64XX_PA_SDRAM + 0x100,
- .init_irq = s3c6400_init_irq,
.map_io = smdk6400_map_io,
+ .init_early = smdk6400_init_early,
+ .init_irq = s3c6400_init_irq,
.init_machine = smdk6400_machine_init,
.timer = &s3c24xx_timer,
MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-smdk6410.c b/arch/arm/mach-s3c64xx/mach-smdk6410.c
index 2c0353a..efcd691 100644
--- a/arch/arm/mach-s3c64xx/mach-smdk6410.c
+++ b/arch/arm/mach-s3c64xx/mach-smdk6410.c
@@ -681,9 +681,14 @@ static struct s3c2410_ts_mach_info s3c_ts_platform __initdata = {
static void __init smdk6410_map_io(void)
{
+ s3c64xx_init_io(smdk6410_iodesc, ARRAY_SIZE(smdk6410_iodesc));
+}
+
+static void __init smdk6410_init_early(void)
+{
u32 tmp;
- s3c64xx_init_io(smdk6410_iodesc, ARRAY_SIZE(smdk6410_iodesc));
+ s3c_init_early();
s3c24xx_init_clocks(12000000);
s3c24xx_init_uarts(smdk6410_uartcfgs, ARRAY_SIZE(smdk6410_uartcfgs));
@@ -747,8 +752,9 @@ MACHINE_START(SMDK6410, "SMDK6410")
/* Maintainer: Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org> */
.boot_params = S3C64XX_PA_SDRAM + 0x100,
- .init_irq = s3c6410_init_irq,
.map_io = smdk6410_map_io,
+ .init_early = smdk6410_init_early,
+ .init_irq = s3c6410_init_irq,
.init_machine = smdk6410_machine_init,
.timer = &s3c24xx_timer,
MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/s3c6400.c b/arch/arm/mach-s3c64xx/s3c6400.c
index 5e93fe3..68c90c9 100644
--- a/arch/arm/mach-s3c64xx/s3c6400.c
+++ b/arch/arm/mach-s3c64xx/s3c6400.c
@@ -40,7 +40,7 @@
#include <plat/onenand-core.h>
#include <mach/s3c6400.h>
-void __init s3c6400_map_io(void)
+void __init s3c6400_init_early(void)
{
/* setup SDHCI */
diff --git a/arch/arm/mach-s3c64xx/s3c6410.c b/arch/arm/mach-s3c64xx/s3c6410.c
index 312aa6b..47c464c 100644
--- a/arch/arm/mach-s3c64xx/s3c6410.c
+++ b/arch/arm/mach-s3c64xx/s3c6410.c
@@ -44,7 +44,7 @@
#include <mach/s3c6400.h>
#include <mach/s3c6410.h>
-void __init s3c6410_map_io(void)
+void __init s3c6410_init_early(void)
{
/* initialise device information early */
s3c6410_default_sdhci0();
diff --git a/arch/arm/mach-s5p64x0/cpu.c b/arch/arm/mach-s5p64x0/cpu.c
index a5c0095..2516453 100644
--- a/arch/arm/mach-s5p64x0/cpu.c
+++ b/arch/arm/mach-s5p64x0/cpu.c
@@ -106,22 +106,28 @@ static void s5p64x0_idle(void)
void __init s5p6440_map_io(void)
{
- /* initialize any device information early */
- s3c_adc_setname("s3c64xx-adc");
-
iotable_init(s5p64x0_iodesc, ARRAY_SIZE(s5p64x0_iodesc));
iotable_init(s5p6440_iodesc, ARRAY_SIZE(s5p6440_iodesc));
}
-void __init s5p6450_map_io(void)
+void __init s5p6440_init_early(void)
{
/* initialize any device information early */
s3c_adc_setname("s3c64xx-adc");
+}
+void __init s5p6450_map_io(void)
+{
iotable_init(s5p64x0_iodesc, ARRAY_SIZE(s5p64x0_iodesc));
iotable_init(s5p6450_iodesc, ARRAY_SIZE(s5p6450_iodesc));
}
+void __init s5p6450_init_early(void)
+{
+ /* initialize any device information early */
+ s3c_adc_setname("s3c64xx-adc");
+}
+
/*
* s5p64x0_init_clocks
*
diff --git a/arch/arm/mach-s5p64x0/mach-smdk6440.c b/arch/arm/mach-s5p64x0/mach-smdk6440.c
index 2d559f1..e5a13d8 100644
--- a/arch/arm/mach-s5p64x0/mach-smdk6440.c
+++ b/arch/arm/mach-s5p64x0/mach-smdk6440.c
@@ -178,6 +178,11 @@ static struct s3c2410_ts_mach_info s3c_ts_platform __initdata = {
static void __init smdk6440_map_io(void)
{
s5p_init_io(NULL, 0, S5P64X0_SYS_ID);
+}
+
+static void __init smdk6440_init_early(void)
+{
+ s3c_init_early();
s3c24xx_init_clocks(12000000);
s3c24xx_init_uarts(smdk6440_uartcfgs, ARRAY_SIZE(smdk6440_uartcfgs));
s5p_set_timer_source(S5P_PWM3, S5P_PWM4);
@@ -201,8 +206,9 @@ MACHINE_START(SMDK6440, "SMDK6440")
/* Maintainer: Kukjin Kim <kgene.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org> */
.boot_params = S5P64X0_PA_SDRAM + 0x100,
- .init_irq = s5p6440_init_irq,
.map_io = smdk6440_map_io,
+ .init_early = smdk6440_init_early,
+ .init_irq = s5p6440_init_irq,
.init_machine = smdk6440_machine_init,
.timer = &s5p_timer,
MACHINE_END
diff --git a/arch/arm/mach-s5p64x0/mach-smdk6450.c b/arch/arm/mach-s5p64x0/mach-smdk6450.c
index d19c469..c7af808 100644
--- a/arch/arm/mach-s5p64x0/mach-smdk6450.c
+++ b/arch/arm/mach-s5p64x0/mach-smdk6450.c
@@ -197,6 +197,11 @@ static struct s3c2410_ts_mach_info s3c_ts_platform __initdata = {
static void __init smdk6450_map_io(void)
{
s5p_init_io(NULL, 0, S5P64X0_SYS_ID);
+}
+
+static void __init smdk6450_init_early(void)
+{
+ s3c_init_early();
s3c24xx_init_clocks(19200000);
s3c24xx_init_uarts(smdk6450_uartcfgs, ARRAY_SIZE(smdk6450_uartcfgs));
s5p_set_timer_source(S5P_PWM3, S5P_PWM4);
@@ -220,8 +225,9 @@ MACHINE_START(SMDK6450, "SMDK6450")
/* Maintainer: Kukjin Kim <kgene.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org> */
.boot_params = S5P64X0_PA_SDRAM + 0x100,
- .init_irq = s5p6450_init_irq,
.map_io = smdk6450_map_io,
+ .init_early = smdk6450_init_early,
+ .init_irq = s5p6450_init_irq,
.init_machine = smdk6450_machine_init,
.timer = &s5p_timer,
MACHINE_END
diff --git a/arch/arm/mach-s5pc100/cpu.c b/arch/arm/mach-s5pc100/cpu.c
index fd2708e..7d05916 100644
--- a/arch/arm/mach-s5pc100/cpu.c
+++ b/arch/arm/mach-s5pc100/cpu.c
@@ -108,7 +108,10 @@ static void s5pc100_idle(void)
void __init s5pc100_map_io(void)
{
iotable_init(s5pc100_iodesc, ARRAY_SIZE(s5pc100_iodesc));
+}
+void __init s5pc100_init_early(void)
+{
/* initialise device information early */
s5pc100_default_sdhci0();
s5pc100_default_sdhci1();
diff --git a/arch/arm/mach-s5pc100/mach-smdkc100.c b/arch/arm/mach-s5pc100/mach-smdkc100.c
index 0525cb3..c8db153 100644
--- a/arch/arm/mach-s5pc100/mach-smdkc100.c
+++ b/arch/arm/mach-s5pc100/mach-smdkc100.c
@@ -252,6 +252,11 @@ static struct s3c2410_ts_mach_info s3c_ts_platform __initdata = {
static void __init smdkc100_map_io(void)
{
s5p_init_io(NULL, 0, S5P_VA_CHIPID);
+}
+
+static void __init smdkc100_init_early(void)
+{
+ s3c_init_early();
s3c24xx_init_clocks(12000000);
s3c24xx_init_uarts(smdkc100_uartcfgs, ARRAY_SIZE(smdkc100_uartcfgs));
}
@@ -282,8 +287,9 @@ static void __init smdkc100_machine_init(void)
MACHINE_START(SMDKC100, "SMDKC100")
/* Maintainer: Byungho Min <bhmin-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org> */
.boot_params = S5P_PA_SDRAM + 0x100,
- .init_irq = s5pc100_init_irq,
.map_io = smdkc100_map_io,
+ .init_early = smdkc100_init_early,
+ .init_irq = s5pc100_init_irq,
.init_machine = smdkc100_machine_init,
.timer = &s3c24xx_timer,
MACHINE_END
diff --git a/arch/arm/mach-s5pv210/cpu.c b/arch/arm/mach-s5pv210/cpu.c
index 61e6c24..fc13f58 100644
--- a/arch/arm/mach-s5pv210/cpu.c
+++ b/arch/arm/mach-s5pv210/cpu.c
@@ -119,7 +119,10 @@ static void s5pv210_sw_reset(void)
void __init s5pv210_map_io(void)
{
iotable_init(s5pv210_iodesc, ARRAY_SIZE(s5pv210_iodesc));
+}
+void __init s5pv210_init_early(void)
+{
/* initialise device information early */
s5pv210_default_sdhci0();
s5pv210_default_sdhci1();
diff --git a/arch/arm/mach-s5pv210/mach-aquila.c b/arch/arm/mach-s5pv210/mach-aquila.c
index 4e1d8ff..384e52c 100644
--- a/arch/arm/mach-s5pv210/mach-aquila.c
+++ b/arch/arm/mach-s5pv210/mach-aquila.c
@@ -645,6 +645,11 @@ static void __init aquila_sound_init(void)
static void __init aquila_map_io(void)
{
s5p_init_io(NULL, 0, S5P_VA_CHIPID);
+}
+
+static void __init aquila_init_early(void)
+{
+ s3c_init_early();
s3c24xx_init_clocks(24000000);
s3c24xx_init_uarts(aquila_uartcfgs, ARRAY_SIZE(aquila_uartcfgs));
s5p_set_timer_source(S5P_PWM3, S5P_PWM4);
@@ -679,8 +684,9 @@ MACHINE_START(AQUILA, "Aquila")
Marek Szyprowski <m.szyprowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
Kyungmin Park <kyungmin.park-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org> */
.boot_params = S5P_PA_SDRAM + 0x100,
- .init_irq = s5pv210_init_irq,
.map_io = aquila_map_io,
+ .init_early = aquila_init_early,
+ .init_irq = s5pv210_init_irq,
.init_machine = aquila_machine_init,
.timer = &s5p_timer,
MACHINE_END
diff --git a/arch/arm/mach-s5pv210/mach-goni.c b/arch/arm/mach-s5pv210/mach-goni.c
index 31d5aa7..e1e3e63 100644
--- a/arch/arm/mach-s5pv210/mach-goni.c
+++ b/arch/arm/mach-s5pv210/mach-goni.c
@@ -836,6 +836,11 @@ static void __init goni_sound_init(void)
static void __init goni_map_io(void)
{
s5p_init_io(NULL, 0, S5P_VA_CHIPID);
+}
+
+static void __init goni_init_early(void)
+{
+ s3c_init_early();
s3c24xx_init_clocks(24000000);
s3c24xx_init_uarts(goni_uartcfgs, ARRAY_SIZE(goni_uartcfgs));
s5p_set_timer_source(S5P_PWM3, S5P_PWM4);
@@ -889,8 +894,9 @@ static void __init goni_machine_init(void)
MACHINE_START(GONI, "GONI")
/* Maintainers: Kyungmin Park <kyungmin.park-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org> */
.boot_params = S5P_PA_SDRAM + 0x100,
- .init_irq = s5pv210_init_irq,
.map_io = goni_map_io,
+ .init_early = goni_init_early,
+ .init_irq = s5pv210_init_irq,
.init_machine = goni_machine_init,
.timer = &s5p_timer,
MACHINE_END
diff --git a/arch/arm/mach-s5pv210/mach-smdkc110.c b/arch/arm/mach-s5pv210/mach-smdkc110.c
index 6c412c8..f53ca24 100644
--- a/arch/arm/mach-s5pv210/mach-smdkc110.c
+++ b/arch/arm/mach-s5pv210/mach-smdkc110.c
@@ -110,6 +110,11 @@ static struct i2c_board_info smdkc110_i2c_devs2[] __initdata = {
static void __init smdkc110_map_io(void)
{
s5p_init_io(NULL, 0, S5P_VA_CHIPID);
+}
+
+static void __init smdkc110_init_early(void)
+{
+ s3c_init_early();
s3c24xx_init_clocks(24000000);
s3c24xx_init_uarts(smdkv210_uartcfgs, ARRAY_SIZE(smdkv210_uartcfgs));
s5p_set_timer_source(S5P_PWM3, S5P_PWM4);
@@ -137,8 +142,9 @@ static void __init smdkc110_machine_init(void)
MACHINE_START(SMDKC110, "SMDKC110")
/* Maintainer: Kukjin Kim <kgene.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org> */
.boot_params = S5P_PA_SDRAM + 0x100,
- .init_irq = s5pv210_init_irq,
.map_io = smdkc110_map_io,
+ .init_early = smdkc110_init_early,
+ .init_irq = s5pv210_init_irq,
.init_machine = smdkc110_machine_init,
.timer = &s5p_timer,
MACHINE_END
diff --git a/arch/arm/mach-s5pv210/mach-smdkv210.c b/arch/arm/mach-s5pv210/mach-smdkv210.c
index c6a9e86..fdc73aa 100644
--- a/arch/arm/mach-s5pv210/mach-smdkv210.c
+++ b/arch/arm/mach-s5pv210/mach-smdkv210.c
@@ -313,6 +313,11 @@ static struct s3c2410_ts_mach_info s3c_ts_platform __initdata = {
static void __init smdkv210_map_io(void)
{
s5p_init_io(NULL, 0, S5P_VA_CHIPID);
+}
+
+static void __init smdkv210_init_early(void)
+{
+ s3c_init_early();
s3c24xx_init_clocks(24000000);
s3c24xx_init_uarts(smdkv210_uartcfgs, ARRAY_SIZE(smdkv210_uartcfgs));
s5p_set_timer_source(S5P_PWM2, S5P_PWM4);
@@ -347,8 +352,9 @@ static void __init smdkv210_machine_init(void)
MACHINE_START(SMDKV210, "SMDKV210")
/* Maintainer: Kukjin Kim <kgene.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org> */
.boot_params = S5P_PA_SDRAM + 0x100,
- .init_irq = s5pv210_init_irq,
.map_io = smdkv210_map_io,
+ .init_early = smdkv210_init_early,
+ .init_irq = s5pv210_init_irq,
.init_machine = smdkv210_machine_init,
.timer = &s5p_timer,
MACHINE_END
diff --git a/arch/arm/mach-s5pv210/mach-torbreck.c b/arch/arm/mach-s5pv210/mach-torbreck.c
index 925fc0d..2500d8a 100644
--- a/arch/arm/mach-s5pv210/mach-torbreck.c
+++ b/arch/arm/mach-s5pv210/mach-torbreck.c
@@ -103,6 +103,11 @@ static struct i2c_board_info torbreck_i2c_devs2[] __initdata = {
static void __init torbreck_map_io(void)
{
s5p_init_io(NULL, 0, S5P_VA_CHIPID);
+}
+
+static void __init torbreck_init_early(void)
+{
+ s3c_init_early();
s3c24xx_init_clocks(24000000);
s3c24xx_init_uarts(torbreck_uartcfgs, ARRAY_SIZE(torbreck_uartcfgs));
s5p_set_timer_source(S5P_PWM3, S5P_PWM4);
@@ -126,8 +131,9 @@ static void __init torbreck_machine_init(void)
MACHINE_START(TORBRECK, "TORBRECK")
/* Maintainer: Hyunchul Ko <ghcstop-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> */
.boot_params = S5P_PA_SDRAM + 0x100,
- .init_irq = s5pv210_init_irq,
.map_io = torbreck_map_io,
+ .init_early = torbreck_init_early,
+ .init_irq = s5pv210_init_irq,
.init_machine = torbreck_machine_init,
.timer = &s5p_timer,
MACHINE_END
diff --git a/arch/arm/mach-sa1100/assabet.c b/arch/arm/mach-sa1100/assabet.c
index 5778274..2bc7c82 100644
--- a/arch/arm/mach-sa1100/assabet.c
+++ b/arch/arm/mach-sa1100/assabet.c
@@ -301,8 +301,7 @@ static void __init get_assabet_scr(void)
}
static void __init
-fixup_assabet(struct machine_desc *desc, struct tag *tags,
- char **cmdline, struct meminfo *mi)
+fixup_assabet(struct tag *tags, char **cmdline, struct meminfo *mi)
{
/* This must be done before any call to machine_has_neponset() */
map_sa1100_gpio_regs();
@@ -406,7 +405,10 @@ static void __init assabet_map_io(void)
{
sa1100_map_io();
iotable_init(assabet_io_desc, ARRAY_SIZE(assabet_io_desc));
+}
+static void __init assabet_init_early(void)
+{
/*
* Set SUS bit in SDCR0 so serial port 1 functions.
* Its called GPCLKR0 in my SA1110 manual.
@@ -450,6 +452,7 @@ MACHINE_START(ASSABET, "Intel-Assabet")
.boot_params = 0xc0000100,
.fixup = fixup_assabet,
.map_io = assabet_map_io,
+ .init_early = assabet_init_early,
.init_irq = sa1100_init_irq,
.timer = &sa1100_timer,
.init_machine = assabet_init,
diff --git a/arch/arm/mach-sa1100/badge4.c b/arch/arm/mach-sa1100/badge4.c
index 4f19ff8..592a019 100644
--- a/arch/arm/mach-sa1100/badge4.c
+++ b/arch/arm/mach-sa1100/badge4.c
@@ -295,7 +295,10 @@ static void __init badge4_map_io(void)
{
sa1100_map_io();
iotable_init(badge4_io_desc, ARRAY_SIZE(badge4_io_desc));
+}
+static void __init badge4_init_early(void)
+{
sa1100_register_uart_fns(&badge4_port_fns);
sa1100_register_uart(0, 3);
sa1100_register_uart(1, 1);
@@ -304,6 +307,7 @@ static void __init badge4_map_io(void)
MACHINE_START(BADGE4, "Hewlett-Packard Laboratories BadgePAD 4")
.boot_params = 0xc0000100,
.map_io = badge4_map_io,
+ .init_early = badge4_init_early,
.init_irq = sa1100_init_irq,
.timer = &sa1100_timer,
MACHINE_END
diff --git a/arch/arm/mach-sa1100/cerf.c b/arch/arm/mach-sa1100/cerf.c
index 7f3da4b..7813b4f 100644
--- a/arch/arm/mach-sa1100/cerf.c
+++ b/arch/arm/mach-sa1100/cerf.c
@@ -112,7 +112,10 @@ static void __init cerf_map_io(void)
{
sa1100_map_io();
iotable_init(cerf_io_desc, ARRAY_SIZE(cerf_io_desc));
+}
+static void __init cerf_init_early(void)
+{
sa1100_register_uart(0, 3);
sa1100_register_uart(1, 2); /* disable this and the uart2 device for sa1100_fir */
sa1100_register_uart(2, 1);
@@ -136,6 +139,7 @@ static void __init cerf_init(void)
MACHINE_START(CERF, "Intrinsyc CerfBoard/CerfCube")
/* Maintainer: support-a2zIG6VkHR58UrSeD/g0lQ@public.gmane.org */
.map_io = cerf_map_io,
+ .init_early = cerf_init_early,
.init_irq = cerf_init_irq,
.timer = &sa1100_timer,
.init_machine = cerf_init,
diff --git a/arch/arm/mach-sa1100/collie.c b/arch/arm/mach-sa1100/collie.c
index bd3e1bf..035bf29 100644
--- a/arch/arm/mach-sa1100/collie.c
+++ b/arch/arm/mach-sa1100/collie.c
@@ -373,7 +373,10 @@ static void __init collie_map_io(void)
{
sa1100_map_io();
iotable_init(collie_io_desc, ARRAY_SIZE(collie_io_desc));
+}
+static void __init collie_init_early(void)
+{
#ifdef CONFIG_SHARP_LOCOMO
sa1100_register_uart_fns(&collie_port_fns);
#endif
@@ -383,6 +386,7 @@ static void __init collie_map_io(void)
MACHINE_START(COLLIE, "Sharp-Collie")
.map_io = collie_map_io,
+ .init_early = collie_init_early,
.init_irq = sa1100_init_irq,
.timer = &sa1100_timer,
.init_machine = collie_init,
diff --git a/arch/arm/mach-sa1100/h3100.c b/arch/arm/mach-sa1100/h3100.c
index 03d7376..8d08740 100644
--- a/arch/arm/mach-sa1100/h3100.c
+++ b/arch/arm/mach-sa1100/h3100.c
@@ -37,9 +37,9 @@ static void h3100_lcd_power(int enable)
}
-static void __init h3100_map_io(void)
+static void __init h3100_init_early(void)
{
- h3xxx_map_io();
+ h3xxx_init_early();
sa1100fb_lcd_power = h3100_lcd_power;
@@ -85,7 +85,8 @@ static void __init h3100_mach_init(void)
MACHINE_START(H3100, "Compaq iPAQ H3100")
.boot_params = 0xc0000100,
- .map_io = h3100_map_io,
+ .map_io = h3xxx_map_io,
+ .init_early = h3100_init_early,
.init_irq = sa1100_init_irq,
.timer = &sa1100_timer,
.init_machine = h3100_mach_init,
diff --git a/arch/arm/mach-sa1100/h3600.c b/arch/arm/mach-sa1100/h3600.c
index 965f64a..d512453 100644
--- a/arch/arm/mach-sa1100/h3600.c
+++ b/arch/arm/mach-sa1100/h3600.c
@@ -56,10 +56,9 @@ err2: gpio_free(H3XXX_EGPIO_LCD_ON);
err1: return;
}
-static void __init h3600_map_io(void)
+static void __init h3600_init_early(void)
{
- h3xxx_map_io();
-
+ h3xxx_init_early();
sa1100fb_lcd_power = h3600_lcd_power;
}
@@ -126,7 +125,8 @@ static void __init h3600_mach_init(void)
MACHINE_START(H3600, "Compaq iPAQ H3600")
.boot_params = 0xc0000100,
- .map_io = h3600_map_io,
+ .map_io = h3xxx_map_io,
+ .init_early = h3600_init_early,
.init_irq = sa1100_init_irq,
.timer = &sa1100_timer,
.init_machine = h3600_mach_init,
diff --git a/arch/arm/mach-sa1100/h3xxx.c b/arch/arm/mach-sa1100/h3xxx.c
index b0784c9..f638a01 100644
--- a/arch/arm/mach-sa1100/h3xxx.c
+++ b/arch/arm/mach-sa1100/h3xxx.c
@@ -294,7 +294,10 @@ void __init h3xxx_map_io(void)
{
sa1100_map_io();
iotable_init(h3600_io_desc, ARRAY_SIZE(h3600_io_desc));
+}
+void __init h3xxx_init_early(void)
+{
sa1100_register_uart(0, 3); /* Common serial port */
// sa1100_register_uart(1, 1); /* Microcontroller on 3100/3600 */
diff --git a/arch/arm/mach-sa1100/hackkit.c b/arch/arm/mach-sa1100/hackkit.c
index db5e434..8712553 100644
--- a/arch/arm/mach-sa1100/hackkit.c
+++ b/arch/arm/mach-sa1100/hackkit.c
@@ -42,8 +42,6 @@
*/
/* init funcs */
-static void __init hackkit_map_io(void);
-
static u_int hackkit_get_mctrl(struct uart_port *port);
static void hackkit_set_mctrl(struct uart_port *port, u_int mctrl);
static void hackkit_uart_pm(struct uart_port *port, u_int state, u_int oldstate);
@@ -79,7 +77,10 @@ static void __init hackkit_map_io(void)
{
sa1100_map_io();
iotable_init(hackkit_io_desc, ARRAY_SIZE(hackkit_io_desc));
+}
+static void __init hackkit_init_early(void)
+{
sa1100_register_uart_fns(&hackkit_port_fns);
sa1100_register_uart(0, 1); /* com port */
sa1100_register_uart(1, 2);
@@ -197,6 +198,7 @@ static void __init hackkit_init(void)
MACHINE_START(HACKKIT, "HackKit Cpu Board")
.boot_params = 0xc0000100,
.map_io = hackkit_map_io,
+ .init_early = hackkit_init_early,
.init_irq = sa1100_init_irq,
.timer = &sa1100_timer,
.init_machine = hackkit_init,
diff --git a/arch/arm/mach-sa1100/include/mach/h3xxx.h b/arch/arm/mach-sa1100/include/mach/h3xxx.h
index 7d9df16..82b64b9 100644
--- a/arch/arm/mach-sa1100/include/mach/h3xxx.h
+++ b/arch/arm/mach-sa1100/include/mach/h3xxx.h
@@ -89,6 +89,7 @@ struct gpio_default_state {
void h3xxx_init_gpio(struct gpio_default_state *s, size_t n);
void __init h3xxx_map_io(void);
+void __init h3xxx_init_early(void);
void __init h3xxx_mach_init(void);
#endif /* _INCLUDE_H3XXX_H_ */
diff --git a/arch/arm/mach-sa1100/jornada720.c b/arch/arm/mach-sa1100/jornada720.c
index 491ac9f..3bd2c5d 100644
--- a/arch/arm/mach-sa1100/jornada720.c
+++ b/arch/arm/mach-sa1100/jornada720.c
@@ -295,7 +295,10 @@ static void __init jornada720_map_io(void)
{
sa1100_map_io();
iotable_init(jornada720_io_desc, ARRAY_SIZE(jornada720_io_desc));
+}
+static void __init jornada720_init_early(void)
+{
sa1100_register_uart(0, 3);
sa1100_register_uart(1, 1);
}
@@ -366,6 +369,7 @@ MACHINE_START(JORNADA720, "HP Jornada 720")
/* Maintainer: Kristoffer Ericson <Kristoffer.Ericson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> */
.boot_params = 0xc0000100,
.map_io = jornada720_map_io,
+ .init_early = jornada720_init_early,
.init_irq = sa1100_init_irq,
.timer = &sa1100_timer,
.init_machine = jornada720_mach_init,
diff --git a/arch/arm/mach-sa1100/lart.c b/arch/arm/mach-sa1100/lart.c
index 7b9556b..2b999ea 100644
--- a/arch/arm/mach-sa1100/lart.c
+++ b/arch/arm/mach-sa1100/lart.c
@@ -49,7 +49,10 @@ static void __init lart_map_io(void)
{
sa1100_map_io();
iotable_init(lart_io_desc, ARRAY_SIZE(lart_io_desc));
+}
+static void __init lart_init_early(void)
+{
sa1100_register_uart(0, 3);
sa1100_register_uart(1, 1);
sa1100_register_uart(2, 2);
@@ -63,6 +66,7 @@ static void __init lart_map_io(void)
MACHINE_START(LART, "LART")
.boot_params = 0xc0000100,
.map_io = lart_map_io,
+ .init_early = lart_init_early,
.init_irq = sa1100_init_irq,
.init_machine = lart_init,
.timer = &sa1100_timer,
diff --git a/arch/arm/mach-sa1100/pleb.c b/arch/arm/mach-sa1100/pleb.c
index 65161f2..652e04f 100644
--- a/arch/arm/mach-sa1100/pleb.c
+++ b/arch/arm/mach-sa1100/pleb.c
@@ -117,10 +117,8 @@ static void __init pleb_init(void)
}
-static void __init pleb_map_io(void)
+static void __init pleb_init_early(void)
{
- sa1100_map_io();
-
sa1100_register_uart(0, 3);
sa1100_register_uart(1, 1);
@@ -146,7 +144,8 @@ static void __init pleb_map_io(void)
}
MACHINE_START(PLEB, "PLEB")
- .map_io = pleb_map_io,
+ .map_io = sa1100_map_io,
+ .init_early = pleb_init_early,
.init_irq = sa1100_init_irq,
.timer = &sa1100_timer,
.init_machine = pleb_init,
diff --git a/arch/arm/mach-sa1100/shannon.c b/arch/arm/mach-sa1100/shannon.c
index 7917b24..f62616e 100644
--- a/arch/arm/mach-sa1100/shannon.c
+++ b/arch/arm/mach-sa1100/shannon.c
@@ -63,10 +63,8 @@ static void __init shannon_init(void)
sa11x0_register_mcp(&shannon_mcp_data);
}
-static void __init shannon_map_io(void)
+static void __init shannon_init_early(void)
{
- sa1100_map_io();
-
sa1100_register_uart(0, 3);
sa1100_register_uart(1, 1);
@@ -83,7 +81,8 @@ static void __init shannon_map_io(void)
MACHINE_START(SHANNON, "Shannon (AKA: Tuxscreen)")
.boot_params = 0xc0000100,
- .map_io = shannon_map_io,
+ .map_io = sa1100_map_io,
+ .init_early = shannon_init_early,
.init_irq = sa1100_init_irq,
.timer = &sa1100_timer,
.init_machine = shannon_init,
diff --git a/arch/arm/mach-sa1100/simpad.c b/arch/arm/mach-sa1100/simpad.c
index cfb7607..995c47e 100644
--- a/arch/arm/mach-sa1100/simpad.c
+++ b/arch/arm/mach-sa1100/simpad.c
@@ -141,7 +141,10 @@ static void __init simpad_map_io(void)
sa1100_map_io();
iotable_init(simpad_io_desc, ARRAY_SIZE(simpad_io_desc));
+}
+static void __init simpad_init_early(void)
+{
set_cs3_bit (EN1 | EN0 | LED2_ON | DISPLAY_ON | RS232_ON |
ENABLE_5V | RESET_SIMCARD | DECT_POWER_ON);
@@ -231,6 +234,7 @@ MACHINE_START(SIMPAD, "Simpad")
/* Maintainer: Holger Freyther */
.boot_params = 0xc0000100,
.map_io = simpad_map_io,
+ .init_early = simpad_init_early,
.init_irq = sa1100_init_irq,
.timer = &sa1100_timer,
MACHINE_END
diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
index 08acb6e..aa0f089 100644
--- a/arch/arm/mach-shmobile/board-ap4evb.c
+++ b/arch/arm/mach-shmobile/board-ap4evb.c
@@ -1118,7 +1118,10 @@ static struct map_desc ap4evb_io_desc[] __initdata = {
static void __init ap4evb_map_io(void)
{
iotable_init(ap4evb_io_desc, ARRAY_SIZE(ap4evb_io_desc));
+}
+static void __init ap4evb_init_early(void)
+{
/* setup early devices and console here as well */
sh7372_add_early_devices();
shmobile_setup_console();
@@ -1372,6 +1375,7 @@ static struct sys_timer ap4evb_timer = {
MACHINE_START(AP4EVB, "ap4evb")
.map_io = ap4evb_map_io,
+ .init_early = ap4evb_init_early,
.init_irq = sh7372_init_irq,
.handle_irq = shmobile_handle_irq_intc,
.init_machine = ap4evb_init,
diff --git a/arch/arm/mach-shmobile/board-g3evm.c b/arch/arm/mach-shmobile/board-g3evm.c
index ef4613b..2089f33 100644
--- a/arch/arm/mach-shmobile/board-g3evm.c
+++ b/arch/arm/mach-shmobile/board-g3evm.c
@@ -260,7 +260,10 @@ static struct map_desc g3evm_io_desc[] __initdata = {
static void __init g3evm_map_io(void)
{
iotable_init(g3evm_io_desc, ARRAY_SIZE(g3evm_io_desc));
+}
+static void __init g3evm_init_early(void)
+{
/* setup early devices and console here as well */
sh7367_add_early_devices();
shmobile_setup_console();
@@ -365,6 +368,7 @@ static struct sys_timer g3evm_timer = {
MACHINE_START(G3EVM, "g3evm")
.map_io = g3evm_map_io,
+ .init_early = g3evm_init_early,
.init_irq = sh7367_init_irq,
.handle_irq = shmobile_handle_irq_intc,
.init_machine = g3evm_init,
diff --git a/arch/arm/mach-shmobile/board-g4evm.c b/arch/arm/mach-shmobile/board-g4evm.c
index 8e3c555..0885db3 100644
--- a/arch/arm/mach-shmobile/board-g4evm.c
+++ b/arch/arm/mach-shmobile/board-g4evm.c
@@ -274,7 +274,10 @@ static struct map_desc g4evm_io_desc[] __initdata = {
static void __init g4evm_map_io(void)
{
iotable_init(g4evm_io_desc, ARRAY_SIZE(g4evm_io_desc));
+}
+static void __init g4evm_init_early(void)
+{
/* setup early devices and console here as well */
sh7377_add_early_devices();
shmobile_setup_console();
@@ -408,6 +411,7 @@ static struct sys_timer g4evm_timer = {
MACHINE_START(G4EVM, "g4evm")
.map_io = g4evm_map_io,
+ .init_early = g4evm_init_early,
.init_irq = sh7377_init_irq,
.handle_irq = shmobile_handle_irq_intc,
.init_machine = g4evm_init,
diff --git a/arch/arm/mach-spear3xx/include/mach/generic.h b/arch/arm/mach-spear3xx/include/mach/generic.h
index b8f31c3..dd79808 100644
--- a/arch/arm/mach-spear3xx/include/mach/generic.h
+++ b/arch/arm/mach-spear3xx/include/mach/generic.h
@@ -39,6 +39,7 @@ extern struct sys_timer spear3xx_timer;
void __init spear3xx_clk_init(void);
void __init spear_setup_timer(void);
void __init spear3xx_map_io(void);
+void __init spear3xx_init_early(void);
void __init spear3xx_init_irq(void);
void __init spear3xx_init(void);
diff --git a/arch/arm/mach-spear3xx/spear300_evb.c b/arch/arm/mach-spear3xx/spear300_evb.c
index 69006f6..69494cc 100644
--- a/arch/arm/mach-spear3xx/spear300_evb.c
+++ b/arch/arm/mach-spear3xx/spear300_evb.c
@@ -66,6 +66,7 @@ static void __init spear300_evb_init(void)
MACHINE_START(SPEAR300, "ST-SPEAR300-EVB")
.boot_params = 0x00000100,
.map_io = spear3xx_map_io,
+ .init_early = spear3xx_init_early,
.init_irq = spear3xx_init_irq,
.timer = &spear3xx_timer,
.init_machine = spear300_evb_init,
diff --git a/arch/arm/mach-spear3xx/spear310_evb.c b/arch/arm/mach-spear3xx/spear310_evb.c
index c8684ce..d067e9c 100644
--- a/arch/arm/mach-spear3xx/spear310_evb.c
+++ b/arch/arm/mach-spear3xx/spear310_evb.c
@@ -72,6 +72,7 @@ static void __init spear310_evb_init(void)
MACHINE_START(SPEAR310, "ST-SPEAR310-EVB")
.boot_params = 0x00000100,
.map_io = spear3xx_map_io,
+ .init_early = spear3xx_init_early,
.init_irq = spear3xx_init_irq,
.timer = &spear3xx_timer,
.init_machine = spear310_evb_init,
diff --git a/arch/arm/mach-spear3xx/spear320_evb.c b/arch/arm/mach-spear3xx/spear320_evb.c
index a12b353..6a32af0 100644
--- a/arch/arm/mach-spear3xx/spear320_evb.c
+++ b/arch/arm/mach-spear3xx/spear320_evb.c
@@ -70,6 +70,7 @@ static void __init spear320_evb_init(void)
MACHINE_START(SPEAR320, "ST-SPEAR320-EVB")
.boot_params = 0x00000100,
.map_io = spear3xx_map_io,
+ .init_early = spear3xx_init_early,
.init_irq = spear3xx_init_irq,
.timer = &spear3xx_timer,
.init_machine = spear320_evb_init,
diff --git a/arch/arm/mach-spear3xx/spear3xx.c b/arch/arm/mach-spear3xx/spear3xx.c
index 10af45d..c2b77b1 100644
--- a/arch/arm/mach-spear3xx/spear3xx.c
+++ b/arch/arm/mach-spear3xx/spear3xx.c
@@ -95,7 +95,10 @@ struct map_desc spear3xx_io_desc[] __initdata = {
void __init spear3xx_map_io(void)
{
iotable_init(spear3xx_io_desc, ARRAY_SIZE(spear3xx_io_desc));
+}
+void __init spear3xx_init_early(void)
+{
/* This will initialize clock framework */
spear3xx_clk_init();
}
diff --git a/arch/arm/mach-spear6xx/include/mach/generic.h b/arch/arm/mach-spear6xx/include/mach/generic.h
index 183f023..b79b11b 100644
--- a/arch/arm/mach-spear6xx/include/mach/generic.h
+++ b/arch/arm/mach-spear6xx/include/mach/generic.h
@@ -36,6 +36,7 @@ extern struct sys_timer spear6xx_timer;
/* Add spear6xx family function declarations here */
void __init spear_setup_timer(void);
void __init spear6xx_map_io(void);
+void __init spear6xx_init_early(void);
void __init spear6xx_init_irq(void);
void __init spear6xx_init(void);
void __init spear600_init(void);
diff --git a/arch/arm/mach-spear6xx/spear600_evb.c b/arch/arm/mach-spear6xx/spear600_evb.c
index f19cefe..d4fbf64 100644
--- a/arch/arm/mach-spear6xx/spear600_evb.c
+++ b/arch/arm/mach-spear6xx/spear600_evb.c
@@ -45,6 +45,7 @@ static void __init spear600_evb_init(void)
MACHINE_START(SPEAR600, "ST-SPEAR600-EVB")
.boot_params = 0x00000100,
.map_io = spear6xx_map_io,
+ .init_early = spear6xx_init_early,
.init_irq = spear6xx_init_irq,
.timer = &spear6xx_timer,
.init_machine = spear600_evb_init,
diff --git a/arch/arm/mach-spear6xx/spear6xx.c b/arch/arm/mach-spear6xx/spear6xx.c
index e0f6628..28917ae 100644
--- a/arch/arm/mach-spear6xx/spear6xx.c
+++ b/arch/arm/mach-spear6xx/spear6xx.c
@@ -146,7 +146,10 @@ static struct map_desc spear6xx_io_desc[] __initdata = {
void __init spear6xx_map_io(void)
{
iotable_init(spear6xx_io_desc, ARRAY_SIZE(spear6xx_io_desc));
+}
+void __init spear6xx_init_early(void)
+{
/* This will initialize clock framework */
spear6xx_clk_init();
}
diff --git a/arch/arm/mach-tegra/board-harmony.c b/arch/arm/mach-tegra/board-harmony.c
index 30e18bc..63717ac 100644
--- a/arch/arm/mach-tegra/board-harmony.c
+++ b/arch/arm/mach-tegra/board-harmony.c
@@ -145,8 +145,8 @@ static struct platform_device *harmony_devices[] __initdata = {
&harmony_audio_device,
};
-static void __init tegra_harmony_fixup(struct machine_desc *desc,
- struct tag *tags, char **cmdline, struct meminfo *mi)
+static void __init tegra_harmony_fixup(struct tag *tags, char **cmdline,
+ struct meminfo *mi)
{
mi->nr_banks = 2;
mi->bank[0].start = PHYS_OFFSET;
diff --git a/arch/arm/mach-w90x900/mach-nuc910evb.c b/arch/arm/mach-w90x900/mach-nuc910evb.c
index 30fccde..fb8faf7 100644
--- a/arch/arm/mach-w90x900/mach-nuc910evb.c
+++ b/arch/arm/mach-w90x900/mach-nuc910evb.c
@@ -21,12 +21,6 @@
#include "nuc910.h"
-static void __init nuc910evb_map_io(void)
-{
- nuc910_map_io();
- nuc910_init_clocks();
-}
-
static void __init nuc910evb_init(void)
{
nuc910_board_init();
@@ -35,7 +29,8 @@ static void __init nuc910evb_init(void)
MACHINE_START(W90P910EVB, "W90P910EVB")
/* Maintainer: Wan ZongShun */
.boot_params = 0,
- .map_io = nuc910evb_map_io,
+ .map_io = nuc910_map_io,
+ .init_early = nuc910_init_clocks,
.init_irq = nuc900_init_irq,
.init_machine = nuc910evb_init,
.timer = &nuc900_timer,
diff --git a/arch/arm/mach-w90x900/mach-nuc950evb.c b/arch/arm/mach-w90x900/mach-nuc950evb.c
index 590c99b..07eb073 100644
--- a/arch/arm/mach-w90x900/mach-nuc950evb.c
+++ b/arch/arm/mach-w90x900/mach-nuc950evb.c
@@ -24,12 +24,6 @@
#include "nuc950.h"
-static void __init nuc950evb_map_io(void)
-{
- nuc950_map_io();
- nuc950_init_clocks();
-}
-
static void __init nuc950evb_init(void)
{
nuc950_board_init();
@@ -38,7 +32,8 @@ static void __init nuc950evb_init(void)
MACHINE_START(W90P950EVB, "W90P950EVB")
/* Maintainer: Wan ZongShun */
.boot_params = 0,
- .map_io = nuc950evb_map_io,
+ .map_io = nuc950_map_io,
+ .init_early = nuc950_init_clocks,
.init_irq = nuc900_init_irq,
.init_machine = nuc950evb_init,
.timer = &nuc900_timer,
diff --git a/arch/arm/mach-w90x900/mach-nuc960evb.c b/arch/arm/mach-w90x900/mach-nuc960evb.c
index e09c645..504719e 100644
--- a/arch/arm/mach-w90x900/mach-nuc960evb.c
+++ b/arch/arm/mach-w90x900/mach-nuc960evb.c
@@ -21,12 +21,6 @@
#include "nuc960.h"
-static void __init nuc960evb_map_io(void)
-{
- nuc960_map_io();
- nuc960_init_clocks();
-}
-
static void __init nuc960evb_init(void)
{
nuc960_board_init();
@@ -35,7 +29,8 @@ static void __init nuc960evb_init(void)
MACHINE_START(W90N960EVB, "W90N960EVB")
/* Maintainer: Wan ZongShun */
.boot_params = 0,
- .map_io = nuc960evb_map_io,
+ .map_io = nuc960_map_io,
+ .init_early = nuc960_init_clocks,
.init_irq = nuc900_init_irq,
.init_machine = nuc960evb_init,
.timer = &nuc900_timer,
diff --git a/arch/arm/plat-s3c24xx/cpu.c b/arch/arm/plat-s3c24xx/cpu.c
index 4a10c0f..a6cd25f 100644
--- a/arch/arm/plat-s3c24xx/cpu.c
+++ b/arch/arm/plat-s3c24xx/cpu.c
@@ -71,6 +71,7 @@ static struct cpu_table cpu_ids[] __initdata = {
.idcode = 0x32410000,
.idmask = 0xffffffff,
.map_io = s3c2410_map_io,
+ .init_early = s3c2410_init_early,
.init_clocks = s3c2410_init_clocks,
.init_uarts = s3c2410_init_uarts,
.init = s3c2410_init,
@@ -80,6 +81,7 @@ static struct cpu_table cpu_ids[] __initdata = {
.idcode = 0x32410002,
.idmask = 0xffffffff,
.map_io = s3c2410_map_io,
+ .init_early = s3c2410_init_early,
.init_clocks = s3c2410_init_clocks,
.init_uarts = s3c2410_init_uarts,
.init = s3c2410a_init,
@@ -89,6 +91,7 @@ static struct cpu_table cpu_ids[] __initdata = {
.idcode = 0x32440000,
.idmask = 0xffffffff,
.map_io = s3c2440_map_io,
+ .init_early = s3c244x_init_early,
.init_clocks = s3c244x_init_clocks,
.init_uarts = s3c244x_init_uarts,
.init = s3c2440_init,
@@ -98,6 +101,7 @@ static struct cpu_table cpu_ids[] __initdata = {
.idcode = 0x32440001,
.idmask = 0xffffffff,
.map_io = s3c2440_map_io,
+ .init_early = s3c244x_init_early,
.init_clocks = s3c244x_init_clocks,
.init_uarts = s3c244x_init_uarts,
.init = s3c2440_init,
@@ -107,6 +111,7 @@ static struct cpu_table cpu_ids[] __initdata = {
.idcode = 0x32440aaa,
.idmask = 0xffffffff,
.map_io = s3c2442_map_io,
+ .init_early = s3c244x_init_early,
.init_clocks = s3c244x_init_clocks,
.init_uarts = s3c244x_init_uarts,
.init = s3c2442_init,
@@ -116,6 +121,7 @@ static struct cpu_table cpu_ids[] __initdata = {
.idcode = 0x32440aab,
.idmask = 0xffffffff,
.map_io = s3c2442_map_io,
+ .init_early = s3c244x_init_early,
.init_clocks = s3c244x_init_clocks,
.init_uarts = s3c244x_init_uarts,
.init = s3c2442_init,
@@ -125,6 +131,7 @@ static struct cpu_table cpu_ids[] __initdata = {
.idcode = 0x32412001,
.idmask = 0xffffffff,
.map_io = s3c2412_map_io,
+ .init_early = s3c2412_init_early,
.init_clocks = s3c2412_init_clocks,
.init_uarts = s3c2412_init_uarts,
.init = s3c2412_init,
@@ -134,6 +141,7 @@ static struct cpu_table cpu_ids[] __initdata = {
.idcode = 0x32412003,
.idmask = 0xffffffff,
.map_io = s3c2412_map_io,
+ .init_early = s3c2412_init_early,
.init_clocks = s3c2412_init_clocks,
.init_uarts = s3c2412_init_uarts,
.init = s3c2412_init,
@@ -143,6 +151,7 @@ static struct cpu_table cpu_ids[] __initdata = {
.idcode = 0x32450003,
.idmask = 0xffffffff,
.map_io = s3c2416_map_io,
+ .init_early = s3c2416_init_early,
.init_clocks = s3c2416_init_clocks,
.init_uarts = s3c2416_init_uarts,
.init = s3c2416_init,
diff --git a/arch/arm/plat-s3c24xx/include/plat/s3c2410.h b/arch/arm/plat-s3c24xx/include/plat/s3c2410.h
index 82ab4aad..77bff52 100644
--- a/arch/arm/plat-s3c24xx/include/plat/s3c2410.h
+++ b/arch/arm/plat-s3c24xx/include/plat/s3c2410.h
@@ -17,7 +17,7 @@ extern int s3c2410_init(void);
extern int s3c2410a_init(void);
extern void s3c2410_map_io(void);
-
+extern void s3c2410_init_early(void);
extern void s3c2410_init_uarts(struct s3c2410_uartcfg *cfg, int no);
extern void s3c2410_init_clocks(int xtal);
@@ -26,6 +26,7 @@ extern void s3c2410_init_clocks(int xtal);
#define s3c2410_init_clocks NULL
#define s3c2410_init_uarts NULL
#define s3c2410_map_io NULL
+#define s3c2410_init_early NULL
#define s3c2410_init NULL
#define s3c2410a_init NULL
#endif
diff --git a/arch/arm/plat-s3c24xx/include/plat/s3c2412.h b/arch/arm/plat-s3c24xx/include/plat/s3c2412.h
index bb15d3b..dc98eb5 100644
--- a/arch/arm/plat-s3c24xx/include/plat/s3c2412.h
+++ b/arch/arm/plat-s3c24xx/include/plat/s3c2412.h
@@ -15,13 +15,14 @@
extern int s3c2412_init(void);
extern void s3c2412_map_io(void);
-
+extern void s3c2412_init_early(void);
extern void s3c2412_init_uarts(struct s3c2410_uartcfg *cfg, int no);
extern void s3c2412_init_clocks(int xtal);
extern int s3c2412_baseclk_add(void);
#else
+#define s3c2412_init_early NULL
#define s3c2412_init_clocks NULL
#define s3c2412_init_uarts NULL
#define s3c2412_map_io NULL
diff --git a/arch/arm/plat-s3c24xx/include/plat/s3c2416.h b/arch/arm/plat-s3c24xx/include/plat/s3c2416.h
index dc3c090..961e6cc 100644
--- a/arch/arm/plat-s3c24xx/include/plat/s3c2416.h
+++ b/arch/arm/plat-s3c24xx/include/plat/s3c2416.h
@@ -16,7 +16,7 @@ struct s3c2410_uartcfg;
extern int s3c2416_init(void);
extern void s3c2416_map_io(void);
-
+extern void s3c2416_init_early(void);
extern void s3c2416_init_uarts(struct s3c2410_uartcfg *cfg, int no);
extern void s3c2416_init_clocks(int xtal);
@@ -24,6 +24,7 @@ extern void s3c2416_init_clocks(int xtal);
extern int s3c2416_baseclk_add(void);
#else
+#define s3c2416_init_early NULL
#define s3c2416_init_clocks NULL
#define s3c2416_init_uarts NULL
#define s3c2416_map_io NULL
diff --git a/arch/arm/plat-s3c24xx/include/plat/s3c244x.h b/arch/arm/plat-s3c24xx/include/plat/s3c244x.h
index 89e8d0a..06fb41d 100644
--- a/arch/arm/plat-s3c24xx/include/plat/s3c244x.h
+++ b/arch/arm/plat-s3c24xx/include/plat/s3c244x.h
@@ -13,12 +13,13 @@
#if defined(CONFIG_CPU_S3C2440) || defined(CONFIG_CPU_S3C2442)
extern void s3c244x_map_io(void);
-
+extern void s3c244x_init_early(void);
extern void s3c244x_init_uarts(struct s3c2410_uartcfg *cfg, int no);
extern void s3c244x_init_clocks(int xtal);
#else
+#define s3c244x_init_early NULL
#define s3c244x_init_clocks NULL
#define s3c244x_init_uarts NULL
#endif
diff --git a/arch/arm/plat-s5p/cpu.c b/arch/arm/plat-s5p/cpu.c
index bbc2aa7..41d5e49 100644
--- a/arch/arm/plat-s5p/cpu.c
+++ b/arch/arm/plat-s5p/cpu.c
@@ -39,6 +39,7 @@ static struct cpu_table cpu_ids[] __initdata = {
.idcode = 0x56440100,
.idmask = 0xfffff000,
.map_io = s5p6440_map_io,
+ .init_early = s5p6440_init_early,
.init_clocks = s5p6440_init_clocks,
.init_uarts = s5p6440_init_uarts,
.init = s5p64x0_init,
@@ -47,6 +48,7 @@ static struct cpu_table cpu_ids[] __initdata = {
.idcode = 0x36450000,
.idmask = 0xfffff000,
.map_io = s5p6450_map_io,
+ .init_early = s5p6450_init_early,
.init_clocks = s5p6450_init_clocks,
.init_uarts = s5p6450_init_uarts,
.init = s5p64x0_init,
@@ -55,6 +57,7 @@ static struct cpu_table cpu_ids[] __initdata = {
.idcode = 0x43100000,
.idmask = 0xfffff000,
.map_io = s5pc100_map_io,
+ .init_early = s5pc100_init_early,
.init_clocks = s5pc100_init_clocks,
.init_uarts = s5pc100_init_uarts,
.init = s5pc100_init,
@@ -63,6 +66,7 @@ static struct cpu_table cpu_ids[] __initdata = {
.idcode = 0x43110000,
.idmask = 0xfffff000,
.map_io = s5pv210_map_io,
+ .init_early = s5pv210_init_early,
.init_clocks = s5pv210_init_clocks,
.init_uarts = s5pv210_init_uarts,
.init = s5pv210_init,
@@ -71,6 +75,7 @@ static struct cpu_table cpu_ids[] __initdata = {
.idcode = 0x43210000,
.idmask = 0xfffe0000,
.map_io = exynos4_map_io,
+ .init_early = exynos4_init_early,
.init_clocks = exynos4_init_clocks,
.init_uarts = exynos4_init_uarts,
.init = exynos4_init,
diff --git a/arch/arm/plat-s5p/include/plat/exynos4.h b/arch/arm/plat-s5p/include/plat/exynos4.h
index 907caab..3b45890 100644
--- a/arch/arm/plat-s5p/include/plat/exynos4.h
+++ b/arch/arm/plat-s5p/include/plat/exynos4.h
@@ -19,6 +19,7 @@ extern void exynos4_setup_clocks(void);
#ifdef CONFIG_CPU_EXYNOS4210
extern int exynos4_init(void);
+extern void exynos4_init_early(void);
extern void exynos4_init_irq(void);
extern void exynos4_map_io(void);
extern void exynos4_init_clocks(int xtal);
@@ -27,6 +28,7 @@ extern struct sys_timer exynos4_timer;
#define exynos4_init_uarts exynos4_common_init_uarts
#else
+#define exynos4_init_early NULL
#define exynos4_init_clocks NULL
#define exynos4_init_uarts NULL
#define exynos4_map_io NULL
diff --git a/arch/arm/plat-s5p/include/plat/s5p6440.h b/arch/arm/plat-s5p/include/plat/s5p6440.h
index 528585d..654a766 100644
--- a/arch/arm/plat-s5p/include/plat/s5p6440.h
+++ b/arch/arm/plat-s5p/include/plat/s5p6440.h
@@ -18,6 +18,7 @@ extern void s5p6440_setup_clocks(void);
#ifdef CONFIG_CPU_S5P6440
extern int s5p64x0_init(void);
+extern void s5p6440_init_early(void);
extern void s5p6440_init_irq(void);
extern void s5p6440_map_io(void);
extern void s5p6440_init_clocks(int xtal);
@@ -25,6 +26,7 @@ extern void s5p6440_init_clocks(int xtal);
extern void s5p6440_init_uarts(struct s3c2410_uartcfg *cfg, int no);
#else
+#define s5p6440_init_early NULL
#define s5p6440_init_clocks NULL
#define s5p6440_init_uarts NULL
#define s5p6440_map_io NULL
diff --git a/arch/arm/plat-s5p/include/plat/s5p6450.h b/arch/arm/plat-s5p/include/plat/s5p6450.h
index 640a41c..f4a9fc0 100644
--- a/arch/arm/plat-s5p/include/plat/s5p6450.h
+++ b/arch/arm/plat-s5p/include/plat/s5p6450.h
@@ -18,6 +18,7 @@ extern void s5p6450_setup_clocks(void);
#ifdef CONFIG_CPU_S5P6450
extern int s5p64x0_init(void);
+extern void s5p6450_init_early(void);
extern void s5p6450_init_irq(void);
extern void s5p6450_map_io(void);
extern void s5p6450_init_clocks(int xtal);
@@ -25,6 +26,7 @@ extern void s5p6450_init_clocks(int xtal);
extern void s5p6450_init_uarts(struct s3c2410_uartcfg *cfg, int no);
#else
+#define s5p6450_init_early NULL
#define s5p6450_init_clocks NULL
#define s5p6450_init_uarts NULL
#define s5p6450_map_io NULL
diff --git a/arch/arm/plat-s5p/include/plat/s5pc100.h b/arch/arm/plat-s5p/include/plat/s5pc100.h
index 5f6099d..308f05d 100644
--- a/arch/arm/plat-s5p/include/plat/s5pc100.h
+++ b/arch/arm/plat-s5p/include/plat/s5pc100.h
@@ -19,6 +19,7 @@ extern void s5pc100_setup_clocks(void);
#ifdef CONFIG_CPU_S5PC100
extern int s5pc100_init(void);
+extern void s5pc100_init_early(void);
extern void s5pc100_init_irq(void);
extern void s5pc100_map_io(void);
extern void s5pc100_init_clocks(int xtal);
@@ -26,6 +27,7 @@ extern void s5pc100_init_clocks(int xtal);
#define s5pc100_init_uarts s5pc100_common_init_uarts
#else
+#define s5pc100_init_early NULL
#define s5pc100_init_clocks NULL
#define s5pc100_init_uarts NULL
#define s5pc100_map_io NULL
diff --git a/arch/arm/plat-s5p/include/plat/s5pv210.h b/arch/arm/plat-s5p/include/plat/s5pv210.h
index 6c93a0c..b31a02b 100644
--- a/arch/arm/plat-s5p/include/plat/s5pv210.h
+++ b/arch/arm/plat-s5p/include/plat/s5pv210.h
@@ -19,6 +19,7 @@ extern void s5pv210_setup_clocks(void);
#ifdef CONFIG_CPU_S5PV210
extern int s5pv210_init(void);
+extern void s5pv210_init_early(void);
extern void s5pv210_init_irq(void);
extern void s5pv210_map_io(void);
extern void s5pv210_init_clocks(int xtal);
@@ -26,6 +27,7 @@ extern void s5pv210_init_clocks(int xtal);
#define s5pv210_init_uarts s5pv210_common_init_uarts
#else
+#define s5pv210_init_early NULL
#define s5pv210_init_clocks NULL
#define s5pv210_init_uarts NULL
#define s5pv210_map_io NULL
diff --git a/arch/arm/plat-samsung/include/plat/cpu.h b/arch/arm/plat-samsung/include/plat/cpu.h
index c0a5741..14ec469 100644
--- a/arch/arm/plat-samsung/include/plat/cpu.h
+++ b/arch/arm/plat-samsung/include/plat/cpu.h
@@ -35,6 +35,7 @@ struct cpu_table {
unsigned long idcode;
unsigned long idmask;
void (*map_io)(void);
+ void (*init_early)(void);
void (*init_uarts)(struct s3c2410_uartcfg *cfg, int no);
void (*init_clocks)(int xtal);
int (*init)(void);
@@ -43,6 +44,7 @@ struct cpu_table {
extern void s3c_init_cpu(unsigned long idcode,
struct cpu_table *cpus, unsigned int cputab_size);
+extern void s3c_init_early(void);
/* core initialisation functions */
diff --git a/arch/arm/plat-samsung/init.c b/arch/arm/plat-samsung/init.c
index 79d10fc..c27b92f 100644
--- a/arch/arm/plat-samsung/init.c
+++ b/arch/arm/plat-samsung/init.c
@@ -60,7 +60,14 @@ void __init s3c_init_cpu(unsigned long idcode,
panic("Unsupported Samsung CPU");
}
- cpu->map_io();
+ if (cpu->map_io)
+ cpu->map_io();
+}
+
+void __init s3c_init_early(void)
+{
+ if (cpu->init_early)
+ cpu->init_early();
}
/* s3c24xx_init_clocks
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: DT vs ARM static mappings
2011-09-20 19:28 ` Arnd Bergmann
2011-09-21 9:41 ` Pawel Moll
@ 2011-09-22 16:23 ` Pawel Moll
[not found] ` <1316708611.4611.873.camel-okZbbLrgpR/YkXV2EHHjLW3o5bpOHsLO@public.gmane.org>
1 sibling, 1 reply; 16+ messages in thread
From: Pawel Moll @ 2011-09-22 16:23 UTC (permalink / raw)
To: Arnd Bergmann, Rob Herring; +Cc: devicetree-discuss, linux-arm-kernel
> - 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 just a development snapshot, don't treat it as a
final proposal).
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 to use in v2m.c have aliases in DTS so I can find
their offsets in the flat tree (the *_find_node_by_alias() function is
rather generic and could be moved to drivers/of/fdt.c if you think it
would be useful for others).
* There are no more users of MMIO_P2V in v2m.c, next thing I will do is
the same in core tile; then the macro can be killed. Once this happens
the virtual address currently taken from __MMIO_P2V(V2M_PA_CS7) will be
replaced by some kind of "#define V2M_PERIPH_BASE 0xf8000000".
* Once Nico's changes regarding static maps are in, the manual pointer
operations in v2m_dt_map_io can be replaced with neat ioremap()-s.
All feedback appreciated, cheers!
Paweł
diff --git a/arch/arm/boot/dts/vexpress-v2m-legacy.dtsi b/arch/arm/boot/dts/vexpress-v2m-legacy.dtsi
index cb18052..ec40e5c 100644
--- a/arch/arm/boot/dts/vexpress-v2m-legacy.dtsi
+++ b/arch/arm/boot/dts/vexpress-v2m-legacy.dtsi
@@ -9,6 +9,10 @@
serial3 = &uart3;
i2c0 = &i2c0;
i2c1 = &i2c1;
+ timer01 = &timer01;
+ timer23 = &timer23;
+ sysreg = &sysreg;
+ sysctl = &sysctl;
};
motherboard {
@@ -48,6 +52,16 @@
#size-cells = <1>;
ranges = <0 7 0 0x20000>;
+ sysreg: sysreg@00000 {
+ compatible = "arm,vexpress-sysreg";
+ reg = <0x00000 0x1000>;
+ };
+
+ sysctl: sysctl@01000 {
+ compatible = "arm,sp810";
+ reg = <0x01000 0x1000>;
+ };
+
// PCI-E I2C bus
i2c0: i2c@02000 {
compatible = "arm,versatile-i2c";
@@ -116,6 +130,16 @@
interrupts = <0>;
};
+ timer01: timer@11000 {
+ compatible = "arm,sp804", "arm,primecell";
+ reg = <0x11000 0x1000>;
+ };
+
+ timer23: timer@12000 {
+ compatible = "arm,sp804", "arm,primecell";
+ reg = <0x12000 0x1000>;
+ };
+
// DVI I2C bus
i2c1: i2c@16000 {
compatible = "arm,versatile-i2c";
diff --git a/arch/arm/boot/dts/vexpress-v2p-ca9.dts b/arch/arm/boot/dts/vexpress-v2p-ca9.dts
index 5fc4871..dadaae1 100644
--- a/arch/arm/boot/dts/vexpress-v2p-ca9.dts
+++ b/arch/arm/boot/dts/vexpress-v2p-ca9.dts
@@ -6,7 +6,7 @@
/ {
model = "ARM Versatile Express";
- compatible = "arm,vexpress-v2p-ca9", "arm,vexpress";
+ compatible = "arm,vexpress-v2p-ca9", "arm,vexpress-legacy", "arm,vexpress";
interrupt-parent = <&intc>;
memory {
diff --git a/arch/arm/include/asm/hardware/arm_timer.h b/arch/arm/include/asm/hardware/arm_timer.h
index c0f4e7b..d6030ff 100644
--- a/arch/arm/include/asm/hardware/arm_timer.h
+++ b/arch/arm/include/asm/hardware/arm_timer.h
@@ -9,7 +9,12 @@
*
* Integrator AP has 16-bit timers, Integrator CP, Versatile and Realview
* can have 16-bit or 32-bit selectable via a bit in the control register.
+ *
+ * Every SP804 contains two identical timers.
*/
+#define TIMER_1_BASE 0x00
+#define TIMER_2_BASE 0x20
+
#define TIMER_LOAD 0x00 /* ACVR rw */
#define TIMER_VALUE 0x04 /* ACVR ro */
#define TIMER_CTRL 0x08 /* ACVR rw */
diff --git a/arch/arm/mach-vexpress/include/mach/motherboard.h b/arch/arm/mach-vexpress/include/mach/motherboard.h
index 0a3a375..0b42b96 100644
--- a/arch/arm/mach-vexpress/include/mach/motherboard.h
+++ b/arch/arm/mach-vexpress/include/mach/motherboard.h
@@ -39,34 +39,27 @@
#define V2M_CF (V2M_PA_CS7 + 0x0001a000)
#define V2M_CLCD (V2M_PA_CS7 + 0x0001f000)
-#define V2M_SYS_ID (V2M_SYSREGS + 0x000)
-#define V2M_SYS_SW (V2M_SYSREGS + 0x004)
-#define V2M_SYS_LED (V2M_SYSREGS + 0x008)
-#define V2M_SYS_100HZ (V2M_SYSREGS + 0x024)
-#define V2M_SYS_FLAGS (V2M_SYSREGS + 0x030)
-#define V2M_SYS_FLAGSSET (V2M_SYSREGS + 0x030)
-#define V2M_SYS_FLAGSCLR (V2M_SYSREGS + 0x034)
-#define V2M_SYS_NVFLAGS (V2M_SYSREGS + 0x038)
-#define V2M_SYS_NVFLAGSSET (V2M_SYSREGS + 0x038)
-#define V2M_SYS_NVFLAGSCLR (V2M_SYSREGS + 0x03c)
-#define V2M_SYS_MCI (V2M_SYSREGS + 0x048)
-#define V2M_SYS_FLASH (V2M_SYSREGS + 0x03c)
-#define V2M_SYS_CFGSW (V2M_SYSREGS + 0x058)
-#define V2M_SYS_24MHZ (V2M_SYSREGS + 0x05c)
-#define V2M_SYS_MISC (V2M_SYSREGS + 0x060)
-#define V2M_SYS_DMA (V2M_SYSREGS + 0x064)
-#define V2M_SYS_PROCID0 (V2M_SYSREGS + 0x084)
-#define V2M_SYS_PROCID1 (V2M_SYSREGS + 0x088)
-#define V2M_SYS_CFGDATA (V2M_SYSREGS + 0x0a0)
-#define V2M_SYS_CFGCTRL (V2M_SYSREGS + 0x0a4)
-#define V2M_SYS_CFGSTAT (V2M_SYSREGS + 0x0a8)
-
-#define V2M_TIMER0 (V2M_TIMER01 + 0x000)
-#define V2M_TIMER1 (V2M_TIMER01 + 0x020)
-
-#define V2M_TIMER2 (V2M_TIMER23 + 0x000)
-#define V2M_TIMER3 (V2M_TIMER23 + 0x020)
-
+#define V2M_SYS_ID 0x000
+#define V2M_SYS_SW 0x004
+#define V2M_SYS_LED 0x008
+#define V2M_SYS_100HZ 0x024
+#define V2M_SYS_FLAGS 0x030
+#define V2M_SYS_FLAGSSET 0x030
+#define V2M_SYS_FLAGSCLR 0x034
+#define V2M_SYS_NVFLAGS 0x038
+#define V2M_SYS_NVFLAGSSET 0x038
+#define V2M_SYS_NVFLAGSCLR 0x03c
+#define V2M_SYS_MCI 0x048
+#define V2M_SYS_FLASH 0x03c
+#define V2M_SYS_CFGSW 0x058
+#define V2M_SYS_24MHZ 0x05c
+#define V2M_SYS_MISC 0x060
+#define V2M_SYS_DMA 0x064
+#define V2M_SYS_PROCID0 0x084
+#define V2M_SYS_PROCID1 0x088
+#define V2M_SYS_CFGDATA 0x0a0
+#define V2M_SYS_CFGCTRL 0x0a4
+#define V2M_SYS_CFGSTAT 0x0a8
/*
* Interrupts. Those in {} are for AMBA devices
diff --git a/arch/arm/mach-vexpress/v2m.c b/arch/arm/mach-vexpress/v2m.c
index ed00d52..16e4006 100644
--- a/arch/arm/mach-vexpress/v2m.c
+++ b/arch/arm/mach-vexpress/v2m.c
@@ -6,6 +6,8 @@
#include <linux/amba/mmci.h>
#include <linux/io.h>
#include <linux/init.h>
+#include <linux/of_address.h>
+#include <linux/of_fdt.h>
#include <linux/of_irq.h>
#include <linux/of_platform.h>
#include <linux/platform_device.h>
@@ -33,13 +35,14 @@
#include "core.h"
+/* Legacy memory map values for backward compatibility */
#define V2M_PA_CS0 0x40000000
#define V2M_PA_CS1 0x44000000
#define V2M_PA_CS2 0x48000000
#define V2M_PA_CS3 0x4c000000
#define V2M_PA_CS7 0x10000000
-static struct map_desc v2m_io_desc[] __initdata = {
+static struct map_desc v2m_legacy_io_desc[] __initdata = {
{
.virtual = __MMIO_P2V(V2M_PA_CS7),
.pfn = __phys_to_pfn(V2M_PA_CS7),
@@ -48,21 +51,36 @@ static struct map_desc v2m_io_desc[] __initdata = {
},
};
+static struct map_desc v2m_rs1_io_desc[] __initdata = {
+ {
+ .virtual = __MMIO_P2V(V2M_PA_CS7),
+ .pfn = __phys_to_pfn(0x1c000000),
+ .length = SZ_2M,
+ .type = MT_DEVICE,
+ },
+};
+
+static void __iomem *v2m_sysreg_base;
+static void __iomem *v2m_sysctl_base;
+static void __iomem *v2m_timer01_base;
+
+
+
static void __init v2m_timer_init(void)
{
u32 scctrl;
/* Select 1MHz TIMCLK as the reference clock for SP804 timers */
- scctrl = readl(MMIO_P2V(V2M_SYSCTL + SCCTRL));
+ scctrl = readl(v2m_sysctl_base + SCCTRL);
scctrl |= SCCTRL_TIMEREN0SEL_TIMCLK;
scctrl |= SCCTRL_TIMEREN1SEL_TIMCLK;
- writel(scctrl, MMIO_P2V(V2M_SYSCTL + SCCTRL));
+ writel(scctrl, v2m_sysctl_base + SCCTRL);
- writel(0, MMIO_P2V(V2M_TIMER0) + TIMER_CTRL);
- writel(0, MMIO_P2V(V2M_TIMER1) + TIMER_CTRL);
+ writel(0, v2m_timer01_base + TIMER_1_BASE + TIMER_CTRL);
+ writel(0, v2m_timer01_base + TIMER_2_BASE + TIMER_CTRL);
- sp804_clocksource_init(MMIO_P2V(V2M_TIMER1), "v2m-timer1");
- sp804_clockevents_init(MMIO_P2V(V2M_TIMER0), IRQ_V2M_TIMER0,
+ sp804_clocksource_init(v2m_timer01_base + TIMER_1_BASE, "v2m-timer1");
+ sp804_clockevents_init(v2m_timer01_base + TIMER_2_BASE, IRQ_V2M_TIMER0,
"v2m-timer0");
}
@@ -83,14 +101,14 @@ int v2m_cfg_write(u32 devfn, u32 data)
devfn |= SYS_CFG_START | SYS_CFG_WRITE;
spin_lock(&v2m_cfg_lock);
- val = readl(MMIO_P2V(V2M_SYS_CFGSTAT));
- writel(val & ~SYS_CFG_COMPLETE, MMIO_P2V(V2M_SYS_CFGSTAT));
+ val = readl(v2m_sysreg_base + V2M_SYS_CFGSTAT);
+ writel(val & ~SYS_CFG_COMPLETE, v2m_sysreg_base + V2M_SYS_CFGSTAT);
- writel(data, MMIO_P2V(V2M_SYS_CFGDATA));
- writel(devfn, MMIO_P2V(V2M_SYS_CFGCTRL));
+ writel(data, v2m_sysreg_base + V2M_SYS_CFGDATA);
+ writel(devfn, v2m_sysreg_base + V2M_SYS_CFGCTRL);
do {
- val = readl(MMIO_P2V(V2M_SYS_CFGSTAT));
+ val = readl(v2m_sysreg_base + V2M_SYS_CFGSTAT);
} while (val == 0);
spin_unlock(&v2m_cfg_lock);
@@ -104,17 +122,17 @@ int v2m_cfg_read(u32 devfn, u32 *data)
devfn |= SYS_CFG_START;
spin_lock(&v2m_cfg_lock);
- writel(0, MMIO_P2V(V2M_SYS_CFGSTAT));
- writel(devfn, MMIO_P2V(V2M_SYS_CFGCTRL));
+ writel(0, v2m_sysreg_base + V2M_SYS_CFGSTAT);
+ writel(devfn, v2m_sysreg_base + V2M_SYS_CFGCTRL);
mb();
do {
cpu_relax();
- val = readl(MMIO_P2V(V2M_SYS_CFGSTAT));
+ val = readl(v2m_sysreg_base + V2M_SYS_CFGSTAT);
} while (val == 0);
- *data = readl(MMIO_P2V(V2M_SYS_CFGDATA));
+ *data = readl(v2m_sysreg_base + V2M_SYS_CFGDATA);
spin_unlock(&v2m_cfg_lock);
return !!(val & SYS_CFG_ERR);
@@ -205,7 +223,7 @@ static struct platform_device v2m_usb_device = {
static void v2m_flash_set_vpp(struct platform_device *pdev, int on)
{
- writel(on != 0, MMIO_P2V(V2M_SYS_FLASH));
+ writel(on != 0, v2m_sysreg_base + V2M_SYS_FLASH);
}
static struct physmap_flash_data v2m_flash_data = {
@@ -259,7 +277,7 @@ static struct platform_device v2m_cf_device = {
static unsigned int v2m_mmci_status(struct device *dev)
{
- return readl(MMIO_P2V(V2M_SYS_MCI)) & (1 << 0);
+ return readl(v2m_sysreg_base + V2M_SYS_MCI) & (1 << 0);
}
static struct mmci_platform_data v2m_mmci_data = {
@@ -372,7 +390,7 @@ static void __init v2m_init_early(void)
{
ct_desc->init_early();
clkdev_add_table(v2m_lookups, ARRAY_SIZE(v2m_lookups));
- versatile_sched_clock_init(MMIO_P2V(V2M_SYS_24MHZ), 24000000);
+ versatile_sched_clock_init(v2m_sysreg_base + V2M_SYS_24MHZ, 24000000);
}
static void v2m_power_off(void)
@@ -401,7 +419,8 @@ static void __init v2m_populate_ct_desc(void)
u32 current_tile_id;
ct_desc = NULL;
- current_tile_id = readl(MMIO_P2V(V2M_SYS_PROCID0)) & V2M_CT_ID_MASK;
+ current_tile_id = readl(v2m_sysreg_base + V2M_SYS_PROCID0)
+ & V2M_CT_ID_MASK;
for (i = 0; i < ARRAY_SIZE(ct_descs) && !ct_desc; ++i)
if (ct_descs[i]->id == current_tile_id)
@@ -414,7 +433,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));
+ iotable_init(v2m_legacy_io_desc, ARRAY_SIZE(v2m_legacy_io_desc));
+ v2m_sysreg_base = MMIO_P2V(V2M_SYSREGS);
+ v2m_sysctl_base = MMIO_P2V(V2M_SYSCTL);
+ v2m_timer01_base = MMIO_P2V(V2M_TIMER01);
v2m_populate_ct_desc();
ct_desc->map_io();
}
@@ -472,6 +494,135 @@ struct of_dev_auxdata v2m_dt_auxdata_lookup[] __initdata = {
{}
};
+struct v2m_dt_find_alias_state {
+ const char *alias;
+ unsigned long node;
+ const char *path;
+ int depth;
+ int token_len;
+
+};
+
+static int __init v2m_dt_scan_path(unsigned long node,
+ const char *uname, int depth, void *data)
+{
+ struct v2m_dt_find_alias_state *state = data;
+
+ pr_debug("%s: uname='%s', depth=%d, state->path='%s', state->depth=%d,"
+ " state->token_len=%d\n", __func__, uname, depth,
+ state->path, state->depth, state->token_len);
+
+ /* If the depth decreases, we didn't find the path */
+ if (depth < state->depth)
+ return -ENOENT;
+
+ /* Check if path ~= /^uname[\/\0]/ */
+ if (strncmp(state->path, uname, state->token_len) == 0 &&
+ uname[state->token_len] == 0) {
+ const char *slash;
+
+ state->depth++;
+ state->path += state->token_len; /* Next token */
+ if (*state->path == 0) { /* All path tokens processed? */
+ state->node = node;
+ return 1; /* Success! */
+ }
+ BUG_ON(*state->path != '/');
+ state->path++; /* Skip leading slash */
+ slash = strchr(state->path, '/');
+ if (!slash)
+ state->token_len = strlen(state->path);
+ else
+ state->token_len = slash - state->path;
+ }
+
+ return 0;
+}
+
+static int __init v2m_dt_scan_alias(unsigned long node,
+ const char *uname, int depth, void *data)
+{
+ int res;
+ struct v2m_dt_find_alias_state *state = data;
+
+ if (depth != 1 || strcmp(uname, "aliases") != 0)
+ return 0;
+
+ state->path = of_get_flat_dt_prop(node, state->alias, NULL);
+ if (!state->path)
+ return -ENXIO;
+ if (*state->path != '/')
+ return -EFAULT;
+
+ state->token_len = 0; /* Root node has no name */
+ res = of_scan_flat_dt(v2m_dt_scan_path, state);
+ if (res == 0) /* Whole tree scanned, no path found */
+ res = -ENOENT;
+
+ return res;
+}
+
+static int __init v2m_dt_find_node_by_alias(const char *alias,
+ unsigned long *node)
+{
+ int err;
+ struct v2m_dt_find_alias_state state = {
+ .alias = alias,
+ };
+
+ err = of_scan_flat_dt(v2m_dt_scan_alias, &state);
+
+ if (err > 0)
+ *node = state.node;
+
+ return err;
+}
+
+static unsigned long __init v2m_dt_periph_offset(const char *alias)
+{
+ unsigned long node;
+ __be32 *reg;
+ unsigned long len;
+ unsigned long offset;
+
+ if (v2m_dt_find_node_by_alias(alias, &node) <= 0)
+ panic("%s(): Can't get offset for '%s'!\n", __func__, alias);
+
+ reg = of_get_flat_dt_prop(node, "reg", &len);
+ if (!reg)
+ panic("%s(): Can't get reg property for '%s'!\n",
+ __func__, alias);
+
+ return be32_to_cpup(reg);
+}
+
+static void __init v2m_dt_map_io(void)
+{
+ void __iomem *periph_base;
+
+ if (of_flat_dt_is_compatible(of_get_flat_dt_root(),
+ "arm,vexpress-legacy")) {
+ pr_info("v2m: Legacy memory map.\n");
+ iotable_init(v2m_legacy_io_desc,
+ ARRAY_SIZE(v2m_legacy_io_desc));
+ /* Won't be needed once we can call ioremap() in map_io */
+ periph_base = (void __iomem *)v2m_legacy_io_desc[0].virtual;
+ } else {
+ printk("v2m: RS1 memory map.\n");
+ iotable_init(v2m_rs1_io_desc,
+ ARRAY_SIZE(v2m_rs1_io_desc));
+ /* Won't be needed once we can call ioremap() in map_io */
+ periph_base = (void __iomem *)v2m_legacy_io_desc[0].virtual;
+ }
+
+ v2m_sysreg_base = periph_base + v2m_dt_periph_offset("sysreg");
+ v2m_sysctl_base = periph_base + v2m_dt_periph_offset("sysctl");
+ v2m_timer01_base = periph_base + v2m_dt_periph_offset("timer01");
+
+ v2m_populate_ct_desc();
+ ct_desc->map_io();
+}
+
static void __init v2m_dt_init(void)
{
of_platform_populate(NULL, of_default_bus_match_table,
@@ -489,7 +640,7 @@ static const char *v2m_dt_match[] __initconst = {
};
DT_MACHINE_START(VEXPRESS_DT, "ARM-Versatile Express")
- .map_io = v2m_map_io,
+ .map_io = v2m_dt_map_io,
.init_early = v2m_init_early,
.init_irq = v2m_init_irq,
.timer = &v2m_timer,
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: DT vs ARM static mappings
[not found] ` <1316708611.4611.873.camel-okZbbLrgpR/YkXV2EHHjLW3o5bpOHsLO@public.gmane.org>
@ 2011-09-23 15:45 ` Arnd Bergmann
0 siblings, 0 replies; 16+ messages in thread
From: Arnd Bergmann @ 2011-09-23 15:45 UTC (permalink / raw)
To: Pawel Moll
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
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 to use in v2m.c have aliases in DTS so I can find
> their offsets in the flat tree (the *_find_node_by_alias() function is
> rather generic and could be moved to drivers/of/fdt.c if you think it
> would be useful for others).
>
> * There are no more users of MMIO_P2V in v2m.c, next thing I will do is
> the same in core tile; then the macro can be killed. Once this happens
> the virtual address currently taken from __MMIO_P2V(V2M_PA_CS7) will be
> replaced by some kind of "#define V2M_PERIPH_BASE 0xf8000000".
>
> * Once Nico's changes regarding static maps are in, the manual pointer
> operations in v2m_dt_map_io can be replaced with neat ioremap()-s.
>
> All feedback appreciated, cheers!
Look ok to me. Just a comment on the submission:
Even when you post something for review instead of inclusion, please add
a Signed-off-by: line and a diffstat.
Arnd
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2011-09-23 15:45 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-20 11:51 DT vs ARM static mappings Pawel Moll
[not found] ` <1316519479.4611.150.camel-okZbbLrgpR/YkXV2EHHjLW3o5bpOHsLO@public.gmane.org>
2011-09-20 12:58 ` Rob Herring
2011-09-20 14:02 ` Pawel Moll
[not found] ` <1316527365.4611.354.camel-okZbbLrgpR/YkXV2EHHjLW3o5bpOHsLO@public.gmane.org>
2011-09-20 14:37 ` Rob Herring
2011-09-20 16:16 ` Pawel Moll
[not found] ` <1316535403.4611.534.camel-okZbbLrgpR/YkXV2EHHjLW3o5bpOHsLO@public.gmane.org>
2011-09-20 19:28 ` Arnd Bergmann
2011-09-21 9:41 ` Pawel Moll
[not found] ` <1316598109.4611.613.camel-okZbbLrgpR/YkXV2EHHjLW3o5bpOHsLO@public.gmane.org>
2011-09-21 9:59 ` Dave Martin
2011-09-21 10:02 ` Pawel Moll
2011-09-22 16:23 ` Pawel Moll
[not found] ` <1316708611.4611.873.camel-okZbbLrgpR/YkXV2EHHjLW3o5bpOHsLO@public.gmane.org>
2011-09-23 15:45 ` Arnd Bergmann
2011-09-21 17:49 ` Nicolas Pitre
2011-09-22 13:04 ` Pawel Moll
[not found] ` <1316696696.4611.844.camel-okZbbLrgpR/YkXV2EHHjLW3o5bpOHsLO@public.gmane.org>
2011-09-22 13:13 ` Russell King - ARM Linux
2011-09-22 13:45 ` Pawel Moll
[not found] ` <1316699153.4611.858.camel-okZbbLrgpR/YkXV2EHHjLW3o5bpOHsLO@public.gmane.org>
2011-09-22 13:59 ` Russell King - ARM Linux
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).