From nobody Sun Sep 22 07:35:59 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BFAD4C433EF for ; Thu, 7 Apr 2022 08:04:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236366AbiDGIGM (ORCPT ); Thu, 7 Apr 2022 04:06:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242730AbiDGIFu (ORCPT ); Thu, 7 Apr 2022 04:05:50 -0400 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E29B61B3F6B; Thu, 7 Apr 2022 01:02:22 -0700 (PDT) X-UUID: 7ed996b0661e4a2eb3f2670fa6d65a6c-20220407 X-UUID: 7ed996b0661e4a2eb3f2670fa6d65a6c-20220407 Received: from mtkexhb02.mediatek.inc [(172.21.101.103)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1775206421; Thu, 07 Apr 2022 16:02:13 +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; Thu, 7 Apr 2022 16:02:11 +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; Thu, 7 Apr 2022 16:02:10 +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 v6 34/34] iommu/mediatek: mt8195: Enable multi banks for infra iommu Date: Thu, 7 Apr 2022 15:57:26 +0800 Message-ID: <20220407075726.17771-35-yong.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20220407075726.17771-1-yong.wu@mediatek.com> References: <20220407075726.17771-1-yong.wu@mediatek.com> MIME-Version: 1.0 X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: AngeloGioacchino Del Regno --- 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 027bbbced80d..22c95ed78b3c 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -1449,8 +1449,11 @@ static const struct mtk_iommu_plat_data mt8195_data_= infra =3D { MTK_IOMMU_TYPE_INFRA | IFA_IOMMU_PCIE_SUPPORT, .pericfg_comp_str =3D "mediatek,mt8195-pericfg_ao", .inv_sel_reg =3D REG_MMU_INV_SEL_GEN2, - .banks_num =3D 1, - .banks_enable =3D {true}, + .banks_num =3D 5, + .banks_enable =3D {true, false, false, false, true}, + .banks_portmsk =3D {[0] =3D GENMASK(19, 16), /* PCIe */ + [4] =3D GENMASK(31, 20), /* USB */ + }, .iova_region =3D single_domain, .iova_region_nr =3D ARRAY_SIZE(single_domain), }; --=20 2.18.0