Skip to content

Commit 21c68e7

Browse files
committed
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: Olof Johansson <olof@lixom.net>
2 parents 602f585 + 7db143b commit 21c68e7

2 files changed

Lines changed: 36 additions & 5 deletions

File tree

‎arch/arm/mach-omap2/omap_hwmod.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2065,7 +2065,7 @@ static void _reconfigure_io_chain(void)
20652065

20662066
spin_lock_irqsave(&io_chain_lock, flags);
20672067

2068-
if (cpu_is_omap34xx() && omap3_has_io_chain_ctrl())
2068+
if (cpu_is_omap34xx())
20692069
omap3xxx_prm_reconfigure_io_chain();
20702070
else if (cpu_is_omap44xx())
20712071
omap44xx_prm_reconfigure_io_chain();

‎arch/arm/mach-omap2/prm3xxx.c‎

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ static struct omap_prcm_irq_setup omap3_prcm_irq_setup = {
4545
.ocp_barrier = &omap3xxx_prm_ocp_barrier,
4646
.save_and_clear_irqen = &omap3xxx_prm_save_and_clear_irqen,
4747
.restore_irqen = &omap3xxx_prm_restore_irqen,
48-
.reconfigure_io_chain = &omap3xxx_prm_reconfigure_io_chain,
48+
.reconfigure_io_chain = NULL,
4949
};
5050

5151
/*
@@ -369,15 +369,30 @@ void __init omap3_prm_init_pm(bool has_uart4, bool has_iva)
369369
}
370370

371371
/**
372-
* omap3xxx_prm_reconfigure_io_chain - clear latches and reconfigure I/O chain
372+
* omap3430_pre_es3_1_reconfigure_io_chain - restart wake-up daisy chain
373+
*
374+
* The ST_IO_CHAIN bit does not exist in 3430 before es3.1. The only
375+
* thing we can do is toggle EN_IO bit for earlier omaps.
376+
*/
377+
void omap3430_pre_es3_1_reconfigure_io_chain(void)
378+
{
379+
omap2_prm_clear_mod_reg_bits(OMAP3430_EN_IO_MASK, WKUP_MOD,
380+
PM_WKEN);
381+
omap2_prm_set_mod_reg_bits(OMAP3430_EN_IO_MASK, WKUP_MOD,
382+
PM_WKEN);
383+
omap2_prm_read_mod_reg(WKUP_MOD, PM_WKEN);
384+
}
385+
386+
/**
387+
* omap3_prm_reconfigure_io_chain - clear latches and reconfigure I/O chain
373388
*
374389
* Clear any previously-latched I/O wakeup events and ensure that the
375390
* I/O wakeup gates are aligned with the current mux settings. Works
376391
* by asserting WUCLKIN, waiting for WUCLKOUT to be asserted, and then
377392
* deasserting WUCLKIN and clearing the ST_IO_CHAIN WKST bit. No
378-
* return value.
393+
* return value. These registers are only available in 3430 es3.1 and later.
379394
*/
380-
void omap3xxx_prm_reconfigure_io_chain(void)
395+
void omap3_prm_reconfigure_io_chain(void)
381396
{
382397
int i = 0;
383398

@@ -399,6 +414,15 @@ void omap3xxx_prm_reconfigure_io_chain(void)
399414
omap2_prm_read_mod_reg(WKUP_MOD, PM_WKST);
400415
}
401416

417+
/**
418+
* omap3xxx_prm_reconfigure_io_chain - reconfigure I/O chain
419+
*/
420+
void omap3xxx_prm_reconfigure_io_chain(void)
421+
{
422+
if (omap3_prcm_irq_setup.reconfigure_io_chain)
423+
omap3_prcm_irq_setup.reconfigure_io_chain();
424+
}
425+
402426
/**
403427
* omap3xxx_prm_enable_io_wakeup - enable wakeup events from I/O wakeup latches
404428
*
@@ -656,6 +680,13 @@ static int omap3xxx_prm_late_init(void)
656680
if (!(prm_features & PRM_HAS_IO_WAKEUP))
657681
return 0;
658682

683+
if (omap3_has_io_chain_ctrl())
684+
omap3_prcm_irq_setup.reconfigure_io_chain =
685+
omap3_prm_reconfigure_io_chain;
686+
else
687+
omap3_prcm_irq_setup.reconfigure_io_chain =
688+
omap3430_pre_es3_1_reconfigure_io_chain;
689+
659690
omap3xxx_prm_enable_io_wakeup();
660691
ret = omap_prcm_register_chain_handler(&omap3_prcm_irq_setup);
661692
if (!ret)

0 commit comments

Comments
 (0)