Skip to contentSkip to conversation

mt8395/mt6359: Fix several dtb-check errors

PATCH Applied Julien Massot 4 participants 11 messages May 14, 2025 – Jun 6, 2025

Subsystems (7)
lore
Share & tools
lore
#0 lore raw

v2 cover mt8395/mt6359: Fix several dtb-check errors

Hi,
This patch series addresses several dtb-check errors reported for the mt8395-genio-1200-evk.dtb and mt8395-radxa-nio-12l.dtb device trees.

The fixes include:
- Adding the missing #sound-dai-cells property in the mt6397 binding.
- Allowing 5 interrupts in the MediaTek IOMMU binding to support MT8395 properly.
- Renaming the rtc node to match expected schema naming.

---
Changes in v2:
- Patch 1/3: Add ref to dai-common as suggested by Krzysztof
- Patch 2/3: Only accept 5 interrupts for mt8195 infra IOMMU
- Patch 3/3: Add missing S-o-B
- I did not include the 'Reviewed-by' from Angelo and Nicolas since the 1/3 and 2/3 changed from v1
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Julien Massot (3):
dt-bindings: mfd: mediatek: mt6397: Add #sound-dai-cells property
dt-bindings: iommu: mediatek: Support 5 IRQs on MT8195 infra IOMMU
arm64: dts: mt6359: Rename RTC node to match binding expectations

 .../devicetree/bindings/iommu/mediatek,iommu.yaml      | 18 +++++++++++++++++-
 .../devicetree/bindings/mfd/mediatek,mt6397.yaml       |  6 ++++++
 arch/arm64/boot/dts/mediatek/mt6359.dtsi               |  2 +-
 3 files changed, 24 insertions(+), 2 deletions(-)

---
base-commit: ed61cb3d78d585209ec775933078e268544fe9a4
change-id: 20250505-mt8395-dtb-errors-0847ffc12f44

Best regards,

Signature · 1 line
Julien Massot <[email protected]>
#1 lore raw

PATCH v2 1/3 dt-bindings: mfd: mediatek: mt6397: Add #sound-dai-cells property

The 'mt6359.dtsi' file already uses the '#sound-dai-cells' property. Add the corresponding property to the binding to fix the following dtb-check error:

mediatek/mt8395-radxa-nio-12l.dtb: pmic: '#sound-dai-cells', 'mt6359rtc' do not match any of the regexes: 'pinctrl-[0-9]+' from schema $id: http://devicetree.org/schemas/mfd/mediatek,mt6397.yaml#

Fixes 9bc8353be720 ("arm64: dts: mt6359: Add #sound-dai-cells property")
---
 Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml | 6 ++++++
 1 file changed, 6 insertions(+)
Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml +6 -0
index 6a89b479d10fad3c8b61cab5a3af1453baca4d1a..9580c4ec1ae00f1dd1182357d8b0a5035a1b7f82 100644
@@ -30,6 +30,9 @@ description: |
   See the following for pwrap node definitions:
   Documentation/devicetree/bindings/soc/mediatek/mediatek,pwrap.yaml
 
+allOf:
+  - $ref: /schemas/sound/dai-common.yaml#
+
 properties:
   compatible:
     oneOf:
@@ -53,6 +56,9 @@ properties:
   "#interrupt-cells":
     const: 2
 
+  '#sound-dai-cells':
+    const: 1
+
   rtc:
     type: object
     $ref: /schemas/rtc/rtc.yaml#
Signature · 1 line
2.49.0
maintainer Reviewed-by on v2 1/3
#2 lore raw

Re: [PATCH v2 1/3] dt-bindings: mfd: mediatek: mt6397: Add #sound-dai-cells property

Il 14/05/25 10:19, Julien Massot ha scritto:

Quoted 9 lines

The 'mt6359.dtsi' file already uses the '#sound-dai-cells' property. Add the corresponding property to the binding to fix the following dtb-check error:

mediatek/mt8395-radxa-nio-12l.dtb: pmic: '#sound-dai-cells', 'mt6359rtc' do not match any of the regexes: 'pinctrl-[0-9]+' from schema $id: http://devicetree.org/schemas/mfd/mediatek,mt6397.yaml#

Fixes 9bc8353be720 ("arm64: dts: mt6359: Add #sound-dai-cells property")
#3 lore raw

Re: [PATCH v2 1/3] dt-bindings: mfd: mediatek: mt6397: Add #sound-dai-cells property

In reply to Julien Massot
Quoted 6 lines · Julien Massot

The 'mt6359.dtsi' file already uses the '#sound-dai-cells' property. Add the corresponding property to the binding to fix the following dtb-check error:

mediatek/mt8395-radxa-nio-12l.dtb: pmic: '#sound-dai-cells', 'mt6359rtc' do not match any of the regexes: 'pinctrl-[0-9]+' from schema $id: http://devicetree.org/schemas/mfd/mediatek,mt6397.yaml#

If this is a random drive-by, would be fine, but if that's your platform which you should know, then I expect this to be a real reason instead something which can easily be rejected with: what if DTS is wrong?

I could not find the ASoC driver for that compatible and quick glance to MFD shown me no usage of dai cells, so you need proper explanation here.

Especially, that there is a subnode audio-codec, so adding dai cells to the parent node feels just wrong. One is wrong - either subnode or parent is a codec.

Quoted 22 lines
Fixes 9bc8353be720 ("arm64: dts: mt6359: Add #sound-dai-cells property")
---
 Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml | 6 ++++++
 1 file changed, 6 insertions(+)
Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml +3 -0
index 6a89b479d10fad3c8b61cab5a3af1453baca4d1a..9580c4ec1ae00f1dd1182357d8b0a5035a1b7f82 100644
@@ -30,6 +30,9 @@ description: |
   See the following for pwrap node definitions:
   Documentation/devicetree/bindings/soc/mediatek/mediatek,pwrap.yaml
 
+allOf:
+  - $ref: /schemas/sound/dai-common.yaml#
+
 properties:
   compatible:
     oneOf:

Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml properties: · line 60

Quoted 5 lines
Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml +2 -0
@@ -53,6 +56,9 @@ properties:
   "#interrupt-cells":
     const: 2
 
+  '#sound-dai-cells':
+    const: 1

Also extend the example, if there is one for such device.

Best regards,
Krzysztof

#4 lore raw

Re: [PATCH v2 1/3] dt-bindings: mfd: mediatek: mt6397: Add #sound-dai-cells property

Quoted 12 lines · Krzysztof Kozlowski
Quoted 6 lines · Julien Massot

The 'mt6359.dtsi' file already uses the '#sound-dai-cells' property. Add the corresponding property to the binding to fix the following dtb-check error:

mediatek/mt8395-radxa-nio-12l.dtb: pmic: '#sound-dai-cells', 'mt6359rtc' do not match any of the regexes: 'pinctrl-[0-9]+' from schema $id: http://devicetree.org/schemas/mfd/mediatek,mt6397.yaml#

If this is a random drive-by, would be fine, but if that's your platform which you should know, then I expect this to be a real reason instead something which can easily be rejected with: what if DTS is wrong?

Quoted 6 lines

I could not find the ASoC driver for that compatible and quick glance to MFD shown me no usage of dai cells, so you need proper explanation here.

Especially, that there is a subnode audio-codec, so adding dai cells to the parent node feels just wrong. One is wrong - either subnode or parent is a codec.

The driver is sound/soc/codecs/mt6359.c, which defines 2 DAIs. It's currently probed by the MFD through the driver name, hence the parent MFD device is the one used to register the audio component.

The right fix would probably be to add the compatible both to the ASoC and the MFD drivers, and then move the dai-cells to the sound subnode in DT.

Thanks,
Nícolas

#5 lore raw

Re: [PATCH v2 1/3] dt-bindings: mfd: mediatek: mt6397: Add #sound-dai-cells property

Quoted 16 lines · Nícolas F. R. A. Prado
Quoted 15 lines · Krzysztof Kozlowski
Quoted 6 lines · Julien Massot

The 'mt6359.dtsi' file already uses the '#sound-dai-cells' property. Add the corresponding property to the binding to fix the following dtb-check error:

mediatek/mt8395-radxa-nio-12l.dtb: pmic: '#sound-dai-cells', 'mt6359rtc' do not match any of the regexes: 'pinctrl-[0-9]+' from schema $id: http://devicetree.org/schemas/mfd/mediatek,mt6397.yaml#

If this is a random drive-by, would be fine, but if that's your platform which you should know, then I expect this to be a real reason instead something which can easily be rejected with: what if DTS is wrong?

I could not find the ASoC driver for that compatible and quick glance to MFD shown me no usage of dai cells, so you need proper explanation here.

Quoted 6 lines
Quoted 3 lines

Especially, that there is a subnode audio-codec, so adding dai cells to the parent node feels just wrong. One is wrong - either subnode or parent is a codec.

The driver is sound/soc/codecs/mt6359.c, which defines 2 DAIs. It's currently probed by the MFD through the driver name, hence the parent MFD device is the

It does not matter whether MFD or simple bus instantiates a device. Really.

Quoted 1 line

one used to register the audio component.

I see codecs/mt6359.c registering the component, not the parent MFD device. This change does not look right but maybe the binding needs fixes as well.

Best regards,
Krzysztof

#6 lore raw

PATCH v2 2/3 dt-bindings: iommu: mediatek: Support 5 IRQs on MT8195 infra IOMMU

In reply to Julien Massot

The MT8195 Infra IOMMU is currently the only Mediatek IOMMU instance that uses five interrupts instead of one.

Update the binding to allow either one or five interrupts, depending on the compatible string. This avoids dtbs_check errors on platforms like the Radxa NIO 12L using the MT8395 SoC:

mediatek/mt8395-radxa-nio-12l.dtb: 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

Fixes 3b5838d1d82e3 ("arm64: dts: mt8195: Add iommu and smi nodes")
---
 .../devicetree/bindings/iommu/mediatek,iommu.yaml      | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml +17 -1
index 75750c64157c868725c087500ac81be4e282c829..5068617a5146c8a8d61234d83c19d2848d5e708f 100644
@@ -97,7 +97,8 @@ properties:
     maxItems: 1
 
   interrupts:
-    maxItems: 1
+    minItems: 1
+    maxItems: 5
 
   clocks:
     items:
@@ -201,6 +202,21 @@ allOf:
       required:
         - mediatek,infracfg
 
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - mediatek,mt8195-iommu-infra
+    then:
+      properties:
+        interrupts:
+          minItems: 5
+    else:
+      properties:
+        interrupts:
+          maxItems: 1
+
   - if: # The IOMMUs don't have larbs.
       not:
         properties:
Signature · 1 line
2.49.0
#7 lore raw

Re: [PATCH v2 2/3] dt-bindings: iommu: mediatek: Support 5 IRQs on MT8195 infra IOMMU

Quoted 14 lines · Julien Massot
Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml +2 -1
@@ -97,7 +97,8 @@ properties:
     maxItems: 1
 
   interrupts:
-    maxItems: 1
+    minItems: 1
+    maxItems: 5
 
   clocks:
     items:
@@ -201,6 +202,21 @@ allOf:
       required:
         - mediatek,infracfg
 

Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml allOf: · line 214

Quoted 10 lines
Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml +10 -0
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - mediatek,mt8195-iommu-infra
+    then:
+      properties:
+        interrupts:
+          minItems: 5

Instead list the items here and in else:, or in top-level if first interrupt is the same.

Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml allOf: · line 218

Quoted 4 lines
Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml +4 -0
+    else:
+      properties:
+        interrupts:
+          maxItems: 1

Best regards,
Krzysztof

#8 lore raw

PATCH v2 3/3 arm64: dts: mt6359: Rename RTC node to match binding expectations

In reply to Julien Massot

Rename the node 'mt6359rtc' to 'rtc', as required by the binding.

Fix the following dtb-check error:

mediatek/mt8395-radxa-nio-12l.dtb: pmic: 'mt6359rtc' do not match any of the regexes: 'pinctrl-[0-9]+'

Fixes 3b7d143be4b7 ("arm64: dts: mt6359: add PMIC MT6359 related nodes")
---
 arch/arm64/boot/dts/mediatek/mt6359.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/mediatek/mt6359.dtsi +1 -1
index 0c479404b3fe3adc9789386e34bda4dc580b5abd..467d8a4c2aa7f16ade92a287ecdeed5089302045 100644
@@ -300,7 +300,7 @@ mt6359_vsram_others_sshub_ldo: ldo_vsram_others_sshub {
 			};
 		};
 
-		mt6359rtc: mt6359rtc {
+		mt6359rtc: rtc {
 			compatible = "mediatek,mt6358-rtc";
 		};
 	};
Signature · 1 line
2.49.0
maintainer Reviewed-by on v2 3/3
#9 lore raw

Re: [PATCH v2 3/3] arm64: dts: mt6359: Rename RTC node to match binding expectations

Il 14/05/25 10:19, Julien Massot ha scritto:

Quoted 9 lines

Rename the node 'mt6359rtc' to 'rtc', as required by the binding.

Fix the following dtb-check error:

mediatek/mt8395-radxa-nio-12l.dtb: pmic: 'mt6359rtc' do not match any of the regexes: 'pinctrl-[0-9]+'

Fixes 3b7d143be4b7 ("arm64: dts: mt6359: add PMIC MT6359 related nodes")
maintainer Applied
#10 lore raw

Re: (subset) [PATCH v2 0/3] mt8395/mt6359: Fix several dtb-check errors

In reply to Julien Massot
Quoted 8 lines · Julien Massot

This patch series addresses several dtb-check errors reported for the mt8395-genio-1200-evk.dtb and mt8395-radxa-nio-12l.dtb device trees.

The fixes include:
- Adding the missing #sound-dai-cells property in the mt6397 binding.
- Allowing 5 interrupts in the MediaTek IOMMU binding to support MT8395 properly.
- Renaming the rtc node to match expected schema naming.

[...]

Applied to v6.15-next/dts64, thanks!

[3/3] arm64: dts: mt6359: Rename RTC node to match binding expectations

      commit: e19de38cca6d037bf3ab5b9908d49e230f817062

Cheers,
Angelo