18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * SMP support for R-Mobile / SH-Mobile 48c2ecf20Sopenharmony_ci * 58c2ecf20Sopenharmony_ci * Copyright (C) 2010 Magnus Damm 68c2ecf20Sopenharmony_ci * Copyright (C) 2011 Paul Mundt 78c2ecf20Sopenharmony_ci * 88c2ecf20Sopenharmony_ci * Based on vexpress, Copyright (C) 2002 ARM Ltd, All Rights Reserved 98c2ecf20Sopenharmony_ci */ 108c2ecf20Sopenharmony_ci#include <linux/init.h> 118c2ecf20Sopenharmony_ci#include <asm/cacheflush.h> 128c2ecf20Sopenharmony_ci#include <asm/smp_plat.h> 138c2ecf20Sopenharmony_ci#include "common.h" 148c2ecf20Sopenharmony_ci 158c2ecf20Sopenharmony_ciextern unsigned long shmobile_smp_fn[]; 168c2ecf20Sopenharmony_ciextern unsigned long shmobile_smp_arg[]; 178c2ecf20Sopenharmony_ciextern unsigned long shmobile_smp_mpidr[]; 188c2ecf20Sopenharmony_ci 198c2ecf20Sopenharmony_civoid shmobile_smp_hook(unsigned int cpu, unsigned long fn, unsigned long arg) 208c2ecf20Sopenharmony_ci{ 218c2ecf20Sopenharmony_ci shmobile_smp_fn[cpu] = 0; 228c2ecf20Sopenharmony_ci flush_cache_all(); 238c2ecf20Sopenharmony_ci 248c2ecf20Sopenharmony_ci shmobile_smp_mpidr[cpu] = cpu_logical_map(cpu); 258c2ecf20Sopenharmony_ci shmobile_smp_fn[cpu] = fn; 268c2ecf20Sopenharmony_ci shmobile_smp_arg[cpu] = arg; 278c2ecf20Sopenharmony_ci flush_cache_all(); 288c2ecf20Sopenharmony_ci} 298c2ecf20Sopenharmony_ci 308c2ecf20Sopenharmony_ci#ifdef CONFIG_HOTPLUG_CPU 318c2ecf20Sopenharmony_cibool shmobile_smp_cpu_can_disable(unsigned int cpu) 328c2ecf20Sopenharmony_ci{ 338c2ecf20Sopenharmony_ci return true; /* Hotplug of any CPU is supported */ 348c2ecf20Sopenharmony_ci} 358c2ecf20Sopenharmony_ci#endif 36