xref: /openbmc/linux/arch/mips/include/asm/smp-cps.h (revision fa0dadde)
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3  * Copyright (C) 2013 Imagination Technologies
4  * Author: Paul Burton <paul.burton@mips.com>
5  */
6 
7 #ifndef __MIPS_ASM_SMP_CPS_H__
8 #define __MIPS_ASM_SMP_CPS_H__
9 
10 #define CPS_ENTRY_PATCH_INSNS	6
11 
12 #ifndef __ASSEMBLY__
13 
14 struct vpe_boot_config {
15 	unsigned long pc;
16 	unsigned long sp;
17 	unsigned long gp;
18 };
19 
20 struct core_boot_config {
21 	atomic_t vpe_mask;
22 	struct vpe_boot_config *vpe_config;
23 };
24 
25 extern struct core_boot_config *mips_cps_core_bootcfg;
26 
27 extern void mips_cps_core_entry(void);
28 extern void mips_cps_core_init(void);
29 
30 extern void mips_cps_boot_vpes(struct core_boot_config *cfg, unsigned vpe);
31 
32 extern void mips_cps_pm_save(void);
33 extern void mips_cps_pm_restore(void);
34 
35 extern void *mips_cps_core_entry_patch_end;
36 
37 #ifdef CONFIG_MIPS_CPS
38 
39 extern bool mips_cps_smp_in_use(void);
40 
41 #else /* !CONFIG_MIPS_CPS */
42 
43 static inline bool mips_cps_smp_in_use(void) { return false; }
44 
45 #endif /* !CONFIG_MIPS_CPS */
46 
47 #else /* __ASSEMBLY__ */
48 
49 .extern mips_cps_bootcfg;
50 
51 #endif /* __ASSEMBLY__ */
52 #endif /* __MIPS_ASM_SMP_CPS_H__ */
53