18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 28c2ecf20Sopenharmony_ci#ifndef __ASM_SH_SMP_OPS_H 38c2ecf20Sopenharmony_ci#define __ASM_SH_SMP_OPS_H 48c2ecf20Sopenharmony_ci 58c2ecf20Sopenharmony_cistruct plat_smp_ops { 68c2ecf20Sopenharmony_ci void (*smp_setup)(void); 78c2ecf20Sopenharmony_ci unsigned int (*smp_processor_id)(void); 88c2ecf20Sopenharmony_ci void (*prepare_cpus)(unsigned int max_cpus); 98c2ecf20Sopenharmony_ci void (*start_cpu)(unsigned int cpu, unsigned long entry_point); 108c2ecf20Sopenharmony_ci void (*send_ipi)(unsigned int cpu, unsigned int message); 118c2ecf20Sopenharmony_ci int (*cpu_disable)(unsigned int cpu); 128c2ecf20Sopenharmony_ci void (*cpu_die)(unsigned int cpu); 138c2ecf20Sopenharmony_ci void (*play_dead)(void); 148c2ecf20Sopenharmony_ci}; 158c2ecf20Sopenharmony_ci 168c2ecf20Sopenharmony_ciextern struct plat_smp_ops *mp_ops; 178c2ecf20Sopenharmony_ciextern struct plat_smp_ops shx3_smp_ops; 188c2ecf20Sopenharmony_ci 198c2ecf20Sopenharmony_ci#ifdef CONFIG_SMP 208c2ecf20Sopenharmony_ci 218c2ecf20Sopenharmony_cistatic inline void plat_smp_setup(void) 228c2ecf20Sopenharmony_ci{ 238c2ecf20Sopenharmony_ci BUG_ON(!mp_ops); 248c2ecf20Sopenharmony_ci mp_ops->smp_setup(); 258c2ecf20Sopenharmony_ci} 268c2ecf20Sopenharmony_ci 278c2ecf20Sopenharmony_cistatic inline void play_dead(void) 288c2ecf20Sopenharmony_ci{ 298c2ecf20Sopenharmony_ci mp_ops->play_dead(); 308c2ecf20Sopenharmony_ci} 318c2ecf20Sopenharmony_ci 328c2ecf20Sopenharmony_ciextern void register_smp_ops(struct plat_smp_ops *ops); 338c2ecf20Sopenharmony_ci 348c2ecf20Sopenharmony_ci#else 358c2ecf20Sopenharmony_ci 368c2ecf20Sopenharmony_cistatic inline void plat_smp_setup(void) 378c2ecf20Sopenharmony_ci{ 388c2ecf20Sopenharmony_ci /* UP, nothing to do ... */ 398c2ecf20Sopenharmony_ci} 408c2ecf20Sopenharmony_ci 418c2ecf20Sopenharmony_cistatic inline void register_smp_ops(struct plat_smp_ops *ops) 428c2ecf20Sopenharmony_ci{ 438c2ecf20Sopenharmony_ci} 448c2ecf20Sopenharmony_ci 458c2ecf20Sopenharmony_cistatic inline void play_dead(void) 468c2ecf20Sopenharmony_ci{ 478c2ecf20Sopenharmony_ci BUG(); 488c2ecf20Sopenharmony_ci} 498c2ecf20Sopenharmony_ci 508c2ecf20Sopenharmony_ci#endif /* CONFIG_SMP */ 518c2ecf20Sopenharmony_ci 528c2ecf20Sopenharmony_ci#endif /* __ASM_SH_SMP_OPS_H */ 53