From nobody Sun Sep 22 09:29:06 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 270D4C433EF for ; Thu, 17 Feb 2022 11:36:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239896AbiBQLgs (ORCPT ); Thu, 17 Feb 2022 06:36:48 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:40586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239887AbiBQLgo (ORCPT ); Thu, 17 Feb 2022 06:36:44 -0500 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B820E64CD; Thu, 17 Feb 2022 03:36:29 -0800 (PST) X-UUID: c4b68df975954b8385d21a950d25f375-20220217 X-UUID: c4b68df975954b8385d21a950d25f375-20220217 Received: from mtkmbs10n1.mediatek.inc [(172.21.101.34)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1031520529; Thu, 17 Feb 2022 19:36:27 +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:36:25 +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:36:24 +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 09/34] iommu/mediatek: Add 12G~16G support for multi domains Date: Thu, 17 Feb 2022 19:34:28 +0800 Message-ID: <20220217113453.13658-10-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" In mt8192, we preassign 0-4G; 4G-8G; 8G-12G for different multimedia engines. This depends on the "dma-ranges=3D" in the iommu consumer's dtsi node. Adds 12G-16G region here. and reword the previous comment. we don't limit which master locate in which region. CCU still is 8G-12G. Don't change it here. Signed-off-by: Yong Wu Reviewed-by: AngeloGioacchino Del Regno --- drivers/iommu/mtk_iommu.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index c8fb9c8d8c65..a4042b702e6a 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -180,10 +180,12 @@ static const struct mtk_iommu_iova_region single_doma= in[] =3D { }; =20 static const struct mtk_iommu_iova_region mt8192_multi_dom[] =3D { - { .iova_base =3D 0x0, .size =3D SZ_4G}, /* disp: 0 ~ 4G */ + { .iova_base =3D 0x0, .size =3D SZ_4G}, /* 0 ~ 4G */ #if IS_ENABLED(CONFIG_ARCH_DMA_ADDR_T_64BIT) - { .iova_base =3D SZ_4G, .size =3D SZ_4G}, /* vdec: 4G ~ 8G */ - { .iova_base =3D SZ_4G * 2, .size =3D SZ_4G}, /* CAM/MDP: 8G ~ 12G */ + { .iova_base =3D SZ_4G, .size =3D SZ_4G}, /* 4G ~ 8G */ + { .iova_base =3D SZ_4G * 2, .size =3D SZ_4G}, /* 8G ~ 12G */ + { .iova_base =3D SZ_4G * 3, .size =3D SZ_4G}, /* 12G ~ 16G */ + { .iova_base =3D 0x240000000ULL, .size =3D 0x4000000}, /* CCU0 */ { .iova_base =3D 0x244000000ULL, .size =3D 0x4000000}, /* CCU1 */ #endif --=20 2.18.0