Merge tag 'rdma-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland...
[deliverable/linux.git] / arch / arm / mach-tegra / hotplug.c
CommitLineData
1cea7326 1/*
1cea7326
CC
2 * Copyright (C) 2002 ARM Ltd.
3 * All Rights Reserved
7469688e 4 * Copyright (c) 2010, 2012-2013, NVIDIA Corporation. All rights reserved.
1cea7326
CC
5 *
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 */
10#include <linux/kernel.h>
1cea7326 11#include <linux/smp.h>
89572c77 12#include <linux/clk/tegra.h>
1cea7326 13
59b0f682 14#include <asm/smp_plat.h>
1cea7326 15
7469688e 16#include "fuse.h"
59b0f682 17#include "sleep.h"
1cea7326 18
59b0f682 19static void (*tegra_hotplug_shutdown)(void);
1cea7326 20
b8119431
JL
21int tegra_cpu_kill(unsigned cpu)
22{
23 cpu = cpu_logical_map(cpu);
24
25 /* Clock gate the CPU */
26 tegra_wait_cpu_in_reset(cpu);
27 tegra_disable_cpu_clock(cpu);
28
29 return 1;
30}
31
1cea7326
CC
32/*
33 * platform-specific code to shutdown a CPU
34 *
35 * Called with IRQs disabled
36 */
a1725732 37void __ref tegra_cpu_die(unsigned int cpu)
1cea7326 38{
57886616 39 /* Clean L1 data cache */
ac2527bf 40 tegra_disable_clean_inv_dcache(TEGRA_FLUSH_CACHE_LOUIS);
1cea7326 41
59b0f682
JL
42 /* Shut down the current CPU. */
43 tegra_hotplug_shutdown();
44
59b0f682
JL
45 /* Should never return here. */
46 BUG();
1cea7326
CC
47}
48
7469688e 49void __init tegra_hotplug_init(void)
453689e4 50{
7469688e
HD
51 if (!IS_ENABLED(CONFIG_HOTPLUG_CPU))
52 return;
453689e4 53
7469688e
HD
54 if (IS_ENABLED(CONFIG_ARCH_TEGRA_2x_SOC) && tegra_chip_id == TEGRA20)
55 tegra_hotplug_shutdown = tegra20_hotplug_shutdown;
56 if (IS_ENABLED(CONFIG_ARCH_TEGRA_3x_SOC) && tegra_chip_id == TEGRA30)
57 tegra_hotplug_shutdown = tegra30_hotplug_shutdown;
33d5c019
JL
58 if (IS_ENABLED(CONFIG_ARCH_TEGRA_114_SOC) && tegra_chip_id == TEGRA114)
59 tegra_hotplug_shutdown = tegra30_hotplug_shutdown;
9997e626
JL
60 if (IS_ENABLED(CONFIG_ARCH_TEGRA_124_SOC) && tegra_chip_id == TEGRA124)
61 tegra_hotplug_shutdown = tegra30_hotplug_shutdown;
59b0f682 62}
This page took 0.20032 seconds and 5 git commands to generate.