2 * SMP support for r8a7790
4 * Copyright (C) 2012-2013 Renesas Solutions Corp.
5 * Copyright (C) 2012 Takashi Yoshii <takashi.yoshii.ze@renesas.com>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 #include <linux/kernel.h>
17 #include <linux/init.h>
18 #include <linux/smp.h>
21 #include <asm/smp_plat.h>
27 static struct rcar_sysc_ch r8a7790_ca15_scu = {
28 .chan_offs = 0x180, /* PWRSR5 .. PWRER5 */
29 .isr_bit = 12, /* CA15-SCU */
32 static struct rcar_sysc_ch r8a7790_ca7_scu = {
33 .chan_offs = 0x100, /* PWRSR3 .. PWRER3 */
34 .isr_bit = 21, /* CA7-SCU */
37 static void __init r8a7790_smp_prepare_cpus(unsigned int max_cpus)
39 /* let APMU code install data related to shmobile_boot_vector */
40 shmobile_smp_apmu_prepare_cpus(max_cpus);
42 /* turn on power to SCU */
44 rcar_sysc_power_up(&r8a7790_ca15_scu);
45 rcar_sysc_power_up(&r8a7790_ca7_scu);
48 struct smp_operations r8a7790_smp_ops __initdata = {
49 .smp_prepare_cpus = r8a7790_smp_prepare_cpus,
50 .smp_boot_secondary = shmobile_smp_apmu_boot_secondary,
51 #ifdef CONFIG_HOTPLUG_CPU
52 .cpu_disable = shmobile_smp_cpu_disable,
53 .cpu_die = shmobile_smp_apmu_cpu_die,
54 .cpu_kill = shmobile_smp_apmu_cpu_kill,