From patchwork Mon Nov 12 00:52:58 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 1726221 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 5467EDF288 for ; Mon, 12 Nov 2012 00:55:22 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TXiHC-0007uU-R4; Mon, 12 Nov 2012 00:53:22 +0000 Received: from mail.df.lth.se ([194.47.250.12]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TXiGs-0007qH-Mu for linux-arm-kernel@lists.infradead.org; Mon, 12 Nov 2012 00:53:04 +0000 Received: from mer.df.lth.se (mer.df.lth.se [194.47.250.37]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.df.lth.se (Postfix) with ESMTPS id 4139165D7B; Mon, 12 Nov 2012 01:53:00 +0100 (CET) Received: from mer.df.lth.se (triad@localhost.localdomain [127.0.0.1]) by mer.df.lth.se (8.14.3/8.14.3/Debian-9.4) with ESMTP id qAC0qx6K012997; Mon, 12 Nov 2012 01:53:00 +0100 Received: (from triad@localhost) by mer.df.lth.se (8.14.3/8.14.3/Submit) id qAC0qxK2012996; Mon, 12 Nov 2012 01:52:59 +0100 From: Linus Walleij To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 4/6] ARM: integrator: remove static CP syscon mapping Date: Mon, 12 Nov 2012 01:52:58 +0100 Message-Id: <1352681578-12969-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 1.7.2.5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121111_195303_116759_2081D78C X-CRM114-Status: GOOD ( 16.86 ) X-Spam-Score: -3.3 (---) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-3.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [194.47.250.12 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.7 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Linus Walleij , arm@kernel.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org This removes the static mapping for the CP system controller for the device tree case. Fork the static mappings table and move the system controller to only be statically mapped in the ATAG boot path. Signed-off-by: Linus Walleij --- arch/arm/mach-integrator/integrator_cp.c | 50 +++++++++++++++++++++----------- 1 file changed, 33 insertions(+), 17 deletions(-) diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c index 9194a4f..7220210 100644 --- a/arch/arm/mach-integrator/integrator_cp.c +++ b/arch/arm/mach-integrator/integrator_cp.c @@ -52,11 +52,13 @@ #include "common.h" +/* Base address to the CP controller */ +static void __iomem *intcp_con_base; + #define INTCP_PA_FLASH_BASE 0x24000000 #define INTCP_PA_CLCD_BASE 0xc0000000 -#define INTCP_VA_CTRL_BASE __io_address(INTEGRATOR_CP_CTL_BASE) #define INTCP_FLASHPROG 0x04 #define CINTEGRATOR_FLASHPROG_FLVPPEN (1 << 0) #define CINTEGRATOR_FLASHPROG_FLWREN (1 << 1) @@ -127,11 +129,6 @@ static struct map_desc intcp_io_desc[] __initdata = { .pfn = __phys_to_pfn(INTEGRATOR_CP_SIC_BASE), .length = SZ_4K, .type = MT_DEVICE - }, { - .virtual = IO_ADDRESS(INTEGRATOR_CP_CTL_BASE), - .pfn = __phys_to_pfn(INTEGRATOR_CP_CTL_BASE), - .length = SZ_4K, - .type = MT_DEVICE } }; @@ -147,9 +144,9 @@ static int intcp_flash_init(struct platform_device *dev) { u32 val; - val = readl(INTCP_VA_CTRL_BASE + INTCP_FLASHPROG); + val = readl(intcp_con_base + INTCP_FLASHPROG); val |= CINTEGRATOR_FLASHPROG_FLWREN; - writel(val, INTCP_VA_CTRL_BASE + INTCP_FLASHPROG); + writel(val, intcp_con_base + INTCP_FLASHPROG); return 0; } @@ -158,21 +155,21 @@ static void intcp_flash_exit(struct platform_device *dev) { u32 val; - val = readl(INTCP_VA_CTRL_BASE + INTCP_FLASHPROG); + val = readl(intcp_con_base + INTCP_FLASHPROG); val &= ~(CINTEGRATOR_FLASHPROG_FLVPPEN|CINTEGRATOR_FLASHPROG_FLWREN); - writel(val, INTCP_VA_CTRL_BASE + INTCP_FLASHPROG); + writel(val, intcp_con_base + INTCP_FLASHPROG); } static void intcp_flash_set_vpp(struct platform_device *pdev, int on) { u32 val; - val = readl(INTCP_VA_CTRL_BASE + INTCP_FLASHPROG); + val = readl(intcp_con_base + INTCP_FLASHPROG); if (on) val |= CINTEGRATOR_FLASHPROG_FLVPPEN; else val &= ~CINTEGRATOR_FLASHPROG_FLVPPEN; - writel(val, INTCP_VA_CTRL_BASE + INTCP_FLASHPROG); + writel(val, intcp_con_base + INTCP_FLASHPROG); } static struct physmap_flash_data intcp_flash_data = { @@ -191,7 +188,7 @@ static struct physmap_flash_data intcp_flash_data = { static unsigned int mmc_status(struct device *dev) { unsigned int status = readl(__io_address(0xca000000 + 4)); - writel(8, __io_address(INTEGRATOR_CP_CTL_BASE + 8)); + writel(8, intcp_con_base + 8); return status & 8; } @@ -337,9 +334,6 @@ static struct of_dev_auxdata intcp_auxdata_lookup[] __initdata = { { /* sentinel */ }, }; -/* Base address to the CP controller */ -static void __iomem *intcp_con_base; - static void __init intcp_init_of(void) { struct device_node *root; @@ -418,6 +412,28 @@ MACHINE_END #ifdef CONFIG_ATAGS /* + * For the ATAG boot some static mappings are needed. This will + * go away with the ATAG support down the road. + */ + +static struct map_desc intcp_io_desc_atag[] __initdata = { + { + .virtual = IO_ADDRESS(INTEGRATOR_CP_CTL_BASE), + .pfn = __phys_to_pfn(INTEGRATOR_CP_CTL_BASE), + .length = SZ_4K, + .type = MT_DEVICE + }, +}; + +static void __init intcp_map_io_atag(void) +{ + iotable_init(intcp_io_desc_atag, ARRAY_SIZE(intcp_io_desc_atag)); + intcp_con_base = __io_address(INTEGRATOR_CP_CTL_BASE); + intcp_map_io(); +} + + +/* * This is where non-devicetree initialization code is collected and stashed * for eventual deletion. */ @@ -556,7 +572,7 @@ MACHINE_START(CINTEGRATOR, "ARM-IntegratorCP") /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */ .atag_offset = 0x100, .reserve = integrator_reserve, - .map_io = intcp_map_io, + .map_io = intcp_map_io_atag, .nr_irqs = NR_IRQS_INTEGRATOR_CP, .init_early = intcp_init_early, .init_irq = intcp_init_irq,