From mboxrd@z Thu Jan 1 00:00:00 1970 From: Magnus Damm Date: Sat, 14 Sep 2013 13:46:25 +0000 Subject: [PATCH 01/05] ARM: shmobile: Add CPU notifier based SCU boot vector code Message-Id: <20130914134625.19258.10925.sendpatchset@w520> List-Id: References: <20130914134616.19258.27110.sendpatchset@w520> In-Reply-To: <20130914134616.19258.27110.sendpatchset@w520> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-arm-kernel@lists.infradead.org From: Magnus Damm Add CPU notifiers for the shared mach-shmobile SCU code to allow removal of the shared SCU boot_secondary code. Regarding notifiers, at CPU_UP_PREPARE time the SMP boot vector is initialized so secondary CPU cores can boot. Signed-off-by: Magnus Damm --- arch/arm/mach-shmobile/platsmp-scu.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) --- 0001/arch/arm/mach-shmobile/platsmp-scu.c +++ work/arch/arm/mach-shmobile/platsmp-scu.c 2013-09-14 22:15:07.000000000 +0900 @@ -7,6 +7,7 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ +#include #include #include #include @@ -16,6 +17,26 @@ #include #include +static int shmobile_smp_scu_notifier_call(struct notifier_block *nfb, + unsigned long action, void *hcpu) +{ + unsigned int cpu = (long)hcpu; + + switch (action) { + case CPU_UP_PREPARE: + /* For this particular CPU register SCU SMP boot vector */ + shmobile_smp_hook(cpu, virt_to_phys(shmobile_boot_scu), + (unsigned long)shmobile_scu_base); + break; + }; + + return NOTIFY_OK; +} + +static struct notifier_block shmobile_smp_scu_notifier = { + .notifier_call = shmobile_smp_scu_notifier_call, +}; + void __init shmobile_smp_scu_prepare_cpus(unsigned int max_cpus) { /* install boot code shared by all CPUs */ @@ -25,6 +46,9 @@ void __init shmobile_smp_scu_prepare_cpu /* enable SCU and cache coherency on booting CPU */ scu_enable(shmobile_scu_base); scu_power_mode(shmobile_scu_base, SCU_PM_NORMAL); + + /* Use CPU notifier for reset vector control */ + register_cpu_notifier(&shmobile_smp_scu_notifier); } int shmobile_smp_scu_boot_secondary(unsigned int cpu, struct task_struct *idle)