• Yong Wu's avatar
    iommu/mediatek: Add larb-id remapped support · b3e5eee7
    Yong Wu authored
    The larb-id may be remapped in the smi-common, this means the
    larb-id reported in the mtk_iommu_isr isn't the real larb-id,
    
    Take mt8183 as a example:
                           M4U
                            |
    ---------------------------------------------
    |               SMI common                  |
    -0-----7-----5-----6-----1-----2------3-----4- <- Id remapped
     |     |     |     |     |     |      |     |
    larb0 larb1 IPU0  IPU1 larb4 larb5  larb6  CCU
    disp  vdec  img   cam   venc  img    cam
    As above, larb0 connects with the id 0 in smi-common.
              larb1 connects with the id 7 in smi-common.
              ...
    If the larb-id reported in the isr is 7, actually it's larb1(vdec).
    In order to output the right larb-id in the isr, we add a larb-id
    remapping relationship in this patch.
    
    If there is no this larb-id remapping in some SoCs, use the linear
    mapping array instead.
    
    This also is a preparing patch for mt8183.
    Signed-off-by: default avatarYong Wu <yong.wu@mediatek.com>
    Reviewed-by: default avatarNicolas Boichat <drinkcat@chromium.org>
    Reviewed-by: default avatarEvan Green <evgreen@chromium.org>
    Reviewed-by: default avatarMatthias Brugger <matthias.bgg@gmail.com>
    Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
    b3e5eee7
mtk_iommu.c 21.8 KB