Merge tag '3.10-rc2-psci-ops-11-tag' of git://git.kernel.org/pub/scm/linux/kernel...
authorRussell King <rmk+kernel@arm.linux.org.uk>
Wed, 22 May 2013 09:52:32 +0000 (10:52 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Wed, 22 May 2013 09:53:20 +0000 (10:53 +0100)
Pull psci_smp_ops support from Stefano Stabellini:
It contains the generic PSCI patch and the smp_init patch that we
discussed so much about.  I think it would be helpful for other
people if you could create a stable branch with these patches so
that SoC devs can base their work on it.

1  2 
arch/arm/kernel/Makefile
arch/arm/kernel/setup.c

diff --combined arch/arm/kernel/Makefile
@@@ -15,7 -15,7 +15,7 @@@ CFLAGS_REMOVE_return_address.o = -p
  
  # Object file lists.
  
 -obj-y         := elf.o entry-armv.o entry-common.o irq.o opcodes.o \
 +obj-y         := elf.o entry-common.o irq.o opcodes.o \
                   process.o ptrace.o return_address.o sched_clock.o \
                   setup.o signal.o stacktrace.o sys_arm.o time.o traps.o
  
@@@ -23,12 -23,6 +23,12 @@@ obj-$(CONFIG_ATAGS)         += atags_parse.
  obj-$(CONFIG_ATAGS_PROC)      += atags_proc.o
  obj-$(CONFIG_DEPRECATED_PARAM_STRUCT) += atags_compat.o
  
 +ifeq ($(CONFIG_CPU_V7M),y)
 +obj-y         += entry-v7m.o
 +else
 +obj-y         += entry-armv.o
 +endif
 +
  obj-$(CONFIG_OC_ETM)          += etm.o
  obj-$(CONFIG_CPU_IDLE)                += cpuidle.o
  obj-$(CONFIG_ISA_DMA_API)     += dma.o
@@@ -88,6 -82,9 +88,9 @@@ obj-$(CONFIG_DEBUG_LL)        += debug.
  obj-$(CONFIG_EARLY_PRINTK)    += early_printk.o
  
  obj-$(CONFIG_ARM_VIRT_EXT)    += hyp-stub.o
- obj-$(CONFIG_ARM_PSCI)                += psci.o
+ ifeq ($(CONFIG_ARM_PSCI),y)
+ obj-y                         += psci.o
+ obj-$(CONFIG_SMP)             += psci_smp.o
+ endif
  
  extra-y := $(head-y) vmlinux.lds
diff --combined arch/arm/kernel/setup.c
@@@ -37,6 -37,7 +37,7 @@@
  #include <asm/cputype.h>
  #include <asm/elf.h>
  #include <asm/procinfo.h>
+ #include <asm/psci.h>
  #include <asm/sections.h>
  #include <asm/setup.h>
  #include <asm/smp_plat.h>
@@@ -128,9 -129,7 +129,9 @@@ struct stack 
        u32 und[3];
  } ____cacheline_aligned;
  
 +#ifndef CONFIG_CPU_V7M
  static struct stack stacks[NR_CPUS];
 +#endif
  
  char elf_platform[ELF_PLATFORM_SIZE];
  EXPORT_SYMBOL(elf_platform);
@@@ -209,7 -208,7 +210,7 @@@ static const char *proc_arch[] = 
        "5TEJ",
        "6TEJ",
        "7",
 -      "?(11)",
 +      "7M",
        "?(12)",
        "?(13)",
        "?(14)",
        "?(17)",
  };
  
 +#ifdef CONFIG_CPU_V7M
 +static int __get_cpu_architecture(void)
 +{
 +      return CPU_ARCH_ARMv7M;
 +}
 +#else
  static int __get_cpu_architecture(void)
  {
        int cpu_arch;
  
        return cpu_arch;
  }
 +#endif
  
  int __pure cpu_architecture(void)
  {
@@@ -302,9 -294,7 +303,9 @@@ static void __init cacheid_init(void
  {
        unsigned int arch = cpu_architecture();
  
 -      if (arch >= CPU_ARCH_ARMv6) {
 +      if (arch == CPU_ARCH_ARMv7M) {
 +              cacheid = 0;
 +      } else if (arch >= CPU_ARCH_ARMv6) {
                unsigned int cachetype = read_cpuid_cachetype();
                if ((cachetype & (7 << 29)) == 4 << 29) {
                        /* ARMv7 register format */
@@@ -403,7 -393,6 +404,7 @@@ static void __init feat_v6_fixup(void
   */
  void notrace cpu_init(void)
  {
 +#ifndef CONFIG_CPU_V7M
        unsigned int cpu = smp_processor_id();
        struct stack *stk = &stacks[cpu];
  
              "I" (offsetof(struct stack, und[0])),
              PLC (PSR_F_BIT | PSR_I_BIT | SVC_MODE)
            : "r14");
 +#endif
  }
  
  int __cpu_logical_map[NR_CPUS];
@@@ -809,9 -797,15 +810,15 @@@ void __init setup_arch(char **cmdline_p
        unflatten_device_tree();
  
        arm_dt_init_cpu_maps();
+       psci_init();
  #ifdef CONFIG_SMP
        if (is_smp()) {
-               smp_set_ops(mdesc->smp);
+               if (!mdesc->smp_init || !mdesc->smp_init()) {
+                       if (psci_smp_available())
+                               smp_set_ops(&psci_smp_ops);
+                       else if (mdesc->smp)
+                               smp_set_ops(mdesc->smp);
+               }
                smp_init_cpus();
        }
  #endif