Commit 2541d15f authored by Tero Kristo's avatar Tero Kristo Committed by Paul Walmsley

ARM: OMAP3/OMAP4: PRM: add prm_features flags and add IO wakeup under it

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: default avatarTero Kristo <t-kristo@ti.com>
Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
parent 81243651
...@@ -17,10 +17,18 @@ ...@@ -17,10 +17,18 @@
# ifndef __ASSEMBLER__ # ifndef __ASSEMBLER__
extern void __iomem *prm_base; extern void __iomem *prm_base;
extern u16 prm_features;
extern void omap2_set_globals_prm(void __iomem *prm); extern void omap2_set_globals_prm(void __iomem *prm);
int of_prcm_init(void); int of_prcm_init(void);
# endif # 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 * MAX_MODULE_SOFTRESET_WAIT: Maximum microseconds to wait for OMAP
......
...@@ -247,7 +247,7 @@ void omap3xxx_prm_reconfigure_io_chain(void) ...@@ -247,7 +247,7 @@ void omap3xxx_prm_reconfigure_io_chain(void)
*/ */
static void __init omap3xxx_prm_enable_io_wakeup(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, omap2_prm_set_mod_reg_bits(OMAP3430_EN_IO_MASK, WKUP_MOD,
PM_WKEN); PM_WKEN);
} }
...@@ -407,6 +407,9 @@ static struct prm_ll_data omap3xxx_prm_ll_data = { ...@@ -407,6 +407,9 @@ static struct prm_ll_data omap3xxx_prm_ll_data = {
int __init omap3xxx_prm_init(void) int __init omap3xxx_prm_init(void)
{ {
if (omap3_has_io_wakeup())
prm_features |= PRM_HAS_IO_WAKEUP;
return prm_register(&omap3xxx_prm_ll_data); return prm_register(&omap3xxx_prm_ll_data);
} }
...@@ -417,6 +420,9 @@ static int __init omap3xxx_prm_late_init(void) ...@@ -417,6 +420,9 @@ static int __init omap3xxx_prm_late_init(void)
if (!cpu_is_omap34xx()) if (!cpu_is_omap34xx())
return 0; return 0;
if (!(prm_features & PRM_HAS_IO_WAKEUP))
return 0;
omap3xxx_prm_enable_io_wakeup(); omap3xxx_prm_enable_io_wakeup();
ret = omap_prcm_register_chain_handler(&omap3_prcm_irq_setup); ret = omap_prcm_register_chain_handler(&omap3_prcm_irq_setup);
if (!ret) if (!ret)
......
...@@ -661,6 +661,9 @@ static struct prm_ll_data omap44xx_prm_ll_data = { ...@@ -661,6 +661,9 @@ static struct prm_ll_data omap44xx_prm_ll_data = {
int __init omap44xx_prm_init(void) int __init omap44xx_prm_init(void)
{ {
if (cpu_is_omap44xx())
prm_features |= PRM_HAS_IO_WAKEUP;
return prm_register(&omap44xx_prm_ll_data); return prm_register(&omap44xx_prm_ll_data);
} }
...@@ -669,6 +672,9 @@ static int __init omap44xx_prm_late_init(void) ...@@ -669,6 +672,9 @@ static int __init omap44xx_prm_late_init(void)
if (!cpu_is_omap44xx()) if (!cpu_is_omap44xx())
return 0; return 0;
if (!(prm_features & PRM_HAS_IO_WAKEUP))
return 0;
omap44xx_prm_enable_io_wakeup(); omap44xx_prm_enable_io_wakeup();
return omap_prcm_register_chain_handler(&omap4_prcm_irq_setup); return omap_prcm_register_chain_handler(&omap4_prcm_irq_setup);
......
...@@ -62,6 +62,8 @@ static struct omap_prcm_irq_setup *prcm_irq_setup; ...@@ -62,6 +62,8 @@ static struct omap_prcm_irq_setup *prcm_irq_setup;
/* prm_base: base virtual address of the PRM IP block */ /* prm_base: base virtual address of the PRM IP block */
void __iomem *prm_base; void __iomem *prm_base;
u16 prm_features;
/* /*
* prm_ll_data: function pointers to SoC-specific implementations of * prm_ll_data: function pointers to SoC-specific implementations of
* common PRM functions * common PRM functions
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment