1. 24 10月, 2012 1 次提交
  2. 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
  3. 23 1月, 2012 1 次提交
    • R
      ARM: add dma coherent region reporting via procfs · 45cd5290
      Russell King 提交于
      Add a new seqfile for reporting coherent DMA allocations.  This contains
      the address range, size and the function which was used to allocate
      each region, allowing these allocations to be viewed in much the same
      way as /proc/vmallocinfo.
      
      The DMA coherent region has limited space, so this allows allocation
      failures to be viewed, as well as finding out how much space is being
      used.
      
      Make sure this file is only readable by root - same as vmallocinfo - to
      prevent information leakage.
      Acked-by: NNicolas Pitre <nico@linaro.org>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      45cd5290
  4. 27 7月, 2010 1 次提交
    • R
      ARM: DMA coherent allocator: align remapped addresses · 5bc23d32
      Russell King 提交于
      The DMA coherent remap area is used to provide an uncached mapping
      of memory for coherency with DMA engines.  Currently, we look for
      any free hole which our allocation will fit in with page alignment.
      
      However, this can lead to fragmentation of the area, and allows small
      allocations to cross L1 entry boundaries.  This is undesirable as we
      want to move towards allocating sections of memory.
      
      Align allocations according to the size, limiting the alignment between
      the page and section sizes.
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      5bc23d32
  5. 25 11月, 2009 1 次提交