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.c90
1 files changed, 90 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/prm3xxx.c b/arch/arm/mach-omap2/prm3xxx.c
index 4d93b844bcc4..48218a450cb0 100644
--- a/arch/arm/mach-omap2/prm3xxx.c
+++ b/arch/arm/mach-omap2/prm3xxx.c
@@ -275,6 +275,96 @@ void __init omap3_prm_reset_modem(void)
275} 275}
276 276
277/** 277/**
278 * omap3_prm_init_pm - initialize PM related registers for PRM
279 * @has_uart4: SoC has UART4
280 * @has_iva: SoC has IVA
281 *
282 * Initializes PRM registers for PM use. Called from PM init.
283 */
284void __init omap3_prm_init_pm(bool has_uart4, bool has_iva)
285{
286 u32 en_uart4_mask;
287 u32 grpsel_uart4_mask;
288
289 /*
290 * Enable control of expternal oscillator through
291 * sys_clkreq. In the long run clock framework should
292 * take care of this.
293 */
294 omap2_prm_rmw_mod_reg_bits(OMAP_AUTOEXTCLKMODE_MASK,
295 1 << OMAP_AUTOEXTCLKMODE_SHIFT,
296 OMAP3430_GR_MOD,
297 OMAP3_PRM_CLKSRC_CTRL_OFFSET);
298
299 /* setup wakup source */
300 omap2_prm_write_mod_reg(OMAP3430_EN_IO_MASK | OMAP3430_EN_GPIO1_MASK |
301 OMAP3430_EN_GPT1_MASK | OMAP3430_EN_GPT12_MASK,
302 WKUP_MOD, PM_WKEN);
303 /* No need to write EN_IO, that is always enabled */
304 omap2_prm_write_mod_reg(OMAP3430_GRPSEL_GPIO1_MASK |
305 OMAP3430_GRPSEL_GPT1_MASK |
306 OMAP3430_GRPSEL_GPT12_MASK,
307 WKUP_MOD, OMAP3430_PM_MPUGRPSEL);
308
309 /* Enable PM_WKEN to support DSS LPR */
310 omap2_prm_write_mod_reg(OMAP3430_PM_WKEN_DSS_EN_DSS_MASK,
311 OMAP3430_DSS_MOD, PM_WKEN);
312
313 if (has_uart4) {
314 en_uart4_mask = OMAP3630_EN_UART4_MASK;
315 grpsel_uart4_mask = OMAP3630_GRPSEL_UART4_MASK;
316 }
317
318 /* Enable wakeups in PER */
319 omap2_prm_write_mod_reg(en_uart4_mask |
320 OMAP3430_EN_GPIO2_MASK |
321 OMAP3430_EN_GPIO3_MASK |
322 OMAP3430_EN_GPIO4_MASK |
323 OMAP3430_EN_GPIO5_MASK |
324 OMAP3430_EN_GPIO6_MASK |
325 OMAP3430_EN_UART3_MASK |
326 OMAP3430_EN_MCBSP2_MASK |
327 OMAP3430_EN_MCBSP3_MASK |
328 OMAP3430_EN_MCBSP4_MASK,
329 OMAP3430_PER_MOD, PM_WKEN);
330
331 /* and allow them to wake up MPU */
332 omap2_prm_write_mod_reg(grpsel_uart4_mask |
333 OMAP3430_GRPSEL_GPIO2_MASK |
334 OMAP3430_GRPSEL_GPIO3_MASK |
335 OMAP3430_GRPSEL_GPIO4_MASK |
336 OMAP3430_GRPSEL_GPIO5_MASK |
337 OMAP3430_GRPSEL_GPIO6_MASK |
338 OMAP3430_GRPSEL_UART3_MASK |
339 OMAP3430_GRPSEL_MCBSP2_MASK |
340 OMAP3430_GRPSEL_MCBSP3_MASK |
341 OMAP3430_GRPSEL_MCBSP4_MASK,
342 OMAP3430_PER_MOD, OMAP3430_PM_MPUGRPSEL);
343
344 /* Don't attach IVA interrupts */
345 if (has_iva) {
346 omap2_prm_write_mod_reg(0, WKUP_MOD, OMAP3430_PM_IVAGRPSEL);
347 omap2_prm_write_mod_reg(0, CORE_MOD, OMAP3430_PM_IVAGRPSEL1);
348 omap2_prm_write_mod_reg(0, CORE_MOD, OMAP3430ES2_PM_IVAGRPSEL3);
349 omap2_prm_write_mod_reg(0, OMAP3430_PER_MOD,
350 OMAP3430_PM_IVAGRPSEL);
351 }
352
353 /* Clear any pending 'reset' flags */
354 omap2_prm_write_mod_reg(0xffffffff, MPU_MOD, OMAP2_RM_RSTST);
355 omap2_prm_write_mod_reg(0xffffffff, CORE_MOD, OMAP2_RM_RSTST);
356 omap2_prm_write_mod_reg(0xffffffff, OMAP3430_PER_MOD, OMAP2_RM_RSTST);
357 omap2_prm_write_mod_reg(0xffffffff, OMAP3430_EMU_MOD, OMAP2_RM_RSTST);
358 omap2_prm_write_mod_reg(0xffffffff, OMAP3430_NEON_MOD, OMAP2_RM_RSTST);
359 omap2_prm_write_mod_reg(0xffffffff, OMAP3430_DSS_MOD, OMAP2_RM_RSTST);
360 omap2_prm_write_mod_reg(0xffffffff, OMAP3430ES2_USBHOST_MOD,
361 OMAP2_RM_RSTST);
362
363 /* Clear any pending PRCM interrupts */
364 omap2_prm_write_mod_reg(0, OCP_MOD, OMAP3_PRM_IRQSTATUS_MPU_OFFSET);
365}
366
367/**
278 * omap3xxx_prm_reconfigure_io_chain - clear latches and reconfigure I/O chain 368 * omap3xxx_prm_reconfigure_io_chain - clear latches and reconfigure I/O chain
279 * 369 *
280 * Clear any previously-latched I/O wakeup events and ensure that the 370 * Clear any previously-latched I/O wakeup events and ensure that the