All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/5] mtk_iommu: Specify phandles to infracfg and pericfg
@ 2022-06-16 11:08 ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 36+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-06-16 11:08 UTC (permalink / raw)
  To: yong.wu
  Cc: joro, will, robh+dt, krzysztof.kozlowski+dt, matthias.bgg, iommu,
	linux-mediatek, devicetree, linux-kernel, linux-arm-kernel,
	krzysztof.kozlowski, miles.chen, AngeloGioacchino Del Regno

The IOMMU has registers in the infracfg and/or pericfg iospaces: as
for the currently supported SoCs, MT2712 and MT8173 need a phandle to
infracfg, while MT8195 needs one to pericfg.

Before this change, the driver was checking for a SoC-specific infra/peri
compatible but, sooner or later, these lists are going to grow a lot...
...and this is why it was chosen to add phandles (as it was done with
some other drivers already - look at mtk-pm-domains, mt8192-afe

Please note that, while it was necessary to update the devicetrees for
MT8173 and MT2712e, there was no update for MT8195 because there is no
IOMMU node in there yet.

Changes in v4:
 - Dropped changes introducing mediatek,pericfg handle
 - Fixed required property in IOMMU example in patch [1/5]
 - Added a pericfg lookup flow cleanup commit

Changes in v3:
 - Different squashing of dt-bindings patches (sorry for misunderstanding!)
 - Removed legacy devicetree print

Changes in v2:
 - Squashed dt-bindings patches as suggested by Matthias
 - Removed quotes from infra/peri phandle refs
 - Changed dev_warn to dev_info in patches [2/7], [3/7]

AngeloGioacchino Del Regno (5):
  dt-bindings: iommu: mediatek: Add mediatek,infracfg phandle
  iommu/mediatek: Lookup phandle to retrieve syscon to infracfg
  arm64: dts: mediatek: mt8173: Add mediatek,infracfg phandle for IOMMU
  arm64: dts: mediatek: mt2712e: Add mediatek,infracfg phandle for IOMMU
  iommu/mediatek: Cleanup pericfg lookup flow

 .../bindings/iommu/mediatek,iommu.yaml        | 17 +++++++
 arch/arm64/boot/dts/mediatek/mt2712e.dtsi     |  2 +
 arch/arm64/boot/dts/mediatek/mt8173.dtsi      |  1 +
 drivers/iommu/mtk_iommu.c                     | 50 +++++++++++--------
 4 files changed, 49 insertions(+), 21 deletions(-)

-- 
2.35.1


^ permalink raw reply	[flat|nested] 36+ messages in thread

* [PATCH v4 0/5] mtk_iommu: Specify phandles to infracfg and pericfg
@ 2022-06-16 11:08 ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 36+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-06-16 11:08 UTC (permalink / raw)
  To: yong.wu
  Cc: devicetree, linux-kernel, krzysztof.kozlowski, iommu, robh+dt,
	linux-mediatek, krzysztof.kozlowski+dt, miles.chen, matthias.bgg,
	will, linux-arm-kernel, AngeloGioacchino Del Regno

The IOMMU has registers in the infracfg and/or pericfg iospaces: as
for the currently supported SoCs, MT2712 and MT8173 need a phandle to
infracfg, while MT8195 needs one to pericfg.

Before this change, the driver was checking for a SoC-specific infra/peri
compatible but, sooner or later, these lists are going to grow a lot...
...and this is why it was chosen to add phandles (as it was done with
some other drivers already - look at mtk-pm-domains, mt8192-afe

Please note that, while it was necessary to update the devicetrees for
MT8173 and MT2712e, there was no update for MT8195 because there is no
IOMMU node in there yet.

Changes in v4:
 - Dropped changes introducing mediatek,pericfg handle
 - Fixed required property in IOMMU example in patch [1/5]
 - Added a pericfg lookup flow cleanup commit

Changes in v3:
 - Different squashing of dt-bindings patches (sorry for misunderstanding!)
 - Removed legacy devicetree print

Changes in v2:
 - Squashed dt-bindings patches as suggested by Matthias
 - Removed quotes from infra/peri phandle refs
 - Changed dev_warn to dev_info in patches [2/7], [3/7]

AngeloGioacchino Del Regno (5):
  dt-bindings: iommu: mediatek: Add mediatek,infracfg phandle
  iommu/mediatek: Lookup phandle to retrieve syscon to infracfg
  arm64: dts: mediatek: mt8173: Add mediatek,infracfg phandle for IOMMU
  arm64: dts: mediatek: mt2712e: Add mediatek,infracfg phandle for IOMMU
  iommu/mediatek: Cleanup pericfg lookup flow

 .../bindings/iommu/mediatek,iommu.yaml        | 17 +++++++
 arch/arm64/boot/dts/mediatek/mt2712e.dtsi     |  2 +
 arch/arm64/boot/dts/mediatek/mt8173.dtsi      |  1 +
 drivers/iommu/mtk_iommu.c                     | 50 +++++++++++--------
 4 files changed, 49 insertions(+), 21 deletions(-)

-- 
2.35.1

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [PATCH v4 0/5] mtk_iommu: Specify phandles to infracfg and pericfg
@ 2022-06-16 11:08 ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 36+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-06-16 11:08 UTC (permalink / raw)
  To: yong.wu
  Cc: joro, will, robh+dt, krzysztof.kozlowski+dt, matthias.bgg, iommu,
	linux-mediatek, devicetree, linux-kernel, linux-arm-kernel,
	krzysztof.kozlowski, miles.chen, AngeloGioacchino Del Regno

The IOMMU has registers in the infracfg and/or pericfg iospaces: as
for the currently supported SoCs, MT2712 and MT8173 need a phandle to
infracfg, while MT8195 needs one to pericfg.

Before this change, the driver was checking for a SoC-specific infra/peri
compatible but, sooner or later, these lists are going to grow a lot...
...and this is why it was chosen to add phandles (as it was done with
some other drivers already - look at mtk-pm-domains, mt8192-afe

Please note that, while it was necessary to update the devicetrees for
MT8173 and MT2712e, there was no update for MT8195 because there is no
IOMMU node in there yet.

Changes in v4:
 - Dropped changes introducing mediatek,pericfg handle
 - Fixed required property in IOMMU example in patch [1/5]
 - Added a pericfg lookup flow cleanup commit

Changes in v3:
 - Different squashing of dt-bindings patches (sorry for misunderstanding!)
 - Removed legacy devicetree print

Changes in v2:
 - Squashed dt-bindings patches as suggested by Matthias
 - Removed quotes from infra/peri phandle refs
 - Changed dev_warn to dev_info in patches [2/7], [3/7]

AngeloGioacchino Del Regno (5):
  dt-bindings: iommu: mediatek: Add mediatek,infracfg phandle
  iommu/mediatek: Lookup phandle to retrieve syscon to infracfg
  arm64: dts: mediatek: mt8173: Add mediatek,infracfg phandle for IOMMU
  arm64: dts: mediatek: mt2712e: Add mediatek,infracfg phandle for IOMMU
  iommu/mediatek: Cleanup pericfg lookup flow

 .../bindings/iommu/mediatek,iommu.yaml        | 17 +++++++
 arch/arm64/boot/dts/mediatek/mt2712e.dtsi     |  2 +
 arch/arm64/boot/dts/mediatek/mt8173.dtsi      |  1 +
 drivers/iommu/mtk_iommu.c                     | 50 +++++++++++--------
 4 files changed, 49 insertions(+), 21 deletions(-)

-- 
2.35.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [PATCH v4 1/5] dt-bindings: iommu: mediatek: Add mediatek,infracfg phandle
  2022-06-16 11:08 ` AngeloGioacchino Del Regno
  (?)
@ 2022-06-16 11:08   ` AngeloGioacchino Del Regno
  -1 siblings, 0 replies; 36+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-06-16 11:08 UTC (permalink / raw)
  To: yong.wu
  Cc: joro, will, robh+dt, krzysztof.kozlowski+dt, matthias.bgg, iommu,
	linux-mediatek, devicetree, linux-kernel, linux-arm-kernel,
	krzysztof.kozlowski, miles.chen, AngeloGioacchino Del Regno

Add property "mediatek,infracfg" to let the mtk_iommu driver retrieve
a phandle to the infracfg syscon instead of performing a per-soc
compatible lookup in the entire devicetree and set it as a required
property for MT2712 and MT8173.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
 .../bindings/iommu/mediatek,iommu.yaml          | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml b/Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml
index 2ae3bbad7f1a..fee0241b5098 100644
--- a/Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml
+++ b/Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml
@@ -101,6 +101,10 @@ properties:
     items:
       - const: bclk
 
+  mediatek,infracfg:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description: The phandle to the mediatek infracfg syscon
+
   mediatek,larbs:
     $ref: /schemas/types.yaml#/definitions/phandle-array
     minItems: 1
@@ -167,6 +171,18 @@ allOf:
       required:
         - power-domains
 
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - mediatek,mt2712-m4u
+              - mediatek,mt8173-m4u
+
+    then:
+      required:
+        - mediatek,infracfg
+
   - if: # The IOMMUs don't have larbs.
       not:
         properties:
@@ -191,6 +207,7 @@ examples:
             interrupts = <GIC_SPI 139 IRQ_TYPE_LEVEL_LOW>;
             clocks = <&infracfg CLK_INFRA_M4U>;
             clock-names = "bclk";
+            mediatek,infracfg = <&infracfg>;
             mediatek,larbs = <&larb0>, <&larb1>, <&larb2>,
                              <&larb3>, <&larb4>, <&larb5>;
             #iommu-cells = <1>;
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH v4 1/5] dt-bindings: iommu: mediatek: Add mediatek, infracfg phandle
@ 2022-06-16 11:08   ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 36+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-06-16 11:08 UTC (permalink / raw)
  To: yong.wu
  Cc: devicetree, linux-kernel, krzysztof.kozlowski, iommu, robh+dt,
	linux-mediatek, krzysztof.kozlowski+dt, miles.chen, matthias.bgg,
	will, linux-arm-kernel, AngeloGioacchino Del Regno

Add property "mediatek,infracfg" to let the mtk_iommu driver retrieve
a phandle to the infracfg syscon instead of performing a per-soc
compatible lookup in the entire devicetree and set it as a required
property for MT2712 and MT8173.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
 .../bindings/iommu/mediatek,iommu.yaml          | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml b/Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml
index 2ae3bbad7f1a..fee0241b5098 100644
--- a/Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml
+++ b/Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml
@@ -101,6 +101,10 @@ properties:
     items:
       - const: bclk
 
+  mediatek,infracfg:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description: The phandle to the mediatek infracfg syscon
+
   mediatek,larbs:
     $ref: /schemas/types.yaml#/definitions/phandle-array
     minItems: 1
@@ -167,6 +171,18 @@ allOf:
       required:
         - power-domains
 
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - mediatek,mt2712-m4u
+              - mediatek,mt8173-m4u
+
+    then:
+      required:
+        - mediatek,infracfg
+
   - if: # The IOMMUs don't have larbs.
       not:
         properties:
@@ -191,6 +207,7 @@ examples:
             interrupts = <GIC_SPI 139 IRQ_TYPE_LEVEL_LOW>;
             clocks = <&infracfg CLK_INFRA_M4U>;
             clock-names = "bclk";
+            mediatek,infracfg = <&infracfg>;
             mediatek,larbs = <&larb0>, <&larb1>, <&larb2>,
                              <&larb3>, <&larb4>, <&larb5>;
             #iommu-cells = <1>;
-- 
2.35.1

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH v4 1/5] dt-bindings: iommu: mediatek: Add mediatek,infracfg phandle
@ 2022-06-16 11:08   ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 36+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-06-16 11:08 UTC (permalink / raw)
  To: yong.wu
  Cc: joro, will, robh+dt, krzysztof.kozlowski+dt, matthias.bgg, iommu,
	linux-mediatek, devicetree, linux-kernel, linux-arm-kernel,
	krzysztof.kozlowski, miles.chen, AngeloGioacchino Del Regno

Add property "mediatek,infracfg" to let the mtk_iommu driver retrieve
a phandle to the infracfg syscon instead of performing a per-soc
compatible lookup in the entire devicetree and set it as a required
property for MT2712 and MT8173.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
 .../bindings/iommu/mediatek,iommu.yaml          | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml b/Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml
index 2ae3bbad7f1a..fee0241b5098 100644
--- a/Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml
+++ b/Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml
@@ -101,6 +101,10 @@ properties:
     items:
       - const: bclk
 
+  mediatek,infracfg:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description: The phandle to the mediatek infracfg syscon
+
   mediatek,larbs:
     $ref: /schemas/types.yaml#/definitions/phandle-array
     minItems: 1
@@ -167,6 +171,18 @@ allOf:
       required:
         - power-domains
 
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - mediatek,mt2712-m4u
+              - mediatek,mt8173-m4u
+
+    then:
+      required:
+        - mediatek,infracfg
+
   - if: # The IOMMUs don't have larbs.
       not:
         properties:
@@ -191,6 +207,7 @@ examples:
             interrupts = <GIC_SPI 139 IRQ_TYPE_LEVEL_LOW>;
             clocks = <&infracfg CLK_INFRA_M4U>;
             clock-names = "bclk";
+            mediatek,infracfg = <&infracfg>;
             mediatek,larbs = <&larb0>, <&larb1>, <&larb2>,
                              <&larb3>, <&larb4>, <&larb5>;
             #iommu-cells = <1>;
-- 
2.35.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH v4 2/5] iommu/mediatek: Lookup phandle to retrieve syscon to infracfg
  2022-06-16 11:08 ` AngeloGioacchino Del Regno
  (?)
@ 2022-06-16 11:08   ` AngeloGioacchino Del Regno
  -1 siblings, 0 replies; 36+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-06-16 11:08 UTC (permalink / raw)
  To: yong.wu
  Cc: joro, will, robh+dt, krzysztof.kozlowski+dt, matthias.bgg, iommu,
	linux-mediatek, devicetree, linux-kernel, linux-arm-kernel,
	krzysztof.kozlowski, miles.chen, AngeloGioacchino Del Regno

This driver will get support for more SoCs and the list of infracfg
compatibles is expected to grow: in order to prevent getting this
situation out of control and see a long list of compatible strings,
add support to retrieve a handle to infracfg's regmap through a
new "mediatek,infracfg" phandle.

In order to keep retrocompatibility with older devicetrees, the old
way is kept in place.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Miles Chen <miles.chen@mediatek.com>
Reviewed-by: Yong Wu <yong.wu@mediatek.com>
Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
---
 drivers/iommu/mtk_iommu.c | 38 ++++++++++++++++++++++++--------------
 1 file changed, 24 insertions(+), 14 deletions(-)

diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c
index bb9dd92c9898..90685946fcbe 100644
--- a/drivers/iommu/mtk_iommu.c
+++ b/drivers/iommu/mtk_iommu.c
@@ -1140,22 +1140,32 @@ static int mtk_iommu_probe(struct platform_device *pdev)
 	data->protect_base = ALIGN(virt_to_phys(protect), MTK_PROTECT_PA_ALIGN);
 
 	if (MTK_IOMMU_HAS_FLAG(data->plat_data, HAS_4GB_MODE)) {
-		switch (data->plat_data->m4u_plat) {
-		case M4U_MT2712:
-			p = "mediatek,mt2712-infracfg";
-			break;
-		case M4U_MT8173:
-			p = "mediatek,mt8173-infracfg";
-			break;
-		default:
-			p = NULL;
+		infracfg = syscon_regmap_lookup_by_phandle(dev->of_node, "mediatek,infracfg");
+		if (IS_ERR(infracfg)) {
+			/*
+			 * Legacy devicetrees will not specify a phandle to
+			 * mediatek,infracfg: in that case, we use the older
+			 * way to retrieve a syscon to infra.
+			 *
+			 * This is for retrocompatibility purposes only, hence
+			 * no more compatibles shall be added to this.
+			 */
+			switch (data->plat_data->m4u_plat) {
+			case M4U_MT2712:
+				p = "mediatek,mt2712-infracfg";
+				break;
+			case M4U_MT8173:
+				p = "mediatek,mt8173-infracfg";
+				break;
+			default:
+				p = NULL;
+			}
+
+			infracfg = syscon_regmap_lookup_by_compatible(p);
+			if (IS_ERR(infracfg))
+				return PTR_ERR(infracfg);
 		}
 
-		infracfg = syscon_regmap_lookup_by_compatible(p);
-
-		if (IS_ERR(infracfg))
-			return PTR_ERR(infracfg);
-
 		ret = regmap_read(infracfg, REG_INFRA_MISC, &val);
 		if (ret)
 			return ret;
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH v4 2/5] iommu/mediatek: Lookup phandle to retrieve syscon to infracfg
@ 2022-06-16 11:08   ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 36+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-06-16 11:08 UTC (permalink / raw)
  To: yong.wu
  Cc: devicetree, linux-kernel, krzysztof.kozlowski, iommu, robh+dt,
	linux-mediatek, krzysztof.kozlowski+dt, miles.chen, matthias.bgg,
	will, linux-arm-kernel, AngeloGioacchino Del Regno

This driver will get support for more SoCs and the list of infracfg
compatibles is expected to grow: in order to prevent getting this
situation out of control and see a long list of compatible strings,
add support to retrieve a handle to infracfg's regmap through a
new "mediatek,infracfg" phandle.

In order to keep retrocompatibility with older devicetrees, the old
way is kept in place.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Miles Chen <miles.chen@mediatek.com>
Reviewed-by: Yong Wu <yong.wu@mediatek.com>
Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
---
 drivers/iommu/mtk_iommu.c | 38 ++++++++++++++++++++++++--------------
 1 file changed, 24 insertions(+), 14 deletions(-)

diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c
index bb9dd92c9898..90685946fcbe 100644
--- a/drivers/iommu/mtk_iommu.c
+++ b/drivers/iommu/mtk_iommu.c
@@ -1140,22 +1140,32 @@ static int mtk_iommu_probe(struct platform_device *pdev)
 	data->protect_base = ALIGN(virt_to_phys(protect), MTK_PROTECT_PA_ALIGN);
 
 	if (MTK_IOMMU_HAS_FLAG(data->plat_data, HAS_4GB_MODE)) {
-		switch (data->plat_data->m4u_plat) {
-		case M4U_MT2712:
-			p = "mediatek,mt2712-infracfg";
-			break;
-		case M4U_MT8173:
-			p = "mediatek,mt8173-infracfg";
-			break;
-		default:
-			p = NULL;
+		infracfg = syscon_regmap_lookup_by_phandle(dev->of_node, "mediatek,infracfg");
+		if (IS_ERR(infracfg)) {
+			/*
+			 * Legacy devicetrees will not specify a phandle to
+			 * mediatek,infracfg: in that case, we use the older
+			 * way to retrieve a syscon to infra.
+			 *
+			 * This is for retrocompatibility purposes only, hence
+			 * no more compatibles shall be added to this.
+			 */
+			switch (data->plat_data->m4u_plat) {
+			case M4U_MT2712:
+				p = "mediatek,mt2712-infracfg";
+				break;
+			case M4U_MT8173:
+				p = "mediatek,mt8173-infracfg";
+				break;
+			default:
+				p = NULL;
+			}
+
+			infracfg = syscon_regmap_lookup_by_compatible(p);
+			if (IS_ERR(infracfg))
+				return PTR_ERR(infracfg);
 		}
 
-		infracfg = syscon_regmap_lookup_by_compatible(p);
-
-		if (IS_ERR(infracfg))
-			return PTR_ERR(infracfg);
-
 		ret = regmap_read(infracfg, REG_INFRA_MISC, &val);
 		if (ret)
 			return ret;
-- 
2.35.1

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH v4 2/5] iommu/mediatek: Lookup phandle to retrieve syscon to infracfg
@ 2022-06-16 11:08   ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 36+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-06-16 11:08 UTC (permalink / raw)
  To: yong.wu
  Cc: joro, will, robh+dt, krzysztof.kozlowski+dt, matthias.bgg, iommu,
	linux-mediatek, devicetree, linux-kernel, linux-arm-kernel,
	krzysztof.kozlowski, miles.chen, AngeloGioacchino Del Regno

This driver will get support for more SoCs and the list of infracfg
compatibles is expected to grow: in order to prevent getting this
situation out of control and see a long list of compatible strings,
add support to retrieve a handle to infracfg's regmap through a
new "mediatek,infracfg" phandle.

In order to keep retrocompatibility with older devicetrees, the old
way is kept in place.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Miles Chen <miles.chen@mediatek.com>
Reviewed-by: Yong Wu <yong.wu@mediatek.com>
Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
---
 drivers/iommu/mtk_iommu.c | 38 ++++++++++++++++++++++++--------------
 1 file changed, 24 insertions(+), 14 deletions(-)

diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c
index bb9dd92c9898..90685946fcbe 100644
--- a/drivers/iommu/mtk_iommu.c
+++ b/drivers/iommu/mtk_iommu.c
@@ -1140,22 +1140,32 @@ static int mtk_iommu_probe(struct platform_device *pdev)
 	data->protect_base = ALIGN(virt_to_phys(protect), MTK_PROTECT_PA_ALIGN);
 
 	if (MTK_IOMMU_HAS_FLAG(data->plat_data, HAS_4GB_MODE)) {
-		switch (data->plat_data->m4u_plat) {
-		case M4U_MT2712:
-			p = "mediatek,mt2712-infracfg";
-			break;
-		case M4U_MT8173:
-			p = "mediatek,mt8173-infracfg";
-			break;
-		default:
-			p = NULL;
+		infracfg = syscon_regmap_lookup_by_phandle(dev->of_node, "mediatek,infracfg");
+		if (IS_ERR(infracfg)) {
+			/*
+			 * Legacy devicetrees will not specify a phandle to
+			 * mediatek,infracfg: in that case, we use the older
+			 * way to retrieve a syscon to infra.
+			 *
+			 * This is for retrocompatibility purposes only, hence
+			 * no more compatibles shall be added to this.
+			 */
+			switch (data->plat_data->m4u_plat) {
+			case M4U_MT2712:
+				p = "mediatek,mt2712-infracfg";
+				break;
+			case M4U_MT8173:
+				p = "mediatek,mt8173-infracfg";
+				break;
+			default:
+				p = NULL;
+			}
+
+			infracfg = syscon_regmap_lookup_by_compatible(p);
+			if (IS_ERR(infracfg))
+				return PTR_ERR(infracfg);
 		}
 
-		infracfg = syscon_regmap_lookup_by_compatible(p);
-
-		if (IS_ERR(infracfg))
-			return PTR_ERR(infracfg);
-
 		ret = regmap_read(infracfg, REG_INFRA_MISC, &val);
 		if (ret)
 			return ret;
-- 
2.35.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH v4 3/5] arm64: dts: mediatek: mt8173: Add mediatek,infracfg phandle for IOMMU
  2022-06-16 11:08 ` AngeloGioacchino Del Regno
  (?)
@ 2022-06-16 11:08   ` AngeloGioacchino Del Regno
  -1 siblings, 0 replies; 36+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-06-16 11:08 UTC (permalink / raw)
  To: yong.wu
  Cc: joro, will, robh+dt, krzysztof.kozlowski+dt, matthias.bgg, iommu,
	linux-mediatek, devicetree, linux-kernel, linux-arm-kernel,
	krzysztof.kozlowski, miles.chen, AngeloGioacchino Del Regno

The IOMMU driver now looks for the "mediatek,infracfg" phandle as a
new way to retrieve a syscon to that:
even though the old way is retained, it has been deprecated and the
driver will write a message in kmsg advertising to use the phandle
way instead.

For this reason, assign the right phandle to mediatek,infracfg in
the iommu node.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Miles Chen <miles.chen@mediatek.com>
---
 arch/arm64/boot/dts/mediatek/mt8173.dtsi | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm64/boot/dts/mediatek/mt8173.dtsi b/arch/arm64/boot/dts/mediatek/mt8173.dtsi
index e14b6e68c4df..b6f65c688f02 100644
--- a/arch/arm64/boot/dts/mediatek/mt8173.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8173.dtsi
@@ -581,6 +581,7 @@ iommu: iommu@10205000 {
 			interrupts = <GIC_SPI 139 IRQ_TYPE_LEVEL_LOW>;
 			clocks = <&infracfg CLK_INFRA_M4U>;
 			clock-names = "bclk";
+			mediatek,infracfg = <&infracfg>;
 			mediatek,larbs = <&larb0>, <&larb1>, <&larb2>,
 					 <&larb3>, <&larb4>, <&larb5>;
 			#iommu-cells = <1>;
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH v4 3/5] arm64: dts: mediatek: mt8173: Add mediatek, infracfg phandle for IOMMU
@ 2022-06-16 11:08   ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 36+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-06-16 11:08 UTC (permalink / raw)
  To: yong.wu
  Cc: devicetree, linux-kernel, krzysztof.kozlowski, iommu, robh+dt,
	linux-mediatek, krzysztof.kozlowski+dt, miles.chen, matthias.bgg,
	will, linux-arm-kernel, AngeloGioacchino Del Regno

The IOMMU driver now looks for the "mediatek,infracfg" phandle as a
new way to retrieve a syscon to that:
even though the old way is retained, it has been deprecated and the
driver will write a message in kmsg advertising to use the phandle
way instead.

For this reason, assign the right phandle to mediatek,infracfg in
the iommu node.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Miles Chen <miles.chen@mediatek.com>
---
 arch/arm64/boot/dts/mediatek/mt8173.dtsi | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm64/boot/dts/mediatek/mt8173.dtsi b/arch/arm64/boot/dts/mediatek/mt8173.dtsi
index e14b6e68c4df..b6f65c688f02 100644
--- a/arch/arm64/boot/dts/mediatek/mt8173.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8173.dtsi
@@ -581,6 +581,7 @@ iommu: iommu@10205000 {
 			interrupts = <GIC_SPI 139 IRQ_TYPE_LEVEL_LOW>;
 			clocks = <&infracfg CLK_INFRA_M4U>;
 			clock-names = "bclk";
+			mediatek,infracfg = <&infracfg>;
 			mediatek,larbs = <&larb0>, <&larb1>, <&larb2>,
 					 <&larb3>, <&larb4>, <&larb5>;
 			#iommu-cells = <1>;
-- 
2.35.1

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH v4 3/5] arm64: dts: mediatek: mt8173: Add mediatek,infracfg phandle for IOMMU
@ 2022-06-16 11:08   ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 36+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-06-16 11:08 UTC (permalink / raw)
  To: yong.wu
  Cc: joro, will, robh+dt, krzysztof.kozlowski+dt, matthias.bgg, iommu,
	linux-mediatek, devicetree, linux-kernel, linux-arm-kernel,
	krzysztof.kozlowski, miles.chen, AngeloGioacchino Del Regno

The IOMMU driver now looks for the "mediatek,infracfg" phandle as a
new way to retrieve a syscon to that:
even though the old way is retained, it has been deprecated and the
driver will write a message in kmsg advertising to use the phandle
way instead.

For this reason, assign the right phandle to mediatek,infracfg in
the iommu node.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Miles Chen <miles.chen@mediatek.com>
---
 arch/arm64/boot/dts/mediatek/mt8173.dtsi | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm64/boot/dts/mediatek/mt8173.dtsi b/arch/arm64/boot/dts/mediatek/mt8173.dtsi
index e14b6e68c4df..b6f65c688f02 100644
--- a/arch/arm64/boot/dts/mediatek/mt8173.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8173.dtsi
@@ -581,6 +581,7 @@ iommu: iommu@10205000 {
 			interrupts = <GIC_SPI 139 IRQ_TYPE_LEVEL_LOW>;
 			clocks = <&infracfg CLK_INFRA_M4U>;
 			clock-names = "bclk";
+			mediatek,infracfg = <&infracfg>;
 			mediatek,larbs = <&larb0>, <&larb1>, <&larb2>,
 					 <&larb3>, <&larb4>, <&larb5>;
 			#iommu-cells = <1>;
-- 
2.35.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH v4 4/5] arm64: dts: mediatek: mt2712e: Add mediatek,infracfg phandle for IOMMU
  2022-06-16 11:08 ` AngeloGioacchino Del Regno
  (?)
@ 2022-06-16 11:08   ` AngeloGioacchino Del Regno
  -1 siblings, 0 replies; 36+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-06-16 11:08 UTC (permalink / raw)
  To: yong.wu
  Cc: joro, will, robh+dt, krzysztof.kozlowski+dt, matthias.bgg, iommu,
	linux-mediatek, devicetree, linux-kernel, linux-arm-kernel,
	krzysztof.kozlowski, miles.chen, AngeloGioacchino Del Regno

The IOMMU driver now looks for the "mediatek,infracfg" phandle as a
new way to retrieve a syscon to that:
even though the old way is retained, it has been deprecated and the
driver will write a message in kmsg advertising to use the phandle
way instead.

For this reason, assign the right phandle to mediatek,infracfg in
the iommu node.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Miles Chen <miles.chen@mediatek.com>
---
 arch/arm64/boot/dts/mediatek/mt2712e.dtsi | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm64/boot/dts/mediatek/mt2712e.dtsi b/arch/arm64/boot/dts/mediatek/mt2712e.dtsi
index 623eb3beabf2..4797537cb368 100644
--- a/arch/arm64/boot/dts/mediatek/mt2712e.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt2712e.dtsi
@@ -329,6 +329,7 @@ iommu0: iommu@10205000 {
 		interrupts = <GIC_SPI 147 IRQ_TYPE_LEVEL_LOW>;
 		clocks = <&infracfg CLK_INFRA_M4U>;
 		clock-names = "bclk";
+		mediatek,infracfg = <&infracfg>;
 		mediatek,larbs = <&larb0>, <&larb1>, <&larb2>,
 				 <&larb3>, <&larb6>;
 		#iommu-cells = <1>;
@@ -346,6 +347,7 @@ iommu1: iommu@1020a000 {
 		interrupts = <GIC_SPI 145 IRQ_TYPE_LEVEL_LOW>;
 		clocks = <&infracfg CLK_INFRA_M4U>;
 		clock-names = "bclk";
+		mediatek,infracfg = <&infracfg>;
 		mediatek,larbs = <&larb4>, <&larb5>, <&larb7>;
 		#iommu-cells = <1>;
 	};
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH v4 4/5] arm64: dts: mediatek: mt2712e: Add mediatek, infracfg phandle for IOMMU
@ 2022-06-16 11:08   ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 36+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-06-16 11:08 UTC (permalink / raw)
  To: yong.wu
  Cc: devicetree, linux-kernel, krzysztof.kozlowski, iommu, robh+dt,
	linux-mediatek, krzysztof.kozlowski+dt, miles.chen, matthias.bgg,
	will, linux-arm-kernel, AngeloGioacchino Del Regno

The IOMMU driver now looks for the "mediatek,infracfg" phandle as a
new way to retrieve a syscon to that:
even though the old way is retained, it has been deprecated and the
driver will write a message in kmsg advertising to use the phandle
way instead.

For this reason, assign the right phandle to mediatek,infracfg in
the iommu node.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Miles Chen <miles.chen@mediatek.com>
---
 arch/arm64/boot/dts/mediatek/mt2712e.dtsi | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm64/boot/dts/mediatek/mt2712e.dtsi b/arch/arm64/boot/dts/mediatek/mt2712e.dtsi
index 623eb3beabf2..4797537cb368 100644
--- a/arch/arm64/boot/dts/mediatek/mt2712e.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt2712e.dtsi
@@ -329,6 +329,7 @@ iommu0: iommu@10205000 {
 		interrupts = <GIC_SPI 147 IRQ_TYPE_LEVEL_LOW>;
 		clocks = <&infracfg CLK_INFRA_M4U>;
 		clock-names = "bclk";
+		mediatek,infracfg = <&infracfg>;
 		mediatek,larbs = <&larb0>, <&larb1>, <&larb2>,
 				 <&larb3>, <&larb6>;
 		#iommu-cells = <1>;
@@ -346,6 +347,7 @@ iommu1: iommu@1020a000 {
 		interrupts = <GIC_SPI 145 IRQ_TYPE_LEVEL_LOW>;
 		clocks = <&infracfg CLK_INFRA_M4U>;
 		clock-names = "bclk";
+		mediatek,infracfg = <&infracfg>;
 		mediatek,larbs = <&larb4>, <&larb5>, <&larb7>;
 		#iommu-cells = <1>;
 	};
-- 
2.35.1

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH v4 4/5] arm64: dts: mediatek: mt2712e: Add mediatek,infracfg phandle for IOMMU
@ 2022-06-16 11:08   ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 36+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-06-16 11:08 UTC (permalink / raw)
  To: yong.wu
  Cc: joro, will, robh+dt, krzysztof.kozlowski+dt, matthias.bgg, iommu,
	linux-mediatek, devicetree, linux-kernel, linux-arm-kernel,
	krzysztof.kozlowski, miles.chen, AngeloGioacchino Del Regno

The IOMMU driver now looks for the "mediatek,infracfg" phandle as a
new way to retrieve a syscon to that:
even though the old way is retained, it has been deprecated and the
driver will write a message in kmsg advertising to use the phandle
way instead.

For this reason, assign the right phandle to mediatek,infracfg in
the iommu node.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Miles Chen <miles.chen@mediatek.com>
---
 arch/arm64/boot/dts/mediatek/mt2712e.dtsi | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm64/boot/dts/mediatek/mt2712e.dtsi b/arch/arm64/boot/dts/mediatek/mt2712e.dtsi
index 623eb3beabf2..4797537cb368 100644
--- a/arch/arm64/boot/dts/mediatek/mt2712e.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt2712e.dtsi
@@ -329,6 +329,7 @@ iommu0: iommu@10205000 {
 		interrupts = <GIC_SPI 147 IRQ_TYPE_LEVEL_LOW>;
 		clocks = <&infracfg CLK_INFRA_M4U>;
 		clock-names = "bclk";
+		mediatek,infracfg = <&infracfg>;
 		mediatek,larbs = <&larb0>, <&larb1>, <&larb2>,
 				 <&larb3>, <&larb6>;
 		#iommu-cells = <1>;
@@ -346,6 +347,7 @@ iommu1: iommu@1020a000 {
 		interrupts = <GIC_SPI 145 IRQ_TYPE_LEVEL_LOW>;
 		clocks = <&infracfg CLK_INFRA_M4U>;
 		clock-names = "bclk";
+		mediatek,infracfg = <&infracfg>;
 		mediatek,larbs = <&larb4>, <&larb5>, <&larb7>;
 		#iommu-cells = <1>;
 	};
-- 
2.35.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH v4 5/5] iommu/mediatek: Cleanup pericfg lookup flow
  2022-06-16 11:08 ` AngeloGioacchino Del Regno
  (?)
@ 2022-06-16 11:08   ` AngeloGioacchino Del Regno
  -1 siblings, 0 replies; 36+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-06-16 11:08 UTC (permalink / raw)
  To: yong.wu
  Cc: joro, will, robh+dt, krzysztof.kozlowski+dt, matthias.bgg, iommu,
	linux-mediatek, devicetree, linux-kernel, linux-arm-kernel,
	krzysztof.kozlowski, miles.chen, AngeloGioacchino Del Regno

Since only the INFRA type IOMMU needs to modify register(s) in the
pericfg iospace, it's safe to drop the pericfg_comp_str NULL check;
also, directly assign the regmap handle to data->pericfg instead of
to the infracfg variable to improve code readability.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
 drivers/iommu/mtk_iommu.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c
index 90685946fcbe..b2ae84046249 100644
--- a/drivers/iommu/mtk_iommu.c
+++ b/drivers/iommu/mtk_iommu.c
@@ -1217,15 +1217,13 @@ static int mtk_iommu_probe(struct platform_device *pdev)
 			dev_err(dev, "mm dts parse fail(%d).", ret);
 			goto out_runtime_disable;
 		}
-	} else if (MTK_IOMMU_IS_TYPE(data->plat_data, MTK_IOMMU_TYPE_INFRA) &&
-		   data->plat_data->pericfg_comp_str) {
-		infracfg = syscon_regmap_lookup_by_compatible(data->plat_data->pericfg_comp_str);
-		if (IS_ERR(infracfg)) {
-			ret = PTR_ERR(infracfg);
+	} else if (MTK_IOMMU_IS_TYPE(data->plat_data, MTK_IOMMU_TYPE_INFRA)) {
+		p = data->plat_data->pericfg_comp_str;
+		data->pericfg = syscon_regmap_lookup_by_compatible(p);
+		if (IS_ERR(data->pericfg)) {
+			ret = PTR_ERR(data->pericfg);
 			goto out_runtime_disable;
 		}
-
-		data->pericfg = infracfg;
 	}
 
 	platform_set_drvdata(pdev, data);
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH v4 5/5] iommu/mediatek: Cleanup pericfg lookup flow
@ 2022-06-16 11:08   ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 36+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-06-16 11:08 UTC (permalink / raw)
  To: yong.wu
  Cc: devicetree, linux-kernel, krzysztof.kozlowski, iommu, robh+dt,
	linux-mediatek, krzysztof.kozlowski+dt, miles.chen, matthias.bgg,
	will, linux-arm-kernel, AngeloGioacchino Del Regno

Since only the INFRA type IOMMU needs to modify register(s) in the
pericfg iospace, it's safe to drop the pericfg_comp_str NULL check;
also, directly assign the regmap handle to data->pericfg instead of
to the infracfg variable to improve code readability.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
 drivers/iommu/mtk_iommu.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c
index 90685946fcbe..b2ae84046249 100644
--- a/drivers/iommu/mtk_iommu.c
+++ b/drivers/iommu/mtk_iommu.c
@@ -1217,15 +1217,13 @@ static int mtk_iommu_probe(struct platform_device *pdev)
 			dev_err(dev, "mm dts parse fail(%d).", ret);
 			goto out_runtime_disable;
 		}
-	} else if (MTK_IOMMU_IS_TYPE(data->plat_data, MTK_IOMMU_TYPE_INFRA) &&
-		   data->plat_data->pericfg_comp_str) {
-		infracfg = syscon_regmap_lookup_by_compatible(data->plat_data->pericfg_comp_str);
-		if (IS_ERR(infracfg)) {
-			ret = PTR_ERR(infracfg);
+	} else if (MTK_IOMMU_IS_TYPE(data->plat_data, MTK_IOMMU_TYPE_INFRA)) {
+		p = data->plat_data->pericfg_comp_str;
+		data->pericfg = syscon_regmap_lookup_by_compatible(p);
+		if (IS_ERR(data->pericfg)) {
+			ret = PTR_ERR(data->pericfg);
 			goto out_runtime_disable;
 		}
-
-		data->pericfg = infracfg;
 	}
 
 	platform_set_drvdata(pdev, data);
-- 
2.35.1

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH v4 5/5] iommu/mediatek: Cleanup pericfg lookup flow
@ 2022-06-16 11:08   ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 36+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-06-16 11:08 UTC (permalink / raw)
  To: yong.wu
  Cc: joro, will, robh+dt, krzysztof.kozlowski+dt, matthias.bgg, iommu,
	linux-mediatek, devicetree, linux-kernel, linux-arm-kernel,
	krzysztof.kozlowski, miles.chen, AngeloGioacchino Del Regno

Since only the INFRA type IOMMU needs to modify register(s) in the
pericfg iospace, it's safe to drop the pericfg_comp_str NULL check;
also, directly assign the regmap handle to data->pericfg instead of
to the infracfg variable to improve code readability.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
 drivers/iommu/mtk_iommu.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c
index 90685946fcbe..b2ae84046249 100644
--- a/drivers/iommu/mtk_iommu.c
+++ b/drivers/iommu/mtk_iommu.c
@@ -1217,15 +1217,13 @@ static int mtk_iommu_probe(struct platform_device *pdev)
 			dev_err(dev, "mm dts parse fail(%d).", ret);
 			goto out_runtime_disable;
 		}
-	} else if (MTK_IOMMU_IS_TYPE(data->plat_data, MTK_IOMMU_TYPE_INFRA) &&
-		   data->plat_data->pericfg_comp_str) {
-		infracfg = syscon_regmap_lookup_by_compatible(data->plat_data->pericfg_comp_str);
-		if (IS_ERR(infracfg)) {
-			ret = PTR_ERR(infracfg);
+	} else if (MTK_IOMMU_IS_TYPE(data->plat_data, MTK_IOMMU_TYPE_INFRA)) {
+		p = data->plat_data->pericfg_comp_str;
+		data->pericfg = syscon_regmap_lookup_by_compatible(p);
+		if (IS_ERR(data->pericfg)) {
+			ret = PTR_ERR(data->pericfg);
 			goto out_runtime_disable;
 		}
-
-		data->pericfg = infracfg;
 	}
 
 	platform_set_drvdata(pdev, data);
-- 
2.35.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 36+ messages in thread

* Re: [PATCH v4 1/5] dt-bindings: iommu: mediatek: Add mediatek,infracfg phandle
  2022-06-16 11:08   ` [PATCH v4 1/5] dt-bindings: iommu: mediatek: Add mediatek, infracfg phandle AngeloGioacchino Del Regno
  (?)
@ 2022-06-16 12:57     ` Matthias Brugger
  -1 siblings, 0 replies; 36+ messages in thread
From: Matthias Brugger @ 2022-06-16 12:57 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno, yong.wu
  Cc: joro, will, robh+dt, krzysztof.kozlowski+dt, iommu,
	linux-mediatek, devicetree, linux-kernel, linux-arm-kernel,
	krzysztof.kozlowski, miles.chen



On 16/06/2022 13:08, AngeloGioacchino Del Regno wrote:
> Add property "mediatek,infracfg" to let the mtk_iommu driver retrieve
> a phandle to the infracfg syscon instead of performing a per-soc
> compatible lookup in the entire devicetree and set it as a required
> property for MT2712 and MT8173.
> 
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>

Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>

> ---
>   .../bindings/iommu/mediatek,iommu.yaml          | 17 +++++++++++++++++
>   1 file changed, 17 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml b/Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml
> index 2ae3bbad7f1a..fee0241b5098 100644
> --- a/Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml
> +++ b/Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml
> @@ -101,6 +101,10 @@ properties:
>       items:
>         - const: bclk
>   
> +  mediatek,infracfg:
> +    $ref: /schemas/types.yaml#/definitions/phandle
> +    description: The phandle to the mediatek infracfg syscon
> +
>     mediatek,larbs:
>       $ref: /schemas/types.yaml#/definitions/phandle-array
>       minItems: 1
> @@ -167,6 +171,18 @@ allOf:
>         required:
>           - power-domains
>   
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - mediatek,mt2712-m4u
> +              - mediatek,mt8173-m4u
> +
> +    then:
> +      required:
> +        - mediatek,infracfg
> +
>     - if: # The IOMMUs don't have larbs.
>         not:
>           properties:
> @@ -191,6 +207,7 @@ examples:
>               interrupts = <GIC_SPI 139 IRQ_TYPE_LEVEL_LOW>;
>               clocks = <&infracfg CLK_INFRA_M4U>;
>               clock-names = "bclk";
> +            mediatek,infracfg = <&infracfg>;
>               mediatek,larbs = <&larb0>, <&larb1>, <&larb2>,
>                                <&larb3>, <&larb4>, <&larb5>;
>               #iommu-cells = <1>;

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v4 1/5] dt-bindings: iommu: mediatek: Add mediatek,infracfg phandle
@ 2022-06-16 12:57     ` Matthias Brugger
  0 siblings, 0 replies; 36+ messages in thread
From: Matthias Brugger @ 2022-06-16 12:57 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno, yong.wu
  Cc: devicetree, linux-kernel, krzysztof.kozlowski, iommu, robh+dt,
	linux-mediatek, krzysztof.kozlowski+dt, miles.chen, will,
	linux-arm-kernel



On 16/06/2022 13:08, AngeloGioacchino Del Regno wrote:
> Add property "mediatek,infracfg" to let the mtk_iommu driver retrieve
> a phandle to the infracfg syscon instead of performing a per-soc
> compatible lookup in the entire devicetree and set it as a required
> property for MT2712 and MT8173.
> 
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>

Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>

> ---
>   .../bindings/iommu/mediatek,iommu.yaml          | 17 +++++++++++++++++
>   1 file changed, 17 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml b/Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml
> index 2ae3bbad7f1a..fee0241b5098 100644
> --- a/Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml
> +++ b/Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml
> @@ -101,6 +101,10 @@ properties:
>       items:
>         - const: bclk
>   
> +  mediatek,infracfg:
> +    $ref: /schemas/types.yaml#/definitions/phandle
> +    description: The phandle to the mediatek infracfg syscon
> +
>     mediatek,larbs:
>       $ref: /schemas/types.yaml#/definitions/phandle-array
>       minItems: 1
> @@ -167,6 +171,18 @@ allOf:
>         required:
>           - power-domains
>   
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - mediatek,mt2712-m4u
> +              - mediatek,mt8173-m4u
> +
> +    then:
> +      required:
> +        - mediatek,infracfg
> +
>     - if: # The IOMMUs don't have larbs.
>         not:
>           properties:
> @@ -191,6 +207,7 @@ examples:
>               interrupts = <GIC_SPI 139 IRQ_TYPE_LEVEL_LOW>;
>               clocks = <&infracfg CLK_INFRA_M4U>;
>               clock-names = "bclk";
> +            mediatek,infracfg = <&infracfg>;
>               mediatek,larbs = <&larb0>, <&larb1>, <&larb2>,
>                                <&larb3>, <&larb4>, <&larb5>;
>               #iommu-cells = <1>;
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v4 1/5] dt-bindings: iommu: mediatek: Add mediatek,infracfg phandle
@ 2022-06-16 12:57     ` Matthias Brugger
  0 siblings, 0 replies; 36+ messages in thread
From: Matthias Brugger @ 2022-06-16 12:57 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno, yong.wu
  Cc: joro, will, robh+dt, krzysztof.kozlowski+dt, iommu,
	linux-mediatek, devicetree, linux-kernel, linux-arm-kernel,
	krzysztof.kozlowski, miles.chen



On 16/06/2022 13:08, AngeloGioacchino Del Regno wrote:
> Add property "mediatek,infracfg" to let the mtk_iommu driver retrieve
> a phandle to the infracfg syscon instead of performing a per-soc
> compatible lookup in the entire devicetree and set it as a required
> property for MT2712 and MT8173.
> 
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>

Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>

> ---
>   .../bindings/iommu/mediatek,iommu.yaml          | 17 +++++++++++++++++
>   1 file changed, 17 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml b/Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml
> index 2ae3bbad7f1a..fee0241b5098 100644
> --- a/Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml
> +++ b/Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml
> @@ -101,6 +101,10 @@ properties:
>       items:
>         - const: bclk
>   
> +  mediatek,infracfg:
> +    $ref: /schemas/types.yaml#/definitions/phandle
> +    description: The phandle to the mediatek infracfg syscon
> +
>     mediatek,larbs:
>       $ref: /schemas/types.yaml#/definitions/phandle-array
>       minItems: 1
> @@ -167,6 +171,18 @@ allOf:
>         required:
>           - power-domains
>   
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - mediatek,mt2712-m4u
> +              - mediatek,mt8173-m4u
> +
> +    then:
> +      required:
> +        - mediatek,infracfg
> +
>     - if: # The IOMMUs don't have larbs.
>         not:
>           properties:
> @@ -191,6 +207,7 @@ examples:
>               interrupts = <GIC_SPI 139 IRQ_TYPE_LEVEL_LOW>;
>               clocks = <&infracfg CLK_INFRA_M4U>;
>               clock-names = "bclk";
> +            mediatek,infracfg = <&infracfg>;
>               mediatek,larbs = <&larb0>, <&larb1>, <&larb2>,
>                                <&larb3>, <&larb4>, <&larb5>;
>               #iommu-cells = <1>;

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v4 5/5] iommu/mediatek: Cleanup pericfg lookup flow
  2022-06-16 11:08   ` AngeloGioacchino Del Regno
  (?)
@ 2022-06-16 13:03     ` Matthias Brugger
  -1 siblings, 0 replies; 36+ messages in thread
From: Matthias Brugger @ 2022-06-16 13:03 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno, yong.wu
  Cc: joro, will, robh+dt, krzysztof.kozlowski+dt, iommu,
	linux-mediatek, devicetree, linux-kernel, linux-arm-kernel,
	krzysztof.kozlowski, miles.chen



On 16/06/2022 13:08, AngeloGioacchino Del Regno wrote:
> Since only the INFRA type IOMMU needs to modify register(s) in the
> pericfg iospace, it's safe to drop the pericfg_comp_str NULL check;
> also, directly assign the regmap handle to data->pericfg instead of
> to the infracfg variable to improve code readability.
> 
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>

Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>

> ---
>   drivers/iommu/mtk_iommu.c | 12 +++++-------
>   1 file changed, 5 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c
> index 90685946fcbe..b2ae84046249 100644
> --- a/drivers/iommu/mtk_iommu.c
> +++ b/drivers/iommu/mtk_iommu.c
> @@ -1217,15 +1217,13 @@ static int mtk_iommu_probe(struct platform_device *pdev)
>   			dev_err(dev, "mm dts parse fail(%d).", ret);
>   			goto out_runtime_disable;
>   		}
> -	} else if (MTK_IOMMU_IS_TYPE(data->plat_data, MTK_IOMMU_TYPE_INFRA) &&
> -		   data->plat_data->pericfg_comp_str) {
> -		infracfg = syscon_regmap_lookup_by_compatible(data->plat_data->pericfg_comp_str);
> -		if (IS_ERR(infracfg)) {
> -			ret = PTR_ERR(infracfg);
> +	} else if (MTK_IOMMU_IS_TYPE(data->plat_data, MTK_IOMMU_TYPE_INFRA)) {
> +		p = data->plat_data->pericfg_comp_str;
> +		data->pericfg = syscon_regmap_lookup_by_compatible(p);
> +		if (IS_ERR(data->pericfg)) {
> +			ret = PTR_ERR(data->pericfg);
>   			goto out_runtime_disable;
>   		}
> -
> -		data->pericfg = infracfg;
>   	}
>   
>   	platform_set_drvdata(pdev, data);

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v4 5/5] iommu/mediatek: Cleanup pericfg lookup flow
@ 2022-06-16 13:03     ` Matthias Brugger
  0 siblings, 0 replies; 36+ messages in thread
From: Matthias Brugger @ 2022-06-16 13:03 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno, yong.wu
  Cc: devicetree, linux-kernel, krzysztof.kozlowski, iommu, robh+dt,
	linux-mediatek, krzysztof.kozlowski+dt, miles.chen, will,
	linux-arm-kernel



On 16/06/2022 13:08, AngeloGioacchino Del Regno wrote:
> Since only the INFRA type IOMMU needs to modify register(s) in the
> pericfg iospace, it's safe to drop the pericfg_comp_str NULL check;
> also, directly assign the regmap handle to data->pericfg instead of
> to the infracfg variable to improve code readability.
> 
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>

Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>

> ---
>   drivers/iommu/mtk_iommu.c | 12 +++++-------
>   1 file changed, 5 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c
> index 90685946fcbe..b2ae84046249 100644
> --- a/drivers/iommu/mtk_iommu.c
> +++ b/drivers/iommu/mtk_iommu.c
> @@ -1217,15 +1217,13 @@ static int mtk_iommu_probe(struct platform_device *pdev)
>   			dev_err(dev, "mm dts parse fail(%d).", ret);
>   			goto out_runtime_disable;
>   		}
> -	} else if (MTK_IOMMU_IS_TYPE(data->plat_data, MTK_IOMMU_TYPE_INFRA) &&
> -		   data->plat_data->pericfg_comp_str) {
> -		infracfg = syscon_regmap_lookup_by_compatible(data->plat_data->pericfg_comp_str);
> -		if (IS_ERR(infracfg)) {
> -			ret = PTR_ERR(infracfg);
> +	} else if (MTK_IOMMU_IS_TYPE(data->plat_data, MTK_IOMMU_TYPE_INFRA)) {
> +		p = data->plat_data->pericfg_comp_str;
> +		data->pericfg = syscon_regmap_lookup_by_compatible(p);
> +		if (IS_ERR(data->pericfg)) {
> +			ret = PTR_ERR(data->pericfg);
>   			goto out_runtime_disable;
>   		}
> -
> -		data->pericfg = infracfg;
>   	}
>   
>   	platform_set_drvdata(pdev, data);
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v4 5/5] iommu/mediatek: Cleanup pericfg lookup flow
@ 2022-06-16 13:03     ` Matthias Brugger
  0 siblings, 0 replies; 36+ messages in thread
From: Matthias Brugger @ 2022-06-16 13:03 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno, yong.wu
  Cc: joro, will, robh+dt, krzysztof.kozlowski+dt, iommu,
	linux-mediatek, devicetree, linux-kernel, linux-arm-kernel,
	krzysztof.kozlowski, miles.chen



On 16/06/2022 13:08, AngeloGioacchino Del Regno wrote:
> Since only the INFRA type IOMMU needs to modify register(s) in the
> pericfg iospace, it's safe to drop the pericfg_comp_str NULL check;
> also, directly assign the regmap handle to data->pericfg instead of
> to the infracfg variable to improve code readability.
> 
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>

Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>

> ---
>   drivers/iommu/mtk_iommu.c | 12 +++++-------
>   1 file changed, 5 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c
> index 90685946fcbe..b2ae84046249 100644
> --- a/drivers/iommu/mtk_iommu.c
> +++ b/drivers/iommu/mtk_iommu.c
> @@ -1217,15 +1217,13 @@ static int mtk_iommu_probe(struct platform_device *pdev)
>   			dev_err(dev, "mm dts parse fail(%d).", ret);
>   			goto out_runtime_disable;
>   		}
> -	} else if (MTK_IOMMU_IS_TYPE(data->plat_data, MTK_IOMMU_TYPE_INFRA) &&
> -		   data->plat_data->pericfg_comp_str) {
> -		infracfg = syscon_regmap_lookup_by_compatible(data->plat_data->pericfg_comp_str);
> -		if (IS_ERR(infracfg)) {
> -			ret = PTR_ERR(infracfg);
> +	} else if (MTK_IOMMU_IS_TYPE(data->plat_data, MTK_IOMMU_TYPE_INFRA)) {
> +		p = data->plat_data->pericfg_comp_str;
> +		data->pericfg = syscon_regmap_lookup_by_compatible(p);
> +		if (IS_ERR(data->pericfg)) {
> +			ret = PTR_ERR(data->pericfg);
>   			goto out_runtime_disable;
>   		}
> -
> -		data->pericfg = infracfg;
>   	}
>   
>   	platform_set_drvdata(pdev, data);

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v4 0/5] mtk_iommu: Specify phandles to infracfg and pericfg
  2022-06-16 11:08 ` AngeloGioacchino Del Regno
  (?)
@ 2022-06-22 13:44   ` Joerg Roedel
  -1 siblings, 0 replies; 36+ messages in thread
From: Joerg Roedel @ 2022-06-22 13:44 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno
  Cc: yong.wu, will, robh+dt, krzysztof.kozlowski+dt, matthias.bgg,
	iommu, linux-mediatek, devicetree, linux-kernel,
	linux-arm-kernel, krzysztof.kozlowski, miles.chen

On Thu, Jun 16, 2022 at 01:08:25PM +0200, AngeloGioacchino Del Regno wrote:
> AngeloGioacchino Del Regno (5):
>   dt-bindings: iommu: mediatek: Add mediatek,infracfg phandle
>   iommu/mediatek: Lookup phandle to retrieve syscon to infracfg
>   arm64: dts: mediatek: mt8173: Add mediatek,infracfg phandle for IOMMU
>   arm64: dts: mediatek: mt2712e: Add mediatek,infracfg phandle for IOMMU
>   iommu/mediatek: Cleanup pericfg lookup flow
> 
>  .../bindings/iommu/mediatek,iommu.yaml        | 17 +++++++
>  arch/arm64/boot/dts/mediatek/mt2712e.dtsi     |  2 +
>  arch/arm64/boot/dts/mediatek/mt8173.dtsi      |  1 +
>  drivers/iommu/mtk_iommu.c                     | 50 +++++++++++--------
>  4 files changed, 49 insertions(+), 21 deletions(-)

Applied, thanks.

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v4 0/5] mtk_iommu: Specify phandles to infracfg and pericfg
@ 2022-06-22 13:44   ` Joerg Roedel
  0 siblings, 0 replies; 36+ messages in thread
From: Joerg Roedel @ 2022-06-22 13:44 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno
  Cc: devicetree, linux-kernel, krzysztof.kozlowski, iommu, robh+dt,
	linux-mediatek, linux-arm-kernel, krzysztof.kozlowski+dt,
	miles.chen, matthias.bgg, will

On Thu, Jun 16, 2022 at 01:08:25PM +0200, AngeloGioacchino Del Regno wrote:
> AngeloGioacchino Del Regno (5):
>   dt-bindings: iommu: mediatek: Add mediatek,infracfg phandle
>   iommu/mediatek: Lookup phandle to retrieve syscon to infracfg
>   arm64: dts: mediatek: mt8173: Add mediatek,infracfg phandle for IOMMU
>   arm64: dts: mediatek: mt2712e: Add mediatek,infracfg phandle for IOMMU
>   iommu/mediatek: Cleanup pericfg lookup flow
> 
>  .../bindings/iommu/mediatek,iommu.yaml        | 17 +++++++
>  arch/arm64/boot/dts/mediatek/mt2712e.dtsi     |  2 +
>  arch/arm64/boot/dts/mediatek/mt8173.dtsi      |  1 +
>  drivers/iommu/mtk_iommu.c                     | 50 +++++++++++--------
>  4 files changed, 49 insertions(+), 21 deletions(-)

Applied, thanks.
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v4 0/5] mtk_iommu: Specify phandles to infracfg and pericfg
@ 2022-06-22 13:44   ` Joerg Roedel
  0 siblings, 0 replies; 36+ messages in thread
From: Joerg Roedel @ 2022-06-22 13:44 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno
  Cc: yong.wu, will, robh+dt, krzysztof.kozlowski+dt, matthias.bgg,
	iommu, linux-mediatek, devicetree, linux-kernel,
	linux-arm-kernel, krzysztof.kozlowski, miles.chen

On Thu, Jun 16, 2022 at 01:08:25PM +0200, AngeloGioacchino Del Regno wrote:
> AngeloGioacchino Del Regno (5):
>   dt-bindings: iommu: mediatek: Add mediatek,infracfg phandle
>   iommu/mediatek: Lookup phandle to retrieve syscon to infracfg
>   arm64: dts: mediatek: mt8173: Add mediatek,infracfg phandle for IOMMU
>   arm64: dts: mediatek: mt2712e: Add mediatek,infracfg phandle for IOMMU
>   iommu/mediatek: Cleanup pericfg lookup flow
> 
>  .../bindings/iommu/mediatek,iommu.yaml        | 17 +++++++
>  arch/arm64/boot/dts/mediatek/mt2712e.dtsi     |  2 +
>  arch/arm64/boot/dts/mediatek/mt8173.dtsi      |  1 +
>  drivers/iommu/mtk_iommu.c                     | 50 +++++++++++--------
>  4 files changed, 49 insertions(+), 21 deletions(-)

Applied, thanks.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v4 0/5] mtk_iommu: Specify phandles to infracfg and pericfg
  2022-06-22 13:44   ` Joerg Roedel
  (?)
@ 2022-06-22 14:12     ` Matthias Brugger
  -1 siblings, 0 replies; 36+ messages in thread
From: Matthias Brugger @ 2022-06-22 14:12 UTC (permalink / raw)
  To: Joerg Roedel, AngeloGioacchino Del Regno
  Cc: yong.wu, will, robh+dt, krzysztof.kozlowski+dt, iommu,
	linux-mediatek, devicetree, linux-kernel, linux-arm-kernel,
	krzysztof.kozlowski, miles.chen

Hi Joerg,

On 22/06/2022 15:44, Joerg Roedel wrote:
> On Thu, Jun 16, 2022 at 01:08:25PM +0200, AngeloGioacchino Del Regno wrote:
>> AngeloGioacchino Del Regno (5):
>>    dt-bindings: iommu: mediatek: Add mediatek,infracfg phandle
>>    iommu/mediatek: Lookup phandle to retrieve syscon to infracfg
>>    arm64: dts: mediatek: mt8173: Add mediatek,infracfg phandle for IOMMU
>>    arm64: dts: mediatek: mt2712e: Add mediatek,infracfg phandle for IOMMU
>>    iommu/mediatek: Cleanup pericfg lookup flow
>>
>>   .../bindings/iommu/mediatek,iommu.yaml        | 17 +++++++
>>   arch/arm64/boot/dts/mediatek/mt2712e.dtsi     |  2 +
>>   arch/arm64/boot/dts/mediatek/mt8173.dtsi      |  1 +
>>   drivers/iommu/mtk_iommu.c                     | 50 +++++++++++--------
>>   4 files changed, 49 insertions(+), 21 deletions(-)
> 
> Applied, thanks.

I wanted to check if you took also 3 and 4, as these should go through my tree. 
Unfortunately you haven't pushed your tree (yet). In case you took the whole 
series, can you please drop the dts patches. I'll apply them now on my 
v5.19-next/dts64 branch.

Regards.
Matthias

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v4 0/5] mtk_iommu: Specify phandles to infracfg and pericfg
@ 2022-06-22 14:12     ` Matthias Brugger
  0 siblings, 0 replies; 36+ messages in thread
From: Matthias Brugger @ 2022-06-22 14:12 UTC (permalink / raw)
  To: Joerg Roedel, AngeloGioacchino Del Regno
  Cc: devicetree, linux-kernel, krzysztof.kozlowski, iommu, robh+dt,
	linux-mediatek, linux-arm-kernel, krzysztof.kozlowski+dt,
	miles.chen, will

Hi Joerg,

On 22/06/2022 15:44, Joerg Roedel wrote:
> On Thu, Jun 16, 2022 at 01:08:25PM +0200, AngeloGioacchino Del Regno wrote:
>> AngeloGioacchino Del Regno (5):
>>    dt-bindings: iommu: mediatek: Add mediatek,infracfg phandle
>>    iommu/mediatek: Lookup phandle to retrieve syscon to infracfg
>>    arm64: dts: mediatek: mt8173: Add mediatek,infracfg phandle for IOMMU
>>    arm64: dts: mediatek: mt2712e: Add mediatek,infracfg phandle for IOMMU
>>    iommu/mediatek: Cleanup pericfg lookup flow
>>
>>   .../bindings/iommu/mediatek,iommu.yaml        | 17 +++++++
>>   arch/arm64/boot/dts/mediatek/mt2712e.dtsi     |  2 +
>>   arch/arm64/boot/dts/mediatek/mt8173.dtsi      |  1 +
>>   drivers/iommu/mtk_iommu.c                     | 50 +++++++++++--------
>>   4 files changed, 49 insertions(+), 21 deletions(-)
> 
> Applied, thanks.

I wanted to check if you took also 3 and 4, as these should go through my tree. 
Unfortunately you haven't pushed your tree (yet). In case you took the whole 
series, can you please drop the dts patches. I'll apply them now on my 
v5.19-next/dts64 branch.

Regards.
Matthias
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v4 0/5] mtk_iommu: Specify phandles to infracfg and pericfg
@ 2022-06-22 14:12     ` Matthias Brugger
  0 siblings, 0 replies; 36+ messages in thread
From: Matthias Brugger @ 2022-06-22 14:12 UTC (permalink / raw)
  To: Joerg Roedel, AngeloGioacchino Del Regno
  Cc: yong.wu, will, robh+dt, krzysztof.kozlowski+dt, iommu,
	linux-mediatek, devicetree, linux-kernel, linux-arm-kernel,
	krzysztof.kozlowski, miles.chen

Hi Joerg,

On 22/06/2022 15:44, Joerg Roedel wrote:
> On Thu, Jun 16, 2022 at 01:08:25PM +0200, AngeloGioacchino Del Regno wrote:
>> AngeloGioacchino Del Regno (5):
>>    dt-bindings: iommu: mediatek: Add mediatek,infracfg phandle
>>    iommu/mediatek: Lookup phandle to retrieve syscon to infracfg
>>    arm64: dts: mediatek: mt8173: Add mediatek,infracfg phandle for IOMMU
>>    arm64: dts: mediatek: mt2712e: Add mediatek,infracfg phandle for IOMMU
>>    iommu/mediatek: Cleanup pericfg lookup flow
>>
>>   .../bindings/iommu/mediatek,iommu.yaml        | 17 +++++++
>>   arch/arm64/boot/dts/mediatek/mt2712e.dtsi     |  2 +
>>   arch/arm64/boot/dts/mediatek/mt8173.dtsi      |  1 +
>>   drivers/iommu/mtk_iommu.c                     | 50 +++++++++++--------
>>   4 files changed, 49 insertions(+), 21 deletions(-)
> 
> Applied, thanks.

I wanted to check if you took also 3 and 4, as these should go through my tree. 
Unfortunately you haven't pushed your tree (yet). In case you took the whole 
series, can you please drop the dts patches. I'll apply them now on my 
v5.19-next/dts64 branch.

Regards.
Matthias

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v4 0/5] mtk_iommu: Specify phandles to infracfg and pericfg
  2022-06-22 13:44   ` Joerg Roedel
  (?)
@ 2022-06-22 14:12     ` Matthias Brugger
  -1 siblings, 0 replies; 36+ messages in thread
From: Matthias Brugger @ 2022-06-22 14:12 UTC (permalink / raw)
  To: Joerg Roedel, AngeloGioacchino Del Regno
  Cc: yong.wu, will, robh+dt, krzysztof.kozlowski+dt, iommu,
	linux-mediatek, devicetree, linux-kernel, linux-arm-kernel,
	krzysztof.kozlowski, miles.chen

Hi Joerg,

On 22/06/2022 15:44, Joerg Roedel wrote:
> On Thu, Jun 16, 2022 at 01:08:25PM +0200, AngeloGioacchino Del Regno wrote:
>> AngeloGioacchino Del Regno (5):
>>    dt-bindings: iommu: mediatek: Add mediatek,infracfg phandle
>>    iommu/mediatek: Lookup phandle to retrieve syscon to infracfg
>>    arm64: dts: mediatek: mt8173: Add mediatek,infracfg phandle for IOMMU
>>    arm64: dts: mediatek: mt2712e: Add mediatek,infracfg phandle for IOMMU
>>    iommu/mediatek: Cleanup pericfg lookup flow
>>
>>   .../bindings/iommu/mediatek,iommu.yaml        | 17 +++++++
>>   arch/arm64/boot/dts/mediatek/mt2712e.dtsi     |  2 +
>>   arch/arm64/boot/dts/mediatek/mt8173.dtsi      |  1 +
>>   drivers/iommu/mtk_iommu.c                     | 50 +++++++++++--------
>>   4 files changed, 49 insertions(+), 21 deletions(-)
> 
> Applied, thanks.

I wanted to check if you took also 3 and 4, as these should go through my tree. 
Unfortunately you haven't pushed your tree (yet). In case you took the whole 
series, can you please drop the dts patches. I'll apply them now on my 
v5.19-next/dts64 branch.

Regards.
Matthias

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v4 0/5] mtk_iommu: Specify phandles to infracfg and pericfg
@ 2022-06-22 14:12     ` Matthias Brugger
  0 siblings, 0 replies; 36+ messages in thread
From: Matthias Brugger @ 2022-06-22 14:12 UTC (permalink / raw)
  To: Joerg Roedel, AngeloGioacchino Del Regno
  Cc: devicetree, linux-kernel, krzysztof.kozlowski, iommu, robh+dt,
	linux-mediatek, linux-arm-kernel, krzysztof.kozlowski+dt,
	miles.chen, will

Hi Joerg,

On 22/06/2022 15:44, Joerg Roedel wrote:
> On Thu, Jun 16, 2022 at 01:08:25PM +0200, AngeloGioacchino Del Regno wrote:
>> AngeloGioacchino Del Regno (5):
>>    dt-bindings: iommu: mediatek: Add mediatek,infracfg phandle
>>    iommu/mediatek: Lookup phandle to retrieve syscon to infracfg
>>    arm64: dts: mediatek: mt8173: Add mediatek,infracfg phandle for IOMMU
>>    arm64: dts: mediatek: mt2712e: Add mediatek,infracfg phandle for IOMMU
>>    iommu/mediatek: Cleanup pericfg lookup flow
>>
>>   .../bindings/iommu/mediatek,iommu.yaml        | 17 +++++++
>>   arch/arm64/boot/dts/mediatek/mt2712e.dtsi     |  2 +
>>   arch/arm64/boot/dts/mediatek/mt8173.dtsi      |  1 +
>>   drivers/iommu/mtk_iommu.c                     | 50 +++++++++++--------
>>   4 files changed, 49 insertions(+), 21 deletions(-)
> 
> Applied, thanks.

I wanted to check if you took also 3 and 4, as these should go through my tree. 
Unfortunately you haven't pushed your tree (yet). In case you took the whole 
series, can you please drop the dts patches. I'll apply them now on my 
v5.19-next/dts64 branch.

Regards.
Matthias
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v4 0/5] mtk_iommu: Specify phandles to infracfg and pericfg
@ 2022-06-22 14:12     ` Matthias Brugger
  0 siblings, 0 replies; 36+ messages in thread
From: Matthias Brugger @ 2022-06-22 14:12 UTC (permalink / raw)
  To: Joerg Roedel, AngeloGioacchino Del Regno
  Cc: yong.wu, will, robh+dt, krzysztof.kozlowski+dt, iommu,
	linux-mediatek, devicetree, linux-kernel, linux-arm-kernel,
	krzysztof.kozlowski, miles.chen

Hi Joerg,

On 22/06/2022 15:44, Joerg Roedel wrote:
> On Thu, Jun 16, 2022 at 01:08:25PM +0200, AngeloGioacchino Del Regno wrote:
>> AngeloGioacchino Del Regno (5):
>>    dt-bindings: iommu: mediatek: Add mediatek,infracfg phandle
>>    iommu/mediatek: Lookup phandle to retrieve syscon to infracfg
>>    arm64: dts: mediatek: mt8173: Add mediatek,infracfg phandle for IOMMU
>>    arm64: dts: mediatek: mt2712e: Add mediatek,infracfg phandle for IOMMU
>>    iommu/mediatek: Cleanup pericfg lookup flow
>>
>>   .../bindings/iommu/mediatek,iommu.yaml        | 17 +++++++
>>   arch/arm64/boot/dts/mediatek/mt2712e.dtsi     |  2 +
>>   arch/arm64/boot/dts/mediatek/mt8173.dtsi      |  1 +
>>   drivers/iommu/mtk_iommu.c                     | 50 +++++++++++--------
>>   4 files changed, 49 insertions(+), 21 deletions(-)
> 
> Applied, thanks.

I wanted to check if you took also 3 and 4, as these should go through my tree. 
Unfortunately you haven't pushed your tree (yet). In case you took the whole 
series, can you please drop the dts patches. I'll apply them now on my 
v5.19-next/dts64 branch.

Regards.
Matthias

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v4 0/5] mtk_iommu: Specify phandles to infracfg and pericfg
  2022-06-22 14:12     ` Matthias Brugger
  (?)
@ 2022-06-23  7:32       ` Joerg Roedel
  -1 siblings, 0 replies; 36+ messages in thread
From: Joerg Roedel @ 2022-06-23  7:32 UTC (permalink / raw)
  To: Matthias Brugger
  Cc: AngeloGioacchino Del Regno, yong.wu, will, robh+dt,
	krzysztof.kozlowski+dt, iommu, linux-mediatek, devicetree,
	linux-kernel, linux-arm-kernel, krzysztof.kozlowski, miles.chen

Hi Matthias,

On Wed, Jun 22, 2022 at 04:12:47PM +0200, Matthias Brugger wrote:
> I wanted to check if you took also 3 and 4, as these should go through my
> tree. Unfortunately you haven't pushed your tree (yet). In case you took the
> whole series, can you please drop the dts patches. I'll apply them now on my
> v5.19-next/dts64 branch.

Yes, I applied the whole series, will drop patches 3 and 4 now.

Thanks,

	Joerg

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v4 0/5] mtk_iommu: Specify phandles to infracfg and pericfg
@ 2022-06-23  7:32       ` Joerg Roedel
  0 siblings, 0 replies; 36+ messages in thread
From: Joerg Roedel @ 2022-06-23  7:32 UTC (permalink / raw)
  To: Matthias Brugger
  Cc: devicetree, linux-kernel, krzysztof.kozlowski, iommu, robh+dt,
	linux-mediatek, linux-arm-kernel, krzysztof.kozlowski+dt,
	miles.chen, will, AngeloGioacchino Del Regno

Hi Matthias,

On Wed, Jun 22, 2022 at 04:12:47PM +0200, Matthias Brugger wrote:
> I wanted to check if you took also 3 and 4, as these should go through my
> tree. Unfortunately you haven't pushed your tree (yet). In case you took the
> whole series, can you please drop the dts patches. I'll apply them now on my
> v5.19-next/dts64 branch.

Yes, I applied the whole series, will drop patches 3 and 4 now.

Thanks,

	Joerg
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v4 0/5] mtk_iommu: Specify phandles to infracfg and pericfg
@ 2022-06-23  7:32       ` Joerg Roedel
  0 siblings, 0 replies; 36+ messages in thread
From: Joerg Roedel @ 2022-06-23  7:32 UTC (permalink / raw)
  To: Matthias Brugger
  Cc: AngeloGioacchino Del Regno, yong.wu, will, robh+dt,
	krzysztof.kozlowski+dt, iommu, linux-mediatek, devicetree,
	linux-kernel, linux-arm-kernel, krzysztof.kozlowski, miles.chen

Hi Matthias,

On Wed, Jun 22, 2022 at 04:12:47PM +0200, Matthias Brugger wrote:
> I wanted to check if you took also 3 and 4, as these should go through my
> tree. Unfortunately you haven't pushed your tree (yet). In case you took the
> whole series, can you please drop the dts patches. I'll apply them now on my
> v5.19-next/dts64 branch.

Yes, I applied the whole series, will drop patches 3 and 4 now.

Thanks,

	Joerg

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 36+ messages in thread

end of thread, other threads:[~2022-06-23  7:33 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-16 11:08 [PATCH v4 0/5] mtk_iommu: Specify phandles to infracfg and pericfg AngeloGioacchino Del Regno
2022-06-16 11:08 ` AngeloGioacchino Del Regno
2022-06-16 11:08 ` AngeloGioacchino Del Regno
2022-06-16 11:08 ` [PATCH v4 1/5] dt-bindings: iommu: mediatek: Add mediatek,infracfg phandle AngeloGioacchino Del Regno
2022-06-16 11:08   ` AngeloGioacchino Del Regno
2022-06-16 11:08   ` [PATCH v4 1/5] dt-bindings: iommu: mediatek: Add mediatek, infracfg phandle AngeloGioacchino Del Regno
2022-06-16 12:57   ` [PATCH v4 1/5] dt-bindings: iommu: mediatek: Add mediatek,infracfg phandle Matthias Brugger
2022-06-16 12:57     ` Matthias Brugger
2022-06-16 12:57     ` Matthias Brugger
2022-06-16 11:08 ` [PATCH v4 2/5] iommu/mediatek: Lookup phandle to retrieve syscon to infracfg AngeloGioacchino Del Regno
2022-06-16 11:08   ` AngeloGioacchino Del Regno
2022-06-16 11:08   ` AngeloGioacchino Del Regno
2022-06-16 11:08 ` [PATCH v4 3/5] arm64: dts: mediatek: mt8173: Add mediatek,infracfg phandle for IOMMU AngeloGioacchino Del Regno
2022-06-16 11:08   ` AngeloGioacchino Del Regno
2022-06-16 11:08   ` [PATCH v4 3/5] arm64: dts: mediatek: mt8173: Add mediatek, infracfg " AngeloGioacchino Del Regno
2022-06-16 11:08 ` [PATCH v4 4/5] arm64: dts: mediatek: mt2712e: Add mediatek,infracfg " AngeloGioacchino Del Regno
2022-06-16 11:08   ` AngeloGioacchino Del Regno
2022-06-16 11:08   ` [PATCH v4 4/5] arm64: dts: mediatek: mt2712e: Add mediatek, infracfg " AngeloGioacchino Del Regno
2022-06-16 11:08 ` [PATCH v4 5/5] iommu/mediatek: Cleanup pericfg lookup flow AngeloGioacchino Del Regno
2022-06-16 11:08   ` AngeloGioacchino Del Regno
2022-06-16 11:08   ` AngeloGioacchino Del Regno
2022-06-16 13:03   ` Matthias Brugger
2022-06-16 13:03     ` Matthias Brugger
2022-06-16 13:03     ` Matthias Brugger
2022-06-22 13:44 ` [PATCH v4 0/5] mtk_iommu: Specify phandles to infracfg and pericfg Joerg Roedel
2022-06-22 13:44   ` Joerg Roedel
2022-06-22 13:44   ` Joerg Roedel
2022-06-22 14:12   ` Matthias Brugger
2022-06-22 14:12     ` Matthias Brugger
2022-06-22 14:12     ` Matthias Brugger
2022-06-23  7:32     ` Joerg Roedel
2022-06-23  7:32       ` Joerg Roedel
2022-06-23  7:32       ` Joerg Roedel
2022-06-22 14:12   ` Matthias Brugger
2022-06-22 14:12     ` Matthias Brugger
2022-06-22 14:12     ` Matthias Brugger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.