* [PATCH 00/05] ARM: shmobile: Use CPU notifiers for SCU boot vector code
@ 2013-09-14 13:46 Magnus Damm
2013-09-14 13:46 ` [PATCH 01/05] ARM: shmobile: Add CPU notifier based " Magnus Damm
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: Magnus Damm @ 2013-09-14 13:46 UTC (permalink / raw)
To: linux-arm-kernel
ARM: shmobile: Use CPU notifiers for SCU boot vector code
[PATCH 01/05] ARM: shmobile: Add CPU notifier based SCU boot vector code
[PATCH 02/05] ARM: shmobile: Let sh73a0 rely on SCU CPU notifier
[PATCH 03/05] ARM: shmobile: Let EMEV2 rely on SCU CPU notifier
[PATCH 04/05] ARM: shmobile: Let r8a7779 rely on SCU CPU notifier
[PATCH 05/05] ARM: shmobile: Remove shmobile_smp_scu_boot_secondary()
This series converts mach-shmobile to use CPU notifiers for boot vector
setup for SCU based SoCs such as sh73a0, EMEV2 and r8a7779. This
allows us to remove the shmobile_smp_scu_boot_secondary() function,
and it is also ground work for the CPUIdle resume path.
Signed-off-by: Magnus Damm <damm@opensource.se>
---
Written against renesas.git tag renesas-devel-20130906
arch/arm/mach-shmobile/include/mach/common.h | 2 -
arch/arm/mach-shmobile/platsmp-scu.c | 32 +++++++++++++++++++-------
arch/arm/mach-shmobile/smp-emev2.c | 6 ----
arch/arm/mach-shmobile/smp-r8a7779.c | 4 ---
arch/arm/mach-shmobile/smp-sh73a0.c | 5 ----
5 files changed, 24 insertions(+), 25 deletions(-)
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 01/05] ARM: shmobile: Add CPU notifier based SCU boot vector code
2013-09-14 13:46 [PATCH 00/05] ARM: shmobile: Use CPU notifiers for SCU boot vector code Magnus Damm
@ 2013-09-14 13:46 ` Magnus Damm
2013-09-14 13:46 ` [PATCH 02/05] ARM: shmobile: Let sh73a0 rely on SCU CPU notifier Magnus Damm
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Magnus Damm @ 2013-09-14 13:46 UTC (permalink / raw)
To: linux-arm-kernel
From: Magnus Damm <damm@opensource.se>
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 <damm@opensource.se>
---
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 <linux/cpu.h>
#include <linux/delay.h>
#include <linux/init.h>
#include <linux/io.h>
@@ -16,6 +17,26 @@
#include <asm/smp_scu.h>
#include <mach/common.h>
+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)
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 02/05] ARM: shmobile: Let sh73a0 rely on SCU CPU notifier
2013-09-14 13:46 [PATCH 00/05] ARM: shmobile: Use CPU notifiers for SCU boot vector code Magnus Damm
2013-09-14 13:46 ` [PATCH 01/05] ARM: shmobile: Add CPU notifier based " Magnus Damm
@ 2013-09-14 13:46 ` Magnus Damm
2013-09-14 13:46 ` [PATCH 03/05] ARM: shmobile: Let EMEV2 " Magnus Damm
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Magnus Damm @ 2013-09-14 13:46 UTC (permalink / raw)
To: linux-arm-kernel
From: Magnus Damm <damm@opensource.se>
Now when CPU notifiers are used for SCU boot vector
setup shmobile_smp_scu_boot_secondary() is no longer
needed.
Signed-off-by: Magnus Damm <damm@opensource.se>
---
arch/arm/mach-shmobile/smp-sh73a0.c | 5 -----
1 file changed, 5 deletions(-)
--- 0001/arch/arm/mach-shmobile/smp-sh73a0.c
+++ work/arch/arm/mach-shmobile/smp-sh73a0.c 2013-09-14 19:28:29.000000000 +0900
@@ -46,11 +46,6 @@ void __init sh73a0_register_twd(void)
static int sh73a0_boot_secondary(unsigned int cpu, struct task_struct *idle)
{
unsigned int lcpu = cpu_logical_map(cpu);
- int ret;
-
- ret = shmobile_smp_scu_boot_secondary(cpu, idle);
- if (ret)
- return ret;
if (((__raw_readl(PSTR) >> (4 * lcpu)) & 3) == 3)
__raw_writel(1 << lcpu, WUPCR); /* wake up */
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 03/05] ARM: shmobile: Let EMEV2 rely on SCU CPU notifier
2013-09-14 13:46 [PATCH 00/05] ARM: shmobile: Use CPU notifiers for SCU boot vector code Magnus Damm
2013-09-14 13:46 ` [PATCH 01/05] ARM: shmobile: Add CPU notifier based " Magnus Damm
2013-09-14 13:46 ` [PATCH 02/05] ARM: shmobile: Let sh73a0 rely on SCU CPU notifier Magnus Damm
@ 2013-09-14 13:46 ` Magnus Damm
2013-09-14 13:46 ` [PATCH 04/05] ARM: shmobile: Let r8a7779 " Magnus Damm
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Magnus Damm @ 2013-09-14 13:46 UTC (permalink / raw)
To: linux-arm-kernel
From: Magnus Damm <damm@opensource.se>
Now when CPU notifiers are used for SCU boot vector
setup shmobile_smp_scu_boot_secondary() is no longer
needed.
Signed-off-by: Magnus Damm <damm@opensource.se>
---
arch/arm/mach-shmobile/smp-emev2.c | 6 ------
1 file changed, 6 deletions(-)
--- 0001/arch/arm/mach-shmobile/smp-emev2.c
+++ work/arch/arm/mach-shmobile/smp-emev2.c 2013-09-14 19:34:45.000000000 +0900
@@ -34,12 +34,6 @@
static int emev2_boot_secondary(unsigned int cpu, struct task_struct *idle)
{
- int ret;
-
- ret = shmobile_smp_scu_boot_secondary(cpu, idle);
- if (ret)
- return ret;
-
arch_send_wakeup_ipi_mask(cpumask_of(cpu_logical_map(cpu)));
return 0;
}
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 04/05] ARM: shmobile: Let r8a7779 rely on SCU CPU notifier
2013-09-14 13:46 [PATCH 00/05] ARM: shmobile: Use CPU notifiers for SCU boot vector code Magnus Damm
` (2 preceding siblings ...)
2013-09-14 13:46 ` [PATCH 03/05] ARM: shmobile: Let EMEV2 " Magnus Damm
@ 2013-09-14 13:46 ` Magnus Damm
2013-09-14 13:47 ` [PATCH 05/05] ARM: shmobile: Remove shmobile_smp_scu_boot_secondary() Magnus Damm
2013-09-18 0:34 ` [PATCH 00/05] ARM: shmobile: Use CPU notifiers for SCU boot vector code Simon Horman
5 siblings, 0 replies; 7+ messages in thread
From: Magnus Damm @ 2013-09-14 13:46 UTC (permalink / raw)
To: linux-arm-kernel
From: Magnus Damm <damm@opensource.se>
Now when CPU notifiers are used for SCU boot vector
setup shmobile_smp_scu_boot_secondary() is no longer
needed.
Signed-off-by: Magnus Damm <damm@opensource.se>
---
arch/arm/mach-shmobile/smp-r8a7779.c | 4 ----
1 file changed, 4 deletions(-)
--- 0001/arch/arm/mach-shmobile/smp-r8a7779.c
+++ work/arch/arm/mach-shmobile/smp-r8a7779.c 2013-09-14 19:36:57.000000000 +0900
@@ -87,10 +87,6 @@ static int r8a7779_boot_secondary(unsign
unsigned int lcpu = cpu_logical_map(cpu);
int ret;
- ret = shmobile_smp_scu_boot_secondary(cpu, idle);
- if (ret)
- return ret;
-
if (lcpu < ARRAY_SIZE(r8a7779_ch_cpu))
ch = r8a7779_ch_cpu[lcpu];
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 05/05] ARM: shmobile: Remove shmobile_smp_scu_boot_secondary()
2013-09-14 13:46 [PATCH 00/05] ARM: shmobile: Use CPU notifiers for SCU boot vector code Magnus Damm
` (3 preceding siblings ...)
2013-09-14 13:46 ` [PATCH 04/05] ARM: shmobile: Let r8a7779 " Magnus Damm
@ 2013-09-14 13:47 ` Magnus Damm
2013-09-18 0:34 ` [PATCH 00/05] ARM: shmobile: Use CPU notifiers for SCU boot vector code Simon Horman
5 siblings, 0 replies; 7+ messages in thread
From: Magnus Damm @ 2013-09-14 13:47 UTC (permalink / raw)
To: linux-arm-kernel
From: Magnus Damm <damm@opensource.se>
Remove shmobile_smp_scu_boot_secondary() since
it is no longer used. CPU boot vector setup is
instead handled by CPU notifiers.
Signed-off-by: Magnus Damm <damm@opensource.se>
---
arch/arm/mach-shmobile/include/mach/common.h | 2 --
arch/arm/mach-shmobile/platsmp-scu.c | 8 --------
2 files changed, 10 deletions(-)
--- 0001/arch/arm/mach-shmobile/include/mach/common.h
+++ work/arch/arm/mach-shmobile/include/mach/common.h 2013-09-14 19:38:47.000000000 +0900
@@ -18,8 +18,6 @@ extern int shmobile_smp_cpu_disable(unsi
extern void shmobile_invalidate_start(void);
extern void shmobile_boot_scu(void);
extern void shmobile_smp_scu_prepare_cpus(unsigned int max_cpus);
-extern int shmobile_smp_scu_boot_secondary(unsigned int cpu,
- struct task_struct *idle);
extern void shmobile_smp_scu_cpu_die(unsigned int cpu);
extern int shmobile_smp_scu_cpu_kill(unsigned int cpu);
extern void shmobile_smp_apmu_prepare_cpus(unsigned int max_cpus);
--- 0004/arch/arm/mach-shmobile/platsmp-scu.c
+++ work/arch/arm/mach-shmobile/platsmp-scu.c 2013-09-14 19:39:01.000000000 +0900
@@ -59,14 +59,6 @@ void __init shmobile_smp_scu_prepare_cpu
register_cpu_notifier(&shmobile_smp_scu_notifier);
}
-int shmobile_smp_scu_boot_secondary(unsigned int cpu, struct task_struct *idle)
-{
- /* For this particular CPU register SCU boot vector */
- shmobile_smp_hook(cpu, virt_to_phys(shmobile_boot_scu),
- (unsigned long)shmobile_scu_base);
- return 0;
-}
-
#ifdef CONFIG_HOTPLUG_CPU
void shmobile_smp_scu_cpu_die(unsigned int cpu)
{
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 00/05] ARM: shmobile: Use CPU notifiers for SCU boot vector code
2013-09-14 13:46 [PATCH 00/05] ARM: shmobile: Use CPU notifiers for SCU boot vector code Magnus Damm
` (4 preceding siblings ...)
2013-09-14 13:47 ` [PATCH 05/05] ARM: shmobile: Remove shmobile_smp_scu_boot_secondary() Magnus Damm
@ 2013-09-18 0:34 ` Simon Horman
5 siblings, 0 replies; 7+ messages in thread
From: Simon Horman @ 2013-09-18 0:34 UTC (permalink / raw)
To: linux-arm-kernel
On Sat, Sep 14, 2013 at 10:46:16PM +0900, Magnus Damm wrote:
> ARM: shmobile: Use CPU notifiers for SCU boot vector code
>
> [PATCH 01/05] ARM: shmobile: Add CPU notifier based SCU boot vector code
> [PATCH 02/05] ARM: shmobile: Let sh73a0 rely on SCU CPU notifier
> [PATCH 03/05] ARM: shmobile: Let EMEV2 rely on SCU CPU notifier
> [PATCH 04/05] ARM: shmobile: Let r8a7779 rely on SCU CPU notifier
> [PATCH 05/05] ARM: shmobile: Remove shmobile_smp_scu_boot_secondary()
>
> This series converts mach-shmobile to use CPU notifiers for boot vector
> setup for SCU based SoCs such as sh73a0, EMEV2 and r8a7779. This
> allows us to remove the shmobile_smp_scu_boot_secondary() function,
> and it is also ground work for the CPUIdle resume path.
Thanks Magnus, I have queued these up for v3.12.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2013-09-18 0:34 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-14 13:46 [PATCH 00/05] ARM: shmobile: Use CPU notifiers for SCU boot vector code Magnus Damm
2013-09-14 13:46 ` [PATCH 01/05] ARM: shmobile: Add CPU notifier based " Magnus Damm
2013-09-14 13:46 ` [PATCH 02/05] ARM: shmobile: Let sh73a0 rely on SCU CPU notifier Magnus Damm
2013-09-14 13:46 ` [PATCH 03/05] ARM: shmobile: Let EMEV2 " Magnus Damm
2013-09-14 13:46 ` [PATCH 04/05] ARM: shmobile: Let r8a7779 " Magnus Damm
2013-09-14 13:47 ` [PATCH 05/05] ARM: shmobile: Remove shmobile_smp_scu_boot_secondary() Magnus Damm
2013-09-18 0:34 ` [PATCH 00/05] ARM: shmobile: Use CPU notifiers for SCU boot vector code Simon Horman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).