Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965278AbcKNE7j (ORCPT ); Sun, 13 Nov 2016 23:59:39 -0500 Received: from mailout2.samsung.com ([203.254.224.25]:51703 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964831AbcKNE7d (ORCPT ); Sun, 13 Nov 2016 23:59:33 -0500 X-AuditID: cbfee61b-f796f6d000004092-d2-582944a8c97a From: Pankaj Dubey To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: rmk+kernel@armlinux.org.uk, arnd@arndb.de, horms@verge.net.au, magnus.damm@gmail.com, geert+renesas@glider.be, vireshk@kernel.org, shiraz.linux.kernel@gmail.com, krzk@kernel.org, thomas.ab@samsung.com, Pankaj Dubey , Russell King 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 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1874 Lines: 65 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); -- 2.7.4