mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-25 05:34:00 +08:00
75305275a7
These smp_operations structures are not over-written, so add "const" qualifier and replace __initdata with __initconst. Also, add "static" where it is possible. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Acked-by: Moritz Fischer <moritz.fischer@ettus.com> Acked-by: Stephen Boyd <sboyd@codeaurora.org> # qcom part Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Acked-by: Patrice Chotard <patrice.chotard@st.com> Acked-by: Heiko Stuebner <heiko@sntech.de> Acked-by: Wei Xu <xuwei5@hisilicon.com> Acked-by: Florian Fainelli <f.fainelli@gmail.com> Acked-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Acked-by: Gregory CLEMENT <gregory.clement@free-electrons.com> Acked-by: Shawn Guo <shawnguo@kernel.org> Acked-by: Matthias Brugger <matthias.bgg@gmail.com> Acked-by: Thierry Reding <treding@nvidia.com> Acked-by: Nicolas Pitre <nico@linaro.org> Acked-by: Liviu Dudau <Liviu.Dudau@arm.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
75 lines
1.9 KiB
C
75 lines
1.9 KiB
C
/*
|
|
* linux/arch/arm/mach-vexpress/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 <linux/of_address.h>
|
|
#include <linux/vexpress.h>
|
|
|
|
#include <asm/mcpm.h>
|
|
#include <asm/smp_scu.h>
|
|
#include <asm/mach/map.h>
|
|
|
|
#include <plat/platsmp.h>
|
|
|
|
#include "core.h"
|
|
|
|
bool __init vexpress_smp_init_ops(void)
|
|
{
|
|
#ifdef CONFIG_MCPM
|
|
/*
|
|
* The best way to detect a multi-cluster configuration at the moment
|
|
* is to look for the presence of a CCI in the system.
|
|
* Override the default vexpress_smp_ops if so.
|
|
*/
|
|
struct device_node *node;
|
|
node = of_find_compatible_node(NULL, NULL, "arm,cci-400");
|
|
if (node && of_device_is_available(node)) {
|
|
mcpm_smp_set_ops();
|
|
return true;
|
|
}
|
|
#endif
|
|
return false;
|
|
}
|
|
|
|
static const struct of_device_id vexpress_smp_dt_scu_match[] __initconst = {
|
|
{ .compatible = "arm,cortex-a5-scu", },
|
|
{ .compatible = "arm,cortex-a9-scu", },
|
|
{}
|
|
};
|
|
|
|
static void __init vexpress_smp_dt_prepare_cpus(unsigned int max_cpus)
|
|
{
|
|
struct device_node *scu = of_find_matching_node(NULL,
|
|
vexpress_smp_dt_scu_match);
|
|
|
|
if (scu)
|
|
scu_enable(of_iomap(scu, 0));
|
|
|
|
/*
|
|
* Write the address of secondary startup into the
|
|
* system-wide flags register. The boot monitor waits
|
|
* until it receives a soft interrupt, and then the
|
|
* secondary CPU branches to this address.
|
|
*/
|
|
vexpress_flags_set(virt_to_phys(versatile_secondary_startup));
|
|
}
|
|
|
|
const struct smp_operations vexpress_smp_dt_ops __initconst = {
|
|
.smp_prepare_cpus = vexpress_smp_dt_prepare_cpus,
|
|
.smp_secondary_init = versatile_secondary_init,
|
|
.smp_boot_secondary = versatile_boot_secondary,
|
|
#ifdef CONFIG_HOTPLUG_CPU
|
|
.cpu_die = vexpress_cpu_die,
|
|
#endif
|
|
};
|