Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp4240818pxb; Tue, 25 Jan 2022 06:30:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJymat9CGoqtZ08qAk7AnROLQZNZHwr0nml5sgbPWzzGqegp0WhqH+s5e3Yjk+hJaPX48Zeh X-Received: by 2002:a63:205:: with SMTP id 5mr15410398pgc.379.1643121021950; Tue, 25 Jan 2022 06:30:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643121021; cv=none; d=google.com; s=arc-20160816; b=RcUlQxHlOltFnpeJBEQnKVRUmhW6mM1pGDDPFmLhaKAYYK4SG+4N/8ot7PGdKl5utz EZvrbCgzj/Dt91W0IltfkMoLiVn+nRN6V0dIaYdiS5IxAlMqkPsnBEPXUzVudr/V750m EbxF2TQJtdP87U7RgciPdNZ9RuAnCh9g71hkkt8glRe0H/GJcpcBQZ5dv9BlBw5CQbl3 SbDEfxP4Ka6YVI7mqYXP9MKvvZJT8BudZedd4JaIi1BvgLqSNKwbSVpWI1sLPIEVu3l/ pPo/aAaUOw18iRUhRrr1YgUOtfJqRArSJBHF6SyF0mVp4L5sKfEY43Kn/FHE5RSNe5ux jntw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=enD6IDKBKlt4UvL+rzxyTChT+W7fJISJsWixyQzERys=; b=I2bJdEmgyFXOTETJB0gjHoehLvUvKoEM3j6imtfdzH9u+DwtrARvVqwfScTGUXvtCz jO2ttq25dM+xnNe3zWK1zgSVtzyUzQ+6k2SmO0Cd4smNapI5eBGwdXDc4sNQic8AtOie x/Yev5q8HCA57xnYsy7gcuOxJUzlboXOZhG5mYeUh8O0aUIpNxMjeX8O/awIaQKMAZTo FRZJRy6mn/+6wg9bJrVS0jzvvJfP4GC+Cy16z9oBS/TxM38nxgVAG7v9HXYXxuyF8IcV BjNmurApGoQKghVkNfndZxRyGcwHl6LRqZlMe+JvKVuUsmSCaiO8NhklaizP45lfSoXN 6QzA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x12si15549664plo.75.2022.01.25.06.30.09; Tue, 25 Jan 2022 06:30:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1574016AbiAYJgB (ORCPT + 99 others); Tue, 25 Jan 2022 04:36:01 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:59592 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1574313AbiAYJdJ (ORCPT ); Tue, 25 Jan 2022 04:33:09 -0500 X-UUID: 9aa42dd137d842d3b4995974294a485b-20220125 X-UUID: 9aa42dd137d842d3b4995974294a485b-20220125 Received: from mtkcas10.mediatek.inc [(172.21.101.39)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 747684564; Tue, 25 Jan 2022 17:33:03 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.792.15; Tue, 25 Jan 2022 17:33:00 +0800 Received: from localhost.localdomain (10.17.3.154) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 25 Jan 2022 17:32:59 +0800 From: Yong Wu To: Joerg Roedel , Rob Herring , "Matthias Brugger" , Will Deacon CC: Robin Murphy , Krzysztof Kozlowski , Tomasz Figa , , , , , , , Hsin-Yi Wang , , , , , , "AngeloGioacchino Del Regno" , , , , Subject: [PATCH 2/2] iommu/mediatek: Add mt8186 iommu support Date: Tue, 25 Jan 2022 17:32:44 +0800 Message-ID: <20220125093244.18230-3-yong.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20220125093244.18230-1-yong.wu@mediatek.com> References: <20220125093244.18230-1-yong.wu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add mt8186 iommu supports. Signed-off-by: Anan Sun Signed-off-by: Yong Wu --- drivers/iommu/mtk_iommu.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index be36e73e4bcc..a3124f48f9e1 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -160,6 +160,7 @@ enum mtk_iommu_plat { M4U_MT8167, M4U_MT8173, M4U_MT8183, + M4U_MT8186, M4U_MT8192, M4U_MT8195, }; @@ -1401,6 +1402,21 @@ static const struct mtk_iommu_plat_data mt8183_data = { .larbid_remap = {{0}, {4}, {5}, {6}, {7}, {2}, {3}, {1}}, }; +static const struct mtk_iommu_plat_data mt8186_data_mm = { + .m4u_plat = M4U_MT8186, + .flags = HAS_BCLK | HAS_SUB_COMM_2BITS | OUT_ORDER_WR_EN | + WR_THROT_EN | IOVA_34_EN | NOT_STD_AXI_MODE | + MTK_IOMMU_TYPE_MM, + .larbid_remap = {{0}, {1, MTK_INVALID_LARBID, 8}, {4}, {7}, {2}, {9, 11, 19, 20}, + {MTK_INVALID_LARBID, 14, 16}, + {MTK_INVALID_LARBID, 13, MTK_INVALID_LARBID, 17}}, + .inv_sel_reg = REG_MMU_INV_SEL_GEN2, + .banks_num = 1, + .banks_enable = {true}, + .iova_region = mt8192_multi_dom, + .iova_region_nr = ARRAY_SIZE(mt8192_multi_dom), +}; + static const struct mtk_iommu_plat_data mt8192_data = { .m4u_plat = M4U_MT8192, .flags = HAS_BCLK | HAS_SUB_COMM_2BITS | OUT_ORDER_WR_EN | @@ -1470,6 +1486,7 @@ static const struct of_device_id mtk_iommu_of_ids[] = { { .compatible = "mediatek,mt8167-m4u", .data = &mt8167_data}, { .compatible = "mediatek,mt8173-m4u", .data = &mt8173_data}, { .compatible = "mediatek,mt8183-m4u", .data = &mt8183_data}, + { .compatible = "mediatek,mt8186-iommu-mm", .data = &mt8186_data_mm}, { .compatible = "mediatek,mt8192-m4u", .data = &mt8192_data}, { .compatible = "mediatek,mt8195-iommu-infra", .data = &mt8195_data_infra}, { .compatible = "mediatek,mt8195-iommu-vdo", .data = &mt8195_data_vdo}, -- 2.18.0