From patchwork Thu May 30 08:52:20 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 2634081 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 8A05CDF2A1 for ; Thu, 30 May 2013 08:45:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967983Ab3E3IpC (ORCPT ); Thu, 30 May 2013 04:45:02 -0400 Received: from mail-pd0-f173.google.com ([209.85.192.173]:63645 "EHLO mail-pd0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967915Ab3E3IpB (ORCPT ); Thu, 30 May 2013 04:45:01 -0400 Received: by mail-pd0-f173.google.com with SMTP id v14so9062059pde.32 for ; Thu, 30 May 2013 01:45:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:date:message-id:in-reply-to:references:subject; bh=56XAkTnu/5K58ozTx17mGbIURzJEIlpRNODNtJPo9Lg=; b=bcB5WHetVLkUhINOxPzL3CSscS15aUGHT418mQ4gk417yEfaqniUdQwusaQMTawUkD MJVTdt7ylwHF1qjsMjASAU08wfzM7FmbSn0InnE0vMOpM1dPkd1d2hm7POfaEkSHNQNN vfQaSXBWqwSYRSe1bim2XLQWf38ZYHjKhSPdaj5b8DwqzOOuxVhbmshvLMtmy34aB1kA IMQrZUlGgX/p5EoLXfiEiR8xQKbKXqS7mjIUx44gxtLDhajqHwujb2crAqVECPlfGrZH jliE3aq9Neq0Mj10RPf5tq7L3rY5m6Q8RLEk93OdMk+9PhhSku828A6fGmgX0rLnrYFE A7Cg== X-Received: by 10.66.240.41 with SMTP id vx9mr7355071pac.93.1369903500566; Thu, 30 May 2013 01:45:00 -0700 (PDT) Received: from [127.0.0.1] (49.14.32.202.bf.2iij.net. [202.32.14.49]) by mx.google.com with ESMTPSA id vb8sm41043210pbc.11.2013.05.30.01.44.57 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 30 May 2013 01:44:59 -0700 (PDT) From: Magnus Damm To: linux-sh@vger.kernel.org Cc: arnd@arndb.de, horms@verge.net.au, ulrich.hecht@gmail.com, olof@lixom.net, Magnus Damm , linux-arm-kernel@lists.infradead.org Date: Thu, 30 May 2013 17:52:20 +0900 Message-Id: <20130530085220.24374.94574.sendpatchset@w520> In-Reply-To: <20130530085152.24374.64208.sendpatchset@w520> References: <20130530085152.24374.64208.sendpatchset@w520> Subject: [PATCH 03/05] ARM: shmobile: r8a73a4 CA15 setup WFE as NOP Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org From: Magnus Damm 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 --- arch/arm/mach-shmobile/smp-r8a73a4.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- 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,