hotplug.c 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. *
  3. * Copyright (C) 2002 ARM Ltd.
  4. * All Rights Reserved
  5. * Copyright (c) 2010, 2012 NVIDIA Corporation. All rights reserved.
  6. *
  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.
  10. */
  11. #include <linux/kernel.h>
  12. #include <linux/smp.h>
  13. #include <linux/clk/tegra.h>
  14. #include <asm/cacheflush.h>
  15. #include <asm/smp_plat.h>
  16. #include "sleep.h"
  17. static void (*tegra_hotplug_shutdown)(void);
  18. int tegra_cpu_kill(unsigned cpu)
  19. {
  20. cpu = cpu_logical_map(cpu);
  21. /* Clock gate the CPU */
  22. tegra_wait_cpu_in_reset(cpu);
  23. tegra_disable_cpu_clock(cpu);
  24. return 1;
  25. }
  26. /*
  27. * platform-specific code to shutdown a CPU
  28. *
  29. * Called with IRQs disabled
  30. */
  31. void __ref tegra_cpu_die(unsigned int cpu)
  32. {
  33. /* Clean L1 data cache */
  34. tegra_disable_clean_inv_dcache();
  35. /* Shut down the current CPU. */
  36. tegra_hotplug_shutdown();
  37. /* Should never return here. */
  38. BUG();
  39. }
  40. #ifdef CONFIG_ARCH_TEGRA_2x_SOC
  41. extern void tegra20_hotplug_shutdown(void);
  42. void __init tegra20_hotplug_init(void)
  43. {
  44. tegra_hotplug_shutdown = tegra20_hotplug_shutdown;
  45. }
  46. #endif
  47. #ifdef CONFIG_ARCH_TEGRA_3x_SOC
  48. extern void tegra30_hotplug_shutdown(void);
  49. void __init tegra30_hotplug_init(void)
  50. {
  51. tegra_hotplug_shutdown = tegra30_hotplug_shutdown;
  52. }
  53. #endif