|
|
Log in / Subscribe / Register

MT8188 IOMMU SUPPORT

From:  "Chengci.Xu" <chengci.xu-AT-mediatek.com>
To:  Yong Wu <yong.wu-AT-mediatek.com>, Joerg Roedel <joro-AT-8bytes.org>, Will Deacon <will-AT-kernel.org>, Robin Murphy <robin.murphy-AT-arm.com>, Rob Herring <robh+dt-AT-kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt-AT-linaro.org>, Matthias Brugger <matthias.bgg-AT-gmail.com>
Subject:  [PATCH v2 0/3] MT8188 IOMMU SUPPORT
Date:  Wed, 31 Aug 2022 20:54:59 +0800
Message-ID:  <20220831125502.7818-1-chengci.xu@mediatek.com>
Cc:  <iommu-AT-lists.linux.dev>, <linux-mediatek-AT-lists.infradead.org>, <devicetree-AT-vger.kernel.org>, <linux-kernel-AT-vger.kernel.org>, <linux-arm-kernel-AT-lists.infradead.org>, <Project_Global_Chrome_Upstream_Group-AT-mediatek.com>, Chengci.Xu <chengci.xu-AT-mediatek.com>
Archive-link:  Article

This patchset adds MT8188 IOMMU support.

MT8188 have 3 IOMMU HWs. 2 IOMMU HW is for multimedia, and 1 IOMMU HW
is for infra-master, like PCIe.

About the 2 MM IOMMU HW, the connection could be something like this:

        IOMMU(VDO)          IOMMU(VPP)
           |                   |
      SMI_COMMON(VDO)      SMI_COMMON(VPP)
      ---------------     ----------------
      |      |   ...      |      |     ...
    larb0 larb2  ...    larb1 larb3    ...

INFRA IOMMU does not have SMI, the master connects to IOMMU directly.

Although multiple banks supported in MT8188, we only use one of them,
which means PCIe is put in bank0 of INFRA IOMMU.

So we have two pgtable for MT8188, specifically, these two MM IOMMU HW
share a pgtable while INFRA IOMMU HW use a independent pgtable.

Another change is that we add some SMC command for INFRA master to 
enable/disable INFRA IOMMU in ATF considering security concerns.

changes since v2:
  - base on tag: next-20220831.
  - rename "mt8188-memory-port.h" to "mediatek,mt8188-memory-port.h".
  - use dual-license in "mediatek,mt8188-memory-port.h"
  - remove unnecessary "()" when define SMI_LARB_ID

changes since v1:
  - base on tag: next-20220803.
  - adds MT8188 IOMMU support.

Chengci.Xu (3):
  dt-bindings: mediatek: mt8188: Add binding for MM & INFRA IOMMU
  iommu/mediatek: Add enable IOMMU SMC command for INFRA master
  iommu/mediatek: Add MT8188 IOMMU Support

 .../bindings/iommu/mediatek,iommu.yaml        |  12 +-
 drivers/iommu/mtk_iommu.c                     |  82 ++-
 .../memory/mediatek,mt8188-memory-port.h      | 482 ++++++++++++++++++
 include/soc/mediatek/smi.h                    |   1 +
 4 files changed, 568 insertions(+), 9 deletions(-)
 create mode 100644 include/dt-bindings/memory/mediatek,mt8188-memory-port.h

-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel


Copyright © 2022, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds