diff options
author | Tero Kristo <t-kristo@ti.com> | 2014-03-31 11:15:44 -0400 |
---|---|---|
committer | Paul Walmsley <paul@pwsan.com> | 2014-05-16 00:34:58 -0400 |
commit | 2541d15f16479fd56debe1ea55dee03c3886e33c (patch) | |
tree | 0cedc2f13f21caaf047d74d95ef8b7ed2353d484 /arch/arm | |
parent | 81243651ba25c4418af26c3c6f1aeabb41f734e0 (diff) |
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: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-omap2/prm.h | 8 | ||||
-rw-r--r-- | arch/arm/mach-omap2/prm3xxx.c | 8 | ||||
-rw-r--r-- | arch/arm/mach-omap2/prm44xx.c | 6 | ||||
-rw-r--r-- | arch/arm/mach-omap2/prm_common.c | 2 |
4 files changed, 23 insertions, 1 deletions
diff --git a/arch/arm/mach-omap2/prm.h b/arch/arm/mach-omap2/prm.h index 623db40fdbbd..04426c441fff 100644 --- a/arch/arm/mach-omap2/prm.h +++ b/arch/arm/mach-omap2/prm.h | |||
@@ -17,10 +17,18 @@ | |||
17 | 17 | ||
18 | # ifndef __ASSEMBLER__ | 18 | # ifndef __ASSEMBLER__ |
19 | extern void __iomem *prm_base; | 19 | extern void __iomem *prm_base; |
20 | extern u16 prm_features; | ||
20 | extern void omap2_set_globals_prm(void __iomem *prm); | 21 | extern void omap2_set_globals_prm(void __iomem *prm); |
21 | int of_prcm_init(void); | 22 | int of_prcm_init(void); |
22 | # endif | 23 | # endif |
23 | 24 | ||
25 | /* | ||
26 | * prm_features flag values | ||
27 | * | ||
28 | * PRM_HAS_IO_WAKEUP: has IO wakeup capability | ||
29 | * PRM_HAS_VOLTAGE: has voltage domains | ||
30 | */ | ||
31 | #define PRM_HAS_IO_WAKEUP (1 << 0) | ||
24 | 32 | ||
25 | /* | 33 | /* |
26 | * MAX_MODULE_SOFTRESET_WAIT: Maximum microseconds to wait for OMAP | 34 | * MAX_MODULE_SOFTRESET_WAIT: Maximum microseconds to wait for OMAP |
diff --git a/arch/arm/mach-omap2/prm3xxx.c b/arch/arm/mach-omap2/prm3xxx.c index 2631b9f2b3d8..9c95ac21c5b3 100644 --- a/arch/arm/mach-omap2/prm3xxx.c +++ b/arch/arm/mach-omap2/prm3xxx.c | |||
@@ -247,7 +247,7 @@ void omap3xxx_prm_reconfigure_io_chain(void) | |||
247 | */ | 247 | */ |
248 | static void __init omap3xxx_prm_enable_io_wakeup(void) | 248 | static void __init omap3xxx_prm_enable_io_wakeup(void) |
249 | { | 249 | { |
250 | if (omap3_has_io_wakeup()) | 250 | if (prm_features & PRM_HAS_IO_WAKEUP) |
251 | omap2_prm_set_mod_reg_bits(OMAP3430_EN_IO_MASK, WKUP_MOD, | 251 | omap2_prm_set_mod_reg_bits(OMAP3430_EN_IO_MASK, WKUP_MOD, |
252 | PM_WKEN); | 252 | PM_WKEN); |
253 | } | 253 | } |
@@ -407,6 +407,9 @@ static struct prm_ll_data omap3xxx_prm_ll_data = { | |||
407 | 407 | ||
408 | int __init omap3xxx_prm_init(void) | 408 | int __init omap3xxx_prm_init(void) |
409 | { | 409 | { |
410 | if (omap3_has_io_wakeup()) | ||
411 | prm_features |= PRM_HAS_IO_WAKEUP; | ||
412 | |||
410 | return prm_register(&omap3xxx_prm_ll_data); | 413 | return prm_register(&omap3xxx_prm_ll_data); |
411 | } | 414 | } |
412 | 415 | ||
@@ -417,6 +420,9 @@ static int __init omap3xxx_prm_late_init(void) | |||
417 | if (!cpu_is_omap34xx()) | 420 | if (!cpu_is_omap34xx()) |
418 | return 0; | 421 | return 0; |
419 | 422 | ||
423 | if (!(prm_features & PRM_HAS_IO_WAKEUP)) | ||
424 | return 0; | ||
425 | |||
420 | omap3xxx_prm_enable_io_wakeup(); | 426 | omap3xxx_prm_enable_io_wakeup(); |
421 | ret = omap_prcm_register_chain_handler(&omap3_prcm_irq_setup); | 427 | ret = omap_prcm_register_chain_handler(&omap3_prcm_irq_setup); |
422 | if (!ret) | 428 | if (!ret) |
diff --git a/arch/arm/mach-omap2/prm44xx.c b/arch/arm/mach-omap2/prm44xx.c index f464179eb82b..e4e52f14dbbf 100644 --- a/arch/arm/mach-omap2/prm44xx.c +++ b/arch/arm/mach-omap2/prm44xx.c | |||
@@ -661,6 +661,9 @@ static struct prm_ll_data omap44xx_prm_ll_data = { | |||
661 | 661 | ||
662 | int __init omap44xx_prm_init(void) | 662 | int __init omap44xx_prm_init(void) |
663 | { | 663 | { |
664 | if (cpu_is_omap44xx()) | ||
665 | prm_features |= PRM_HAS_IO_WAKEUP; | ||
666 | |||
664 | return prm_register(&omap44xx_prm_ll_data); | 667 | return prm_register(&omap44xx_prm_ll_data); |
665 | } | 668 | } |
666 | 669 | ||
@@ -669,6 +672,9 @@ static int __init omap44xx_prm_late_init(void) | |||
669 | if (!cpu_is_omap44xx()) | 672 | if (!cpu_is_omap44xx()) |
670 | return 0; | 673 | return 0; |
671 | 674 | ||
675 | if (!(prm_features & PRM_HAS_IO_WAKEUP)) | ||
676 | return 0; | ||
677 | |||
672 | omap44xx_prm_enable_io_wakeup(); | 678 | omap44xx_prm_enable_io_wakeup(); |
673 | 679 | ||
674 | return omap_prcm_register_chain_handler(&omap4_prcm_irq_setup); | 680 | return omap_prcm_register_chain_handler(&omap4_prcm_irq_setup); |
diff --git a/arch/arm/mach-omap2/prm_common.c b/arch/arm/mach-omap2/prm_common.c index bd746fc05d18..aa2550dd2ac1 100644 --- a/arch/arm/mach-omap2/prm_common.c +++ b/arch/arm/mach-omap2/prm_common.c | |||
@@ -62,6 +62,8 @@ static struct omap_prcm_irq_setup *prcm_irq_setup; | |||
62 | /* prm_base: base virtual address of the PRM IP block */ | 62 | /* prm_base: base virtual address of the PRM IP block */ |
63 | void __iomem *prm_base; | 63 | void __iomem *prm_base; |
64 | 64 | ||
65 | u16 prm_features; | ||
66 | |||
65 | /* | 67 | /* |
66 | * prm_ll_data: function pointers to SoC-specific implementations of | 68 | * prm_ll_data: function pointers to SoC-specific implementations of |
67 | * common PRM functions | 69 | * common PRM functions |