hotplug.c 985 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * Copyright 2011 Freescale Semiconductor, Inc.
  3. * Copyright 2011 Linaro Ltd.
  4. *
  5. * The code contained herein is licensed under the GNU General Public
  6. * License. You may obtain a copy of the GNU General Public License
  7. * Version 2 or later at the following locations:
  8. *
  9. * http://www.opensource.org/licenses/gpl-license.html
  10. * http://www.gnu.org/copyleft/gpl.html
  11. */
  12. #include <linux/errno.h>
  13. #include <asm/cacheflush.h>
  14. #include <mach/common.h>
  15. int platform_cpu_kill(unsigned int cpu)
  16. {
  17. return 1;
  18. }
  19. /*
  20. * platform-specific code to shutdown a CPU
  21. *
  22. * Called with IRQs disabled
  23. */
  24. void platform_cpu_die(unsigned int cpu)
  25. {
  26. flush_cache_all();
  27. imx_enable_cpu(cpu, false);
  28. cpu_do_idle();
  29. /* We should never return from idle */
  30. panic("cpu %d unexpectedly exit from shutdown\n", cpu);
  31. }
  32. int platform_cpu_disable(unsigned int cpu)
  33. {
  34. /*
  35. * we don't allow CPU 0 to be shutdown (it is still too special
  36. * e.g. clock tick interrupts)
  37. */
  38. return cpu == 0 ? -EPERM : 0;
  39. }