1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (C) 2002 ARM Ltd.
5 * Copyright (c) 2010, 2012-2013, NVIDIA Corporation. All rights reserved.
8 #include <linux/clk/tegra.h>
9 #include <linux/kernel.h>
10 #include <linux/smp.h>
12 #include <soc/tegra/common.h>
13 #include <soc/tegra/fuse.h>
15 #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 tegra_cpu_die(unsigned int cpu
)
40 if (!tegra_hotplug_shutdown
) {
41 WARN(1, "hotplug is not yet initialized\n");
45 /* Clean L1 data cache */
46 tegra_disable_clean_inv_dcache(TEGRA_FLUSH_CACHE_LOUIS
);
48 /* Shut down the current CPU. */
49 tegra_hotplug_shutdown();
51 /* Should never return here. */
55 static int __init
tegra_hotplug_init(void)
57 if (!IS_ENABLED(CONFIG_HOTPLUG_CPU
))
63 if (IS_ENABLED(CONFIG_ARCH_TEGRA_2x_SOC
) && tegra_get_chip_id() == TEGRA20
)
64 tegra_hotplug_shutdown
= tegra20_hotplug_shutdown
;
65 if (IS_ENABLED(CONFIG_ARCH_TEGRA_3x_SOC
) && tegra_get_chip_id() == TEGRA30
)
66 tegra_hotplug_shutdown
= tegra30_hotplug_shutdown
;
67 if (IS_ENABLED(CONFIG_ARCH_TEGRA_114_SOC
) && tegra_get_chip_id() == TEGRA114
)
68 tegra_hotplug_shutdown
= tegra30_hotplug_shutdown
;
69 if (IS_ENABLED(CONFIG_ARCH_TEGRA_124_SOC
) && tegra_get_chip_id() == TEGRA124
)
70 tegra_hotplug_shutdown
= tegra30_hotplug_shutdown
;
74 pure_initcall(tegra_hotplug_init
);