blob: b23378f3d7e1726b6f92b3cc8be0ba8264c838f7 [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