From patchwork Sat May 31 07:40:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Shiyan X-Patchwork-Id: 4275041 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 93AC29F326 for ; Sat, 31 May 2014 07:43:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A919B20397 for ; Sat, 31 May 2014 07:43:11 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EA67520340 for ; Sat, 31 May 2014 07:43:09 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WqduO-00088M-Cx; Sat, 31 May 2014 07:40:52 +0000 Received: from smtp47.i.mail.ru ([94.100.177.107]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WqduK-00085r-U4 for linux-arm-kernel@lists.infradead.org; Sat, 31 May 2014 07:40:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.ru; s=mail2; h=Message-Id:Date:Subject:Cc:To:From; bh=pjy6wu+LdrRM3nkOOdUhF6P2YmxZ/i8WWrwMdQ+Idxg=; b=Eqa3hLxiNE5VTv9js0TsNCcWgvX+fcnfkLTNqevX/65zXyfwZXcauoxN71UN7WePuRI3K11X14WRLuUlgYwEVd4gHiNueR8xStLTfgXe8oSQUmqsqxCpzJ3laPNmcI6OsI9ZRskyhb31d0PrF91SyE07+OHnoGqeiqNhMLNMIFw=; Received: from [5.18.98.7] (port=51414 helo=shc.zet) by smtp47.i.mail.ru with esmtpa (envelope-from ) id 1Wqdtw-0001pQ-Ac; Sat, 31 May 2014 11:40:24 +0400 From: Alexander Shiyan To: linux-arm-kernel@lists.infradead.org Subject: [PATCH RFT] ARM: imx6q: Remove static memory mapping for SCU Date: Sat, 31 May 2014 11:40:16 +0400 Message-Id: <1401522016-25024-1-git-send-email-shc_work@mail.ru> X-Mailer: git-send-email 1.8.5.5 X-Mras: Ok X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140531_004049_611271_18E4EB6F X-CRM114-Status: GOOD ( 15.29 ) X-Spam-Score: -0.1 (/) Cc: Alexander Shiyan , Sascha Hauer , Shawn Guo X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Alexander Shiyan --- Completely untested. --- arch/arm/mach-imx/common.h | 1 - arch/arm/mach-imx/mach-imx6q.c | 8 +------- arch/arm/mach-imx/platsmp.c | 30 +++++++----------------------- 3 files changed, 8 insertions(+), 31 deletions(-) diff --git a/arch/arm/mach-imx/common.h b/arch/arm/mach-imx/common.h index 9586187..7fdbb18 100644 --- a/arch/arm/mach-imx/common.h +++ b/arch/arm/mach-imx/common.h @@ -96,7 +96,6 @@ u32 imx_get_cpu_arg(int cpu); void imx_set_cpu_arg(int cpu, u32 arg); #ifdef CONFIG_SMP void v7_secondary_startup(void); -void imx_scu_map_io(void); void imx_smp_prepare(void); void imx_scu_standby_enable(void); #else diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c index e60456d..f3a0170 100644 --- a/arch/arm/mach-imx/mach-imx6q.c +++ b/arch/arm/mach-imx/mach-imx6q.c @@ -381,12 +381,6 @@ static void __init imx6q_init_late(void) } } -static void __init imx6q_map_io(void) -{ - debug_ll_io_init(); - imx_scu_map_io(); -} - static void __init imx6q_init_irq(void) { imx_init_revision_from_anatop(); @@ -404,7 +398,7 @@ static const char *imx6q_dt_compat[] __initconst = { DT_MACHINE_START(IMX6Q, "Freescale i.MX6 Quad/DualLite (Device Tree)") .smp = smp_ops(imx_smp_ops), - .map_io = imx6q_map_io, + .map_io = debug_ll_io_init, .init_irq = imx6q_init_irq, .init_machine = imx6q_init_machine, .init_late = imx6q_init_late, diff --git a/arch/arm/mach-imx/platsmp.c b/arch/arm/mach-imx/platsmp.c index 5b57c17..4d3aba0 100644 --- a/arch/arm/mach-imx/platsmp.c +++ b/arch/arm/mach-imx/platsmp.c @@ -11,40 +11,18 @@ */ #include +#include #include #include -#include #include -#include #include "common.h" -#include "hardware.h" #define SCU_STANDBY_ENABLE (1 << 5) u32 g_diag_reg; static void __iomem *scu_base; -static struct map_desc scu_io_desc __initdata = { - /* .virtual and .pfn are run-time assigned */ - .length = SZ_4K, - .type = MT_DEVICE, -}; - -void __init imx_scu_map_io(void) -{ - unsigned long base; - - /* Get SCU base */ - asm("mrc p15, 4, %0, c15, c0, 0" : "=r" (base)); - - scu_io_desc.virtual = IMX_IO_P2V(base); - scu_io_desc.pfn = __phys_to_pfn(base); - iotable_init(&scu_io_desc, 1); - - scu_base = IMX_IO_ADDRESS(base); -} - void imx_scu_standby_enable(void) { u32 val = readl_relaxed(scu_base); @@ -66,8 +44,14 @@ static int imx_boot_secondary(unsigned int cpu, struct task_struct *idle) */ static void __init imx_smp_init_cpus(void) { + unsigned long base; int i, ncores; + /* Get SCU base */ + asm("mrc p15, 4, %0, c15, c0, 0" : "=r" (base)); + + scu_base = ioremap(base, SZ_4K); + ncores = scu_get_core_count(scu_base); for (i = ncores; i < NR_CPUS; i++)