From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 37BF8ECAAD1 for ; Wed, 31 Aug 2022 13:06:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject:CC:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=DXR2PXWAWMX0KgfXPP1A4ZTE8C/1YVfBvSUt34KpiTo=; b=v0zGQPBJMDZf0MGM6ytWtNrrEr JKsfoMVqMpZi43BYUw4p+5UbKhG3qQNgTJJCJEslymVT1Z4EyORg5NoMp3UyCIbcRUnAJUixGfF0S MPcZc3ISvGP0ZLEnSJSjTZN6M757wjjClZNjq9p+uSGkRN3TgPMofwyuJo5PWBhpfNKcFvcJELJEm RDlMccYr7CyB6O8MCd0a3TPKvVmr4m7u/zqmrr2spIcP0Rp8cY/s3wsBq+h+M9tKt6+QI/WakaZmV VEtTlntXAc4+Zmur2rsf3l2Are0QY7YePVdPNEzrOBzW+7mQOdWCbxjgg28tstVVzZbR5Ks2uyY8G AanKI3bQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oTNPr-006Ex8-8C; Wed, 31 Aug 2022 13:05:59 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oTNPf-006Elz-43; Wed, 31 Aug 2022 13:05:48 +0000 X-UUID: ed5e7825148d48be95f910e36e6ae0ae-20220831 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=DXR2PXWAWMX0KgfXPP1A4ZTE8C/1YVfBvSUt34KpiTo=; b=aKO5FSigGJYx2uwN4xGe1H5C10mI0lfKkSrJjDnR8VhCJY+451UV4QQvOPcuCZkVod7hUeOgXYYIQJ1wNuQx1NiT4h6i2HcmQHww+WarooJRzLagxmg0C/QbWnuNPIjL/ns4sXN2+L3xWteZEYZQyQ0wF9ey9BslFKmN/1ypWXs=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.10,REQID:d9a65753-e1c3-4cac-abbb-9673158e11ac,OB:0,L OB:0,IP:0,URL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_ Ham,ACTION:release,TS:0 X-CID-META: VersionHash:84eae18,CLOUDID:1ebc2856-e800-47dc-8adf-0c936acf4f1b,C OID:IGNORED,Recheck:0,SF:nil,TC:nil,Content:0,EDM:-3,IP:nil,URL:0,File:nil ,Bulk:nil,QS:nil,BEC:nil,COL:0 X-UUID: ed5e7825148d48be95f910e36e6ae0ae-20220831 Received: from mtkmbs11n1.mediatek.inc [(172.21.101.185)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1293327425; Wed, 31 Aug 2022 06:05:42 -0700 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) by mtkmbs11n2.mediatek.inc (172.21.101.187) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.15; Wed, 31 Aug 2022 20:55:06 +0800 Received: from localhost.localdomain (10.17.3.154) by mtkmbs11n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Wed, 31 Aug 2022 20:55:05 +0800 From: Chengci.Xu To: Yong Wu , Joerg Roedel , Will Deacon , Robin Murphy , Rob Herring , Krzysztof Kozlowski , Matthias Brugger CC: , , , , , , Chengci.Xu 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> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220831_060547_186703_4BE21EE0 X-CRM114-Status: GOOD ( 12.69 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org 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