From patchwork Mon Nov 14 05:01:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pankaj Dubey X-Patchwork-Id: 9426499 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CE12F60233 for ; Mon, 14 Nov 2016 05:10:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BADCA288EA for ; Mon, 14 Nov 2016 05:10:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AD661288F4; Mon, 14 Nov 2016 05:10:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E152B288EA for ; Mon, 14 Nov 2016 05:10:28 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1c69Vs-0006r8-Ck; Mon, 14 Nov 2016 05:09:00 +0000 Received: from mailout2.samsung.com ([203.254.224.25]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1c69Ms-0005v1-Dg for linux-arm-kernel@lists.infradead.org; Mon, 14 Nov 2016 04:59:44 +0000 Received: from epcpsbgm2new.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OGM00F5D8INJL70@mailout2.samsung.com> for linux-arm-kernel@lists.infradead.org; Mon, 14 Nov 2016 13:59:20 +0900 (KST) X-AuditID: cbfee61b-f796f6d000004092-d2-582944a8c97a Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id 7F.56.16530.8A449285; Mon, 14 Nov 2016 13:59:20 +0900 (KST) Received: from pankaj.sisodomain.com ([107.108.83.125]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OGM009SR8IFBJ70@mmp2.samsung.com>; Mon, 14 Nov 2016 13:59:20 +0900 (KST) From: Pankaj Dubey To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 04/16] ARM: realview: use generic API for enabling SCU Date: Mon, 14 Nov 2016 10:31:59 +0530 Message-id: <1479099731-28108-5-git-send-email-pankaj.dubey@samsung.com> X-Mailer: git-send-email 2.7.4 In-reply-to: <1479099731-28108-1-git-send-email-pankaj.dubey@samsung.com> References: <1479099731-28108-1-git-send-email-pankaj.dubey@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprDIsWRmVeSWpSXmKPExsVy+t9jQd0VLpoRBt1TrSz+TjrGbjF39iRG i+atXxktzp/fwG6x6fE1VovLu+awWRyaupfR4sHqt2wWi7Z+Ybe41D+RyWL+t5OsFh3LGC02 PzjG5sDrcfnaRWaP378mMXpMPKvrsXPWXXaPTas62Tw2L6n36NuyitFjzs9vLB6fN8kFcEa5 2WSkJqakFimk5iXnp2TmpdsqhYa46VooKeQl5qbaKkXo+oYEKSmUJeaUAnlGBmjAwTnAPVhJ 3y7BLWPioXb2gqn8FW33XrE0MK7n6WLk5JAQMJG40N/IDmGLSVy4t56ti5GLQ0hgFqPE7Mst rBDOT0aJntndYFVsAroST97PZQaxRQTcJG40djCBFDELLGSSWLrjKFhCGChxdtsERhCbRUBV orlhCUsXIwcHr4CHxOFWH4htchI3z3WClXMKeErM6TzDBmILAZU8v3GdcQIj7wJGhlWMEqkF yQXFSem5Rnmp5XrFibnFpXnpesn5uZsYwTHzTHoH4+Fd7ocYBTgYlXh4O/I1IoRYE8uKK3MP MUpwMCuJ8LraaEYI8aYkVlalFuXHF5XmpBYfYjQFumsis5Rocj4wnvNK4g1NzE3MjQ0szC0t TYyUxHkbZz8LFxJITyxJzU5NLUgtgulj4uCUamDcJOXiHrDXfvP8twX+G+9MvmtSr2Yny2LD /2EBz8JkQX6F1Zty7abNmrvOuZj/dVaZvFreosOh2q4aid/UzC7bZLfsdPj1eeKLfQFLz6+y rU9oKPjaVaScorjLeJWhbu1VlUcSd862hL+ZeDQg2+em+F0x8+Y9Pt6XLwbM51yW03bc46Tj nxAlluKMREMt5qLiRADaclPcrwIAAA== X-MTR: 20000000000000000@CPGS X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161113_205942_963311_A7BFD134 X-CRM114-Status: GOOD ( 13.62 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: arnd@arndb.de, geert+renesas@glider.be, vireshk@kernel.org, magnus.damm@gmail.com, Russell King , krzk@kernel.org, rmk+kernel@armlinux.org.uk, horms@verge.net.au, thomas.ab@samsung.com, Pankaj Dubey , shiraz.linux.kernel@gmail.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Now as we have of_scu_enable which takes care of mapping scu base from DT, lets use it. Also this patch removes computation of number of cores from SCU, as for DT platform it will be taken care from DT CPU device nodes. CC: Russell King Signed-off-by: Pankaj Dubey --- arch/arm/mach-realview/platsmp-dt.c | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/arch/arm/mach-realview/platsmp-dt.c b/arch/arm/mach-realview/platsmp-dt.c index 70ca99e..b2dbf77 100644 --- a/arch/arm/mach-realview/platsmp-dt.c +++ b/arch/arm/mach-realview/platsmp-dt.c @@ -23,8 +23,6 @@ static const struct of_device_id realview_scu_match[] = { { .compatible = "arm,arm11mp-scu", }, - { .compatible = "arm,cortex-a9-scu", }, - { .compatible = "arm,cortex-a5-scu", }, { } }; @@ -41,27 +39,18 @@ static void __init realview_smp_prepare_cpus(unsigned int max_cpus) struct device_node *np; void __iomem *scu_base; struct regmap *map; - unsigned int ncores; int i; - np = of_find_matching_node(NULL, realview_scu_match); - if (!np) { - pr_err("PLATSMP: No SCU base address\n"); - return; + if (of_scu_enable()) { + np = of_find_matching_node(NULL, realview_scu_match); + scu_base = of_iomap(np, 0); + of_node_put(np); + if (!scu_base) { + pr_err("PLATSMP: No SCU remap\n"); + return; + } + scu_enable(scu_base); } - scu_base = of_iomap(np, 0); - of_node_put(np); - if (!scu_base) { - pr_err("PLATSMP: No SCU remap\n"); - return; - } - - scu_enable(scu_base); - ncores = scu_get_core_count(scu_base); - pr_info("SCU: %d cores detected\n", ncores); - for (i = 0; i < ncores; i++) - set_cpu_possible(i, true); - iounmap(scu_base); /* The syscon contains the magic SMP start address registers */ np = of_find_matching_node(NULL, realview_syscon_match);