]> rtime.felk.cvut.cz Git - zynq/linux.git/commitdiff
arm: zynq: Sychronization hotplug code with mainline
authorMichal Simek <michal.simek@xilinx.com>
Wed, 20 Mar 2013 12:56:15 +0000 (13:56 +0100)
committerMichal Simek <michal.simek@xilinx.com>
Fri, 23 Aug 2013 12:51:37 +0000 (14:51 +0200)
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
arch/arm/mach-zynq/Makefile
arch/arm/mach-zynq/common.h
arch/arm/mach-zynq/hotplug.c
arch/arm/mach-zynq/platsmp.c

index ae8031092289f2fd436b3c7b725efed9b4674e43..b50834d839c8ce0efcf8959300a61bb90fa779d5 100644 (file)
@@ -6,8 +6,10 @@
 obj-y                          := common.o timer.o slcr.o
 
 obj-$(CONFIG_CPU_IDLE)                 += cpuidle.o
-obj-$(CONFIG_HOTPLUG_CPU)      += hotplug.o
 obj-$(CONFIG_PCI_MSI)           += xaxipcie-msi.o
+CFLAGS_REMOVE_hotplug.o                =-march=armv6k
+CFLAGS_hotplug.o               =-Wa,-march=armv7-a -mcpu=cortex-a9
+obj-$(CONFIG_HOTPLUG_CPU)      += hotplug.o
 obj-$(CONFIG_SMP)              += headsmp.o platsmp.o
 obj-$(CONFIG_SUSPEND)          += pm.o suspend.o
 obj-$(CONFIG_XILINX_AXIPCIE)    += xaxipcie.o
index 07833cb5911ea6cef323ce8c2415cc0dad16fd3d..e520ef9df1219329019b8ef8c7594e717d286314 100644 (file)
@@ -44,6 +44,9 @@ extern void xslcr_init_postload_fpga(void);
 extern void __iomem *zynq_slcr_base;
 extern void __iomem *scu_base;
 
+/* Hotplug */
+extern void zynq_platform_cpu_die(unsigned int cpu);
+
 #ifdef CONFIG_SUSPEND
 int zynq_pm_late_init(void);
 #else
@@ -56,8 +59,6 @@ static inline int zynq_pm_late_init(void)
 extern unsigned int zynq_sys_suspend_sz;
 int zynq_sys_suspend(void __iomem *ddrc_base, void __iomem *slcr_base);
 
-extern void platform_cpu_die(unsigned int cpu);
-
 #define IRQ_XILINX_MSI_0       128
 
 #endif
index 22b1084212a70e0994f4c9da0eeeecc5801493db..c89672bd1de266eefc52fd42a48d082cc7d17e70 100644 (file)
@@ -1,8 +1,10 @@
 /*
- *  linux/arch/arm/mach-realview/hotplug.c
+ * Copyright (C) 2012-2013 Xilinx
  *
- *  Copyright (C) 2002 ARM Ltd.
- *  All Rights Reserved
+ * based on linux/arch/arm/mach-realview/hotplug.c
+ *
+ * Copyright (C) 2002 ARM Ltd.
+ * All Rights Reserved
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
@@ -14,8 +16,9 @@
 
 #include <asm/cacheflush.h>
 #include <asm/cp15.h>
+#include "common.h"
 
-static inline void cpu_enter_lowpower(void)
+static inline void zynq_cpu_enter_lowpower(void)
 {
        unsigned int v;
 
@@ -37,7 +40,7 @@ static inline void cpu_enter_lowpower(void)
          : "cc");
 }
 
-static inline void cpu_leave_lowpower(void)
+static inline void zynq_cpu_leave_lowpower(void)
 {
        unsigned int v;
 
@@ -53,7 +56,7 @@ static inline void cpu_leave_lowpower(void)
          : "cc");
 }
 
-static inline void platform_do_lowpower(unsigned int cpu, int *spurious)
+static inline void zynq_platform_do_lowpower(unsigned int cpu, int *spurious)
 {
        /*
         * there is no power-control hardware on this platform, so all
@@ -75,41 +78,27 @@ static inline void platform_do_lowpower(unsigned int cpu, int *spurious)
        }
 }
 
-int platform_cpu_kill(unsigned int cpu)
-{
-       return 1;
-}
-
 /*
  * platform-specific code to shutdown a CPU
  *
  * Called with IRQs disabled
  */
-void platform_cpu_die(unsigned int cpu)
+void zynq_platform_cpu_die(unsigned int cpu)
 {
        int spurious = 0;
 
        /*
         * we're ready for shutdown now, so do it
         */
-       cpu_enter_lowpower();
-       platform_do_lowpower(cpu, &spurious);
+       zynq_cpu_enter_lowpower();
+       zynq_platform_do_lowpower(cpu, &spurious);
 
        /*
         * bring this CPU back into the world of cache
         * coherency, and then restore interrupts
         */
-       cpu_leave_lowpower();
+       zynq_cpu_leave_lowpower();
 
        if (spurious)
                pr_warn("CPU%u: %u spurious wakeup calls\n", cpu, spurious);
 }
-
-int platform_cpu_disable(unsigned int cpu)
-{
-       /*
-        * we don't allow CPU 0 to be shutdown (it is still too special
-        * e.g. clock tick interrupts)
-        */
-       return cpu == 0 ? -EPERM : 0;
-}
index 3d7a63bb61147a4573e01562a716c70446d0f4e8..b7b9cfa6055f810104a597faddb53a59e0c411ee 100644 (file)
@@ -149,6 +149,6 @@ struct smp_operations zynq_smp_ops __initdata = {
        .smp_secondary_init     = zynq_secondary_init,
        .smp_boot_secondary     = zynq_boot_secondary,
 #ifdef CONFIG_HOTPLUG_CPU
-       .cpu_die                = platform_cpu_die,
+       .cpu_die                = zynq_platform_cpu_die,
 #endif
 };