04 Jan, 2013

1 commit

  • 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
    Cc: David Woodhouse
    Cc: Joerg Roedel
    Cc: Ohad Ben-Cohen
    Cc: Tony Lindgren
    Cc: Omar Ramirez Luna
    Cc: Mauro Carvalho Chehab
    Cc: Hiroshi Doyu
    Cc: Stephen Warren
    Cc: Bharat Nihalani
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

04 Dec, 2012

4 commits

  • 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: Omar Ramirez Luna
    Tested-by: Ohad Ben-Cohen
    Acked-by: Tony Lindgren
    Signed-off-by: Joerg Roedel

    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: Omar Ramirez Luna
    Tested-by: Ohad Ben-Cohen
    Signed-off-by: Joerg Roedel

    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: Omar Ramirez Luna
    Tested-by: Ohad Ben-Cohen
    Signed-off-by: Joerg Roedel

    Omar Ramirez Luna
     
  • For the interrupt to be generated, the mmu clock should be already
    enabled while translating a virtual address, so, this call to clock
    handling is just increasing/decreasing the counter.

    This works now, because its users need the same clock and they
    indirectly power the mmu, in this interrupt context the handling of
    clocks inside the ISR doesn't seem to be needed nor helping.

    Next patch should also correct the dependency on clients to handle
    iommu clocks.

    Signed-off-by: Omar Ramirez Luna
    Tested-by: Ohad Ben-Cohen
    Signed-off-by: Joerg Roedel

    Omar Ramirez Luna
     

21 Nov, 2012

5 commits

  • Move iommu/iovmm headers from plat/ to platform_data/ as part of the
    single zImage work.

    Partially based on an earlier version by Ido Yariv .

    Cc: Ido Yariv
    Cc: Laurent Pinchart
    Cc: Omar Ramirez Luna
    Acked-by: Mauro Carvalho Chehab
    Acked-by: Ohad Ben-Cohen
    Acked-by: Joerg Roedel
    Signed-off-by: Tony Lindgren

    Tony Lindgren
     
  • Move some of the definitions in omap-iommu.h that can be made local to
    either drivers/iommu.

    Cc: Laurent Pinchart
    Cc: Mauro Carvalho Chehab
    Cc: Omar Ramirez Luna
    Signed-off-by: Ido Yariv
    Acked-by: Ohad Ben-Cohen
    Acked-by: Joerg Roedel
    [tony@atomide.com: updated for header changes in the series]
    Signed-off-by: Tony Lindgren

    Ido Yariv
     
  • This file should not be in arch/arm. Move it to drivers/iommu
    to allow making most of the header local to drivers/iommu.

    This is needed as we are removing plat and mach includes
    from drivers for ARM common zImage support.

    Cc: Ido Yariv
    Cc: Laurent Pinchart
    Cc: Mauro Carvalho Chehab
    Cc: Omar Ramirez Luna
    Cc: linux-media@vger.kernel.org
    Acked-by: Ohad Ben-Cohen
    Acked-by: Joerg Roedel
    Signed-off-by: Tony Lindgren

    Tony Lindgren
     
  • Looks like the iommu framework does not have generic functions
    exported for all the needs yet. The hardware specific functions
    are defined in files like intel-iommu.h and amd-iommu.h. Follow
    the same standard for omap-iommu.h.

    This is needed because we are removing plat and mach includes
    for ARM common zImage support. Further work should continue
    in the iommu framework context as only pure platform data will
    be communicated from arch/arm/*omap*/* code to the iommu
    framework.

    Cc: Ido Yariv
    Cc: Laurent Pinchart
    Cc: Omar Ramirez Luna
    Cc: linux-media@vger.kernel.org
    Acked-by: Mauro Carvalho Chehab
    Acked-by: Ohad Ben-Cohen
    Acked-by: Joerg Roedel
    Signed-off-by: Tony Lindgren

    Tony Lindgren
     
  • The iopgtable header file is only used by the iommu & iovmm drivers, so
    move it to drivers/iommu/, as part of the single zImage effort.

    Cc: Laurent Pinchart
    Cc: Mauro Carvalho Chehab
    Cc: Omar Ramirez Luna
    Signed-off-by: Ido Yariv
    Acked-by: Ohad Ben-Cohen
    Acked-by: Joerg Roedel
    [tony@atomide.com: updated to be earlier in the series]
    Signed-off-by: Tony Lindgren

    Ido Yariv
     

11 Jul, 2012

1 commit


19 Apr, 2012

1 commit

  • 'domain_destroy with devices attached' case isn't yet handled, instead
    code assumes that the device was already detached.

    If the domain is destroyed the hardware still has access to invalid
    pointers to its page table and internal iommu object. In order to
    detach the users we need to track devices using the iommu, current
    use cases only have one user of iommu per instance. When required
    this can evolve to a list with the devices using the iommu_dev.

    Reported-by: Joerg Roedel
    Reviewed-by: Ohad Ben-Cohen
    Signed-off-by: Omar Ramirez Luna
    Signed-off-by: Joerg Roedel

    Omar Ramirez Luna
     

27 Feb, 2012

1 commit

  • omap3isp depends on omap's iommu and will fail to probe if
    initialized before it (which always happen if they are builtin).

    Make omap's iommu subsys_initcall as an interim solution until
    the probe deferral mechanism is merged.

    Reported-by: James
    Debugged-by: Laurent Pinchart
    Signed-off-by: Ohad Ben-Cohen
    Cc: stable
    Cc: Tony Lindgren
    Cc: Hiroshi Doyu
    Cc: Joerg Roedel
    Signed-off-by: Joerg Roedel

    Ohad Ben-Cohen
     

09 Jan, 2012

1 commit


06 Dec, 2011

1 commit


05 Dec, 2011

1 commit

  • Eliminate the public omap_find_iommu_device() method, and don't
    expect clients to provide the omap_iommu handle anymore.

    Instead, OMAP's iommu driver now utilizes dev_archdata's private iommu
    extension to be able to access the required iommu information.

    This way OMAP IOMMU users are now able to use the generic IOMMU API without
    having to call any omap-specific binding method.

    Update omap3isp appropriately.

    Signed-off-by: Ohad Ben-Cohen
    Acked-by: Laurent Pinchart
    Acked-by: Tony Lindgren
    Cc: Hiroshi Doyu

    Ohad Ben-Cohen
     

10 Nov, 2011

2 commits

  • Let the IOMMU core know we support 4KiB, 64KiB, 1MiB and 16MiB page sizes.

    This way the IOMMU core can split any arbitrary-sized physically
    contiguous regions (that it needs to map) as needed.

    Signed-off-by: Ohad Ben-Cohen
    Cc: Hiroshi DOYU
    Signed-off-by: Joerg Roedel

    Ohad Ben-Cohen
     
  • Express sizes in bytes rather than in page order, to eliminate the
    size->order->size conversions we have whenever the IOMMU API is calling
    the low level drivers' map/unmap methods.

    Adopt all existing drivers.

    Signed-off-by: Ohad Ben-Cohen
    Cc: David Brown
    Cc: David Woodhouse
    Cc: Joerg Roedel
    Cc: Stepan Moskovchenko
    Cc: KyongHo Cho
    Cc: Hiroshi DOYU
    Cc: Laurent Pinchart
    Signed-off-by: Joerg Roedel

    Ohad Ben-Cohen
     

21 Oct, 2011

2 commits


10 Oct, 2011

1 commit

  • The iommu module on omap contains a few functions that are
    only used by the debug module. These are however only there
    when the debug code is built as a module. Since it is possible
    to build the debug code into the kernel, the functions should
    also be provided for the built-in case.

    Signed-off-by: Arnd Bergmann
    Signed-off-by: Ohad Ben-Cohen
    Signed-off-by: Joerg Roedel

    Arnd Bergmann
     

14 Sep, 2011

1 commit

  • Start using the generic fault report mechanism, as provided by
    the IOMMU core, and remove its now-redundant omap_iommu_set_isr API.

    Currently we're only interested in letting upper layers know about the
    fault, so in case the faulting device is a remote processor, they could
    restart it.

    Dynamic PTE/TLB loading is not supported.

    Signed-off-by: Ohad Ben-Cohen
    Signed-off-by: Joerg Roedel

    Ohad Ben-Cohen
     

05 Sep, 2011

2 commits


26 Aug, 2011

6 commits

  • The omap_iommu_set_isr() was still using the mutex functions
    but the iommu_lock was converted to a spin_lock. Fix that
    up.

    Signed-off-by: Joerg Roedel

    Joerg Roedel
     
  • Prepend 'omap_' to OMAP's 'struct iommu' and exposed API, to prevent
    namespace pollution and generally to improve readability of the code
    that still uses the driver directly.

    Update the users as needed as well.

    Signed-off-by: Ohad Ben-Cohen
    Acked-by: Laurent Pinchart
    Acked-by: Hiroshi DOYU
    Acked-by: Tony Lindgren
    Signed-off-by: Joerg Roedel

    Ohad Ben-Cohen
     
  • Remove unused public APIs from OMAP's iommu driver.

    IOMMU functionality should be exposed only via the generic IOMMU API;
    this way drivers stay generic, and different IOMMU drivers
    don't need to duplicate similar functionalities.

    The rest of the API still exposed by OMAP's iommu will be evaluated
    and eventually either added to the generic IOMMU API (if relevant),
    or completely removed.

    The intention is that OMAP's iommu driver will eventually not expose
    any public API.

    Signed-off-by: Ohad Ben-Cohen
    Acked-by: Hiroshi DOYU
    Acked-by: Tony Lindgren
    Signed-off-by: Joerg Roedel

    Ohad Ben-Cohen
     
  • Use PREFETCH_IOTLB to control the content of the called function,
    instead of inlining it in the code.

    This improves readability of the code, and also prevents an "unused
    function" warning to show up when PREFETCH_IOTLB isn't set.

    Signed-off-by: Ohad Ben-Cohen
    Acked-by: Hiroshi DOYU
    Acked-by: Tony Lindgren
    Signed-off-by: Joerg Roedel

    Ohad Ben-Cohen
     
  • Stop exporting functions that are used only within the iommu
    driver itself.

    Eventually OMAP's iommu driver should only expose API via the generic
    IOMMU framework.

    Signed-off-by: Ohad Ben-Cohen
    Acked-by: Hiroshi DOYU
    Acked-by: Tony Lindgren
    Signed-off-by: Joerg Roedel

    Ohad Ben-Cohen
     
  • Move OMAP's iommu drivers to the dedicated iommu drivers folder.

    While OMAP's iovmm (virtual memory manager) driver does not strictly
    belong to the iommu drivers folder, move it there as well, because
    it's by no means OMAP-specific (in concept. technically it is still
    coupled with OMAP's iommu).

    Eventually, iovmm will be completely replaced with the generic,
    iommu-based, dma-mapping API.

    Signed-off-by: Ohad Ben-Cohen
    Acked-by: Laurent Pinchart
    Acked-by: Hiroshi DOYU
    Acked-by: Tony Lindgren
    Signed-off-by: Joerg Roedel

    Ohad Ben-Cohen