mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-28 23:23:55 +08:00
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>
This commit is contained in:
parent
28db51f428
commit
4984eeaf71
@ -1984,10 +1984,7 @@ static void _reconfigure_io_chain(void)
|
||||
|
||||
spin_lock_irqsave(&io_chain_lock, flags);
|
||||
|
||||
if (cpu_is_omap34xx())
|
||||
omap3xxx_prm_reconfigure_io_chain();
|
||||
else if (cpu_is_omap44xx())
|
||||
omap44xx_prm_reconfigure_io_chain();
|
||||
omap_prm_reconfigure_io_chain();
|
||||
|
||||
spin_unlock_irqrestore(&io_chain_lock, flags);
|
||||
}
|
||||
|
@ -157,6 +157,8 @@ extern u32 prm_read_reset_sources(void);
|
||||
extern bool prm_was_any_context_lost_old(u8 part, s16 inst, u16 idx);
|
||||
extern void prm_clear_context_loss_flags_old(u8 part, s16 inst, u16 idx);
|
||||
|
||||
void omap_prm_reconfigure_io_chain(void);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -380,7 +380,7 @@ void __init omap3_prm_init_pm(bool has_uart4, bool has_iva)
|
||||
* The ST_IO_CHAIN bit does not exist in 3430 before es3.1. The only
|
||||
* thing we can do is toggle EN_IO bit for earlier omaps.
|
||||
*/
|
||||
void omap3430_pre_es3_1_reconfigure_io_chain(void)
|
||||
static void omap3430_pre_es3_1_reconfigure_io_chain(void)
|
||||
{
|
||||
omap2_prm_clear_mod_reg_bits(OMAP3430_EN_IO_MASK, WKUP_MOD,
|
||||
PM_WKEN);
|
||||
@ -398,7 +398,7 @@ void omap3430_pre_es3_1_reconfigure_io_chain(void)
|
||||
* deasserting WUCLKIN and clearing the ST_IO_CHAIN WKST bit. No
|
||||
* return value. These registers are only available in 3430 es3.1 and later.
|
||||
*/
|
||||
void omap3_prm_reconfigure_io_chain(void)
|
||||
static void omap3_prm_reconfigure_io_chain(void)
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
@ -420,15 +420,6 @@ void omap3_prm_reconfigure_io_chain(void)
|
||||
omap2_prm_read_mod_reg(WKUP_MOD, PM_WKST);
|
||||
}
|
||||
|
||||
/**
|
||||
* omap3xxx_prm_reconfigure_io_chain - reconfigure I/O chain
|
||||
*/
|
||||
void omap3xxx_prm_reconfigure_io_chain(void)
|
||||
{
|
||||
if (omap3_prcm_irq_setup.reconfigure_io_chain)
|
||||
omap3_prcm_irq_setup.reconfigure_io_chain();
|
||||
}
|
||||
|
||||
/**
|
||||
* omap3xxx_prm_enable_io_wakeup - enable wakeup events from I/O wakeup latches
|
||||
*
|
||||
|
@ -144,14 +144,6 @@ extern u32 omap3_prm_vcvp_read(u8 offset);
|
||||
extern void omap3_prm_vcvp_write(u32 val, u8 offset);
|
||||
extern u32 omap3_prm_vcvp_rmw(u32 mask, u32 bits, u8 offset);
|
||||
|
||||
#ifdef CONFIG_ARCH_OMAP3
|
||||
void omap3xxx_prm_reconfigure_io_chain(void);
|
||||
#else
|
||||
static inline void omap3xxx_prm_reconfigure_io_chain(void)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
extern void omap3xxx_prm_dpll3_reset(void);
|
||||
|
||||
extern int __init omap3xxx_prm_init(void);
|
||||
|
@ -36,6 +36,7 @@ static void omap44xx_prm_read_pending_irqs(unsigned long *events);
|
||||
static void omap44xx_prm_ocp_barrier(void);
|
||||
static void omap44xx_prm_save_and_clear_irqen(u32 *saved_mask);
|
||||
static void omap44xx_prm_restore_irqen(u32 *saved_mask);
|
||||
static void omap44xx_prm_reconfigure_io_chain(void);
|
||||
|
||||
static const struct omap_prcm_irq omap4_prcm_irqs[] = {
|
||||
OMAP_PRCM_IRQ("io", 9, 1),
|
||||
@ -292,7 +293,7 @@ static void omap44xx_prm_restore_irqen(u32 *saved_mask)
|
||||
* deasserting WUCLKIN and waiting for WUCLKOUT to be deasserted.
|
||||
* No return value. XXX Are the final two steps necessary?
|
||||
*/
|
||||
void omap44xx_prm_reconfigure_io_chain(void)
|
||||
static void omap44xx_prm_reconfigure_io_chain(void)
|
||||
{
|
||||
int i = 0;
|
||||
s32 inst = omap4_prmst_get_prm_dev_inst();
|
||||
|
@ -38,15 +38,6 @@ extern u32 omap4_prm_vcvp_read(u8 offset);
|
||||
extern void omap4_prm_vcvp_write(u32 val, u8 offset);
|
||||
extern u32 omap4_prm_vcvp_rmw(u32 mask, u32 bits, u8 offset);
|
||||
|
||||
#if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) || \
|
||||
defined(CONFIG_SOC_DRA7XX) || defined(CONFIG_SOC_AM43XX)
|
||||
void omap44xx_prm_reconfigure_io_chain(void);
|
||||
#else
|
||||
static inline void omap44xx_prm_reconfigure_io_chain(void)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
extern int __init omap44xx_prm_init(void);
|
||||
extern u32 omap44xx_prm_get_reset_sources(void);
|
||||
|
||||
|
@ -486,6 +486,22 @@ int omap_prm_is_hardreset_asserted(u8 shift, u8 part, s16 prm_mod, u16 offset)
|
||||
return prm_ll_data->is_hardreset_asserted(shift, part, prm_mod, offset);
|
||||
}
|
||||
|
||||
/**
|
||||
* omap_prm_reconfigure_io_chain - clear latches and reconfigure I/O chain
|
||||
*
|
||||
* Clear any previously-latched I/O wakeup events and ensure that the
|
||||
* I/O wakeup gates are aligned with the current mux settings.
|
||||
* Calls SoC specific I/O chain reconfigure function if available,
|
||||
* otherwise does nothing.
|
||||
*/
|
||||
void omap_prm_reconfigure_io_chain(void)
|
||||
{
|
||||
if (!prcm_irq_setup || !prcm_irq_setup->reconfigure_io_chain)
|
||||
return;
|
||||
|
||||
prcm_irq_setup->reconfigure_io_chain();
|
||||
}
|
||||
|
||||
/**
|
||||
* prm_register - register per-SoC low-level data with the PRM
|
||||
* @pld: low-level per-SoC OMAP PRM data & function pointers to register
|
||||
|
Loading…
Reference in New Issue
Block a user