From patchwork Thu Oct 15 06:59:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 7402951 X-Patchwork-Delegate: horms@verge.net.au Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 354EABEEA4 for ; Thu, 15 Oct 2015 06:59:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 659E120851 for ; Thu, 15 Oct 2015 06:59:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BEEEE20852 for ; Thu, 15 Oct 2015 06:59:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753704AbbJOG7r (ORCPT ); Thu, 15 Oct 2015 02:59:47 -0400 Received: from kirsty.vergenet.net ([202.4.237.240]:36826 "EHLO kirsty.vergenet.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753794AbbJOG7r (ORCPT ); Thu, 15 Oct 2015 02:59:47 -0400 Received: from reginn.isobedori.kobe.vergenet.net (p2250-ipbfp1101kobeminato.hyogo.ocn.ne.jp [122.22.210.250]) by kirsty.vergenet.net (Postfix) with ESMTPA id F3D1225B7D5; Thu, 15 Oct 2015 17:59:39 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=verge.net.au; s=mail; t=1444892380; bh=ZO7tMhBWQRl5qNGIhseqLM+UQPcqzSTu65sqKGLB220=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DQ4PAVgr4Mn0ZXd7/iefluuztPWM9lL9DSf4eobnX/FdgUlIlo9UdckxoTwaPsojg XRcau1ARQl/YF6Pwacw3ZUZIyjBa/yeONjIa8kVfx/GVIRkz+/v3UoilP1KTWNoIgm 0kSKEwCIL3hhnW1WKhoLQ8NwWuFIBRaFn9E5W2xY= Received: by reginn.isobedori.kobe.vergenet.net (Postfix, from userid 7100) id C885A942E7F; Thu, 15 Oct 2015 15:59:38 +0900 (JST) From: Simon Horman To: Laurent Pinchart Cc: linux-sh@vger.kernel.org, Magnus Damm , Simon Horman Subject: [PATCH/RFC 4/6] arm: shmobile: r8a7791: Obtain MD pin value using boot-mode-reg Date: Thu, 15 Oct 2015 15:59:35 +0900 Message-Id: <1444892377-10170-5-git-send-email-horms+renesas@verge.net.au> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1444892377-10170-1-git-send-email-horms+renesas@verge.net.au> References: <1444892377-10170-1-git-send-email-horms+renesas@verge.net.au> Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,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 Use new boot mode reg infrastructure to obtain the mode pin value when initialising SMP for r8a7791 SoC. Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/smp-r8a7791.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-shmobile/smp-r8a7791.c b/arch/arm/mach-shmobile/smp-r8a7791.c index b2508c0d276b..595499834293 100644 --- a/arch/arm/mach-shmobile/smp-r8a7791.c +++ b/arch/arm/mach-shmobile/smp-r8a7791.c @@ -20,6 +20,8 @@ #include +#include + #include "common.h" #include "platsmp-apmu.h" #include "r8a7791.h" @@ -45,8 +47,17 @@ static void __init r8a7791_smp_prepare_cpus(unsigned int max_cpus) static int r8a7791_smp_boot_secondary(unsigned int cpu, struct task_struct *idle) { + int err; + u32 mode; + + err = boot_mode_reg_get(&mode); + if (err) { + pr_warn("Unable retrieve boot mode register\n"); + return err; + } + /* Error out when hardware debug mode is enabled */ - if (rcar_gen2_read_mode_pins() & BIT(21)) { + if (mode & BIT(21)) { pr_warn("Unable to boot CPU%u when MD21 is set\n", cpu); return -ENOTSUPP; }