Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965917AbcKNFAL (ORCPT ); Mon, 14 Nov 2016 00:00:11 -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 S936621AbcKNFAB (ORCPT ); Mon, 14 Nov 2016 00:00:01 -0500 X-AuditID: cbfee61a-f79916d0000062de-a5-582944bd4ea1 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 , Wei Xu 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 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1540 Lines: 58 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) -- 2.7.4