From: Flora Fu <flora.fu@mediatek.com>
To: Matthias Brugger <matthias.bgg@gmail.com>,
Pi-Cheng Chen <pi-cheng.chen@mediatek.com>,
Yong Wu <yong.wu@mediatek.com>
Cc: <linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-mediatek@lists.infradead.org>,
Flora Fu <flora.fu@mediatek.com>,
"JB Tsai" <jb.tsai@mediatek.com>
Subject: [PATCH 04/12] iommu/mediatek: Add APU iommu data for mt8195
Date: Sat, 11 Dec 2021 01:52:15 +0800 [thread overview]
Message-ID: <20211210175223.31131-5-flora.fu@mediatek.com> (raw)
In-Reply-To: <20211210175223.31131-1-flora.fu@mediatek.com>
Add hardware settins for support mt8195 apu iommu.
Signed-off-by: Yong Wu <yong.wu@mediatek.com>
Signed-off-by: Flora Fu <flora.fu@mediatek.com>
---
drivers/iommu/mtk_iommu.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c
index 4bc7c76062e6..3fda9ad9f925 100644
--- a/drivers/iommu/mtk_iommu.c
+++ b/drivers/iommu/mtk_iommu.c
@@ -218,6 +218,13 @@ static const struct mtk_iommu_iova_region mt8192_multi_dom_apu[] = {
{ .iova_base = 0x70000000ULL, .size = 0x12600000}, /* APU REG */
};
+static const struct mtk_iommu_iova_region mt8195_multi_dom_apu[] = {
+ { .iova_base = 0x0, .size = SZ_4G}, /* APU DATA */
+ { .iova_base = 0x8000000ULL, .size = 0x8000000}, /* APU VLM */
+ { .iova_base = 0x20000000ULL, .size = 0xe0000000}, /* APU VPU */
+ { .iova_base = 0x70000000ULL, .size = 0x12600000}, /* APU REG */
+};
+
/* If 2 M4U share a domain(use the same hwlist), Put the corresponding info in first data.*/
static struct mtk_iommu_data *mtk_iommu_get_frst_data(struct list_head *hwlist)
{
@@ -1312,6 +1319,18 @@ static const struct mtk_iommu_plat_data mt8192_data_apu = {
.iova_region_nr = ARRAY_SIZE(mt8192_multi_dom_apu),
};
+static const struct mtk_iommu_plat_data mt8195_data_apu = {
+ .m4u_plat = M4U_MT8195,
+ .flags = DCM_DISABLE | MTK_IOMMU_TYPE_APU |
+ SHARE_PGTABLE,
+ .inv_sel_reg = REG_MMU_INV_SEL_GEN2,
+ .hw_list = &apulist,
+ .bank_nr = 1,
+ .bank_enable = {true},
+ .iova_region = mt8195_multi_dom_apu,
+ .iova_region_nr = ARRAY_SIZE(mt8195_multi_dom_apu),
+};
+
static const struct mtk_iommu_plat_data mt8195_data_infra = {
.m4u_plat = M4U_MT8195,
.flags = WR_THROT_EN | DCM_DISABLE |
@@ -1368,6 +1387,7 @@ static const struct of_device_id mtk_iommu_of_ids[] = {
{ .compatible = "mediatek,mt8183-m4u", .data = &mt8183_data},
{ .compatible = "mediatek,mt8192-m4u", .data = &mt8192_data},
{ .compatible = "mediatek,mt8192-iommu-apu", .data = &mt8192_data_apu},
+ { .compatible = "mediatek,mt8195-iommu-apu", .data = &mt8195_data_apu},
{ .compatible = "mediatek,mt8195-iommu-infra", .data = &mt8195_data_infra},
{ .compatible = "mediatek,mt8195-iommu-vdo", .data = &mt8195_data_vdo},
{ .compatible = "mediatek,mt8195-iommu-vpp", .data = &mt8195_data_vpp},
--
2.18.0
next prev parent reply other threads:[~2021-12-10 17:53 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-10 17:52 [PATCH 00/12] MediaTek MT8195 APU Flora Fu
2021-12-10 17:52 ` [PATCH 01/12] dt-bindings: memory: mediatek: Add MT8195 apu iommu bindings Flora Fu
2021-12-10 17:52 ` [PATCH 02/12] dt-bindings: remoteproc: mediatek: Add MT8195 in apu rproc Flora Fu
2021-12-10 17:52 ` [PATCH 03/12] dt-bindings: soc: mediatek: apu: Add MT8195 APU power bindings Flora Fu
2021-12-10 17:52 ` Flora Fu [this message]
2021-12-10 17:52 ` [PATCH 05/12] remoteproc: mediatek: Add MT8195 APU remoteproc support Flora Fu
2021-12-10 17:52 ` [PATCH 06/12] soc: mediatek: apu: Add MT8195 APU power driver Flora Fu
2021-12-10 17:52 ` [PATCH 07/12] arm64: dts: mt8195: Add APU mtk-apu-mailbox node Flora Fu
2021-12-10 17:52 ` [PATCH 08/12] arm64: dts: mt8195: Add APU-IOMMU nodes Flora Fu
2021-12-10 17:52 ` [PATCH 09/12] arm64: dts: mt8195: Add apu tinysys node Flora Fu
2021-12-10 17:52 ` [PATCH 10/12] arm64: dts: mt8195: Add APU power nodes Flora Fu
2021-12-10 17:52 ` [PATCH 11/12] arm64: dts: mt8195: Add apu-sw-logger node Flora Fu
2021-12-10 17:52 ` [PATCH 12/12] arm64: dts: mt8195: Set up regulators for APU subsys Flora Fu
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=20211210175223.31131-5-flora.fu@mediatek.com \
--to=flora.fu@mediatek.com \
--cc=jb.tsai@mediatek.com \
--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=pi-cheng.chen@mediatek.com \
--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