hotplug.c 783 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * CPU hotplug support for CSR Marco dual-core SMP SoCs
  3. *
  4. * Copyright (c) 2012 Cambridge Silicon Radio Limited, a CSR plc group company.
  5. *
  6. * Licensed under GPLv2 or later.
  7. */
  8. #include <linux/kernel.h>
  9. #include <linux/errno.h>
  10. #include <linux/smp.h>
  11. #include <asm/cacheflush.h>
  12. #include <asm/smp_plat.h>
  13. static inline void platform_do_lowpower(unsigned int cpu)
  14. {
  15. flush_cache_all();
  16. /* we put the platform to just WFI */
  17. for (;;) {
  18. __asm__ __volatile__("dsb\n\t" "wfi\n\t"
  19. : : : "memory");
  20. if (pen_release == cpu_logical_map(cpu)) {
  21. /*
  22. * OK, proper wakeup, we're done
  23. */
  24. break;
  25. }
  26. }
  27. }
  28. /*
  29. * platform-specific code to shutdown a CPU
  30. *
  31. * Called with IRQs disabled
  32. */
  33. void __ref sirfsoc_cpu_die(unsigned int cpu)
  34. {
  35. platform_do_lowpower(cpu);
  36. }