hotplug.c 699 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * Copyright 2007-2009 Analog Devices Inc.
  3. * Graff Yang <graf.yang@analog.com>
  4. *
  5. * Licensed under the GPL-2 or later.
  6. */
  7. #include <asm/blackfin.h>
  8. #include <asm/irq.h>
  9. #include <asm/smp.h>
  10. #define SIC_SYSIRQ(irq) (irq - (IRQ_CORETMR + 1))
  11. int hotplug_coreb;
  12. void platform_cpu_die(void)
  13. {
  14. unsigned long iwr[2] = {0, 0};
  15. unsigned long bank = SIC_SYSIRQ(IRQ_SUPPLE_0) / 32;
  16. unsigned long bit = 1 << (SIC_SYSIRQ(IRQ_SUPPLE_0) % 32);
  17. hotplug_coreb = 1;
  18. iwr[bank] = bit;
  19. /* disable core timer */
  20. bfin_write_TCNTL(0);
  21. /* clear ipi interrupt IRQ_SUPPLE_0 */
  22. bfin_write_SICB_SYSCR(bfin_read_SICB_SYSCR() | (1 << (10 + 1)));
  23. SSYNC();
  24. coreb_sleep(iwr[0], iwr[1], 0);
  25. }