Skip to content

Commit 7db143b

Browse files
committed
ARM: OMAP3: Fix I/O chain clock line assertion timed out error
We are getting "PRM: I/O chain clock line assertion timed out" errors on early omaps for device tree based booting. This is because we are unconditionally calling reconfigure_io_chain while legacy booting has omap3_has_io_chain_ctrl() checks in place in omap_hwmod.c. For device tree based booting, we are calling reconfigure_io_chain unconditionally from pinctrl framework. So we need to add a check for omap3_has_io_chain_ctrl() to avoid the errors for trying to access a register that does not exist. For es3.0, the documentation in "4.11.2 Device Off-Mode Configuration" just mentions PM_WKEN_WKUP[8] bit. For es3.1, there's a new chapter in documentation for "4.11.2.2 I/O Wake-Up Mechanism" that describes the PM_WKEN_WKUP[16] ST_IO_CHAIN bit. So PM_WKEN_WKUP[16] bit did not get added until in es3.1 probaly to fix issues with flakey wake-up events. We are doing proper checks for ST_IO_CHAIN already in id.c and with omap3_has_io_chain_ctrl(). For more information, see also commit b02b917 ("ARM: OMAP3: PM: fix I/O wakeup and I/O chain clock control detection"). Let's fix the issue by selecting the right function during init for reconfigure_io_chain depending on the omap revision. For es3.0 and earlier we need to just toggle EN_IO. By doing this, we can move the check for omap3_has_io_chain_ctrl() from omap_hwmod.c to the init code in prm_3xxx.c. And then we can unconditionally call reconfigure_io_chain. Thanks to Paul Walmsley and Nishanth Menon for help with debugging the issue. Fixes: 30a69ef ("ARM: OMAP: Move DT wake-up event handling over to use pinctrl-single-omap") Cc: Kevin Hilman <khilman@kernel.org> Cc: Paul Walmsley <paul@pwsan.com> Cc: Tero Kristo <t-kristo@ti.com> Reviewed-by: Nishanth Menon <nm@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
1 parent 69e273c commit 7db143b

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)