1. 05 11月, 2011 1 次提交
  2. 15 9月, 2011 1 次提交
    • P
      OMAP2+: hwmod: remove OMAP_CHIP* · d6504acd
      Paul Walmsley 提交于
      At Tony's request, remove the OMAP_CHIP* flags from the hwmod data, and
      replace it instead with chip family, variant, and ES level-specific lists
      of hwmods to register.
      
      Thanks to Gražvydas Ignotas <notasas@gmail.com> for finding a bug in the
      AM3517/3505 support, and for other review comments.
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      Cc: Gražvydas Ignotas <notasas@gmail.com>
      d6504acd
  3. 10 7月, 2011 17 次提交
    • R
      OMAP2+: hwmod: Follow the recommended PRCM module enable sequence · 665d0013
      Rajendra Nayak 提交于
      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: NRajendra Nayak <rnayak@ti.com>
      [b-cousson@ti.com: Adapt it to the new clkdm hwmod attribute and API]
      Signed-off-by: NBenoit 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: NPaul Walmsley <paul@pwsan.com>
      665d0013
    • B
      OMAP4: hwmod: Introduce the module control in hwmod control · 45c38252
      Benoit Cousson 提交于
      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: NBenoit Cousson <b-cousson@ti.com>
      Cc: Paul Walmsley <paul@pwsan.com>
      Cc: Rajendra Nayak <rnayak@ti.com>
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      45c38252
    • B
      OMAP4: hwmod: Replace RSTCTRL absolute address with offset macros · eaac329d
      Benoit Cousson 提交于
      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: NBenoit 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: NPaul Walmsley <paul@pwsan.com>
      eaac329d
    • B
      OMAP: hwmod: Wait the idle status to be disabled · 11b10341
      Benoit Cousson 提交于
      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: NBenoit Cousson <b-cousson@ti.com>
      Signed-off-by: NRajendra 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: NPaul Walmsley <paul@pwsan.com>
      11b10341
    • B
      OMAP4: hwmod: Replace CLKCTRL absolute address with offset macros · d0f0631d
      Benoit Cousson 提交于
      The CLKCTRL 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 a offset will allow future improvement like migration from
      the current architecture code toward a module driver.
      
      Update cm_xxx accessor, move definition to the proper header file and
      update copyrights.
      Signed-off-by: NBenoit Cousson <b-cousson@ti.com>
      Cc: Paul Walmsley <paul@pwsan.com>
      Cc: Rajendra Nayak <rnayak@ti.com>
      Cc: Todd Poynor <toddpoynor@google.com>
      [paul@pwsan.com: renamed 'omap4_cm_' fns to 'omap4_cminst_'; removed empty
       fn prototype section from cm44xx.h; incorporated comments from Todd;
       documented some functions]
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      d0f0631d
    • B
      OMAP2+: hwmod: Init clkdm field at boot time · 6ae76997
      Benoit Cousson 提交于
      At boot time, lookup the clkdm_name to get the clkdm
      structure pointer for further usage.
      Signed-off-by: NBenoit Cousson <b-cousson@ti.com>
      Cc: Paul Walmsley <paul@pwsan.com>
      Cc: Rajendra Nayak <rnayak@ti.com>
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      6ae76997
    • A
      OMAP: hwmod: fix the i2c-reset timeout during bootup · 6d3c55fd
      Avinash.H.M 提交于
      The sequence of _ocp_softreset doesn't work for i2c. The i2c module has a
      special sequence to reset the module. The sequence is
       - Disable the I2C.
       - Write to SOFTRESET bit.
       - Enable the I2C.
       - Poll on the RESETDONE bit.
      The sequence is implemented as a function and the i2c_class is updated with
      the correct 'reset' pointer.  omap_hwmod_softreset function is implemented
      which triggers the softreset by writing into sysconfig register. On following
      this sequence, i2c module resets properly and timeouts are not seen.
      
      Cc: Rajendra Nayak <rnayak@ti.com>
      Cc: Paul Walmsley <paul@pwsan.com>
      Cc: Benoit Cousson <b-cousson@ti.com>
      Cc: Kevin Hilman <khilman@ti.com>
      Signed-off-by: NAvinash.H.M <avinashhm@ti.com>
      [paul@pwsan.com: combined this patch with a patch to remove
       HWMOD_INIT_NO_RESET from the 44xx hwmod flags; change register
       offset conditional code to use the IP block revision; minor code
       cleanup]
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      6d3c55fd
    • P
      omap_hwmod: use a terminator record with omap_hwmod_dma_info arrays · bc614958
      Paul Walmsley 提交于
      Previously, struct omap_hwmod_dma_info arrays were unterminated; and
      users of these arrays used the ARRAY_SIZE() macro to determine the
      length of the array.  However, ARRAY_SIZE() only works when the array
      is in the same scope as the macro user.
      
      So far this hasn't been a problem.  However, to reduce duplicated
      data, a subsequent patch will move common data to a separate, shared
      file.  When this is done, ARRAY_SIZE() will no longer be usable.
      
      This patch removes ARRAY_SIZE() usage for struct omap_hwmod_dma_info
      arrays and uses a sentinel value (irq == -1) as the array terminator
      instead.
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      bc614958
    • P
      omap_hwmod: use a terminator record with omap_hwmod_mpu_irqs arrays · 212738a4
      Paul Walmsley 提交于
      Previously, struct omap_hwmod_mpu_irqs arrays were unterminated; and
      users of these arrays used the ARRAY_SIZE() macro to determine the
      length of the array.  However, ARRAY_SIZE() only works when the array
      is in the same scope as the macro user.
      
      So far this hasn't been a problem.  However, to reduce duplicated
      data, a subsequent patch will move common data to a separate, shared
      file.  When this is done, ARRAY_SIZE() will no longer be usable.
      
      This patch removes ARRAY_SIZE() usage for struct omap_hwmod_mpu_irqs
      arrays and uses a sentinel value (irq == -1) as the array terminator
      instead.
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      212738a4
    • P
      omap_hwmod: use a null structure record to terminate omap_hwmod_addr_space arrays · 78183f3f
      Paul Walmsley 提交于
      Previously, struct omap_hwmod_addr_space arrays were unterminated; and
      users of these arrays used the ARRAY_SIZE() macro to determine the
      length of the array.  However, ARRAY_SIZE() only works when the array
      is in the same scope as the macro user.
      
      So far this hasn't been a problem.  However, to reduce duplicated
      data, a subsequent patch will move common data to a separate, shared
      file.  When this is done, ARRAY_SIZE() will no longer be usable.
      
      This patch removes ARRAY_SIZE() usage for struct omap_hwmod_addr_space
      arrays and uses a null structure member as the array terminator
      instead.
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      
      
      
      
      78183f3f
    • B
      OMAP: hwmod: Move pr_debug to improve the readability · 34617e2a
      Benoit Cousson 提交于
      Move the pr_debug at the top of the function
      to trace the entry even if the first test is failing.
      That help understanding that we entered the function
      but failed in it.
      
      Move the _enable last part out of the test to reduce
      indentation and improve readability.
      Signed-off-by: NBenoit Cousson <b-cousson@ti.com>
      Cc: Paul Walmsley <paul@pwsan.com>
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      34617e2a
    • B
      OMAP: hwmod: Add warnings if enable failed · 6652271a
      Benoit Cousson 提交于
      Change the debug into warning to check what IPs are failing.
      Signed-off-by: NBenoit Cousson <b-cousson@ti.com>
      Cc: Rajendra Nayak <rnayak@ti.com>
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      6652271a
    • B
      OMAP2+: hwmod: Fix the HW reset management · 31f62866
      Benoit Cousson 提交于
      The HW reset must be de-assert after the clocks are enabled
      but before waiting for the target to be ready. Otherwise the
      reset might not work properly since the clock is not running
      to proceed the reset.
      
      De-assert the reset after _enable_clocks and before
      _wait_target_ready.
      Re-assert it only when the clocks are disabled.
      Signed-off-by: NBenoit Cousson <b-cousson@ti.com>
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      31f62866
    • B
      OMAP2+: hwmod: Remove _populate_mpu_rt_base warning · d24bcaa3
      Benoit Cousson 提交于
      It is perfectly valid for some hwmod to not have any
      register target address for sysconfig. This is especially
      true for interconnect hwmods.
      Remove the warning.
      Signed-off-by: NBenoit Cousson <b-cousson@ti.com>
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      d24bcaa3
    • B
      OMAP2+: hwmod: Do not write the enawakeup bit if SYSC_HAS_ENAWAKEUP is not set · 1fe74113
      Benoit Cousson 提交于
      The Type 2 type of IPs will not have any enawakeup bit in their sysconfig.
      Writing to that bit will instead trigger a softreset.
      Check the flag to write this bit only if the module supports it.
      Reported-by: NMiguel Vadillo <vadillo@ti.com>
      Signed-off-by: NBenoit Cousson <b-cousson@ti.com>
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      1fe74113
    • M
      OMAP2+: hwmod: Enable module in shutdown to access sysconfig · 6481c73c
      Miguel Vadillo 提交于
      When calling the shutdown, the module may be already in idle.
      Accessing the sysconfig register will then lead to a crash.
      In that case, re-enable the module in order to allow the access
      to the sysconfig register.
      Signed-off-by: NMiguel Vadillo <vadillo@ti.com>
      Signed-off-by: NBenoit Cousson <b-cousson@ti.com>
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      6481c73c
    • B
      OMAP2+: hwmod: Fix smart-standby + wakeup support · 724019b0
      Benoit Cousson 提交于
      The commit 86009eb3 was adding
      the wakeup support for new OMAP4 IPs. This support is incomplete for
      busmaster IPs that need as well to use smart-standby with wakeup.
      
      This new standbymode is suported on HSI and USB_HOST_FS for the moment.
      
      Add the new MSTANDBY_SMART_WKUP flag to mark the IPs that support this
      capability.
      
      Enable this new mode when applicable in _enable_wakeup, _disable_wakeup,
      _enable_sysc and _idle_sysc.
      
      The omap_hwmod_44xx_data.c will have to be updated to add this new flag.
      Signed-off-by: NBenoit Cousson <b-cousson@ti.com>
      Signed-off-by: NDjamil Elaidi <d-elaidi@ti.com>
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      724019b0
  4. 01 6月, 2011 1 次提交
  5. 12 3月, 2011 1 次提交
  6. 10 3月, 2011 6 次提交
  7. 01 3月, 2011 5 次提交
    • P
      OMAP2+: hwmod: add ability to setup individual hwmods · a2debdbd
      Paul Walmsley 提交于
      Add omap_hwmod_setup_one(), which is intended for use early in boot to
      selectively setup the hwmods needed for system clocksources and
      clockevents, and any other hwmod that is needed in early boot.
      omap_hwmod_setup_all() can then be called later in the boot process.
      The point is to minimize the amount of code that needs to be run
      early.
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      Cc: Benoît Cousson <b-cousson@ti.com>
      Cc: Kevin Hilman <khilman@ti.com>
      Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
      Cc: Tony Lindgren <tony@atomide.com>
      a2debdbd
    • P
      OMAP2+: hwmod: ignore attempts to re-setup a hwmod · 48d54f3f
      Paul Walmsley 提交于
      Previously, if a hwmod had already been set up, and the code attempted
      to set up the hwmod again, an error would be returned.  This is not
      really useful behavior if we wish to allow the OMAP core code to setup
      the hwmods needed for the Linux clocksources and clockevents before
      the rest of the hwmods are setup.  So, instead of generating errors,
      just ignore the attempt to re-setup the hwmod.
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      Cc: Benoît Cousson <b-cousson@ti.com>
      Cc: Kevin Hilman <khilman@ti.com>
      48d54f3f
    • P
      OMAP2+: hwmod: find MPU initiator hwmod during in _register() · 569edd70
      Paul Walmsley 提交于
      Move the code that looks for the MPU initiator hwmod to run during
      the individual hwmod _register() function.  (Previously, it ran after
      all hwmods were registered in the omap_hwmod_late_init() function.)
      
      This is done so code can late-initialize a few individual hwmods --
      for example, for the system timer -- before the entire set of hwmods is
      initialized later in boot via omap_hwmod_late_init().
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      Cc: Benoît Cousson <b-cousson@ti.com>
      Cc: Kevin Hilman <khilman@ti.com>
      569edd70
    • P
      OMAP2+: hwmod: rename some init functions · 550c8092
      Paul Walmsley 提交于
      Rename omap_hwmod_init() to omap_hwmod_register().  Rename
      omap_hwmod_late_init() to omap_hwmod_setup_all().  Also change all of
      the callers to reflect the new names.  While here, update some
      copyrights.
      
      Suggested by Tony Lindgren <tony@atomide.com>.
      
      N.B. The comment in mach-omap2/serial.c may no longer be correct, given
           recent changes in init order.
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      Cc: Benoît Cousson <b-cousson@ti.com>
      Cc: Kevin Hilman <khilman@ti.com>
      Cc: Tony Lindgren <tony@atomide.com>
      550c8092
    • P
      OMAP2+: hwmod: allow multiple calls to omap_hwmod_init() · bac1a0f0
      Paul Walmsley 提交于
      There's no longer any reason why we should prevent multiple
      calls to omap_hwmod_init().  It is now simply used to register an
      array of hwmods.
      
      This should allow a subset of hwmods (e.g., hwmods
      handling the system clocksource and clockevents) to be registered
      earlier than the remaining mass of hwmods.
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      Cc: Benoît Cousson <b-cousson@ti.com>
      Cc: Kevin Hilman <khilman@ti.com>
      bac1a0f0
  8. 25 2月, 2011 1 次提交
  9. 15 2月, 2011 2 次提交
  10. 23 12月, 2010 1 次提交
  11. 22 12月, 2010 4 次提交
    • K
      OMAP: PM: implement context loss count APIs · c80705aa
      Kevin Hilman 提交于
      Implement OMAP PM layer omap_pm_get_dev_context_loss_count() API by
      creating similar APIs at the omap_device and omap_hwmod levels.  The
      omap_hwmod level call is the layer with access to the powerdomain
      core, so it is the place where the powerdomain is queried to get the
      context loss count.
      
      The new APIs return an unsigned value that can wrap as the
      context-loss count grows.  However, the wrapping is not important as
      the role of this function is to determine context loss by checking for
      any difference in subsequent calls to this function.
      
      Note that these APIs at each level can return zero when no context
      loss is detected, or on errors.  This is to avoid returning error
      codes which could potentially be mistaken for large context loss
      counters.
      
      NOTE: only works for devices which have been converted to use
            omap_device/omap_hwmod.
      
      Longer term, we could possibly remove this API from the OMAP PM layer,
      and instead directly use the omap_device level API.
      Signed-off-by: NKevin Hilman <khilman@deeprootsystems.com>
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      c80705aa
    • B
      OMAP2+: hwmod: Add wakeup support for new OMAP4 IPs · 86009eb3
      Benoit Cousson 提交于
      The new OMAP4 IPs introduced a new idle mode named smart-idle with wakeup.
      
      This new idlemode replaces the enawakeup for the new IPs but seems to
      coexist as well for some legacy IPs (UART, GPIO, MCSPI...)
      
      Add the new SIDLE_SMART_WKUP flag to mark the IPs that support this
      capability.
      The omap_hwmod_44xx_data.c will have to be updated to add this new flag.
      
      Enable this new mode when applicable in _enable_wakeup, _enable_sysc and
      _idle_sysc.
      Signed-off-by: NBenoit Cousson <b-cousson@ti.com>
      Tested-by: NSebastien Guiriec <s-guiriec@ti.com>
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      Cc: Kevin Hilman <khilman@deeprootsystems.com>
      Cc: Rajendra Nayak <rnayak@ti.com>
      86009eb3
    • R
      OMAP2+: hwmod: Disable clocks when hwmod enable fails · f2dd7e09
      Rajendra Nayak 提交于
      In cases where a module (hwmod) does not become accesible on enabling
      the main clocks (can happen if there are external clocks needed
      for the module to become accesible), make sure the clocks are not
      left enabled.
      This ensures that when the requisite external dependencies are met
      a omap_hwmod_enable and omap_hwmod_idle/shutdown would rightly enable
      and disable clocks using clk framework. Leaving the clocks enabled in
      the error case causes additional usecounting at the clock framework
      level leaving the clock enabled forever.
      Signed-off-by: NRajendra Nayak <rnayak@ti.com>
      Signed-off-by: NBenoit Cousson <b-cousson@ti.com>
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      Cc: Kevin Hilman <khilman@deeprootsystems.com>
      f2dd7e09
    • B
      OMAP2+: hwmod: Remove omap_hwmod_mutex · ce35b244
      Benoit Cousson 提交于
      The hwmod list will be built are init time and never
      be modified at runtime. There is no need anymore to protect
      the list from concurrent accesses using a mutex.
      Signed-off-by: NBenoit Cousson <b-cousson@ti.com>
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      Cc: Kevin Hilman <khilman@deeprootsystems.com>
      ce35b244