Skip to content
  1. Sep 30, 2011
    • Axel Lin's avatar
      ARM: OMAP: musb: Remove a redundant omap4430_phy_init call in usb_musb_init · b8e111a7
      Axel Lin authored
      
      
      Current code calls omap4430_phy_init() twice in usb_musb_init().
      Calling omap4430_phy_init() once is enough.
      This patch removes the first omap4430_phy_init() call, which using an
      uninitialized pointer as parameter.
      
      This patch elimates below build warning:
      arch/arm/mach-omap2/usb-musb.c: In function 'usb_musb_init':
      arch/arm/mach-omap2/usb-musb.c:141: warning: 'dev' may be used uninitialized in this function
      
      Signed-off-by: default avatarAxel Lin <axel.lin@gmail.com>
      Bjarne Steinsbo <bsteinsbo@gmail.com>
      Acked-by: default avatarFelipe Balbi <balbi@ti.com>
      Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
      b8e111a7
    • Tony Lindgren's avatar
      ARM: OMAP: Fix i2c init for twl4030 · bfd46a54
      Tony Lindgren authored
      
      
      Looks like 2600 kHz rate does not work reliably on 2430,
      so just use the 100 kHz rate.
      
      Otherwise the system often fails to boot properly with:
      
      omap_i2c omap_i2c.2: timeout waiting for bus ready
      omap_i2c omap_i2c.2: timeout waiting for bus ready
      twl: i2c_write failed to transfer all messages
      omap_i2c omap_i2c.2: timeout waiting for bus ready
      twl: i2c_write failed to transfer all messages
      omap_i2c omap_i2c.2: timeout waiting for bus ready
      twl: i2c_write failed to transfer all messages
      twl: clock init err [-110]
      omap_i2c omap_i2c.2: timeout waiting for bus ready
      twl: i2c_write failed to transfer all messages
      TWL4030 Unable to unlock IDCODE registers --110
      
      Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
      bfd46a54
    • Bryan Buckley's avatar
      ARM: OMAP4: MMC: fix power and audio issue, decouple USBC1 from MMC1 · 3696d303
      Bryan Buckley authored
      
      
      Remove OMAP4_USBC1_ICUSB_PWRDNZ_MASK during enable/disable PWRDNZ mode for
      MMC1_PBIAS and associated extended-drain MMC1 I/O cell. This is in accordance
      with the control module programming guide. This fixes a bug where if trying to
      use gpio_98 or gpio_99 and MMC1 at the same time the GPIO signal will be
      affected by a changing SDMMC1_VDDS.
      
      Software must keep MMC1_PBIAS cell and MMC1_IO cell PWRDNZ signals low whenever
      SDMMC1_VDDS ramps up/down or changes for cell protection purposes.
      
      MMC1 is based on SDMMC1_VDDS whereas USBC1 is based on SIM_VDDS therefore
      they can operate independently.
      
      Signed-off-by: default avatarBryan Buckley <bryan.buckley@ti.com>
      Acked-by: default avatarKishore Kadiyala <kishore.kadiyala@ti.com>
      Tested-by: default avatarBalaji T K <balajitk@ti.com>
      Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
      3696d303
  2. Sep 05, 2011
    • Paul Walmsley's avatar
      OMAP2430: hwmod: musb: add missing terminator to omap2430_usbhsotg_addrs[] · 10167873
      Paul Walmsley authored
      
      
      Add a missing array terminator to omap2430_usbhsotg_addrs[].  Without
      this terminator, the omap_hwmod resource building code runs off the
      end of the array, resulting in at least this error -- if not worse
      behavior:
      
      [    0.578002] musb-omap2430: failed to claim resource 4
      [    0.583465] omap_device: musb-omap2430: build failed (-16)
      [    0.589294] Could not build omap_device for musb-omap2430 usb_otg_hs
      
      This should have been part of commit
      78183f3f ("omap_hwmod: use a null
      structure record to terminate omap_hwmod_addr_space arrays") but was
      evidently missed.
      
      Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
      10167873
  3. Aug 22, 2011
    • Paul Walmsley's avatar
      OMAP3: clock: indicate that gpt12_fck and wdt1_fck are in the WKUP clockdomain · e21757a0
      Paul Walmsley authored
      The oscillator that supplies GPT12_FCLK and WDT1_FCLK exists in the
      WKUP powerdomain[1].  This resolves at least one boot-time warning:
      
      omap_hwmod: gpt12_fck: missing clockdomain for gpt12_fck.
      
      1. _OMAP34xx Multimedia High Security (HS) Device Silicon Revision 3.1.x
         Security Addendum Version K (SWPU119K)_  Figure 3-29.  August 2010.
      e21757a0
  4. Aug 21, 2011
    • Paul Walmsley's avatar
      OMAP4: clock: fix compile warning · 450a37d2
      Paul Walmsley authored
      
      
      Fix the following compile warning:
      
      arch/arm/mach-omap2/clock44xx_data.c: In function 'omap4xxx_clk_init':
      arch/arm/mach-omap2/clock44xx_data.c:3371:6: warning: 'cpu_clkflg' may be used uninitialized in this function
      
      The approach taken here is intended to work if omap4xxx_clk_init() is
      converted into an initcall.
      
      Thanks to Bjarne Steinsbo <bsteinsbo@gmail.com> for proposing another
      approach.
      
      Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
      Cc: Bjarne Steinsbo <bsteinsbo@gmail.com>
      450a37d2
  5. Aug 19, 2011
    • Paul Walmsley's avatar
      OMAP4: clock: re-enable previous clockdomain enable/disable sequence · 9c5f5601
      Paul Walmsley authored
      After commit 665d0013 ("OMAP2+: hwmod:
      Follow the recommended PRCM module enable sequence"), device drivers
      for OMAP IP blocks that do not use runtime PM can cause oopses or
      kernel instability[1][2].
      
      This is because those non-runtime PM drivers do not use the hwmod
      code, which implements the correct IP block enable and disable
      sequence.
      
      Several options for dealing with this problem have been proposed:
      
      1. Add a new field to the OMAP struct clk to mark clocks that are
         currently used by non-runtime PM drivers.  Modify the clock code to
         use the old clockdomain sequence for these marked clocks.  As
         drivers are converted to use runtime PM, remove the annotation from
         the clocks.
      
      2. Similar to #1, but associate the flag with the struct omap_clk
         instead.
      
      3. Add IDLEST wait support to the OMAP4 clock code, similar to the way
         it is implemented for OMAP2/3, and enable it in each struct clk
         currently used by non-runtime PM drivers.  As drivers are converted
         to use runtime PM, remove the annotation from the clocks.
      
      4. Do nothing; leave the problem to those responsible for the
         unconverted drivers.
      
      5. Re-enable clock-based clockdomain control in the OMAP4 clock code.
         This would revert back to the behavior of Linux 3.0, simply with a
         slightly longer module enable/disable latency.
      
      Unfortunately, no approach seemed particularly good.  Options 1
      through 3 seemed unwise due to the following reasons:
      
      A. The OMAP struct clks are intended primarily to describe hardware
         clock nodes, and the intention is that no driver-specific data
         should be stored there (applies to #1)
      
      B. The resulting patch would have been quite large for the -rc series
         (applies to #1, #2, #3)
      
      C. The patch would have been a new, yet temporary hack; and similar fixes
         have drawn negative comments in the recent past (see for example [3])
      
      Option 4 is undesirable because commit
      665d0013 ("OMAP2+: hwmod: Follow the
      recommended PRCM module enable sequence") has resulted in a less
      stable kernel; and kernel stability is more important than OMAP4 power
      management.
      
      Option 5 is the approach taken in this patch.  This seemed to be the
      least intrusive approach for 3.1-rc.
      
      The approach in this patch was originally proposed by Ohad Ben-Cohen
      <ohad@wizery.com>.  I'm simply writing the commit message and passing
      it along.
      
      ...
      
      Thanks to Luciano Coelho <coelho@ti.com> for reporting the problem.
      Thanks to Ohad Ben-Cohen <ohad@wizery.com> for tracking the problem
      down, generating a temporary workaround, and proposing a patch to deal
      with the problem.  Thanks to Rajendra Nayak <rnayak@ti.com> for
      proposing another patch to deal with the problem.  Thanks to Felipe
      Balbi <balbi@ti.com> for comments.
      
      1. Coelho, Luciano <coelho@ti.com>.  _Re: Oops on ehci_hcd when
         booting 3.0.0-rc2 on panda_.  Tue, 09 Aug 2011 14:26:08 +0300.
         Posted to the <linux-omap@vger.kernel.org> mailing list.  Available
         from (among others)
         http://www.spinics.net/linux/lists/linux-omap/msg55213.html
      
      2. Munegowda, Keshava <keshava_mgowda@ti.com>. _Re: Oops on ehci_hcd
         when booting 3.0.0-rc2 on panda_.  Thu, 11 Aug 2011 13:51:05 +0530.
         Posted to the <linux-omap@vger.kernel.org> mailing list.  Available
         from (among others)
         http://www.spinics.net/linux/lists/linux-omap/msg55371.html
      
      3. King, Russell <linux@arm.linux.org.uk>.  _Re: [PATCH 5/8] OMAP4:
         PM: TEMP: Prevent l3init from idling/force sleep_.  Thu, 23 Jun
         2011 16:22:49 +0100.  Posted to the <linux-omap@vger.kernel.org>
         mailing list.  Available from (among others)
         http://www.mail-archive.com/linux-omap@vger.kernel.org/msg51392.html
      
      
      
      Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
      Cc: Luciano Coelho <coelho@ti.com>
      Cc: Ohad Ben-Cohen <ohad@wizery.com>
      Cc: Rajendra Nayak <rnayak@ti.com>
      Cc: Benoît Cousson <b-cousson@ti.com>
      Acked-by: default avatarSantosh Shilimkar <santosh.shilimkar@ti.com>
      
      9c5f5601
    • Santosh Shilimkar's avatar
      OMAP: clockdomain: Wait for powerdomain to be ON when using clockdomain force wakeup · b1cbdb00
      Santosh Shilimkar authored
      
      
      While using clockdomain force wakeup method, not waiting for powerdomain
      to be effectively ON may end up locking the clockdomain FSM until a
      next wakeup event occurs.
      
      One such issue was seen on OMAP4430, where L4_PER was periodically
      getting stuck in in-transition state when transitioning from from OSWR to ON.
      
      This issue was reported and investigated by Patrick Titiano <p-titiano@ti.com>
      
      Signed-off-by: default avatarSantosh Shilimkar <santosh.shilimkar@ti.com>
      Signed-off-by: default avatarRajendra Nayak <rnayak@ti.com>
      Reported-by: default avatarPatrick Titiano <p-titiano@ti.com>
      Cc: Kevin Hilman <khilman@ti.com>
      Cc: Benoit Cousson <b-cousson@ti.com>
      Cc: Paul Walmsley <paul@pwsan.com>
      [paul@pwsan.com: updated to apply; added transition wait on clkdm_deny_idle();
       remove two superfluous pwrdm_wait_transition() calls]
      Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
      b1cbdb00
    • Rajendra Nayak's avatar
      OMAP: powerdomains: Make all powerdomain target states as ON at init · c956b753
      Rajendra Nayak authored
      
      
      Program all powerdomain target state as ON; this is to prevent domains
      from hitting low power states (if bootloader has target states set to
      something other than ON) and potentially even losing context while PM
      is not fully initialized, which can cause the system to crash.  The PM
      late init code can then program the desired target state for all the
      power domains.
      
      Signed-off-by: default avatarRajendra Nayak <rnayak@ti.com>
      Signed-off-by: default avatarSantosh Shilimkar <santosh.shilimkar@ti.com>
      [paul@pwsan.com: dropped comment typo hunk; fixed comment indent and moved
       to kerneldoc; moved code to pwrdm_init(); changed pwrdm_init() argument name
       to prevent clash; cleaned up patch description]
      Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
      c956b753
  6. Aug 10, 2011
    • Hemant Pedanekar's avatar
      omap: timer: Set dmtimer used as clocksource in autoreload mode · e9d0b97e
      Hemant Pedanekar authored
      
      
      If CONFIG_OMAP_32K_TIMER is not selected and dmtimer is used as clocksource, the
      timer stops counting once overflow occurs as it was not set in autoreload mode.
      This results into timekeeping failure: for example, 'sleep 1' at the shell after
      the timer counter overflow would hang.
      
      This patch sets up autoreload when starting the clocksource timer which fixes
      the above issue.
      
      Signed-off-by: default avatarHemant Pedanekar <hemantp@ti.com>
      Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
      e9d0b97e
    • Johan Hovold's avatar
      OMAP3: am3517crane: remove NULL board_mux from board file · 133e6b55
      Johan Hovold authored
      
      
      Since 7203f8a4 (arm: mach-omap2: remove
      NULL board_mux from board files) NULL board_mux is defined in mux.h.
      
      Signed-off-by: default avatarJohan Hovold <jhovold@gmail.com>
      Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
      133e6b55
    • Thomas Meyer's avatar
      arm: mach-omap2: mux: use kstrdup() · dccb3b0e
      Thomas Meyer authored
      Use kstrdup rather than duplicating its implementation
      
      The semantic patch that makes this output is available
      in scripts/coccinelle/api/kstrdup.cocci.
      
      More information about semantic patching is available at
      http://coccinelle.lip6.fr/
      
      
      
      Signed-off-by: default avatarThomas Meyer <thomas@m3y3r.de>
      Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
      dccb3b0e
    • Paul Walmsley's avatar
      OMAP: hwmod: fix build break on non-OMAP4 multi-OMAP2 builds · c9a48c2a
      Paul Walmsley authored
      
      
      Builds for multi-OMAP2 (e.g., OMAP2420 with OMAP2430) with
      CONFIG_ARCH_OMAP4=n fail with the following errors:
      
      arch/arm/mach-omap2/built-in.o: In function `_enable_module':
      arch/arm/mach-omap2/omap_hwmod.c:701: undefined reference to `omap4_cminst_module_enable'
      arch/arm/mach-omap2/built-in.o: In function `_disable_module':
      arch/arm/mach-omap2/omap_hwmod.c:726: undefined reference to `omap4_cminst_module_disable'
      arch/arm/mach-omap2/built-in.o: In function `_wait_target_disable':
      arch/arm/mach-omap2/omap_hwmod.c:1179: undefined reference to `omap4_cminst_wait_module_idle'
      
      This is probably due to the preprocessor directives in
      arch/arm/plat-omap/include/plat/cpu.h that convert some cpu_is_omap*()
      expressions from preprocessor directives into something that is only
      resolvable during runtime, if multiple OMAP2 build targets are
      selected.
      
      Thanks to Tony Lindgren <tony@atomide.com> for reporting.
      
      Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
      Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
      c9a48c2a
    • Peter Ujfalusi's avatar
      OMAP: Fix linking error in twl-common.c for OMAP2/3/4 only builds · d12d1fca
      Peter Ujfalusi authored
      
      
      Commit b22f954b (OMAP4: Move common twl6030 configuration to twl-common)
      caused compile failures for code for OMAP arch which is not selected by
      the config.
      
      Fixes issues like:
      With CONFIG_ARCH_OMAP3=y and CONFIG_ARCH_OMAP4=n, I'm getting this:
      
      arch/arm/mach-omap2/built-in.o:(.data+0xf99c): undefined reference to `omap4430_phy_init'
      arch/arm/mach-omap2/built-in.o:(.data+0xf9a0): undefined reference to `omap4430_phy_exit'
      arch/arm/mach-omap2/built-in.o:(.data+0xf9a4): undefined reference to `omap4430_phy_power'
      arch/arm/mach-omap2/built-in.o:(.data+0xf9a8): undefined reference to `omap4430_phy_set_clk'
      arch/arm/mach-omap2/built-in.o:(.data+0xf9ac): undefined reference to `omap4430_phy_suspend'
      
      Fix the problem by moving the code to ifdef sections for omap3 and omap4.
      
      Signed-off-by: default avatarPeter Ujfalusi <peter.ujfalusi@ti.com>
      [tony@atomide.com: updated comments]
      Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
      d12d1fca
  7. Aug 05, 2011
    • Colin Cross's avatar
      OMAP2+: PM: SmartReflex: use put_sync_suspend for IRQ-safe disabling · 98333b3d
      Colin Cross authored
      
      
      omap_sr_disable_reset_volt is called with irqs off in omapx_enter_sleep,
      as part of idle sequence, this eventually calls sr_disable and
      pm_runtime_put_sync. pm_runtime_put_sync calls rpm_idle, which will
      enable interrupts in order to call the callback. In this short interval
      when interrupts are enabled, scenarios such as the following can occur:
      while interrupts are enabled, the timer interrupt that is supposed to
      wake the device out of idle occurs and is acked, so when the CPU finally
      goes to off, the timer is already gone, missing a wakeup event.
      
      Further, as the documentation for runtime states:"
       However, subsystems can use the pm_runtime_irq_safe() helper function
       to tell the PM core that a device's ->runtime_suspend() and ->runtime_resume()
       callbacks should be invoked in atomic context with interrupts disabled
       (->runtime_idle() is still invoked the default way)."
      
      Hence, replace pm_runtime_put_sync with pm_runtime_put_sync_suspend
      to invoke the suspend handler and shut off the fclk for SmartReflex
      module instead of using the idle handler in interrupt disabled context.
      
      Signed-off-by: default avatarNishanth Menon <nm@ti.com>
      Signed-off-by: default avatarColin Cross <ccross@google.com>
      [khilman@ti.com: minor Subject edits]
      Signed-off-by: default avatarKevin Hilman <khilman@ti.com>
      98333b3d
    • Kevin Hilman's avatar
      OMAP3: beagle: don't touch omap_device internals · 8c7f6594
      Kevin Hilman authored
      
      
      Board code should not touch omap_device internals.  To get the MPU/IVA devices,
      use existing APIs: omap2_get_mpu_device(), omap2_get_iva_device().
      
      Signed-off-by: default avatarKevin Hilman <khilman@ti.com>
      8c7f6594
    • Nishanth Menon's avatar
      OMAP3+: SR: ensure pm-runtime callbacks can be invoked with IRQs disabled · e13d8f38
      Nishanth Menon authored
      
      
      SmartReflex should be disabled while entering low power mode due to
      a) SmartReflex values are not defined for retention voltage, further
      b) with SmartReflex enabled, if CPU enters lower c-states, FSM will try
      to bump the voltage to current OPP's voltage for which it has entered c-state;
      hence SmartReflex needs to be disabled for MPU, CORE and IVA voltage
      domains in idle path before enabling auto retention voltage achievement
      on the device.
      
      However, since the current pm_runtime setup for SmartReflex devices are
      setup to allow callbacks to be invoked with interrupts enabled, calling
      SmartReflex enable/disable from other contexts such as idle paths
      where preemption is disabled causes warnings such as the following
      indicating of a potential race.
      [   82.023895] [<c04d079c>] (__irq_svc+0x3c/0x120) from [<c04d0484>] (_raw_spin_unlock_irq+0x28/0x2c)
      [   82.023895] [<c04d0484>] (_raw_spin_unlock_irq+0x28/0x2c) from [<c0323234>] (rpm_callback+0x4c/0x68)
      [   82.023956] [<c0323234>] (rpm_callback+0x4c/0x68) from [<c0323f7c>] (rpm_resume+0x338/0x53c)
      [   82.023956] [<c0323f7c>] (rpm_resume+0x338/0x53c) from [<c03243f4>] (__pm_runtime_resume+0x48/0x60)
      [   82.023986] [<c03243f4>] (__pm_runtime_resume+0x48/0x60) from [<c008aee0>] (sr_enable+0xa8/0x19c)
      [   82.023986] [<c008aee0>] (sr_enable+0xa8/0x19c) from [<c008b2fc>] (omap_sr_enable+0x50/0x90)
      [   82.024017] [<c008b2fc>] (omap_sr_enable+0x50/0x90) from [<c00888c0>] (omap4_enter_sleep+0x138/0x168)
      
      Instead, we use pm_runtime_irq_safe to tell the PM core that callbacks can be
      invoked in interrupt disabled contexts.
      
      Acked-by: default avatarRajendra Nayak <rnayak@ti.com>
      Signed-off-by: default avatarNishanth Menon <nm@ti.com>
      [khilman@ti.com: minor changelog edits]
      Signed-off-by: default avatarKevin Hilman <khilman@ti.com>
      e13d8f38
    • Kevin Hilman's avatar
      OMAP2+: Kconfig: don't select PM in OMAP2PLUS_TYPICAL · 44e51b29
      Kevin Hilman authored
      
      
      CONFIG_PM is no longer a user-selectable Kconfig option.  Rather it is
      automatically enabled if either CONFIG_SUSPEND or CONFIG_RUNTIME_PM is
      enabled, so having a 'select PM' here is redunant when 'select
      CONFIG_PM_RUNTIME' is present.
      
      Signed-off-by: default avatarKevin Hilman <khilman@ti.com>
      44e51b29
  8. Jul 27, 2011
  9. Jul 25, 2011
  10. Jul 19, 2011
  11. Jul 12, 2011
  12. Jul 10, 2011
    • Rajendra Nayak's avatar
      OMAP2+: hwmod: Follow the recommended PRCM module enable sequence · 665d0013
      Rajendra Nayak authored
      
      
      On OMAP4, the PRCM recommended sequence for enabling
      a module after power-on-reset is:
      -1- Force clkdm to SW_WKUP
      -2- Enabling the clocks
      -3- Configure desired module mode to "enable" or "auto"
      -4- Wait for the desired module idle status to be FUNC
      -5- Program clkdm in HW_AUTO(if supported)
      
      This sequence applies to all older OMAPs' as well,
      however since they use autodeps, it makes sure that
      no clkdm is in IDLE, and hence not requiring a force
      SW_WKUP when a module is being enabled.
      
      OMAP4 does not need to support autodeps, because
      of the dyanamic dependency feature, wherein
      the HW takes care of waking up a clockdomain from
      idle and hence the module, whenever an interconnect
      access happens to the given module.
      
      Implementing the sequence for OMAP4 requires
      the clockdomain handling that is currently done in
      clock framework to be done as part of hwmod framework
      since the step -4- above to "Wait for the desired
      module idle status to be FUNC" is done as part of
      hwmod framework.
      
      Signed-off-by: default avatarRajendra Nayak <rnayak@ti.com>
      [b-cousson@ti.com: Adapt it to the new clkdm hwmod attribute and API]
      Signed-off-by: default avatarBenoit Cousson <b-cousson@ti.com>
      Cc: Paul Walmsley <paul@pwsan.com>
      [paul@pwsan.com: dropped mach-omap2/clock.c changes; modified to only
       call the clockdomain code if oh->clkdm is set; disable clock->clockdomain
       interaction on OMAP4]
      Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
      665d0013
    • Paul Walmsley's avatar
      OMAP2+: clock: allow per-SoC clock init code to prevent clockdomain calls from clock code · 12706c54
      Paul Walmsley authored
      
      
      The OMAP2/3 clock code was written to notify the clockdomain code when
      the first clock in a clockdomain is enabled and when the last enabled
      clock in a clockdomain is disabled.  OMAP4 requires a different
      approach: the hwmod code needs to signal the clockdomain code when to
      force-enable and auto-idle a clockdomain during the IP block enable
      process.  The current conjecture is that once that hwmod sequence is
      implemented, it will no longer be necessary for the clock code to call
      into the clockdomain code for "optional clocks" on OMAP4.
      
      Add a static flag to the OMAP2+ clock code, clkdm_control, that by
      default preserves the OMAP2/3 behavior.  Also add a function,
      omap2_clk_disable_clkdm_control(), intended to be called from OMAP4
      and beyond clock initcalls, that disables the old behavior.
      
      Part of this patch was originally based on a patch by Rajendra Nayak
      <rnayak@ti.com>.
      
      Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
      Cc: Benoît Cousson <b-cousson@ti.com>
      Cc: Rajendra Nayak <rnayak@ti.com>
      
      
      12706c54
    • Rajendra Nayak's avatar
      OMAP2+: clockdomain: Add per clkdm lock to prevent concurrent state programming · 555e74ea
      Rajendra Nayak authored
      
      
      Since the clkdm state programming is now done from within the hwmod
      framework (which uses a per-hwmod lock) instead of the being done
      from the clock framework (which used a global lock), there is now a
      need to have per-clkdm locking to prevent races between different
      hwmods/modules belonging to the same clock domain concurrently
      programming the clkdm state.
      
      Signed-off-by: default avatarRajendra Nayak <rnayak@ti.com>
      Signed-off-by: default avatarBenoit Cousson <b-cousson@ti.com>
      Cc: Paul Walmsley <paul@pwsan.com>
      Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
      555e74ea
    • Rajendra Nayak's avatar
      OMAP2+: PM: idle clkdms only if already in idle · b86cfb52
      Rajendra Nayak authored
      
      
      The omap_set_pwrdm_state function forces clockdomains
      to idle, without checking the existing idle state
      programmed, instead based solely on the HW capability
      of the clockdomain to support idle.
      This is wrong and the clockdomains should be idled
      post a state_switch *only* if idle transitions on the
      clockdomain were already enabled.
      
      Signed-off-by: default avatarRajendra Nayak <rnayak@ti.com>
      Cc: Paul Walmsley <paul@pwsan.com>
      Acked-by: default avatarKevin Hilman <khilman@ti.com>
      Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
      b86cfb52
    • Paul Walmsley's avatar
      OMAP2+: clockdomain: add clkdm_in_hwsup() · 32a363c0
      Paul Walmsley authored
      
      
      Add a new function, clkdm_in_hwsup(), that returns true if a clockdomain
      is configured for hardware-supervised idle.  It does not actually read the
      hardware; rather, it checks an internal flag in the struct clockdomain, which
      is changed when the clockdomain is switched in and out of hardware-supervised
      idle.  This should be safe, since all changes to the idle mode should
      pass through the clockdomain code.
      
      Based on a set of patches by Rajendra Nayak <rnayak@ti.com> which do
      the same thing by checking the hardware bits.  This approach should be
      faster and more compact.
      
      Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
      Cc: Rajendra Nayak <rnayak@ti.com>
      Cc: Todd Poynor <toddpoynor@google.com>
      Cc: Benoît Cousson <b-cousson@ti.com>
      32a363c0
    • Benoit Cousson's avatar
      OMAP2+: clockdomain: Add 2 APIs to control clockdomain from hwmod framework · 113a7413
      Benoit Cousson authored
      
      
      Duplicate the existing API for clockdomain enable from clock to enable
      a clock domain from hwmod framework.
      This will be needed when the hwmod framework will move from the current
      clock centric approach to the module based approach.
      
      These APIs are returning 0 for the moment for OMAP2 and OMAP3 until
      their hwmods are updated with the clksm attribute.
      
      Signed-off-by: default avatarBenoit Cousson <b-cousson@ti.com>
      Cc: Kevin Hilman <khilman@ti.com>
      Cc: Paul Walmsley <paul@pwsan.com>
      Cc: Rajendra Nayak <rnayak@ti.com>
      Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
      113a7413
    • Vaibhav Bedia's avatar
      OMAP: clockdomain: Remove redundant call to pwrdm_wait_transition() · a5122ff8
      Vaibhav Bedia authored
      
      
      The call to pwrdm_wait_transition() in clkdm_clk_enable()
      is redundant since the function pwrdm_clkdm_state_switch()
      which is called next also does the same thing.
      
      Signed-off-by: default avatarVaibhav Bedia <vaibhav.bedia@ti.com>
      Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
      a5122ff8
    • Benoit Cousson's avatar
      OMAP4: hwmod: Introduce the module control in hwmod control · 45c38252
      Benoit Cousson authored
      
      
      Take advantage of the explicit modulemode control to fix
      the way parents clocks are managed.
      A module must be disabled before any parents are disabled.
      That programming model was not possible with the previous
      implementation that was considering a modulemode as a leaf
      clock node managed by the clock fmwk.
      This was leading to bad crash upon disable when the parent
      clock was gated before the module completed its transition
      to idle.
      
      Signed-off-by: default avatarBenoit Cousson <b-cousson@ti.com>
      Cc: Paul Walmsley <paul@pwsan.com>
      Cc: Rajendra Nayak <rnayak@ti.com>
      Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
      45c38252
    • Benoit Cousson's avatar
      OMAP4: cm: Add two new APIs for modulemode control · 288d6a16
      Benoit Cousson authored
      
      
      In OMAP4, a new programming model based on module control instead
      of clock control was introduced.
      Expose two APIs to allow the upper layer (omap_hwmod) to control
      the module mode independently of the parent clocks management.
      
      Signed-off-by: default avatarBenoit Cousson <b-cousson@ti.com>
      Cc: Paul Walmsley <paul@pwsan.com>
      Cc: Rajendra Nayak <rnayak@ti.com>
      [paul@pwsan.com: renamed 'omap4_cm_' fns to 'omap4_cminst_'; cleaned up
       kerneldoc]
      Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
      288d6a16
    • Benoit Cousson's avatar
      OMAP4: hwmod data: Add modulemode entry in omap_hwmod structure · 03fdefe5
      Benoit Cousson authored
      
      
      Add a new field to provide the mode supported by the module.
      The mode will control the way mandatory clocks are managed by the PRCM.
      
        0 : Module is temporarily disabled by SW. OCP access to module are stalled.
            Can be used to change timing parameter of GPMC module.
        1 : Module is managed automatically by HW according to clock domain
            transition. A clock domain sleep transition put module into idle.
            A wakeup domain transition put it back into function.
            If CLKTRCTRL=3, any OCP access to module is always granted.
            Module clocks may be gated according to the clock domain state.
        2 : Module is explicitly enabled. Interface clock (if not used for
            functions) may be gated according to the clock domain state.
            Functional clocks are guarantied to stay present. As long as
            in this configuration, power domain sleep transition cannot happen.
      
      Some modules will have a modulemode initialized at 1 (HWCTRL) by default.
      This is the case for interconnect and simple module like GPIO, WDT, MAILBOX.
      
      Signed-off-by: default avatarBenoit Cousson <b-cousson@ti.com>
      Cc: Paul Walmsley <paul@pwsan.com>
      Cc: Rajendra Nayak <rnayak@ti.com>
      Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
      03fdefe5
    • Benoit Cousson's avatar
      OMAP4: hwmod data: Add PRM context register offset · 27bb00b5
      Benoit Cousson authored
      
      
      Add a 'context_offs' entry in the prcm.omap4 structure to all
      IPs when applicable.
      The offset will be used to retrieve the per module context lost
      information now available on OMAP4.
      
      Signed-off-by: default avatarBenoit Cousson <b-cousson@ti.com>
      Cc: Paul Walmsley <paul@pwsan.com>
      Cc: Rajendra Nayak <rnayak@ti.com>
      Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
      27bb00b5
    • Benoit Cousson's avatar
      OMAP4: prm: Remove deprecated functions · ad53ebb7
      Benoit Cousson authored
      
      
      The new prminst_xxx accessors based on partition and offset
      is now used, so removed all the previous prcm_xxx accessors.
      
      Signed-off-by: default avatarBenoit Cousson <b-cousson@ti.com>
      Cc: Paul Walmsley <paul@pwsan.com>
      Cc: Rajendra Nayak <rnayak@ti.com>
      [paul@pwsan.com: remove fn prototypes also]
      Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
      ad53ebb7
    • Benoit Cousson's avatar
      OMAP4: prm: Replace warm reset API with the offset based version · e54433f1
      Benoit Cousson authored
      
      
      The warm reset function was still using the obsolete API.
      Replace it by the new one and move the file to the proper c file.
      
      Change the function names to stick to the file convention as
      suggested by Paul Walmsley <paul@pwsan.com>:
      prm_xxx -> prminst_xxx
      
      Signed-off-by: default avatarBenoit Cousson <b-cousson@ti.com>
      Cc: Paul Walmsley <paul@pwsan.com>
      Cc: Rajendra Nayak <rnayak@ti.com>
      Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
      e54433f1
    • Benoit Cousson's avatar
      OMAP4: hwmod: Replace RSTCTRL absolute address with offset macros · eaac329d
      Benoit Cousson authored
      
      
      The RSTCTRL register was accessed using an absolute address.
      The usage of hardcoded macros to calculate virtual address from physical
      one should be avoided as much as possible.
      The usage of an offset will allow future improvement like migration from
      the current architecture code toward a module driver.
      
      Update prm_xxx accessors, move definition to the proper header file and
      update copyrights.
      Change the s16 register offset parameter to u16.
      
      Signed-off-by: default avatarBenoit Cousson <b-cousson@ti.com>
      Cc: Paul Walmsley <paul@pwsan.com>
      Cc: Rajendra Nayak <rnayak@ti.com>
      [paul@pwsan.com: use '_prminst_' in function names that are part of the
       prminst44xx.c file]
      Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
      eaac329d
    • Benoit Cousson's avatar
      OMAP: hwmod: Wait the idle status to be disabled · 11b10341
      Benoit Cousson authored
      
      
      It is mandatory to wait for a module to be in disabled state before
      potentially disabling source clock or re-asserting a reset.
      
      omap_hwmod_idle and omap_hwmod_shutdown does not wait for
      the module to be fully idle.
      
      Add a cm_xxx accessor to wait the clkctrl idle status to be disabled.
      Fix hwmod_[idle|shutdown] to use this API.
      
      Based on Rajendra's initial patch.
      
      Please note that most interconnects hwmod will return one timeout because
      it is impossible for them to be in idle since the processor is accessing
      the registers though the interconnect.
      
      Signed-off-by: default avatarBenoit Cousson <b-cousson@ti.com>
      Signed-off-by: default avatarRajendra Nayak <rnayak@ti.com>
      Cc: Paul Walmsley <paul@pwsan.com>
      Cc: Todd Poynor <toddpoynor@google.com>
      [paul@pwsan.com: move cpu_is_*() tests to the top of _wait_target_disable();
       incorporate some feedback from Todd]
      Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
      11b10341
Loading