aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2
diff options
context:
space:
mode:
authorTero Kristo <t-kristo@ti.com>2014-10-27 11:39:26 -0400
committerTony Lindgren <tony@atomide.com>2014-10-27 11:39:26 -0400
commit4984eeaf71f033d1ca6b644e4fcdef4b3e6a97b4 (patch)
treec907d6f5a185dbf0df3af720d2b0acc3b2716977 /arch/arm/mach-omap2
parent28db51f428bf284dc12a60a0c0a12fa522a530f5 (diff)
ARM: OMAP3+: PRM: add generic API for reconfiguring I/O chain
This adds a generic API for reconfiguring the I/O chain. The implementation will call the SoC specific function registered during init time. The SoC specific reconfigure functions are also made static, as they don't need to be accessed outside the PRM driver itself. Signed-off-by: Tero Kristo <t-kristo@ti.com> Acked-by: Paul Walmsley <paul@pwsan.com> Tested-by: Nishanth Menon <nm@ti.com> [tony@atomide.com: updated for recent omap3 prcm fixes] Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.c5
-rw-r--r--arch/arm/mach-omap2/prm.h2
-rw-r--r--arch/arm/mach-omap2/prm3xxx.c13
-rw-r--r--arch/arm/mach-omap2/prm3xxx.h8
-rw-r--r--arch/arm/mach-omap2/prm44xx.c3
-rw-r--r--arch/arm/mach-omap2/prm44xx_54xx.h9
-rw-r--r--arch/arm/mach-omap2/prm_common.c16
7 files changed, 23 insertions, 33 deletions
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index e8098ca28dc5..cedbbb5d4825 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -1984,10 +1984,7 @@ static void _reconfigure_io_chain(void)
1984 1984
1985 spin_lock_irqsave(&io_chain_lock, flags); 1985 spin_lock_irqsave(&io_chain_lock, flags);
1986 1986
1987 if (cpu_is_omap34xx()) 1987 omap_prm_reconfigure_io_chain();
1988 omap3xxx_prm_reconfigure_io_chain();
1989 else if (cpu_is_omap44xx())
1990 omap44xx_prm_reconfigure_io_chain();
1991 1988
1992 spin_unlock_irqrestore(&io_chain_lock, flags); 1989 spin_unlock_irqrestore(&io_chain_lock, flags);
1993} 1990}
diff --git a/arch/arm/mach-omap2/prm.h b/arch/arm/mach-omap2/prm.h
index d72dd7120920..dd802eec0dec 100644
--- a/arch/arm/mach-omap2/prm.h
+++ b/arch/arm/mach-omap2/prm.h
@@ -157,6 +157,8 @@ extern u32 prm_read_reset_sources(void);
157extern bool prm_was_any_context_lost_old(u8 part, s16 inst, u16 idx); 157extern bool prm_was_any_context_lost_old(u8 part, s16 inst, u16 idx);
158extern void prm_clear_context_loss_flags_old(u8 part, s16 inst, u16 idx); 158extern void prm_clear_context_loss_flags_old(u8 part, s16 inst, u16 idx);
159 159
160void omap_prm_reconfigure_io_chain(void);
161
160#endif 162#endif
161 163
162 164
diff --git a/arch/arm/mach-omap2/prm3xxx.c b/arch/arm/mach-omap2/prm3xxx.c
index cb71354c503c..9da15e9db6d2 100644
--- a/arch/arm/mach-omap2/prm3xxx.c
+++ b/arch/arm/mach-omap2/prm3xxx.c
@@ -380,7 +380,7 @@ void __init omap3_prm_init_pm(bool has_uart4, bool has_iva)
380 * The ST_IO_CHAIN bit does not exist in 3430 before es3.1. The only 380 * The ST_IO_CHAIN bit does not exist in 3430 before es3.1. The only
381 * thing we can do is toggle EN_IO bit for earlier omaps. 381 * thing we can do is toggle EN_IO bit for earlier omaps.
382 */ 382 */
383void omap3430_pre_es3_1_reconfigure_io_chain(void) 383static void omap3430_pre_es3_1_reconfigure_io_chain(void)
384{ 384{
385 omap2_prm_clear_mod_reg_bits(OMAP3430_EN_IO_MASK, WKUP_MOD, 385 omap2_prm_clear_mod_reg_bits(OMAP3430_EN_IO_MASK, WKUP_MOD,
386 PM_WKEN); 386 PM_WKEN);
@@ -398,7 +398,7 @@ void omap3430_pre_es3_1_reconfigure_io_chain(void)
398 * deasserting WUCLKIN and clearing the ST_IO_CHAIN WKST bit. No 398 * deasserting WUCLKIN and clearing the ST_IO_CHAIN WKST bit. No
399 * return value. These registers are only available in 3430 es3.1 and later. 399 * return value. These registers are only available in 3430 es3.1 and later.
400 */ 400 */
401void omap3_prm_reconfigure_io_chain(void) 401static void omap3_prm_reconfigure_io_chain(void)
402{ 402{
403 int i = 0; 403 int i = 0;
404 404
@@ -421,15 +421,6 @@ void omap3_prm_reconfigure_io_chain(void)
421} 421}
422 422
423/** 423/**
424 * omap3xxx_prm_reconfigure_io_chain - reconfigure I/O chain
425 */
426void omap3xxx_prm_reconfigure_io_chain(void)
427{
428 if (omap3_prcm_irq_setup.reconfigure_io_chain)
429 omap3_prcm_irq_setup.reconfigure_io_chain();
430}
431
432/**
433 * omap3xxx_prm_enable_io_wakeup - enable wakeup events from I/O wakeup latches 424 * omap3xxx_prm_enable_io_wakeup - enable wakeup events from I/O wakeup latches
434 * 425 *
435 * Activates the I/O wakeup event latches and allows events logged by 426 * Activates the I/O wakeup event latches and allows events logged by
diff --git a/arch/arm/mach-omap2/prm3xxx.h b/arch/arm/mach-omap2/prm3xxx.h
index 5d993d2df7ef..321568bc0847 100644
--- a/arch/arm/mach-omap2/prm3xxx.h
+++ b/arch/arm/mach-omap2/prm3xxx.h
@@ -144,14 +144,6 @@ extern u32 omap3_prm_vcvp_read(u8 offset);
144extern void omap3_prm_vcvp_write(u32 val, u8 offset); 144extern void omap3_prm_vcvp_write(u32 val, u8 offset);
145extern u32 omap3_prm_vcvp_rmw(u32 mask, u32 bits, u8 offset); 145extern u32 omap3_prm_vcvp_rmw(u32 mask, u32 bits, u8 offset);
146 146
147#ifdef CONFIG_ARCH_OMAP3
148void omap3xxx_prm_reconfigure_io_chain(void);
149#else
150static inline void omap3xxx_prm_reconfigure_io_chain(void)
151{
152}
153#endif
154
155extern void omap3xxx_prm_dpll3_reset(void); 147extern void omap3xxx_prm_dpll3_reset(void);
156 148
157extern int __init omap3xxx_prm_init(void); 149extern int __init omap3xxx_prm_init(void);
diff --git a/arch/arm/mach-omap2/prm44xx.c b/arch/arm/mach-omap2/prm44xx.c
index bfcc3562e015..e7ac7e209edc 100644
--- a/arch/arm/mach-omap2/prm44xx.c
+++ b/arch/arm/mach-omap2/prm44xx.c
@@ -36,6 +36,7 @@ static void omap44xx_prm_read_pending_irqs(unsigned long *events);
36static void omap44xx_prm_ocp_barrier(void); 36static void omap44xx_prm_ocp_barrier(void);
37static void omap44xx_prm_save_and_clear_irqen(u32 *saved_mask); 37static void omap44xx_prm_save_and_clear_irqen(u32 *saved_mask);
38static void omap44xx_prm_restore_irqen(u32 *saved_mask); 38static void omap44xx_prm_restore_irqen(u32 *saved_mask);
39static void omap44xx_prm_reconfigure_io_chain(void);
39 40
40static const struct omap_prcm_irq omap4_prcm_irqs[] = { 41static const struct omap_prcm_irq omap4_prcm_irqs[] = {
41 OMAP_PRCM_IRQ("io", 9, 1), 42 OMAP_PRCM_IRQ("io", 9, 1),
@@ -292,7 +293,7 @@ static void omap44xx_prm_restore_irqen(u32 *saved_mask)
292 * deasserting WUCLKIN and waiting for WUCLKOUT to be deasserted. 293 * deasserting WUCLKIN and waiting for WUCLKOUT to be deasserted.
293 * No return value. XXX Are the final two steps necessary? 294 * No return value. XXX Are the final two steps necessary?
294 */ 295 */
295void omap44xx_prm_reconfigure_io_chain(void) 296static void omap44xx_prm_reconfigure_io_chain(void)
296{ 297{
297 int i = 0; 298 int i = 0;
298 s32 inst = omap4_prmst_get_prm_dev_inst(); 299 s32 inst = omap4_prmst_get_prm_dev_inst();
diff --git a/arch/arm/mach-omap2/prm44xx_54xx.h b/arch/arm/mach-omap2/prm44xx_54xx.h
index faa7411c79eb..f7512515fde5 100644
--- a/arch/arm/mach-omap2/prm44xx_54xx.h
+++ b/arch/arm/mach-omap2/prm44xx_54xx.h
@@ -38,15 +38,6 @@ extern u32 omap4_prm_vcvp_read(u8 offset);
38extern void omap4_prm_vcvp_write(u32 val, u8 offset); 38extern void omap4_prm_vcvp_write(u32 val, u8 offset);
39extern u32 omap4_prm_vcvp_rmw(u32 mask, u32 bits, u8 offset); 39extern u32 omap4_prm_vcvp_rmw(u32 mask, u32 bits, u8 offset);
40 40
41#if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) || \
42 defined(CONFIG_SOC_DRA7XX) || defined(CONFIG_SOC_AM43XX)
43void omap44xx_prm_reconfigure_io_chain(void);
44#else
45static inline void omap44xx_prm_reconfigure_io_chain(void)
46{
47}
48#endif
49
50extern int __init omap44xx_prm_init(void); 41extern int __init omap44xx_prm_init(void);
51extern u32 omap44xx_prm_get_reset_sources(void); 42extern u32 omap44xx_prm_get_reset_sources(void);
52 43
diff --git a/arch/arm/mach-omap2/prm_common.c b/arch/arm/mach-omap2/prm_common.c
index ce0434a16ad6..be40824acf5f 100644
--- a/arch/arm/mach-omap2/prm_common.c
+++ b/arch/arm/mach-omap2/prm_common.c
@@ -487,6 +487,22 @@ int omap_prm_is_hardreset_asserted(u8 shift, u8 part, s16 prm_mod, u16 offset)
487} 487}
488 488
489/** 489/**
490 * omap_prm_reconfigure_io_chain - clear latches and reconfigure I/O chain
491 *
492 * Clear any previously-latched I/O wakeup events and ensure that the
493 * I/O wakeup gates are aligned with the current mux settings.
494 * Calls SoC specific I/O chain reconfigure function if available,
495 * otherwise does nothing.
496 */
497void omap_prm_reconfigure_io_chain(void)
498{
499 if (!prcm_irq_setup || !prcm_irq_setup->reconfigure_io_chain)
500 return;
501
502 prcm_irq_setup->reconfigure_io_chain();
503}
504
505/**
490 * prm_register - register per-SoC low-level data with the PRM 506 * prm_register - register per-SoC low-level data with the PRM
491 * @pld: low-level per-SoC OMAP PRM data & function pointers to register 507 * @pld: low-level per-SoC OMAP PRM data & function pointers to register
492 * 508 *