From 849369d6c66d3054688672f97d31fceb8e8230fb Mon Sep 17 00:00:00 2001 From: root Date: Fri, 25 Dec 2015 04:40:36 +0000 Subject: initial_commit --- arch/arm/mach-shmobile/platsmp.c | 73 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 arch/arm/mach-shmobile/platsmp.c (limited to 'arch/arm/mach-shmobile/platsmp.c') diff --git a/arch/arm/mach-shmobile/platsmp.c b/arch/arm/mach-shmobile/platsmp.c new file mode 100644 index 00000000..f3888feb --- /dev/null +++ b/arch/arm/mach-shmobile/platsmp.c @@ -0,0 +1,73 @@ +/* + * SMP support for R-Mobile / SH-Mobile + * + * Copyright (C) 2010 Magnus Damm + * Copyright (C) 2011 Paul Mundt + * + * 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 +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static unsigned int __init shmobile_smp_get_core_count(void) +{ + if (machine_is_ag5evm()) + return sh73a0_get_core_count(); + + return 1; +} + +static void __init shmobile_smp_prepare_cpus(void) +{ + if (machine_is_ag5evm()) + sh73a0_smp_prepare_cpus(); +} + +void __cpuinit platform_secondary_init(unsigned int cpu) +{ + trace_hardirqs_off(); + + if (machine_is_ag5evm()) + sh73a0_secondary_init(cpu); +} + +int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle) +{ + if (machine_is_ag5evm()) + return sh73a0_boot_secondary(cpu); + + return -ENOSYS; +} + +void __init smp_init_cpus(void) +{ + unsigned int ncores = shmobile_smp_get_core_count(); + unsigned int i; + + for (i = 0; i < ncores; i++) + set_cpu_possible(i, true); + + set_smp_cross_call(gic_raise_softirq); +} + +void __init platform_smp_prepare_cpus(unsigned int max_cpus) +{ + int i; + + for (i = 0; i < max_cpus; i++) + set_cpu_present(i, true); + + shmobile_smp_prepare_cpus(); +} -- cgit v1.2.3