Merge branch 'for-next' of git://git.pengutronix.de/git/ukl/linux into devel-stable
authorRussell King <rmk+kernel@arm.linux.org.uk>
Sat, 9 Mar 2013 15:49:32 +0000 (15:49 +0000)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Sat, 9 Mar 2013 15:49:32 +0000 (15:49 +0000)
Conflicts:
arch/arm/include/asm/cputype.h

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
1  2 
arch/arm/Kconfig
arch/arm/include/asm/cputype.h
arch/arm/kernel/smp_scu.c
arch/arm/mach-omap2/id.c
arch/arm/mach-omap2/omap-smp.c
arch/arm/mm/Kconfig
arch/arm/mm/alignment.c
arch/arm/mm/mmu.c

diff --combined arch/arm/Kconfig
@@@ -4,7 -4,6 +4,7 @@@ config AR
        select ARCH_BINFMT_ELF_RANDOMIZE_PIE
        select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
        select ARCH_HAVE_CUSTOM_GPIO_H
 +      select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
        select ARCH_WANT_IPC_PARSE_VERSION
        select BUILDTIME_EXTABLE_SORT if MMU
        select CPU_PM if (SUSPEND || CPU_IDLE)
@@@ -37,6 -36,7 +37,6 @@@
        select HAVE_GENERIC_HARDIRQS
        select HAVE_HW_BREAKPOINT if (PERF_EVENTS && (CPU_V6 || CPU_V6K || CPU_V7))
        select HAVE_IDE if PCI || ISA || PCMCIA
 -      select HAVE_IRQ_WORK
        select HAVE_KERNEL_GZIP
        select HAVE_KERNEL_LZMA
        select HAVE_KERNEL_LZO
@@@ -49,7 -49,6 +49,7 @@@
        select HAVE_REGS_AND_STACK_ACCESS_API
        select HAVE_SYSCALL_TRACEPOINTS
        select HAVE_UID16
 +      select HAVE_VIRT_TO_BUS
        select KTIME_SCALAR
        select PERF_USE_VMALLOC
        select RTC_LIB
@@@ -57,8 -56,6 +57,8 @@@
        select HAVE_MOD_ARCH_SPECIFIC if ARM_UNWIND
        select MODULES_USE_ELF_REL
        select CLONE_BACKWARDS
 +      select OLD_SIGSUSPEND3
 +      select OLD_SIGACTION
        help
          The ARM series is a line of low-power-consumption RISC chip designs
          licensed by ARM Ltd and targeted at embedded applications and
@@@ -78,27 -75,6 +78,27 @@@ config ARM_DMA_USE_IOMM
        select ARM_HAS_SG_CHAIN
        select NEED_SG_DMA_LENGTH
  
 +if ARM_DMA_USE_IOMMU
 +
 +config ARM_DMA_IOMMU_ALIGNMENT
 +      int "Maximum PAGE_SIZE order of alignment for DMA IOMMU buffers"
 +      range 4 9
 +      default 8
 +      help
 +        DMA mapping framework by default aligns all buffers to the smallest
 +        PAGE_SIZE order which is greater than or equal to the requested buffer
 +        size. This works well for buffers up to a few hundreds kilobytes, but
 +        for larger buffers it just a waste of address space. Drivers which has
 +        relatively small addressing window (like 64Mib) might run out of
 +        virtual space with just a few allocations.
 +
 +        With this parameter you can specify the maximum PAGE_SIZE order for
 +        DMA IOMMU buffers. Larger buffers will be aligned only to this
 +        specified order. The order is expressed as a power of two multiplied
 +        by the PAGE_SIZE.
 +
 +endif
 +
  config HAVE_PWM
        bool
  
@@@ -285,8 -261,7 +285,8 @@@ config MM
  #
  choice
        prompt "ARM system type"
 -      default ARCH_MULTIPLATFORM
 +      default ARCH_VERSATILE if !MMU
 +      default ARCH_MULTIPLATFORM if MMU
  
  config ARCH_MULTIPLATFORM
        bool "Allow multiple platforms to be selected"
@@@ -369,10 -344,10 +369,10 @@@ config ARCH_BCM283
        select ARM_ERRATA_411920
        select ARM_TIMER_SP804
        select CLKDEV_LOOKUP
 +      select CLKSRC_OF
        select COMMON_CLK
        select CPU_V6
        select GENERIC_CLOCKEVENTS
 -      select GENERIC_GPIO
        select MULTI_IRQ_HANDLER
        select PINCTRL
        select PINCTRL_BCM2835
@@@ -418,7 -393,6 +418,7 @@@ config ARCH_GEMIN
  config ARCH_SIRF
        bool "CSR SiRF"
        select ARCH_REQUIRE_GPIOLIB
 +      select AUTO_ZRELADDR
        select COMMON_CLK
        select GENERIC_CLOCKEVENTS
        select GENERIC_IRQ_CHIP
@@@ -666,12 -640,11 +666,12 @@@ config ARCH_LPC32X
  config ARCH_TEGRA
        bool "NVIDIA Tegra"
        select ARCH_HAS_CPUFREQ
 +      select ARCH_REQUIRE_GPIOLIB
        select CLKDEV_LOOKUP
        select CLKSRC_MMIO
 +      select CLKSRC_OF
        select COMMON_CLK
        select GENERIC_CLOCKEVENTS
 -      select GENERIC_GPIO
        select HAVE_CLK
        select HAVE_SMP
        select MIGHT_HAVE_CACHE_L2X0
@@@ -725,7 -698,6 +725,7 @@@ config ARCH_SHMOBIL
        select MULTI_IRQ_HANDLER
        select NEED_MACH_MEMORY_H
        select NO_IOPORT
 +      select PINCTRL
        select PM_GENERIC_DOMAINS if PM
        select SPARSE_IRQ
        help
@@@ -772,6 -744,7 +772,6 @@@ config ARCH_S3C24X
        select ARCH_HAS_CPUFREQ
        select ARCH_USES_GETTIMEOFFSET
        select CLKDEV_LOOKUP
 -      select GENERIC_GPIO
        select HAVE_CLK
        select HAVE_S3C2410_I2C if I2C
        select HAVE_S3C2410_WATCHDOG if WATCHDOG
@@@ -814,6 -787,7 +814,6 @@@ config ARCH_S5P64X
        select CLKSRC_MMIO
        select CPU_V6
        select GENERIC_CLOCKEVENTS
 -      select GENERIC_GPIO
        select HAVE_CLK
        select HAVE_S3C2410_I2C if I2C
        select HAVE_S3C2410_WATCHDOG if WATCHDOG
@@@ -828,6 -802,7 +828,6 @@@ config ARCH_S5PC10
        select ARCH_USES_GETTIMEOFFSET
        select CLKDEV_LOOKUP
        select CPU_V7
 -      select GENERIC_GPIO
        select HAVE_CLK
        select HAVE_S3C2410_I2C if I2C
        select HAVE_S3C2410_WATCHDOG if WATCHDOG
@@@ -845,6 -820,7 +845,6 @@@ config ARCH_S5PV21
        select CLKSRC_MMIO
        select CPU_V7
        select GENERIC_CLOCKEVENTS
 -      select GENERIC_GPIO
        select HAVE_CLK
        select HAVE_S3C2410_I2C if I2C
        select HAVE_S3C2410_WATCHDOG if WATCHDOG
@@@ -862,6 -838,7 +862,6 @@@ config ARCH_EXYNO
        select CLKDEV_LOOKUP
        select CPU_V7
        select GENERIC_CLOCKEVENTS
 -      select GENERIC_GPIO
        select HAVE_CLK
        select HAVE_S3C2410_I2C if I2C
        select HAVE_S3C2410_WATCHDOG if WATCHDOG
@@@ -896,6 -873,7 +896,6 @@@ config ARCH_U30
        select COMMON_CLK
        select CPU_ARM926T
        select GENERIC_CLOCKEVENTS
 -      select GENERIC_GPIO
        select HAVE_TCM
        select SPARSE_IRQ
        help
@@@ -921,12 -899,10 +921,12 @@@ config ARCH_NOMADI
        select ARCH_REQUIRE_GPIOLIB
        select ARM_AMBA
        select ARM_VIC
 +      select CLKSRC_NOMADIK_MTU
        select COMMON_CLK
        select CPU_ARM926T
        select GENERIC_CLOCKEVENTS
        select MIGHT_HAVE_CACHE_L2X0
 +      select USE_OF
        select PINCTRL
        select PINCTRL_STN8815
        select SPARSE_IRQ
@@@ -961,24 -937,33 +961,24 @@@ config ARCH_DAVINC
        help
          Support for TI's DaVinci platform.
  
 -config ARCH_OMAP
 -      bool "TI OMAP"
 +config ARCH_OMAP1
 +      bool "TI OMAP1"
        depends on MMU
        select ARCH_HAS_CPUFREQ
        select ARCH_HAS_HOLES_MEMORYMODEL
 -      select ARCH_REQUIRE_GPIOLIB
 -      select CLKSRC_MMIO
 -      select GENERIC_CLOCKEVENTS
 -      select HAVE_CLK
 -      help
 -        Support for TI's OMAP platform (OMAP1/2/3/4).
 -
 -config ARCH_VT8500_SINGLE
 -      bool "VIA/WonderMedia 85xx"
 -      select ARCH_HAS_CPUFREQ
 +      select ARCH_OMAP
        select ARCH_REQUIRE_GPIOLIB
        select CLKDEV_LOOKUP
 -      select COMMON_CLK
 -      select CPU_ARM926T
 +      select CLKSRC_MMIO
        select GENERIC_CLOCKEVENTS
 -      select GENERIC_GPIO
 +      select GENERIC_IRQ_CHIP
        select HAVE_CLK
 -      select MULTI_IRQ_HANDLER
 -      select SPARSE_IRQ
 -      select USE_OF
 +      select HAVE_IDE
 +      select IRQ_DOMAIN
 +      select NEED_MACH_IO_H if PCCARD
 +      select NEED_MACH_MEMORY_H
        help
 -        Support for VIA/WonderMedia VT8500/WM85xx System-on-Chip.
 +        Support for older TI OMAP1 (omap7xx, omap15xx or omap16xx)
  
  endchoice
  
@@@ -1101,12 -1086,17 +1101,12 @@@ source "arch/arm/mach-realview/Kconfig
  source "arch/arm/mach-sa1100/Kconfig"
  
  source "arch/arm/plat-samsung/Kconfig"
 -source "arch/arm/plat-s3c24xx/Kconfig"
  
  source "arch/arm/mach-socfpga/Kconfig"
  
  source "arch/arm/plat-spear/Kconfig"
  
  source "arch/arm/mach-s3c24xx/Kconfig"
 -if ARCH_S3C24XX
 -source "arch/arm/mach-s3c2412/Kconfig"
 -source "arch/arm/mach-s3c2440/Kconfig"
 -endif
  
  if ARCH_S3C64XX
  source "arch/arm/mach-s3c64xx/Kconfig"
@@@ -1137,8 -1127,6 +1137,8 @@@ source "arch/arm/mach-versatile/Kconfig
  source "arch/arm/mach-vexpress/Kconfig"
  source "arch/arm/plat-versatile/Kconfig"
  
 +source "arch/arm/mach-virt/Kconfig"
 +
  source "arch/arm/mach-vt8500/Kconfig"
  
  source "arch/arm/mach-w90x900/Kconfig"
@@@ -1462,10 -1450,6 +1462,10 @@@ config ISA_DM
        bool
        select ISA_DMA_API
  
 +config ARCH_NO_VIRT_TO_BUS
 +      def_bool y
 +      depends on !ARCH_RPC && !ARCH_NETWINDER && !ARCH_SHARK
 +
  # Select ISA DMA interface
  config ISA_DMA_API
        bool
@@@ -1547,6 -1531,7 +1547,6 @@@ config SM
  
  config SMP_ON_UP
        bool "Allow booting SMP kernel on uniprocessor systems (EXPERIMENTAL)"
 -      depends on EXPERIMENTAL
        depends on SMP && !XIP_KERNEL
        default y
        help
@@@ -1587,10 -1572,9 +1587,10 @@@ config HAVE_ARM_SC
        help
          This option enables support for the ARM system coherency unit
  
 -config ARM_ARCH_TIMER
 +config HAVE_ARM_ARCH_TIMER
        bool "Architected timer support"
        depends on CPU_V7
 +      select ARM_ARCH_TIMER
        help
          This option enables support for the ARM architected timer
  
@@@ -1636,16 -1620,6 +1636,16 @@@ config HOTPLUG_CP
          Say Y here to experiment with turning CPUs off and on.  CPUs
          can be controlled through /sys/devices/system/cpu.
  
 +config ARM_PSCI
 +      bool "Support for the ARM Power State Coordination Interface (PSCI)"
 +      depends on CPU_V7
 +      help
 +        Say Y here if you want Linux to communicate with system firmware
 +        implementing the PSCI specification for CPU-centric power
 +        management operations described in ARM document number ARM DEN
 +        0022A ("Power State Coordination Interface System Software on
 +        ARM processors").
 +
  config LOCAL_TIMERS
        bool "Use local timer interrupts"
        depends on SMP
@@@ -1663,7 -1637,7 +1663,7 @@@ config ARCH_NR_GPI
        default 355 if ARCH_U8500
        default 264 if MACH_H4700
        default 512 if SOC_OMAP5
 -      default 288 if ARCH_VT8500
 +      default 288 if ARCH_VT8500 || ARCH_SUNXI
        default 0
        help
          Maximum number of GPIOs in the system.
@@@ -1676,16 -1650,15 +1676,17 @@@ config H
        int
        default 200 if ARCH_EBSA110 || ARCH_S3C24XX || ARCH_S5P64X0 || \
                ARCH_S5PV210 || ARCH_EXYNOS4
 -      default OMAP_32K_TIMER_HZ if ARCH_OMAP && OMAP_32K_TIMER
        default AT91_TIMER_HZ if ARCH_AT91
        default SHMOBILE_TIMER_HZ if ARCH_SHMOBILE
        default 100
  
 +config SCHED_HRTICK
 +      def_bool HIGH_RES_TIMERS
 +
  config THUMB2_KERNEL
-       bool "Compile the kernel in Thumb-2 mode"
+       bool "Compile the kernel in Thumb-2 mode" if !CPU_THUMBONLY
        depends on CPU_V7 && !CPU_V6 && !CPU_V6K
+       default y if CPU_THUMBONLY
        select AEABI
        select ARM_ASM_UNIFIED
        select ARM_UNWIND
@@@ -1747,7 -1720,7 +1748,7 @@@ config AEAB
  
  config OABI_COMPAT
        bool "Allow old ABI binaries to run with this kernel (EXPERIMENTAL)"
 -      depends on AEABI && EXPERIMENTAL && !THUMB2_KERNEL
 +      depends on AEABI && !THUMB2_KERNEL
        default y
        help
          This option preserves the old syscall interface along with the
@@@ -1871,6 -1844,7 +1872,6 @@@ config SECCOM
  
  config CC_STACKPROTECTOR
        bool "Enable -fstack-protector buffer overflow detection (EXPERIMENTAL)"
 -      depends on EXPERIMENTAL
        help
          This option turns on the -fstack-protector GCC feature. This
          feature puts, at the beginning of functions, a canary value on
@@@ -1887,7 -1861,7 +1888,7 @@@ config XEN_DOM
  
  config XEN
        bool "Xen guest support on ARM (EXPERIMENTAL)"
 -      depends on EXPERIMENTAL && ARM && OF
 +      depends on ARM && OF
        depends on CPU_V7 && !CPU_V6
        help
          Say Y if you want to run Linux in a Virtual Machine on Xen on ARM.
@@@ -1956,7 -1930,7 +1957,7 @@@ config ZBOOT_RO
  
  choice
        prompt "Include SD/MMC loader in zImage (EXPERIMENTAL)"
 -      depends on ZBOOT_ROM && ARCH_SH7372 && EXPERIMENTAL
 +      depends on ZBOOT_ROM && ARCH_SH7372
        default ZBOOT_ROM_NONE
        help
          Include experimental SD/MMC loading code in the ROM-able zImage.
@@@ -1985,7 -1959,7 +1986,7 @@@ endchoic
  
  config ARM_APPENDED_DTB
        bool "Use appended device tree blob to zImage (EXPERIMENTAL)"
 -      depends on OF && !ZBOOT_ROM && EXPERIMENTAL
 +      depends on OF && !ZBOOT_ROM
        help
          With this option, the boot code will look for a device tree binary
          (DTB) appended to zImage
@@@ -2103,7 -2077,7 +2104,7 @@@ config XIP_PHYS_ADD
  
  config KEXEC
        bool "Kexec system call (EXPERIMENTAL)"
 -      depends on EXPERIMENTAL && (!SMP || HOTPLUG_CPU)
 +      depends on (!SMP || HOTPLUG_CPU)
        help
          kexec is a system call that implements the ability to shutdown your
          current kernel, and to start another kernel.  It is like a reboot
@@@ -2125,6 -2099,7 +2126,6 @@@ config ATAGS_PRO
  
  config CRASH_DUMP
        bool "Build kdump crash kernel (EXPERIMENTAL)"
 -      depends on EXPERIMENTAL
        help
          Generate crash dump after being started by kexec. This should
          be normally only set in special crash dump kernels which are
@@@ -2191,7 -2166,7 +2192,7 @@@ config CPU_FREQ_S3
  
  config CPU_FREQ_S3C24XX
        bool "CPUfreq driver for Samsung S3C24XX series CPUs (EXPERIMENTAL)"
 -      depends on ARCH_S3C24XX && CPU_FREQ && EXPERIMENTAL
 +      depends on ARCH_S3C24XX && CPU_FREQ
        select CPU_FREQ_S3C
        help
          This enables the CPUfreq driver for the Samsung S3C24XX family
  
  config CPU_FREQ_S3C24XX_PLL
        bool "Support CPUfreq changing of PLL frequency (EXPERIMENTAL)"
 -      depends on CPU_FREQ_S3C24XX && EXPERIMENTAL
 +      depends on CPU_FREQ_S3C24XX
        help
          Compile in support for changing the PLL frequency from the
          S3C24XX series CPUfreq driver. The PLL takes time to settle
@@@ -2266,7 -2241,7 +2267,7 @@@ config FPE_NWFPE_X
  
  config FPE_FASTFPE
        bool "FastFPE math emulation (EXPERIMENTAL)"
 -      depends on (!AEABI || OABI_COMPAT) && !CPU_32v3 && EXPERIMENTAL
 +      depends on (!AEABI || OABI_COMPAT) && !CPU_32v3
        ---help---
          Say Y here to include the FAST floating point emulator in the kernel.
          This is an experimental much faster emulator which now also has full
@@@ -2348,5 -2323,3 +2349,5 @@@ source "security/Kconfig
  source "crypto/Kconfig"
  
  source "lib/Kconfig"
 +
 +source "arch/arm/kvm/Kconfig"
  #define MPIDR_AFFINITY_LEVEL(mpidr, level) \
        ((mpidr >> (MPIDR_LEVEL_BITS * level)) & MPIDR_LEVEL_MASK)
  
++#define ARM_CPU_IMP_ARM                       0x41
++#define ARM_CPU_IMP_INTEL             0x69
++
++#define ARM_CPU_PART_ARM1136          0xB360
++#define ARM_CPU_PART_ARM1156          0xB560
++#define ARM_CPU_PART_ARM1176          0xB760
++#define ARM_CPU_PART_ARM11MPCORE      0xB020
++#define ARM_CPU_PART_CORTEX_A8                0xC080
++#define ARM_CPU_PART_CORTEX_A9                0xC090
++#define ARM_CPU_PART_CORTEX_A5                0xC050
++#define ARM_CPU_PART_CORTEX_A15               0xC0F0
++#define ARM_CPU_PART_CORTEX_A7                0xC070
++
++#define ARM_CPU_XSCALE_ARCH_MASK      0xe000
++#define ARM_CPU_XSCALE_ARCH_V1                0x2000
++#define ARM_CPU_XSCALE_ARCH_V2                0x4000
++#define ARM_CPU_XSCALE_ARCH_V3                0x6000
++
  extern unsigned int processor_id;
  
  #ifdef CONFIG_CPU_CP15
@@@ -50,6 -50,7 +68,7 @@@
                    : "cc");                                            \
                __val;                                                  \
        })
  #define read_cpuid_ext(ext_reg)                                               \
        ({                                                              \
                unsigned int __val;                                     \
                    : "cc");                                            \
                __val;                                                  \
        })
- #else
- #define read_cpuid(reg) (processor_id)
- #define read_cpuid_ext(reg) 0
- #endif
  
- #define ARM_CPU_IMP_ARM                       0x41
- #define ARM_CPU_IMP_INTEL             0x69
+ #else /* ifdef CONFIG_CPU_CP15 */
  
- #define ARM_CPU_PART_ARM1136          0xB360
- #define ARM_CPU_PART_ARM1156          0xB560
- #define ARM_CPU_PART_ARM1176          0xB760
- #define ARM_CPU_PART_ARM11MPCORE      0xB020
- #define ARM_CPU_PART_CORTEX_A8                0xC080
- #define ARM_CPU_PART_CORTEX_A9                0xC090
- #define ARM_CPU_PART_CORTEX_A5                0xC050
- #define ARM_CPU_PART_CORTEX_A15               0xC0F0
- #define ARM_CPU_PART_CORTEX_A7                0xC070
+ /*
+  * read_cpuid and read_cpuid_ext should only ever be called on machines that
+  * have cp15 so warn on other usages.
+  */
+ #define read_cpuid(reg)                                                       \
+       ({                                                              \
+               WARN_ON_ONCE(1);                                        \
+               0;                                                      \
+       })
  
- #define ARM_CPU_XSCALE_ARCH_MASK      0xe000
- #define ARM_CPU_XSCALE_ARCH_V1                0x2000
- #define ARM_CPU_XSCALE_ARCH_V2                0x4000
- #define ARM_CPU_XSCALE_ARCH_V3                0x6000
+ #define read_cpuid_ext(reg) read_cpuid(reg)
  
+ #endif /* ifdef CONFIG_CPU_CP15 / else */
+ #ifdef CONFIG_CPU_CP15
  /*
   * The CPU ID never changes at run time, so we might as well tell the
   * compiler that it's constant.  Use this function to read the CPU ID
@@@ -92,21 -88,15 +106,30 @@@ static inline unsigned int __attribute_
        return read_cpuid(CPUID_ID);
  }
  
+ #else /* ifdef CONFIG_CPU_CP15 */
+ static inline unsigned int __attribute_const__ read_cpuid_id(void)
+ {
+       return processor_id;
+ }
+ #endif /* ifdef CONFIG_CPU_CP15 / else */
 +static inline unsigned int __attribute_const__ read_cpuid_implementor(void)
 +{
 +      return (read_cpuid_id() & 0xFF000000) >> 24;
 +}
 +
 +static inline unsigned int __attribute_const__ read_cpuid_part_number(void)
 +{
 +      return read_cpuid_id() & 0xFFF0;
 +}
 +
 +static inline unsigned int __attribute_const__ xscale_cpu_arch_version(void)
 +{
 +      return read_cpuid_part_number() & ARM_CPU_XSCALE_ARCH_MASK;
 +}
 +
  static inline unsigned int __attribute_const__ read_cpuid_cachetype(void)
  {
        return read_cpuid(CPUID_CACHETYPE);
@@@ -41,7 -41,7 +41,7 @@@ void scu_enable(void __iomem *scu_base
  
  #ifdef CONFIG_ARM_ERRATA_764369
        /* Cortex-A9 only */
-       if ((read_cpuid(CPUID_ID) & 0xff0ffff0) == 0x410fc090) {
+       if ((read_cpuid_id() & 0xff0ffff0) == 0x410fc090) {
                scu_ctrl = __raw_readl(scu_base + 0x30);
                if (!(scu_ctrl & 1))
                        __raw_writel(scu_ctrl | 0x1, scu_base + 0x30);
@@@ -75,7 -75,7 +75,7 @@@
  int scu_power_mode(void __iomem *scu_base, unsigned int mode)
  {
        unsigned int val;
 -      int cpu = cpu_logical_map(smp_processor_id());
 +      int cpu = MPIDR_AFFINITY_LEVEL(cpu_logical_map(smp_processor_id()), 0);
  
        if (mode > 3 || mode == 1 || cpu > 3)
                return -EINVAL;
diff --combined arch/arm/mach-omap2/id.c
@@@ -300,7 -300,7 +300,7 @@@ void __init omap3xxx_check_revision(voi
         * If the processor type is Cortex-A8 and the revision is 0x0
         * it means its Cortex r0p0 which is 3430 ES1.0.
         */
-       cpuid = read_cpuid(CPUID_ID);
+       cpuid = read_cpuid_id();
        if ((((cpuid >> 4) & 0xfff) == 0xc08) && ((cpuid & 0xf) == 0x0)) {
                omap_revision = OMAP3430_REV_ES1_0;
                cpu_rev = "1.0";
                }
                break;
        case 0xb944:
 -              omap_revision = AM335X_REV_ES1_0;
 -              cpu_rev = "1.0";
 +              switch (rev) {
 +              case 0:
 +                      omap_revision = AM335X_REV_ES1_0;
 +                      cpu_rev = "1.0";
 +                      break;
 +              case 1:
 +              /* FALLTHROUGH */
 +              default:
 +                      omap_revision = AM335X_REV_ES2_0;
 +                      cpu_rev = "2.0";
 +                      break;
 +              }
                break;
        case 0xb8f2:
                switch (rev) {
@@@ -460,7 -450,7 +460,7 @@@ void __init omap4xxx_check_revision(voi
         * Use ARM register to detect the correct ES version
         */
        if (!rev && (hawkeye != 0xb94e) && (hawkeye != 0xb975)) {
-               idcode = read_cpuid(CPUID_ID);
+               idcode = read_cpuid_id();
                rev = (idcode & 0xf) - 1;
        }
  
@@@ -19,9 -19,9 +19,9 @@@
  #include <linux/device.h>
  #include <linux/smp.h>
  #include <linux/io.h>
 +#include <linux/irqchip/arm-gic.h>
  
  #include <asm/cacheflush.h>
 -#include <asm/hardware/gic.h>
  #include <asm/smp_scu.h>
  
  #include "omap-secure.h"
@@@ -157,7 -157,7 +157,7 @@@ static int __cpuinit omap4_boot_seconda
                booted = true;
        }
  
 -      gic_raise_softirq(cpumask_of(cpu), 0);
 +      arch_send_wakeup_ipi_mask(cpumask_of(cpu));
  
        /*
         * Now the secondary core is starting up let it run its
@@@ -209,13 -209,13 +209,13 @@@ static void __init omap4_smp_init_cpus(
        unsigned int i = 0, ncores = 1, cpu_id;
  
        /* Use ARM cpuid check here, as SoC detection will not work so early */
-       cpu_id = read_cpuid(CPUID_ID) & CPU_MASK;
+       cpu_id = read_cpuid_id() & CPU_MASK;
        if (cpu_id == CPU_CORTEX_A9) {
                /*
                 * Currently we can't call ioremap here because
                 * SoC detection won't work until after init_early.
                 */
 -              scu_base =  OMAP2_L4_IO_ADDRESS(OMAP44XX_SCU_BASE);
 +              scu_base =  OMAP2_L4_IO_ADDRESS(scu_a9_get_base());
                BUG_ON(!scu_base);
                ncores = scu_get_core_count(scu_base);
        } else if (cpu_id == CPU_CORTEX_A15) {
  
        for (i = 0; i < ncores; i++)
                set_cpu_possible(i, true);
 -
 -      set_smp_cross_call(gic_raise_softirq);
  }
  
  static void __init omap4_smp_prepare_cpus(unsigned int max_cpus)
diff --combined arch/arm/mm/Kconfig
@@@ -397,6 -397,13 +397,13 @@@ config CPU_V
        select CPU_PABRT_V7
        select CPU_TLB_V7 if MMU
  
+ config CPU_THUMBONLY
+       bool
+       # There are no CPUs available with MMU that don't implement an ARM ISA:
+       depends on !MMU
+       help
+         Select this if your CPU doesn't support the 32 bit ARM instructions.
  # Figure out what processor architecture version we should be using.
  # This defines the compiler instruction set which depends on the machine type.
  config CPU_32v3
@@@ -608,7 -615,7 +615,7 @@@ config ARCH_DMA_ADDR_T_64BI
        bool
  
  config ARM_THUMB
-       bool "Support Thumb user binaries"
+       bool "Support Thumb user binaries" if !CPU_THUMBONLY
        depends on CPU_ARM720T || CPU_ARM740T || CPU_ARM920T || CPU_ARM922T || CPU_ARM925T || CPU_ARM926T || CPU_ARM940T || CPU_ARM946E || CPU_ARM1020 || CPU_ARM1020E || CPU_ARM1022 || CPU_ARM1026 || CPU_XSCALE || CPU_XSC3 || CPU_MOHAWK || CPU_V6 || CPU_V6K || CPU_V7 || CPU_FEROCEON
        default y
        help
@@@ -629,9 -636,8 +636,9 @@@ config ARM_THUMBE
          make use of it. Say N for code that can run on CPUs without ThumbEE.
  
  config ARM_VIRT_EXT
 -      bool "Native support for the ARM Virtualization Extensions"
 -      depends on MMU && CPU_V7
 +      bool
 +      depends on MMU
 +      default y if CPU_V7
        help
          Enable the kernel to make use of the ARM Virtualization
          Extensions to install hypervisors without run-time firmware
          use of this feature.  Refer to Documentation/arm/Booting for
          details.
  
 -        It is safe to enable this option even if the kernel may not be
 -        booted in HYP mode, may not have support for the
 -        virtualization extensions, or may be booted with a
 -        non-compliant bootloader.
 -
  config SWP_EMULATE
        bool "Emulate SWP/SWPB instructions"
        depends on !CPU_USE_DOMAINS && CPU_V7
diff --combined arch/arm/mm/alignment.c
@@@ -749,6 -749,7 +749,6 @@@ do_alignment(unsigned long addr, unsign
        unsigned long instr = 0, instrptr;
        int (*handler)(unsigned long addr, unsigned long instr, struct pt_regs *regs);
        unsigned int type;
 -      mm_segment_t fs;
        unsigned int fault;
        u16 tinstr = 0;
        int isize = 4;
  
        instrptr = instruction_pointer(regs);
  
 -      fs = get_fs();
 -      set_fs(KERNEL_DS);
        if (thumb_mode(regs)) {
 -              fault = __get_user(tinstr, (u16 *)(instrptr & ~1));
 +              u16 *ptr = (u16 *)(instrptr & ~1);
 +              fault = probe_kernel_address(ptr, tinstr);
                if (!fault) {
                        if (cpu_architecture() >= CPU_ARCH_ARMv7 &&
                            IS_T32(tinstr)) {
                                /* Thumb-2 32-bit */
                                u16 tinst2 = 0;
 -                              fault = __get_user(tinst2, (u16 *)(instrptr+2));
 +                              fault = probe_kernel_address(ptr + 1, tinst2);
                                instr = (tinstr << 16) | tinst2;
                                thumb2_32b = 1;
                        } else {
                        }
                }
        } else
 -              fault = __get_user(instr, (u32 *)instrptr);
 -      set_fs(fs);
 +              fault = probe_kernel_address(instrptr, instr);
  
        if (fault) {
                type = TYPE_FAULT;
@@@ -961,12 -964,14 +961,14 @@@ static int __init alignment_init(void
                return -ENOMEM;
  #endif
  
+ #ifdef CONFIG_CPU_CP15
        if (cpu_is_v6_unaligned()) {
                cr_alignment &= ~CR_A;
                cr_no_alignment &= ~CR_A;
                set_cr(cr_alignment);
                ai_usermode = safe_usermode(ai_usermode, false);
        }
+ #endif
  
        hook_fault_code(FAULT_CODE_ALIGNMENT, do_alignment, SIGBUS, BUS_ADRALN,
                        "alignment exception");
diff --combined arch/arm/mm/mmu.c
@@@ -57,9 -57,6 +57,9 @@@ static unsigned int cachepolicy __initd
  static unsigned int ecc_mask __initdata = 0;
  pgprot_t pgprot_user;
  pgprot_t pgprot_kernel;
 +pgprot_t pgprot_hyp_device;
 +pgprot_t pgprot_s2;
 +pgprot_t pgprot_s2_device;
  
  EXPORT_SYMBOL(pgprot_user);
  EXPORT_SYMBOL(pgprot_kernel);
@@@ -69,49 -66,38 +69,50 @@@ struct cachepolicy 
        unsigned int    cr_mask;
        pmdval_t        pmd;
        pteval_t        pte;
 +      pteval_t        pte_s2;
  };
  
 +#ifdef CONFIG_ARM_LPAE
 +#define s2_policy(policy)     policy
 +#else
 +#define s2_policy(policy)     0
 +#endif
 +
  static struct cachepolicy cache_policies[] __initdata = {
        {
                .policy         = "uncached",
                .cr_mask        = CR_W|CR_C,
                .pmd            = PMD_SECT_UNCACHED,
                .pte            = L_PTE_MT_UNCACHED,
 +              .pte_s2         = s2_policy(L_PTE_S2_MT_UNCACHED),
        }, {
                .policy         = "buffered",
                .cr_mask        = CR_C,
                .pmd            = PMD_SECT_BUFFERED,
                .pte            = L_PTE_MT_BUFFERABLE,
 +              .pte_s2         = s2_policy(L_PTE_S2_MT_UNCACHED),
        }, {
                .policy         = "writethrough",
                .cr_mask        = 0,
                .pmd            = PMD_SECT_WT,
                .pte            = L_PTE_MT_WRITETHROUGH,
 +              .pte_s2         = s2_policy(L_PTE_S2_MT_WRITETHROUGH),
        }, {
                .policy         = "writeback",
                .cr_mask        = 0,
                .pmd            = PMD_SECT_WB,
                .pte            = L_PTE_MT_WRITEBACK,
 +              .pte_s2         = s2_policy(L_PTE_S2_MT_WRITEBACK),
        }, {
                .policy         = "writealloc",
                .cr_mask        = 0,
                .pmd            = PMD_SECT_WBWA,
                .pte            = L_PTE_MT_WRITEALLOC,
 +              .pte_s2         = s2_policy(L_PTE_S2_MT_WRITEBACK),
        }
  };
  
+ #ifdef CONFIG_CPU_CP15
  /*
   * These are useful for identifying cache coherency
   * problems by allowing the cache or the cache and
@@@ -210,6 -196,22 +211,22 @@@ void adjust_cr(unsigned long mask, unsi
  }
  #endif
  
+ #else /* ifdef CONFIG_CPU_CP15 */
+ static int __init early_cachepolicy(char *p)
+ {
+       pr_warning("cachepolicy kernel parameter not supported without cp15\n");
+ }
+ early_param("cachepolicy", early_cachepolicy);
+ static int __init noalign_setup(char *__unused)
+ {
+       pr_warning("noalign kernel parameter not supported without cp15\n");
+ }
+ __setup("noalign", noalign_setup);
+ #endif /* ifdef CONFIG_CPU_CP15 / else */
  #define PROT_PTE_DEVICE               L_PTE_PRESENT|L_PTE_YOUNG|L_PTE_DIRTY|L_PTE_XN
  #define PROT_SECT_DEVICE      PMD_TYPE_SECT|PMD_SECT_AP_WRITE
  
@@@ -325,7 -327,6 +342,7 @@@ static void __init build_mem_type_table
        struct cachepolicy *cp;
        unsigned int cr = get_cr();
        pteval_t user_pgprot, kern_pgprot, vecs_pgprot;
 +      pteval_t hyp_device_pgprot, s2_pgprot, s2_device_pgprot;
        int cpu_arch = cpu_architecture();
        int i;
  
         */
        cp = &cache_policies[cachepolicy];
        vecs_pgprot = kern_pgprot = user_pgprot = cp->pte;
 +      s2_pgprot = cp->pte_s2;
 +      hyp_device_pgprot = s2_device_pgprot = mem_types[MT_DEVICE].prot_pte;
  
        /*
         * ARMv6 and above have extended page tables.
                        user_pgprot |= L_PTE_SHARED;
                        kern_pgprot |= L_PTE_SHARED;
                        vecs_pgprot |= L_PTE_SHARED;
 +                      s2_pgprot |= L_PTE_SHARED;
                        mem_types[MT_DEVICE_WC].prot_sect |= PMD_SECT_S;
                        mem_types[MT_DEVICE_WC].prot_pte |= L_PTE_SHARED;
                        mem_types[MT_DEVICE_CACHED].prot_sect |= PMD_SECT_S;
        pgprot_user   = __pgprot(L_PTE_PRESENT | L_PTE_YOUNG | user_pgprot);
        pgprot_kernel = __pgprot(L_PTE_PRESENT | L_PTE_YOUNG |
                                 L_PTE_DIRTY | kern_pgprot);
 +      pgprot_s2  = __pgprot(L_PTE_PRESENT | L_PTE_YOUNG | s2_pgprot);
 +      pgprot_s2_device  = __pgprot(s2_device_pgprot);
 +      pgprot_hyp_device  = __pgprot(hyp_device_pgprot);
  
        mem_types[MT_LOW_VECTORS].prot_l1 |= ecc_mask;
        mem_types[MT_HIGH_VECTORS].prot_l1 |= ecc_mask;
@@@ -779,24 -774,21 +796,24 @@@ void __init iotable_init(struct map_des
  {
        struct map_desc *md;
        struct vm_struct *vm;
 +      struct static_vm *svm;
  
        if (!nr)
                return;
  
 -      vm = early_alloc_aligned(sizeof(*vm) * nr, __alignof__(*vm));
 +      svm = early_alloc_aligned(sizeof(*svm) * nr, __alignof__(*svm));
  
        for (md = io_desc; nr; md++, nr--) {
                create_mapping(md);
 +
 +              vm = &svm->vm;
                vm->addr = (void *)(md->virtual & PAGE_MASK);
                vm->size = PAGE_ALIGN(md->length + (md->virtual & ~PAGE_MASK));
                vm->phys_addr = __pfn_to_phys(md->pfn);
                vm->flags = VM_IOREMAP | VM_ARM_STATIC_MAPPING;
                vm->flags |= VM_ARM_MTYPE(md->type);
                vm->caller = iotable_init;
 -              vm_area_add_early(vm++);
 +              add_static_vm_early(svm++);
        }
  }
  
@@@ -804,16 -796,13 +821,16 @@@ void __init vm_reserve_area_early(unsig
                                  void *caller)
  {
        struct vm_struct *vm;
 +      struct static_vm *svm;
 +
 +      svm = early_alloc_aligned(sizeof(*svm), __alignof__(*svm));
  
 -      vm = early_alloc_aligned(sizeof(*vm), __alignof__(*vm));
 +      vm = &svm->vm;
        vm->addr = (void *)addr;
        vm->size = size;
        vm->flags = VM_IOREMAP | VM_ARM_EMPTY_MAPPING;
        vm->caller = caller;
 -      vm_area_add_early(vm);
 +      add_static_vm_early(svm);
  }
  
  #ifndef CONFIG_ARM_LPAE
@@@ -838,13 -827,14 +855,13 @@@ static void __init pmd_empty_section_ga
  
  static void __init fill_pmd_gaps(void)
  {
 +      struct static_vm *svm;
        struct vm_struct *vm;
        unsigned long addr, next = 0;
        pmd_t *pmd;
  
 -      /* we're still single threaded hence no lock needed here */
 -      for (vm = vmlist; vm; vm = vm->next) {
 -              if (!(vm->flags & (VM_ARM_STATIC_MAPPING | VM_ARM_EMPTY_MAPPING)))
 -                      continue;
 +      list_for_each_entry(svm, &static_vmlist, list) {
 +              vm = &svm->vm;
                addr = (unsigned long)vm->addr;
                if (addr < next)
                        continue;
  #if defined(CONFIG_PCI) && !defined(CONFIG_NEED_MACH_IO_H)
  static void __init pci_reserve_io(void)
  {
 -      struct vm_struct *vm;
 -      unsigned long addr;
 +      struct static_vm *svm;
  
 -      /* we're still single threaded hence no lock needed here */
 -      for (vm = vmlist; vm; vm = vm->next) {
 -              if (!(vm->flags & VM_ARM_STATIC_MAPPING))
 -                      continue;
 -              addr = (unsigned long)vm->addr;
 -              addr &= ~(SZ_2M - 1);
 -              if (addr == PCI_IO_VIRT_BASE)
 -                      return;
 +      svm = find_static_vm_vaddr((void *)PCI_IO_VIRT_BASE);
 +      if (svm)
 +              return;
  
 -      }
        vm_reserve_area_early(PCI_IO_VIRT_BASE, SZ_2M, pci_reserve_io);
  }
  #else