]> Pileus Git - ~andy/linux/blobdiff - arch/arm/mach-omap2/io.c
ARM: OMAP2+: split omap2/3/4_check_revision function
[~andy/linux] / arch / arm / mach-omap2 / io.c
index 25d20ced03e13cb18bc7d6f27d44d11c5c671d90..58bd138e5a981b366e7168c809283330fe4fca9b 100644 (file)
@@ -35,7 +35,7 @@
 #include "clock3xxx.h"
 #include "clock44xx.h"
 
-#include <plat/common.h>
+#include "common.h"
 #include <plat/omap-pm.h>
 #include "voltage.h"
 #include "powerdomain.h"
@@ -43,7 +43,7 @@
 #include "clockdomain.h"
 #include <plat/omap_hwmod.h>
 #include <plat/multi.h>
-#include <plat/common.h>
+#include "common.h"
 
 /*
  * The machine specific code may provide the extra mapping besides the
@@ -176,14 +176,31 @@ static struct map_desc omap34xx_io_desc[] __initdata = {
 };
 #endif
 
-#ifdef CONFIG_SOC_OMAPTI816X
-static struct map_desc omapti816x_io_desc[] __initdata = {
+#ifdef CONFIG_SOC_OMAPTI81XX
+static struct map_desc omapti81xx_io_desc[] __initdata = {
+       {
+               .virtual        = L4_34XX_VIRT,
+               .pfn            = __phys_to_pfn(L4_34XX_PHYS),
+               .length         = L4_34XX_SIZE,
+               .type           = MT_DEVICE
+       }
+};
+#endif
+
+#ifdef CONFIG_SOC_OMAPAM33XX
+static struct map_desc omapam33xx_io_desc[] __initdata = {
        {
                .virtual        = L4_34XX_VIRT,
                .pfn            = __phys_to_pfn(L4_34XX_PHYS),
                .length         = L4_34XX_SIZE,
                .type           = MT_DEVICE
        },
+       {
+               .virtual        = L4_WK_AM33XX_VIRT,
+               .pfn            = __phys_to_pfn(L4_WK_AM33XX_PHYS),
+               .length         = L4_WK_AM33XX_SIZE,
+               .type           = MT_DEVICE
+       }
 };
 #endif
 
@@ -263,10 +280,17 @@ void __init omap34xx_map_common_io(void)
 }
 #endif
 
-#ifdef CONFIG_SOC_OMAPTI816X
-void __init omapti816x_map_common_io(void)
+#ifdef CONFIG_SOC_OMAPTI81XX
+void __init omapti81xx_map_common_io(void)
+{
+       iotable_init(omapti81xx_io_desc, ARRAY_SIZE(omapti81xx_io_desc));
+}
+#endif
+
+#ifdef CONFIG_SOC_OMAPAM33XX
+void __init omapam33xx_map_common_io(void)
 {
-       iotable_init(omapti816x_io_desc, ARRAY_SIZE(omapti816x_io_desc));
+       iotable_init(omapam33xx_io_desc, ARRAY_SIZE(omapam33xx_io_desc));
 }
 #endif
 
@@ -316,13 +340,8 @@ static int _set_hwmod_postsetup_state(struct omap_hwmod *oh, void *data)
        return omap_hwmod_set_postsetup_state(oh, *(u8 *)data);
 }
 
-/* See irq.c, omap4-common.c and entry-macro.S */
-void __iomem *omap_irq_base;
-
 static void __init omap_common_init_early(void)
 {
-       omap2_check_revision();
-       omap_ioremap_init();
        omap_init_consistent_dma_size();
 }
 
@@ -363,6 +382,7 @@ static void __init omap_hwmod_init_postsetup(void)
 void __init omap2420_init_early(void)
 {
        omap2_set_globals_242x();
+       omap2xxx_check_revision();
        omap_common_init_early();
        omap2xxx_voltagedomains_init();
        omap242x_powerdomains_init();
@@ -375,6 +395,7 @@ void __init omap2420_init_early(void)
 void __init omap2430_init_early(void)
 {
        omap2_set_globals_243x();
+       omap2xxx_check_revision();
        omap_common_init_early();
        omap2xxx_voltagedomains_init();
        omap243x_powerdomains_init();
@@ -393,6 +414,8 @@ void __init omap2430_init_early(void)
 void __init omap3_init_early(void)
 {
        omap2_set_globals_3xxx();
+       omap3xxx_check_revision();
+       omap3xxx_check_features();
        omap_common_init_early();
        omap3xxx_voltagedomains_init();
        omap3xxx_powerdomains_init();
@@ -422,9 +445,11 @@ void __init am35xx_init_early(void)
        omap3_init_early();
 }
 
-void __init ti816x_init_early(void)
+void __init ti81xx_init_early(void)
 {
-       omap2_set_globals_ti816x();
+       omap2_set_globals_ti81xx();
+       omap3xxx_check_revision();
+       ti81xx_check_features();
        omap_common_init_early();
        omap3xxx_voltagedomains_init();
        omap3xxx_powerdomains_init();
@@ -439,6 +464,8 @@ void __init ti816x_init_early(void)
 void __init omap4430_init_early(void)
 {
        omap2_set_globals_443x();
+       omap4xxx_check_revision();
+       omap4xxx_check_features();
        omap_common_init_early();
        omap44xx_voltagedomains_init();
        omap44xx_powerdomains_init();