lkml.org 
[lkml]   [2020]   [Jul]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 18/21] iommu/mediatek: Add support for multi domain
    On Sat, Jul 11, 2020 at 02:48:43PM +0800, Yong Wu wrote:
    > Some HW IP(ex: CCU) require the special iova range. That means the
    > iova got from dma_alloc_attrs for that devices must locate in his
    > special range. In this patch, we allocate a special iova_range for
    > each a special requirement and create each a iommu domain for each
    > a iova_range.
    >
    > meanwhile we still use one pagetable which support 16GB iova.
    >
    > After this patch, If the iova range of a master is over 4G, the master
    > should:
    > a) Declare its special dma_ranges in its dtsi node. For example, If we
    > preassign the iova 4G-8G for vcodec, then the vcodec dtsi node should:
    > dma-ranges = <0x1 0x0 0x1 0x0 0x1 0x0>; /* 4G ~ 8G */

    BTW, dma-ranges should be in the parent node of the vcodec.

    > b) Update the dma_mask:
    > dma_set_mask_and_coherent(dev, DMA_BIT_MASK(33));

    This should happen for you automatically. The DMA PFN offset
    should also be 4GB here.

    >
    > Signed-off-by: Yong Wu <yong.wu@mediatek.com>
    > ---
    > drivers/iommu/mtk_iommu.c | 49 ++++++++++++++++++++++++++++++++-------
    > drivers/iommu/mtk_iommu.h | 3 ++-
    > 2 files changed, 42 insertions(+), 10 deletions(-)

    \
     
     \ /
      Last update: 2020-07-23 22:48    [W:3.907 / U:0.368 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site