1. 31 3月, 2015 1 次提交
  2. 25 2月, 2015 1 次提交
    • T
      iommu/omap: Play nice in multi-platform builds · f938aab2
      Thierry Reding 提交于
      The OMAP IOMMU driver unconditionally executes code and registers a
      struct iommu_ops with the platform bus irrespective of whether it runs
      on an OMAP SoC or not. This causes problems in multi-platform kernels
      where drivers for other SoCs will no longer be able to register their
      own struct iommu_ops or even try to use a struct iommu_ops for an IOMMU
      that obviously isn't there.
      
      The smallest fix I could think of is to check for the existence of any
      OMAP IOMMU devices in the device tree and skip initialization otherwise.
      
      This fixes a problem on Tegra20 where the DRM driver will try to use the
      obviously non-existent OMAP IOMMU.
      Reported-by: NNicolas Chauvet <kwizart@gmail.com>
      Cc: Tony Lindgren <tony@atomide.com>
      Cc: Suman Anna <s-anna@ti.com>
      Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      Acked-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      f938aab2
  3. 30 1月, 2015 1 次提交
  4. 04 11月, 2014 2 次提交
    • K
      iommu/omap: Use dev_get_platdata() · 99cb9aee
      Kiran Padwal 提交于
      Use the wrapper function for retrieving the platform data instead of
      accessing dev->platform_data directly.
      Signed-off-by: NKiran Padwal <kiran.padwal@smartplayin.com>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      99cb9aee
    • O
      iommu: Add iommu_map_sg() function · 315786eb
      Olav Haugan 提交于
      Mapping and unmapping are more often than not in the critical path.
      map_sg allows IOMMU driver implementations to optimize the process
      of mapping buffers into the IOMMU page tables.
      
      Instead of mapping a buffer one page at a time and requiring potentially
      expensive TLB operations for each page, this function allows the driver
      to map all pages in one go and defer TLB maintenance until after all
      pages have been mapped.
      
      Additionally, the mapping operation would be faster in general since
      clients does not have to keep calling map API over and over again for
      each physically contiguous chunk of memory that needs to be mapped to a
      virtually contiguous region.
      Signed-off-by: NOlav Haugan <ohaugan@codeaurora.org>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      315786eb
  5. 23 10月, 2014 7 次提交
    • S
      iommu/omap: Reset the domain field upon detaching · f24d9ad3
      Suman Anna 提交于
      The .domain field in omap_iommu struct is set properly when the
      OMAP IOMMU device is attached to, but is never reset properly
      on detach. Reset this properly so that the OMAP IOMMU debugfs
      logic can depend on this field before allowing the debugfs
      operations.
      Signed-off-by: NSuman Anna <s-anna@ti.com>
      Acked-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      f24d9ad3
    • S
      iommu/omap: Do not export unneeded functions · 4899a563
      Suman Anna 提交于
      The following functions were exported previously for usage by
      the OMAP IOMMU debug module:
      	omap_iommu_dump_ctx()
      	omap_dump_tlb_entries()
      	omap_iopgtable_store_entry()
      
      These functions need not be exported anymore as the OMAP IOMMU
      debugfs code is integrated with the OMAP IOMMU driver, and
      there won't be external users for these functions. So, remove
      the EXPORT_SYMBOL_GPL on these. The omap_iopgtable_store_entry()
      is also made internal only, after making the 'pagetable' debugfs
      entry read-only.
      Signed-off-by: NSuman Anna <s-anna@ti.com>
      Acked-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      4899a563
    • S
      iommu/omap: Remove couple of unused exported functions · c55caec1
      Suman Anna 提交于
      The exported functions omap_foreach_iommu_device() and
      omap_iotlb_cr_to_e() have been deleted, as they are no
      longer needed.
      
      The function omap_foreach_iommu_device() is not required
      after the consolidation of the OMAP IOMMU debug module,
      and the function omap_iotlb_cr_to_e() is not required
      after making the debugfs entry 'pagetable' read-only.
      Signed-off-by: NSuman Anna <s-anna@ti.com>
      Acked-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      c55caec1
    • S
      iommu/omap: Integrate omap-iommu-debug into omap-iommu · 61c75352
      Suman Anna 提交于
      The debugfs support for OMAP IOMMU is currently implemented
      as a module, warranting certain OMAP-specific IOMMU API to
      be exported. The OMAP IOMMU, when enabled, can only be built-in
      into the kernel, so integrate the OMAP IOMMU debug module
      into the OMAP IOMMU driver. This helps in eliminating the
      need to export most of the current OMAP IOMMU API.
      
      The following are the main changes:
      - The debugfs directory and entry creation logic is reversed,
        the calls are invoked by the OMAP IOMMU driver now.
      - The current iffy circular logic of adding IOMMU archdata
        to the IOMMU devices itself to get a pointer to the omap_iommu
        object in the debugfs support code is replaced by directly
        using the omap_iommu structure while creating the debugfs
        entries.
      - The debugfs root directory is renamed from the generic name
        "iommu" to a specific name "omap_iommu".
      - Unneeded headers have also been cleaned up while at this.
      - There will no longer be a omap-iommu-debug.ko module after
        this patch.
      - The OMAP_IOMMU_DEBUG Kconfig option is converted to boolean
        only, the OMAP IOMMU debugfs support is built alongside the
        OMAP IOMMU driver only when this option is enabled.
      Signed-off-by: NSuman Anna <s-anna@ti.com>
      Acked-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      61c75352
    • S
      iommu/omap: Consolidate OMAP IOMMU modules · bd4396f0
      Suman Anna 提交于
      The OMAP IOMMU driver was originally designed as modules, and split
      into a core module and a thin arch-specific module through the OMAP
      arch-specific struct iommu_functions, to scale for both OMAP1 and
      OMAP2+ IOMMU variants. The driver can only be built for OMAP2+
      platforms currently, and also can only be built-in after the
      adaptation to generic IOMMU API. The OMAP1 variant was never added
      and will most probably be never added (the code for the only potential
      user, its parent, DSP processor has already been cleaned up). So,
      consolidate the OMAP2 specific omap-iommu2 module into the core OMAP
      IOMMU driver - this eliminates the arch-specific ops structure and
      simplifies the driver into a single module that only implements the
      generic IOMMU API's iommu_ops.
      
      The following are the main changes:
      - omap-iommu2 module is completely eliminated, with the common
        definitions moved to the internal omap-iommu.h, and the ops
        implementations moved into omap-iommu.c
      - OMAP arch-specific struct iommu_functions is also eliminated,
        with the ops implementations directly absorbed into the calling
        functions
      - iotlb_alloc_cr() is no longer inlined and defined only when
        PREFETCH_IOTLB is defined
      - iotlb_dump_cr() is similarly defined only when CONFIG_OMAP_IOMMU_DEBUG
        is defined
      - Elimination of the OMAP IOMMU exported functions to register the
        arch ops, omap_install_iommu_arch() & omap_uninstall_iommu_arch()
      - Any stale comments about OMAP1 are also cleaned up
      Signed-off-by: NSuman Anna <s-anna@ti.com>
      Acked-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      bd4396f0
    • S
      iommu/omap: Remove omap_iommu_arch_version() and version field · 3acb04ca
      Suman Anna 提交于
      The function omap_iommu_arch_version() is not used anymore,
      and is not required either, so remove it. The .version field
      in struct iommu_functions that this function uses is also
      removed, as it is not really an ops to retrieve a version and
      there won't be any usage for this field either.
      Signed-off-by: NSuman Anna <s-anna@ti.com>
      Acked-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      3acb04ca
    • S
      iommu/omap: Remove refcount field from omap_iommu object · 2088ecba
      Suman Anna 提交于
      The refcount field in omap_iommu object is primarily used to check
      if an IOMMU device has already been enabled, but this is already
      implicit in the omap_iommu_attach_dev() which ensures that only
      a single device can attach to an IOMMU. This field is redundant,
      and so has been cleaned up.
      Signed-off-by: NSuman Anna <s-anna@ti.com>
      Acked-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      2088ecba
  6. 25 9月, 2014 2 次提交
  7. 05 9月, 2014 2 次提交
  8. 29 7月, 2014 1 次提交
  9. 07 7月, 2014 1 次提交
  10. 16 4月, 2014 6 次提交
  11. 06 3月, 2014 1 次提交
  12. 05 3月, 2014 6 次提交
  13. 12 9月, 2013 1 次提交
  14. 20 6月, 2013 2 次提交
  15. 03 4月, 2013 1 次提交
  16. 28 1月, 2013 1 次提交
  17. 04 1月, 2013 1 次提交
    • G
      Drivers: iommu: remove __dev* attributes. · d34d6517
      Greg Kroah-Hartman 提交于
      CONFIG_HOTPLUG is going away as an option.  As a result, the __dev*
      markings need to be removed.
      
      This change removes the use of __devinit, __devexit_p, __devinitdata,
      and __devexit from these drivers.
      
      Based on patches originally written by Bill Pemberton, but redone by me
      in order to handle some of the coding style issues better, by hand.
      
      Cc: Bill Pemberton <wfp5p@virginia.edu>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: Joerg Roedel <joro@8bytes.org>
      Cc: Ohad Ben-Cohen <ohad@wizery.com>
      Cc: Tony Lindgren <tony@atomide.com>
      Cc: Omar Ramirez Luna <omar.luna@linaro.org>
      Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
      Cc: Hiroshi Doyu <hdoyu@nvidia.com>
      Cc: Stephen Warren <swarren@wwwdotorg.org>
      Cc: Bharat Nihalani <bnihalani@nvidia.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d34d6517
  18. 04 12月, 2012 3 次提交
    • O
      iommu/omap: Adapt to runtime pm · ebf7cda0
      Omar Ramirez Luna 提交于
      Use runtime PM functionality interfaced with hwmod enable/idle
      functions, to replace direct clock operations and sysconfig
      handling.
      
      Due to reset sequence, pm_runtime_[get|put]_sync must be used, to
      avoid possible operations with the module under reset. Because of
      this and given that the driver uses spin_locks to protect their
      critical sections, we must use pm_runtime_irq_safe in order for the
      runtime ops to be happy, otherwise might_sleep_if checks in runtime
      framework will complain.
      
      The remaining pm_runtime out of iommu_enable and iommu_disable
      corresponds to paths that can be accessed through debugfs, some of
      them doesn't work if the module is not enabled first, but in future
      if the mmu is idled withouth freeing, these are needed to debug.
      Signed-off-by: NOmar Ramirez Luna <omar.luna@linaro.org>
      Tested-by: NOhad Ben-Cohen <ohad@wizery.com>
      Acked-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NJoerg Roedel <joro@8bytes.org>
      ebf7cda0
    • O
      iommu/omap: Migrate to hwmod framework · 72b15b6a
      Omar Ramirez Luna 提交于
      Use hwmod data and device attributes to build and register an
      omap device for iommu driver.
      
       - Update the naming convention in isp module.
       - Remove unneeded check for number of resources, as this is now
         handled by omap_device and prevents driver from loading.
       - Now unused, remove platform device and resource data, handling
         of sysconfig register for softreset purposes, use default
         latency structure.
       - Use hwmod API for reset handling.
      Signed-off-by: NOmar Ramirez Luna <omar.luna@linaro.org>
      Tested-by: NOhad Ben-Cohen <ohad@wizery.com>
      Signed-off-by: NJoerg Roedel <joro@8bytes.org>
      72b15b6a
    • O
      iommu/omap: Keep mmu enabled when requested · 87f8e573
      Omar Ramirez Luna 提交于
      The purpose of the mmu is to handle the memory accesses requested by
      its users. Typically, the mmu is bundled with the processing unit in
      a single IP block, which makes them to share the same clock to be
      functional.
      
      Currently, iommu code assumes that its user will be indirectly
      clocking it, but being a separate mmu driver, it should handle
      its own clocks, so as long as the mmu is requested it will be
      powered ON and once detached it will be powered OFF.
      
      The remaining clock handling out of iommu_enable and iommu_disable
      corresponds to paths that can be accessed through debugfs, some of
      them doesn't work if the module is not enabled first, but in future
      if the mmu is idled withouth freeing, these are needed to debug.
      Signed-off-by: NOmar Ramirez Luna <omar.luna@linaro.org>
      Tested-by: NOhad Ben-Cohen <ohad@wizery.com>
      Signed-off-by: NJoerg Roedel <joro@8bytes.org>
      87f8e573