ARM: plat-omap: remove arch specific special handling for ioremap
authorNicolas Pitre <nicolas.pitre@linaro.org>
Wed, 14 Sep 2011 21:06:22 +0000 (17:06 -0400)
committerNicolas Pitre <nico@fluxnic.net>
Fri, 18 Nov 2011 18:51:02 +0000 (13:51 -0500)
A generic version should replace this later.

As io.c has become nearly empty, omap_init_consistent_dma_size() is moved
into common.c so that io.c can be removed entirely.

Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Tested-by: Kevin Hilman <khilman@ti.com>
arch/arm/mach-omap1/io.c
arch/arm/mach-omap2/io.c
arch/arm/plat-omap/Makefile
arch/arm/plat-omap/common.c
arch/arm/plat-omap/include/plat/io.h
arch/arm/plat-omap/io.c [deleted file]

index 7969cfd..8e55b6f 100644 (file)
@@ -121,7 +121,6 @@ void __init omap16xx_map_io(void)
 void omap1_init_early(void)
 {
        omap_check_revision();
-       omap_ioremap_init();
 
        /* REVISIT: Refer to OMAP5910 Errata, Advisory SYS_1: "Timeout Abort
         * on a Posted Write in the TIPB Bridge".
index 25d20ce..58ba784 100644 (file)
@@ -322,7 +322,6 @@ void __iomem *omap_irq_base;
 static void __init omap_common_init_early(void)
 {
        omap2_check_revision();
-       omap_ioremap_init();
        omap_init_consistent_dma_size();
 }
 
index 9852622..3df04d9 100644 (file)
@@ -4,7 +4,7 @@
 
 # Common support
 obj-y := common.o sram.o clock.o devices.o dma.o mux.o \
-        usb.o fb.o io.o counter_32k.o
+        usb.o fb.o counter_32k.o
 obj-m :=
 obj-n :=
 obj-  :=
index d9f10a3..7a4578b 100644 (file)
@@ -66,3 +66,10 @@ void __init omap_reserve(void)
        omap_vram_reserve_sdram_memblock();
        omap_dsp_reserve_sdram_memblock();
 }
+
+void __init omap_init_consistent_dma_size(void)
+{
+#ifdef CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE
+       init_consistent_dma_size(CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE << 20);
+#endif
+}
index 7f2969e..27d3897 100644 (file)
  * NOTE: Please use ioremap + __raw_read/write where possible instead of these
  */
 
-void omap_ioremap_init(void);
-
 extern u8 omap_readb(u32 pa);
 extern u16 omap_readw(u32 pa);
 extern u32 omap_readl(u32 pa);
@@ -328,12 +326,6 @@ extern void omap2_init_common_infrastructure(void);
 extern void omap_sdrc_init(struct omap_sdrc_params *sdrc_cs0,
                                      struct omap_sdrc_params *sdrc_cs1);
 
-#define __arch_ioremap omap_ioremap
-#define __arch_iounmap omap_iounmap
-
-void __iomem *omap_ioremap(unsigned long phys, size_t size, unsigned int type);
-void omap_iounmap(volatile void __iomem *addr);
-
 extern void __init omap_init_consistent_dma_size(void);
 
 #endif
diff --git a/arch/arm/plat-omap/io.c b/arch/arm/plat-omap/io.c
deleted file mode 100644 (file)
index 333871f..0000000
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * Common io.c file
- * This file is created by Russell King <rmk+kernel@arm.linux.org.uk>
- *
- * Copyright (C) 2009 Texas Instruments
- * Added OMAP4 support - Santosh Shilimkar <santosh.shilimkar@ti.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-#include <linux/module.h>
-#include <linux/io.h>
-#include <linux/mm.h>
-#include <linux/dma-mapping.h>
-
-#include <plat/omap7xx.h>
-#include <plat/omap1510.h>
-#include <plat/omap16xx.h>
-#include <plat/omap24xx.h>
-#include <plat/omap34xx.h>
-#include <plat/omap44xx.h>
-
-#define BETWEEN(p,st,sz)       ((p) >= (st) && (p) < ((st) + (sz)))
-#define XLATE(p,pst,vst)       ((void __iomem *)((p) - (pst) + (vst)))
-
-static int initialized;
-
-/*
- * Intercept ioremap() requests for addresses in our fixed mapping regions.
- */
-void __iomem *omap_ioremap(unsigned long p, size_t size, unsigned int type)
-{
-
-       WARN(!initialized, "Do not use ioremap before init_early\n");
-
-#ifdef CONFIG_ARCH_OMAP1
-       if (cpu_class_is_omap1()) {
-               if (BETWEEN(p, OMAP1_IO_PHYS, OMAP1_IO_SIZE))
-                       return XLATE(p, OMAP1_IO_PHYS, OMAP1_IO_VIRT);
-       }
-       if (cpu_is_omap7xx()) {
-               if (BETWEEN(p, OMAP7XX_DSP_BASE, OMAP7XX_DSP_SIZE))
-                       return XLATE(p, OMAP7XX_DSP_BASE, OMAP7XX_DSP_START);
-
-               if (BETWEEN(p, OMAP7XX_DSPREG_BASE, OMAP7XX_DSPREG_SIZE))
-                       return XLATE(p, OMAP7XX_DSPREG_BASE,
-                                       OMAP7XX_DSPREG_START);
-       }
-       if (cpu_is_omap15xx()) {
-               if (BETWEEN(p, OMAP1510_DSP_BASE, OMAP1510_DSP_SIZE))
-                       return XLATE(p, OMAP1510_DSP_BASE, OMAP1510_DSP_START);
-
-               if (BETWEEN(p, OMAP1510_DSPREG_BASE, OMAP1510_DSPREG_SIZE))
-                       return XLATE(p, OMAP1510_DSPREG_BASE,
-                                       OMAP1510_DSPREG_START);
-       }
-       if (cpu_is_omap16xx()) {
-               if (BETWEEN(p, OMAP16XX_DSP_BASE, OMAP16XX_DSP_SIZE))
-                       return XLATE(p, OMAP16XX_DSP_BASE, OMAP16XX_DSP_START);
-
-               if (BETWEEN(p, OMAP16XX_DSPREG_BASE, OMAP16XX_DSPREG_SIZE))
-                       return XLATE(p, OMAP16XX_DSPREG_BASE,
-                                       OMAP16XX_DSPREG_START);
-       }
-#endif
-#ifdef CONFIG_ARCH_OMAP2
-       if (cpu_is_omap24xx()) {
-               if (BETWEEN(p, L3_24XX_PHYS, L3_24XX_SIZE))
-                       return XLATE(p, L3_24XX_PHYS, L3_24XX_VIRT);
-               if (BETWEEN(p, L4_24XX_PHYS, L4_24XX_SIZE))
-                       return XLATE(p, L4_24XX_PHYS, L4_24XX_VIRT);
-       }
-       if (cpu_is_omap2420()) {
-               if (BETWEEN(p, DSP_MEM_2420_PHYS, DSP_MEM_2420_SIZE))
-                       return XLATE(p, DSP_MEM_2420_PHYS, DSP_MEM_2420_VIRT);
-               if (BETWEEN(p, DSP_IPI_2420_PHYS, DSP_IPI_2420_SIZE))
-                       return XLATE(p, DSP_IPI_2420_PHYS, DSP_IPI_2420_SIZE);
-               if (BETWEEN(p, DSP_MMU_2420_PHYS, DSP_MMU_2420_SIZE))
-                       return XLATE(p, DSP_MMU_2420_PHYS, DSP_MMU_2420_VIRT);
-       }
-       if (cpu_is_omap2430()) {
-               if (BETWEEN(p, L4_WK_243X_PHYS, L4_WK_243X_SIZE))
-                       return XLATE(p, L4_WK_243X_PHYS, L4_WK_243X_VIRT);
-               if (BETWEEN(p, OMAP243X_GPMC_PHYS, OMAP243X_GPMC_SIZE))
-                       return XLATE(p, OMAP243X_GPMC_PHYS, OMAP243X_GPMC_VIRT);
-               if (BETWEEN(p, OMAP243X_SDRC_PHYS, OMAP243X_SDRC_SIZE))
-                       return XLATE(p, OMAP243X_SDRC_PHYS, OMAP243X_SDRC_VIRT);
-               if (BETWEEN(p, OMAP243X_SMS_PHYS, OMAP243X_SMS_SIZE))
-                       return XLATE(p, OMAP243X_SMS_PHYS, OMAP243X_SMS_VIRT);
-       }
-#endif
-#ifdef CONFIG_ARCH_OMAP3
-       if (cpu_is_ti816x()) {
-               if (BETWEEN(p, L4_34XX_PHYS, L4_34XX_SIZE))
-                       return XLATE(p, L4_34XX_PHYS, L4_34XX_VIRT);
-       } else if (cpu_is_omap34xx()) {
-               if (BETWEEN(p, L3_34XX_PHYS, L3_34XX_SIZE))
-                       return XLATE(p, L3_34XX_PHYS, L3_34XX_VIRT);
-               if (BETWEEN(p, L4_34XX_PHYS, L4_34XX_SIZE))
-                       return XLATE(p, L4_34XX_PHYS, L4_34XX_VIRT);
-               if (BETWEEN(p, OMAP34XX_GPMC_PHYS, OMAP34XX_GPMC_SIZE))
-                       return XLATE(p, OMAP34XX_GPMC_PHYS, OMAP34XX_GPMC_VIRT);
-               if (BETWEEN(p, OMAP343X_SMS_PHYS, OMAP343X_SMS_SIZE))
-                       return XLATE(p, OMAP343X_SMS_PHYS, OMAP343X_SMS_VIRT);
-               if (BETWEEN(p, OMAP343X_SDRC_PHYS, OMAP343X_SDRC_SIZE))
-                       return XLATE(p, OMAP343X_SDRC_PHYS, OMAP343X_SDRC_VIRT);
-               if (BETWEEN(p, L4_PER_34XX_PHYS, L4_PER_34XX_SIZE))
-                       return XLATE(p, L4_PER_34XX_PHYS, L4_PER_34XX_VIRT);
-               if (BETWEEN(p, L4_EMU_34XX_PHYS, L4_EMU_34XX_SIZE))
-                       return XLATE(p, L4_EMU_34XX_PHYS, L4_EMU_34XX_VIRT);
-       }
-#endif
-#ifdef CONFIG_ARCH_OMAP4
-       if (cpu_is_omap44xx()) {
-               if (BETWEEN(p, L3_44XX_PHYS, L3_44XX_SIZE))
-                       return XLATE(p, L3_44XX_PHYS, L3_44XX_VIRT);
-               if (BETWEEN(p, L4_44XX_PHYS, L4_44XX_SIZE))
-                       return XLATE(p, L4_44XX_PHYS, L4_44XX_VIRT);
-               if (BETWEEN(p, OMAP44XX_GPMC_PHYS, OMAP44XX_GPMC_SIZE))
-                       return XLATE(p, OMAP44XX_GPMC_PHYS, OMAP44XX_GPMC_VIRT);
-               if (BETWEEN(p, OMAP44XX_EMIF1_PHYS, OMAP44XX_EMIF1_SIZE))
-                       return XLATE(p, OMAP44XX_EMIF1_PHYS,            \
-                                                       OMAP44XX_EMIF1_VIRT);
-               if (BETWEEN(p, OMAP44XX_EMIF2_PHYS, OMAP44XX_EMIF2_SIZE))
-                       return XLATE(p, OMAP44XX_EMIF2_PHYS,            \
-                                                       OMAP44XX_EMIF2_VIRT);
-               if (BETWEEN(p, OMAP44XX_DMM_PHYS, OMAP44XX_DMM_SIZE))
-                       return XLATE(p, OMAP44XX_DMM_PHYS, OMAP44XX_DMM_VIRT);
-               if (BETWEEN(p, L4_PER_44XX_PHYS, L4_PER_44XX_SIZE))
-                       return XLATE(p, L4_PER_44XX_PHYS, L4_PER_44XX_VIRT);
-               if (BETWEEN(p, L4_EMU_44XX_PHYS, L4_EMU_44XX_SIZE))
-                       return XLATE(p, L4_EMU_44XX_PHYS, L4_EMU_44XX_VIRT);
-       }
-#endif
-       return __arm_ioremap_caller(p, size, type, __builtin_return_address(0));
-}
-EXPORT_SYMBOL(omap_ioremap);
-
-void omap_iounmap(volatile void __iomem *addr)
-{
-       unsigned long virt = (unsigned long)addr;
-
-       if (virt >= VMALLOC_START && virt < VMALLOC_END)
-               __iounmap(addr);
-}
-EXPORT_SYMBOL(omap_iounmap);
-
-void __init omap_init_consistent_dma_size(void)
-{
-#ifdef CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE
-       init_consistent_dma_size(CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE << 20);
-#endif
-}
-
-void __init omap_ioremap_init(void)
-{
-       initialized++;
-}