1. 04 11月, 2014 1 次提交
    • D
      iommu/rockchip: rk3288 iommu driver · c68a2921
      Daniel Kurtz 提交于
      The rk3288 has several iommus.  Each iommu belongs to a single master
      device.  There is one device (ISP) that has two slave iommus, but that
      case is not yet supported by this driver.
      
      At subsys init, the iommu driver registers itself as the iommu driver for
      the platform bus.  The master devices find their slave iommus using the
      "iommus" field in their devicetree description.  Since each slave iommu
      belongs to exactly one master, their is no additional data needed at probe
      to associate a slave with its master.
      
      An iommu device's power domain, clock and irq are all shared with its
      master device, and the master device must be careful to attach from the
      iommu only after powering and clocking it (and leave it powered and
      clocked before detaching).  Because their is no guarantee what the status
      of the iommu is at probe, and since the driver does not even know if the
      device is powered, we delay requesting its irq until the master device
      attaches, at which point we have a guarantee that the device is powered
      and clocked and we can reset it and disable its interrupt mask.
      
      An iommu_domain describes a virtual iova address space.  Each iommu_domain
      has a corresponding page table that lists the mappings from iova to
      physical address.
      
      For the rk3288 iommu, the page table has two levels:
       The Level 1 "directory_table" has 1024 4-byte dte entries.
       Each dte points to a level 2 "page_table".
       Each level 2 page_table has 1024 4-byte pte entries.
       Each pte points to a 4 KiB page of memory.
      
      An iommu_domain is created when a dma_iommu_mapping is created via
      arm_iommu_create_mapping.  Master devices can then attach themselves to
      this mapping (or attach the mapping to themselves?) by calling
      arm_iommu_attach_device().  This in turn instructs the iommu driver to
      write the page table's physical address into the slave iommu's "Directory
      Table Entry" (DTE) register.
      
      In fact multiple master devices, each with their own slave iommu device,
      can all attach to the same mapping.  The iommus for these devices will
      share the same iommu_domain and therefore point to the same page table.
      Thus, the iommu domain maintains a list of iommu devices which are
      attached.  This driver relies on the iommu core to ensure that all devices
      have detached before destroying a domain.
      
      v6: - add .add/remove_device() callbacks.
          - parse platform_device device tree nodes for "iommus" property
          - store platform device pointer as group iommudata
          - Check for existence of iommu group instead of relying on a
            dev_get_drvdata() to return NULL for a NULL device.
      
      v7: - fixup some strings.
          - In rk_iommu_disable_paging() # and % were reversed.
      Signed-off-by: NDaniel Kurtz <djkurtz@chromium.org>
      Signed-off-by: NSimon Xue <xxm@rock-chips.com>
      Reviewed-by: NGrant Grundler <grundler@chromium.org>
      Reviewed-by: NStéphane Marchesin <marcheu@chromium.org>
      Tested-by: NHeiko Stuebner <heiko@sntech.de>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      c68a2921
  2. 29 7月, 2014 1 次提交
  3. 04 7月, 2014 1 次提交
    • A
      iommu: Add sysfs support for IOMMUs · c61959ec
      Alex Williamson 提交于
      IOMMUs currently have no common representation to userspace, most
      seem to have no representation at all aside from a few printks
      on bootup.  There are however features of IOMMUs that are useful
      to know about.  For instance the IOMMU might support superpages,
      making use of processor large/huge pages more important in a device
      assignment scenario.  It's also useful to create cross links between
      devices and IOMMU hardware units, so that users might be able to
      load balance their devices to avoid thrashing a single hardware unit.
      
      This patch adds a device create and destroy interface as well as
      device linking, making it very lightweight for an IOMMU driver to add
      basic support.  IOMMU drivers can provide additional attributes
      automatically by using an attribute_group.
      
      The attributes exposed are expected to be relatively device specific,
      the means to retrieve them certainly are, so there are currently no
      common attributes for the new class created here.
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      c61959ec
  4. 26 5月, 2014 1 次提交
  5. 24 9月, 2013 1 次提交
    • S
      iommu: Add event tracing feature to iommu · 7f6db171
      Shuah Khan 提交于
      Add tracing feature to iommu to report various iommu events. Classes
      iommu_group, iommu_device, and iommu_map_unmap are defined.
      
      iommu_group class events can be enabled to trigger when devices get added
      to and removed from an iommu group. Trace information includes iommu group
      id and device name.
      
      iommu:add_device_to_group
      iommu:remove_device_from_group
      
      iommu_device class events can be enabled to trigger when devices are attached
      to and detached from a domain. Trace information includes device name.
      
      iommu:attach_device_to_domain
      iommu:detach_device_from_domain
      
      iommu_map_unmap class events can be enabled to trigger when iommu map and
      unmap iommu ops. Trace information includes iova, physical address (map event
      only), and size.
      
      iommu:map
      iommu:unmap
      Signed-off-by: NShuah Khan <shuah.kh@samsung.com>
      Signed-off-by: NJoerg Roedel <joro@8bytes.org>
      7f6db171
  6. 14 8月, 2013 1 次提交
    • V
      iommu/fsl: Freescale PAMU driver and iommu implementation. · 695093e3
      Varun Sethi 提交于
      Following is a brief description of the PAMU hardware:
      PAMU determines what action to take and whether to authorize the action on
      the basis of the memory address, a Logical IO Device Number (LIODN), and
      PAACT table (logically) indexed by LIODN and address. Hardware devices which
      need to access memory must provide an LIODN in addition to the memory address.
      
      Peripheral Access Authorization and Control Tables (PAACTs) are the primary
      data structures used by PAMU. A PAACT is a table of peripheral access
      authorization and control entries (PAACE).Each PAACE defines the range of
      I/O bus address space that is accessible by the LIOD and the associated access
      capabilities.
      
      There are two types of PAACTs: primary PAACT (PPAACT) and secondary PAACT
      (SPAACT).A given physical I/O device may be able to act as one or more
      independent logical I/O devices (LIODs). Each such logical I/O device is
      assigned an identifier called logical I/O device number (LIODN). A LIODN is
      allocated a contiguous portion of the I/O bus address space called the DSA window
      for performing DSA operations. The DSA window may optionally be divided into
      multiple sub-windows, each of which may be used to map to a region in system
      storage space. The first sub-window is referred to as the primary sub-window
      and the remaining are called secondary sub-windows.
      
      This patch provides the PAMU driver (fsl_pamu.c) and the corresponding IOMMU
      API implementation (fsl_pamu_domain.c). The PAMU hardware driver (fsl_pamu.c)
      has been derived from the work done by Ashish Kalra and Timur Tabi.
      
      [For iommu group support]
      Acked-by: NAlex Williamson <alex.williamson@redhat.com>
      Signed-off-by: NTimur Tabi <timur@tabi.org>
      Signed-off-by: NVarun Sethi <Varun.Sethi@freescale.com>
      Signed-off-by: NJoerg Roedel <joro@8bytes.org>
      695093e3
  7. 26 6月, 2013 1 次提交
  8. 06 2月, 2013 1 次提交
    • H
      iommu/shmobile: Add iommu driver for Renesas IPMMU modules · c2c460f7
      Hideki EIRAKU 提交于
      This is the Renesas IPMMU driver and IOMMU API implementation.
      
      The IPMMU module supports the MMU function and the PMB function.  The
      MMU function provides address translation by pagetable compatible with
      ARMv6.  The PMB function provides address translation including
      tile-linear translation.  This patch implements the MMU function.
      
      The iommu driver does not register a platform driver directly because:
      - the register space of the MMU function and the PMB function
        have a common register (used for settings flush), so they should ideally
        have a way to appropriately share this register.
      - the MMU function uses the IOMMU API while the PMB function does not.
      - the two functions may be used independently.
      Signed-off-by: NHideki EIRAKU <hdk@igel.co.jp>
      Signed-off-by: NJoerg Roedel <joro@8bytes.org>
      c2c460f7
  9. 21 11月, 2012 1 次提交
  10. 25 6月, 2012 1 次提交
  11. 12 5月, 2012 1 次提交
  12. 07 5月, 2012 3 次提交
  13. 26 1月, 2012 2 次提交
  14. 12 12月, 2011 1 次提交
  15. 21 9月, 2011 1 次提交
  16. 26 8月, 2011 1 次提交
  17. 21 6月, 2011 4 次提交
  18. 14 6月, 2011 1 次提交