Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp504762pxb; Thu, 23 Sep 2021 05:06:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzPSQFJtYMO8t7pkbkddk8wJlyU/5eE4ZhcAfUnQM2vVZnEQqb5QV6c3zR2GP+MTRFlk9DH X-Received: by 2002:a2e:83cf:: with SMTP id s15mr4840255ljh.476.1632398791102; Thu, 23 Sep 2021 05:06:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632398791; cv=none; d=google.com; s=arc-20160816; b=T7gnnG3TROTn0yw8+zkK964Kj688NKY/Q8G7ZG/Q+V3CGnao/0fFGpwdO54QgbyZKb pX773qAM/NhTVIEe/wYjof+0jUOlxNTZDvQm/xTyOrqOdnjMysYKQKlu3KSOWVkCXmuM zaAXdvJHXS42ZeHqmrceYRn/op+K2pI6xhtNytL+r1pw2dyuvlwgwnkGq6XYUsYSh26O qn+fpDEWbV8W7nJKSfJuFZWPhqo+cBNSf8DDdKz8QnZojFXjlBb4YbqC9+DsvIWfCwVu elV3SMQ5BdysuI8ljgF6RMPGiznF79wKbYyqrWkLh8CIDz/10KMcZZqm2lY1GkrGc5No tqsg== 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=3YOcc0b05OZK/JUdMRReNN+RAb4GQytrFTYZPqz3WpA=; b=V4ha7dQM0TX7Sx9VOt4AHFpokRwsxkmLB86MpN5x/UUMcyzRkkT3F/9qeU/XC5fKAw bhV8QjAuPN0uZsxkzPOCD7LZnw8NjrFAYPGlIy4bH4boee8dObvTMZw0Kk+6Efr8jn8U wApJWiKbFLb508YyGk62T49XW31IrkVLrBAPZSzymxn2iCL1z9YCu0LxKsWUgmSARg0G UtIfvXCBrZSVOkqE0rLmGC8ZhXhh1Ml1WWymDqxx1fXZaeCyXJk0k8OilymMhqsNzbvb TNqzgqQcaRv02zMtaUNG3SkzpX1yyR1fRYnocNVTpRbjiNQizTieUrlRN+1ACRffXAzU 2UoQ== 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 p17si5601101edy.229.2021.09.23.05.06.06; Thu, 23 Sep 2021 05:06:31 -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 S241009AbhIWMFe (ORCPT + 99 others); Thu, 23 Sep 2021 08:05:34 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:55896 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S241001AbhIWMF3 (ORCPT ); Thu, 23 Sep 2021 08:05:29 -0400 X-UUID: d698e36c4f574aafa073f6012dcfb7b3-20210923 X-UUID: d698e36c4f574aafa073f6012dcfb7b3-20210923 Received: from mtkexhb01.mediatek.inc [(172.21.101.102)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1303560306; Thu, 23 Sep 2021 20:03:55 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs07n1.mediatek.inc (172.21.101.16) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 23 Sep 2021 20:03:53 +0800 Received: from localhost.localdomain (10.17.3.154) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 23 Sep 2021 20:03:53 +0800 From: Yong Wu To: Joerg Roedel , Rob Herring , Matthias Brugger , Will Deacon , Robin Murphy CC: Krzysztof Kozlowski , Tomasz Figa , , , , , , , Hsin-Yi Wang , , , , , Subject: [PATCH v3 33/33] iommu/mediatek: mt8195: Enable multi banks for infra iommu Date: Thu, 23 Sep 2021 19:58:40 +0800 Message-ID: <20210923115840.17813-34-yong.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20210923115840.17813-1-yong.wu@mediatek.com> References: <20210923115840.17813-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 3cb18ed28132..90be8ebbc98a 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -1273,8 +1273,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