ARM: tegra: Add Tegra 3 CPU hotplug support
Scott Williams [Thu, 21 Jul 2011 20:20:20 +0000 (13:20 -0700)]
Change-Id: Ie43f4efdf884a916c6bc9737157091c35dc44501
Signed-off-by: Scott Williams <scwilliams@nvidia.com>
DW: Split into logical changes
Signed-off-by: Dan Willemsen <dwillemsen@nvidia.com>

Rebase-Id: R1f023651504a7d336f7e98921f6372bee0aa1341

arch/arm/mach-tegra/hotplug.c
arch/arm/mach-tegra/sleep-t30.S

index 8a02bc4..682e0ea 100644 (file)
@@ -16,6 +16,7 @@
 #include <asm/cacheflush.h>
 #include <asm/smp_plat.h>
 
+#include "gic.h"
 #include "sleep.h"
 
 static void (*tegra_hotplug_shutdown)(void);
@@ -43,6 +44,17 @@ void tegra_cpu_die(unsigned int cpu)
        /* Flush the L1 data cache. */
        flush_cache_all();
 
+#ifndef CONFIG_ARCH_TEGRA_2x_SOC
+       /* Disable GIC CPU interface for this CPU. */
+       tegra_gic_cpu_disable();
+
+       /* Tegra3 enters LPx states via WFI - do not propagate legacy IRQs
+          to CPU core to avoid fall through WFI; then GIC output will be
+          enabled, however at this time - CPU is dying - no interrupt should
+          have affinity to this CPU. */
+       tegra_gic_pass_through_disable();
+#endif
+
        /* Shut down the current CPU. */
        tegra_hotplug_shutdown();
 
index be7614b..8663afd 100644 (file)
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include <linux/const.h>
+#include <linux/init.h>
 #include <linux/linkage.h>
 
 #include <asm/assembler.h>
+#include <asm/cache.h>
+#include <asm/domain.h>
+#include <asm/memory.h>
+#include <asm/page.h>
+#include <asm/ptrace.h>
+#include <asm/asm-offsets.h>
+#include <asm/glue-cache.h>
+#include <asm/glue-proc.h>
+#include <asm/cp15.h>
 
 #include "sleep.h"
 #include "flowctrl.h"
@@ -80,6 +91,7 @@ delay_1:
        ldr     r3, [r1]                        @ read CSR
        str     r3, [r1]                        @ clear CSR
        tst     r0, #TEGRA30_POWER_HOTPLUG_SHUTDOWN
+       moveq   r3, #FLOW_CTRL_WAIT_FOR_INTERRUPT       @ For LP2
        movne   r3, #FLOW_CTRL_WAITEVENT                @ For hotplug
        str     r3, [r2]
        ldr     r0, [r2]