hotplug.c 728 B

123456789101112131415161718192021222324252627282930313233343536373839
  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/smp_plat.h>
  12. static inline void platform_do_lowpower(unsigned int cpu)
  13. {
  14. /* we put the platform to just WFI */
  15. for (;;) {
  16. __asm__ __volatile__("dsb\n\t" "wfi\n\t"
  17. : : : "memory");
  18. if (pen_release == cpu_logical_map(cpu)) {
  19. /*
  20. * OK, proper wakeup, we're done
  21. */
  22. break;
  23. }
  24. }
  25. }
  26. /*
  27. * platform-specific code to shutdown a CPU
  28. *
  29. * Called with IRQs disabled
  30. */
  31. void sirfsoc_cpu_die(unsigned int cpu)
  32. {
  33. platform_do_lowpower(cpu);
  34. }