xref: /openbmc/linux/arch/arm64/include/asm/cpu_ops.h (revision e8765b265a69c83504afc6901d6e137b1811d1f0)
1cd1aebf5SMark Rutland /*
2cd1aebf5SMark Rutland  * Copyright (C) 2013 ARM Ltd.
3cd1aebf5SMark Rutland  *
4cd1aebf5SMark Rutland  * This program is free software; you can redistribute it and/or modify
5cd1aebf5SMark Rutland  * it under the terms of the GNU General Public License version 2 as
6cd1aebf5SMark Rutland  * published by the Free Software Foundation.
7cd1aebf5SMark Rutland  *
8cd1aebf5SMark Rutland  * This program is distributed in the hope that it will be useful,
9cd1aebf5SMark Rutland  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10cd1aebf5SMark Rutland  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11cd1aebf5SMark Rutland  * GNU General Public License for more details.
12cd1aebf5SMark Rutland  *
13cd1aebf5SMark Rutland  * You should have received a copy of the GNU General Public License
14cd1aebf5SMark Rutland  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
15cd1aebf5SMark Rutland  */
16cd1aebf5SMark Rutland #ifndef __ASM_CPU_OPS_H
17cd1aebf5SMark Rutland #define __ASM_CPU_OPS_H
18cd1aebf5SMark Rutland 
19cd1aebf5SMark Rutland #include <linux/init.h>
20cd1aebf5SMark Rutland #include <linux/threads.h>
21cd1aebf5SMark Rutland 
22cd1aebf5SMark Rutland struct device_node;
23cd1aebf5SMark Rutland 
24652af899SMark Rutland /**
25652af899SMark Rutland  * struct cpu_operations - Callback operations for hotplugging CPUs.
26652af899SMark Rutland  *
27652af899SMark Rutland  * @name:	Name of the property as appears in a devicetree cpu node's
28652af899SMark Rutland  *		enable-method property.
29652af899SMark Rutland  * @cpu_init:	Reads any data necessary for a specific enable-method from the
30652af899SMark Rutland  *		devicetree, for a given cpu node and proposed logical id.
31652af899SMark Rutland  * @cpu_prepare: Early one-time preparation step for a cpu. If there is a
32652af899SMark Rutland  *		mechanism for doing so, tests whether it is possible to boot
33652af899SMark Rutland  *		the given CPU.
34652af899SMark Rutland  * @cpu_boot:	Boots a cpu into the kernel.
35652af899SMark Rutland  * @cpu_postboot: Optionally, perform any post-boot cleanup or necesary
36652af899SMark Rutland  *		synchronisation. Called from the cpu being booted.
37652af899SMark Rutland  */
38cd1aebf5SMark Rutland struct cpu_operations {
39cd1aebf5SMark Rutland 	const char	*name;
40cd1aebf5SMark Rutland 	int		(*cpu_init)(struct device_node *, unsigned int);
41cd1aebf5SMark Rutland 	int		(*cpu_prepare)(unsigned int);
42652af899SMark Rutland 	int		(*cpu_boot)(unsigned int);
43652af899SMark Rutland 	void		(*cpu_postboot)(void);
44cd1aebf5SMark Rutland };
45cd1aebf5SMark Rutland 
46cd1aebf5SMark Rutland extern const struct cpu_operations *cpu_ops[NR_CPUS];
47*e8765b26SMark Rutland extern int __init cpu_read_ops(struct device_node *dn, int cpu);
48*e8765b26SMark Rutland extern void __init cpu_read_bootcpu_ops(void);
49cd1aebf5SMark Rutland 
50cd1aebf5SMark Rutland #endif /* ifndef __ASM_CPU_OPS_H */
51