mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-05 10:29:37 +00:00
![Rob Herring](/assets/img/avatar_default.png)
In preparation of moving gic code to drivers/irqchip, remove the direct platform dependencies on gic_raise_softirq. Move the setup of smp_cross_call into the gic code and use arch_send_wakeup_ipi_mask function to trigger wake-up IPIs. Signed-off-by: Rob Herring <rob.herring@calxeda.com> Cc: Russell King <linux@arm.linux.org.uk> Cc: Kukjin Kim <kgene.kim@samsung.com> Cc: Sascha Hauer <kernel@pengutronix.de> Cc: David Brown <davidb@codeaurora.org> Cc: Daniel Walker <dwalker@fifo99.com> Cc: Bryan Huntsman <bryanh@codeaurora.org> Acked-by: Tony Lindgren <tony@atomide.com> Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Cc: Paul Mundt <lethal@linux-sh.org> Cc: Magnus Damm <magnus.damm@gmail.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Cc: Shiraz Hashim <shiraz.hashim@st.com> Acked-by: Stephen Warren <swarren@nvidia.com> Cc: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com> Cc: Linus Walleij <linus.walleij@linaro.org> Acked-by: Olof Johansson <olof@lixom.net>
86 lines
2.2 KiB
C
86 lines
2.2 KiB
C
/*
|
|
* linux/arch/arm/mach-realview/platsmp.c
|
|
*
|
|
* 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/errno.h>
|
|
#include <linux/smp.h>
|
|
#include <linux/io.h>
|
|
|
|
#include <mach/hardware.h>
|
|
#include <asm/mach-types.h>
|
|
#include <asm/smp_scu.h>
|
|
|
|
#include <mach/board-eb.h>
|
|
#include <mach/board-pb11mp.h>
|
|
#include <mach/board-pbx.h>
|
|
|
|
#include <plat/platsmp.h>
|
|
|
|
#include "core.h"
|
|
|
|
static void __iomem *scu_base_addr(void)
|
|
{
|
|
if (machine_is_realview_eb_mp())
|
|
return __io_address(REALVIEW_EB11MP_SCU_BASE);
|
|
else if (machine_is_realview_pb11mp())
|
|
return __io_address(REALVIEW_TC11MP_SCU_BASE);
|
|
else if (machine_is_realview_pbx() &&
|
|
(core_tile_pbx11mp() || core_tile_pbxa9mp()))
|
|
return __io_address(REALVIEW_PBX_TILE_SCU_BASE);
|
|
else
|
|
return (void __iomem *)0;
|
|
}
|
|
|
|
/*
|
|
* Initialise the CPU possible map early - this describes the CPUs
|
|
* which may be present or become present in the system.
|
|
*/
|
|
static void __init realview_smp_init_cpus(void)
|
|
{
|
|
void __iomem *scu_base = scu_base_addr();
|
|
unsigned int i, ncores;
|
|
|
|
ncores = scu_base ? scu_get_core_count(scu_base) : 1;
|
|
|
|
/* sanity check */
|
|
if (ncores > nr_cpu_ids) {
|
|
pr_warn("SMP: %u cores greater than maximum (%u), clipping\n",
|
|
ncores, nr_cpu_ids);
|
|
ncores = nr_cpu_ids;
|
|
}
|
|
|
|
for (i = 0; i < ncores; i++)
|
|
set_cpu_possible(i, true);
|
|
}
|
|
|
|
static void __init realview_smp_prepare_cpus(unsigned int max_cpus)
|
|
{
|
|
|
|
scu_enable(scu_base_addr());
|
|
|
|
/*
|
|
* Write the address of secondary startup into the
|
|
* system-wide flags register. The BootMonitor waits
|
|
* until it receives a soft interrupt, and then the
|
|
* secondary CPU branches to this address.
|
|
*/
|
|
__raw_writel(virt_to_phys(versatile_secondary_startup),
|
|
__io_address(REALVIEW_SYS_FLAGSSET));
|
|
}
|
|
|
|
struct smp_operations realview_smp_ops __initdata = {
|
|
.smp_init_cpus = realview_smp_init_cpus,
|
|
.smp_prepare_cpus = realview_smp_prepare_cpus,
|
|
.smp_secondary_init = versatile_secondary_init,
|
|
.smp_boot_secondary = versatile_boot_secondary,
|
|
#ifdef CONFIG_HOTPLUG_CPU
|
|
.cpu_die = realview_cpu_die,
|
|
#endif
|
|
};
|