]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - arch/powerpc/platforms/powernv/smp.c
Merge branch 'topic/xive' (early part) into next
[karo-tx-linux.git] / arch / powerpc / platforms / powernv / smp.c
index 914b456ef5510028c9ac2bb053088c88c5b5f5f7..39296bf7009e2d62c6df7635a0179068d4d18c2d 100644 (file)
@@ -29,6 +29,7 @@
 #include <asm/vdso_datapage.h>
 #include <asm/cputhreads.h>
 #include <asm/xics.h>
+#include <asm/xive.h>
 #include <asm/opal.h>
 #include <asm/runlatch.h>
 #include <asm/code-patching.h>
@@ -48,7 +49,9 @@
 
 static void pnv_smp_setup_cpu(int cpu)
 {
-       if (cpu != boot_cpuid)
+       if (xive_enabled())
+               xive_smp_setup_cpu();
+       else if (cpu != boot_cpuid)
                xics_setup_cpu();
 
 #ifdef CONFIG_PPC_DOORBELL
@@ -133,7 +136,10 @@ static int pnv_smp_cpu_disable(void)
        vdso_data->processorCount--;
        if (cpu == boot_cpuid)
                boot_cpuid = cpumask_any(cpu_online_mask);
-       xics_migrate_irqs_away();
+       if (xive_enabled())
+               xive_smp_disable_cpu();
+       else
+               xics_migrate_irqs_away();
        return 0;
 }
 
@@ -199,9 +205,12 @@ static void pnv_smp_cpu_kill_self(void)
                if (((srr1 & wmask) == SRR1_WAKEEE) ||
                    ((srr1 & wmask) == SRR1_WAKEHVI) ||
                    (local_paca->irq_happened & PACA_IRQ_EE)) {
-                       if (cpu_has_feature(CPU_FTR_ARCH_300))
-                               icp_opal_flush_interrupt();
-                       else
+                       if (cpu_has_feature(CPU_FTR_ARCH_300)) {
+                               if (xive_enabled())
+                                       xive_flush_interrupt();
+                               else
+                                       icp_opal_flush_interrupt();
+                       } else
                                icp_native_flush_interrupt();
                } else if ((srr1 & wmask) == SRR1_WAKEHDBELL) {
                        unsigned long msg = PPC_DBELL_TYPE(PPC_DBELL_SERVER);
@@ -238,10 +247,26 @@ static int pnv_cpu_bootable(unsigned int nr)
        return smp_generic_cpu_bootable(nr);
 }
 
+static int pnv_smp_prepare_cpu(int cpu)
+{
+       if (xive_enabled())
+               return xive_smp_prepare_cpu(cpu);
+       return 0;
+}
+
+static void __init pnv_smp_probe(void)
+{
+       if (xive_enabled())
+               xive_smp_probe();
+       else
+               xics_smp_probe();
+}
+
 static struct smp_ops_t pnv_smp_ops = {
        .message_pass   = smp_muxed_ipi_message_pass,
-       .cause_ipi      = NULL, /* Filled at runtime by xics_smp_probe() */
-       .probe          = xics_smp_probe,
+       .cause_ipi      = NULL, /* Filled at runtime by xi{cs,ve}_smp_probe() */
+       .probe          = pnv_smp_probe,
+       .prepare_cpu    = pnv_smp_prepare_cpu,
        .kick_cpu       = pnv_smp_kick_cpu,
        .setup_cpu      = pnv_smp_setup_cpu,
        .cpu_bootable   = pnv_cpu_bootable,