dt-bindings: iommu: Add binding for MediaTek MT8167 IOMMU
Subsystems (5)
PATCH v4 1/3 dt-bindings: iommu: Add binding for MediaTek MT8167 IOMMU
This commit adds IOMMU binding documentation and larb port definitions for the MT8167 SoC.
---
V4:
* Added path to mt8167 larb header file
* Added Honghui Zhang in copyright header
V3: Added mt8167-larb-port.h file for iommu port definitions
V2: no change
--- .../bindings/iommu/mediatek,iommu.txt | 2 + include/dt-bindings/memory/mt8167-larb-port.h | 51 +++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 include/dt-bindings/memory/mt8167-larb-port.h
Documentation/devicetree/bindings/iommu/mediatek,iommu.txt +2 -0
@@ -61,6 +61,7 @@ Required properties: "mediatek,mt6779-m4u" for mt6779 which uses generation two m4u HW. "mediatek,mt7623-m4u", "mediatek,mt2701-m4u" for mt7623 which uses generation one m4u HW. + "mediatek,mt8167-m4u" for mt8167 which uses generation two m4u HW. "mediatek,mt8173-m4u" for mt8173 which uses generation two m4u HW. "mediatek,mt8183-m4u" for mt8183 which uses generation two m4u HW. - reg : m4u register base and size.
@@ -80,6 +81,7 @@ Required properties: dt-binding/memory/mt2701-larb-port.h for mt2701, mt7623 dt-binding/memory/mt2712-larb-port.h for mt2712, dt-binding/memory/mt6779-larb-port.h for mt6779, + dt-binding/memory/mt8167-larb-port.h for mt8167, dt-binding/memory/mt8173-larb-port.h for mt8173, and dt-binding/memory/mt8183-larb-port.h for mt8183.
include/dt-bindings/memory/mt8167-larb-port.h new file +51 -0
51 lines not on this page · raw message
Signature · 6 lines
2.28.0 _______________________________________________ iommu mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/iommu
PATCH v4 2/3 iommu/mediatek: add flag for legacy ivrp paddr
Add a new flag in order to select which IVRP_PADDR format is used by an SoC.
---
v4: no change
v3: set LEGACY_IVRP_PADDR as a flag instead of platform data
v2: new patch
--- drivers/iommu/mtk_iommu.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/iommu/mtk_iommu.c +4 -2
@@ -116,6 +116,7 @@#define OUT_ORDER_WR_EN BIT(4)#define HAS_SUB_COMM BIT(5)#define WR_THROT_EN BIT(6) +#define HAS_LEGACY_IVRP_PADDR BIT(7)#define MTK_IOMMU_HAS_FLAG (pdata, _x) \ ((((pdata)->flags) & (_x)) == (_x))
@@ -582,7 +583,7 @@ static int mtk_iommu_hw_init(const struct mtk_iommu_data *data)F_INT_PRETETCH_TRANSATION_FIFO_FAULT ;writel_relaxed (regval, data->base +REG_MMU_INT_MAIN_CONTROL ); -if (data->plat_data->m4u_plat ==M4U_MT8173 ) +if (MTK_IOMMU_HAS_FLAG (data->plat_data,HAS_LEGACY_IVRP_PADDR )) regval = (data->protect_base >>1 ) | (data->enable_4GB <<31 );else regval = lower_32_bits(data->protect_base) |
@@ -818,7 +819,8 @@ static const struct mtk_iommu_plat_data mt6779_data = {static const struct mtk_iommu_plat_data mt8173_data = { .m4u_plat =M4U_MT8173 , - .flags =HAS_4GB_MODE |HAS_BCLK |RESET_AXI , + .flags =HAS_4GB_MODE |HAS_BCLK |RESET_AXI | +HAS_LEGACY_IVRP_PADDR , .inv_sel_reg =REG_MMU_INV_SEL_GEN1 , .larbid_remap = {{0 }, {1 }, {2 }, {3 }, {4 }, {5 }},/* Linear mapping. */ };
Signature · 6 lines
2.28.0 _______________________________________________ iommu mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/iommu
Re: [PATCH v4 2/3] iommu/mediatek: add flag for legacy ivrp paddr
Quoted 5 lines · Fabien Parent
Add a new flag in order to select which
IVRP_PADDRformat is used by an SoC.Signed-off-by Fabien Parent <[email protected]>Reviewed-by Yong Wu <[email protected]>
Quoted 33 lines
---
v4: no change
v3: setLEGACY_IVRP_PADDRas a flag instead of platform data
v2: new patch--- drivers/iommu/mtk_iommu.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)drivers/iommu/mtk_iommu.c +2
-1@@ -116,6 +116,7 @@#define OUT_ORDER_WR_EN BIT(4)#define HAS_SUB_COMM BIT(5)#define WR_THROT_EN BIT(6) +#define HAS_LEGACY_IVRP_PADDR BIT(7)#define MTK_IOMMU_HAS_FLAG (pdata, _x) \ ((((pdata)->flags) & (_x)) == (_x))@@ -582,7 +583,7 @@ static int mtk_iommu_hw_init(const struct mtk_iommu_data *data)F_INT_PRETETCH_TRANSATION_FIFO_FAULT ;writel_relaxed (regval, data->base +REG_MMU_INT_MAIN_CONTROL ); -if (data->plat_data->m4u_plat ==M4U_MT8173 ) +if (MTK_IOMMU_HAS_FLAG (data->plat_data,HAS_LEGACY_IVRP_PADDR )) regval = (data->protect_base >>1 ) | (data->enable_4GB <<31 );else regval = lower_32_bits(data->protect_base) |
drivers/iommu/mtk_iommu.c static const struct mtk_iommu_plat_data mt6779_data = { · line 826
Quoted 9 lines
drivers/iommu/mtk_iommu.c +2
-1@@ -818,7 +819,8 @@ static const struct mtk_iommu_plat_data mt6779_data = {static const struct mtk_iommu_plat_data mt8173_data = { .m4u_plat =M4U_MT8173 , - .flags =HAS_4GB_MODE |HAS_BCLK |RESET_AXI , + .flags =HAS_4GB_MODE |HAS_BCLK |RESET_AXI | +HAS_LEGACY_IVRP_PADDR , .inv_sel_reg =REG_MMU_INV_SEL_GEN1 , .larbid_remap = {{0 }, {1 }, {2 }, {3 }, {4 }, {5 }},/* Linear mapping. */ };
_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu
PATCH v4 3/3 iommu/mediatek: add support for MT8167
In reply to Fabien ParentAdd support for the IOMMU on MT8167
---
V4;
* Removed HAS_4GB_MODE flag since this SoC does not seem to support it
V3:
* use LEGACY_IVRP_PADDR flag instead of using a platform data member
V2:
* removed if based on m4u_plat, and using instead the new has_legacy_ivrp_paddr member that was introduced in patch 2.
--- drivers/iommu/mtk_iommu.c | 8 ++++++++ drivers/iommu/mtk_iommu.h | 1 + 2 files changed, 9 insertions(+)
drivers/iommu/mtk_iommu.c +8 -0
@@ -817,6 +817,13 @@ static const struct mtk_iommu_plat_data mt6779_data = { .larbid_remap = {{0}, {1}, {2}, {3}, {5}, {7, 8}, {10}, {9}}, }; +static const struct mtk_iommu_plat_data mt8167_data = { + .m4u_plat = M4U_MT8167, + .flags = RESET_AXI | HAS_LEGACY_IVRP_PADDR, + .inv_sel_reg = REG_MMU_INV_SEL_GEN1, + .larbid_remap = {{0}, {1}, {2}}, /* Linear mapping. */ +}; + static const struct mtk_iommu_plat_data mt8173_data = { .m4u_plat = M4U_MT8173, .flags = HAS_4GB_MODE | HAS_BCLK | RESET_AXI |
@@ -835,6 +842,7 @@ static const struct mtk_iommu_plat_data mt8183_data = {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,mt8167-m4u" , .data = &mt8167_data}, { .compatible ="mediatek,mt8173-m4u" , .data = &mt8173_data}, { .compatible ="mediatek,mt8183-m4u" , .data = &mt8183_data}, {}
drivers/iommu/mtk_iommu.h +1 -0
@@ -39,6 +39,7 @@ enum mtk_iommu_plat {M4U_MT2701 ,M4U_MT2712 ,M4U_MT6779 , +M4U_MT8167 ,M4U_MT8173 , M4U_MT8183, };
Signature · 6 lines
2.28.0 _______________________________________________ iommu mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/iommu
Re: [PATCH v4 3/3] iommu/mediatek: add support for MT8167
Quoted 3 lines · Fabien Parent
Add support for the IOMMU on MT8167
Signed-off-by Fabien Parent <[email protected]>
Quoted 46 lines
---
V4;
* RemovedHAS_4GB_MODEflag since this SoC does not seem to support it
V3:
* useLEGACY_IVRP_PADDRflag instead of using a platform data member
V2:
* removed if based onm4u_plat, and using instead the newhas_legacy_ivrp_paddrmember that was introduced in patch 2.--- drivers/iommu/mtk_iommu.c | 8 ++++++++ drivers/iommu/mtk_iommu.h | 1 + 2 files changed, 9 insertions(+)drivers/iommu/mtk_iommu.c +8
-0@@ -817,6 +817,13 @@ static const struct mtk_iommu_plat_data mt6779_data = { .larbid_remap = {{0}, {1}, {2}, {3}, {5}, {7, 8}, {10}, {9}}, }; +static const struct mtk_iommu_plat_data mt8167_data = { + .m4u_plat = M4U_MT8167, + .flags = RESET_AXI | HAS_LEGACY_IVRP_PADDR, + .inv_sel_reg = REG_MMU_INV_SEL_GEN1, + .larbid_remap = {{0}, {1}, {2}}, /* Linear mapping. */ +}; + static const struct mtk_iommu_plat_data mt8173_data = { .m4u_plat = M4U_MT8173, .flags = HAS_4GB_MODE | HAS_BCLK | RESET_AXI |@@ -835,6 +842,7 @@ static const struct mtk_iommu_plat_data mt8183_data = {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,mt8167-m4u" , .data = &mt8167_data}, { .compatible ="mediatek,mt8173-m4u" , .data = &mt8173_data}, { .compatible ="mediatek,mt8183-m4u" , .data = &mt8183_data}, {}drivers/iommu/mtk_iommu.h +0
-0
drivers/iommu/mtk_iommu.h enum mtk_iommu_plat { · line 45
Quoted 7 lines
drivers/iommu/mtk_iommu.h +1
-0@@ -39,6 +39,7 @@ enum mtk_iommu_plat {M4U_MT2701 ,M4U_MT2712 ,M4U_MT6779 , +M4U_MT8167 ,M4U_MT8173 , M4U_MT8183, };
_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu
Quoted 5 lines · Fabien Parent
This commit adds IOMMU binding documentation and larb port definitions for the MT8167 SoC.
Signed-off-by Fabien Parent <[email protected]>Acked-by Rob Herring <[email protected]>
Quoted 7 lines
---
V4:
* Added path to mt8167 larb header file
* Added Honghui Zhang in copyright header
V3: Addedmt8167-larb-port.hfile for iommu port definitions
V2: no change
Applied all, thanks.