platsmp.c 782 字节
Newer Older
M
Magnus Damm 已提交
1 2 3 4
/*
 * SMP support for R-Mobile / SH-Mobile
 *
 * Copyright (C) 2010  Magnus Damm
5
 * Copyright (C) 2011  Paul Mundt
M
Magnus Damm 已提交
6 7 8 9 10 11 12 13 14
 *
 * Based on vexpress, Copyright (C) 2002 ARM Ltd, All Rights Reserved
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */
#include <linux/init.h>
#include <linux/smp.h>
15
#include <asm/hardware/gic.h>
M
Magnus Damm 已提交
16

17
void __init shmobile_smp_init_cpus(unsigned int ncores)
M
Magnus Damm 已提交
18 19 20
{
	unsigned int i;

21 22 23 24 25 26
	if (ncores > nr_cpu_ids) {
		pr_warn("SMP: %u cores greater than maximum (%u), clipping\n",
			ncores, nr_cpu_ids);
		ncores = nr_cpu_ids;
	}

M
Magnus Damm 已提交
27 28
	for (i = 0; i < ncores; i++)
		set_cpu_possible(i, true);
29 30

	set_smp_cross_call(gic_raise_softirq);
M
Magnus Damm 已提交
31
}