1. 20 5月, 2014 1 次提交
  2. 28 2月, 2014 2 次提交
    • M
      arm: dma-mapping: remove order parameter from arm_iommu_create_mapping() · 68efd7d2
      Marek Szyprowski 提交于
      The 'order' parameter for IOMMU-aware dma-mapping implementation was
      introduced mainly as a hack to reduce size of the bitmap used for
      tracking IO virtual address space. Since now it is possible to dynamically
      resize the bitmap, this hack is not needed and can be removed without any
      impact on the client devices. This way the parameters for
      arm_iommu_create_mapping() becomes much easier to understand. 'size'
      parameter now means the maximum supported IO address space size.
      
      The code will allocate (resize) bitmap in chunks, ensuring that a single
      chunk is not larger than a single memory page to avoid unreliable
      allocations of size larger than PAGE_SIZE in atomic context.
      Signed-off-by: NMarek Szyprowski <m.szyprowski@samsung.com>
      68efd7d2
    • A
      arm: dma-mapping: Add support to extend DMA IOMMU mappings · 4d852ef8
      Andreas Herrmann 提交于
      Instead of using just one bitmap to keep track of IO virtual addresses
      (handed out for IOMMU use) introduce an array of bitmaps. This allows
      us to extend existing mappings when running out of iova space in the
      initial mapping etc.
      
      If there is not enough space in the mapping to service an IO virtual
      address allocation request, __alloc_iova() tries to extend the mapping
      -- by allocating another bitmap -- and makes another allocation
      attempt using the freshly allocated bitmap.
      
      This allows arm iommu drivers to start with a decent initial size when
      an dma_iommu_mapping is created and still to avoid running out of IO
      virtual addresses for the mapping.
      Signed-off-by: NAndreas Herrmann <andreas.herrmann@calxeda.com>
      [mszyprow: removed extensions parameter to arm_iommu_create_mapping()
       function, which will be modified in the next patch anyway, also some
       debug messages about extending bitmap]
      Signed-off-by: NMarek Szyprowski <m.szyprowski@samsung.com>
      4d852ef8
  3. 25 2月, 2013 2 次提交
  4. 21 5月, 2012 1 次提交
    • M
      ARM: dma-mapping: add support for IOMMU mapper · 4ce63fcd
      Marek Szyprowski 提交于
      This patch add a complete implementation of DMA-mapping API for
      devices which have IOMMU support.
      
      This implementation tries to optimize dma address space usage by remapping
      all possible physical memory chunks into a single dma address space chunk.
      
      DMA address space is managed on top of the bitmap stored in the
      dma_iommu_mapping structure stored in device->archdata. Platform setup
      code has to initialize parameters of the dma address space (base address,
      size, allocation precision order) with arm_iommu_create_mapping() function.
      To reduce the size of the bitmap, all allocations are aligned to the
      specified order of base 4 KiB pages.
      
      dma_alloc_* functions allocate physical memory in chunks, each with
      alloc_pages() function to avoid failing if the physical memory gets
      fragmented. In worst case the allocated buffer is composed of 4 KiB page
      chunks.
      
      dma_map_sg() function minimizes the total number of dma address space
      chunks by merging of physical memory chunks into one larger dma address
      space chunk. If requested chunk (scatter list entry) boundaries
      match physical page boundaries, most calls to dma_map_sg() requests will
      result in creating only one chunk in dma address space.
      
      dma_map_page() simply creates a mapping for the given page(s) in the dma
      address space.
      
      All dma functions also perform required cache operation like their
      counterparts from the arm linear physical memory mapping version.
      
      This patch contains code and fixes kindly provided by:
      - Krishna Reddy <vdumpa@nvidia.com>,
      - Andrzej Pietrasiewicz <andrzej.p@samsung.com>,
      - Hiroshi DOYU <hdoyu@nvidia.com>
      Signed-off-by: NMarek Szyprowski <m.szyprowski@samsung.com>
      Acked-by: NKyungmin Park <kyungmin.park@samsung.com>
      Reviewed-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Tested-By: NSubash Patel <subash.ramaswamy@linaro.org>
      4ce63fcd