Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S938717AbcKNFBY (ORCPT ); Mon, 14 Nov 2016 00:01:24 -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 S936187AbcKNE7x (ORCPT ); Sun, 13 Nov 2016 23:59:53 -0500 X-AuditID: cbfee61a-f79916d0000062de-a2-582944bb0aef 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 , Michal Simek 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 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3230 Lines: 114 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); } -- 2.7.4