hotplug.c 786 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * Copyright (C) STMicroelectronics 2009
  3. * Copyright (C) ST-Ericsson SA 2010
  4. *
  5. * License Terms: GNU General Public License v2
  6. * Based on ARM realview platform
  7. *
  8. * Author: Sundar Iyer <sundar.iyer@stericsson.com>
  9. *
  10. */
  11. #include <linux/kernel.h>
  12. #include <linux/errno.h>
  13. #include <linux/smp.h>
  14. #include <asm/cacheflush.h>
  15. #include <asm/smp_plat.h>
  16. #include <mach/setup.h>
  17. /*
  18. * platform-specific code to shutdown a CPU
  19. *
  20. * Called with IRQs disabled
  21. */
  22. void __ref ux500_cpu_die(unsigned int cpu)
  23. {
  24. flush_cache_all();
  25. /* directly enter low power state, skipping secure registers */
  26. for (;;) {
  27. __asm__ __volatile__("dsb\n\t" "wfi\n\t"
  28. : : : "memory");
  29. if (pen_release == cpu_logical_map(cpu)) {
  30. /*
  31. * OK, proper wakeup, we're done
  32. */
  33. break;
  34. }
  35. }
  36. }