linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v6 1/4] dt-bindings: iommu: mediatek: Fix interrupt count constraint for new SoCs
@ 2024-10-03  3:09 Macpaul Lin
  2024-10-03  3:09 ` [PATCH v6 2/4] arm64: dts: mediatek: mt8395-genio-1200-evk: Fix dtbs_check error for phy Macpaul Lin
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Macpaul Lin @ 2024-10-03  3:09 UTC (permalink / raw)
  To: Chun-Kuang Hu, Philipp Zabel, David Airlie, Simona Vetter,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Yong Wu, Joerg Roedel,
	Will Deacon, Robin Murphy, Matthias Brugger,
	AngeloGioacchino Del Regno, Rohit Agarwal, dri-devel,
	linux-mediatek, devicetree, linux-kernel, iommu, linux-arm-kernel,
	Alexandre Mergnat
  Cc: Bear Wang, Pablo Sun, Macpaul Lin, Macpaul Lin, Sen Chu,
	Chris-qj chen, MediaTek Chromebook Upstream, Chen-Yu Tsai

The infra-iommu node in mt8195.dtsi was triggering a CHECK_DTBS error due
to an excessively long 'interrupts' property. The error message was:

  infra-iommu@10315000: interrupts: [[0, 795, 4, 0], [0, 796, 4, 0],
                     [0, 797, 4, 0], [0, 798, 4, 0], [0, 799, 4, 0]]
                     is too long

To address this issue, update the compatbile matching rule for
'interrupts' property. This change allows flexibility in the number
of interrupts for new SoCs like MT8195.
The purpose of these 5 interrupts is also added into description.

Fixes: bca28426805d ("dt-bindings: iommu: mediatek: Convert IOMMU to DT schema")
Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
---
 .../bindings/iommu/mediatek,iommu.yaml        | 28 ++++++++++++++++++-
 1 file changed, 27 insertions(+), 1 deletion(-)

Changes for v2:
 - commit message: re-formatting and add a description of adding 5 interrupts.
 - add 'description' and 'maxItems: 5' for 'interrupt' property of
   'mt8195-iommu-infra'
 - others keeps 'maxItems: 1'

Changes for v3:
 - Refine the description for 'interrupts' property and fixes the compatible
   matching rules.
 - Refine commit message.

Changes for v4:
  - add missing 'minItems: 5' to 'mediatek,mt8195-iommu-infra'.
    Thanks the explanation from Conor and Krzysztof. 

Changes for v5:
  - Repharse the description for interrupts property of MT8195.

Changes for v6:
  - Remove maxItems for mt8195-iommu-infra.
  - Add 'Reviewed-by' tag from Rob. Thanks for the review.

diff --git a/Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml b/Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml
index ea6b0f5f24de..eeb39f5acf7e 100644
--- a/Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml
+++ b/Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml
@@ -96,7 +96,16 @@ properties:
     maxItems: 1
 
   interrupts:
-    maxItems: 1
+    description: |
+      Usually, the IOMMU requires only one interrupt.
+
+      The infra IOMMU in MT8195 has five banks: each features one set
+      of APB registers. One for the normal world (set 0), three for the
+      protected world (sets 1-3), and one for the secure world (set 4).
+      and each set has its own interrupt. Therefore, five interrupts
+      are needed.
+    minItems: 1
+    maxItems: 5
 
   clocks:
     items:
@@ -210,6 +219,23 @@ allOf:
       required:
         - mediatek,larbs
 
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - mediatek,mt8195-iommu-infra
+
+    then:
+      properties:
+        interrupts:
+          minItems: 5
+
+    else:
+      properties:
+        interrupts:
+          maxItems: 1
+
 additionalProperties: false
 
 examples:
-- 
2.45.2



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

* [PATCH v6 2/4] arm64: dts: mediatek: mt8395-genio-1200-evk: Fix dtbs_check error for phy
  2024-10-03  3:09 [PATCH v6 1/4] dt-bindings: iommu: mediatek: Fix interrupt count constraint for new SoCs Macpaul Lin
@ 2024-10-03  3:09 ` Macpaul Lin
  2024-10-03  3:09 ` [PATCH v6 3/4] arm64: dts: mt8195: Fix dtbs_check error for mutex node Macpaul Lin
  2024-10-03  3:09 ` [PATCH v6 4/4] dt-bindings: display: mediatek: dpi: correct power-domains property Macpaul Lin
  2 siblings, 0 replies; 5+ messages in thread
From: Macpaul Lin @ 2024-10-03  3:09 UTC (permalink / raw)
  To: Chun-Kuang Hu, Philipp Zabel, David Airlie, Simona Vetter,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Yong Wu, Joerg Roedel,
	Will Deacon, Robin Murphy, Matthias Brugger,
	AngeloGioacchino Del Regno, Rohit Agarwal, dri-devel,
	linux-mediatek, devicetree, linux-kernel, iommu, linux-arm-kernel,
	Alexandre Mergnat
  Cc: Bear Wang, Pablo Sun, Macpaul Lin, Macpaul Lin, Sen Chu,
	Chris-qj chen, MediaTek Chromebook Upstream, Chen-Yu Tsai

The ethernet-phy node in mt8395-genio-1200-evk.dts was triggering a
dtbs_check error. The error message was:
  eth-phy0@1: $nodename:0: 'eth-phy0@1' does not match
              '^ethernet-phy(@[a-f0-9]+)?$'
Fix this issue by replacing 'eth-phy' node to generic 'ethernet-phy'.

Fixes: f2b543a191b6 ("arm64: dts: mediatek: add device-tree for Genio 1200 EVK board")
Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
 arch/arm64/boot/dts/mediatek/mt8395-genio-1200-evk.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Changes for v2, v3, v4, v5 and v6:
 - No change.

diff --git a/arch/arm64/boot/dts/mediatek/mt8395-genio-1200-evk.dts b/arch/arm64/boot/dts/mediatek/mt8395-genio-1200-evk.dts
index 1ef6262b65c9..b4b48eb93f3c 100644
--- a/arch/arm64/boot/dts/mediatek/mt8395-genio-1200-evk.dts
+++ b/arch/arm64/boot/dts/mediatek/mt8395-genio-1200-evk.dts
@@ -187,7 +187,7 @@ mdio {
 		compatible = "snps,dwmac-mdio";
 		#address-cells = <1>;
 		#size-cells = <0>;
-		eth_phy0: eth-phy0@1 {
+		eth_phy0: ethernet-phy@1 {
 			compatible = "ethernet-phy-id001c.c916";
 			reg = <0x1>;
 		};
-- 
2.45.2



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

* [PATCH v6 3/4] arm64: dts: mt8195: Fix dtbs_check error for mutex node
  2024-10-03  3:09 [PATCH v6 1/4] dt-bindings: iommu: mediatek: Fix interrupt count constraint for new SoCs Macpaul Lin
  2024-10-03  3:09 ` [PATCH v6 2/4] arm64: dts: mediatek: mt8395-genio-1200-evk: Fix dtbs_check error for phy Macpaul Lin
@ 2024-10-03  3:09 ` Macpaul Lin
  2024-10-03  3:09 ` [PATCH v6 4/4] dt-bindings: display: mediatek: dpi: correct power-domains property Macpaul Lin
  2 siblings, 0 replies; 5+ messages in thread
From: Macpaul Lin @ 2024-10-03  3:09 UTC (permalink / raw)
  To: Chun-Kuang Hu, Philipp Zabel, David Airlie, Simona Vetter,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Yong Wu, Joerg Roedel,
	Will Deacon, Robin Murphy, Matthias Brugger,
	AngeloGioacchino Del Regno, Rohit Agarwal, dri-devel,
	linux-mediatek, devicetree, linux-kernel, iommu, linux-arm-kernel,
	Alexandre Mergnat
  Cc: Bear Wang, Pablo Sun, Macpaul Lin, Macpaul Lin, Sen Chu,
	Chris-qj chen, MediaTek Chromebook Upstream, Chen-Yu Tsai

The mutex node in mt8195.dtsi was triggering a dtbs_check error:
  mutex@1c101000: 'clock-names', 'reg-names' do not match any of the
                  regexes: 'pinctrl-[0-9]+'

This seems no need by inspecting the DT schemas and other reference boards,
so drop 'clock-names' and 'reg-names' in mt8195.dtsi.

Fixes: 92d2c23dc269 ("arm64: dts: mt8195: add display node for vdosys1")
Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
 arch/arm64/boot/dts/mediatek/mt8195.dtsi | 2 --
 1 file changed, 2 deletions(-)

Changes for v2, v3, v4, v5, v6:
 - No change.

diff --git a/arch/arm64/boot/dts/mediatek/mt8195.dtsi b/arch/arm64/boot/dts/mediatek/mt8195.dtsi
index 2e1b41359b43..ade685ed2190 100644
--- a/arch/arm64/boot/dts/mediatek/mt8195.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8195.dtsi
@@ -3331,11 +3331,9 @@ &larb19 &larb21 &larb24 &larb25
 		mutex1: mutex@1c101000 {
 			compatible = "mediatek,mt8195-disp-mutex";
 			reg = <0 0x1c101000 0 0x1000>;
-			reg-names = "vdo1_mutex";
 			interrupts = <GIC_SPI 494 IRQ_TYPE_LEVEL_HIGH 0>;
 			power-domains = <&spm MT8195_POWER_DOMAIN_VDOSYS1>;
 			clocks = <&vdosys1 CLK_VDO1_DISP_MUTEX>;
-			clock-names = "vdo1_mutex";
 			mediatek,gce-client-reg = <&gce0 SUBSYS_1c10XXXX 0x1000 0x1000>;
 			mediatek,gce-events = <CMDQ_EVENT_VDO1_STREAM_DONE_ENG_0>;
 		};
-- 
2.45.2



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

* [PATCH v6 4/4] dt-bindings: display: mediatek: dpi: correct power-domains property
  2024-10-03  3:09 [PATCH v6 1/4] dt-bindings: iommu: mediatek: Fix interrupt count constraint for new SoCs Macpaul Lin
  2024-10-03  3:09 ` [PATCH v6 2/4] arm64: dts: mediatek: mt8395-genio-1200-evk: Fix dtbs_check error for phy Macpaul Lin
  2024-10-03  3:09 ` [PATCH v6 3/4] arm64: dts: mt8195: Fix dtbs_check error for mutex node Macpaul Lin
@ 2024-10-03  3:09 ` Macpaul Lin
  2024-10-23 14:35   ` Chun-Kuang Hu
  2 siblings, 1 reply; 5+ messages in thread
From: Macpaul Lin @ 2024-10-03  3:09 UTC (permalink / raw)
  To: Chun-Kuang Hu, Philipp Zabel, David Airlie, Simona Vetter,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Yong Wu, Joerg Roedel,
	Will Deacon, Robin Murphy, Matthias Brugger,
	AngeloGioacchino Del Regno, Rohit Agarwal, dri-devel,
	linux-mediatek, devicetree, linux-kernel, iommu, linux-arm-kernel,
	Alexandre Mergnat
  Cc: Bear Wang, Pablo Sun, Macpaul Lin, Macpaul Lin, Sen Chu,
	Chris-qj chen, MediaTek Chromebook Upstream, Chen-Yu Tsai,
	Jitao Shi

The MediaTek DPI module is typically associated with one of the
following multimedia power domains:
 - POWER_DOMAIN_DISPLAY
 - POWER_DOMAIN_VDOSYS
 - POWER_DOMAIN_MM
The specific power domain used varies depending on the SoC design.

These power domains are shared by multiple devices within the SoC.
In most cases, these power domains are enabled by other devices.
As a result, the DPI module of legacy SoCs often functions correctly
even without explicit configuration.

It is recommended to explicitly add the appropriate power domain
property to the DPI node in the device tree. Hence drop the
compatible checking for specific SoCs.

Fixes: 5474d49b2f79 ("dt-bindings: display: mediatek: dpi: Add power domains")
Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
Signed-off-by: Jitao Shi <jitao.shi@mediatek.com>
Signed-off-by: Pablo Sun <pablo.sun@mediatek.com>
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 .../display/mediatek/mediatek,dpi.yaml        | 24 ++++++++-----------
 1 file changed, 10 insertions(+), 14 deletions(-)

Changes for v2:
 - Because of the corresponding dts fix has been reviewed with a Reviewed-by: tag.
   [1] https://lore.kernel.org/all/20240925080515.16377-1-macpaul.lin@mediatek.com/
   We still need this change to fix the 2 dtbs_check errors.
   So keeps no change here.

Changes for v3:
 - The origin patch is [2]
   https://lore.kernel.org/all/20240926111449.9245-2-macpaul.lin@mediatek.com/
 - Thanks for Conor's reminding, after MediaTek's internal discussion,
   This patch v3 is the replacement of [2] v2.
   Because the DPI module should has a explicit configuration with power domain.
 - Drop Acked-by: tag since v3 is nearly a new patch for different approach.

Changes for v4:
 - No change. Please help to review it again.

Changes for v5:
 - Add missing Reviewed-by Tag from Krzysztof. Thanks.

Changes for v6:
 - No change.

diff --git a/Documentation/devicetree/bindings/display/mediatek/mediatek,dpi.yaml b/Documentation/devicetree/bindings/display/mediatek/mediatek,dpi.yaml
index 3a82aec9021c..497c0eb4ed0b 100644
--- a/Documentation/devicetree/bindings/display/mediatek/mediatek,dpi.yaml
+++ b/Documentation/devicetree/bindings/display/mediatek/mediatek,dpi.yaml
@@ -63,6 +63,16 @@ properties:
       - const: sleep
 
   power-domains:
+    description: |
+      The MediaTek DPI module is typically associated with one of the
+      following multimedia power domains:
+        POWER_DOMAIN_DISPLAY
+        POWER_DOMAIN_VDOSYS
+        POWER_DOMAIN_MM
+      The specific power domain used varies depending on the SoC design.
+
+      It is recommended to explicitly add the appropriate power domain
+      property to the DPI node in the device tree.
     maxItems: 1
 
   port:
@@ -79,20 +89,6 @@ required:
   - clock-names
   - port
 
-allOf:
-  - if:
-      not:
-        properties:
-          compatible:
-            contains:
-              enum:
-                - mediatek,mt6795-dpi
-                - mediatek,mt8173-dpi
-                - mediatek,mt8186-dpi
-    then:
-      properties:
-        power-domains: false
-
 additionalProperties: false
 
 examples:
-- 
2.45.2



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

* Re: [PATCH v6 4/4] dt-bindings: display: mediatek: dpi: correct power-domains property
  2024-10-03  3:09 ` [PATCH v6 4/4] dt-bindings: display: mediatek: dpi: correct power-domains property Macpaul Lin
@ 2024-10-23 14:35   ` Chun-Kuang Hu
  0 siblings, 0 replies; 5+ messages in thread
From: Chun-Kuang Hu @ 2024-10-23 14:35 UTC (permalink / raw)
  To: Macpaul Lin
  Cc: Chun-Kuang Hu, Philipp Zabel, David Airlie, Simona Vetter,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Yong Wu, Joerg Roedel,
	Will Deacon, Robin Murphy, Matthias Brugger,
	AngeloGioacchino Del Regno, Rohit Agarwal, dri-devel,
	linux-mediatek, devicetree, linux-kernel, iommu, linux-arm-kernel,
	Alexandre Mergnat, Bear Wang, Pablo Sun, Macpaul Lin, Sen Chu,
	Chris-qj chen, MediaTek Chromebook Upstream, Chen-Yu Tsai,
	Jitao Shi

Hi, Macpaul:

Macpaul Lin <macpaul.lin@mediatek.com> 於 2024年10月3日 週四 上午11:09寫道:
>
> The MediaTek DPI module is typically associated with one of the
> following multimedia power domains:
>  - POWER_DOMAIN_DISPLAY
>  - POWER_DOMAIN_VDOSYS
>  - POWER_DOMAIN_MM
> The specific power domain used varies depending on the SoC design.
>
> These power domains are shared by multiple devices within the SoC.
> In most cases, these power domains are enabled by other devices.
> As a result, the DPI module of legacy SoCs often functions correctly
> even without explicit configuration.
>
> It is recommended to explicitly add the appropriate power domain
> property to the DPI node in the device tree. Hence drop the
> compatible checking for specific SoCs.

Applied to mediatek-drm-fixes [1], thanks.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux.git/log/?h=mediatek-drm-fixes

Regards,
Chun-Kuang.

>
> Fixes: 5474d49b2f79 ("dt-bindings: display: mediatek: dpi: Add power domains")
> Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
> Signed-off-by: Jitao Shi <jitao.shi@mediatek.com>
> Signed-off-by: Pablo Sun <pablo.sun@mediatek.com>
> Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
> ---
>  .../display/mediatek/mediatek,dpi.yaml        | 24 ++++++++-----------
>  1 file changed, 10 insertions(+), 14 deletions(-)
>
> Changes for v2:
>  - Because of the corresponding dts fix has been reviewed with a Reviewed-by: tag.
>    [1] https://lore.kernel.org/all/20240925080515.16377-1-macpaul.lin@mediatek.com/
>    We still need this change to fix the 2 dtbs_check errors.
>    So keeps no change here.
>
> Changes for v3:
>  - The origin patch is [2]
>    https://lore.kernel.org/all/20240926111449.9245-2-macpaul.lin@mediatek.com/
>  - Thanks for Conor's reminding, after MediaTek's internal discussion,
>    This patch v3 is the replacement of [2] v2.
>    Because the DPI module should has a explicit configuration with power domain.
>  - Drop Acked-by: tag since v3 is nearly a new patch for different approach.
>
> Changes for v4:
>  - No change. Please help to review it again.
>
> Changes for v5:
>  - Add missing Reviewed-by Tag from Krzysztof. Thanks.
>
> Changes for v6:
>  - No change.
>
> diff --git a/Documentation/devicetree/bindings/display/mediatek/mediatek,dpi.yaml b/Documentation/devicetree/bindings/display/mediatek/mediatek,dpi.yaml
> index 3a82aec9021c..497c0eb4ed0b 100644
> --- a/Documentation/devicetree/bindings/display/mediatek/mediatek,dpi.yaml
> +++ b/Documentation/devicetree/bindings/display/mediatek/mediatek,dpi.yaml
> @@ -63,6 +63,16 @@ properties:
>        - const: sleep
>
>    power-domains:
> +    description: |
> +      The MediaTek DPI module is typically associated with one of the
> +      following multimedia power domains:
> +        POWER_DOMAIN_DISPLAY
> +        POWER_DOMAIN_VDOSYS
> +        POWER_DOMAIN_MM
> +      The specific power domain used varies depending on the SoC design.
> +
> +      It is recommended to explicitly add the appropriate power domain
> +      property to the DPI node in the device tree.
>      maxItems: 1
>
>    port:
> @@ -79,20 +89,6 @@ required:
>    - clock-names
>    - port
>
> -allOf:
> -  - if:
> -      not:
> -        properties:
> -          compatible:
> -            contains:
> -              enum:
> -                - mediatek,mt6795-dpi
> -                - mediatek,mt8173-dpi
> -                - mediatek,mt8186-dpi
> -    then:
> -      properties:
> -        power-domains: false
> -
>  additionalProperties: false
>
>  examples:
> --
> 2.45.2
>


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

end of thread, other threads:[~2024-10-23 14:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-03  3:09 [PATCH v6 1/4] dt-bindings: iommu: mediatek: Fix interrupt count constraint for new SoCs Macpaul Lin
2024-10-03  3:09 ` [PATCH v6 2/4] arm64: dts: mediatek: mt8395-genio-1200-evk: Fix dtbs_check error for phy Macpaul Lin
2024-10-03  3:09 ` [PATCH v6 3/4] arm64: dts: mt8195: Fix dtbs_check error for mutex node Macpaul Lin
2024-10-03  3:09 ` [PATCH v6 4/4] dt-bindings: display: mediatek: dpi: correct power-domains property Macpaul Lin
2024-10-23 14:35   ` Chun-Kuang Hu

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).