1. 22 Dec, 2010 17 commits
    • Rajendra Nayak's avatar
      OMAP: powerdomain: Arch specific funcs for mem control · 9b7fc907
      Rajendra Nayak authored
      Define the following architecture specific funtions for omap2/3/4
      .pwrdm_set_mem_onst
      .pwrdm_set_mem_retst
      .pwrdm_read_mem_pwrst
      .pwrdm_read_prev_mem_pwrst
      .pwrdm_read_mem_retst
      .pwrdm_clear_all_prev_pwrst
      .pwrdm_enable_hdwr_sar
      .pwrdm_disable_hdwr_sar
      .pwrdm_wait_transition
      .pwrdm_set_lowpwrstchange
      
      Convert the platform-independent framework to call these functions.
      Signed-off-by: default avatarRajendra Nayak <rnayak@ti.com>
      [paul@pwsan.com: rearranged Makefile changes]
      Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
      Cc: Benoit Cousson <b-cousson@ti.com>
      Cc: Kevin Hilman <khilman@deeprootsystems.com>
      Reviewed-by: default avatarKevin Hilman <khilman@deeprootsystems.com>
      Tested-by: default avatarKevin Hilman <khilman@deeprootsystems.com>
      Tested-by: default avatarSantosh Shilimkar <santosh.shilimkar@ti.com>
      9b7fc907
    • Rajendra Nayak's avatar
      OMAP: powerdomain: Arch specific funcs for logic control · 12627578
      Rajendra Nayak authored
      Define the following architecture specific funtions for omap2/3/4
      .pwrdm_set_logic_retst
      .pwrdm_read_logic_pwrst
      .pwrdm_read_prev_logic_pwrst
      .pwrdm_read_logic_retst
      
      Convert the platform-independent framework to call these functions.
      Signed-off-by: default avatarRajendra Nayak <rnayak@ti.com>
      Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
      Cc: Benoit Cousson <b-cousson@ti.com>
      Cc: Kevin Hilman <khilman@deeprootsystems.com>
      Reviewed-by: default avatarKevin Hilman <khilman@deeprootsystems.com>
      Tested-by: default avatarKevin Hilman <khilman@deeprootsystems.com>
      Tested-by: default avatarSantosh Shilimkar <santosh.shilimkar@ti.com>
      Tested-by: default avatarRajendra Nayak <rnayak@ti.com>
      12627578
    • Rajendra Nayak's avatar
      OMAP: powerdomain: Arch specific funcs for state control · f327e07b
      Rajendra Nayak authored
      Define the following architecture specific funtions for omap2/3/4
      .pwrdm_set_next_pwrst
      .pwrdm_read_next_pwrst
      .pwrdm_read_pwrst
      .pwrdm_read_prev_pwrst
      
      Convert the platform-independent framework to call these functions.
      Signed-off-by: default avatarRajendra Nayak <rnayak@ti.com>
      [paul@pwsan.com: remove remaining static allocations in powerdomains.h file;
       remove path in file header comments, rearranged Makefile changes]
      Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
      Cc: Benoit Cousson <b-cousson@ti.com>
      Cc: Kevin Hilman <khilman@deeprootsystems.com>
      Reviewed-by: default avatarKevin Hilman <khilman@deeprootsystems.com>
      Tested-by: default avatarKevin Hilman <khilman@deeprootsystems.com>
      Tested-by: default avatarSantosh Shilimkar <santosh.shilimkar@ti.com>
      Tested-by: default avatarRajendra Nayak <rnayak@ti.com>
      f327e07b
    • Rajendra Nayak's avatar
      OMAP: powerdomain: Infrastructure to put arch specific code · 3b1e8b21
      Rajendra Nayak authored
      Put infrastructure in place, so arch specific func pointers
      can be hooked up to the platform-independent part of the
      framework.
      This is in preparation of splitting the powerdomain framework into
      platform-independent part (for all omaps) and platform-specific
      parts.
      Signed-off-by: default avatarRajendra Nayak <rnayak@ti.com>
      Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
      Cc: Benoit Cousson <b-cousson@ti.com>
      Cc: Kevin Hilman <khilman@deeprootsystems.com>
      Reviewed-by: default avatarKevin Hilman <khilman@deeprootsystems.com>
      Tested-by: default avatarKevin Hilman <khilman@deeprootsystems.com>
      Tested-by: default avatarSantosh Shilimkar <santosh.shilimkar@ti.com>
      Tested-by: default avatarRajendra Nayak <rnayak@ti.com>
      3b1e8b21
    • Rajendra Nayak's avatar
      OMAP: powerdomain: Move static allocations from powerdomains.h to a .c file · 74bea6b9
      Rajendra Nayak authored
      powerdomains.h header today has only static definitions.  Adding any
      function declarations into it and including it in multiple source file
      is expected to cause issues.  Hence move all the static definitions
      from powerdomains.h file into powerdomains_data.c file.
      
      Also, create a new powerdomain section of the mach-omap2/Makefile, and
      rearrange the prcm-common part of the Makefile, now that the
      powerdomain code is in its own Makefile section.
      Signed-off-by: default avatarRajendra Nayak <rnayak@ti.com>
      [paul@pwsan.com: rearrange Makefile changes, tweaked commit message]
      Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
      Reviewed-by: default avatarKevin Hilman <khilman@deeprootsystems.com>
      Tested-by: default avatarKevin Hilman <khilman@deeprootsystems.com>
      Tested-by: default avatarSantosh Shilimkar <santosh.shilimkar@ti.com>
      Tested-by: default avatarRajendra Nayak <rnayak@ti.com>
      74bea6b9
    • Paul Walmsley's avatar
      OMAP2+: wd_timer: disable on boot via hwmod postsetup mechanism · ff2516fb
      Paul Walmsley authored
      The OMAP watchdog timer IP blocks require a specific set of register
      writes to occur before they will be disabled[1], even if the device
      clocks appear to be disabled in the CM_*CLKEN registers.  In the MPU
      watchdog case, failure to execute this reset sequence will eventually
      cause the watchdog to reset the OMAP unexpectedly.
      
      Previously, the code to disable this watchdog was manually called from
      mach-omap2/devices.c during device initialization.  This causes the
      watchdog to be unconditionally disabled for a portion of kernel
      initialization.  This should be controllable by the board-*.c files,
      since some system integrators will want full watchdog coverage of
      kernel initialization.  Also, the watchdog disable code was not
      connected to the hwmod shutdown code.  This means that calling
      omap_hwmod_shutdown() will not, in fact, disable the watchdog, and the
      goal of omap_hwmod_shutdown() is to be able to shutdown any on-chip
      OMAP device.
      
      To resolve the latter problem, populate the pre_shutdown pointer in
      the watchdog timer hwmod classes with a function that executes the
      watchdog shutdown sequence.  This allows the hwmod code to fully
      disable the watchdog.
      
      Then, to allow some board files to support watchdog coverage
      throughout kernel initialization, add common code to mach-omap2/io.c
      to cause the MPU watchdog to be disabled on boot unless a board file
      specifically requests it to remain enabled.  Board files can do this
      by changing the watchdog timer hwmod's postsetup state between the
      omap2_init_common_infrastructure() and omap2_init_common_devices()
      function calls.
      
      1. OMAP34xx Multimedia Device Silicon Revision 3.1.x Rev. ZH
         [SWPU222H], Section 16.4.3.6, "Start/Stop Sequence for WDTs (Using
         WDTi.WSPR Register)"
      Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
      Cc: Benoît Cousson <b-cousson@ti.com>
      Cc: Kevin Hilman <khilman@deeprootsystems.com>
      Cc: Charulatha Varadarajan <charu@ti.com>
      ff2516fb
    • Paul Walmsley's avatar
      OMAP2+: wd_timer: separate watchdog disable code from the rest of mach-omap2/devices.c · 81fbc5ef
      Paul Walmsley authored
      Split the wd_timer disable code out into its own file,
      mach-omap2/wd_timer.c; it belongs in its own file rather than
      cluttering up devices.c.
      Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
      Cc: Charulatha Varadarajan <charu@ti.com>
      81fbc5ef
    • Rajendra Nayak's avatar
      OMAP2+: hwmod: Update the sysc_cache in case module context is lost · 233cbe5b
      Rajendra Nayak authored
      Do not skip the sysc programming in the hmwod framework based
      on the cached value alone, since at times the module might have lost
      context (due to the Powerdomain in which the module belongs
      transitions to either Open Switch RET or OFF).
      
      Identifying if a module has lost context requires atleast one
      register read, and since a register read has more latency than
      a write, it makes sense to do a blind write always.
      Signed-off-by: default avatarRajendra Nayak <rnayak@ti.com>
      Acked-by: default avatarKevin Hilman <khilman@deeprootsystems.com>
      Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
      Cc: Benoit Cousson <b-cousson@ti.com>
      Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
      233cbe5b
    • Paul Walmsley's avatar
      OMAP2+: hwmod: fix a warning, add some docs, remove unused fields · b56b7bc8
      Paul Walmsley authored
      Trivial cleanup and documentation changes on the hwmod code and data:
      
      - add some hwmod documentation to indicate flags that should be moved
        outside the static hwmod data in a future patch
      
      - remove some unused fields in the struct omap_hwmod_ocp_if and
        struct omap_hwmod structures
      Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
      Cc: Benoît Cousson <b-cousson@ti.com>
      b56b7bc8
    • Paul Walmsley's avatar
      OMAP2+: hwmod: upgrade per-hwmod mutex to a spinlock · dc6d1cda
      Paul Walmsley authored
      Change the per-hwmod mutex to a spinlock.  (The per-hwmod lock
      serializes most post-initialization hwmod operations such as enable,
      idle, and shutdown.)  Spinlocks are needed, because in some cases,
      hwmods must be enabled from timer interrupt disabled-context, such as
      an ISR.  The current use-case that is driving this is the OMAP GPIO
      block ISR: it can trigger interrupts even with its clocks disabled,
      but these clocks are needed for register accesses in the ISR to succeed.
      
      This patch also effectively reverts commit
      84824022 - this patch makes
      _omap_hwmod_enable() and _omap_hwmod_init() static, renames them back
      to _enable() and _idle(), and changes their callers to call the
      spinlocking versions.  Previously, since omap_hwmod_{enable,init}()
      attempted to take mutexes, these functions could not be called while
      the timer interrupt was disabled; but now that the functions use
      spinlocks and save and restore the IRQ state, it is appropriate to
      call them directly.
      
      Kevin Hilman <khilman@deeprootsystems.com> originally proposed this
      patch - thanks Kevin.
      Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
      Cc: Kevin Hilman <khilman@deeprootsystems.com>
      Cc: Benoît Cousson <b-cousson@ti.com>
      dc6d1cda
    • Paul Walmsley's avatar
      OMAP2+: hwmod: add support for per-class custom device reset functions · bd36179e
      Paul Walmsley authored
      The standard omap_hwmod.c _reset() code relies on an IP block's
      OCP_SYSCONFIG.SOFTRESET register bit to reset the IP block.  This
      works for most IP blocks on the chip, but unfortunately not all.  For
      example, initiator-only IP blocks often don't have any MPU-accessible
      OCP-header registers, and therefore the MPU can't write to any
      OCP_SYSCONFIG registers in that block.  Other IP blocks, such as the
      IVA and I2C, require a specialized reset sequence.
      
      Since we need to be able to reset these IP blocks as well, allow
      custom IP block reset functions to be passed into the hwmod code via a
      per-hwmod-class reset function pointer, struct omap_hwmod_class.reset.
      If .reset is non-null, then the hwmod _reset() code will call the custom
      function instead of the standard OCP SOFTRESET-based code.
      
      As part of this change, rename most of the existing _reset() function
      code to _ocp_softreset(), to indicate more clearly that it does not work
      for all cases.
      Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
      Cc: Benoît Cousson <b-cousson@ti.com>
      Cc: Paul Hunt <hunt@ti.com>
      Cc: Stanley Liu <stanley_liu@ti.com>
      bd36179e
    • Paul Walmsley's avatar
      OMAP2+: hwmod: add postsetup state · 2092e5cc
      Paul Walmsley authored
      Allow board files and OMAP core code to control the state that some or
      all of the hwmods end up in at the end of _setup() (called by
      omap_hwmod_late_init() ).  Reimplement the old skip_setup_idle code in
      terms of this new postsetup state code.
      
      There are two use-cases for this patch: the !CONFIG_PM_RUNTIME case,
      in which all IP blocks should stay enabled after _setup() finishes;
      and the MPU watchdog case, in which the watchdog IP block should enter
      idle if watchdog coverage of kernel initialization is desired, and
      should be disabled otherwise.
      Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
      Cc: Benoît Cousson <b-cousson@ti.com>
      Cc: Kevin Hilman <khilman@deeprootsystems.com>
      Cc: Charulatha Varadarajan <charu@ti.com>
      2092e5cc
    • Paul Walmsley's avatar
      OMAP2+: hwmod: allow custom pre-shutdown functions · e4dc8f50
      Paul Walmsley authored
      Some OMAP IP blocks, such as the watchdog timers, cannot be completely
      shut down via the standard hwmod shutdown mechanism.  This patch
      enables the hwmod data files to supply a pointer to a custom
      pre-shutdown function via the struct omap_hwmod_class.pre_shutdown
      function pointer.  If the struct omap_hwmod_class.pre_shutdown
      function pointer is non-null, the function will be executed before the
      existing hwmod shutdown code runs.
      Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
      Cc: Benoît Cousson <b-cousson@ti.com>
      e4dc8f50
    • Paul Walmsley's avatar
      OMAP2+: io: split omap2_init_common_hw() · 4805734b
      Paul Walmsley authored
      Split omap2_init_common_hw() into two functions.  The first,
      omap2_init_common_infrastructure(), initializes the hwmod code and
      data, the OMAP PM code, and the clock code and data.  The second,
      omap2_init_common_devices(), handles any other early device
      initialization that, for whatever reason, has not been or cannot be
      moved to initcalls or early platform devices.
      
      This patch is required for the hwmod postsetup patch, which allows
      board files to change the state that hwmods should be placed into at
      the conclusion of the hwmod _setup() function.  For example, for a
      board whose creators wish to ensure watchdog coverage across the
      entire kernel boot process, code to change the watchdog's postsetup
      state will be added in the board-*.c file between the
      omap2_init_common_infrastructure() and omap2_init_common_devices() function
      calls.
      Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
      Cc: Tony Lindgren <tony@atomide.com>
      4805734b
    • Tony Lindgren's avatar
      Merge branch 'pm-opp' of... · b9e7683b
      Tony Lindgren authored
      Merge branch 'pm-opp' of ssh://master.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap-pm into omap-for-linus
      b9e7683b
    • Tony Lindgren's avatar
      Merge branch 'pm-next' of... · bb3613aa
      Tony Lindgren authored
      Merge branch 'pm-next' of ssh://master.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap-pm into omap-for-linus
      bb3613aa
    • Tony Lindgren's avatar
      6971071c
  2. 21 Dec, 2010 23 commits