diff options
| author | Tony Lindgren <tony@atomide.com> | 2014-09-16 18:09:44 -0400 |
|---|---|---|
| committer | Tony Lindgren <tony@atomide.com> | 2014-09-16 18:09:44 -0400 |
| commit | 7db143b89137de06ed289cf8b302f3bbbc5baa1f (patch) | |
| tree | d74d6abac3dcab9772cfda6983c885e530d44636 | |
| parent | 69e273c0b0a3c337a521d083374c918dc52c666f (diff) | |
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
b02b917211d5 ("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: 30a69ef785e8 ("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>
| -rw-r--r-- | arch/arm/mach-omap2/omap_hwmod.c | 2 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/prm3xxx.c | 39 |
2 files changed, 36 insertions, 5 deletions
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index 8fd87a3055bf..9e91a4e7519a 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c | |||
| @@ -2065,7 +2065,7 @@ static void _reconfigure_io_chain(void) | |||
| 2065 | 2065 | ||
| 2066 | spin_lock_irqsave(&io_chain_lock, flags); | 2066 | spin_lock_irqsave(&io_chain_lock, flags); |
| 2067 | 2067 | ||
| 2068 | if (cpu_is_omap34xx() && omap3_has_io_chain_ctrl()) | 2068 | if (cpu_is_omap34xx()) |
| 2069 | omap3xxx_prm_reconfigure_io_chain(); | 2069 | omap3xxx_prm_reconfigure_io_chain(); |
| 2070 | else if (cpu_is_omap44xx()) | 2070 | else if (cpu_is_omap44xx()) |
| 2071 | omap44xx_prm_reconfigure_io_chain(); | 2071 | omap44xx_prm_reconfigure_io_chain(); |
diff --git a/arch/arm/mach-omap2/prm3xxx.c b/arch/arm/mach-omap2/prm3xxx.c index 2458be6fc67b..372de3edf4a5 100644 --- a/arch/arm/mach-omap2/prm3xxx.c +++ b/arch/arm/mach-omap2/prm3xxx.c | |||
| @@ -45,7 +45,7 @@ static struct omap_prcm_irq_setup omap3_prcm_irq_setup = { | |||
| 45 | .ocp_barrier = &omap3xxx_prm_ocp_barrier, | 45 | .ocp_barrier = &omap3xxx_prm_ocp_barrier, |
| 46 | .save_and_clear_irqen = &omap3xxx_prm_save_and_clear_irqen, | 46 | .save_and_clear_irqen = &omap3xxx_prm_save_and_clear_irqen, |
| 47 | .restore_irqen = &omap3xxx_prm_restore_irqen, | 47 | .restore_irqen = &omap3xxx_prm_restore_irqen, |
| 48 | .reconfigure_io_chain = &omap3xxx_prm_reconfigure_io_chain, | 48 | .reconfigure_io_chain = NULL, |
| 49 | }; | 49 | }; |
| 50 | 50 | ||
| 51 | /* | 51 | /* |
| @@ -369,15 +369,30 @@ void __init omap3_prm_init_pm(bool has_uart4, bool has_iva) | |||
| 369 | } | 369 | } |
| 370 | 370 | ||
| 371 | /** | 371 | /** |
| 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 | ||
| 373 | * | 388 | * |
| 374 | * Clear any previously-latched I/O wakeup events and ensure that the | 389 | * Clear any previously-latched I/O wakeup events and ensure that the |
| 375 | * I/O wakeup gates are aligned with the current mux settings. Works | 390 | * I/O wakeup gates are aligned with the current mux settings. Works |
| 376 | * by asserting WUCLKIN, waiting for WUCLKOUT to be asserted, and then | 391 | * by asserting WUCLKIN, waiting for WUCLKOUT to be asserted, and then |
| 377 | * deasserting WUCLKIN and clearing the ST_IO_CHAIN WKST bit. No | 392 | * 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. |
| 379 | */ | 394 | */ |
| 380 | void omap3xxx_prm_reconfigure_io_chain(void) | 395 | void omap3_prm_reconfigure_io_chain(void) |
| 381 | { | 396 | { |
| 382 | int i = 0; | 397 | int i = 0; |
| 383 | 398 | ||
| @@ -400,6 +415,15 @@ void omap3xxx_prm_reconfigure_io_chain(void) | |||
| 400 | } | 415 | } |
| 401 | 416 | ||
| 402 | /** | 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 | |||
| 426 | /** | ||
| 403 | * omap3xxx_prm_enable_io_wakeup - enable wakeup events from I/O wakeup latches | 427 | * omap3xxx_prm_enable_io_wakeup - enable wakeup events from I/O wakeup latches |
| 404 | * | 428 | * |
| 405 | * Activates the I/O wakeup event latches and allows events logged by | 429 | * Activates the I/O wakeup event latches and allows events logged by |
| @@ -656,6 +680,13 @@ static int omap3xxx_prm_late_init(void) | |||
| 656 | if (!(prm_features & PRM_HAS_IO_WAKEUP)) | 680 | if (!(prm_features & PRM_HAS_IO_WAKEUP)) |
| 657 | return 0; | 681 | return 0; |
| 658 | 682 | ||
| 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 | |||
| 659 | omap3xxx_prm_enable_io_wakeup(); | 690 | omap3xxx_prm_enable_io_wakeup(); |
| 660 | ret = omap_prcm_register_chain_handler(&omap3_prcm_irq_setup); | 691 | ret = omap_prcm_register_chain_handler(&omap3_prcm_irq_setup); |
| 661 | if (!ret) | 692 | if (!ret) |
