blob: f3dba6f356e29446c0960af2d37e51d2eacc8302 [file] [log] [blame]
Magnus Damm1c51ed42010-12-14 16:56:55 +09001/*
2 * SMP support for R-Mobile / SH-Mobile
3 *
4 * Copyright (C) 2010 Magnus Damm
Paul Mundtc4135212011-01-07 12:03:22 +09005 * Copyright (C) 2011 Paul Mundt
Magnus Damm1c51ed42010-12-14 16:56:55 +09006 *
7 * Based on vexpress, Copyright (C) 2002 ARM Ltd, All Rights Reserved
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 */
13#include <linux/init.h>
Magnus Dammcc615912013-08-01 03:38:18 +090014#include <asm/cacheflush.h>
15#include <asm/smp_plat.h>
Magnus Dammfd44aa52014-06-17 16:47:37 +090016#include "common.h"
Magnus Damm1c51ed42010-12-14 16:56:55 +090017
Magnus Dammcc615912013-08-01 03:38:18 +090018extern unsigned long shmobile_smp_fn[];
19extern unsigned long shmobile_smp_arg[];
20extern unsigned long shmobile_smp_mpidr[];
21
22void shmobile_smp_hook(unsigned int cpu, unsigned long fn, unsigned long arg)
23{
24 shmobile_smp_fn[cpu] = 0;
25 flush_cache_all();
26
27 shmobile_smp_mpidr[cpu] = cpu_logical_map(cpu);
28 shmobile_smp_fn[cpu] = fn;
29 shmobile_smp_arg[cpu] = arg;
30 flush_cache_all();
31}
Magnus Damm5c4dfcd2013-08-08 07:13:30 +090032
33#ifdef CONFIG_HOTPLUG_CPU
Stephen Boyd787047e2015-07-29 00:34:48 +010034bool shmobile_smp_cpu_can_disable(unsigned int cpu)
Magnus Damm5c4dfcd2013-08-08 07:13:30 +090035{
Stephen Boyd787047e2015-07-29 00:34:48 +010036 return true; /* Hotplug of any CPU is supported */
Magnus Damm5c4dfcd2013-08-08 07:13:30 +090037}
38#endif
Magnus Dammc21af442016-06-28 16:10:37 +020039
40bool __init shmobile_smp_init_fallback_ops(void)
41{
42 /* fallback on PSCI/smp_ops if no other DT based method is detected */
43 return platform_can_secondary_boot() ? true : false;
44}