ARM: OMAP3/OMAP4: PRM: add prm_features flags and add IO wakeup under it
authorTero Kristo <t-kristo@ti.com>
Mon, 31 Mar 2014 15:15:44 +0000 (18:15 +0300)
committerPaul Walmsley <paul@pwsan.com>
Fri, 16 May 2014 04:34:58 +0000 (22:34 -0600)
prm_features flag will contain SoC specific feature enabler flags. Initially
IO wakeup is added under this. Helps to get rid of runtime cpu_is_X checks.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
arch/arm/mach-omap2/prm.h
arch/arm/mach-omap2/prm3xxx.c
arch/arm/mach-omap2/prm44xx.c
arch/arm/mach-omap2/prm_common.c

index 623db40fdbbda48c50888d620b6a8a28b8a27c17..04426c441fff1285fbff33edb7960807d9634bab 100644 (file)
 
 # ifndef __ASSEMBLER__
 extern void __iomem *prm_base;
+extern u16 prm_features;
 extern void omap2_set_globals_prm(void __iomem *prm);
 int of_prcm_init(void);
 # endif
 
+/*
+ * prm_features flag values
+ *
+ * PRM_HAS_IO_WAKEUP: has IO wakeup capability
+ * PRM_HAS_VOLTAGE: has voltage domains
+ */
+#define PRM_HAS_IO_WAKEUP      (1 << 0)
 
 /*
  * MAX_MODULE_SOFTRESET_WAIT: Maximum microseconds to wait for OMAP
index 2631b9f2b3d83edd593ed4d8dcda5dcd3fb8eb33..9c95ac21c5b39f5994b223b7c5e0c3f81845542b 100644 (file)
@@ -247,7 +247,7 @@ void omap3xxx_prm_reconfigure_io_chain(void)
  */
 static void __init omap3xxx_prm_enable_io_wakeup(void)
 {
-       if (omap3_has_io_wakeup())
+       if (prm_features & PRM_HAS_IO_WAKEUP)
                omap2_prm_set_mod_reg_bits(OMAP3430_EN_IO_MASK, WKUP_MOD,
                                           PM_WKEN);
 }
@@ -407,6 +407,9 @@ static struct prm_ll_data omap3xxx_prm_ll_data = {
 
 int __init omap3xxx_prm_init(void)
 {
+       if (omap3_has_io_wakeup())
+               prm_features |= PRM_HAS_IO_WAKEUP;
+
        return prm_register(&omap3xxx_prm_ll_data);
 }
 
@@ -417,6 +420,9 @@ static int __init omap3xxx_prm_late_init(void)
        if (!cpu_is_omap34xx())
                return 0;
 
+       if (!(prm_features & PRM_HAS_IO_WAKEUP))
+               return 0;
+
        omap3xxx_prm_enable_io_wakeup();
        ret = omap_prcm_register_chain_handler(&omap3_prcm_irq_setup);
        if (!ret)
index f464179eb82b39bc468d7aa6e5451e3342a16b06..e4e52f14dbbf2ea7c0cfde9053f268dbed8d8ccd 100644 (file)
@@ -661,6 +661,9 @@ static struct prm_ll_data omap44xx_prm_ll_data = {
 
 int __init omap44xx_prm_init(void)
 {
+       if (cpu_is_omap44xx())
+               prm_features |= PRM_HAS_IO_WAKEUP;
+
        return prm_register(&omap44xx_prm_ll_data);
 }
 
@@ -669,6 +672,9 @@ static int __init omap44xx_prm_late_init(void)
        if (!cpu_is_omap44xx())
                return 0;
 
+       if (!(prm_features & PRM_HAS_IO_WAKEUP))
+               return 0;
+
        omap44xx_prm_enable_io_wakeup();
 
        return omap_prcm_register_chain_handler(&omap4_prcm_irq_setup);
index bd746fc05d18775e94fef1c855406fa95f05b6c6..aa2550dd2ac1894d64fe0b38279772b6e6151135 100644 (file)
@@ -62,6 +62,8 @@ static struct omap_prcm_irq_setup *prcm_irq_setup;
 /* prm_base: base virtual address of the PRM IP block */
 void __iomem *prm_base;
 
+u16 prm_features;
+
 /*
  * prm_ll_data: function pointers to SoC-specific implementations of
  * common PRM functions