diff mbox

ARM: clean-up common multi-platform kconfig options

Message ID 1386262722-26016-1-git-send-email-robherring2@gmail.com
State New
Headers show

Commit Message

Rob Herring Dec. 5, 2013, 4:58 p.m. UTC
From: Rob Herring <rob.herring@calxeda.com>

Multi-platform requires various kconfig options to be selected, so
platforms don't need to select them individually.

A few more options could be selected because they are either on nearly
every platform or they just enable other kconfig options to be visible:

select ARM_AMBA
select ARM_GIC if CPU_V7
select HAVE_SMP if CPU_V7
select MIGHT_HAVE_CACHE_L2X0 if ARCH_MULTI_V6_V7
select ARCH_HAS_CPUFREQ
select ARCH_HAS_OPP

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
---
 arch/arm/Kconfig                |  2 ++
 arch/arm/mach-bcm/Kconfig       |  5 -----
 arch/arm/mach-bcm2835/Kconfig   |  4 ----
 arch/arm/mach-cns3xxx/Kconfig   |  1 -
 arch/arm/mach-highbank/Kconfig  |  6 ------
 arch/arm/mach-imx/Kconfig       | 12 ------------
 arch/arm/mach-keystone/Kconfig  |  3 ---
 arch/arm/mach-mvebu/Kconfig     |  5 -----
 arch/arm/mach-mxs/Kconfig       |  4 ----
 arch/arm/mach-nomadik/Kconfig   |  5 -----
 arch/arm/mach-nspire/Kconfig    |  5 -----
 arch/arm/mach-omap2/Kconfig     | 16 ----------------
 arch/arm/mach-picoxcell/Kconfig |  4 ----
 arch/arm/mach-prima2/Kconfig    |  4 ----
 arch/arm/mach-rockchip/Kconfig  |  2 --
 arch/arm/mach-shmobile/Kconfig  |  3 ---
 arch/arm/mach-socfpga/Kconfig   |  5 -----
 arch/arm/mach-spear/Kconfig     |  8 --------
 arch/arm/mach-sunxi/Kconfig     |  4 ----
 arch/arm/mach-tegra/Kconfig     |  6 ------
 arch/arm/mach-u300/Kconfig      |  6 ------
 arch/arm/mach-ux500/Kconfig     |  3 ---
 arch/arm/mach-vexpress/Kconfig  |  3 ---
 arch/arm/mach-virt/Kconfig      |  4 ----
 arch/arm/mach-vt8500/Kconfig    |  4 ----
 arch/arm/mach-zynq/Kconfig      |  5 -----
 26 files changed, 2 insertions(+), 127 deletions(-)

Comments

Arnd Bergmann Dec. 5, 2013, 8:25 p.m. UTC | #1
On Thursday 05 December 2013, Rob Herring wrote:
> select ARM_AMBA
> select ARM_GIC if CPU_V7
> select HAVE_SMP if CPU_V7
> select MIGHT_HAVE_CACHE_L2X0 if ARCH_MULTI_V6_V7
> select ARCH_HAS_CPUFREQ
> select ARCH_HAS_OPP

Not sure about ARM_GIC and HAVE_SMP, as they won't typically be
set on Cortex-A8, Scorpion and PJ4. The other suggestions sound
good, and your patch looks fine as well.

Acked-by: Arnd Bergmann <arnd@arndb.de>
Rob Herring Dec. 5, 2013, 9:34 p.m. UTC | #2
On Thu, Dec 5, 2013 at 2:25 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Thursday 05 December 2013, Rob Herring wrote:
>> select ARM_AMBA
>> select ARM_GIC if CPU_V7
>> select HAVE_SMP if CPU_V7
>> select MIGHT_HAVE_CACHE_L2X0 if ARCH_MULTI_V6_V7
>> select ARCH_HAS_CPUFREQ
>> select ARCH_HAS_OPP
>
> Not sure about ARM_GIC and HAVE_SMP, as they won't typically be
> set on Cortex-A8, Scorpion and PJ4. The other suggestions sound
> good, and your patch looks fine as well.

HAVE_SMP only enables visibility of the SMP kconfig option. That could
cause randconfig builds that would not boot if SMP_ON_UP was not
enabled, but a "select SMP_ON_UP if SMP" here would fix that though.

GIC is on probably 90% of the v7 platforms, so seems like a small cost
to carry it. We've tried to avoid putting core specific knowledge into
the kernel, but effectively it is still there. It's just duplicated in
each platform selecting the individual options (GIC, SCU, TWD, errata,
etc.) rather than a core type.

Rob
Arnd Bergmann Dec. 5, 2013, 9:50 p.m. UTC | #3
On Thursday 05 December 2013, Rob Herring wrote:
> On Thu, Dec 5, 2013 at 2:25 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> > On Thursday 05 December 2013, Rob Herring wrote:
> >> select ARM_AMBA
> >> select ARM_GIC if CPU_V7
> >> select HAVE_SMP if CPU_V7
> >> select MIGHT_HAVE_CACHE_L2X0 if ARCH_MULTI_V6_V7
> >> select ARCH_HAS_CPUFREQ
> >> select ARCH_HAS_OPP
> >
> > Not sure about ARM_GIC and HAVE_SMP, as they won't typically be
> > set on Cortex-A8, Scorpion and PJ4. The other suggestions sound
> > good, and your patch looks fine as well.
> 
> HAVE_SMP only enables visibility of the SMP kconfig option. That could
> cause randconfig builds that would not boot if SMP_ON_UP was not
> enabled, but a "select SMP_ON_UP if SMP" here would fix that though.

Ok, I see. "select HAVE_SMP if CPU_V7" maybe "select HAVE_SMP if
ARCH_MULTI_V7" sounds reasonable then, at least I'd prefer that over
the "select SMP_ON_UP if SMP" option, which would make having SMP_ON_UP
as an option pointless, since you could no longer turn it off.

If you set HAVE_SMP for CPU_V7, it would be logical to also set it for
CPU_V6K, although I'm unsure if we actually still support any SMP V6K
platforms in practice: CNS3xxx is the only such platform I'm aware of,
and the SMP support for that one was never merged (it's in openwrt
though).

> GIC is on probably 90% of the v7 platforms, so seems like a small cost
> to carry it. We've tried to avoid putting core specific knowledge into
> the kernel, but effectively it is still there. It's just duplicated in
> each platform selecting the individual options (GIC, SCU, TWD, errata,
> etc.) rather than a core type.

Hmm, I realize that this only controls the compilation of one file and
no other #ifdef at this point, but I'm still hesitant here, since I can
think of a few people that were actually worried about a potential kernel
binary size increase after enabling CONFIG_MULTIPLATFORM. I think so
far we have been really good at keeping the size difference close to
zero, and while this is not a lot of code, it seems wrong to intentionally
grow the kernel here. No strong objections though, if you can find other
developers that think it's a good idea to have this automatically turned on.

	Arnd
Rob Herring Dec. 6, 2013, 4:10 a.m. UTC | #4
On Thu, Dec 5, 2013 at 3:50 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Thursday 05 December 2013, Rob Herring wrote:
>> On Thu, Dec 5, 2013 at 2:25 PM, Arnd Bergmann <arnd@arndb.de> wrote:
>> > On Thursday 05 December 2013, Rob Herring wrote:
>> >> select ARM_AMBA
>> >> select ARM_GIC if CPU_V7
>> >> select HAVE_SMP if CPU_V7
>> >> select MIGHT_HAVE_CACHE_L2X0 if ARCH_MULTI_V6_V7
>> >> select ARCH_HAS_CPUFREQ
>> >> select ARCH_HAS_OPP
>> >
>> > Not sure about ARM_GIC and HAVE_SMP, as they won't typically be
>> > set on Cortex-A8, Scorpion and PJ4. The other suggestions sound
>> > good, and your patch looks fine as well.
>>
>> HAVE_SMP only enables visibility of the SMP kconfig option. That could
>> cause randconfig builds that would not boot if SMP_ON_UP was not
>> enabled, but a "select SMP_ON_UP if SMP" here would fix that though.
>
> Ok, I see. "select HAVE_SMP if CPU_V7" maybe "select HAVE_SMP if
> ARCH_MULTI_V7" sounds reasonable then, at least I'd prefer that over
> the "select SMP_ON_UP if SMP" option, which would make having SMP_ON_UP
> as an option pointless, since you could no longer turn it off.
>
> If you set HAVE_SMP for CPU_V7, it would be logical to also set it for
> CPU_V6K, although I'm unsure if we actually still support any SMP V6K
> platforms in practice: CNS3xxx is the only such platform I'm aware of,
> and the SMP support for that one was never merged (it's in openwrt
> though).

We should be able to boot an SMP kernel on it whether or not the
platform has SMP support added, right?

Practically every v6 platform selects v6K. We should probably default
to V6K for ARCH_MULTI_V6 and let platforms select CPU_V6 instead if
needed. I believe that will give the v6 versions of code only as
needed and will give better versions of code if only v6K is selected.
imx31 is one that doesn't select v6K, but only very early revs did not
have v6K version of the 1136. I don't think any of those parts went
into production (maybe into the original Zune?).

I assume we expect a v6 SMP kernel to run on a non-v6K v6 platform? if
so, doing more digging I think we have a problem with
__kuser_cmpxchg64 on a v6 only platform with v6K enabled in the
kernel. Adding Nico since he wrote this. The code is ifdef'ed like
this:

#if defined(CONFIG_NEEDS_SYSCALL_FOR_CMPXCHG)
(only true for pre-v6)
...
#elif defined(CONFIG_CPU_32v6K)
(true when v6K gets enabled)
...
#elif !defined(CONFIG_SMP)
#ifdef CONFIG_MMU
(this is the correct condition for a v6 only platform)
...
#else
#warning "NPTL on non MMU needs fixing"
...
#endif
#else
#error "incoherent kernel configuration"
#endif

Any build with v6K enabled will get the double exclusive instructions
which won't work on v6 only platforms. It seems we need some
ALT_SMP/ALT_UP magic here.

>> GIC is on probably 90% of the v7 platforms, so seems like a small cost
>> to carry it. We've tried to avoid putting core specific knowledge into
>> the kernel, but effectively it is still there. It's just duplicated in
>> each platform selecting the individual options (GIC, SCU, TWD, errata,
>> etc.) rather than a core type.
>
> Hmm, I realize that this only controls the compilation of one file and
> no other #ifdef at this point, but I'm still hesitant here, since I can
> think of a few people that were actually worried about a potential kernel
> binary size increase after enabling CONFIG_MULTIPLATFORM. I think so
> far we have been really good at keeping the size difference close to
> zero, and while this is not a lot of code, it seems wrong to intentionally
> grow the kernel here. No strong objections though, if you can find other
> developers that think it's a good idea to have this automatically turned on.

Agreed. I doubt we'd get agreement here which is why I did not do it
from the start.

Rob
Arnd Bergmann Dec. 6, 2013, 4:41 p.m. UTC | #5
On Friday 06 December 2013, Rob Herring wrote:
> On Thu, Dec 5, 2013 at 3:50 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> > On Thursday 05 December 2013, Rob Herring wrote:
> >> On Thu, Dec 5, 2013 at 2:25 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> >> > On Thursday 05 December 2013, Rob Herring wrote:
> >> >> select ARM_AMBA
> >> >> select ARM_GIC if CPU_V7
> >> >> select HAVE_SMP if CPU_V7
> >> >> select MIGHT_HAVE_CACHE_L2X0 if ARCH_MULTI_V6_V7
> >> >> select ARCH_HAS_CPUFREQ
> >> >> select ARCH_HAS_OPP
> >> >
> >> > Not sure about ARM_GIC and HAVE_SMP, as they won't typically be
> >> > set on Cortex-A8, Scorpion and PJ4. The other suggestions sound
> >> > good, and your patch looks fine as well.
> >>
> >> HAVE_SMP only enables visibility of the SMP kconfig option. That could
> >> cause randconfig builds that would not boot if SMP_ON_UP was not
> >> enabled, but a "select SMP_ON_UP if SMP" here would fix that though.
> >
> > Ok, I see. "select HAVE_SMP if CPU_V7" maybe "select HAVE_SMP if
> > ARCH_MULTI_V7" sounds reasonable then, at least I'd prefer that over
> > the "select SMP_ON_UP if SMP" option, which would make having SMP_ON_UP
> > as an option pointless, since you could no longer turn it off.
> >
> > If you set HAVE_SMP for CPU_V7, it would be logical to also set it for
> > CPU_V6K, although I'm unsure if we actually still support any SMP V6K
> > platforms in practice: CNS3xxx is the only such platform I'm aware of,
> > and the SMP support for that one was never merged (it's in openwrt
> > though).
> 
> We should be able to boot an SMP kernel on it whether or not the
> platform has SMP support added, right?

Yes, although I don't think anyone has ever tried to boot a UP_ON_SMP
kernel on ARMv5 or earlier. We don't allow that combination at the
moment, and it would be pointless.

> Practically every v6 platform selects v6K. We should probably default
> to V6K for ARCH_MULTI_V6 and let platforms select CPU_V6 instead if
> needed. I believe that will give the v6 versions of code only as
> needed and will give better versions of code if only v6K is selected.
> imx31 is one that doesn't select v6K, but only very early revs did not
> have v6K version of the 1136. I don't think any of those parts went
> into production (maybe into the original Zune?).

Interesting, I had no idea that plain ARMv6 was this rare.

If we could show that all supported platforms are actually v6K anyway
and that nobody has any plans to add new ones, doing away with
v6 in favor of v6k would clean up a lot of confusing (i.e. possibly
wrong) Kconfig logic.

> I assume we expect a v6 SMP kernel to run on a non-v6K v6 platform?

Actually, as far as I can see:

config SMP
        bool "Symmetric Multi-Processing"
        depends on CPU_V6K || CPU_V7
        depends on HAVE_SMP

This prevents you from building a plain v6 SMP kernel, and we've
had a variation of that since CONFIG_SMP was first marked non-BROKEN.

> if so, doing more digging I think we have a problem with
> __kuser_cmpxchg64 on a v6 only platform with v6K enabled in the
> kernel. Adding Nico since he wrote this. The code is ifdef'ed like
> this:
> 
> #if defined(CONFIG_NEEDS_SYSCALL_FOR_CMPXCHG)
> (only true for pre-v6)
> ...
> #elif defined(CONFIG_CPU_32v6K)
> (true when v6K gets enabled)
> ...
> #elif !defined(CONFIG_SMP)
> #ifdef CONFIG_MMU
> (this is the correct condition for a v6 only platform)
> ...
> #else
> #warning "NPTL on non MMU needs fixing"
> ...
> #endif
> #else
> #error "incoherent kernel configuration"
> #endif
> 
> Any build with v6K enabled will get the double exclusive instructions
> which won't work on v6 only platforms. It seems we need some
> ALT_SMP/ALT_UP magic here.

The above code can already be simplified a lot, since the pre-v6 and
pre-v6k v6 cases are dead code. There are comments in Kconfig like this:

config TLS_REG_EMUL
        bool
        select NEED_KUSER_HELPERS
        help
          An SMP system using a pre-ARMv6 processor (there are apparently
          a few prototypes like that in existence) and therefore access to
          that required register must be emulated.

config NEEDS_SYSCALL_FOR_CMPXCHG
        bool
        select NEED_KUSER_HELPERS
        help
          SMP on a pre-ARMv6 processor?  Well OK then.
          Forget about fast user space cmpxchg support.
          It is just not possible.


added in a commit from Nico back in 2005:

    [PATCH] ARM: 2663/1: straightify TLS register emulation a bit more
    
    Patch from Nicolas Pitre
    
    This better express things, and should cover RMK's weird SMP toys.

I don't know what "weird toys" he is referring to, but maybe he or Russell
can shed some light on that and whether we'd expect to see support for
them added in the future. If anyone else but Russell were to propose
adding new platforms like those, I'd probably say no (or possibly
NOOOOoooo) anyway. 

	Arnd
Nicolas Pitre Dec. 6, 2013, 4:59 p.m. UTC | #6
On Fri, 6 Dec 2013, Arnd Bergmann wrote:

> On Friday 06 December 2013, Rob Herring wrote:
> > I assume we expect a v6 SMP kernel to run on a non-v6K v6 platform?
> 
> Actually, as far as I can see:
> 
> config SMP
>         bool "Symmetric Multi-Processing"
>         depends on CPU_V6K || CPU_V7
>         depends on HAVE_SMP
> 
> This prevents you from building a plain v6 SMP kernel, and we've
> had a variation of that since CONFIG_SMP was first marked non-BROKEN.

I don't think the code currently support SMP if v6k is not available.
Therefore...

> > if so, doing more digging I think we have a problem with
> > __kuser_cmpxchg64 on a v6 only platform with v6K enabled in the
> > kernel. Adding Nico since he wrote this. The code is ifdef'ed like
> > this:
> > 
> > #if defined(CONFIG_NEEDS_SYSCALL_FOR_CMPXCHG)
> > (only true for pre-v6)
> > ...
> > #elif defined(CONFIG_CPU_32v6K)
> > (true when v6K gets enabled)
> > ...
> > #elif !defined(CONFIG_SMP)
> > #ifdef CONFIG_MMU
> > (this is the correct condition for a v6 only platform)
> > ...
> > #else
> > #warning "NPTL on non MMU needs fixing"
> > ...
> > #endif
> > #else
> > #error "incoherent kernel configuration"
> > #endif
> > 
> > Any build with v6K enabled will get the double exclusive instructions
> > which won't work on v6 only platforms. It seems we need some
> > ALT_SMP/ALT_UP magic here.
> 
> The above code can already be simplified a lot, since the pre-v6 and
> pre-v6k v6 cases are dead code. There are comments in Kconfig like this:
> 
> config TLS_REG_EMUL
>         bool
>         select NEED_KUSER_HELPERS
>         help
>           An SMP system using a pre-ARMv6 processor (there are apparently
>           a few prototypes like that in existence) and therefore access to
>           that required register must be emulated.
> 
> config NEEDS_SYSCALL_FOR_CMPXCHG
>         bool
>         select NEED_KUSER_HELPERS
>         help
>           SMP on a pre-ARMv6 processor?  Well OK then.
>           Forget about fast user space cmpxchg support.
>           It is just not possible.
> 
> 
> added in a commit from Nico back in 2005:
> 
>     [PATCH] ARM: 2663/1: straightify TLS register emulation a bit more
>     
>     Patch from Nicolas Pitre
>     
>     This better express things, and should cover RMK's weird SMP toys.
> 
> I don't know what "weird toys" he is referring to, but maybe he or Russell
> can shed some light on that and whether we'd expect to see support for
> them added in the future.

If my memory is right, Russell had a Versatile Express with one of the 
first SMP implementations available on ARM which was based on a quad 
ARM9 (ARMv5) core.  I'm pretty sure this is no longer in service, and 
the current state of the kernel wouldn't accommodate it either.

> If anyone else but Russell were to propose
> adding new platforms like those, I'd probably say no (or possibly
> NOOOOoooo) anyway. 

Such a platform would be broken wrt atomic operations across all cores 
anyway.


Nicolas
Rob Herring Dec. 6, 2013, 8:01 p.m. UTC | #7
On Fri, Dec 6, 2013 at 10:41 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Friday 06 December 2013, Rob Herring wrote:
>> On Thu, Dec 5, 2013 at 3:50 PM, Arnd Bergmann <arnd@arndb.de> wrote:
>> > On Thursday 05 December 2013, Rob Herring wrote:
>> >> On Thu, Dec 5, 2013 at 2:25 PM, Arnd Bergmann <arnd@arndb.de> wrote:
>> >> > On Thursday 05 December 2013, Rob Herring wrote:
>> >> >> select ARM_AMBA
>> >> >> select ARM_GIC if CPU_V7
>> >> >> select HAVE_SMP if CPU_V7
>> >> >> select MIGHT_HAVE_CACHE_L2X0 if ARCH_MULTI_V6_V7
>> >> >> select ARCH_HAS_CPUFREQ
>> >> >> select ARCH_HAS_OPP
>> >> >
>> >> > Not sure about ARM_GIC and HAVE_SMP, as they won't typically be
>> >> > set on Cortex-A8, Scorpion and PJ4. The other suggestions sound
>> >> > good, and your patch looks fine as well.
>> >>
>> >> HAVE_SMP only enables visibility of the SMP kconfig option. That could
>> >> cause randconfig builds that would not boot if SMP_ON_UP was not
>> >> enabled, but a "select SMP_ON_UP if SMP" here would fix that though.
>> >
>> > Ok, I see. "select HAVE_SMP if CPU_V7" maybe "select HAVE_SMP if
>> > ARCH_MULTI_V7" sounds reasonable then, at least I'd prefer that over
>> > the "select SMP_ON_UP if SMP" option, which would make having SMP_ON_UP
>> > as an option pointless, since you could no longer turn it off.
>> >
>> > If you set HAVE_SMP for CPU_V7, it would be logical to also set it for
>> > CPU_V6K, although I'm unsure if we actually still support any SMP V6K
>> > platforms in practice: CNS3xxx is the only such platform I'm aware of,
>> > and the SMP support for that one was never merged (it's in openwrt
>> > though).
>>
>> We should be able to boot an SMP kernel on it whether or not the
>> platform has SMP support added, right?
>
> Yes, although I don't think anyone has ever tried to boot a UP_ON_SMP
> kernel on ARMv5 or earlier. We don't allow that combination at the
> moment, and it would be pointless.

I meant an SMP capable platform (v6K+ h/w) should boot an SMP kernel
build whether or not that platform has added smp_ops yet.

>> Practically every v6 platform selects v6K. We should probably default
>> to V6K for ARCH_MULTI_V6 and let platforms select CPU_V6 instead if
>> needed. I believe that will give the v6 versions of code only as
>> needed and will give better versions of code if only v6K is selected.
>> imx31 is one that doesn't select v6K, but only very early revs did not
>> have v6K version of the 1136. I don't think any of those parts went
>> into production (maybe into the original Zune?).
>
> Interesting, I had no idea that plain ARMv6 was this rare.

What I said is not quite right. I think the correct statement is most
of ARM11 (1136 r1px and 1176) is v6K but without the SMP extensions.
AFAICT, only ARM11 MPCore is full v6K. The 1136 and 1176 do have
clrex, double/half/byte exclusives, TEX remapping, and thread ID regs,
but do not have sev and wfe/wfi instructions. SMP_ON_UP should be
enough to handle the sev/wfe instruction differences. So I still think
we really want to be selecting CPU_V6K by default.

> If we could show that all supported platforms are actually v6K anyway
> and that nobody has any plans to add new ones, doing away with
> v6 in favor of v6k would clean up a lot of confusing (i.e. possibly
> wrong) Kconfig logic.
>
>> I assume we expect a v6 SMP kernel to run on a non-v6K v6 platform?
>
> Actually, as far as I can see:
>
> config SMP
>         bool "Symmetric Multi-Processing"
>         depends on CPU_V6K || CPU_V7
>         depends on HAVE_SMP
>
> This prevents you from building a plain v6 SMP kernel, and we've
> had a variation of that since CONFIG_SMP was first marked non-BROKEN.

I'm saying a v6k enabled kernel would not work on pure v6 h/w. But
since all implementations appear to support doubleword exclusives and
there may not be any pure v6 only h/w, then we may never have a
problem with the code below.

>> if so, doing more digging I think we have a problem with
>> __kuser_cmpxchg64 on a v6 only platform with v6K enabled in the
>> kernel. Adding Nico since he wrote this. The code is ifdef'ed like
>> this:
>>
>> #if defined(CONFIG_NEEDS_SYSCALL_FOR_CMPXCHG)
>> (only true for pre-v6)
>> ...
>> #elif defined(CONFIG_CPU_32v6K)
>> (true when v6K gets enabled)
>> ...
>> #elif !defined(CONFIG_SMP)
>> #ifdef CONFIG_MMU
>> (this is the correct condition for a v6 only platform)
>> ...
>> #else
>> #warning "NPTL on non MMU needs fixing"
>> ...
>> #endif
>> #else
>> #error "incoherent kernel configuration"
>> #endif
>>
>> Any build with v6K enabled will get the double exclusive instructions
>> which won't work on v6 only platforms. It seems we need some
>> ALT_SMP/ALT_UP magic here.
>
> The above code can already be simplified a lot, since the pre-v6 and
> pre-v6k v6 cases are dead code. There are comments in Kconfig like this:
>
> config TLS_REG_EMUL
>         bool
>         select NEED_KUSER_HELPERS
>         help
>           An SMP system using a pre-ARMv6 processor (there are apparently
>           a few prototypes like that in existence) and therefore access to
>           that required register must be emulated.
>
> config NEEDS_SYSCALL_FOR_CMPXCHG
>         bool
>         select NEED_KUSER_HELPERS
>         help
>           SMP on a pre-ARMv6 processor?  Well OK then.
>           Forget about fast user space cmpxchg support.
>           It is just not possible.
>
>
> added in a commit from Nico back in 2005:
>
>     [PATCH] ARM: 2663/1: straightify TLS register emulation a bit more
>
>     Patch from Nicolas Pitre
>
>     This better express things, and should cover RMK's weird SMP toys.
>
> I don't know what "weird toys" he is referring to, but maybe he or Russell
> can shed some light on that and whether we'd expect to see support for
> them added in the future. If anyone else but Russell were to propose
> adding new platforms like those, I'd probably say no (or possibly
> NOOOOoooo) anyway.
>
>         Arnd
Arnd Bergmann Dec. 7, 2013, 4:52 a.m. UTC | #8
On Friday 06 December 2013, Rob Herring wrote:
> On Fri, Dec 6, 2013 at 10:41 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> >>
> >> We should be able to boot an SMP kernel on it whether or not the
> >> platform has SMP support added, right?
> >
> > Yes, although I don't think anyone has ever tried to boot a UP_ON_SMP
> > kernel on ARMv5 or earlier. We don't allow that combination at the
> > moment, and it would be pointless.
> 
> I meant an SMP capable platform (v6K+ h/w) should boot an SMP kernel
> build whether or not that platform has added smp_ops yet.

Yes, absolutely.

> >> Practically every v6 platform selects v6K. We should probably default
> >> to V6K for ARCH_MULTI_V6 and let platforms select CPU_V6 instead if
> >> needed. I believe that will give the v6 versions of code only as
> >> needed and will give better versions of code if only v6K is selected.
> >> imx31 is one that doesn't select v6K, but only very early revs did not
> >> have v6K version of the 1136. I don't think any of those parts went
> >> into production (maybe into the original Zune?).
> >
> > Interesting, I had no idea that plain ARMv6 was this rare.
> 
> What I said is not quite right. I think the correct statement is most
> of ARM11 (1136 r1px and 1176) is v6K but without the SMP extensions.
> AFAICT, only ARM11 MPCore is full v6K. The 1136 and 1176 do have
> clrex, double/half/byte exclusives, TEX remapping, and thread ID regs,
> but do not have sev and wfe/wfi instructions. SMP_ON_UP should be
> enough to handle the sev/wfe instruction differences. So I still think
> we really want to be selecting CPU_V6K by default.

For all I can tell, sev, wfe and wfi are only used in SMP code or in
code that is specific to ARMv7 based platforms we know support it, so
no runtime SMP_ON_UP logic would be necessary at this point.

We have a number of platforms that currently select CPU_V6 but not CPU_V6K:

ARCH_S3C64XX (arm1176)
ARCH_S5P64X0 (arm1176)
ARCH_BCM2835 (arm1176)
ARCH_DAVINCI_TNETV107X (arm1176)
SOC_IMX31 (arm1136)
ARCH_MSM7X00A (arm1136r1p2)
ARCH_OMAP2 (arm1136)
MACH_REALVIEW_PB1176 (arm1176)
ARCH_WM8750 (arm1176)

According to what you say about 1136r1px and 1176, it looks like most
of them are actually wrong and should select CPU_V6K instead. MSM
is probably safe with V6K as we only support one board (trout)
and it's r1p2 according to 
http://forum.xda-developers.com/showthread.php?p=5575605.
IMX31 is ok as well according to what you said earlier, which
basically leaves OMAP2. All /proc/cpuinfo references I found for
omap are actually r0p2, r0p5 or r0p6, so those would be v6.

This should be an exhaustive list of differences between V6 and V6K
that we have in the kernel:

ARM_ERRATA_326103 -- only relevant for 1136r0, but never enabled
ARM_ERRATA_364296 -- only relevant for 1136r0, but never enabled
TLS_REG_EMUL      -- only needed for pre-V6K
CPU_USE_DOMAINS   -- only enabled for V6 but not if V6K or V7 are on
SWP_EMULATE       -- only available with !CPU_USE_DOMAINS && CPU_V7
svc_exit()	  -- emulates clrex when V6 is enabled
percpu.h          -- emulates TPIDRPRW when V6 is enabled
cmpxchg(<4byte)	  -- not available if V6 is enabled (Xen was hit by this)
cmpxchg_local     -- slow if V6 is enabled
Makefile	  -- build with -march=armv6k if building for v6k or v6+v7
		     rather than -march=armv6 for v6-only
barrier.h	  -- sev(), wfe(), wfi() are not defined for v6-only
tls.h		  -- v6 uses software, v6k uses reg, dtrt if both enabled
__kuser_cmpxchg64 -- as discussed below

>From this list it is pretty clear that we want V6K as the default as you
suggested, and I think we should eliminate any 'select CPU_V6K' except
for OMAP2 (unless I made a mistake in my platform list). Maybe Tony has
a better understanding of which OMAP2 systems are actually V6K or V6.

> > If we could show that all supported platforms are actually v6K anyway
> > and that nobody has any plans to add new ones, doing away with
> > v6 in favor of v6k would clean up a lot of confusing (i.e. possibly
> > wrong) Kconfig logic.
> >
> >> I assume we expect a v6 SMP kernel to run on a non-v6K v6 platform?
> >
> > Actually, as far as I can see:
> >
> > config SMP
> >         bool "Symmetric Multi-Processing"
> >         depends on CPU_V6K || CPU_V7
> >         depends on HAVE_SMP
> >
> > This prevents you from building a plain v6 SMP kernel, and we've
> > had a variation of that since CONFIG_SMP was first marked non-BROKEN.
> 
> I'm saying a v6k enabled kernel would not work on pure v6 h/w. But
> since all implementations appear to support doubleword exclusives and
> there may not be any pure v6 only h/w, then we may never have a
> problem with the code below.

Ok, I think I now understand what you mean: the __kuser_cmpxchg64
implementation on a pure ARMv6 CPU is broken when the kernel is built
to also support V6K or V7. I think you are right with this, but wrong
with it not being relevant on shipping hardware. We have had OMAP2+OMAP3
kernels that enable CONFIG_CPU_32v6K on a V6 CPU for a long time.

What I think happened though is that __kuser_cmpxchg64 is a function
that is used extremely rarely in real-life applications, and those
multiplatform kernels are probably used less in production than they
are in basic testing, so it was a coincidence that the problem has not
hurt anyone. All the other differences between v6 and v6k that I listed
above seem to be more relevant to the test cases that people run,
and seem to be implemented correctly in the sense that a v6+v6k
kernel just runs a little slower on v6k hardware than it could but
does work correctly.

Of course what you describe is a real bug and needs to get fixed,
plus we should probably add a test case into LTP for this if it
doesn't catch this already.

	Arnd
Tony Lindgren Dec. 7, 2013, 5:41 p.m. UTC | #9
* Arnd Bergmann <arnd@arndb.de> [131206 20:54]:
> On Friday 06 December 2013, Rob Herring wrote:
> 
> From this list it is pretty clear that we want V6K as the default as you
> suggested, and I think we should eliminate any 'select CPU_V6K' except
> for OMAP2 (unless I made a mistake in my platform list). Maybe Tony has
> a better understanding of which OMAP2 systems are actually V6K or V6.

Yes both omap2420 and 2430 are just V6, not V6K.

Regards,

Tony
Russell King - ARM Linux Dec. 7, 2013, 6:02 p.m. UTC | #10
On Fri, Dec 06, 2013 at 05:41:33PM +0100, Arnd Bergmann wrote:
> The above code can already be simplified a lot, since the pre-v6 and
> pre-v6k v6 cases are dead code. There are comments in Kconfig like this:
> 
> config TLS_REG_EMUL
>         bool
>         select NEED_KUSER_HELPERS
>         help
>           An SMP system using a pre-ARMv6 processor (there are apparently
>           a few prototypes like that in existence) and therefore access to
>           that required register must be emulated.

Arnd,

If you look at where this is selected, it's selected for SMP on pre-ARMv6
(okay, I doubt anyone cares about that) _or_ for uclinux on pre-ARMv6
since pre-ARMv6 can't do the vectors page trick.

So getting rid of the above takes away __thread support from userland
uclinux on these CPUs.  Is that something you really want to do?
Russell King - ARM Linux Dec. 7, 2013, 6:10 p.m. UTC | #11
On Fri, Dec 06, 2013 at 02:01:51PM -0600, Rob Herring wrote:
> On Fri, Dec 6, 2013 at 10:41 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> > This prevents you from building a plain v6 SMP kernel, and we've
> > had a variation of that since CONFIG_SMP was first marked non-BROKEN.
> 
> I'm saying a v6k enabled kernel would not work on pure v6 h/w. But
> since all implementations appear to support doubleword exclusives and
> there may not be any pure v6 only h/w, then we may never have a
> problem with the code below.

I wonder why we have the SMP_ON_UP option.  It's there so that we can
do exactly this - build a SMP kernel (so, one for V6K or later) _and_
have it run on non-SMP capable V6 platforms.

Now, while it's true that ARMv6 doesn't have the WFI instruction, and
that was introduced in ARMv6K, when we include support for ARMv6, we
don't use that instruction - we use its MCR equivalent.

Remember, we've specifically put work into the kernel so that ARMv6
can operate as part of the single zImage kernel precisely because we
have mixtures of SoCs which have this spread of architectures.

So, as far as I'm aware, today, a kernel which has V6, V6K and V7
will work across all those CPUs.

What's rather annoying in this thread is that you and Arnd are running
around seemingly making decisions on this without bothering to find out
the details, in persuit of endless cleanups.  Where is this heading?
Yet more fscking breakage of the ARM kernel, leading to platforms which
won't boot.  I'm getting rather sick and tired of cleaning up after
this kind of activity, so I'm going to tell you right now to stop this.

I've had to push a whole load of footbridge patches into stable kernels
during the last fortnight because of this.  For instance, Rob, your
changes to the way that VGA was supported on ARM pretty much broke the
whole thing leading to an oops on boot at 0xb80000.

Please stop this madness.
Arnd Bergmann Dec. 7, 2013, 6:31 p.m. UTC | #12
On Saturday 07 December 2013, Russell King - ARM Linux wrote:
> On Fri, Dec 06, 2013 at 05:41:33PM +0100, Arnd Bergmann wrote:
> > The above code can already be simplified a lot, since the pre-v6 and
> > pre-v6k v6 cases are dead code. There are comments in Kconfig like this:
> > 
> > config TLS_REG_EMUL
> >         bool
> >         select NEED_KUSER_HELPERS
> >         help
> >           An SMP system using a pre-ARMv6 processor (there are apparently
> >           a few prototypes like that in existence) and therefore access to
> >           that required register must be emulated.
> 
> Arnd,
> 
> If you look at where this is selected, it's selected for SMP on pre-ARMv6
> (okay, I doubt anyone cares about that) _or_ for uclinux on pre-ARMv6
> since pre-ARMv6 can't do the vectors page trick.

Right, I noticed the part about NOMMU later when I read through the code path
again.

> So getting rid of the above takes away __thread support from userland
> uclinux on these CPUs.  Is that something you really want to do?

No, not at all, sorry for the confusion.

	Arnd
Rob Herring Dec. 7, 2013, 8:49 p.m. UTC | #13
On Sat, Dec 7, 2013 at 12:10 PM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> On Fri, Dec 06, 2013 at 02:01:51PM -0600, Rob Herring wrote:
>> On Fri, Dec 6, 2013 at 10:41 AM, Arnd Bergmann <arnd@arndb.de> wrote:
>> > This prevents you from building a plain v6 SMP kernel, and we've
>> > had a variation of that since CONFIG_SMP was first marked non-BROKEN.
>>
>> I'm saying a v6k enabled kernel would not work on pure v6 h/w. But
>> since all implementations appear to support doubleword exclusives and
>> there may not be any pure v6 only h/w, then we may never have a
>> problem with the code below.
>
> I wonder why we have the SMP_ON_UP option.  It's there so that we can
> do exactly this - build a SMP kernel (so, one for V6K or later) _and_
> have it run on non-SMP capable V6 platforms.

Exactly, but __kuser_cmpxchg64 is missing the necessary SMP_ON_UP
patching or correct ifdef logic. I have yet to get my head around what
is the right fix here.

> Now, while it's true that ARMv6 doesn't have the WFI instruction, and
> that was introduced in ARMv6K, when we include support for ARMv6, we
> don't use that instruction - we use its MCR equivalent.
>
> Remember, we've specifically put work into the kernel so that ARMv6
> can operate as part of the single zImage kernel precisely because we
> have mixtures of SoCs which have this spread of architectures.
>
> So, as far as I'm aware, today, a kernel which has V6, V6K and V7
> will work across all those CPUs.
>
> What's rather annoying in this thread is that you and Arnd are running
> around seemingly making decisions on this without bothering to find out
> the details, in persuit of endless cleanups.  Where is this heading?
> Yet more fscking breakage of the ARM kernel, leading to platforms which
> won't boot.  I'm getting rather sick and tired of cleaning up after
> this kind of activity, so I'm going to tell you right now to stop this.
>
> I've had to push a whole load of footbridge patches into stable kernels
> during the last fortnight because of this.  For instance, Rob, your
> changes to the way that VGA was supported on ARM pretty much broke the
> whole thing leading to an oops on boot at 0xb80000.
>
> Please stop this madness.

Highlighting the above issue and selecting the correct cpu option for
various platforms is hardly madness. This doesn't affect just v6
platforms, but also all v7 platforms in v6+v7 builds since less
optimal non-v6K code paths are selected.

Rob
Nicolas Pitre Dec. 8, 2013, 2:21 a.m. UTC | #14
On Sat, 7 Dec 2013, Rob Herring wrote:

> On Sat, Dec 7, 2013 at 12:10 PM, Russell King - ARM Linux
> <linux@arm.linux.org.uk> wrote:
> > On Fri, Dec 06, 2013 at 02:01:51PM -0600, Rob Herring wrote:
> >> On Fri, Dec 6, 2013 at 10:41 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> >> > This prevents you from building a plain v6 SMP kernel, and we've
> >> > had a variation of that since CONFIG_SMP was first marked non-BROKEN.
> >>
> >> I'm saying a v6k enabled kernel would not work on pure v6 h/w. But
> >> since all implementations appear to support doubleword exclusives and
> >> there may not be any pure v6 only h/w, then we may never have a
> >> problem with the code below.
> >
> > I wonder why we have the SMP_ON_UP option.  It's there so that we can
> > do exactly this - build a SMP kernel (so, one for V6K or later) _and_
> > have it run on non-SMP capable V6 platforms.
> 
> Exactly, but __kuser_cmpxchg64 is missing the necessary SMP_ON_UP
> patching or correct ifdef logic. I have yet to get my head around what
> is the right fix here.

The right fix is probably to leave it as is and optimize your user space 
for ARMv6k instead, meaning that this operation would then be 
implemented inline rather than relying on the kernel helper.

Otherwise if you really want to optimize the kernel helper at runtime 
for ARMv6k when ARMv6 is also configured in, then you could do some 
instruction patching in kuser_init() as we already do for getting the 
TLS value.


Nicolas
Arnd Bergmann Dec. 8, 2013, 3:02 a.m. UTC | #15
On Sunday 08 December 2013, Nicolas Pitre wrote:
> The right fix is probably to leave it as is and optimize your user space 
> for ARMv6k instead, meaning that this operation would then be 
> implemented inline rather than relying on the kernel helper.

That would not make the program run on ARMv6 though. The bug we're trying
to fix is for running a kernel with ARMv6k support built-in on an
OMAP2 with ARMv6. The kuser helper already supports cmpxchg for pure
v6 builds, but that code doesn't get built (and isn't SMP safe) with
CONFIG_CPU_V6K or CONFIG_CPU_V7 enabled.
 
> Otherwise if you really want to optimize the kernel helper at runtime 
> for ARMv6k when ARMv6 is also configured in, then you could do some 
> instruction patching in kuser_init() as we already do for getting the 
> TLS value.

This does sound like the cleanest solution.

	Arnd
Arnd Bergmann Dec. 8, 2013, 3:39 a.m. UTC | #16
On Saturday 07 December 2013, Russell King - ARM Linux wrote:
> So, as far as I'm aware, today, a kernel which has V6, V6K and V7
> will work across all those CPUs.
> 
> What's rather annoying in this thread is that you and Arnd are running
> around seemingly making decisions on this without bothering to find out
> the details, in persuit of endless cleanups.  Where is this heading?

I admit that we've been stumbling a bit in the dark at some points, but
that doesn't mean every idea ends up in a patch that even gets submitted.

What I've concluded so far is (please correct any statements that you
find are wrong):

* there is no harm in "select HAVE_SMP if CPU_V7" for multiplatform, as
  was the original suggestion. Whether we want to actually do that is
  open for discussion when someone submits a patch.

* It was a mistake (I guess mine) to 'select CPU_V6' from ARCH_MULTI_V6,
  since that makes V6K based platforms slower without a reason, and we
  probably want to do something else.

* A kernel which enables V6, V6K and V7 has a broken kuser_cmpxchg64
  implementation on pre-V6K CPUs.

* Most platforms (possibly every one but OMAP2) that select CPU_V6
  today are actually V6K compatible. It's probably worth asking those
  V6 platform maintainers to change their CPU selection after confirming
  that they are V6K-only.

* I'm still trying to understand the full implications of
  CONFIG_CPU_USE_DOMAIN, but according to the comment in 247055aa21ffe
  "ARM: 6384/1: Remove the domain switching on ARMv6k/v7 CPUs", it seems
  to be a bug to enable this on v6k or v7 CPUs, which we currently do
  whenever CPU_V6 (implied by CONFIG_MULTI_V6) is enabled.

	Arnd
Michal Simek Dec. 11, 2013, 4:41 p.m. UTC | #17
On 12/05/2013 05:58 PM, Rob Herring wrote:
> From: Rob Herring <rob.herring@calxeda.com>
> 
> Multi-platform requires various kconfig options to be selected, so
> platforms don't need to select them individually.
> 
> A few more options could be selected because they are either on nearly
> every platform or they just enable other kconfig options to be visible:
> 
> select ARM_AMBA
> select ARM_GIC if CPU_V7
> select HAVE_SMP if CPU_V7
> select MIGHT_HAVE_CACHE_L2X0 if ARCH_MULTI_V6_V7
> select ARCH_HAS_CPUFREQ
> select ARCH_HAS_OPP
> 
> Signed-off-by: Rob Herring <rob.herring@calxeda.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> ---
>  arch/arm/Kconfig                |  2 ++
>  arch/arm/mach-bcm/Kconfig       |  5 -----
>  arch/arm/mach-bcm2835/Kconfig   |  4 ----
>  arch/arm/mach-cns3xxx/Kconfig   |  1 -
>  arch/arm/mach-highbank/Kconfig  |  6 ------
>  arch/arm/mach-imx/Kconfig       | 12 ------------
>  arch/arm/mach-keystone/Kconfig  |  3 ---
>  arch/arm/mach-mvebu/Kconfig     |  5 -----
>  arch/arm/mach-mxs/Kconfig       |  4 ----
>  arch/arm/mach-nomadik/Kconfig   |  5 -----
>  arch/arm/mach-nspire/Kconfig    |  5 -----
>  arch/arm/mach-omap2/Kconfig     | 16 ----------------
>  arch/arm/mach-picoxcell/Kconfig |  4 ----
>  arch/arm/mach-prima2/Kconfig    |  4 ----
>  arch/arm/mach-rockchip/Kconfig  |  2 --
>  arch/arm/mach-shmobile/Kconfig  |  3 ---
>  arch/arm/mach-socfpga/Kconfig   |  5 -----
>  arch/arm/mach-spear/Kconfig     |  8 --------
>  arch/arm/mach-sunxi/Kconfig     |  4 ----
>  arch/arm/mach-tegra/Kconfig     |  6 ------
>  arch/arm/mach-u300/Kconfig      |  6 ------
>  arch/arm/mach-ux500/Kconfig     |  3 ---
>  arch/arm/mach-vexpress/Kconfig  |  3 ---
>  arch/arm/mach-virt/Kconfig      |  4 ----
>  arch/arm/mach-vt8500/Kconfig    |  4 ----
>  arch/arm/mach-zynq/Kconfig      |  5 -----
>  26 files changed, 2 insertions(+), 127 deletions(-)
> 
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index c1f1a7e..d871bdd 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -302,9 +302,11 @@ choice
>  config ARCH_MULTIPLATFORM
>  	bool "Allow multiple platforms to be selected"
>  	depends on MMU
> +	select ARCH_WANT_OPTIONAL_GPIOLIB
>  	select ARM_PATCH_PHYS_VIRT
>  	select AUTO_ZRELADDR
>  	select COMMON_CLK
> +	select GENERIC_CLOCKEVENTS
>  	select MULTI_IRQ_HANDLER
>  	select SPARSE_IRQ
>  	select USE_OF
> diff --git a/arch/arm/mach-bcm/Kconfig b/arch/arm/mach-bcm/Kconfig
> index 9fe6d88..6a58980 100644
> --- a/arch/arm/mach-bcm/Kconfig
> +++ b/arch/arm/mach-bcm/Kconfig
> @@ -16,12 +16,7 @@ config ARCH_BCM_MOBILE
>  	select ARM_ERRATA_754322
>  	select ARM_ERRATA_764369 if SMP
>  	select ARM_GIC
> -	select CPU_V7
> -	select CLKSRC_OF
> -	select GENERIC_CLOCKEVENTS
> -	select GENERIC_TIME
>  	select GPIO_BCM_KONA
> -	select SPARSE_IRQ
>  	select TICK_ONESHOT
>  	select CACHE_L2X0
>  	select HAVE_ARM_ARCH_TIMER
> diff --git a/arch/arm/mach-bcm2835/Kconfig b/arch/arm/mach-bcm2835/Kconfig
> index 560045ca..acea0d8 100644
> --- a/arch/arm/mach-bcm2835/Kconfig
> +++ b/arch/arm/mach-bcm2835/Kconfig
> @@ -4,10 +4,6 @@ config ARCH_BCM2835
>  	select ARM_AMBA
>  	select ARM_ERRATA_411920
>  	select ARM_TIMER_SP804
> -	select CLKDEV_LOOKUP
> -	select CLKSRC_OF
> -	select CPU_V6
> -	select GENERIC_CLOCKEVENTS
>  	select PINCTRL
>  	select PINCTRL_BCM2835
>  	help
> diff --git a/arch/arm/mach-cns3xxx/Kconfig b/arch/arm/mach-cns3xxx/Kconfig
> index dbf0df8..e346688 100644
> --- a/arch/arm/mach-cns3xxx/Kconfig
> +++ b/arch/arm/mach-cns3xxx/Kconfig
> @@ -2,7 +2,6 @@ config ARCH_CNS3XXX
>  	bool "Cavium Networks CNS3XXX family" if ARCH_MULTI_V6
>  	select ARM_GIC
>  	select CPU_V6K
> -	select GENERIC_CLOCKEVENTS
>  	select MIGHT_HAVE_CACHE_L2X0
>  	select MIGHT_HAVE_PCI
>  	select PCI_DOMAINS if PCI
> diff --git a/arch/arm/mach-highbank/Kconfig b/arch/arm/mach-highbank/Kconfig
> index 0aded64..59274a7 100644
> --- a/arch/arm/mach-highbank/Kconfig
> +++ b/arch/arm/mach-highbank/Kconfig
> @@ -5,7 +5,6 @@ config ARCH_HIGHBANK
>  	select ARCH_HAS_HOLES_MEMORYMODEL
>  	select ARCH_HAS_OPP
>  	select ARCH_SUPPORTS_BIG_ENDIAN
> -	select ARCH_WANT_OPTIONAL_GPIOLIB
>  	select ARM_AMBA
>  	select ARM_ERRATA_764369 if SMP
>  	select ARM_ERRATA_775420
> @@ -14,14 +13,9 @@ config ARCH_HIGHBANK
>  	select ARM_PSCI
>  	select ARM_TIMER_SP804
>  	select CACHE_L2X0
> -	select COMMON_CLK
> -	select CPU_V7
> -	select GENERIC_CLOCKEVENTS
>  	select HAVE_ARM_SCU
>  	select HAVE_ARM_TWD if SMP
>  	select HAVE_SMP
>  	select MAILBOX
>  	select PL320_MBOX
> -	select SPARSE_IRQ
> -	select USE_OF
>  	select ZONE_DMA if ARM_LPAE
> diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
> index 7a6e6f7..5052c18 100644
> --- a/arch/arm/mach-imx/Kconfig
> +++ b/arch/arm/mach-imx/Kconfig
> @@ -2,18 +2,11 @@ config ARCH_MXC
>  	bool "Freescale i.MX family" if ARCH_MULTI_V4_V5 || ARCH_MULTI_V6_V7
>  	select ARCH_REQUIRE_GPIOLIB
>  	select ARM_CPU_SUSPEND if PM
> -	select ARM_PATCH_PHYS_VIRT
> -	select AUTO_ZRELADDR if !ZBOOT_ROM
>  	select CLKSRC_MMIO
> -	select COMMON_CLK
>  	select GENERIC_ALLOCATOR
> -	select GENERIC_CLOCKEVENTS
>  	select GENERIC_IRQ_CHIP
>  	select MIGHT_HAVE_CACHE_L2X0 if ARCH_MULTI_V6_V7
> -	select MULTI_IRQ_HANDLER
>  	select SOC_BUS
> -	select SPARSE_IRQ
> -	select USE_OF
>  	help
>  	  Support for Freescale MXC/iMX-based family of processors
>  
> @@ -139,7 +132,6 @@ config SOC_IMX5
>  	select ARCH_HAS_CPUFREQ
>  	select ARCH_HAS_OPP
>  	select ARCH_MXC_IOMUX_V3
> -	select CPU_V7
>  	select MXC_TZIC
>  
>  config	SOC_IMX51
> @@ -785,7 +777,6 @@ config SOC_IMX6Q
>  	select ARM_ERRATA_764369 if SMP
>  	select ARM_ERRATA_775420
>  	select ARM_GIC
> -	select CPU_V7
>  	select HAVE_ARM_SCU if SMP
>  	select HAVE_ARM_TWD if SMP
>  	select HAVE_IMX_ANATOP
> @@ -811,7 +802,6 @@ config SOC_IMX6SL
>  	select ARM_ERRATA_754322
>  	select ARM_ERRATA_775420
>  	select ARM_GIC
> -	select CPU_V7
>  	select HAVE_IMX_ANATOP
>  	select HAVE_IMX_GPC
>  	select HAVE_IMX_MMDC
> @@ -828,9 +818,7 @@ config SOC_IMX6SL
>  
>  config SOC_VF610
>  	bool "Vybrid Family VF610 support"
> -	select CPU_V7
>  	select ARM_GIC
> -	select CLKSRC_OF
>  	select PINCTRL
>  	select PINCTRL_VF610
>  	select VF_PIT_TIMER
> diff --git a/arch/arm/mach-keystone/Kconfig b/arch/arm/mach-keystone/Kconfig
> index f20c53e..ea35853 100644
> --- a/arch/arm/mach-keystone/Kconfig
> +++ b/arch/arm/mach-keystone/Kconfig
> @@ -1,13 +1,10 @@
>  config ARCH_KEYSTONE
>  	bool "Texas Instruments Keystone Devices"
>  	depends on ARCH_MULTI_V7
> -	select CPU_V7
>  	select ARM_GIC
>  	select HAVE_ARM_ARCH_TIMER
>  	select HAVE_SMP
>  	select CLKSRC_MMIO
> -	select GENERIC_CLOCKEVENTS
> -	select ARCH_WANT_OPTIONAL_GPIOLIB
>  	select ARM_ERRATA_798181 if SMP
>  	select COMMON_CLK_KEYSTONE
>  	select TI_EDMA
> diff --git a/arch/arm/mach-mvebu/Kconfig b/arch/arm/mach-mvebu/Kconfig
> index 5e269d7..d581e84 100644
> --- a/arch/arm/mach-mvebu/Kconfig
> +++ b/arch/arm/mach-mvebu/Kconfig
> @@ -2,15 +2,10 @@ config ARCH_MVEBU
>  	bool "Marvell SOCs with Device Tree support" if ARCH_MULTI_V7
>  	select ARCH_SUPPORTS_BIG_ENDIAN
>  	select CLKSRC_MMIO
> -	select COMMON_CLK
> -	select GENERIC_CLOCKEVENTS
>  	select GENERIC_IRQ_CHIP
>  	select IRQ_DOMAIN
> -	select MULTI_IRQ_HANDLER
>  	select PINCTRL
>  	select PLAT_ORION
> -	select SPARSE_IRQ
> -	select CLKDEV_LOOKUP
>  	select MVEBU_MBUS
>  	select ZONE_DMA if ARM_LPAE
>  	select ARCH_REQUIRE_GPIOLIB
> diff --git a/arch/arm/mach-mxs/Kconfig b/arch/arm/mach-mxs/Kconfig
> index 8cde9e0..8479413 100644
> --- a/arch/arm/mach-mxs/Kconfig
> +++ b/arch/arm/mach-mxs/Kconfig
> @@ -16,11 +16,7 @@ config ARCH_MXS
>  	bool "Freescale MXS (i.MX23, i.MX28) support"
>  	depends on ARCH_MULTI_V5
>  	select ARCH_REQUIRE_GPIOLIB
> -	select CLKDEV_LOOKUP
>  	select CLKSRC_MMIO
> -	select CLKSRC_OF
> -	select GENERIC_CLOCKEVENTS
> -	select HAVE_CLK_PREPARE
>  	select PINCTRL
>  	select SOC_BUS
>  	select SOC_IMX23
> diff --git a/arch/arm/mach-nomadik/Kconfig b/arch/arm/mach-nomadik/Kconfig
> index 4d42da4..486d301 100644
> --- a/arch/arm/mach-nomadik/Kconfig
> +++ b/arch/arm/mach-nomadik/Kconfig
> @@ -6,16 +6,11 @@ config ARCH_NOMADIK
>  	select ARM_VIC
>  	select CLKSRC_NOMADIK_MTU
>  	select CLKSRC_NOMADIK_MTU_SCHED_CLOCK
> -	select CLKSRC_OF
> -	select COMMON_CLK
>  	select CPU_ARM926T
> -	select GENERIC_CLOCKEVENTS
>  	select MIGHT_HAVE_CACHE_L2X0
>  	select PINCTRL
>  	select PINCTRL_NOMADIK
>  	select PINCTRL_STN8815
> -	select SPARSE_IRQ
> -	select USE_OF
>  	help
>  	  Support for the Nomadik platform by ST-Ericsson
>  
> diff --git a/arch/arm/mach-nspire/Kconfig b/arch/arm/mach-nspire/Kconfig
> index 59d8f0a..bc41f26 100644
> --- a/arch/arm/mach-nspire/Kconfig
> +++ b/arch/arm/mach-nspire/Kconfig
> @@ -3,14 +3,9 @@ config ARCH_NSPIRE
>  	depends on ARCH_MULTI_V4_V5
>  	depends on MMU
>  	select CPU_ARM926T
> -	select COMMON_CLK
> -	select GENERIC_CLOCKEVENTS
>  	select GENERIC_IRQ_CHIP
> -	select SPARSE_IRQ
>  	select ARM_AMBA
>  	select ARM_VIC
>  	select ARM_TIMER_SP804
> -	select USE_OF
> -	select CLKSRC_OF
>  	help
>  	  This enables support for systems using the TI-NSPIRE CPU
> diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
> index dc21df1..c128792 100644
> --- a/arch/arm/mach-omap2/Kconfig
> +++ b/arch/arm/mach-omap2/Kconfig
> @@ -5,8 +5,6 @@ config ARCH_OMAP2
>  	bool "TI OMAP2"
>  	depends on ARCH_MULTI_V6
>  	select ARCH_OMAP2PLUS
> -	select CPU_V6
> -	select MULTI_IRQ_HANDLER
>  	select SOC_HAS_OMAP2_SDRC
>  
>  config ARCH_OMAP3
> @@ -15,8 +13,6 @@ config ARCH_OMAP3
>  	select ARCH_OMAP2PLUS
>  	select ARCH_HAS_OPP
>  	select ARM_CPU_SUSPEND if PM
> -	select CPU_V7
> -	select MULTI_IRQ_HANDLER
>  	select OMAP_INTERCONNECT
>  	select PM_OPP if PM
>  	select PM_RUNTIME if CPU_IDLE
> @@ -33,7 +29,6 @@ config ARCH_OMAP4
>  	select ARM_ERRATA_720789
>  	select ARM_GIC
>  	select CACHE_L2X0
> -	select CPU_V7
>  	select HAVE_ARM_SCU if SMP
>  	select HAVE_ARM_TWD if SMP
>  	select HAVE_SMP
> @@ -52,7 +47,6 @@ config SOC_OMAP5
>  	select ARCH_OMAP2PLUS
>  	select ARM_CPU_SUSPEND if PM
>  	select ARM_GIC
> -	select CPU_V7
>  	select HAVE_ARM_SCU if SMP
>  	select HAVE_ARM_TWD if LOCAL_TIMERS
>  	select HAVE_SMP
> @@ -64,15 +58,11 @@ config SOC_AM33XX
>  	depends on ARCH_MULTI_V7
>  	select ARCH_OMAP2PLUS
>  	select ARM_CPU_SUSPEND if PM
> -	select CPU_V7
> -	select MULTI_IRQ_HANDLER
>  
>  config SOC_AM43XX
>  	bool "TI AM43x"
>  	depends on ARCH_MULTI_V7
> -	select CPU_V7
>  	select ARCH_OMAP2PLUS
> -	select MULTI_IRQ_HANDLER
>  	select ARM_GIC
>  	select MACH_OMAP_GENERIC
>  
> @@ -84,17 +74,13 @@ config ARCH_OMAP2PLUS
>  	select ARCH_OMAP
>  	select ARCH_REQUIRE_GPIOLIB
>  	select CLKSRC_MMIO
> -	select COMMON_CLK
> -	select GENERIC_CLOCKEVENTS
>  	select GENERIC_IRQ_CHIP
>  	select MACH_OMAP_GENERIC
>  	select OMAP_DM_TIMER
>  	select PINCTRL
>  	select PROC_DEVICETREE if PROC_FS
>  	select SOC_BUS
> -	select SPARSE_IRQ
>  	select TI_PRIV_EDMA
> -	select USE_OF
>  	help
>  	  Systems based on OMAP2, OMAP3, OMAP4 or OMAP5
>  
> @@ -131,10 +117,8 @@ config SOC_HAS_REALTIME_COUNTER
>  config SOC_DRA7XX
>  	bool "TI DRA7XX"
>  	select ARM_ARCH_TIMER
> -	select CPU_V7
>  	select ARM_GIC
>  	select HAVE_SMP
> -	select COMMON_CLK
>  
>  comment "OMAP Core Type"
>  	depends on ARCH_OMAP2
> diff --git a/arch/arm/mach-picoxcell/Kconfig b/arch/arm/mach-picoxcell/Kconfig
> index b1022f4..c88ff74 100644
> --- a/arch/arm/mach-picoxcell/Kconfig
> +++ b/arch/arm/mach-picoxcell/Kconfig
> @@ -1,12 +1,8 @@
>  config ARCH_PICOXCELL
>  	bool "Picochip PicoXcell" if ARCH_MULTI_V6
>  	select ARCH_REQUIRE_GPIOLIB
> -	select ARM_PATCH_PHYS_VIRT
>  	select ARM_VIC
>  	select CPU_V6K
>  	select DW_APB_TIMER_OF
> -	select GENERIC_CLOCKEVENTS
>  	select HAVE_TCM
>  	select NO_IOPORT
> -	select SPARSE_IRQ
> -	select USE_OF
> diff --git a/arch/arm/mach-prima2/Kconfig b/arch/arm/mach-prima2/Kconfig
> index 6988b11..16c2d90 100644
> --- a/arch/arm/mach-prima2/Kconfig
> +++ b/arch/arm/mach-prima2/Kconfig
> @@ -1,7 +1,6 @@
>  config ARCH_SIRF
>  	bool "CSR SiRF" if ARCH_MULTI_V7
>  	select ARCH_REQUIRE_GPIOLIB
> -	select GENERIC_CLOCKEVENTS
>  	select GENERIC_IRQ_CHIP
>  	select MIGHT_HAVE_CACHE_L2X0
>  	select NO_IOPORT
> @@ -17,7 +16,6 @@ menu "CSR SiRF atlas6/primaII/Marco/Polo Specific Features"
>  config ARCH_ATLAS6
>  	bool "CSR SiRFSoC ATLAS6 ARM Cortex A9 Platform"
>  	default y
> -	select CPU_V7
>  	select SIRF_IRQ
>  	help
>            Support for CSR SiRFSoC ARM Cortex A9 Platform
> @@ -25,7 +23,6 @@ config ARCH_ATLAS6
>  config ARCH_PRIMA2
>  	bool "CSR SiRFSoC PRIMA2 ARM Cortex A9 Platform"
>  	default y
> -	select CPU_V7
>  	select SIRF_IRQ
>  	select ZONE_DMA
>  	help
> @@ -35,7 +32,6 @@ config ARCH_MARCO
>  	bool "CSR SiRFSoC MARCO ARM Cortex A9 Platform"
>  	default y
>  	select ARM_GIC
> -	select CPU_V7
>  	select HAVE_ARM_SCU if SMP
>  	select HAVE_SMP
>  	select SMP_ON_UP if SMP
> diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig
> index cf073de..2a695bc 100644
> --- a/arch/arm/mach-rockchip/Kconfig
> +++ b/arch/arm/mach-rockchip/Kconfig
> @@ -7,8 +7,6 @@ config ARCH_ROCKCHIP
>  	select CACHE_L2X0
>  	select HAVE_ARM_TWD if SMP
>  	select HAVE_SMP
> -	select COMMON_CLK
> -	select GENERIC_CLOCKEVENTS
>  	select DW_APB_TIMER_OF
>  	select ARM_GLOBAL_TIMER
>  	select CLKSRC_ARM_GLOBAL_TIMER_SCHED_CLOCK
> diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
> index a4a4b75..de75560 100644
> --- a/arch/arm/mach-shmobile/Kconfig
> +++ b/arch/arm/mach-shmobile/Kconfig
> @@ -1,8 +1,6 @@
>  config ARCH_SHMOBILE_MULTI
>  	bool "SH-Mobile Series" if ARCH_MULTI_V7
>  	depends on MMU
> -	select CPU_V7
> -	select GENERIC_CLOCKEVENTS
>  	select HAVE_ARM_SCU if SMP
>  	select HAVE_ARM_TWD if LOCAL_TIMERS
>  	select HAVE_SMP
> @@ -11,7 +9,6 @@ config ARCH_SHMOBILE_MULTI
>  	select NO_IOPORT
>  	select PINCTRL
>  	select ARCH_REQUIRE_GPIOLIB
> -	select CLKDEV_LOOKUP
>  
>  if ARCH_SHMOBILE_MULTI
>  
> diff --git a/arch/arm/mach-socfpga/Kconfig b/arch/arm/mach-socfpga/Kconfig
> index 037100a..57e11cd 100644
> --- a/arch/arm/mach-socfpga/Kconfig
> +++ b/arch/arm/mach-socfpga/Kconfig
> @@ -4,13 +4,8 @@ config ARCH_SOCFPGA
>  	select ARM_AMBA
>  	select ARM_GIC
>  	select CACHE_L2X0
> -	select COMMON_CLK
> -	select CPU_V7
>  	select DW_APB_TIMER_OF
> -	select GENERIC_CLOCKEVENTS
>  	select GPIO_PL061 if GPIOLIB
>  	select HAVE_ARM_SCU
>  	select HAVE_SMP
>  	select MFD_SYSCON
> -	select SPARSE_IRQ
> -	select USE_OF
> diff --git a/arch/arm/mach-spear/Kconfig b/arch/arm/mach-spear/Kconfig
> index ac1710e6..a7a28ea 100644
> --- a/arch/arm/mach-spear/Kconfig
> +++ b/arch/arm/mach-spear/Kconfig
> @@ -8,8 +8,6 @@ menuconfig PLAT_SPEAR
>  	select ARCH_REQUIRE_GPIOLIB
>  	select ARM_AMBA
>  	select CLKSRC_MMIO
> -	select COMMON_CLK
> -	select GENERIC_CLOCKEVENTS
>  
>  if PLAT_SPEAR
>  
> @@ -18,14 +16,12 @@ config ARCH_SPEAR13XX
>  	depends on ARCH_MULTI_V7 || PLAT_SPEAR_SINGLE
>  	select ARCH_HAS_CPUFREQ
>  	select ARM_GIC
> -	select CPU_V7
>  	select GPIO_SPEAR_SPICS
>  	select HAVE_ARM_SCU if SMP
>  	select HAVE_ARM_TWD if SMP
>  	select HAVE_SMP
>  	select MIGHT_HAVE_CACHE_L2X0
>  	select PINCTRL
> -	select USE_OF
>  	help
>  	  Supports for ARM's SPEAR13XX family
>  
> @@ -50,9 +46,7 @@ config ARCH_SPEAR3XX
>  	depends on ARCH_MULTI_V5 || PLAT_SPEAR_SINGLE
>  	depends on !ARCH_SPEAR13XX
>  	select ARM_VIC
> -	select CPU_ARM926T
>  	select PINCTRL
> -	select USE_OF
>  	help
>  	  Supports for ARM's SPEAR3XX family
>  
> @@ -83,14 +77,12 @@ config ARCH_SPEAR6XX
>  	depends on ARCH_MULTI_V5 || PLAT_SPEAR_SINGLE
>  	depends on !ARCH_SPEAR13XX
>  	select ARM_VIC
> -	select CPU_ARM926T
>  	help
>  	  Supports for ARM's SPEAR6XX family
>  
>  config MACH_SPEAR600
>  	def_bool y
>  	depends on ARCH_SPEAR6XX
> -	select USE_OF
>  	help
>  	  Supports ST SPEAr600 boards configured via the device-treesource "arch/arm/mach-spear6xx/Kconfig"
>  
> diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig
> index c9e72c8..ade43c9 100644
> --- a/arch/arm/mach-sunxi/Kconfig
> +++ b/arch/arm/mach-sunxi/Kconfig
> @@ -3,12 +3,8 @@ config ARCH_SUNXI
>  	select ARCH_REQUIRE_GPIOLIB
>  	select ARM_GIC
>  	select CLKSRC_MMIO
> -	select CLKSRC_OF
> -	select COMMON_CLK
> -	select GENERIC_CLOCKEVENTS
>  	select GENERIC_IRQ_CHIP
>  	select HAVE_SMP
>  	select PINCTRL
>  	select PINCTRL_SUNXI
> -	select SPARSE_IRQ
>  	select SUN4I_TIMER
> diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig
> index 09e740f..8f97cf0 100644
> --- a/arch/arm/mach-tegra/Kconfig
> +++ b/arch/arm/mach-tegra/Kconfig
> @@ -4,10 +4,6 @@ config ARCH_TEGRA
>  	select ARCH_REQUIRE_GPIOLIB
>  	select ARM_GIC
>  	select CLKSRC_MMIO
> -	select CLKSRC_OF
> -	select COMMON_CLK
> -	select CPU_V7
> -	select GENERIC_CLOCKEVENTS
>  	select HAVE_ARM_SCU if SMP
>  	select HAVE_ARM_TWD if SMP
>  	select HAVE_SMP
> @@ -15,11 +11,9 @@ config ARCH_TEGRA
>  	select MIGHT_HAVE_PCI
>  	select PINCTRL
>  	select SOC_BUS
> -	select SPARSE_IRQ
>  	select USB_ARCH_HAS_EHCI if USB_SUPPORT
>  	select USB_ULPI if USB_PHY
>  	select USB_ULPI_VIEWPORT if USB_PHY
> -	select USE_OF
>  	help
>  	  This enables support for NVIDIA Tegra based systems.
>  
> diff --git a/arch/arm/mach-u300/Kconfig b/arch/arm/mach-u300/Kconfig
> index 8e23071..e3a96d7 100644
> --- a/arch/arm/mach-u300/Kconfig
> +++ b/arch/arm/mach-u300/Kconfig
> @@ -3,20 +3,14 @@ config ARCH_U300
>  	depends on MMU
>  	select ARCH_REQUIRE_GPIOLIB
>  	select ARM_AMBA
> -	select ARM_PATCH_PHYS_VIRT
>  	select ARM_VIC
>  	select CLKSRC_MMIO
> -	select CLKSRC_OF
> -	select COMMON_CLK
>  	select CPU_ARM926T
> -	select GENERIC_CLOCKEVENTS
>  	select HAVE_TCM
>  	select PINCTRL
>  	select PINCTRL_COH901
>  	select PINCTRL_U300
> -	select SPARSE_IRQ
>  	select MFD_SYSCON
> -	select USE_OF
>  	help
>  	  Support for ST-Ericsson U300 series mobile platforms.
>  
> diff --git a/arch/arm/mach-ux500/Kconfig b/arch/arm/mach-ux500/Kconfig
> index 0034d2c..5292f7b 100644
> --- a/arch/arm/mach-ux500/Kconfig
> +++ b/arch/arm/mach-ux500/Kconfig
> @@ -11,9 +11,6 @@ config ARCH_U8500
>  	select ARM_GIC
>  	select CACHE_L2X0
>  	select CLKSRC_NOMADIK_MTU
> -	select COMMON_CLK
> -	select CPU_V7
> -	select GENERIC_CLOCKEVENTS
>  	select HAVE_ARM_SCU if SMP
>  	select HAVE_ARM_TWD if SMP
>  	select HAVE_SMP
> diff --git a/arch/arm/mach-vexpress/Kconfig b/arch/arm/mach-vexpress/Kconfig
> index 4a70be4..fa29222 100644
> --- a/arch/arm/mach-vexpress/Kconfig
> +++ b/arch/arm/mach-vexpress/Kconfig
> @@ -5,10 +5,7 @@ config ARCH_VEXPRESS
>  	select ARM_AMBA
>  	select ARM_GIC
>  	select ARM_TIMER_SP804
> -	select COMMON_CLK
>  	select COMMON_CLK_VERSATILE
> -	select CPU_V7
> -	select GENERIC_CLOCKEVENTS
>  	select HAVE_ARM_SCU if SMP
>  	select HAVE_ARM_TWD if SMP
>  	select HAVE_PATA_PLATFORM
> diff --git a/arch/arm/mach-virt/Kconfig b/arch/arm/mach-virt/Kconfig
> index 081d469..eaad072 100644
> --- a/arch/arm/mach-virt/Kconfig
> +++ b/arch/arm/mach-virt/Kconfig
> @@ -1,10 +1,6 @@
>  config ARCH_VIRT
>  	bool "Dummy Virtual Machine" if ARCH_MULTI_V7
> -	select ARCH_WANT_OPTIONAL_GPIOLIB
>  	select ARM_GIC
>  	select HAVE_ARM_ARCH_TIMER
>  	select ARM_PSCI
>  	select HAVE_SMP
> -	select CPU_V7
> -	select SPARSE_IRQ
> -	select USE_OF
> diff --git a/arch/arm/mach-vt8500/Kconfig b/arch/arm/mach-vt8500/Kconfig
> index 927be93..08f56a4 100644
> --- a/arch/arm/mach-vt8500/Kconfig
> +++ b/arch/arm/mach-vt8500/Kconfig
> @@ -3,8 +3,6 @@ config ARCH_VT8500
>  	select ARCH_HAS_CPUFREQ
>  	select ARCH_REQUIRE_GPIOLIB
>  	select CLKDEV_LOOKUP
> -	select CLKSRC_OF
> -	select GENERIC_CLOCKEVENTS
>  	select VT8500_TIMER
>  	select PINCTRL
>  	help
> @@ -21,7 +19,6 @@ config ARCH_WM8750
>  	bool "WonderMedia WM8750"
>  	depends on ARCH_MULTI_V6
>  	select ARCH_VT8500
> -	select CPU_V6
>  	help
>  	  Support for WonderMedia WM8750 System-on-Chip.
>  
> @@ -29,6 +26,5 @@ config ARCH_WM8850
>  	bool "WonderMedia WM8850"
>  	depends on ARCH_MULTI_V7
>  	select ARCH_VT8500
> -	select CPU_V7
>  	help
>  	  Support for WonderMedia WM8850 System-on-Chip.
> diff --git a/arch/arm/mach-zynq/Kconfig b/arch/arm/mach-zynq/Kconfig
> index 6b04260..85d1805 100644
> --- a/arch/arm/mach-zynq/Kconfig
> +++ b/arch/arm/mach-zynq/Kconfig
> @@ -2,16 +2,11 @@ config ARCH_ZYNQ
>  	bool "Xilinx Zynq ARM Cortex A9 Platform" if ARCH_MULTI_V7
>  	select ARM_AMBA
>  	select ARM_GIC
> -	select COMMON_CLK
> -	select CPU_V7
> -	select GENERIC_CLOCKEVENTS
>  	select HAVE_ARM_SCU if SMP
>  	select HAVE_ARM_TWD if SMP
>  	select ICST
>  	select MIGHT_HAVE_CACHE_L2X0
> -	select USE_OF
>  	select HAVE_SMP
> -	select SPARSE_IRQ
>  	select CADENCE_TTC_TIMER
>  	select ARM_GLOBAL_TIMER
>  	help
> 

For zynq:
Reviewed by: Michal Simek <monstr@monstr.eu>

Thanks,
Michal
diff mbox

Patch

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index c1f1a7e..d871bdd 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -302,9 +302,11 @@  choice
 config ARCH_MULTIPLATFORM
 	bool "Allow multiple platforms to be selected"
 	depends on MMU
+	select ARCH_WANT_OPTIONAL_GPIOLIB
 	select ARM_PATCH_PHYS_VIRT
 	select AUTO_ZRELADDR
 	select COMMON_CLK
+	select GENERIC_CLOCKEVENTS
 	select MULTI_IRQ_HANDLER
 	select SPARSE_IRQ
 	select USE_OF
diff --git a/arch/arm/mach-bcm/Kconfig b/arch/arm/mach-bcm/Kconfig
index 9fe6d88..6a58980 100644
--- a/arch/arm/mach-bcm/Kconfig
+++ b/arch/arm/mach-bcm/Kconfig
@@ -16,12 +16,7 @@  config ARCH_BCM_MOBILE
 	select ARM_ERRATA_754322
 	select ARM_ERRATA_764369 if SMP
 	select ARM_GIC
-	select CPU_V7
-	select CLKSRC_OF
-	select GENERIC_CLOCKEVENTS
-	select GENERIC_TIME
 	select GPIO_BCM_KONA
-	select SPARSE_IRQ
 	select TICK_ONESHOT
 	select CACHE_L2X0
 	select HAVE_ARM_ARCH_TIMER
diff --git a/arch/arm/mach-bcm2835/Kconfig b/arch/arm/mach-bcm2835/Kconfig
index 560045ca..acea0d8 100644
--- a/arch/arm/mach-bcm2835/Kconfig
+++ b/arch/arm/mach-bcm2835/Kconfig
@@ -4,10 +4,6 @@  config ARCH_BCM2835
 	select ARM_AMBA
 	select ARM_ERRATA_411920
 	select ARM_TIMER_SP804
-	select CLKDEV_LOOKUP
-	select CLKSRC_OF
-	select CPU_V6
-	select GENERIC_CLOCKEVENTS
 	select PINCTRL
 	select PINCTRL_BCM2835
 	help
diff --git a/arch/arm/mach-cns3xxx/Kconfig b/arch/arm/mach-cns3xxx/Kconfig
index dbf0df8..e346688 100644
--- a/arch/arm/mach-cns3xxx/Kconfig
+++ b/arch/arm/mach-cns3xxx/Kconfig
@@ -2,7 +2,6 @@  config ARCH_CNS3XXX
 	bool "Cavium Networks CNS3XXX family" if ARCH_MULTI_V6
 	select ARM_GIC
 	select CPU_V6K
-	select GENERIC_CLOCKEVENTS
 	select MIGHT_HAVE_CACHE_L2X0
 	select MIGHT_HAVE_PCI
 	select PCI_DOMAINS if PCI
diff --git a/arch/arm/mach-highbank/Kconfig b/arch/arm/mach-highbank/Kconfig
index 0aded64..59274a7 100644
--- a/arch/arm/mach-highbank/Kconfig
+++ b/arch/arm/mach-highbank/Kconfig
@@ -5,7 +5,6 @@  config ARCH_HIGHBANK
 	select ARCH_HAS_HOLES_MEMORYMODEL
 	select ARCH_HAS_OPP
 	select ARCH_SUPPORTS_BIG_ENDIAN
-	select ARCH_WANT_OPTIONAL_GPIOLIB
 	select ARM_AMBA
 	select ARM_ERRATA_764369 if SMP
 	select ARM_ERRATA_775420
@@ -14,14 +13,9 @@  config ARCH_HIGHBANK
 	select ARM_PSCI
 	select ARM_TIMER_SP804
 	select CACHE_L2X0
-	select COMMON_CLK
-	select CPU_V7
-	select GENERIC_CLOCKEVENTS
 	select HAVE_ARM_SCU
 	select HAVE_ARM_TWD if SMP
 	select HAVE_SMP
 	select MAILBOX
 	select PL320_MBOX
-	select SPARSE_IRQ
-	select USE_OF
 	select ZONE_DMA if ARM_LPAE
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index 7a6e6f7..5052c18 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -2,18 +2,11 @@  config ARCH_MXC
 	bool "Freescale i.MX family" if ARCH_MULTI_V4_V5 || ARCH_MULTI_V6_V7
 	select ARCH_REQUIRE_GPIOLIB
 	select ARM_CPU_SUSPEND if PM
-	select ARM_PATCH_PHYS_VIRT
-	select AUTO_ZRELADDR if !ZBOOT_ROM
 	select CLKSRC_MMIO
-	select COMMON_CLK
 	select GENERIC_ALLOCATOR
-	select GENERIC_CLOCKEVENTS
 	select GENERIC_IRQ_CHIP
 	select MIGHT_HAVE_CACHE_L2X0 if ARCH_MULTI_V6_V7
-	select MULTI_IRQ_HANDLER
 	select SOC_BUS
-	select SPARSE_IRQ
-	select USE_OF
 	help
 	  Support for Freescale MXC/iMX-based family of processors
 
@@ -139,7 +132,6 @@  config SOC_IMX5
 	select ARCH_HAS_CPUFREQ
 	select ARCH_HAS_OPP
 	select ARCH_MXC_IOMUX_V3
-	select CPU_V7
 	select MXC_TZIC
 
 config	SOC_IMX51
@@ -785,7 +777,6 @@  config SOC_IMX6Q
 	select ARM_ERRATA_764369 if SMP
 	select ARM_ERRATA_775420
 	select ARM_GIC
-	select CPU_V7
 	select HAVE_ARM_SCU if SMP
 	select HAVE_ARM_TWD if SMP
 	select HAVE_IMX_ANATOP
@@ -811,7 +802,6 @@  config SOC_IMX6SL
 	select ARM_ERRATA_754322
 	select ARM_ERRATA_775420
 	select ARM_GIC
-	select CPU_V7
 	select HAVE_IMX_ANATOP
 	select HAVE_IMX_GPC
 	select HAVE_IMX_MMDC
@@ -828,9 +818,7 @@  config SOC_IMX6SL
 
 config SOC_VF610
 	bool "Vybrid Family VF610 support"
-	select CPU_V7
 	select ARM_GIC
-	select CLKSRC_OF
 	select PINCTRL
 	select PINCTRL_VF610
 	select VF_PIT_TIMER
diff --git a/arch/arm/mach-keystone/Kconfig b/arch/arm/mach-keystone/Kconfig
index f20c53e..ea35853 100644
--- a/arch/arm/mach-keystone/Kconfig
+++ b/arch/arm/mach-keystone/Kconfig
@@ -1,13 +1,10 @@ 
 config ARCH_KEYSTONE
 	bool "Texas Instruments Keystone Devices"
 	depends on ARCH_MULTI_V7
-	select CPU_V7
 	select ARM_GIC
 	select HAVE_ARM_ARCH_TIMER
 	select HAVE_SMP
 	select CLKSRC_MMIO
-	select GENERIC_CLOCKEVENTS
-	select ARCH_WANT_OPTIONAL_GPIOLIB
 	select ARM_ERRATA_798181 if SMP
 	select COMMON_CLK_KEYSTONE
 	select TI_EDMA
diff --git a/arch/arm/mach-mvebu/Kconfig b/arch/arm/mach-mvebu/Kconfig
index 5e269d7..d581e84 100644
--- a/arch/arm/mach-mvebu/Kconfig
+++ b/arch/arm/mach-mvebu/Kconfig
@@ -2,15 +2,10 @@  config ARCH_MVEBU
 	bool "Marvell SOCs with Device Tree support" if ARCH_MULTI_V7
 	select ARCH_SUPPORTS_BIG_ENDIAN
 	select CLKSRC_MMIO
-	select COMMON_CLK
-	select GENERIC_CLOCKEVENTS
 	select GENERIC_IRQ_CHIP
 	select IRQ_DOMAIN
-	select MULTI_IRQ_HANDLER
 	select PINCTRL
 	select PLAT_ORION
-	select SPARSE_IRQ
-	select CLKDEV_LOOKUP
 	select MVEBU_MBUS
 	select ZONE_DMA if ARM_LPAE
 	select ARCH_REQUIRE_GPIOLIB
diff --git a/arch/arm/mach-mxs/Kconfig b/arch/arm/mach-mxs/Kconfig
index 8cde9e0..8479413 100644
--- a/arch/arm/mach-mxs/Kconfig
+++ b/arch/arm/mach-mxs/Kconfig
@@ -16,11 +16,7 @@  config ARCH_MXS
 	bool "Freescale MXS (i.MX23, i.MX28) support"
 	depends on ARCH_MULTI_V5
 	select ARCH_REQUIRE_GPIOLIB
-	select CLKDEV_LOOKUP
 	select CLKSRC_MMIO
-	select CLKSRC_OF
-	select GENERIC_CLOCKEVENTS
-	select HAVE_CLK_PREPARE
 	select PINCTRL
 	select SOC_BUS
 	select SOC_IMX23
diff --git a/arch/arm/mach-nomadik/Kconfig b/arch/arm/mach-nomadik/Kconfig
index 4d42da4..486d301 100644
--- a/arch/arm/mach-nomadik/Kconfig
+++ b/arch/arm/mach-nomadik/Kconfig
@@ -6,16 +6,11 @@  config ARCH_NOMADIK
 	select ARM_VIC
 	select CLKSRC_NOMADIK_MTU
 	select CLKSRC_NOMADIK_MTU_SCHED_CLOCK
-	select CLKSRC_OF
-	select COMMON_CLK
 	select CPU_ARM926T
-	select GENERIC_CLOCKEVENTS
 	select MIGHT_HAVE_CACHE_L2X0
 	select PINCTRL
 	select PINCTRL_NOMADIK
 	select PINCTRL_STN8815
-	select SPARSE_IRQ
-	select USE_OF
 	help
 	  Support for the Nomadik platform by ST-Ericsson
 
diff --git a/arch/arm/mach-nspire/Kconfig b/arch/arm/mach-nspire/Kconfig
index 59d8f0a..bc41f26 100644
--- a/arch/arm/mach-nspire/Kconfig
+++ b/arch/arm/mach-nspire/Kconfig
@@ -3,14 +3,9 @@  config ARCH_NSPIRE
 	depends on ARCH_MULTI_V4_V5
 	depends on MMU
 	select CPU_ARM926T
-	select COMMON_CLK
-	select GENERIC_CLOCKEVENTS
 	select GENERIC_IRQ_CHIP
-	select SPARSE_IRQ
 	select ARM_AMBA
 	select ARM_VIC
 	select ARM_TIMER_SP804
-	select USE_OF
-	select CLKSRC_OF
 	help
 	  This enables support for systems using the TI-NSPIRE CPU
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index dc21df1..c128792 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -5,8 +5,6 @@  config ARCH_OMAP2
 	bool "TI OMAP2"
 	depends on ARCH_MULTI_V6
 	select ARCH_OMAP2PLUS
-	select CPU_V6
-	select MULTI_IRQ_HANDLER
 	select SOC_HAS_OMAP2_SDRC
 
 config ARCH_OMAP3
@@ -15,8 +13,6 @@  config ARCH_OMAP3
 	select ARCH_OMAP2PLUS
 	select ARCH_HAS_OPP
 	select ARM_CPU_SUSPEND if PM
-	select CPU_V7
-	select MULTI_IRQ_HANDLER
 	select OMAP_INTERCONNECT
 	select PM_OPP if PM
 	select PM_RUNTIME if CPU_IDLE
@@ -33,7 +29,6 @@  config ARCH_OMAP4
 	select ARM_ERRATA_720789
 	select ARM_GIC
 	select CACHE_L2X0
-	select CPU_V7
 	select HAVE_ARM_SCU if SMP
 	select HAVE_ARM_TWD if SMP
 	select HAVE_SMP
@@ -52,7 +47,6 @@  config SOC_OMAP5
 	select ARCH_OMAP2PLUS
 	select ARM_CPU_SUSPEND if PM
 	select ARM_GIC
-	select CPU_V7
 	select HAVE_ARM_SCU if SMP
 	select HAVE_ARM_TWD if LOCAL_TIMERS
 	select HAVE_SMP
@@ -64,15 +58,11 @@  config SOC_AM33XX
 	depends on ARCH_MULTI_V7
 	select ARCH_OMAP2PLUS
 	select ARM_CPU_SUSPEND if PM
-	select CPU_V7
-	select MULTI_IRQ_HANDLER
 
 config SOC_AM43XX
 	bool "TI AM43x"
 	depends on ARCH_MULTI_V7
-	select CPU_V7
 	select ARCH_OMAP2PLUS
-	select MULTI_IRQ_HANDLER
 	select ARM_GIC
 	select MACH_OMAP_GENERIC
 
@@ -84,17 +74,13 @@  config ARCH_OMAP2PLUS
 	select ARCH_OMAP
 	select ARCH_REQUIRE_GPIOLIB
 	select CLKSRC_MMIO
-	select COMMON_CLK
-	select GENERIC_CLOCKEVENTS
 	select GENERIC_IRQ_CHIP
 	select MACH_OMAP_GENERIC
 	select OMAP_DM_TIMER
 	select PINCTRL
 	select PROC_DEVICETREE if PROC_FS
 	select SOC_BUS
-	select SPARSE_IRQ
 	select TI_PRIV_EDMA
-	select USE_OF
 	help
 	  Systems based on OMAP2, OMAP3, OMAP4 or OMAP5
 
@@ -131,10 +117,8 @@  config SOC_HAS_REALTIME_COUNTER
 config SOC_DRA7XX
 	bool "TI DRA7XX"
 	select ARM_ARCH_TIMER
-	select CPU_V7
 	select ARM_GIC
 	select HAVE_SMP
-	select COMMON_CLK
 
 comment "OMAP Core Type"
 	depends on ARCH_OMAP2
diff --git a/arch/arm/mach-picoxcell/Kconfig b/arch/arm/mach-picoxcell/Kconfig
index b1022f4..c88ff74 100644
--- a/arch/arm/mach-picoxcell/Kconfig
+++ b/arch/arm/mach-picoxcell/Kconfig
@@ -1,12 +1,8 @@ 
 config ARCH_PICOXCELL
 	bool "Picochip PicoXcell" if ARCH_MULTI_V6
 	select ARCH_REQUIRE_GPIOLIB
-	select ARM_PATCH_PHYS_VIRT
 	select ARM_VIC
 	select CPU_V6K
 	select DW_APB_TIMER_OF
-	select GENERIC_CLOCKEVENTS
 	select HAVE_TCM
 	select NO_IOPORT
-	select SPARSE_IRQ
-	select USE_OF
diff --git a/arch/arm/mach-prima2/Kconfig b/arch/arm/mach-prima2/Kconfig
index 6988b11..16c2d90 100644
--- a/arch/arm/mach-prima2/Kconfig
+++ b/arch/arm/mach-prima2/Kconfig
@@ -1,7 +1,6 @@ 
 config ARCH_SIRF
 	bool "CSR SiRF" if ARCH_MULTI_V7
 	select ARCH_REQUIRE_GPIOLIB
-	select GENERIC_CLOCKEVENTS
 	select GENERIC_IRQ_CHIP
 	select MIGHT_HAVE_CACHE_L2X0
 	select NO_IOPORT
@@ -17,7 +16,6 @@  menu "CSR SiRF atlas6/primaII/Marco/Polo Specific Features"
 config ARCH_ATLAS6
 	bool "CSR SiRFSoC ATLAS6 ARM Cortex A9 Platform"
 	default y
-	select CPU_V7
 	select SIRF_IRQ
 	help
           Support for CSR SiRFSoC ARM Cortex A9 Platform
@@ -25,7 +23,6 @@  config ARCH_ATLAS6
 config ARCH_PRIMA2
 	bool "CSR SiRFSoC PRIMA2 ARM Cortex A9 Platform"
 	default y
-	select CPU_V7
 	select SIRF_IRQ
 	select ZONE_DMA
 	help
@@ -35,7 +32,6 @@  config ARCH_MARCO
 	bool "CSR SiRFSoC MARCO ARM Cortex A9 Platform"
 	default y
 	select ARM_GIC
-	select CPU_V7
 	select HAVE_ARM_SCU if SMP
 	select HAVE_SMP
 	select SMP_ON_UP if SMP
diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig
index cf073de..2a695bc 100644
--- a/arch/arm/mach-rockchip/Kconfig
+++ b/arch/arm/mach-rockchip/Kconfig
@@ -7,8 +7,6 @@  config ARCH_ROCKCHIP
 	select CACHE_L2X0
 	select HAVE_ARM_TWD if SMP
 	select HAVE_SMP
-	select COMMON_CLK
-	select GENERIC_CLOCKEVENTS
 	select DW_APB_TIMER_OF
 	select ARM_GLOBAL_TIMER
 	select CLKSRC_ARM_GLOBAL_TIMER_SCHED_CLOCK
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
index a4a4b75..de75560 100644
--- a/arch/arm/mach-shmobile/Kconfig
+++ b/arch/arm/mach-shmobile/Kconfig
@@ -1,8 +1,6 @@ 
 config ARCH_SHMOBILE_MULTI
 	bool "SH-Mobile Series" if ARCH_MULTI_V7
 	depends on MMU
-	select CPU_V7
-	select GENERIC_CLOCKEVENTS
 	select HAVE_ARM_SCU if SMP
 	select HAVE_ARM_TWD if LOCAL_TIMERS
 	select HAVE_SMP
@@ -11,7 +9,6 @@  config ARCH_SHMOBILE_MULTI
 	select NO_IOPORT
 	select PINCTRL
 	select ARCH_REQUIRE_GPIOLIB
-	select CLKDEV_LOOKUP
 
 if ARCH_SHMOBILE_MULTI
 
diff --git a/arch/arm/mach-socfpga/Kconfig b/arch/arm/mach-socfpga/Kconfig
index 037100a..57e11cd 100644
--- a/arch/arm/mach-socfpga/Kconfig
+++ b/arch/arm/mach-socfpga/Kconfig
@@ -4,13 +4,8 @@  config ARCH_SOCFPGA
 	select ARM_AMBA
 	select ARM_GIC
 	select CACHE_L2X0
-	select COMMON_CLK
-	select CPU_V7
 	select DW_APB_TIMER_OF
-	select GENERIC_CLOCKEVENTS
 	select GPIO_PL061 if GPIOLIB
 	select HAVE_ARM_SCU
 	select HAVE_SMP
 	select MFD_SYSCON
-	select SPARSE_IRQ
-	select USE_OF
diff --git a/arch/arm/mach-spear/Kconfig b/arch/arm/mach-spear/Kconfig
index ac1710e6..a7a28ea 100644
--- a/arch/arm/mach-spear/Kconfig
+++ b/arch/arm/mach-spear/Kconfig
@@ -8,8 +8,6 @@  menuconfig PLAT_SPEAR
 	select ARCH_REQUIRE_GPIOLIB
 	select ARM_AMBA
 	select CLKSRC_MMIO
-	select COMMON_CLK
-	select GENERIC_CLOCKEVENTS
 
 if PLAT_SPEAR
 
@@ -18,14 +16,12 @@  config ARCH_SPEAR13XX
 	depends on ARCH_MULTI_V7 || PLAT_SPEAR_SINGLE
 	select ARCH_HAS_CPUFREQ
 	select ARM_GIC
-	select CPU_V7
 	select GPIO_SPEAR_SPICS
 	select HAVE_ARM_SCU if SMP
 	select HAVE_ARM_TWD if SMP
 	select HAVE_SMP
 	select MIGHT_HAVE_CACHE_L2X0
 	select PINCTRL
-	select USE_OF
 	help
 	  Supports for ARM's SPEAR13XX family
 
@@ -50,9 +46,7 @@  config ARCH_SPEAR3XX
 	depends on ARCH_MULTI_V5 || PLAT_SPEAR_SINGLE
 	depends on !ARCH_SPEAR13XX
 	select ARM_VIC
-	select CPU_ARM926T
 	select PINCTRL
-	select USE_OF
 	help
 	  Supports for ARM's SPEAR3XX family
 
@@ -83,14 +77,12 @@  config ARCH_SPEAR6XX
 	depends on ARCH_MULTI_V5 || PLAT_SPEAR_SINGLE
 	depends on !ARCH_SPEAR13XX
 	select ARM_VIC
-	select CPU_ARM926T
 	help
 	  Supports for ARM's SPEAR6XX family
 
 config MACH_SPEAR600
 	def_bool y
 	depends on ARCH_SPEAR6XX
-	select USE_OF
 	help
 	  Supports ST SPEAr600 boards configured via the device-treesource "arch/arm/mach-spear6xx/Kconfig"
 
diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig
index c9e72c8..ade43c9 100644
--- a/arch/arm/mach-sunxi/Kconfig
+++ b/arch/arm/mach-sunxi/Kconfig
@@ -3,12 +3,8 @@  config ARCH_SUNXI
 	select ARCH_REQUIRE_GPIOLIB
 	select ARM_GIC
 	select CLKSRC_MMIO
-	select CLKSRC_OF
-	select COMMON_CLK
-	select GENERIC_CLOCKEVENTS
 	select GENERIC_IRQ_CHIP
 	select HAVE_SMP
 	select PINCTRL
 	select PINCTRL_SUNXI
-	select SPARSE_IRQ
 	select SUN4I_TIMER
diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig
index 09e740f..8f97cf0 100644
--- a/arch/arm/mach-tegra/Kconfig
+++ b/arch/arm/mach-tegra/Kconfig
@@ -4,10 +4,6 @@  config ARCH_TEGRA
 	select ARCH_REQUIRE_GPIOLIB
 	select ARM_GIC
 	select CLKSRC_MMIO
-	select CLKSRC_OF
-	select COMMON_CLK
-	select CPU_V7
-	select GENERIC_CLOCKEVENTS
 	select HAVE_ARM_SCU if SMP
 	select HAVE_ARM_TWD if SMP
 	select HAVE_SMP
@@ -15,11 +11,9 @@  config ARCH_TEGRA
 	select MIGHT_HAVE_PCI
 	select PINCTRL
 	select SOC_BUS
-	select SPARSE_IRQ
 	select USB_ARCH_HAS_EHCI if USB_SUPPORT
 	select USB_ULPI if USB_PHY
 	select USB_ULPI_VIEWPORT if USB_PHY
-	select USE_OF
 	help
 	  This enables support for NVIDIA Tegra based systems.
 
diff --git a/arch/arm/mach-u300/Kconfig b/arch/arm/mach-u300/Kconfig
index 8e23071..e3a96d7 100644
--- a/arch/arm/mach-u300/Kconfig
+++ b/arch/arm/mach-u300/Kconfig
@@ -3,20 +3,14 @@  config ARCH_U300
 	depends on MMU
 	select ARCH_REQUIRE_GPIOLIB
 	select ARM_AMBA
-	select ARM_PATCH_PHYS_VIRT
 	select ARM_VIC
 	select CLKSRC_MMIO
-	select CLKSRC_OF
-	select COMMON_CLK
 	select CPU_ARM926T
-	select GENERIC_CLOCKEVENTS
 	select HAVE_TCM
 	select PINCTRL
 	select PINCTRL_COH901
 	select PINCTRL_U300
-	select SPARSE_IRQ
 	select MFD_SYSCON
-	select USE_OF
 	help
 	  Support for ST-Ericsson U300 series mobile platforms.
 
diff --git a/arch/arm/mach-ux500/Kconfig b/arch/arm/mach-ux500/Kconfig
index 0034d2c..5292f7b 100644
--- a/arch/arm/mach-ux500/Kconfig
+++ b/arch/arm/mach-ux500/Kconfig
@@ -11,9 +11,6 @@  config ARCH_U8500
 	select ARM_GIC
 	select CACHE_L2X0
 	select CLKSRC_NOMADIK_MTU
-	select COMMON_CLK
-	select CPU_V7
-	select GENERIC_CLOCKEVENTS
 	select HAVE_ARM_SCU if SMP
 	select HAVE_ARM_TWD if SMP
 	select HAVE_SMP
diff --git a/arch/arm/mach-vexpress/Kconfig b/arch/arm/mach-vexpress/Kconfig
index 4a70be4..fa29222 100644
--- a/arch/arm/mach-vexpress/Kconfig
+++ b/arch/arm/mach-vexpress/Kconfig
@@ -5,10 +5,7 @@  config ARCH_VEXPRESS
 	select ARM_AMBA
 	select ARM_GIC
 	select ARM_TIMER_SP804
-	select COMMON_CLK
 	select COMMON_CLK_VERSATILE
-	select CPU_V7
-	select GENERIC_CLOCKEVENTS
 	select HAVE_ARM_SCU if SMP
 	select HAVE_ARM_TWD if SMP
 	select HAVE_PATA_PLATFORM
diff --git a/arch/arm/mach-virt/Kconfig b/arch/arm/mach-virt/Kconfig
index 081d469..eaad072 100644
--- a/arch/arm/mach-virt/Kconfig
+++ b/arch/arm/mach-virt/Kconfig
@@ -1,10 +1,6 @@ 
 config ARCH_VIRT
 	bool "Dummy Virtual Machine" if ARCH_MULTI_V7
-	select ARCH_WANT_OPTIONAL_GPIOLIB
 	select ARM_GIC
 	select HAVE_ARM_ARCH_TIMER
 	select ARM_PSCI
 	select HAVE_SMP
-	select CPU_V7
-	select SPARSE_IRQ
-	select USE_OF
diff --git a/arch/arm/mach-vt8500/Kconfig b/arch/arm/mach-vt8500/Kconfig
index 927be93..08f56a4 100644
--- a/arch/arm/mach-vt8500/Kconfig
+++ b/arch/arm/mach-vt8500/Kconfig
@@ -3,8 +3,6 @@  config ARCH_VT8500
 	select ARCH_HAS_CPUFREQ
 	select ARCH_REQUIRE_GPIOLIB
 	select CLKDEV_LOOKUP
-	select CLKSRC_OF
-	select GENERIC_CLOCKEVENTS
 	select VT8500_TIMER
 	select PINCTRL
 	help
@@ -21,7 +19,6 @@  config ARCH_WM8750
 	bool "WonderMedia WM8750"
 	depends on ARCH_MULTI_V6
 	select ARCH_VT8500
-	select CPU_V6
 	help
 	  Support for WonderMedia WM8750 System-on-Chip.
 
@@ -29,6 +26,5 @@  config ARCH_WM8850
 	bool "WonderMedia WM8850"
 	depends on ARCH_MULTI_V7
 	select ARCH_VT8500
-	select CPU_V7
 	help
 	  Support for WonderMedia WM8850 System-on-Chip.
diff --git a/arch/arm/mach-zynq/Kconfig b/arch/arm/mach-zynq/Kconfig
index 6b04260..85d1805 100644
--- a/arch/arm/mach-zynq/Kconfig
+++ b/arch/arm/mach-zynq/Kconfig
@@ -2,16 +2,11 @@  config ARCH_ZYNQ
 	bool "Xilinx Zynq ARM Cortex A9 Platform" if ARCH_MULTI_V7
 	select ARM_AMBA
 	select ARM_GIC
-	select COMMON_CLK
-	select CPU_V7
-	select GENERIC_CLOCKEVENTS
 	select HAVE_ARM_SCU if SMP
 	select HAVE_ARM_TWD if SMP
 	select ICST
 	select MIGHT_HAVE_CACHE_L2X0
-	select USE_OF
 	select HAVE_SMP
-	select SPARSE_IRQ
 	select CADENCE_TTC_TIMER
 	select ARM_GLOBAL_TIMER
 	help