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: 9420951 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 70C90601C0 for ; Thu, 10 Nov 2016 11:55:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5CD352969C for ; Thu, 10 Nov 2016 11:55:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 518EB2969F; Thu, 10 Nov 2016 11:55:28 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 671CA2969C for ; Thu, 10 Nov 2016 11:55:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755428AbcKJLz0 (ORCPT ); Thu, 10 Nov 2016 06:55:26 -0500 Received: from mout.kundenserver.de ([217.72.192.73]:56622 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755189AbcKJLzZ (ORCPT ); Thu, 10 Nov 2016 06:55:25 -0500 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 Cc: Pankaj Dubey , linux-samsung-soc@vger.kernel.org, kgene@kernel.org, thomas.ab@samsung.com, krzk@kernel.org, Russell King 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 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.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 --- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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)