hotplug.c 881 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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 <linux/smp.h>
  8. #include <asm/blackfin.h>
  9. #include <asm/cacheflush.h>
  10. #include <mach/pll.h>
  11. int hotplug_coreb;
  12. void platform_cpu_die(void)
  13. {
  14. unsigned long iwr;
  15. hotplug_coreb = 1;
  16. /*
  17. * When CoreB wakes up, the code in _coreb_trampoline_start cannot
  18. * turn off the data cache. This causes the CoreB failed to boot.
  19. * As a workaround, we invalidate all the data cache before sleep.
  20. */
  21. blackfin_invalidate_entire_dcache();
  22. /* disable core timer */
  23. bfin_write_TCNTL(0);
  24. /* clear ipi interrupt IRQ_SUPPLE_0 of CoreB */
  25. bfin_write_SICB_SYSCR(bfin_read_SICB_SYSCR() | (1 << (10 + 1)));
  26. SSYNC();
  27. /* set CoreB wakeup by ipi0, iwr will be discarded */
  28. bfin_iwr_set_sup0(&iwr, &iwr, &iwr);
  29. SSYNC();
  30. coreb_die();
  31. }