From: magnus.damm@gmail.com (Magnus Damm)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 03/05] ARM: shmobile: r8a73a4 CA15 setup WFE as NOP
Date: Thu, 30 May 2013 17:52:20 +0900 [thread overview]
Message-ID: <20130530085220.24374.94574.sendpatchset@w520> (raw)
In-Reply-To: <20130530085152.24374.64208.sendpatchset@w520>
From: Magnus Damm <damm@opensource.se>
Configure CA15 included in r8a73a4 to treat WFE as NOP.
This works around hardware issue found in APE6, needed
for CA7 cluster to work together with CA15 cluster.
Not-yet-Signed-off-by: Magnus Damm <damm@opensource.se>
---
arch/arm/mach-shmobile/smp-r8a73a4.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
--- 0006/arch/arm/mach-shmobile/smp-r8a73a4.c
+++ work/arch/arm/mach-shmobile/smp-r8a73a4.c 2013-05-22 14:16:59.000000000 +0900
@@ -45,6 +45,20 @@
#define CCI_SNOOP 0x0000
#define CCI_STATUS 0x000c
+static inline void r8a73a4_execute_wfe_as_nop(void)
+{
+ unsigned int v;
+
+ /* set bit 7 in ACTLR */
+ asm volatile(
+ " mrc p15, 0, %0, c1, c0, 1\n"
+ " orr %0, %0, #0x40\n"
+ " mcr p15, 0, %0, c1, c0, 1\n"
+ : "=&r" (v)
+ :
+ : "cc");
+}
+
static void __init r8a73a4_smp_prepare_cpus(unsigned int max_cpus)
{
u32 bar;
@@ -71,6 +85,8 @@ static void __init r8a73a4_smp_prepare_c
while (__raw_readl(p + CCI_STATUS))
/* wait for pending bit low */;
iounmap(p);
+
+ r8a73a4_execute_wfe_as_nop();
}
static int __cpuinit r8a73a4_boot_secondary(unsigned int cpu, struct task_struct *idle)
@@ -85,6 +101,13 @@ static int __cpuinit r8a73a4_boot_second
return 0;
}
+static void __cpuinit r8a73a4_secondary_init(unsigned int cpu)
+{
+ /* CA15 need SW workaround */
+ if (cpu_logical_map(cpu) < 4)
+ r8a73a4_execute_wfe_as_nop();
+}
+
#ifdef CONFIG_HOTPLUG_CPU
static int r8a73a4_cpu_kill(unsigned int cpu)
{
@@ -169,6 +192,7 @@ static int r8a73a4_cpu_disable(unsigned
struct smp_operations r8a73a4_smp_ops __initdata = {
.smp_prepare_cpus = r8a73a4_smp_prepare_cpus,
.smp_boot_secondary = r8a73a4_boot_secondary,
+ .smp_secondary_init = r8a73a4_secondary_init,
#ifdef CONFIG_HOTPLUG_CPU
.cpu_kill = r8a73a4_cpu_kill,
.cpu_die = r8a73a4_cpu_die,
next prev parent reply other threads:[~2013-05-30 8:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-30 8:51 [PATCH 00/05] ARM: shmobile: r8a73a4 SMP and CPU Hotplug prototype v2 Magnus Damm
2013-05-30 8:52 ` [PATCH 01/05] ARM: shmobile: r8a73a4 SMP prototype v1 (CA15 x 4) Magnus Damm
2013-06-05 8:29 ` Shinya Kuribayashi
2013-05-30 8:52 ` [PATCH 02/05] ARM: shmobile: r8a73a4 CPU Hotplug " Magnus Damm
2013-05-30 8:52 ` Magnus Damm [this message]
2013-05-30 8:52 ` [PATCH 04/05] ARM: shmobile: r8a73a4 SMP CA7 prototype (+ CA7 " Magnus Damm
2013-05-30 8:52 ` [PATCH 05/05] ARM: shmobile: r8a73a4 CA7 setup arch timer Magnus Damm
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130530085220.24374.94574.sendpatchset@w520 \
--to=magnus.damm@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).