From patchwork Mon Nov 14 05:02:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pankaj Dubey X-Patchwork-Id: 9426489 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 17C9660233 for ; Mon, 14 Nov 2016 05:07:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 05EA2288D8 for ; Mon, 14 Nov 2016 05:07:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EACCD288F8; Mon, 14 Nov 2016 05:07:25 +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 775BC288D8 for ; Mon, 14 Nov 2016 05:07:21 +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 1c69Sl-0004Ur-Kg; Mon, 14 Nov 2016 05:05:47 +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 1c69Mz-0005x4-8m for linux-arm-kernel@lists.infradead.org; Mon, 14 Nov 2016 04:59:51 +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:40 +0900 (KST) X-AuditID: cbfee61a-f79916d0000062de-a2-582944bb0aef Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1new.samsung.com (EPCPMTA) with SMTP id 34.33.25310.BB449285; Mon, 14 Nov 2016 13:59:39 +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:39 +0900 (KST) From: Pankaj Dubey To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 13/16] ARM: zynq: use generic API for enabling SCU Date: Mon, 14 Nov 2016 10:32:08 +0530 Message-id: <1479099731-28108-14-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+NgFlrIIsWRmVeSWpSXmKPExsVy+t9jQd3dLpoRBo8v2lj8nXSM3WLu7EmM Fs1bvzJanD+/gd1i0+NrrBaXd81hs3iw+i2bxbuXERaLtn5ht7jUP5HJYv63k6wWHcsYLTY/ OMbmwOtx+dpFZo/fvyYxekw8q+uxc9Zddo9NqzrZPDYvqffo27KK0WPOz28sHp83yXns/fyb JYArys0mIzUxJbVIITUvOT8lMy/dVik0xE3XQkkhLzE31VYpQtc3JEhJoSwxpxTIMzJAAw7O Ae7BSvp2CW4Zb7+sYSuYJFXR3TCdqYHxqWgXIyeHhICJxIcvq5khbDGJC/fWs3UxcnEICcxi lNg+ey8ThPOTUeLPpw6wKjYBXYkn7+eC2SICbhI3GjvAipgFFjNJHLo+hRUkISzgJNGxoJER xGYRUJU4/m8CmM0r4Cnx491HVoh1chI3z3WCDeIEis/pPMMGYgsJeEg8v3GdcQIj7wJGhlWM EqkFyQXFSem5hnmp5XrFibnFpXnpesn5uZsYwdHzTGoH48Fd7ocYBTgYlXh4D5hpRgixJpYV V+YeYpTgYFYS4XW1AQrxpiRWVqUW5ccXleakFh9iNAU6bCKzlGhyPjCy80riDU3MTcyNDSzM LS1NjJTEeRtnPwsXEkhPLEnNTk0tSC2C6WPi4JRqYFQKE3q5W4DHKX31h/KjzAzNH/6k7jde p/WvVka2JX3PcytOs36OJ1onRC/Pbrn4cNXJmMfMuzpeyPA9zX56qmjZrFBHpRMZM0wj3zes jfpfJ3p1g9zUpGlRDB37zt/fLffHpCbOsfeY2c7dPwz1jj5a7KR6l+lU8tljb3/cWVTKdv0X 0+w2ycVKLMUZiYZazEXFiQBEetXUtAIAAA== X-MTR: 20000000000000000@CPGS X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161113_205949_708305_517F98F8 X-CRM114-Status: GOOD ( 13.07 ) 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, Michal Simek , krzk@kernel.org, rmk+kernel@armlinux.org.uk, horms@verge.net.au, thomas.ab@samsung.com, Pankaj Dubey , 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. At the same time this patch cleans up mach-zynq platform files by removing static mapping of SCU and dropping zynq_scu_map_io and zynq_map_io functions. CC: Michal Simek Signed-off-by: Pankaj Dubey --- arch/arm/mach-zynq/common.c | 32 +------------------------------- arch/arm/mach-zynq/common.h | 2 -- arch/arm/mach-zynq/platsmp.c | 2 ++ 3 files changed, 3 insertions(+), 33 deletions(-) diff --git a/arch/arm/mach-zynq/common.c b/arch/arm/mach-zynq/common.c index d12002c..3986b2b 100644 --- a/arch/arm/mach-zynq/common.c +++ b/arch/arm/mach-zynq/common.c @@ -38,7 +38,6 @@ #include #include #include -#include #include #include @@ -48,8 +47,6 @@ #define ZYNQ_DEVCFG_PS_VERSION_SHIFT 28 #define ZYNQ_DEVCFG_PS_VERSION_MASK 0xF -void __iomem *zynq_scu_base; - /** * zynq_memory_init - Initialize special memory * @@ -153,33 +150,6 @@ static void __init zynq_timer_init(void) clocksource_probe(); } -static struct map_desc zynq_cortex_a9_scu_map __initdata = { - .length = SZ_256, - .type = MT_DEVICE, -}; - -static void __init zynq_scu_map_io(void) -{ - unsigned long base; - - base = scu_a9_get_base(); - zynq_cortex_a9_scu_map.pfn = __phys_to_pfn(base); - /* Expected address is in vmalloc area that's why simple assign here */ - zynq_cortex_a9_scu_map.virtual = base; - iotable_init(&zynq_cortex_a9_scu_map, 1); - zynq_scu_base = (void __iomem *)base; - BUG_ON(!zynq_scu_base); -} - -/** - * zynq_map_io - Create memory mappings needed for early I/O. - */ -static void __init zynq_map_io(void) -{ - debug_ll_io_init(); - zynq_scu_map_io(); -} - static void __init zynq_irq_init(void) { zynq_early_slcr_init(); @@ -196,7 +166,7 @@ DT_MACHINE_START(XILINX_EP107, "Xilinx Zynq Platform") .l2c_aux_val = 0x00400000, .l2c_aux_mask = 0xffbfffff, .smp = smp_ops(zynq_smp_ops), - .map_io = zynq_map_io, + .map_io = debug_ll_io_init, .init_irq = zynq_irq_init, .init_machine = zynq_init_machine, .init_late = zynq_init_late, diff --git a/arch/arm/mach-zynq/common.h b/arch/arm/mach-zynq/common.h index e771933..7c2f008 100644 --- a/arch/arm/mach-zynq/common.h +++ b/arch/arm/mach-zynq/common.h @@ -33,8 +33,6 @@ extern int zynq_cpun_start(u32 address, int cpu); extern const struct smp_operations zynq_smp_ops; #endif -extern void __iomem *zynq_scu_base; - void zynq_pm_late_init(void); static inline void zynq_core_pm_init(void) diff --git a/arch/arm/mach-zynq/platsmp.c b/arch/arm/mach-zynq/platsmp.c index 7cd9865..2d09119 100644 --- a/arch/arm/mach-zynq/platsmp.c +++ b/arch/arm/mach-zynq/platsmp.c @@ -33,6 +33,7 @@ * be called from zynq_cpun_start() because it is not in __init section. */ static int ncores; +static void __iomem *zynq_scu_base; int zynq_cpun_start(u32 address, int cpu) { @@ -108,6 +109,7 @@ static void __init zynq_smp_init_cpus(void) static void __init zynq_smp_prepare_cpus(unsigned int max_cpus) { + zynq_scu_base = of_scu_get_base(); scu_enable(zynq_scu_base); }