2010-02-22 09:46:23 +08:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2002 ARM Ltd.
|
|
|
|
* All Rights Reserved
|
2013-02-14 01:15:48 +08:00
|
|
|
* Copyright (c) 2010, 2012-2013, NVIDIA Corporation. All rights reserved.
|
2010-02-22 09:46:23 +08:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
|
|
* published by the Free Software Foundation.
|
|
|
|
*/
|
|
|
|
#include <linux/kernel.h>
|
|
|
|
#include <linux/smp.h>
|
2013-01-11 15:46:21 +08:00
|
|
|
#include <linux/clk/tegra.h>
|
2010-02-22 09:46:23 +08:00
|
|
|
|
2012-08-16 17:31:51 +08:00
|
|
|
#include <asm/smp_plat.h>
|
2010-02-22 09:46:23 +08:00
|
|
|
|
2013-02-14 01:15:48 +08:00
|
|
|
#include "fuse.h"
|
2012-08-16 17:31:51 +08:00
|
|
|
#include "sleep.h"
|
2010-02-22 09:46:23 +08:00
|
|
|
|
2012-08-16 17:31:51 +08:00
|
|
|
static void (*tegra_hotplug_shutdown)(void);
|
2010-02-22 09:46:23 +08:00
|
|
|
|
2013-01-03 14:43:00 +08:00
|
|
|
int tegra_cpu_kill(unsigned cpu)
|
|
|
|
{
|
|
|
|
cpu = cpu_logical_map(cpu);
|
|
|
|
|
|
|
|
/* Clock gate the CPU */
|
|
|
|
tegra_wait_cpu_in_reset(cpu);
|
|
|
|
tegra_disable_cpu_clock(cpu);
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2010-02-22 09:46:23 +08:00
|
|
|
/*
|
|
|
|
* platform-specific code to shutdown a CPU
|
|
|
|
*
|
|
|
|
* Called with IRQs disabled
|
|
|
|
*/
|
2011-09-08 20:15:22 +08:00
|
|
|
void __ref tegra_cpu_die(unsigned int cpu)
|
2010-02-22 09:46:23 +08:00
|
|
|
{
|
2013-01-03 14:42:59 +08:00
|
|
|
/* Clean L1 data cache */
|
|
|
|
tegra_disable_clean_inv_dcache();
|
2010-02-22 09:46:23 +08:00
|
|
|
|
2012-08-16 17:31:51 +08:00
|
|
|
/* Shut down the current CPU. */
|
|
|
|
tegra_hotplug_shutdown();
|
|
|
|
|
|
|
|
/* Should never return here. */
|
|
|
|
BUG();
|
2010-02-22 09:46:23 +08:00
|
|
|
}
|
|
|
|
|
2013-02-14 01:15:48 +08:00
|
|
|
void __init tegra_hotplug_init(void)
|
2012-08-16 17:31:52 +08:00
|
|
|
{
|
2013-02-14 01:15:48 +08:00
|
|
|
if (!IS_ENABLED(CONFIG_HOTPLUG_CPU))
|
|
|
|
return;
|
2012-08-16 17:31:52 +08:00
|
|
|
|
2013-02-14 01:15:48 +08:00
|
|
|
if (IS_ENABLED(CONFIG_ARCH_TEGRA_2x_SOC) && tegra_chip_id == TEGRA20)
|
|
|
|
tegra_hotplug_shutdown = tegra20_hotplug_shutdown;
|
|
|
|
if (IS_ENABLED(CONFIG_ARCH_TEGRA_3x_SOC) && tegra_chip_id == TEGRA30)
|
|
|
|
tegra_hotplug_shutdown = tegra30_hotplug_shutdown;
|
2012-08-16 17:31:51 +08:00
|
|
|
}
|