From patchwork Thu Nov 10 11:54:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9420955 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 416EC601C0 for ; Thu, 10 Nov 2016 11:56:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2D04C2969D for ; Thu, 10 Nov 2016 11:56:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1FEA0296A0; Thu, 10 Nov 2016 11:56:44 +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=unavailable 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 A1D032969D for ; Thu, 10 Nov 2016 11:56:43 +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 1c4nx3-0008OL-9X; Thu, 10 Nov 2016 11:55:29 +0000 Received: from mout.kundenserver.de ([217.72.192.73]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1c4nws-0007Dt-0R for linux-arm-kernel@lists.infradead.org; Thu, 10 Nov 2016 11:55:20 +0000 Received: from wuerfel.localnet ([78.43.20.153]) by mrelayeu.kundenserver.de (mreue101 [212.227.15.145]) with ESMTPSA (Nemesis) id 0M6DoA-1d2qeT3VEI-00y8bz; Thu, 10 Nov 2016 12:54:47 +0100 From: Arnd Bergmann To: linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v3 1/2] ARM: EXYNOS: Remove static mapping of SCU SFR Date: Thu, 10 Nov 2016 12:54:44 +0100 Message-ID: <5066943.nydi3GQ3KP@wuerfel> User-Agent: KMail/5.1.3 (Linux/4.4.0-34-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: <1478693755-11953-2-git-send-email-pankaj.dubey@samsung.com> References: <1478693755-11953-1-git-send-email-pankaj.dubey@samsung.com> <1478693755-11953-2-git-send-email-pankaj.dubey@samsung.com> MIME-Version: 1.0 X-Provags-ID: V03:K0:NFSXQ6r5O8AVjEQkXk6uH4MObiSeBTB1teXbEHZ68hEYFW5nFUJ Ww5EzSDRf6X7RiUoTD3cj75gskbZeHzslsiHcMRQ8duNyZuiL1AUV1KHgFBkdzXu0vXpcFi 8z2HeV458OWuvPpZb8ggPQAZHunwMiLNQTQqdNnb0NY2w38JBb8XTRg/mMF2NouhEiCUakS YB9tV9UpuGb1PQwktej3A== X-UI-Out-Filterresults: notjunk:1; V01:K0:sRYN0E3zmUw=:8jmmn2/LAz7MEiHHjjloMg AM0VDMFjGsU0t6FXBvwINdd1yZ+CjwuDzaxBdYH7L0/BSuw61PZ1kpuAo48bn6+PW70cKYenw mhZnA6HKysFpvw9VJfbI6wodzgnM7aCU7O93MSVtLglFAhkEUbPeJ9i97jpZ8F0boOoo33rA8 SWpGwDeswHJuak6dlTeWslQYYRv8ma6xEJf+5akKcgdksOIU2gRvmtwopDKiknSWyJBO2F0Pa iMtD/Js/4a0ussqjYNbMHY8hyE8vsp7qkCQQnd44bQrNiRGc32nLNbuqYW1qgAIsQFmS3GIhT PPA0Pw8K2yBDs+I8ZHrWlW1YqZlZFR0TSc2tQW1uOkMBeykl2FuBVuMWkAT8uQEXi52l6frhX ZMM4+ldjVZVr8NFTpvC5NnfL10+MeuZA31D1OJ0m7v/OVuFpPmQIxdsF/uqx1x66i/kDIK96Y wZIvLGmyBYQVu6Vng6/F+Xo16AJS0yirGOG8RcqlI9f3PUPVDlVE/Yvsnu2kkfQcCajAe/K1a Sr5CnB7TP39TJP9v6Ds879MbnQRzD4IEEtkptkZZkAj3nbADHbWMgve1nCHmGO/JkG6HkRQ+a STK1ph5odAhLMi5GPMK/Fd9/qNZz5b220aQJbbPbWcaqiW20/SjXDu0vQJPPUbqOjdhH3eHro c/nnub7BEXhxyU63TDsjuiZr0qkfzhn329ltHOvskAHD9b7ZfHD2nykRVJvgYQVMuZJmdLCbh wBXiNMNCM9SeNsrs X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161110_035518_456473_CED221FE X-CRM114-Status: GOOD ( 18.60 ) 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: linux-samsung-soc@vger.kernel.org, Pankaj Dubey , krzk@kernel.org, Russell King , thomas.ab@samsung.com, kgene@kernel.org 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 On Wednesday, November 9, 2016 5:45:54 PM CET Pankaj Dubey wrote: > Lets remove static mapping of SCU SFR mainly used in CORTEX-A9 SoC based > boards. Instead use mapping from device tree node of SCU. > > NOTE: This patch has dependency on DT file of any such CORTEX-A9 SoC > based boards, in the absence of SCU device node in DTS file, only single > CPU will boot. So if you are using OUT-OF-TREE DTS file of CORTEX-A9 based > Exynos SoC make sure to add SCU device node to DTS file for SMP boot. > > Signed-off-by: Pankaj Dubey > Reviewed-by: Alim Akhtar With CONFIG_SMP disabled, I now get this build failure: arch/arm/mach-exynos/pm.o: In function `exynos_enter_aftr': pm.c:(.text.exynos_enter_aftr+0xec): undefined reference to `exynos_scu_enable' arch/arm/mach-exynos/suspend.o: In function `exynos_pm_resume': suspend.c:(.text.exynos_pm_resume+0x78): undefined reference to `exynos_scu_enable' Please fix. I have applied a patch locally (see below), but don't know if that is the best solution. As we seem to duplicate that code across several platforms, I wonder why we don't just put it into the core scu implementation. Arnd commit ad63b863bb78188fbe9608cfad629c86bd579dc0 Author: Arnd Bergmann Date: Thu Nov 10 12:51:43 2016 +0100 ARM: exynos: move exynos_scu_enable to main file arch/arm/mach-exynos/pm.o: In function `exynos_enter_aftr': pm.c:(.text.exynos_enter_aftr+0xec): undefined reference to `exynos_scu_enable' arch/arm/mach-exynos/suspend.o: In function `exynos_pm_resume': suspend.c:(.text.exynos_pm_resume+0x78): undefined reference to `exynos_scu_enable' Signed-off-by: Arnd Bergmann diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c index fa08ef99b4ad..784c6d47af17 100644 --- a/arch/arm/mach-exynos/exynos.c +++ b/arch/arm/mach-exynos/exynos.c @@ -39,6 +39,27 @@ static struct platform_device exynos_cpuidle = { void __iomem *sysram_base_addr; void __iomem *sysram_ns_base_addr; +/** + * exynos_scu_enable : enables SCU for Cortex-A9 based system + * returns 0 on success else non-zero error code + */ +int exynos_scu_enable(void) +{ + struct device_node *np; + void __iomem *scu_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) { + pr_err("%s failed to map scu_base\n", __func__); + return -ENOMEM; + } + scu_enable(scu_base); + iounmap(scu_base); + return 0; +} + void __init exynos_sysram_init(void) { struct device_node *node; diff --git a/arch/arm/mach-exynos/platsmp.c b/arch/arm/mach-exynos/platsmp.c index 94405c72d245..4ad376637a34 100644 --- a/arch/arm/mach-exynos/platsmp.c +++ b/arch/arm/mach-exynos/platsmp.c @@ -168,27 +168,6 @@ int exynos_cluster_power_state(int cluster) S5P_CORE_LOCAL_PWR_EN); } -/** - * exynos_scu_enable : enables SCU for Cortex-A9 based system - * returns 0 on success else non-zero error code - */ -int exynos_scu_enable(void) -{ - struct device_node *np; - void __iomem *scu_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) { - pr_err("%s failed to map scu_base\n", __func__); - return -ENOMEM; - } - scu_enable(scu_base); - iounmap(scu_base); - return 0; -} - static void __iomem *cpu_boot_reg_base(void) { if (soc_is_exynos4210() && samsung_rev() == EXYNOS4210_REV_1_1)