• Yong Wu's avatar
    iommu/mediatek: Add mmu1 support · 15a01f4c
    Yong Wu authored
    Normally the M4U HW connect EMI with smi. the diagram is like below:
                  EMI
                   |
                  M4U
                   |
                smi-common
                   |
           -----------------
           |    |    |     |    ...
        larb0 larb1  larb2 larb3
    
    Actually there are 2 mmu cells in the M4U HW, like this diagram:
    
                  EMI
               ---------
                |     |
               mmu0  mmu1     <- M4U
                |     |
               ---------
                   |
                smi-common
                   |
           -----------------
           |    |    |     |    ...
        larb0 larb1  larb2 larb3
    
    This patch add support for mmu1. In order to get better performance,
    we could adjust some larbs go to mmu1 while the others still go to
    mmu0. This is controlled by a SMI COMMON register SMI_BUS_SEL(0x220).
    
    mt2712, mt8173 and mt8183 M4U HW all have 2 mmu cells. the default
    value of that register is 0 which means all the larbs go to mmu0
    defaultly.
    
    This is a preparing patch for adjusting SMI_BUS_SEL for mt8183.
    Signed-off-by: default avatarYong Wu <yong.wu@mediatek.com>
    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>
    15a01f4c
mtk_iommu.c 22.6 KB