From patchwork Wed Feb 26 09:59:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 3722961 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1516ABF13A for ; Wed, 26 Feb 2014 10:05:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0CB712018E for ; Wed, 26 Feb 2014 10:05:19 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1EEC520149 for ; Wed, 26 Feb 2014 10:05:18 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WIbMY-0002VQ-8S; Wed, 26 Feb 2014 10:05:14 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WIbMV-0000cp-Rl; Wed, 26 Feb 2014 10:05:11 +0000 Received: from mail-pd0-x230.google.com ([2607:f8b0:400e:c02::230]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WIbMT-0000cL-7F for linux-arm-kernel@lists.infradead.org; Wed, 26 Feb 2014 10:05:09 +0000 Received: by mail-pd0-f176.google.com with SMTP id r10so749617pdi.7 for ; Wed, 26 Feb 2014 02:04:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:date:message-id:subject; bh=i7cbpDsF31XLb/DWFzFQRstC9L5Su/RvrjKP18nvLKc=; b=gjKyIPVMK9ZCyM2Q56lneqTXnTZthg2B+LEXOK3cPHfP2IrCxcXQQCXM47LNnqeFmm 2r6W4Yu6TV54grL+P1iHxMgL2XgebrbGsH/ZSpmHoNWffHZYU2+YJG+BqHrMz6f4LQAJ 7+RI3Lcm4spwi8U33/cfXVQF7uHUjg1asISywGacyTqAt8wuqvbMuW5XCaby2+pN4TXY GJR4F7D10/7Qingvgn0P+jB6SLV+AGCdZwtyQxpjyIuZpNYWK6HI0rxicuxn6OnYB49D mbwLPtMEskMuInT/xYAwxYr6sU5qfzYNRbAkORjgDmYl8izQ1KBZGsxr1u5MAzhs/+fp WAUQ== X-Received: by 10.68.172.37 with SMTP id az5mr5553046pbc.139.1393408678150; Wed, 26 Feb 2014 01:57:58 -0800 (PST) Received: from [127.0.0.1] (s214090.ppp.asahi-net.or.jp. [220.157.214.90]) by mx.google.com with ESMTPSA id lb4sm1574532pbc.11.2014.02.26.01.57.55 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Feb 2014 01:57:56 -0800 (PST) From: Magnus Damm To: linux-sh@vger.kernel.org Date: Wed, 26 Feb 2014 18:59:16 +0900 Message-Id: <20140226095916.15676.99394.sendpatchset@w520> Subject: [PATCH] ARM: shmobile: Check r8a7791 MD21 at SMP boot X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140226_050509_338124_D266EAF5 X-CRM114-Status: GOOD ( 11.20 ) X-Spam-Score: -2.0 (--) Cc: geert@linux-m68k.org, horms@verge.net.au, Magnus Damm , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Magnus Damm On r8a7791 the hardware boot mode bit MD21 indicates if hardware debug mode is enabled or not. In case hardware debug mode is enabled print a warning and refrain from booting secondary CPU cores. Without this patch Koelsch with SW8-4 set to OFF will hang at SMP boot. Signed-off-by: Magnus Damm Tested-by: Geert Uytterhoeven --- This is a reworked version of the APMU patch previously posted as [PATCH] ARM: shmobile: Check MD21 at SMP boot in case of APMU Written against renesas-devel-v3.14-rc4-20140226 arch/arm/mach-shmobile/smp-r8a7791.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) --- 0001/arch/arm/mach-shmobile/smp-r8a7791.c +++ work/arch/arm/mach-shmobile/smp-r8a7791.c 2014-02-26 18:49:39.000000000 +0900 @@ -20,6 +20,7 @@ #include #include #include +#include #define RST 0xe6160000 #define CA15BAR 0x0020 @@ -51,9 +52,21 @@ static void __init r8a7791_smp_prepare_c iounmap(p); } +static int r8a7791_smp_boot_secondary(unsigned int cpu, + struct task_struct *idle) +{ + /* Error out when hardware debug mode is enabled */ + if (rcar_gen2_read_mode_pins() & BIT(21)) { + pr_warn("Unable to boot CPU%u when MD21 is set\n", cpu); + return -ENOTSUPP; + } + + return shmobile_smp_apmu_boot_secondary(cpu, idle); +} + struct smp_operations r8a7791_smp_ops __initdata = { .smp_prepare_cpus = r8a7791_smp_prepare_cpus, - .smp_boot_secondary = shmobile_smp_apmu_boot_secondary, + .smp_boot_secondary = r8a7791_smp_boot_secondary, #ifdef CONFIG_HOTPLUG_CPU .cpu_disable = shmobile_smp_cpu_disable, .cpu_die = shmobile_smp_apmu_cpu_die,