3 * Copyright (C) 2002 ARM Ltd.
5 * Copyright (c) 2010, 2012 NVIDIA Corporation. All rights reserved.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
11 #include <linux/kernel.h>
12 #include <linux/smp.h>
13 #include <linux/clk/tegra.h>
15 #include <asm/cacheflush.h>
16 #include <asm/smp_plat.h>
20 static void (*tegra_hotplug_shutdown)(void);
22 int tegra_cpu_kill(unsigned cpu)
24 cpu = cpu_logical_map(cpu);
26 /* Clock gate the CPU */
27 tegra_wait_cpu_in_reset(cpu);
28 tegra_disable_cpu_clock(cpu);
34 * platform-specific code to shutdown a CPU
36 * Called with IRQs disabled
38 void __ref tegra_cpu_die(unsigned int cpu)
40 /* Clean L1 data cache */
41 tegra_disable_clean_inv_dcache();
43 /* Shut down the current CPU. */
44 tegra_hotplug_shutdown();
46 /* Should never return here. */
50 int tegra_cpu_disable(unsigned int cpu)
53 * we don't allow CPU 0 to be shutdown (it is still too special
54 * e.g. clock tick interrupts)
56 return cpu == 0 ? -EPERM : 0;
59 #ifdef CONFIG_ARCH_TEGRA_2x_SOC
60 extern void tegra20_hotplug_shutdown(void);
61 void __init tegra20_hotplug_init(void)
63 tegra_hotplug_shutdown = tegra20_hotplug_shutdown;
67 #ifdef CONFIG_ARCH_TEGRA_3x_SOC
68 extern void tegra30_hotplug_shutdown(void);
69 void __init tegra30_hotplug_init(void)
71 tegra_hotplug_shutdown = tegra30_hotplug_shutdown;