]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/arm/mach-omap2/io.c
Add MT_MEMORY_SO, mark L3 and L4 to use it
[linux-2.6-omap-h63xx.git] / arch / arm / mach-omap2 / io.c
index 8acdd04e868cc5a890494abaaca2aa65743d71e6..c11c0e830c5027fdddceb256c382b194a2847914 100644 (file)
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
+#include <linux/io.h>
 
 #include <asm/tlb.h>
-#include <asm/io.h>
 
 #include <asm/mach/map.h>
+#include <mach/mux.h>
+#include <mach/omapfb.h>
+#include <mach/sram.h>
+#include <mach/sdrc.h>
+#include <mach/gpmc.h>
 
-#include <asm/arch/mux.h>
-#include <asm/arch/omapfb.h>
+#include "clock.h"
 
-extern void omap_sram_init(void);
-extern int omap2_clk_init(void);
-extern void omap2_check_revision(void);
-extern void omap2_init_memory(void);
-extern void gpmc_init(void);
-extern void omapfb_reserve_sdram(void);
+#include <mach/powerdomain.h>
+
+#include "powerdomains.h"
+
+#include <mach/clockdomain.h>
+#include "clockdomains.h"
 
 /*
  * The machine specific code may provide the extra mapping besides the
@@ -115,13 +119,13 @@ static struct map_desc omap34xx_io_desc[] __initdata = {
                .virtual        = L3_34XX_VIRT,
                .pfn            = __phys_to_pfn(L3_34XX_PHYS),
                .length         = L3_34XX_SIZE,
-               .type           = MT_DEVICE
+               .type           = MT_MEMORY_SO
        },
        {
                .virtual        = L4_34XX_VIRT,
                .pfn            = __phys_to_pfn(L4_34XX_PHYS),
                .length         = L4_34XX_SIZE,
-               .type           = MT_DEVICE
+               .type           = MT_MEMORY_SO
        },
        {
                .virtual        = L4_WK_34XX_VIRT,
@@ -133,19 +137,19 @@ static struct map_desc omap34xx_io_desc[] __initdata = {
                .virtual        = OMAP34XX_GPMC_VIRT,
                .pfn            = __phys_to_pfn(OMAP34XX_GPMC_PHYS),
                .length         = OMAP34XX_GPMC_SIZE,
-               .type           = MT_DEVICE
+               .type           = MT_MEMORY_SO
        },
        {
                .virtual        = OMAP343X_SMS_VIRT,
                .pfn            = __phys_to_pfn(OMAP343X_SMS_PHYS),
                .length         = OMAP343X_SMS_SIZE,
-               .type           = MT_DEVICE
+               .type           = MT_MEMORY_SO
        },
        {
                .virtual        = OMAP343X_SDRC_VIRT,
                .pfn            = __phys_to_pfn(OMAP343X_SDRC_PHYS),
                .length         = OMAP343X_SDRC_SIZE,
-               .type           = MT_DEVICE
+               .type           = MT_MEMORY_SO
        },
        {
                .virtual        = L4_PER_34XX_VIRT,
@@ -157,7 +161,7 @@ static struct map_desc omap34xx_io_desc[] __initdata = {
                .virtual        = L4_EMU_34XX_VIRT,
                .pfn            = __phys_to_pfn(L4_EMU_34XX_PHYS),
                .length         = L4_EMU_34XX_SIZE,
-               .type           = MT_DEVICE
+               .type           = MT_MEMORY_SO
        },
 };
 #endif
@@ -167,12 +171,17 @@ void __init omap2_map_common_io(void)
 #if defined(CONFIG_ARCH_OMAP2420)
        iotable_init(omap24xx_io_desc, ARRAY_SIZE(omap24xx_io_desc));
        iotable_init(omap242x_io_desc, ARRAY_SIZE(omap242x_io_desc));
-#elif defined(CONFIG_ARCH_OMAP2430)
+#endif
+
+#if defined(CONFIG_ARCH_OMAP2430)
        iotable_init(omap24xx_io_desc, ARRAY_SIZE(omap24xx_io_desc));
        iotable_init(omap243x_io_desc, ARRAY_SIZE(omap243x_io_desc));
-#elif defined(CONFIG_ARCH_OMAP34XX)
+#endif
+
+#if defined(CONFIG_ARCH_OMAP34XX)
        iotable_init(omap34xx_io_desc, ARRAY_SIZE(omap34xx_io_desc));
 #endif
+
        /* Normally devicemaps_init() would flush caches and tlb after
         * mdesc->map_io(), but we must also do it here because of the CPU
         * revision check below.
@@ -185,10 +194,12 @@ void __init omap2_map_common_io(void)
        omapfb_reserve_sdram();
 }
 
-void __init omap2_init_common_hw(void)
+void __init omap2_init_common_hw(struct omap_sdrc_params *sp)
 {
        omap2_mux_init();
+       pwrdm_init(powerdomains_omap);
+       clkdm_init(clockdomains_omap, clkdm_pwrdm_autodeps);
        omap2_clk_init();
-       omap2_init_memory();
+       omap2_sdrc_init(sp);
        gpmc_init();
 }