Received: by 2002:a05:6a10:8a4d:0:0:0:0 with SMTP id dn13csp529597pxb; Thu, 12 Aug 2021 23:59:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyijOdfDWCfYCmjwSc1EM4F63ii1A6ZrZJ3UBXydgMVb/fVLOBa3ZiILZLgR4wem2dl0AOc X-Received: by 2002:a02:7f4c:: with SMTP id r73mr900232jac.95.1628837990383; Thu, 12 Aug 2021 23:59:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628837990; cv=none; d=google.com; s=arc-20160816; b=XXoBwLc+zt8GmUcFuWQ+PAoGsNVZOk2fTLtoNPiTLEwW5CxQJcnN1Fpc8eU5WLUzbx liCT/ALb9bU63zFdAPFn2B2+47Q6ftqJbqAnepO3eXV+pSyHif4atVJyEjk2m/OzlCyW BQPcj0pZG2IGPA2t0gSF2PGt6MJb4e+OudePuyXVm496CSl2Urt2ChX1YpjTmgw2JxZK C3awc/fn+XByQY02amu93sV6x+JbmA6Yey0/MB8uLUuGsuJI9sk6wOkVe2DqAH4QIPWL M/+L2/xYvRs4DN/jDm+PSjOZqR+16iIQ72QG1T4q3TExyT3J43UJ91rK+w3BI3Zqkgfr QM+w== 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=9RzYMYPO4ZP29aiw79TdcYwxSlxqq5BeBbrLmzDEYYo=; b=JiPkv0kxckPT3wBLE1qzGdRqpkoXikFFN3sbawNb9JqosW8zzjh2vgPcqwb4/1xcSE NUAm9MRW2XtH0W7kqTx8ZWSLw3Q9YOk+S5KoDRSpPNv/AScqdBtYgY6WRV3s242Hifso xgYvPI4HFBn7vIwrl9KrVRY0jis3Z7Cg9S4RP/DSAWTaNoJifdKV5rJPrwMlPaDrNq9l OkLt6DqN8If/1jxbAZ6mAGkHIlqstSWqzGP4xHY0YDWnhTC1TgUTvoi9C2EupCjRfOwW VctONjZrschGLhxZYnb//Q0va84o4gmIn53DBT+eqNtcVIaOZdU8BHSxvk07AOx+p7Vs R0dQ== 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 q16si724897ioj.19.2021.08.12.23.59.40; Thu, 12 Aug 2021 23:59:50 -0700 (PDT) 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 S239201AbhHMG6K (ORCPT + 99 others); Fri, 13 Aug 2021 02:58:10 -0400 Received: from mailgw01.mediatek.com ([60.244.123.138]:41732 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S239060AbhHMG6J (ORCPT ); Fri, 13 Aug 2021 02:58:09 -0400 X-UUID: 914ff2a574d14c69b754480a9ee4ea7e-20210813 X-UUID: 914ff2a574d14c69b754480a9ee4ea7e-20210813 Received: from mtkmbs10n2.mediatek.inc [(172.21.101.183)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1060980730; Fri, 13 Aug 2021 14:57:39 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs07n1.mediatek.inc (172.21.101.16) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 13 Aug 2021 14:57:37 +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; Fri, 13 Aug 2021 14:57:36 +0800 From: Yong Wu To: Joerg Roedel , Rob Herring , Matthias Brugger , Will Deacon , Robin Murphy CC: Krzysztof Kozlowski , Evan Green , Tomasz Figa , Tomasz Figa , , , , , , , , , Nicolas Boichat , , Subject: [PATCH v2 29/29] iommu/mediatek: mt8195: Enable multi banks for infra iommu Date: Fri, 13 Aug 2021 14:53:24 +0800 Message-ID: <20210813065324.29220-30-yong.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20210813065324.29220-1-yong.wu@mediatek.com> References: <20210813065324.29220-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 3d474eedce3e..5c4905e70362 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -1283,8 +1283,11 @@ static const struct mtk_iommu_plat_data mt8195_data_infra = { .flags = WR_THROT_EN | DCM_DISABLE | MTK_IOMMU_TYPE_INFRA | IFA_IOMMU_PCIe_SUPPORT, .pericfg_comp_str = "mediatek,mt8195-pericfg_ao", - .bank_nr = 1, - .bank_enable = {true}, + .bank_nr = 5, + .bank_enable = {true, false, false, false, true}, + .bank_portmsk = {[0] = GENMASK(19, 16), /* PCIe */ + [4] = GENMASK(31, 20), /* USB */ + }, .inv_sel_reg = REG_MMU_INV_SEL_GEN2, .iova_region = single_domain, .iova_region_nr = ARRAY_SIZE(single_domain), -- 2.18.0