Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp4904250pxv; Tue, 29 Jun 2021 19:41:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy8a5drNHUYChgyJn+77B7NgbNOA5M3CKp9IGmClDw1VFrLNMrkfZqPvnYTK7O7d8kAD2Bg X-Received: by 2002:a5e:dc48:: with SMTP id s8mr6210867iop.71.1625020916877; Tue, 29 Jun 2021 19:41:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625020916; cv=none; d=google.com; s=arc-20160816; b=vAMKZIKchgkg1SoHcmqt2QtgNgzzWJpuruo2yloOi6pbqVFCq64buXjL1rZyMeMJyS byPvIS9r2S83T6Dhpn7X8fNNzawY6VG653Aba8dSQPLFWnyiWDuZRLzeoeQf4K4TGgqJ 7AERMZBx/1SeK0swsFrxzAAk43eXdfUwTS43ZriOt/eEO4M7/fotI+nHjnahfBoK5/+i GJMxBCS7DuKUHc6cvLpF9uVhk99XD/SKNtajm0/A8xeEDNouiM4V4hNuN7dGzBGZrFCP eCxt3fZYY8nrNcS08ilIfmIrp0ThEp/ZfAiOFb2oKzbN1mcrauf9MUFFB4ZJ9sxljEiG 12BQ== 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=hd1miV3yyI8FN6Aw0SZwwRnD1Gk84vBOXiLHUQnS8uI=; b=kHitxti27hPcBr3D5XKWxtU2Mo4svhEcZZjUjioyTAwG+WJyoHL8WK2xsbYYoVnu1N L1lBvJg3sbQXEM/fktqSNUDb/YRcNJ866hRJZ7FhIdj8MIo7QdXdvopG44xM/oBcNuIe NhRJ85bvK8SW6BtyfBbjWfdAu+qqPHhlm1TceaawvEB0BkV2LW+SdyMP/lbOGY9ieLlr hSOHJ0ExADzEWpsSU1IhLd00gMtMRzoC1KO8otZbYeT+pqyFVvJqMwXsSi8ujmB7JoHf BJbfE3VtpCo1IohHE/4IJTGn8SK2iOk1LYO7fAxOrTVexOV2pAE/aHnnOa1TDmbSMxBt 98bg== 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 b7si14869060ile.135.2021.06.29.19.41.43; Tue, 29 Jun 2021 19:41:56 -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 S233779AbhF3Ck6 (ORCPT + 99 others); Tue, 29 Jun 2021 22:40:58 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:35726 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S233726AbhF3Ckx (ORCPT ); Tue, 29 Jun 2021 22:40:53 -0400 X-UUID: f0f88b3d43f147ecb528a99cf183e4b4-20210630 X-UUID: f0f88b3d43f147ecb528a99cf183e4b4-20210630 Received: from mtkmbs10n1.mediatek.inc [(172.21.101.34)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1704327587; Wed, 30 Jun 2021 10:38:22 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 30 Jun 2021 10:38:20 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 30 Jun 2021 10:38:19 +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 24/24] iommu/mediatek: mt8195: Enable multi-bank for infra iommu Date: Wed, 30 Jun 2021 10:35:04 +0800 Message-ID: <20210630023504.18177-25-yong.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20210630023504.18177-1-yong.wu@mediatek.com> References: <20210630023504.18177-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 3aaf425d5a18..435bb0fdd73f 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -1260,8 +1260,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