Message ID | 20230307080555.14399-1-yong.wu@mediatek.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp2305556wrd; Tue, 7 Mar 2023 00:09:06 -0800 (PST) X-Google-Smtp-Source: AK7set+nrd4e/uShpWCUuDORYcbk534a4b78E9eWudRNMuYTIwUS3VPi2n0+MI2dtt8oWmQbWIyI X-Received: by 2002:a17:90b:314b:b0:232:cdb6:c4ad with SMTP id ip11-20020a17090b314b00b00232cdb6c4admr14543781pjb.0.1678176545937; Tue, 07 Mar 2023 00:09:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678176545; cv=none; d=google.com; s=arc-20160816; b=CzkIvIzNYms1rYoTvxCGc0xzaITfDYRQBRV5OgHu/ywBBmJfw7kXTwr6BsinxgAT+R wTKvdLArFiFs1fP9fUXghK+2xx7yCFSN8UoE5J4seSIg9DEKvXETTq5FRXeDLp3khbOO 7EjzAF82Qsvusp7FErkJdZN6jiMRaAXZXczfk7mC6LmPELT2NRAdPSITELdZ9tFCdK3w LgNL0lx2A2rXAVzJ7q6+efunu5TlvxjPgtOHiF+ujFjhtb7WxjqpPEEnMJaA/ZmzDRnP c/NHUFmMKBgCxySKJPK2vqwKigzUw/+3it39H9pInU7nWKtFLfJeHizrLWxCXTqyVPz2 3BCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=SD4RysfS3my2k8WKOKVTGakT3VkMLfxdyZq5BsEIZUU=; b=ZLhfLgFBiH76CFG17QW8xIvmIFCucUlkdhBkWkXXOoLqJDvlv8MCrT021TDx3x5Yb/ kudfgpqf8s335AMSImvhswPiZxRCV3ukgn8145B2cfwvwUZJaBJiBUAdKhUMBtrTWMOS A4GmLIfyK/cKC6VJLqwQ+7b4Ed5TbSMt05jZKvc+LAQzkiWwHMNN5IIflpafJhugct1v gWEVGbGPXS0yx2wZQzo9DWLOVnYGgc1CIsmDp6K3e1Q+qNkwTCqjizJdwnQGIAFGsizs xcEK6hSQWwJ/XTDCf3y0pWCSGIykvAwgILrUZhJRvnQb51VGkyNjusw/ftqtuEM5NlVS RY3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=uFONQGB6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t23-20020a17090b019700b0023a177c4951si10881639pjs.39.2023.03.07.00.08.53; Tue, 07 Mar 2023 00:09:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=uFONQGB6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229744AbjCGIGN (ORCPT <rfc822;toshivichauhan@gmail.com> + 99 others); Tue, 7 Mar 2023 03:06:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229616AbjCGIGL (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 7 Mar 2023 03:06:11 -0500 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0B94664FD; Tue, 7 Mar 2023 00:06:08 -0800 (PST) X-UUID: e7153d38bcbe11eda06fc9ecc4dadd91-20230307 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=SD4RysfS3my2k8WKOKVTGakT3VkMLfxdyZq5BsEIZUU=; b=uFONQGB6ZhjeSTgML8pG+NzIBJ0GyTuqg6nRQYfnd66zU9nE6oH51tcopT6JQt1C8WRt4e4hlSeBN3RLwM7Lsd8gwMKf1403T5q8xxKdTCGac3KSWLvwxSN6Z0/PTn/0pYUEu264Ju7HAEZ4j4WpZp70HS1fsgBSB7l9ZuZGA+k=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.20,REQID:b07aefc5-1ca7-4d2e-b811-6ef9c68e00c7,IP:0,U RL:0,TC:0,Content:-25,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTIO N:release,TS:-25 X-CID-META: VersionHash:25b5999,CLOUDID:b36f74b2-beed-4dfc-bd9c-e1b22fa6ccc4,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:1,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0 X-CID-BVR: 0 X-UUID: e7153d38bcbe11eda06fc9ecc4dadd91-20230307 Received: from mtkmbs10n2.mediatek.inc [(172.21.101.183)] by mailgw01.mediatek.com (envelope-from <yong.wu@mediatek.com>) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1889710502; Tue, 07 Mar 2023 16:06:02 +0800 Received: from mtkmbs13n1.mediatek.inc (172.21.101.193) by mtkmbs13n2.mediatek.inc (172.21.101.108) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.25; Tue, 7 Mar 2023 16:06:00 +0800 Received: from mhfsdcap04.gcn.mediatek.inc (10.17.3.154) by mtkmbs13n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.25 via Frontend Transport; Tue, 7 Mar 2023 16:06:00 +0800 From: Yong Wu <yong.wu@mediatek.com> To: Joerg Roedel <joro@8bytes.org>, Will Deacon <will@kernel.org>, Rob Herring <robh+dt@kernel.org>, Matthias Brugger <matthias.bgg@gmail.com> CC: Robin Murphy <robin.murphy@arm.com>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Yong Wu <yong.wu@mediatek.com>, AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>, <iommu@lists.linux.dev>, <linux-mediatek@lists.infradead.org>, <devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <linux-arm-kernel@lists.infradead.org>, <mingyuan.ma@mediatek.com>, <yf.wang@mediatek.com>, <jianjiao.zeng@mediatek.com>, <chengci.xu@mediatek.com>, <youlin.pei@mediatek.com> Subject: [PATCH v8 0/7] MT8188 IOMMU SUPPORT Date: Tue, 7 Mar 2023 16:05:48 +0800 Message-ID: <20230307080555.14399-1-yong.wu@mediatek.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-MTK: N X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759695650170631380?= X-GMAIL-MSGID: =?utf-8?q?1759695650170631380?= |
Series |
MT8188 IOMMU SUPPORT
|
|
Message
Yong Wu
March 7, 2023, 8:05 a.m. UTC
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. We also adjust the flow of mtk_iommu_config to reduce indention. change since v8: - Base on v6.3-rc1 and mtk-iommu-dma-range-v5: https://lore.kernel.org/linux-mediatek/20230307023507.13306-1-yong.wu@mediatek.com/ - Add a new patch set_dma_mask since mt8188 support the PA of pgtable 35bits. changes since v7: - Base on mtk-iommu-dma-range-v4: https://lore.kernel.org/linux-mediatek/20230215062544.8677-1-yong.wu@mediatek.com/ - Add a new patch for two IOMMU share pagetable issue. - Add a new patch for adding iova_region_larb_msk for mt8188. - Add the comment in the dt-binding header file about larb index. This is for readable when updating the iova_region_larb_msk. Since there is something wrong for chengci's mail account when sending to devicetree mail list, we don't know why. I help send this patchset. https://lore.kernel.org/linux-mediatek/5a916595-12ee-92e6-d380-84146dd75218@linaro.org/ changes since v6: https://lore.kernel.org/linux-mediatek/20221223101439.494-1-chengci.xu@mediatek.com/ - base on tag: next-20221220. - update commit message of patch[2/4]. changes since v5: - base on tag: next-20221205. - add flag PGTABLE_PA_35_EN for all IOMMU in MT8188. - modify the type of "portid_msk" from "u32" to "unsigned long". changes since v4: - base on tag: next-20221018. - add patch[2/4] to reduce indention by adjust mtk_iommu_config flow. changes since v3: - base on tag: next-20220916. - use license "GPL-2.0-only OR BSD-2-Clause" in bingings head file. - drop redundant "portid" assignment when configure infra master. - reduce indentation by using "else if" when config infra master. - update probe flow about "pericfg" for CFG_IFA_MASTER_IN_ATF. - drop unused "pericfg_comp_str" in mt8188_data_infra. - drop words like "This commit/patch". 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 (5): dt-bindings: mediatek: mt8188: Add binding for MM & INFRA IOMMU iommu/mediatek: Fix two IOMMU share pagetable issue iommu/mediatek: Adjust mtk_iommu_config flow iommu/mediatek: Add enable IOMMU SMC command for INFRA master iommu/mediatek: Add MT8188 IOMMU Support Yong Wu (2): iommu/mediatek: Set dma_mask for PGTABLE_PA_35_EN iommu/mediatek: mt8188: Add iova_region_larb_msk .../bindings/iommu/mediatek,iommu.yaml | 12 +- drivers/iommu/mtk_iommu.c | 159 ++++-- .../memory/mediatek,mt8188-memory-port.h | 489 ++++++++++++++++++ include/soc/mediatek/smi.h | 1 + 4 files changed, 629 insertions(+), 32 deletions(-) create mode 100644 include/dt-bindings/memory/mediatek,mt8188-memory-port.h