summaryrefslogtreecommitdiffstats
path: root/arch/blackfin/mach-bf561/hotplug.c
blob: 4cd3b28cd046d86d51973fe0037abdeb63279ea6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*
 * Copyright 2007-2009 Analog Devices Inc.
 *               Graff Yang <graf.yang@analog.com>
 *
 * Licensed under the GPL-2 or later.
 */

#include <asm/blackfin.h>
#include <asm/irq.h>
#include <asm/smp.h>

#define SIC_SYSIRQ(irq)	(irq - (IRQ_CORETMR + 1))

int hotplug_coreb;

void platform_cpu_die(void)
{
	unsigned long iwr[2] = {0, 0};
	unsigned long bank = SIC_SYSIRQ(IRQ_SUPPLE_0) / 32;
	unsigned long bit = 1 << (SIC_SYSIRQ(IRQ_SUPPLE_0) % 32);

	hotplug_coreb = 1;

	iwr[bank] = bit;

	/* disable core timer */
	bfin_write_TCNTL(0);

	/* clear ipi interrupt IRQ_SUPPLE_0 */
	bfin_write_SICB_SYSCR(bfin_read_SICB_SYSCR() | (1 << (10 + 1)));
	SSYNC();

	coreb_sleep(iwr[0], iwr[1], 0);
}