]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
ARM: OMAP2+: PRM: initialize some PRM functions early
authorPaul Walmsley <paul@pwsan.com>
Wed, 21 Nov 2012 23:15:16 +0000 (16:15 -0700)
committerPaul Walmsley <paul@pwsan.com>
Wed, 21 Nov 2012 23:15:16 +0000 (16:15 -0700)
Some PRM functions will need to be called by the hwmod code early in
kernel init.  To handle this, split the PRM initialization code into
early and late phases.  The early init is handled via mach-omap2/io.c,
while the late init is handled by subsys_initcall().

Signed-off-by: Paul Walmsley <paul@pwsan.com>
arch/arm/mach-omap2/io.c
arch/arm/mach-omap2/prm2xxx.c
arch/arm/mach-omap2/prm2xxx.h
arch/arm/mach-omap2/prm3xxx.c
arch/arm/mach-omap2/prm3xxx.h
arch/arm/mach-omap2/prm44xx.c
arch/arm/mach-omap2/prm44xx.h

index 924bf24693cd508925e2458b31af2c4278caace3..007dc4d85d54815b8bf5366cae2f6ed8e31aa4fd 100644 (file)
 #include "prcm_mpu44xx.h"
 #include "prminst44xx.h"
 #include "cminst44xx.h"
+#include "prm2xxx.h"
+#include "prm3xxx.h"
+#include "prm44xx.h"
+
 /*
  * The machine specific code may provide the extra mapping besides the
  * default mapping provided here.
@@ -392,6 +396,7 @@ void __init omap2420_init_early(void)
        omap2_set_globals_prm(OMAP2_L4_IO_ADDRESS(OMAP2420_PRM_BASE));
        omap2_set_globals_cm(OMAP2_L4_IO_ADDRESS(OMAP2420_CM_BASE), NULL);
        omap2xxx_check_revision();
+       omap2xxx_prm_init();
        omap2xxx_cm_init();
        omap_common_init_early();
        omap2xxx_voltagedomains_init();
@@ -422,6 +427,7 @@ void __init omap2430_init_early(void)
        omap2_set_globals_prm(OMAP2_L4_IO_ADDRESS(OMAP2430_PRM_BASE));
        omap2_set_globals_cm(OMAP2_L4_IO_ADDRESS(OMAP2430_CM_BASE), NULL);
        omap2xxx_check_revision();
+       omap2xxx_prm_init();
        omap2xxx_cm_init();
        omap_common_init_early();
        omap2xxx_voltagedomains_init();
@@ -457,6 +463,7 @@ void __init omap3_init_early(void)
        omap2_set_globals_cm(OMAP2_L4_IO_ADDRESS(OMAP3430_CM_BASE), NULL);
        omap3xxx_check_revision();
        omap3xxx_check_features();
+       omap3xxx_prm_init();
        omap3xxx_cm_init();
        omap_common_init_early();
        omap3xxx_voltagedomains_init();
@@ -591,6 +598,7 @@ void __init omap4430_init_early(void)
        omap_cm_base_init();
        omap4xxx_check_revision();
        omap4xxx_check_features();
+       omap44xx_prm_init();
        omap_common_init_early();
        omap44xx_voltagedomains_init();
        omap44xx_powerdomains_init();
index bf24fc47603b89b936113964cefedc43f393f13d..faeab18696dfff6dc8e092c90c25fdd40be6f9a6 100644 (file)
@@ -118,14 +118,13 @@ static struct prm_ll_data omap2xxx_prm_ll_data = {
        .read_reset_sources = &omap2xxx_prm_read_reset_sources,
 };
 
-static int __init omap2xxx_prm_init(void)
+int __init omap2xxx_prm_init(void)
 {
        if (!cpu_is_omap24xx())
                return 0;
 
        return prm_register(&omap2xxx_prm_ll_data);
 }
-subsys_initcall(omap2xxx_prm_init);
 
 static void __exit omap2xxx_prm_exit(void)
 {
index fe8a14f190abc001ba49eb46e7f57c13994e042e..3194dd87e0e4278accfd0536175fdfe8b4cb2e99 100644 (file)
@@ -126,8 +126,7 @@ extern int omap2xxx_clkdm_wakeup(struct clockdomain *clkdm);
 
 extern void omap2xxx_prm_dpll_reset(void);
 
-extern int __init prm2xxx_init(void);
-extern int __exit prm2xxx_exit(void);
+extern int __init omap2xxx_prm_init(void);
 
 #endif
 
index b86116cf0db905ff3e6c18f82da190a6d50e2a96..db198d058584d06203860216abeb5cc43b1ab074 100644 (file)
@@ -383,27 +383,30 @@ static struct prm_ll_data omap3xxx_prm_ll_data = {
        .read_reset_sources = &omap3xxx_prm_read_reset_sources,
 };
 
-static int __init omap3xxx_prm_init(void)
+int __init omap3xxx_prm_init(void)
+{
+       if (!cpu_is_omap34xx())
+               return 0;
+
+       return prm_register(&omap3xxx_prm_ll_data);
+}
+
+static int __init omap3xxx_prm_late_init(void)
 {
        int ret;
 
        if (!cpu_is_omap34xx())
                return 0;
 
-       ret = prm_register(&omap3xxx_prm_ll_data);
-       if (ret)
-               return ret;
-
        omap3xxx_prm_enable_io_wakeup();
        ret = omap_prcm_register_chain_handler(&omap3_prcm_irq_setup);
        if (!ret)
                irq_set_status_flags(omap_prcm_event_to_irq("io"),
                                     IRQ_NOAUTOEN);
 
-
        return ret;
 }
-subsys_initcall(omap3xxx_prm_init);
+subsys_initcall(omap3xxx_prm_late_init);
 
 static void __exit omap3xxx_prm_exit(void)
 {
index 10cd41a8129eb62c4589edfddbcfd907cf264b36..277f71794e61adc9016212de3f9ae05efb87fd1c 100644 (file)
@@ -154,6 +154,7 @@ extern void omap3xxx_prm_restore_irqen(u32 *saved_mask);
 
 extern void omap3xxx_prm_dpll3_reset(void);
 
+extern int __init omap3xxx_prm_init(void);
 extern u32 omap3xxx_prm_get_reset_sources(void);
 
 #endif /* __ASSEMBLER */
index 6d3467af205d238617dfc27088cd8292eb04877b..9db1bd279f8eb8b4e93082e8989875d3d28834f4 100644 (file)
@@ -615,22 +615,24 @@ static struct prm_ll_data omap44xx_prm_ll_data = {
        .read_reset_sources = &omap44xx_prm_read_reset_sources,
 };
 
-static int __init omap44xx_prm_init(void)
+int __init omap44xx_prm_init(void)
 {
-       int ret;
-
        if (!cpu_is_omap44xx())
                return 0;
 
-       ret = prm_register(&omap44xx_prm_ll_data);
-       if (ret)
-               return ret;
+       return prm_register(&omap44xx_prm_ll_data);
+}
+
+static int __init omap44xx_prm_late_init(void)
+{
+       if (!cpu_is_omap44xx())
+               return 0;
 
        omap44xx_prm_enable_io_wakeup();
 
        return omap_prcm_register_chain_handler(&omap4_prcm_irq_setup);
 }
-subsys_initcall(omap44xx_prm_init);
+subsys_initcall(omap44xx_prm_late_init);
 
 static void __exit omap44xx_prm_exit(void)
 {
index c8e1accdc90ebe71a7c8850bc6756a2d2312f18f..22b0979206ca08b7cd929eee361607f802561af2 100644 (file)
@@ -771,6 +771,7 @@ extern void omap44xx_prm_ocp_barrier(void);
 extern void omap44xx_prm_save_and_clear_irqen(u32 *saved_mask);
 extern void omap44xx_prm_restore_irqen(u32 *saved_mask);
 
+extern int __init omap44xx_prm_init(void);
 extern u32 omap44xx_prm_get_reset_sources(void);
 
 # endif