2009-12-28 04:13:51 -07:00
|
|
|
/*
|
|
|
|
* Copyright 2007-2009 Analog Devices Inc.
|
|
|
|
* Graff Yang <graf.yang@analog.com>
|
|
|
|
*
|
|
|
|
* Licensed under the GPL-2 or later.
|
|
|
|
*/
|
|
|
|
|
2010-01-28 03:46:55 -07:00
|
|
|
#include <linux/smp.h>
|
2009-12-28 04:13:51 -07:00
|
|
|
#include <asm/blackfin.h>
|
2010-03-19 01:01:27 -07:00
|
|
|
#include <asm/cacheflush.h>
|
2010-01-28 03:46:55 -07:00
|
|
|
#include <mach/pll.h>
|
2009-12-28 04:13:51 -07:00
|
|
|
|
|
|
|
int hotplug_coreb;
|
|
|
|
|
|
|
|
void platform_cpu_die(void)
|
|
|
|
{
|
2010-01-28 03:46:55 -07:00
|
|
|
unsigned long iwr;
|
2010-03-19 01:01:27 -07:00
|
|
|
|
2009-12-28 04:13:51 -07:00
|
|
|
hotplug_coreb = 1;
|
|
|
|
|
2010-03-19 01:01:27 -07:00
|
|
|
/*
|
|
|
|
* When CoreB wakes up, the code in _coreb_trampoline_start cannot
|
|
|
|
* turn off the data cache. This causes the CoreB failed to boot.
|
|
|
|
* As a workaround, we invalidate all the data cache before sleep.
|
|
|
|
*/
|
|
|
|
blackfin_invalidate_entire_dcache();
|
|
|
|
|
2009-12-28 04:13:51 -07:00
|
|
|
/* disable core timer */
|
|
|
|
bfin_write_TCNTL(0);
|
|
|
|
|
2010-01-28 03:46:55 -07:00
|
|
|
/* clear ipi interrupt IRQ_SUPPLE_0 of CoreB */
|
2009-12-28 04:13:51 -07:00
|
|
|
bfin_write_SICB_SYSCR(bfin_read_SICB_SYSCR() | (1 << (10 + 1)));
|
|
|
|
SSYNC();
|
|
|
|
|
2010-01-28 03:46:55 -07:00
|
|
|
/* set CoreB wakeup by ipi0, iwr will be discarded */
|
|
|
|
bfin_iwr_set_sup0(&iwr, &iwr, &iwr);
|
|
|
|
SSYNC();
|
|
|
|
|
|
|
|
coreb_die();
|
2009-12-28 04:13:51 -07:00
|
|
|
}
|