x86/mm/pat: Don't report PAT on CPUs that don't support it
[linux/fpc-iii.git] / arch / arm / mach-tegra / hotplug.c
blob8ec70782607296ae8a61c49eae8ac3f154864134
1 /*
2 * Copyright (C) 2002 ARM Ltd.
3 * All Rights Reserved
4 * Copyright (c) 2010, 2012-2013, NVIDIA Corporation. All rights reserved.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
11 #include <linux/clk/tegra.h>
12 #include <linux/kernel.h>
13 #include <linux/smp.h>
15 #include <soc/tegra/common.h>
16 #include <soc/tegra/fuse.h>
18 #include <asm/smp_plat.h>
20 #include "common.h"
21 #include "sleep.h"
23 static void (*tegra_hotplug_shutdown)(void);
25 int tegra_cpu_kill(unsigned cpu)
27 cpu = cpu_logical_map(cpu);
29 /* Clock gate the CPU */
30 tegra_wait_cpu_in_reset(cpu);
31 tegra_disable_cpu_clock(cpu);
33 return 1;
37 * platform-specific code to shutdown a CPU
39 * Called with IRQs disabled
41 void tegra_cpu_die(unsigned int cpu)
43 if (!tegra_hotplug_shutdown) {
44 WARN(1, "hotplug is not yet initialized\n");
45 return;
48 /* Clean L1 data cache */
49 tegra_disable_clean_inv_dcache(TEGRA_FLUSH_CACHE_LOUIS);
51 /* Shut down the current CPU. */
52 tegra_hotplug_shutdown();
54 /* Should never return here. */
55 BUG();
58 static int __init tegra_hotplug_init(void)
60 if (!IS_ENABLED(CONFIG_HOTPLUG_CPU))
61 return 0;
63 if (!soc_is_tegra())
64 return 0;
66 if (IS_ENABLED(CONFIG_ARCH_TEGRA_2x_SOC) && tegra_get_chip_id() == TEGRA20)
67 tegra_hotplug_shutdown = tegra20_hotplug_shutdown;
68 if (IS_ENABLED(CONFIG_ARCH_TEGRA_3x_SOC) && tegra_get_chip_id() == TEGRA30)
69 tegra_hotplug_shutdown = tegra30_hotplug_shutdown;
70 if (IS_ENABLED(CONFIG_ARCH_TEGRA_114_SOC) && tegra_get_chip_id() == TEGRA114)
71 tegra_hotplug_shutdown = tegra30_hotplug_shutdown;
72 if (IS_ENABLED(CONFIG_ARCH_TEGRA_124_SOC) && tegra_get_chip_id() == TEGRA124)
73 tegra_hotplug_shutdown = tegra30_hotplug_shutdown;
75 return 0;
77 pure_initcall(tegra_hotplug_init);