From patchwork Mon Feb 17 06:31:52 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 3660091 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 E8BDDBF13A for ; Mon, 17 Feb 2014 06:31:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 221AA201F5 for ; Mon, 17 Feb 2014 06:31:13 +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 636AF201FD for ; Mon, 17 Feb 2014 06:31:11 +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 1WFHjP-0005Gg-17; Mon, 17 Feb 2014 06:31:07 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WFHjM-0000bf-MY; Mon, 17 Feb 2014 06:31:04 +0000 Received: from mail-pa0-x233.google.com ([2607:f8b0:400e:c03::233]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WFHjJ-0000b1-NB for linux-arm-kernel@lists.infradead.org; Mon, 17 Feb 2014 06:31:02 +0000 Received: by mail-pa0-f51.google.com with SMTP id ld10so14973302pab.10 for ; Sun, 16 Feb 2014 22:30:39 -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=1oYpAO5WyCc52FScqGegsmtidLiEQcrbcgjgr6JMnzo=; b=JDqKorKQgkqepATzMuyJYqdMZ6jdClJQYqaFT2HMJ4ooKt0plTPMKqq9KOw2iOEakj xXBNJhCjVPOHFzHZ5LubomXBDtHvjnqXYxx5YgNcQOMYj33mA5PL4dVoswNthlpHohOu sLRdheGjMPfBsdkHmja9ACSslKV6db4yMIHidCGsZuOxdNPpqiOyVUGS/F5fuxpkI+9U YO54Zi996tYvpD2jJmD+p22l9d4c19xFKUtpcrgfUTe+J8i7BESVLb5RVxx8pIEx/DNx vU2e9by23uakyGx6VHlilhlRxCZNxPfU5yitnnzjdly0pdjuEOWMraNCdKPkEGuhk5hG fcxg== X-Received: by 10.66.159.233 with SMTP id xf9mr6773506pab.139.1392618637484; Sun, 16 Feb 2014 22:30:37 -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 xs1sm109456079pac.7.2014.02.16.22.30.34 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 16 Feb 2014 22:30:36 -0800 (PST) From: Magnus Damm To: linux-sh@vger.kernel.org Date: Mon, 17 Feb 2014 15:31:52 +0900 Message-Id: <20140217063152.21876.6981.sendpatchset@w520> Subject: [PATCH] ARM: shmobile: Check MD21 at SMP boot in case of APMU X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140217_013101_875465_51D0860E X-CRM114-Status: UNSURE ( 9.34 ) X-CRM114-Notice: Please train this message. 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.6 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=unavailable 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 R-Car Gen2 SoCs such as r8a7790 and 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 boards with SW8-4 set to OFF will hang at SMP boot. Signed-off-by: Magnus Damm Acked-by: Geert Uytterhoeven --- Written against renesas-devel-v3.14-rc2-20140213 arch/arm/mach-shmobile/platsmp-apmu.c | 7 +++++++ 1 file changed, 7 insertions(+) --- 0001/arch/arm/mach-shmobile/platsmp-apmu.c +++ work/arch/arm/mach-shmobile/platsmp-apmu.c 2014-02-17 15:11:15.000000000 +0900 @@ -17,6 +17,7 @@ #include #include #include +#include static struct { void __iomem *iomem; @@ -136,6 +137,12 @@ void __init shmobile_smp_apmu_prepare_cp int shmobile_smp_apmu_boot_secondary(unsigned int cpu, struct task_struct *idle) { + /* Refrain boot when hardware debug mode is enabled */ + if (rcar_gen2_read_mode_pins() & BIT(21)) { + pr_warn("Unable to boot CPU%d when MD21 is set\n", cpu); + return -ENOTSUPP; + } + /* For this particular CPU register boot vector */ shmobile_smp_hook(cpu, virt_to_phys(shmobile_invalidate_start), 0);