From patchwork Mon Nov 14 05:02:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pankaj Dubey X-Patchwork-Id: 9426491 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 C673560233 for ; Mon, 14 Nov 2016 05:08:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B580F28872 for ; Mon, 14 Nov 2016 05:08:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A73F828876; Mon, 14 Nov 2016 05:08:02 +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 1320828872 for ; Mon, 14 Nov 2016 05:08:02 +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 1c69TR-0004zg-Gs; Mon, 14 Nov 2016 05:06:29 +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 1c69N0-0005v1-Vq for linux-arm-kernel@lists.infradead.org; Mon, 14 Nov 2016 04:59:53 +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:42 +0900 (KST) X-AuditID: cbfee61a-f79916d0000062de-a5-582944bd4ea1 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1new.samsung.com (EPCPMTA) with SMTP id 55.33.25310.DB449285; Mon, 14 Nov 2016 13:59:41 +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:41 +0900 (KST) From: Pankaj Dubey To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 14/16] ARM: hisi: use generic API for enabling SCU Date: Mon, 14 Nov 2016 10:32:09 +0530 Message-id: <1479099731-28108-15-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+NgFlrEIsWRmVeSWpSXmKPExsVy+t9jQd29LpoRBl8fW1n8nXSM3WLu7EmM Fs1bvzJanD+/gd1i0+NrrBaXd81hs3iw+i2bxaKtX9gtLvVPZLKY/+0kq0XHMkaLzQ+OsVk8 OTqF2YHX4/K1i8wev39NYvSYeFbXY+esu+wej+duZPfYtKqTzWPzknqPvi2rGD3m/PzG4vF5 k1wAV5SbTUZqYkpqkUJqXnJ+SmZeuq1SaIibroWSQl5ibqqtUoSub0iQkkJZYk4pkGdkgAYc nAPcg5X07RLcMk792s1YcICnYser+UwNjPO4uhg5OSQETCQ27HvJAmGLSVy4t56ti5GLQ0hg FqPE9bOHmSGcn4wSF791soFUsQnoSjx5P5cZxBYRcJO40djBBFLELDCLSeLS0b9MIAlhASeJ W1OXgxWxCKhKfP7QzQpi8wp4Spx7cZoVYp2cxM1znWA1nEDxOZ1nwBYICXhIPL9xnXECI+8C RoZVjBKpBckFxUnpuYZ5qeV6xYm5xaV56XrJ+bmbGMHx80xqB+PBXe6HGAU4GJV4eA+YaUYI sSaWFVfmHmKU4GBWEuF1tQEK8aYkVlalFuXHF5XmpBYfYjQFOmwis5Rocj4wtvNK4g1NzE3M jQ0szC0tTYyUxHkbZz8LFxJITyxJzU5NLUgtgulj4uCUamAsuSJyY5mz4FUB7pwcGdFkZ+XW T1NXajvaPdr/jmf1l4NRybliq0ymiso6zmOvDe7bc1iy5/nuA+tZtnN4nddtEly2p11L/+Pq RZMSP/EI20TdkBUS+s5XqDRlcUUdd90eb8M3pfp3xZ8d+TH52+7qxycFGtfn/xBfPMvywHee yReNjoYbRucpsRRnJBpqMRcVJwIAIyVKcbUCAAA= X-MTR: 20000000000000000@CPGS X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161113_205951_449460_E2BCEED9 X-CRM114-Status: GOOD ( 11.45 ) 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, krzk@kernel.org, rmk+kernel@armlinux.org.uk, horms@verge.net.au, thomas.ab@samsung.com, Pankaj Dubey , Wei Xu , 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. CC: Wei Xu Signed-off-by: Pankaj Dubey --- arch/arm/mach-hisi/platsmp.c | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/arch/arm/mach-hisi/platsmp.c b/arch/arm/mach-hisi/platsmp.c index e1d6764..425a291 100644 --- a/arch/arm/mach-hisi/platsmp.c +++ b/arch/arm/mach-hisi/platsmp.c @@ -39,29 +39,14 @@ int hi3xxx_get_cpu_jump(int cpu) return readl_relaxed(ctrl_base + ((cpu - 1) << 2)); } -static void __init hisi_enable_scu_a9(void) -{ - unsigned long base = 0; - void __iomem *scu_base = NULL; - - if (scu_a9_has_base()) { - base = scu_a9_get_base(); - scu_base = ioremap(base, SZ_4K); - if (!scu_base) { - pr_err("ioremap(scu_base) failed\n"); - return; - } - scu_enable(scu_base); - iounmap(scu_base); - } -} - static void __init hi3xxx_smp_prepare_cpus(unsigned int max_cpus) { struct device_node *np = NULL; u32 offset = 0; - hisi_enable_scu_a9(); + if (scu_a9_has_base()) + of_scu_enable(); + if (!ctrl_base) { np = of_find_compatible_node(NULL, NULL, "hisilicon,sysctrl"); if (!np) { @@ -100,7 +85,8 @@ static const struct smp_operations hi3xxx_smp_ops __initconst = { static void __init hisi_common_smp_prepare_cpus(unsigned int max_cpus) { - hisi_enable_scu_a9(); + if (scu_a9_has_base()) + of_scu_enable(); } static void hix5hd2_set_scu_boot_addr(phys_addr_t start_addr, phys_addr_t jump_addr)