]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
ARM: OMAP: Fix __arch_ioremap for 34xx
authorTony Lindgren <tony@atomide.com>
Thu, 4 Sep 2008 20:03:08 +0000 (13:03 -0700)
committerTony Lindgren <tony@atomide.com>
Thu, 4 Sep 2008 20:06:03 +0000 (13:06 -0700)
Also modify for the mappings in linux-omap tree.

Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/plat-omap/include/mach/io.h
arch/arm/plat-omap/io.c

index 447cd12e4120687aa2f94bdb745ee66643045bd7..265833763c5b26a81e6079d314934e1418d576bc 100644 (file)
@@ -74,7 +74,6 @@
 #define L4_24XX_VIRT   0xd8000000
 #define L4_24XX_SIZE   SZ_1M           /* 1MB of 128MB used, want 1MB sect */
 
-#ifdef CONFIG_ARCH_OMAP2430
 #define L4_WK_243X_PHYS                L4_WK_243X_BASE         /* 0x49000000 */
 #define L4_WK_243X_VIRT                0xd9000000
 #define L4_WK_243X_SIZE                SZ_1M
@@ -88,8 +87,6 @@
 #define OMAP243X_SMS_VIRT      0xFC000000
 #define OMAP243X_SMS_SIZE      SZ_1M
 
-#endif
-
 #define IO_OFFSET      0x90000000
 #define IO_ADDRESS(pa) ((pa) + IO_OFFSET)      /* Works for L3 and L4 */
 #define OMAP2_IO_ADDRESS(pa)   ((pa) + IO_OFFSET)      /* Works for L3 and L4 */
index 86a319f9e4d20f20ef6a3dfcb44d0a255bac02c7..af326efc1ad3b807f9cd1e09763181436dfb757d 100644 (file)
@@ -47,11 +47,13 @@ void __iomem *omap_ioremap(unsigned long p, size_t size, unsigned int type)
        }
 #endif
 #ifdef CONFIG_ARCH_OMAP2
-       if (cpu_class_is_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_24XX_PHYS, DSP_MEM_24XX_SIZE))
                        return XLATE(p, DSP_MEM_24XX_PHYS, DSP_MEM_24XX_VIRT);
                if (BETWEEN(p, DSP_IPI_24XX_PHYS, DSP_IPI_24XX_SIZE))
@@ -61,9 +63,33 @@ void __iomem *omap_ioremap(unsigned long p, size_t size, unsigned int type)
        }
        if (cpu_is_omap2430()) {
                if (BETWEEN(p, L4_WK_243X_PHYS, L4_WK_243X_SIZE))
-                       return XLATE(L4_WK_243X_PHYS, L4_WK_243X_VIRT);
+                       return XLATE(p, L4_WK_243X_PHYS, L4_WK_243X_VIRT);
                if (BETWEEN(p, OMAP243X_GPMC_PHYS, OMAP243X_GPMC_SIZE))
-                       return XLATE(OMAP243X_GPMC_PHYS, OMAP243X_GPMC_VIRT);
+                       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_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, L4_WK_34XX_PHYS, L4_WK_34XX_SIZE))
+                       return XLATE(p, L4_WK_34XX_PHYS, L4_WK_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