From patchwork Mon Nov 14 05:01:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pankaj Dubey X-Patchwork-Id: 9426457 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 7DE1260484 for ; Mon, 14 Nov 2016 05:02:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6C1A8288F7 for ; Mon, 14 Nov 2016 05:02:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5CC88288FA; Mon, 14 Nov 2016 05:02:39 +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 E3148288F7 for ; Mon, 14 Nov 2016 05:02:38 +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 1c69NQ-0006kO-F8; Mon, 14 Nov 2016 05:00:16 +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 1c69Mq-0005v1-G6 for linux-arm-kernel@lists.infradead.org; Mon, 14 Nov 2016 04:59:42 +0000 Received: from epcpsbgm1new.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OGM00LQ78IMQU50@mailout2.samsung.com> for linux-arm-kernel@lists.infradead.org; Mon, 14 Nov 2016 13:59:19 +0900 (KST) X-AuditID: cbfee61a-f79916d0000062de-80-582944a63651 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1new.samsung.com (EPCPMTA) with SMTP id F9.23.25310.6A449285; Mon, 14 Nov 2016 13:59:18 +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:18 +0900 (KST) From: Pankaj Dubey To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 03/16] ARM: berlin: use generic API for enabling SCU Date: Mon, 14 Nov 2016 10:31:58 +0530 Message-id: <1479099731-28108-4-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+NgFlrCIsWRmVeSWpSXmKPExsVy+t9jQd1lLpoRBo/vWVv8nXSM3WLu7EmM Fs1bvzJavDu+m8Xi/PkN7BabHl9jtbi8aw6bxYPVb9ksFm39wm5xqX8ik8X7n44W87+dZLXo WMZosfnBMTYHPo/L1y4ye/z+NYnRY+JZXY+ds+6ye2xa1cnmsXlJvcfkhUC5vi2rGD3m/PzG 4vF5k1wAV5SbTUZqYkpqkUJqXnJ+SmZeuq1SaIibroWSQl5ibqqtUoSub0iQkkJZYk4pkGdk gAYcnAPcg5X07RLcMlZu6WcqOMtTcW7VCeYGxn1cXYwcHBICJhIXp/t2MXICmWISF+6tZ+ti 5OIQEpjFKPFz7woo5yejRPP3bWwgVWwCuhJP3s9lBrFFBNwkbjR2MIEUMQvcZpL4Of8LC0hC WMBFoq3hFBvIBhYBVYkvi6JAwrwCHhKzf31jhNgmJ3HzXCfYHE4BT4k5nWfA5gsB1Ty/cZ1x AiPvAkaGVYwSqQXJBcVJ6bmGeanlesWJucWleel6yfm5mxjBMfRMagfjwV3uhxgFOBiVeHgP mGlGCLEmlhVX5h5ilOBgVhLhdbUBCvGmJFZWpRblxxeV5qQWH2I0BbprIrOUaHI+ML7zSuIN TcxNzI0NLMwtLU2MlMR5G2c/CxcSSE8sSc1OTS1ILYLpY+LglGpgPPz6Ctckb/FsUSvDzgzl 8zrTLaqDGu8G30+UdClpmtb+/WrF4Xuss+xmH/c//kt99R2X/21n3nrczXSYlXBj1dw3C77e OXl135v1UgFBNllzUzOqC44cehMhUr/C+O+R0GOWFQe//fHx/cfwPHC52Kb3/U7HLmtuezgp Sbs3oCPf7CO7g8DCTUosxRmJhlrMRcWJAEogC323AgAA X-MTR: 20000000000000000@CPGS X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161113_205940_939785_1F76517A X-CRM114-Status: GOOD ( 11.05 ) 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: Jisheng Zhang , arnd@arndb.de, geert+renesas@glider.be, vireshk@kernel.org, magnus.damm@gmail.com, krzk@kernel.org, rmk+kernel@armlinux.org.uk, horms@verge.net.au, thomas.ab@samsung.com, Pankaj Dubey , shiraz.linux.kernel@gmail.com, Sebastian Hesselbarth 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. CC: Jisheng Zhang CC: Sebastian Hesselbarth Signed-off-by: Pankaj Dubey --- arch/arm/mach-berlin/platsmp.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/arch/arm/mach-berlin/platsmp.c b/arch/arm/mach-berlin/platsmp.c index 93f9068..25a6ca5 100644 --- a/arch/arm/mach-berlin/platsmp.c +++ b/arch/arm/mach-berlin/platsmp.c @@ -60,26 +60,21 @@ static int berlin_boot_secondary(unsigned int cpu, struct task_struct *idle) static void __init berlin_smp_prepare_cpus(unsigned int max_cpus) { struct device_node *np; - void __iomem *scu_base; void __iomem *vectors_base; - np = of_find_compatible_node(NULL, NULL, "arm,cortex-a9-scu"); - scu_base = of_iomap(np, 0); - of_node_put(np); - if (!scu_base) - return; - np = of_find_compatible_node(NULL, NULL, "marvell,berlin-cpu-ctrl"); cpu_ctrl = of_iomap(np, 0); of_node_put(np); if (!cpu_ctrl) - goto unmap_scu; + return; vectors_base = ioremap(CONFIG_VECTORS_BASE, SZ_32K); if (!vectors_base) - goto unmap_scu; + return; + + if (of_scu_enable()) + return; - scu_enable(scu_base); flush_cache_all(); /* @@ -95,8 +90,6 @@ static void __init berlin_smp_prepare_cpus(unsigned int max_cpus) writel(virt_to_phys(secondary_startup), vectors_base + SW_RESET_ADDR); iounmap(vectors_base); -unmap_scu: - iounmap(scu_base); } #ifdef CONFIG_HOTPLUG_CPU