aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/prm2xxx_3xxx.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap2/prm2xxx_3xxx.c')
-rw-r--r--arch/arm/mach-omap2/prm2xxx_3xxx.c34
1 files changed, 33 insertions, 1 deletions
diff --git a/arch/arm/mach-omap2/prm2xxx_3xxx.c b/arch/arm/mach-omap2/prm2xxx_3xxx.c
index f02d87f68e54..177c3ddba788 100644
--- a/arch/arm/mach-omap2/prm2xxx_3xxx.c
+++ b/arch/arm/mach-omap2/prm2xxx_3xxx.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * OMAP2/3 PRM module functions 2 * OMAP2/3 PRM module functions
3 * 3 *
4 * Copyright (C) 2010 Texas Instruments, Inc. 4 * Copyright (C) 2010-2011 Texas Instruments, Inc.
5 * Copyright (C) 2010 Nokia Corporation 5 * Copyright (C) 2010 Nokia Corporation
6 * Benoît Cousson 6 * Benoît Cousson
7 * Paul Walmsley 7 * Paul Walmsley
@@ -212,3 +212,35 @@ u32 omap3_prm_vcvp_rmw(u32 mask, u32 bits, u8 offset)
212{ 212{
213 return omap2_prm_rmw_mod_reg_bits(mask, bits, OMAP3430_GR_MOD, offset); 213 return omap2_prm_rmw_mod_reg_bits(mask, bits, OMAP3430_GR_MOD, offset);
214} 214}
215
216/**
217 * omap3xxx_prm_read_pending_irqs - read pending PRM MPU IRQs into @events
218 * @events: ptr to a u32, preallocated by caller
219 *
220 * Read PRM_IRQSTATUS_MPU bits, AND'ed with the currently-enabled PRM
221 * MPU IRQs, and store the result into the u32 pointed to by @events.
222 * No return value.
223 */
224void omap3xxx_prm_read_pending_irqs(unsigned long *events)
225{
226 u32 mask, st;
227
228 /* XXX Can the mask read be avoided (e.g., can it come from RAM?) */
229 mask = omap2_prm_read_mod_reg(OCP_MOD, OMAP3_PRM_IRQENABLE_MPU_OFFSET);
230 st = omap2_prm_read_mod_reg(OCP_MOD, OMAP3_PRM_IRQSTATUS_MPU_OFFSET);
231
232 events[0] = mask & st;
233}
234
235/**
236 * omap3xxx_prm_ocp_barrier - force buffered MPU writes to the PRM to complete
237 *
238 * Force any buffered writes to the PRM IP block to complete. Needed
239 * by the PRM IRQ handler, which reads and writes directly to the IP
240 * block, to avoid race conditions after acknowledging or clearing IRQ
241 * bits. No return value.
242 */
243void omap3xxx_prm_ocp_barrier(void)
244{
245 omap2_prm_read_mod_reg(OCP_MOD, OMAP3_PRM_REVISION_OFFSET);
246}