Commit 21c68e7c authored by Olof Johansson's avatar Olof Johansson

Merge tag 'fix-v3.17-io-chain-v3' of...

Merge tag 'fix-v3.17-io-chain-v3' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into fixes

Regression fix for early omap3 revisions for wake-up events that
too some time to narrow down. Although a bit intrusive, this would
be good to get into the -rc cycle as there are quite a few boards
out there with omap3 es2.1 and es3.0, and we have those in at least
three boot test systems too that show errors without this patch.

* tag 'fix-v3.17-io-chain-v3' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
  ARM: OMAP3: Fix I/O chain clock line assertion timed out error
Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
parents 602f5850 7db143b8
...@@ -2065,7 +2065,7 @@ static void _reconfigure_io_chain(void) ...@@ -2065,7 +2065,7 @@ static void _reconfigure_io_chain(void)
spin_lock_irqsave(&io_chain_lock, flags); spin_lock_irqsave(&io_chain_lock, flags);
if (cpu_is_omap34xx() && omap3_has_io_chain_ctrl()) if (cpu_is_omap34xx())
omap3xxx_prm_reconfigure_io_chain(); omap3xxx_prm_reconfigure_io_chain();
else if (cpu_is_omap44xx()) else if (cpu_is_omap44xx())
omap44xx_prm_reconfigure_io_chain(); omap44xx_prm_reconfigure_io_chain();
......
...@@ -45,7 +45,7 @@ static struct omap_prcm_irq_setup omap3_prcm_irq_setup = { ...@@ -45,7 +45,7 @@ static struct omap_prcm_irq_setup omap3_prcm_irq_setup = {
.ocp_barrier = &omap3xxx_prm_ocp_barrier, .ocp_barrier = &omap3xxx_prm_ocp_barrier,
.save_and_clear_irqen = &omap3xxx_prm_save_and_clear_irqen, .save_and_clear_irqen = &omap3xxx_prm_save_and_clear_irqen,
.restore_irqen = &omap3xxx_prm_restore_irqen, .restore_irqen = &omap3xxx_prm_restore_irqen,
.reconfigure_io_chain = &omap3xxx_prm_reconfigure_io_chain, .reconfigure_io_chain = NULL,
}; };
/* /*
...@@ -369,15 +369,30 @@ void __init omap3_prm_init_pm(bool has_uart4, bool has_iva) ...@@ -369,15 +369,30 @@ void __init omap3_prm_init_pm(bool has_uart4, bool has_iva)
} }
/** /**
* omap3xxx_prm_reconfigure_io_chain - clear latches and reconfigure I/O chain * omap3430_pre_es3_1_reconfigure_io_chain - restart wake-up daisy chain
*
* 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)
{
omap2_prm_clear_mod_reg_bits(OMAP3430_EN_IO_MASK, WKUP_MOD,
PM_WKEN);
omap2_prm_set_mod_reg_bits(OMAP3430_EN_IO_MASK, WKUP_MOD,
PM_WKEN);
omap2_prm_read_mod_reg(WKUP_MOD, PM_WKEN);
}
/**
* omap3_prm_reconfigure_io_chain - clear latches and reconfigure I/O chain
* *
* Clear any previously-latched I/O wakeup events and ensure that the * Clear any previously-latched I/O wakeup events and ensure that the
* I/O wakeup gates are aligned with the current mux settings. Works * I/O wakeup gates are aligned with the current mux settings. Works
* by asserting WUCLKIN, waiting for WUCLKOUT to be asserted, and then * by asserting WUCLKIN, waiting for WUCLKOUT to be asserted, and then
* deasserting WUCLKIN and clearing the ST_IO_CHAIN WKST bit. No * deasserting WUCLKIN and clearing the ST_IO_CHAIN WKST bit. No
* return value. * return value. These registers are only available in 3430 es3.1 and later.
*/ */
void omap3xxx_prm_reconfigure_io_chain(void) void omap3_prm_reconfigure_io_chain(void)
{ {
int i = 0; int i = 0;
...@@ -399,6 +414,15 @@ void omap3xxx_prm_reconfigure_io_chain(void) ...@@ -399,6 +414,15 @@ void omap3xxx_prm_reconfigure_io_chain(void)
omap2_prm_read_mod_reg(WKUP_MOD, PM_WKST); 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 * omap3xxx_prm_enable_io_wakeup - enable wakeup events from I/O wakeup latches
* *
...@@ -656,6 +680,13 @@ static int omap3xxx_prm_late_init(void) ...@@ -656,6 +680,13 @@ static int omap3xxx_prm_late_init(void)
if (!(prm_features & PRM_HAS_IO_WAKEUP)) if (!(prm_features & PRM_HAS_IO_WAKEUP))
return 0; return 0;
if (omap3_has_io_chain_ctrl())
omap3_prcm_irq_setup.reconfigure_io_chain =
omap3_prm_reconfigure_io_chain;
else
omap3_prcm_irq_setup.reconfigure_io_chain =
omap3430_pre_es3_1_reconfigure_io_chain;
omap3xxx_prm_enable_io_wakeup(); omap3xxx_prm_enable_io_wakeup();
ret = omap_prcm_register_chain_handler(&omap3_prcm_irq_setup); ret = omap_prcm_register_chain_handler(&omap3_prcm_irq_setup);
if (!ret) if (!ret)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment