diff options
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-omap2/prm44xx.c | 54 | ||||
-rw-r--r-- | arch/arm/mach-omap2/prm44xx.h | 2 |
2 files changed, 56 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/prm44xx.c b/arch/arm/mach-omap2/prm44xx.c index f106d21ff581..28ffbc55f8d6 100644 --- a/arch/arm/mach-omap2/prm44xx.c +++ b/arch/arm/mach-omap2/prm44xx.c | |||
@@ -233,6 +233,60 @@ void omap44xx_prm_restore_irqen(u32 *saved_mask) | |||
233 | OMAP4_PRM_IRQENABLE_MPU_2_OFFSET); | 233 | OMAP4_PRM_IRQENABLE_MPU_2_OFFSET); |
234 | } | 234 | } |
235 | 235 | ||
236 | /** | ||
237 | * omap44xx_prm_reconfigure_io_chain - clear latches and reconfigure I/O chain | ||
238 | * | ||
239 | * Clear any previously-latched I/O wakeup events and ensure that the | ||
240 | * I/O wakeup gates are aligned with the current mux settings. Works | ||
241 | * by asserting WUCLKIN, waiting for WUCLKOUT to be asserted, and then | ||
242 | * deasserting WUCLKIN and waiting for WUCLKOUT to be deasserted. | ||
243 | * No return value. XXX Are the final two steps necessary? | ||
244 | */ | ||
245 | void omap44xx_prm_reconfigure_io_chain(void) | ||
246 | { | ||
247 | int i = 0; | ||
248 | u32 v; | ||
249 | |||
250 | v = omap4_prm_read_inst_reg(OMAP4430_PRM_DEVICE_INST, | ||
251 | OMAP4_PRM_IO_PMCTRL_OFFSET); | ||
252 | |||
253 | /* Enable GLOBAL_WUEN */ | ||
254 | if (!(v & OMAP4430_GLOBAL_WUEN_MASK)) | ||
255 | omap4_prm_rmw_inst_reg_bits(OMAP4430_GLOBAL_WUEN_MASK, | ||
256 | OMAP4430_GLOBAL_WUEN_MASK, | ||
257 | OMAP4430_PRM_DEVICE_INST, | ||
258 | OMAP4_PRM_IO_PMCTRL_OFFSET); | ||
259 | |||
260 | /* Trigger WUCLKIN enable */ | ||
261 | omap4_prm_rmw_inst_reg_bits(OMAP4430_WUCLK_CTRL_MASK, | ||
262 | OMAP4430_WUCLK_CTRL_MASK, | ||
263 | OMAP4430_PRM_DEVICE_INST, | ||
264 | OMAP4_PRM_IO_PMCTRL_OFFSET); | ||
265 | omap_test_timeout( | ||
266 | (((omap4_prm_read_inst_reg(OMAP4430_PRM_DEVICE_INST, | ||
267 | OMAP4_PRM_IO_PMCTRL_OFFSET) & | ||
268 | OMAP4430_WUCLK_STATUS_MASK) >> | ||
269 | OMAP4430_WUCLK_STATUS_SHIFT) == 1), | ||
270 | MAX_IOPAD_LATCH_TIME, i); | ||
271 | if (i == MAX_IOPAD_LATCH_TIME) | ||
272 | pr_warn("PRM: I/O chain clock line assertion timed out\n"); | ||
273 | |||
274 | /* Trigger WUCLKIN disable */ | ||
275 | omap4_prm_rmw_inst_reg_bits(OMAP4430_WUCLK_CTRL_MASK, 0x0, | ||
276 | OMAP4430_PRM_DEVICE_INST, | ||
277 | OMAP4_PRM_IO_PMCTRL_OFFSET); | ||
278 | omap_test_timeout( | ||
279 | (((omap4_prm_read_inst_reg(OMAP4430_PRM_DEVICE_INST, | ||
280 | OMAP4_PRM_IO_PMCTRL_OFFSET) & | ||
281 | OMAP4430_WUCLK_STATUS_MASK) >> | ||
282 | OMAP4430_WUCLK_STATUS_SHIFT) == 0), | ||
283 | MAX_IOPAD_LATCH_TIME, i); | ||
284 | if (i == MAX_IOPAD_LATCH_TIME) | ||
285 | pr_warn("PRM: I/O chain clock line deassertion timed out\n"); | ||
286 | |||
287 | return; | ||
288 | } | ||
289 | |||
236 | static int __init omap4xxx_prcm_init(void) | 290 | static int __init omap4xxx_prcm_init(void) |
237 | { | 291 | { |
238 | if (cpu_is_omap44xx()) | 292 | if (cpu_is_omap44xx()) |
diff --git a/arch/arm/mach-omap2/prm44xx.h b/arch/arm/mach-omap2/prm44xx.h index 7978092946db..ee72ae6bd8c9 100644 --- a/arch/arm/mach-omap2/prm44xx.h +++ b/arch/arm/mach-omap2/prm44xx.h | |||
@@ -763,6 +763,8 @@ extern u32 omap4_prm_vcvp_read(u8 offset); | |||
763 | extern void omap4_prm_vcvp_write(u32 val, u8 offset); | 763 | extern void omap4_prm_vcvp_write(u32 val, u8 offset); |
764 | extern u32 omap4_prm_vcvp_rmw(u32 mask, u32 bits, u8 offset); | 764 | extern u32 omap4_prm_vcvp_rmw(u32 mask, u32 bits, u8 offset); |
765 | 765 | ||
766 | extern void omap44xx_prm_reconfigure_io_chain(void); | ||
767 | |||
766 | /* PRM interrupt-related functions */ | 768 | /* PRM interrupt-related functions */ |
767 | extern void omap44xx_prm_read_pending_irqs(unsigned long *events); | 769 | extern void omap44xx_prm_read_pending_irqs(unsigned long *events); |
768 | extern void omap44xx_prm_ocp_barrier(void); | 770 | extern void omap44xx_prm_ocp_barrier(void); |