aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/prm3xxx.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap2/prm3xxx.c')
-rw-r--r--arch/arm/mach-omap2/prm3xxx.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/arch/arm/mach-omap2/prm3xxx.c b/arch/arm/mach-omap2/prm3xxx.c
index 5713bbdf83bc..62680aad2126 100644
--- a/arch/arm/mach-omap2/prm3xxx.c
+++ b/arch/arm/mach-omap2/prm3xxx.c
@@ -29,6 +29,7 @@
29#include "prm-regbits-34xx.h" 29#include "prm-regbits-34xx.h"
30#include "cm3xxx.h" 30#include "cm3xxx.h"
31#include "cm-regbits-34xx.h" 31#include "cm-regbits-34xx.h"
32#include "clock.h"
32 33
33static void omap3xxx_prm_read_pending_irqs(unsigned long *events); 34static void omap3xxx_prm_read_pending_irqs(unsigned long *events);
34static void omap3xxx_prm_ocp_barrier(void); 35static void omap3xxx_prm_ocp_barrier(void);
@@ -96,7 +97,7 @@ static struct omap3_vp omap3_vp[] = {
96 97
97#define MAX_VP_ID ARRAY_SIZE(omap3_vp); 98#define MAX_VP_ID ARRAY_SIZE(omap3_vp);
98 99
99u32 omap3_prm_vp_check_txdone(u8 vp_id) 100static u32 omap3_prm_vp_check_txdone(u8 vp_id)
100{ 101{
101 struct omap3_vp *vp = &omap3_vp[vp_id]; 102 struct omap3_vp *vp = &omap3_vp[vp_id];
102 u32 irqstatus; 103 u32 irqstatus;
@@ -106,7 +107,7 @@ u32 omap3_prm_vp_check_txdone(u8 vp_id)
106 return irqstatus & vp->tranxdone_status; 107 return irqstatus & vp->tranxdone_status;
107} 108}
108 109
109void omap3_prm_vp_clear_txdone(u8 vp_id) 110static void omap3_prm_vp_clear_txdone(u8 vp_id)
110{ 111{
111 struct omap3_vp *vp = &omap3_vp[vp_id]; 112 struct omap3_vp *vp = &omap3_vp[vp_id];
112 113
@@ -217,7 +218,7 @@ static void omap3xxx_prm_restore_irqen(u32 *saved_mask)
217 * omap3xxx_prm_clear_mod_irqs - clear wake-up events from PRCM interrupt 218 * omap3xxx_prm_clear_mod_irqs - clear wake-up events from PRCM interrupt
218 * @module: PRM module to clear wakeups from 219 * @module: PRM module to clear wakeups from
219 * @regs: register set to clear, 1 or 3 220 * @regs: register set to clear, 1 or 3
220 * @ignore_bits: wakeup status bits to ignore 221 * @wkst_mask: wkst bits to clear
221 * 222 *
222 * The purpose of this function is to clear any wake-up events latched 223 * The purpose of this function is to clear any wake-up events latched
223 * in the PRCM PM_WKST_x registers. It is possible that a wake-up event 224 * in the PRCM PM_WKST_x registers. It is possible that a wake-up event
@@ -226,7 +227,7 @@ static void omap3xxx_prm_restore_irqen(u32 *saved_mask)
226 * that any peripheral wake-up events occurring while attempting to 227 * that any peripheral wake-up events occurring while attempting to
227 * clear the PM_WKST_x are detected and cleared. 228 * clear the PM_WKST_x are detected and cleared.
228 */ 229 */
229int omap3xxx_prm_clear_mod_irqs(s16 module, u8 regs, u32 ignore_bits) 230static int omap3xxx_prm_clear_mod_irqs(s16 module, u8 regs, u32 wkst_mask)
230{ 231{
231 u32 wkst, fclk, iclk, clken; 232 u32 wkst, fclk, iclk, clken;
232 u16 wkst_off = (regs == 3) ? OMAP3430ES2_PM_WKST3 : PM_WKST1; 233 u16 wkst_off = (regs == 3) ? OMAP3430ES2_PM_WKST3 : PM_WKST1;
@@ -238,7 +239,7 @@ int omap3xxx_prm_clear_mod_irqs(s16 module, u8 regs, u32 ignore_bits)
238 239
239 wkst = omap2_prm_read_mod_reg(module, wkst_off); 240 wkst = omap2_prm_read_mod_reg(module, wkst_off);
240 wkst &= omap2_prm_read_mod_reg(module, grpsel_off); 241 wkst &= omap2_prm_read_mod_reg(module, grpsel_off);
241 wkst &= ~ignore_bits; 242 wkst &= wkst_mask;
242 if (wkst) { 243 if (wkst) {
243 iclk = omap2_cm_read_mod_reg(module, iclk_off); 244 iclk = omap2_cm_read_mod_reg(module, iclk_off);
244 fclk = omap2_cm_read_mod_reg(module, fclk_off); 245 fclk = omap2_cm_read_mod_reg(module, fclk_off);
@@ -254,7 +255,7 @@ int omap3xxx_prm_clear_mod_irqs(s16 module, u8 regs, u32 ignore_bits)
254 omap2_cm_set_mod_reg_bits(clken, module, fclk_off); 255 omap2_cm_set_mod_reg_bits(clken, module, fclk_off);
255 omap2_prm_write_mod_reg(wkst, module, wkst_off); 256 omap2_prm_write_mod_reg(wkst, module, wkst_off);
256 wkst = omap2_prm_read_mod_reg(module, wkst_off); 257 wkst = omap2_prm_read_mod_reg(module, wkst_off);
257 wkst &= ~ignore_bits; 258 wkst &= wkst_mask;
258 c++; 259 c++;
259 } 260 }
260 omap2_cm_write_mod_reg(iclk, module, iclk_off); 261 omap2_cm_write_mod_reg(iclk, module, iclk_off);
@@ -664,10 +665,15 @@ static struct prm_ll_data omap3xxx_prm_ll_data = {
664 .deassert_hardreset = &omap2_prm_deassert_hardreset, 665 .deassert_hardreset = &omap2_prm_deassert_hardreset,
665 .is_hardreset_asserted = &omap2_prm_is_hardreset_asserted, 666 .is_hardreset_asserted = &omap2_prm_is_hardreset_asserted,
666 .reset_system = &omap3xxx_prm_dpll3_reset, 667 .reset_system = &omap3xxx_prm_dpll3_reset,
668 .clear_mod_irqs = &omap3xxx_prm_clear_mod_irqs,
669 .vp_check_txdone = &omap3_prm_vp_check_txdone,
670 .vp_clear_txdone = &omap3_prm_vp_clear_txdone,
667}; 671};
668 672
669int __init omap3xxx_prm_init(void) 673int __init omap3xxx_prm_init(const struct omap_prcm_init_data *data)
670{ 674{
675 omap2_clk_legacy_provider_init(TI_CLKM_PRM,
676 prm_base + OMAP3430_IVA2_MOD);
671 if (omap3_has_io_wakeup()) 677 if (omap3_has_io_wakeup())
672 prm_features |= PRM_HAS_IO_WAKEUP; 678 prm_features |= PRM_HAS_IO_WAKEUP;
673 679