hotplug.c 677 B

1234567891011121314151617181920212223242526272829303132
  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/smp.h>
  9. #define SIC_SYSIRQ(irq) (irq - (IRQ_CORETMR + 1))
  10. int hotplug_coreb;
  11. void platform_cpu_die(void)
  12. {
  13. unsigned long iwr[2] = {0, 0};
  14. unsigned long bank = SIC_SYSIRQ(IRQ_SUPPLE_0) / 32;
  15. unsigned long bit = 1 << (SIC_SYSIRQ(IRQ_SUPPLE_0) % 32);
  16. hotplug_coreb = 1;
  17. iwr[bank] = bit;
  18. /* disable core timer */
  19. bfin_write_TCNTL(0);
  20. /* clear ipi interrupt IRQ_SUPPLE_0 */
  21. bfin_write_SICB_SYSCR(bfin_read_SICB_SYSCR() | (1 << (10 + 1)));
  22. SSYNC();
  23. coreb_sleep(iwr[0], iwr[1], 0);
  24. }