Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dt-bindings: mediatek: mt8195: Add binding for infra IOMMU

In mt8195, we have a new IOMMU that is for INFRA IOMMU. its masters
mainly are PCIe and USB. Different with MM IOMMU, all these masters
connect with IOMMU directly, there is no mediatek,larbs property for
infra IOMMU.

Another thing is about PCIe ports. currently the function
"of_iommu_configure_dev_id" only support the id number is 1, But our
PCIe have two ports, one is for reading and the other is for writing.
see more about the PCIe patch in this patchset. Thus, I only list
the reading id here and add the other id in our driver.

Signed-off-by: Yong Wu <yong.wu@mediatek.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
Link: https://lore.kernel.org/r/20220503071427.2285-3-yong.wu@mediatek.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>

authored by

Yong Wu and committed by
Joerg Roedel
dc1d9934 6625ffb9

+32 -1
+12 -1
Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml
··· 79 79 - mediatek,mt8192-m4u # generation two 80 80 - mediatek,mt8195-iommu-vdo # generation two 81 81 - mediatek,mt8195-iommu-vpp # generation two 82 + - mediatek,mt8195-iommu-infra # generation two 82 83 83 84 - description: mt7623 generation one 84 85 items: ··· 132 131 - compatible 133 132 - reg 134 133 - interrupts 135 - - mediatek,larbs 136 134 - '#iommu-cells' 137 135 138 136 allOf: ··· 162 162 then: 163 163 required: 164 164 - power-domains 165 + 166 + - if: # The IOMMUs don't have larbs. 167 + not: 168 + properties: 169 + compatible: 170 + contains: 171 + const: mediatek,mt8195-iommu-infra 172 + 173 + then: 174 + required: 175 + - mediatek,larbs 165 176 166 177 additionalProperties: false 167 178
+18
include/dt-bindings/memory/mt8195-memory-port.h
··· 387 387 #define M4U_PORT_L28_CAM_DRZS4NO_R1 MTK_M4U_ID(28, 5) 388 388 #define M4U_PORT_L28_CAM_TNCSO_R1 MTK_M4U_ID(28, 6) 389 389 390 + /* Infra iommu ports */ 391 + /* PCIe1: read: BIT16; write BIT17. */ 392 + #define IOMMU_PORT_INFRA_PCIE1 MTK_IFAIOMMU_PERI_ID(16) 393 + /* PCIe0: read: BIT18; write BIT19. */ 394 + #define IOMMU_PORT_INFRA_PCIE0 MTK_IFAIOMMU_PERI_ID(18) 395 + #define IOMMU_PORT_INFRA_SSUSB_P3_R MTK_IFAIOMMU_PERI_ID(20) 396 + #define IOMMU_PORT_INFRA_SSUSB_P3_W MTK_IFAIOMMU_PERI_ID(21) 397 + #define IOMMU_PORT_INFRA_SSUSB_P2_R MTK_IFAIOMMU_PERI_ID(22) 398 + #define IOMMU_PORT_INFRA_SSUSB_P2_W MTK_IFAIOMMU_PERI_ID(23) 399 + #define IOMMU_PORT_INFRA_SSUSB_P1_1_R MTK_IFAIOMMU_PERI_ID(24) 400 + #define IOMMU_PORT_INFRA_SSUSB_P1_1_W MTK_IFAIOMMU_PERI_ID(25) 401 + #define IOMMU_PORT_INFRA_SSUSB_P1_0_R MTK_IFAIOMMU_PERI_ID(26) 402 + #define IOMMU_PORT_INFRA_SSUSB_P1_0_W MTK_IFAIOMMU_PERI_ID(27) 403 + #define IOMMU_PORT_INFRA_SSUSB2_R MTK_IFAIOMMU_PERI_ID(28) 404 + #define IOMMU_PORT_INFRA_SSUSB2_W MTK_IFAIOMMU_PERI_ID(29) 405 + #define IOMMU_PORT_INFRA_SSUSB_R MTK_IFAIOMMU_PERI_ID(30) 406 + #define IOMMU_PORT_INFRA_SSUSB_W MTK_IFAIOMMU_PERI_ID(31) 407 + 390 408 #endif
+2
include/dt-bindings/memory/mtk-memory-port.h
··· 12 12 #define MTK_M4U_TO_LARB(id) (((id) >> 5) & 0x1f) 13 13 #define MTK_M4U_TO_PORT(id) ((id) & 0x1f) 14 14 15 + #define MTK_IFAIOMMU_PERI_ID(port) MTK_M4U_ID(0, port) 16 + 15 17 #endif