MediaTek IOMMU Architecture Implementation

Schema identifier ($id): "http://devicetree.org/schemas/iommu/mediatek,iommu.yaml#"

Schema dialect ($schema): "http://devicetree.org/meta-schemas/core.yaml#"

Maintainers (maintainers): "Yong Wu <yong.wu@mediatek.com>"

Some MediaTek SOCs contain a Multimedia Memory Management Unit (M4U), and this M4U have two generations of HW architecture. Generation one uses flat pagetable, and only supports 4K size page mapping. Generation two uses the ARM Short-Descriptor translation table format for address translation.

About the M4U Hardware Block Diagram, please check below:

              EMI (External Memory Interface)
               |
              m4u (Multimedia Memory Management Unit)
               |
          +--------+
          |        |
      gals0-rx   gals1-rx    (Global Async Local Sync rx)
          |        |
          |        |
      gals0-tx   gals1-tx    (Global Async Local Sync tx)
          |        |          Some SoCs may have GALS.
          +--------+
               |
           SMI Common(Smart Multimedia Interface Common)
               |
       +----------------+-------
       |                |
       |             gals-rx        There may be GALS in some larbs.
       |                |
       |                |
       |             gals-tx
       |                |
   SMI larb0        SMI larb1   ... SoCs have several SMI local arbiter(larb).
   (display)         (vdec)
       |                |
       |                |
 +-----+-----+     +----+----+
 |     |     |     |    |    |
 |     |     |...  |    |    |  ... There are different ports in each larb.
 |     |     |     |    |    |
OVL0 RDMA0 WDMA0  MC   PP   VLD

As above, The Multimedia HW will go through SMI and M4U while it access EMI. SMI is a bridge between m4u and the Multimedia HW. It contain smi local arbiter and smi common. It will control whether the Multimedia HW should go through the m4u for translation or bypass it and talk directly with EMI. And also SMI help control the power domain and clocks for each local arbiter.

Normally we specify a local arbiter(larb) for each multimedia HW like display, video decode, and camera. And there are different ports in each larb. Take a example, There are many ports like MC, PP, VLD in the video decode local arbiter, all these ports are according to the video HW.

In some SoCs, there may be a GALS(Global Async Local Sync) module between smi-common and m4u, and additional GALS module between smi-larb and smi-common. GALS can been seen as a "asynchronous fifo" which could help synchronize for the modules in different clock frequency.

Properties and child nodes (properties) #

compatible — required here #

Exactly one of these rules must match (oneOf) #

Rule 1

Allowed values (enum): "mediatek,mt2701-m4u", "mediatek,mt2712-m4u", "mediatek,mt6779-m4u", "mediatek,mt6795-m4u", "mediatek,mt6893-iommu-mm", "mediatek,mt8167-m4u", "mediatek,mt8173-m4u", "mediatek,mt8183-m4u", "mediatek,mt8186-iommu-mm", "mediatek,mt8188-iommu-vdo", "mediatek,mt8188-iommu-vpp", "mediatek,mt8188-iommu-infra", "mediatek,mt8189-iommu-apu", "mediatek,mt8189-iommu-infra", "mediatek,mt8189-iommu-mm", "mediatek,mt8192-m4u", "mediatek,mt8195-iommu-vdo", "mediatek,mt8195-iommu-vpp", "mediatek,mt8195-iommu-infra", "mediatek,mt8365-m4u"

Rule 2

mt7623 generation one

Array item rules (items)

Item 1

Exact value (const): "mediatek,mt7623-m4u"

Item 2

Exact value (const): "mediatek,mt2701-m4u"

reg — required here #

Maximum number of items (maxItems): 1

interrupts — required here #

Maximum number of items (maxItems): 1

clocks — not listed as required here #

Array item rules (items) #

Item 1

bclk is the block clock.

clock-names — not listed as required here #

Array item rules (items) #

Item 1

Exact value (const): "bclk"

mediatek,infracfg — not listed as required here #

Shared schema rule ($ref): /schemas/types.yaml#/definitions/phandle

The phandle to the mediatek infracfg syscon

mediatek,larbs — not listed as required here #

Shared schema rule ($ref): /schemas/types.yaml#/definitions/phandle-array

Minimum number of items (minItems): 1

Maximum number of items (maxItems): 32

Array item rules (items) #

Maximum number of items (maxItems): 1

List of phandle to the local arbiters in the current Socs. Refer to bindings/memory-controllers/mediatek,smi-larb.yaml. It must sort according to the local arbiter index, like larb0, larb1, larb2...

#iommu-cells — required here #

Exact value (const): 1

This is the mtk_m4u_id according to the HW. Specifies the mtk_m4u_id as defined in dt-binding/memory/mediatek,mt8188-memory-port.h for mt8188, dt-binding/memory/mediatek,mt8189-memory-port.h for mt8189, dt-binding/memory/mt2701-larb-port.h for mt2701 and mt7623, dt-binding/memory/mt2712-larb-port.h for mt2712, dt-binding/memory/mt6779-larb-port.h for mt6779, dt-binding/memory/mt6795-larb-port.h for mt6795, dt-binding/memory/mediatek,mt6893-memory-port.h for mt6893, dt-binding/memory/mt8167-larb-port.h for mt8167, dt-binding/memory/mt8173-larb-port.h for mt8173, dt-binding/memory/mt8183-larb-port.h for mt8183, dt-binding/memory/mt8186-memory-port.h for mt8186, dt-binding/memory/mt8192-larb-port.h for mt8192. dt-binding/memory/mt8195-memory-port.h for mt8195. dt-binding/memory/mediatek,mt8365-larb-port.h for mt8365.

power-domains — not listed as required here #

Maximum number of items (maxItems): 1

Required in this object (required): "compatible", "reg", "interrupts", "#iommu-cells"

All of these rules must match (allOf) #

Rule 1 #

Condition (if) #

Properties and child nodes (properties)

compatible — not listed as required here

Rule for matching array elements (contains)

Allowed values (enum): "mediatek,mt2701-m4u", "mediatek,mt2712-m4u", "mediatek,mt6795-m4u", "mediatek,mt6893-iommu-mm", "mediatek,mt8173-m4u", "mediatek,mt8186-iommu-mm", "mediatek,mt8188-iommu-vdo", "mediatek,mt8188-iommu-vpp", "mediatek,mt8189-iommu-mm", "mediatek,mt8192-m4u", "mediatek,mt8195-iommu-vdo", "mediatek,mt8195-iommu-vpp"

When the condition matches (then) #

Required in this object (required): "clocks"

Rule 2 #

Condition (if) #

Properties and child nodes (properties)

compatible — not listed as required here

Allowed values (enum): "mediatek,mt6893-iommu-mm", "mediatek,mt8186-iommu-mm", "mediatek,mt8188-iommu-vdo", "mediatek,mt8188-iommu-vpp", "mediatek,mt8189-iommu-mm", "mediatek,mt8192-m4u", "mediatek,mt8195-iommu-vdo", "mediatek,mt8195-iommu-vpp"

When the condition matches (then) #

Required in this object (required): "power-domains"

Rule 3 #

Condition (if) #

Properties and child nodes (properties)

compatible — not listed as required here

Rule for matching array elements (contains)

Allowed values (enum): "mediatek,mt2712-m4u", "mediatek,mt6795-m4u", "mediatek,mt8173-m4u"

When the condition matches (then) #

Required in this object (required): "mediatek,infracfg"

Rule 4 #

Condition (if) #

This rule must not match (not)

Properties and child nodes (properties)

compatible — not listed as required here

Rule for matching array elements (contains)

Allowed values (enum): "mediatek,mt8188-iommu-infra", "mediatek,mt8189-iommu-apu", "mediatek,mt8189-iommu-infra", "mediatek,mt8195-iommu-infra"

When the condition matches (then) #

Required in this object (required): "mediatek,larbs"

Properties not matched by properties or patternProperties in this schema (additionalProperties) #

false

Not allowed by this rule.

Examples (examples) #

#include <dt-bindings/clock/mt8173-clk.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>

iommu: iommu@10205000 {
        compatible = "mediatek,mt8173-m4u";
        reg = <0x10205000 0x1000>;
        interrupts = <GIC_SPI 139 IRQ_TYPE_LEVEL_LOW>;
        clocks = <&infracfg CLK_INFRA_M4U>;
        clock-names = "bclk";
        mediatek,infracfg = <&infracfg>;
        mediatek,larbs = <&larb0>, <&larb1>, <&larb2>,
                         <&larb3>, <&larb4>, <&larb5>;
        #iommu-cells = <1>;
};

Source notes #

Annotations retained from the schema source

Line 1: SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)

Line 73: generation one

Line 74: generation two

Line 75: generation two

Line 76: generation two

Line 77: generation two

Line 78: generation two

Line 79: generation two

Line 80: generation two

Line 81: generation two

Line 82: generation two

Line 83: generation two

Line 84: generation two

Line 85: generation two

Line 86: generation two

Line 87: generation two

Line 88: generation two

Line 89: generation two

Line 90: generation two

Line 91: generation two

Line 92: generation two

Line 210: The IOMMUs don't have larbs.

Edit this page