From nobody Sun Sep 22 09:36:51 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 8F701C433F5 for ; Thu, 17 Feb 2022 11:41:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240111AbiBQLlW (ORCPT ); Thu, 17 Feb 2022 06:41:22 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:57062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240246AbiBQLk6 (ORCPT ); Thu, 17 Feb 2022 06:40:58 -0500 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC2E724BF9; Thu, 17 Feb 2022 03:40:44 -0800 (PST) X-UUID: 703c41c94143403296040a888cc5b8dd-20220217 X-UUID: 703c41c94143403296040a888cc5b8dd-20220217 Received: from mtkcas10.mediatek.inc [(172.21.101.39)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1646086001; Thu, 17 Feb 2022 19:40:42 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) 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; Thu, 17 Feb 2022 19:40:40 +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, 17 Feb 2022 19:40:39 +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 v5 34/34] iommu/mediatek: mt8195: Enable multi banks for infra iommu Date: Thu, 17 Feb 2022 19:34:53 +0800 Message-ID: <20220217113453.13658-35-yong.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20220217113453.13658-1-yong.wu@mediatek.com> References: <20220217113453.13658-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 d3b6c80bf51a..d9ca9ffe404c 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -1458,8 +1458,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