From: Rob Herring <robh@kernel.org>
To: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Cc: yong.wu@mediatek.com, joro@8bytes.org, will@kernel.org,
robin.murphy@arm.com, krzk+dt@kernel.org, conor+dt@kernel.org,
matthias.bgg@gmail.com, iommu@lists.linux.dev,
linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, kernel@collabora.com
Subject: Re: [PATCH v1 2/2] iommu/mediatek: Add support for Dimensity 1200 MT6893 MM IOMMU
Date: Tue, 20 May 2025 19:02:11 -0500 [thread overview]
Message-ID: <20250521000211.GA1717916-robh@kernel.org> (raw)
In-Reply-To: <20250410144008.475888-3-angelogioacchino.delregno@collabora.com>
On Thu, Apr 10, 2025 at 04:40:08PM +0200, AngeloGioacchino Del Regno wrote:
> Add support for the two MM IOMMUs found in the MediaTek Dimensity
> 1200 (MT6893) SoC, used for display, camera, imgsys and vpu.
>
> Since the MT6893 SoC is almost fully compatible with MT8192, also
> move the mt8192_larb_region_msk before the newly introduced mt6893
> platform data, as the larb regions from mt8192 are fully reused.
>
> Note that the only difference with MT8192 is that MT6893 needs the
> SHARE_PGTABLE flag.
>
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> ---
> drivers/iommu/mtk_iommu.c | 37 ++++++++++++++++++++++++++-----------
> 1 file changed, 26 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c
> index df98d0c65f54..0a54c6521bf5 100644
> --- a/drivers/iommu/mtk_iommu.c
> +++ b/drivers/iommu/mtk_iommu.c
> @@ -1550,6 +1550,31 @@ static const struct mtk_iommu_plat_data mt6795_data = {
> .larbid_remap = {{0}, {1}, {2}, {3}, {4}}, /* Linear mapping. */
> };
>
> +static const unsigned int mt8192_larb_region_msk[MT8192_MULTI_REGION_NR_MAX][MTK_LARB_NR_MAX] = {
> + [0] = {~0, ~0}, /* Region0: larb0/1 */
> + [1] = {0, 0, 0, 0, ~0, ~0, 0, ~0}, /* Region1: larb4/5/7 */
> + [2] = {0, 0, ~0, 0, 0, 0, 0, 0, /* Region2: larb2/9/11/13/14/16/17/18/19/20 */
> + 0, ~0, 0, ~0, 0, ~(u32)(BIT(9) | BIT(10)), ~(u32)(BIT(4) | BIT(5)), 0,
> + ~0, ~0, ~0, ~0, ~0},
> + [3] = {0},
> + [4] = {[13] = BIT(9) | BIT(10)}, /* larb13 port9/10 */
> + [5] = {[14] = BIT(4) | BIT(5)}, /* larb14 port4/5 */
> +};
> +
> +static const struct mtk_iommu_plat_data mt6893_data = {
> + .m4u_plat = M4U_MT8192,
> + .flags = HAS_BCLK | OUT_ORDER_WR_EN | HAS_SUB_COMM_2BITS |
> + WR_THROT_EN | IOVA_34_EN | SHARE_PGTABLE | MTK_IOMMU_TYPE_MM,
> + .inv_sel_reg = REG_MMU_INV_SEL_GEN2,
> + .banks_num = 1,
> + .banks_enable = {true},
> + .iova_region = mt8192_multi_dom,
> + .iova_region_nr = ARRAY_SIZE(mt8192_multi_dom),
> + .iova_region_larb_msk = mt8192_larb_region_msk,
> + .larbid_remap = {{0}, {1}, {4, 5}, {7}, {2}, {9, 11, 19, 20},
> + {0, 14, 16}, {0, 13, 18, 17}},
> +};
> +
> static const struct mtk_iommu_plat_data mt8167_data = {
> .m4u_plat = M4U_MT8167,
> .flags = RESET_AXI | HAS_LEGACY_IVRP_PADDR | MTK_IOMMU_TYPE_MM,
> @@ -1673,17 +1698,6 @@ static const struct mtk_iommu_plat_data mt8188_data_vpp = {
> 27, 28 /* ccu0 */, MTK_INVALID_LARBID}, {4, 6}},
> };
>
> -static const unsigned int mt8192_larb_region_msk[MT8192_MULTI_REGION_NR_MAX][MTK_LARB_NR_MAX] = {
> - [0] = {~0, ~0}, /* Region0: larb0/1 */
> - [1] = {0, 0, 0, 0, ~0, ~0, 0, ~0}, /* Region1: larb4/5/7 */
> - [2] = {0, 0, ~0, 0, 0, 0, 0, 0, /* Region2: larb2/9/11/13/14/16/17/18/19/20 */
> - 0, ~0, 0, ~0, 0, ~(u32)(BIT(9) | BIT(10)), ~(u32)(BIT(4) | BIT(5)), 0,
> - ~0, ~0, ~0, ~0, ~0},
> - [3] = {0},
> - [4] = {[13] = BIT(9) | BIT(10)}, /* larb13 port9/10 */
> - [5] = {[14] = BIT(4) | BIT(5)}, /* larb14 port4/5 */
> -};
> -
> static const struct mtk_iommu_plat_data mt8192_data = {
> .m4u_plat = M4U_MT8192,
> .flags = HAS_BCLK | HAS_SUB_COMM_2BITS | OUT_ORDER_WR_EN |
> @@ -1777,6 +1791,7 @@ static const struct of_device_id mtk_iommu_of_ids[] = {
> { .compatible = "mediatek,mt2712-m4u", .data = &mt2712_data},
> { .compatible = "mediatek,mt6779-m4u", .data = &mt6779_data},
> { .compatible = "mediatek,mt6795-m4u", .data = &mt6795_data},
> + { .compatible = "mediatek.mt6893-iommu-mm", .data = &mt6893_data},
Are you going to fix the typo> ^
It is still warning with 'make dt_compatible_check' that it is
undocumented.
Rob
next prev parent reply other threads:[~2025-05-21 0:02 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-10 14:40 [PATCH v1 0/2] MediaTek Dimensity 1200 - Add IOMMU support AngeloGioacchino Del Regno
2025-04-10 14:40 ` [PATCH v1 1/2] dt-bindings: iommu: mediatek: Add binding for MT6893 MM IOMMU AngeloGioacchino Del Regno
2025-04-11 17:27 ` Rob Herring
2025-04-10 14:40 ` [PATCH v1 2/2] iommu/mediatek: Add support for Dimensity 1200 " AngeloGioacchino Del Regno
2025-04-12 7:13 ` Yong Wu (吴勇)
2025-05-21 0:02 ` Rob Herring [this message]
2025-04-17 14:41 ` [PATCH v1 0/2] MediaTek Dimensity 1200 - Add IOMMU support Joerg Roedel
2025-04-28 16:02 ` Rob Herring
2025-04-28 16:04 ` Rob Herring
2025-04-29 7:19 ` Joerg Roedel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250521000211.GA1717916-robh@kernel.org \
--to=robh@kernel.org \
--cc=angelogioacchino.delregno@collabora.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=iommu@lists.linux.dev \
--cc=joro@8bytes.org \
--cc=kernel@collabora.com \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=robin.murphy@arm.com \
--cc=will@kernel.org \
--cc=yong.wu@mediatek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).