Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp4176289pxb; Tue, 25 Jan 2022 05:11:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJySmA6zQpbtuf8rSXUqy6ZbjRTippv8a2NHk5Z87K35ydUn6H8nBmHQOKjzyNRmXUAZLR98 X-Received: by 2002:a50:ab5d:: with SMTP id t29mr15707026edc.371.1643116264197; Tue, 25 Jan 2022 05:11:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643116264; cv=none; d=google.com; s=arc-20160816; b=TpcyWMiq96z8SsIEOsqFAj8nnMrqtwUSZpCClkcdks2AIs/Y0iTRB5sRfcuYeblx8K jQeuXZPH/AYVsFBaZvR7WsSSwJs6zEqSkYIN39tvTEC7XL7Uvi8Yt2E9qUwQs9kE9yGb UOjdVzjuOpb/03jkyjA8kLt9NnzB4goZWJlAoUqbLFx8wWmlJtduUsyCnYFxWMZLkAMi QhnKh91lYz/oTvJRYcx20MnuMKf2MTB1XqTHX6rG1ic+8kPFv1uEenRMqdK/WI8mIU22 iOQVXeWAPptTsgA7X+CqNI+MUCEto6NLKi2ESRWtJRBz/H/f0kqhPboRpZqPLXvswKWX cn4g== 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=6Ui7Qrib5fhPKhmCTGtxuaXr96+fyI4qVbalreJiZ8A=; b=PYCv0BCoStLrB8Xqu63/UqIxk1adbMGC4CYvsZGNokW1su0I3/RCrwKNfrA+VY6Fel 5xBSzwnNZq1vM1y0/sS0rFleweO5tA/jePHNq83mcwG3K1o4p1lCFH3bcy0H0Dw5WCRi 2RJh3bvJX42gA6Zk6AqlZJKqSiVmxTx/XI42GbKQYlZPysac6fsjk1wVsravoChS4M3N Erz4lOXX/QTPH68yDKLhpcAUHsHkKP1RvXoZr8hJEfi2+Fsci9I4sEkdt2ev00wxjcjt /xPTWqDY5wd9EGv7o7DdtlS+bbh6qYL1Zvh1G82rSJJrpJ8WL1VSqB2Feq6BViPUk4Yk 3B6w== 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 di7si10790579ejc.411.2022.01.25.05.10.38; Tue, 25 Jan 2022 05:11:04 -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 S1457029AbiAYJOA (ORCPT + 99 others); Tue, 25 Jan 2022 04:14:00 -0500 Received: from mailgw01.mediatek.com ([60.244.123.138]:58964 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1455297AbiAYJEH (ORCPT ); Tue, 25 Jan 2022 04:04:07 -0500 X-UUID: cb539689a5d24496baee2d4944c5e0da-20220125 X-UUID: cb539689a5d24496baee2d4944c5e0da-20220125 Received: from mtkcas11.mediatek.inc [(172.21.101.40)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 952828097; Tue, 25 Jan 2022 17:01:19 +0800 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkmbs10n2.mediatek.inc (172.21.101.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.792.3; Tue, 25 Jan 2022 17:01:17 +0800 Received: from localhost.localdomain (10.17.3.154) by mtkcas10.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 25 Jan 2022 17:01:16 +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 v4 35/35] iommu/mediatek: mt8195: Enable multi banks for infra iommu Date: Tue, 25 Jan 2022 16:56:34 +0800 Message-ID: <20220125085634.17972-36-yong.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20220125085634.17972-1-yong.wu@mediatek.com> References: <20220125085634.17972-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 Enable the multi-bank functions for infra-iommu. We put PCIE in bank0 and USB in the last bank(bank4). and we don't use the other banks currently, disable them. Signed-off-by: Yong Wu --- drivers/iommu/mtk_iommu.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index a17610434868..be36e73e4bcc 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -1421,8 +1421,11 @@ static const struct mtk_iommu_plat_data mt8195_data_infra = { MTK_IOMMU_TYPE_INFRA | IFA_IOMMU_PCIE_SUPPORT, .pericfg_comp_str = "mediatek,mt8195-pericfg_ao", .inv_sel_reg = REG_MMU_INV_SEL_GEN2, - .banks_num = 1, - .banks_enable = {true}, + .banks_num = 5, + .banks_enable = {true, false, false, false, true}, + .banks_portmsk = {[0] = GENMASK(19, 16), /* PCIe */ + [4] = GENMASK(31, 20), /* USB */ + }, .iova_region = single_domain, .iova_region_nr = ARRAY_SIZE(single_domain), }; -- 2.18.0