blob: ed8d2351915edb68aa17548007a408d701475e64 [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 Damm1c51ed42010-12-14 16:56:55 +090014#include <linux/smp.h>
Russell King0f7b3322011-04-03 13:01:30 +010015#include <asm/hardware/gic.h>
Magnus Damm1c51ed42010-12-14 16:56:55 +090016
Marc Zyngiera62580e2011-09-08 13:15:22 +010017void __init shmobile_smp_init_cpus(unsigned int ncores)
Magnus Damm1c51ed42010-12-14 16:56:55 +090018{
Magnus Damm1c51ed42010-12-14 16:56:55 +090019 unsigned int i;
20
Russell Kinga06f9162011-10-20 22:04:18 +010021 if (ncores > nr_cpu_ids) {
22 pr_warn("SMP: %u cores greater than maximum (%u), clipping\n",
23 ncores, nr_cpu_ids);
24 ncores = nr_cpu_ids;
25 }
26
Magnus Damm1c51ed42010-12-14 16:56:55 +090027 for (i = 0; i < ncores; i++)
28 set_cpu_possible(i, true);
Russell King0f7b3322011-04-03 13:01:30 +010029
30 set_smp_cross_call(gic_raise_softirq);
Magnus Damm1c51ed42010-12-14 16:56:55 +090031}