1. 26 Apr, 2016 8 commits
  2. 23 Oct, 2015 1 commit
    • Dave Gerlach's avatar
      mailbox/omap: Add ti,mbox-send-noirq quirk to fix AM33xx CPU Idle · 8e3c5952
      Dave Gerlach authored
      The mailbox framework controls the transmission queue and requires
      either its controller implementations or clients to run the state
      machine for the Tx queue. The OMAP mailbox controller uses a Tx-ready
      interrupt as the equivalent of a Tx-done interrupt to run this Tx
      queue state-machine.
      
      The WkupM3 processor on AM33xx and AM43xx SoCs is used to offload
      certain PM tasks, like doing the necessary operations for Device
      PM suspend/resume or for entering lower c-states during cpuidle.
      
      The CPUIdle on AM33xx requires the messages to be sent without
      having to trigger the Tx-ready interrupts, as the interrupt
      would immediately terminate the CPUIdle operation. Support for
      this has been added by introducing a DT quirk, "ti,mbox-send-noirq"
      and using it to modify the normal OMAP mailbox controller behavior
      on the sub-mailboxes used to communicate with the WkupM3 remote
      processor. This also requires the wkup_m3_ipc driver to adjust
      its mailbox usage logic to run the Tx state machine.
      
      NOTE:
      - AM43xx does not communicate with WkupM3 for CPU Idle, so is
        not affected by this behavior. But, it uses the same IPC driver
        for PM suspend/resume functionality, so requires the quirk as
        well, because of changes to the common wkup_m3_ipc driver.
      Signed-off-by: default avatarDave Gerlach <d-gerlach@ti.com>
      [s-anna@ti.com: revise logic and update comments/patch description]
      Signed-off-by: default avatarSuman Anna <s-anna@ti.com>
      Signed-off-by: default avatarJassi Brar <jaswinder.singh@linaro.org>
      8e3c5952
  3. 12 May, 2015 2 commits
  4. 27 Nov, 2014 1 commit
    • Suman Anna's avatar
      mailbox/omap: adapt to the new mailbox framework · 8841a66a
      Suman Anna authored
      The OMAP mailbox driver and its existing clients (remoteproc
      for OMAP4+) are adapted to use the generic mailbox framework.
      
      The main changes for the adaptation are:
        - The tasklet used for Tx is replaced with the state machine from
          the generic mailbox framework. The workqueue used for processing
          the received messages stays intact for minimizing the effects on
          the OMAP mailbox clients.
        - The existing exported client API, omap_mbox_get, omap_mbox_put and
          omap_mbox_send_msg are deleted, as the framework provides equivalent
          functionality. A OMAP-specific omap_mbox_request_channel is added
          though to support non-DT way of requesting mailboxes.
        - The OMAP mailbox driver is integrated with the mailbox framework
          through the proper implementations of mbox_chan_ops, except for
          .last_tx_done and .peek_data. The OMAP mailbox driver does not need
          these ops, as it is completely interrupt driven.
        - The OMAP mailbox driver uses a custom of_xlate controller ops that
          allows phandles for the pargs specifier instead of indexing to avoid
          any channel registration order dependencies.
        - The new framework does not support multiple clients operating on a
          single channel, so the reference counting logic is simplified.
        - The remoteproc driver (current client) is adapted to use the new API.
          The notifier callbacks used within this client is replaced with the
          regular callbacks from the newer framework.
        - The exported OMAP mailbox API are limited to omap_mbox_save_ctx,
          omap_mbox_restore_ctx, omap_mbox_enable_irq & omap_mbox_disable_irq,
          with the signature modified to take in the new mbox_chan handle instead
          of the OMAP specific omap_mbox handle. The first 2 will be removed when
          the OMAP mailbox driver is adapted to runtime_pm. The other exported
          API omap_mbox_request_channel will be removed once existing legacy
          users are converted to DT.
      Signed-off-by: default avatarSuman Anna <s-anna@ti.com>
      Cc: Ohad Ben-Cohen <ohad@wizery.com>
      Signed-off-by: default avatarJassi Brar <jaswinder.singh@linaro.org>
      8841a66a
  5. 20 Oct, 2014 1 commit
  6. 11 Sep, 2014 1 commit
    • Suman Anna's avatar
      mailbox/omap: add support for parsing dt devices · 75288cc6
      Suman Anna authored
      Logic has been added to the OMAP2+ mailbox code to parse the
      mailbox dt nodes and construct the different sub-mailboxes
      associated with the instance. The DT representation of the
      sub-mailbox devices is different from legacy platform data
      representation to allow flexibility of interrupt configuration
      between Tx and Rx fifos (to also possibly allow simplex devices
      in the future). The DT representation gathers similar information
      that was being passed previously through the platform data, except
      for the interrupt type information, which is gathered through driver
      compatible match data.
      
      The non-DT support has to be maintained for now to not break
      OMAP3 legacy boot, and the legacy-style code will be cleaned
      up once OMAP3 is also converted to DT-boot only.
      
      Cc: Jassi Brar <jassisinghbrar@gmail.com>
      Cc: Rob Herring <robh+dt@kernel.org>
      Signed-off-by: default avatarSuman Anna <s-anna@ti.com>
      Acked-by: default avatarPavel Machek <pavel@ucw.cz>
      Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
      75288cc6
  7. 29 Jul, 2014 4 commits
    • Suman Anna's avatar
      mailbox/omap: add a parent structure for every IP instance · 72c1c817
      Suman Anna authored
      A new structure, omap_mbox_device, is added to contain
      the global variables pertinent to a mailbox h/w IP block.
      This enables the support for having multiple instances of
      the same h/w IP block in the SoC. This is in preparation
      to support the DRA7 SoC, which is the first SoC in the OMAP
      family to have multiple mailbox IP instances.
      
      The changes include enhancements to the sub-mailbox registration
      logic and mbox startup sequencing, removing the usage of single
      global configuration variables for all h/w instances, and storing
      the registered sub-mailboxes with the parent mailbox device
      structure.
      Signed-off-by: default avatarSuman Anna <s-anna@ti.com>
      Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
      72c1c817
    • Suman Anna's avatar
      mailbox/omap: remove the private mailbox structure · be3322eb
      Suman Anna authored
      The structure omap_mbox_priv is used previously to store arch
      specific (OMAP1 vs OMAP2+) data, and is no longer required to be
      maintained separately. Instead, absorb its elements into either
      the sub-mailbox device structure, omap_mbox, or the individual
      fifo descriptor structure, omap_mbox_fifo.
      
      The newmsg_bit and notfull_bit used on Rx and Tx fifos respectively
      are represented by the new intr_bit field in the fifo descriptor
      structure. The interrupt configuration registers are also moved
      into the fifo descriptor structure to allow the Rx and Tx fifos
      to use different interrupt lines/users.
      Signed-off-by: default avatarSuman Anna <s-anna@ti.com>
      Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
      be3322eb
    • Suman Anna's avatar
      mailbox/omap: consolidate OMAP mailbox driver · 5040f534
      Suman Anna authored
      There is no need for a separate common OMAP mailbox module
      now that the OMAP1 mailbox driver has been removed. So,
      consolidate the two individual OMAP mailbox modules into a
      single driver. This streamlines the driver for converting
      to mailbox framework.
      
      The following are the main changes:
      - collapse mailbox-omap2.c into omap-mailbox.c
      - remove omap_mbox_ops and replace the ops calls with
        the equivalent functionality.
      - simplify the sub-mailbox startup/shutdown functionality,
        the one-time operations are moved into probe, and the
        pm_runtime_get_sync and pm_runtime_put_sync can be invoked
        without using a configuration counter.
      - move all definitions from private omap_mbox.h into the
        source code, and eliminate this internal header.
      - rename some variables that used the omap2_mbox prefix with
        a generic omap_mbox prefix.
      Signed-off-by: default avatarSuman Anna <s-anna@ti.com>
      Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
      5040f534
    • Suman Anna's avatar
      mailbox/omap: remove omap_mbox_type_t from mailbox ops · fe714a46
      Suman Anna authored
      The type definition omap_mbox_type_t used for distinguishing
      OMAP1 from OMAP2+ mailboxes is no longer needed after the
      removal of OMAP1 mailbox driver, and has therefore been
      cleaned up. This cleanup also eliminates the need for the
      polling logic used for checking the transmit readiness.
      Signed-off-by: default avatarSuman Anna <s-anna@ti.com>
      Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
      fe714a46
  8. 11 Jun, 2013 2 commits
    • Suman Anna's avatar
      mailbox/omap: move the OMAP mailbox framework to drivers · c869c75c
      Suman Anna authored
      The mailbox hardware (in OMAP) uses a queued mailbox interrupt
      mechanism that provides a communication channel between processors
      through a set of registers and their associated interrupt signals
      by sending and receiving messages.
      
      The OMAP mailbox framework/driver code is moved to be under
      drivers/mailbox, in preparation for adapting to a common mailbox
      driver framework. This allows the build for OMAP mailbox to be
      enabled (it was disabled during the multi-platform support).
      
      As part of the migration from plat and mach code:
      - Kconfig symbols have been renamed to build OMAP1 or OMAP2+ drivers.
      - mailbox.h under plat-omap/plat/include has been split into a public
        and private header files. The public header has only the API related
        functions and types.
      - The module name mailbox.ko from plat-omap is changed to
        omap-mailbox.ko
      - The module name mailbox_mach.ko from mach-omapX is changed as
          mailbox_omap1.ko for OMAP1
          mailbox_omap2.ko for OMAP2+
      
      Cc: Tony Lindgren <tony@atomide.com>
      [gregkh@linuxfoundation.org: ack for staging part]
      Acked-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarOmar Ramirez Luna <omar.ramirez@copitl.com>
      Signed-off-by: default avatarSuman Anna <s-anna@ti.com>
      c869c75c
    • Suman Anna's avatar
      omap: mailbox: call request_irq after mbox queues are allocated · ecf305cf
      Suman Anna authored
      The OMAP mailbox startup code is enabling the interrupt before any
      of the associated mailbox queues are allocated. Move this code so
      that the interrupt configuration for a mailbox is together.
      Signed-off-by: default avatarFernando Guzman Lugo <lugo.fernando@gmail.com>
      Signed-off-by: default avatarSuman Anna <s-anna@ti.com>
      ecf305cf
  9. 20 Aug, 2012 1 commit
    • Tejun Heo's avatar
      workqueue: deprecate flush[_delayed]_work_sync() · 43829731
      Tejun Heo authored
      flush[_delayed]_work_sync() are now spurious.  Mark them deprecated
      and convert all users to flush[_delayed]_work().
      
      If you're cc'd and wondering what's going on: Now all workqueues are
      non-reentrant and the regular flushes guarantee that the work item is
      not pending or running on any CPU on return, so there's no reason to
      use the sync flushes at all and they're going away.
      
      This patch doesn't make any functional difference.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Cc: Ian Campbell <ian.campbell@citrix.com>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Mattia Dongili <malattia@linux.it>
      Cc: Kent Yoder <key@linux.vnet.ibm.com>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Jiri Kosina <jkosina@suse.cz>
      Cc: Karsten Keil <isdn@linux-pingi.de>
      Cc: Bryan Wu <bryan.wu@canonical.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Alasdair Kergon <agk@redhat.com>
      Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
      Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: linux-wireless@vger.kernel.org
      Cc: Anton Vorontsov <cbou@mail.ru>
      Cc: Sangbeom Kim <sbkim73@samsung.com>
      Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Eric Van Hensbergen <ericvh@gmail.com>
      Cc: Takashi Iwai <tiwai@suse.de>
      Cc: Steven Whitehouse <swhiteho@redhat.com>
      Cc: Petr Vandrovec <petr@vandrovec.name>
      Cc: Mark Fasheh <mfasheh@suse.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Avi Kivity <avi@redhat.com> 
      43829731
  10. 13 May, 2012 1 commit
    • Juan Gutierrez's avatar
      ARM: OMAP: enable mailbox irq per instance · 1d8a0e96
      Juan Gutierrez authored
      The machine-specific omap2_mbox_startup is called only once
      to initialize the whole mbox module, and as a result,
      enabling the mbox irq at that point only works for the very first
      mailbox instance opened.
      
      Instead, this patch makes sure enable_irq() is called every
      time a new mbox instance is opened. In addition, we're now
      enabling the mbox's irq only after its notifier_block is registered,
      to avoid possible race of receiving an interrupt without invoking
      the user's notifier callback.
      Signed-off-by: default avatarJuan Gutierrez <jgutierrez@ti.com>
      Signed-off-by: default avatarSuman Anna <s-anna@ti.com>
      [ohad@wizery.com: slightly reworded the commit log]
      Signed-off-by: default avatarOhad Ben-Cohen <ohad@wizery.com>
      1d8a0e96
  11. 06 Mar, 2012 1 commit
  12. 31 Oct, 2011 1 commit
  13. 14 Feb, 2011 1 commit
  14. 26 Jan, 2011 1 commit
    • Tejun Heo's avatar
      arm/omap: use system_wq in mailbox · c4873005
      Tejun Heo authored
      With cmwq, there's no reason to use a separate workqueue for mailbox.
      Use the system_wq instead.  mbox->rxq->work is sync flushed in
      omap_mbox_fini() to make sure it's not running on any cpu, which makes
      sure that no mbox work is running when omap_mbox_exit() is entered.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Acked-by: default avatarHari Kanigeri <hari.kanigeri@gmail.com>
      Cc: Tony Lindgren <tony@atomide.com>
      Cc: linux-omap@vger.kernel.org
      c4873005
  15. 02 Dec, 2010 4 commits
  16. 04 Aug, 2010 10 commits