summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-tegra/sleep.h
diff options
context:
space:
mode:
authorJoseph Lo <josephl@nvidia.com>2012-08-16 17:31:51 +0800
committerStephen Warren <swarren@nvidia.com>2012-09-13 11:41:06 -0600
commit59b0f6825c15d24859e22b1024440ae2a094983e (patch)
treec0bfc0ebe5a4fc58318eb3a5045287fe452965fc /arch/arm/mach-tegra/sleep.h
parentc2be5bfcc986e688c0c9b427b9fb33be178437d8 (diff)
downloadop-kernel-dev-59b0f6825c15d24859e22b1024440ae2a094983e.zip
op-kernel-dev-59b0f6825c15d24859e22b1024440ae2a094983e.tar.gz
ARM: tegra30: add CPU hotplug support
Hotplug function put CPUs in offline or online state at runtime. When the CPU been put in the offline state, it was been clock and power gated. Except primary CPU other CPUs can be hotplugged. Based on the work by: Scott Williams <scwilliams@nvidia.com> Colin Cross <ccross@android.com> Gary King <gking@nvidia.com> Signed-off-by: Joseph Lo <josephl@nvidia.com> Signed-off-by: Stephen Warren <swarren@nvidia.com>
Diffstat (limited to 'arch/arm/mach-tegra/sleep.h')
-rw-r--r--arch/arm/mach-tegra/sleep.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/sleep.h b/arch/arm/mach-tegra/sleep.h
index d0c7a8b..0f047eb 100644
--- a/arch/arm/mach-tegra/sleep.h
+++ b/arch/arm/mach-tegra/sleep.h
@@ -19,6 +19,8 @@
#include <mach/iomap.h>
+#define TEGRA_ARM_PERIF_VIRT (TEGRA_ARM_PERIF_BASE - IO_CPU_PHYS \
+ + IO_CPU_VIRT)
#define TEGRA_FLOW_CTRL_VIRT (TEGRA_FLOW_CTRL_BASE - IO_PPSB_PHYS \
+ IO_PPSB_VIRT)
@@ -52,5 +54,28 @@
movw \reg, #:lower16:\val
movt \reg, #:upper16:\val
.endm
+
+/* Macro to exit SMP coherency. */
+.macro exit_smp, tmp1, tmp2
+ mrc p15, 0, \tmp1, c1, c0, 1 @ ACTLR
+ bic \tmp1, \tmp1, #(1<<6) | (1<<0) @ clear ACTLR.SMP | ACTLR.FW
+ mcr p15, 0, \tmp1, c1, c0, 1 @ ACTLR
+ isb
+ cpu_id \tmp1
+ mov \tmp1, \tmp1, lsl #2
+ mov \tmp2, #0xf
+ mov \tmp2, \tmp2, lsl \tmp1
+ mov32 \tmp1, TEGRA_ARM_PERIF_VIRT + 0xC
+ str \tmp2, [\tmp1] @ invalidate SCU tags for CPU
+ dsb
+.endm
+#else
+
+#ifdef CONFIG_HOTPLUG_CPU
+void tegra30_hotplug_init(void);
+#else
+static inline void tegra30_hotplug_init(void) {}
+#endif
+
#endif
#endif
OpenPOWER on IntegriCloud