Skip to contentSkip to conversation

Add mmc support for mt7988

PATCH Superseded Frank Wunderlich 5 participants 16 messages Oct 6, 2024 – Oct 7, 2024

Subsystems (4)

v2 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

v2 cover Add mmc support for mt7988

From: Frank Wunderlich <[email protected]>

Add MMC-Support for MT798 SoC

changes in v2:
- corrected minItems to require all 4 clocks

Frank Wunderlich (2):
dt-bindings: mmc: mtk-sd: Add mt7988 SoC
mmc: mtk-sd: add support for mt7988

 .../devicetree/bindings/mmc/mtk-sd.yaml       | 24 +++++++++++++++++++
 drivers/mmc/host/mtk-sd.c                     | 14 +++++++++++
 2 files changed, 38 insertions(+)
Signature · 1 line
2.43.0
#1 lore raw

PATCH v2 1/2 dt-bindings: mmc: mtk-sd: Add mt7988 SoC

From: Frank Wunderlich <[email protected]>

Add binding definitions for mmc on MT7988 SoC.

---
v2:
- fixed minItems to 4

---
 .../devicetree/bindings/mmc/mtk-sd.yaml       | 24 +++++++++++++++++++
 1 file changed, 24 insertions(+)
Documentation/devicetree/bindings/mmc/mtk-sd.yaml +24 -0
index c532ec92d2d9..7380f72ea189 100644
@@ -21,6 +21,7 @@ properties:
           - mediatek,mt7620-mmc
           - mediatek,mt7622-mmc
           - mediatek,mt7986-mmc
+          - mediatek,mt7988-mmc
           - mediatek,mt8135-mmc
           - mediatek,mt8173-mmc
           - mediatek,mt8183-mmc
@@ -263,6 +264,29 @@ allOf:
             - const: bus_clk
             - const: sys_cg
 
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - mediatek,mt7988-mmc
+    then:
+      properties:
+        clocks:
+          minItems: 4
+          items:
+            - description: source clock
+            - description: HCLK which used for host
+            - description: Advanced eXtensible Interface
+            - description: Advanced High-performance Bus clock
+        clock-names:
+          minItems: 3
+          items:
+            - const: source
+            - const: hclk
+            - const: axi_cg
+            - const: ahb_cg
+
   - if:
       properties:
         compatible:
Signature · 1 line
2.43.0
#2 lore raw

Re: [PATCH v2 1/2] dt-bindings: mmc: mtk-sd: Add mt7988 SoC

Quoted 28 lines · Frank Wunderlich

From: Frank Wunderlich <[email protected]>

Add binding definitions for mmc on MT7988 SoC.

---
v2:
- fixed minItems to 4

---
 .../devicetree/bindings/mmc/mtk-sd.yaml       | 24 +++++++++++++++++++
 1 file changed, 24 insertions(+)
Documentation/devicetree/bindings/mmc/mtk-sd.yaml +1 -0
index c532ec92d2d9..7380f72ea189 100644
@@ -21,6 +21,7 @@ properties:
           - mediatek,mt7620-mmc
           - mediatek,mt7622-mmc
           - mediatek,mt7986-mmc
+          - mediatek,mt7988-mmc
           - mediatek,mt8135-mmc
           - mediatek,mt8173-mmc
           - mediatek,mt8183-mmc
@@ -263,6 +264,29 @@ allOf:
             - const: bus_clk
             - const: sys_cg
 

Documentation/devicetree/bindings/mmc/mtk-sd.yaml allOf: · line 276

Quoted 10 lines
Documentation/devicetree/bindings/mmc/mtk-sd.yaml +10 -0
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - mediatek,mt7988-mmc
+    then:
+      properties:
+        clocks:
+          minItems: 4

Drop

Documentation/devicetree/bindings/mmc/mtk-sd.yaml allOf: · line 283

Quoted 7 lines
Documentation/devicetree/bindings/mmc/mtk-sd.yaml +7 -0
+          items:
+            - description: source clock
+            - description: HCLK which used for host
+            - description: Advanced eXtensible Interface
+            - description: Advanced High-performance Bus clock
+        clock-names:
+          minItems: 3

This is still wrong... anyway, drop.

Best regards,
Krzysztof

#3 lore raw

Aw: Re: [PATCH v2 1/2] dt-bindings: mmc: mtk-sd: Add mt7988 SoC

Quoted 55 lines

Gesendet: Montag, 07. Oktober 2024 um 07:55 Uhr
Von: "Krzysztof Kozlowski" <[email protected]>
An: "Frank Wunderlich" <[email protected]>
Betreff: Re: [PATCH v2 1/2] dt-bindings: mmc: mtk-sd: Add mt7988 SoC

Quoted 28 lines · Frank Wunderlich

From: Frank Wunderlich <[email protected]>

Add binding definitions for mmc on MT7988 SoC.

---
v2:
- fixed minItems to 4

---
 .../devicetree/bindings/mmc/mtk-sd.yaml       | 24 +++++++++++++++++++
 1 file changed, 24 insertions(+)
Documentation/devicetree/bindings/mmc/mtk-sd.yaml +1 -0
index c532ec92d2d9..7380f72ea189 100644
@@ -21,6 +21,7 @@ properties:
           - mediatek,mt7620-mmc
           - mediatek,mt7622-mmc
           - mediatek,mt7986-mmc
+          - mediatek,mt7988-mmc
           - mediatek,mt8135-mmc
           - mediatek,mt8173-mmc
           - mediatek,mt8183-mmc
@@ -263,6 +264,29 @@ allOf:
             - const: bus_clk
             - const: sys_cg
 

Documentation/devicetree/bindings/mmc/mtk-sd.yaml allOf: · line 276

Quoted 10 lines
Documentation/devicetree/bindings/mmc/mtk-sd.yaml +10 -0
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - mediatek,mt7988-mmc
+    then:
+      properties:
+        clocks:
+          minItems: 4

Drop

Documentation/devicetree/bindings/mmc/mtk-sd.yaml allOf: · line 283

Quoted 7 lines
Documentation/devicetree/bindings/mmc/mtk-sd.yaml +7 -0
+          items:
+            - description: source clock
+            - description: HCLK which used for host
+            - description: Advanced eXtensible Interface
+            - description: Advanced High-performance Bus clock
+        clock-names:
+          minItems: 3
Quoted 1 line

This is still wrong... anyway, drop.

arg, sorry again...i should triple-check all before resending.

but dropping means the global 2 is used (making axi+ahb optional), or am i wrong? afaik "minItems: 4" is right here

Quoted 3 lines

Best regards,
Krzysztof

regards Frank

#4 lore raw

Re: Aw: Re: [PATCH v2 1/2] dt-bindings: mmc: mtk-sd: Add mt7988 SoC

Quoted 34 lines · Frank Wunderlich
Quoted 34 lines

Gesendet: Montag, 07. Oktober 2024 um 07:55 Uhr
Von: "Krzysztof Kozlowski" <[email protected]>
An: "Frank Wunderlich" <[email protected]>
Betreff: Re: [PATCH v2 1/2] dt-bindings: mmc: mtk-sd: Add mt7988 SoC

Quoted 28 lines · Frank Wunderlich

From: Frank Wunderlich <[email protected]>

Add binding definitions for mmc on MT7988 SoC.

---
v2:
- fixed minItems to 4

---
 .../devicetree/bindings/mmc/mtk-sd.yaml       | 24 +++++++++++++++++++
 1 file changed, 24 insertions(+)
Documentation/devicetree/bindings/mmc/mtk-sd.yaml +1 -0
index c532ec92d2d9..7380f72ea189 100644
@@ -21,6 +21,7 @@ properties:
           - mediatek,mt7620-mmc
           - mediatek,mt7622-mmc
           - mediatek,mt7986-mmc
+          - mediatek,mt7988-mmc
           - mediatek,mt8135-mmc
           - mediatek,mt8173-mmc
           - mediatek,mt8183-mmc
@@ -263,6 +264,29 @@ allOf:
             - const: bus_clk
             - const: sys_cg
 
Quoted 12 lines
Quoted 11 lines

Documentation/devicetree/bindings/mmc/mtk-sd.yaml allOf: · line 276

Quoted 10 lines
Documentation/devicetree/bindings/mmc/mtk-sd.yaml +10 -0
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - mediatek,mt7988-mmc
+    then:
+      properties:
+        clocks:
+          minItems: 4
Quoted 1 line

Drop

Drop this line.

Quoted 9 lines
Quoted 9 lines
Quoted 8 lines
Documentation/devicetree/bindings/mmc/mtk-sd.yaml +7 -0
+          items:
+            - description: source clock
+            - description: HCLK which used for host
+            - description: Advanced eXtensible Interface
+            - description: Advanced High-performance Bus clock
+        clock-names:
+          minItems: 3
Quoted 3 lines
Quoted 1 line

This is still wrong... anyway, drop.

arg, sorry again...i should triple-check all before resending.

Drop this line.

Quoted 2 lines

but dropping means the global 2 is used (making axi+ahb optional), or am i wrong? afaik "minItems: 4" is right here

How minItems:4 is right here?

Best regards,
Krzysztof

#5 lore raw

Aw: Re: Re: [PATCH v2 1/2] dt-bindings: mmc: mtk-sd: Add mt7988 SoC

Hi

Quoted 65 lines

Gesendet: Montag, 07. Oktober 2024 um 09:04 Uhr
Von: "Krzysztof Kozlowski" <[email protected]>
Betreff: Re: Aw: Re: [PATCH v2 1/2] dt-bindings: mmc: mtk-sd: Add mt7988 SoC

Quoted 34 lines · Frank Wunderlich
Quoted 34 lines

Gesendet: Montag, 07. Oktober 2024 um 07:55 Uhr
Von: "Krzysztof Kozlowski" <[email protected]>
An: "Frank Wunderlich" <[email protected]>
Betreff: Re: [PATCH v2 1/2] dt-bindings: mmc: mtk-sd: Add mt7988 SoC

Quoted 28 lines · Frank Wunderlich

From: Frank Wunderlich <[email protected]>

Add binding definitions for mmc on MT7988 SoC.

---
v2:
- fixed minItems to 4

---
 .../devicetree/bindings/mmc/mtk-sd.yaml       | 24 +++++++++++++++++++
 1 file changed, 24 insertions(+)
Documentation/devicetree/bindings/mmc/mtk-sd.yaml +1 -0
index c532ec92d2d9..7380f72ea189 100644
@@ -21,6 +21,7 @@ properties:
           - mediatek,mt7620-mmc
           - mediatek,mt7622-mmc
           - mediatek,mt7986-mmc
+          - mediatek,mt7988-mmc
           - mediatek,mt8135-mmc
           - mediatek,mt8173-mmc
           - mediatek,mt8183-mmc
@@ -263,6 +264,29 @@ allOf:
             - const: bus_clk
             - const: sys_cg
 
Quoted 12 lines
Quoted 11 lines

Documentation/devicetree/bindings/mmc/mtk-sd.yaml allOf: · line 276

Quoted 10 lines
Documentation/devicetree/bindings/mmc/mtk-sd.yaml +10 -0
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - mediatek,mt7988-mmc
+    then:
+      properties:
+        clocks:
+          minItems: 4
Quoted 1 line

Drop

Drop this line.

Quoted 11 lines
Quoted 10 lines

Documentation/devicetree/bindings/mmc/mtk-sd.yaml allOf: · line 283

Quoted 8 lines
Documentation/devicetree/bindings/mmc/mtk-sd.yaml +7 -0
+          items:
+            - description: source clock
+            - description: HCLK which used for host
+            - description: Advanced eXtensible Interface
+            - description: Advanced High-performance Bus clock
+        clock-names:
+          minItems: 3

This is still wrong... anyway, drop.

Quoted 8 lines
Quoted 1 line

arg, sorry again...i should triple-check all before resending.

Drop this line.

Quoted 2 lines

but dropping means the global 2 is used (making axi+ahb optional), or am i wrong? afaik "minItems: 4" is right here

How minItems:4 is right here?

mt7988 needs all 4 clocks, tested with only first 2 (based on global minitems) and got this (similar with first 3 clocks):

[   10.826271] mtk-msdc 11230000.mmc: msdc_request_timeout: aborting cmd/data/mrq
[   10.833485] mtk-msdc 11230000.mmc: msdc_request_timeout: aborting mrq=(____ptrval____) cmd=18
[   10.842006] mtk-msdc 11230000.mmc: msdc_request_timeout: aborting cmd=23
[   10.848704] mtk-msdc 11230000.mmc: msdc_track_cmd_data: cmd=18 arg=00036402; host->error=0x00000002
[   15.866269] mtk-msdc 11230000.mmc: msdc_request_timeout: aborting cmd/data/mrq
[   15.873480] mtk-msdc 11230000.mmc: msdc_request_timeout: aborting mrq=(____ptrval____) cmd=13
[   15.881998] mtk-msdc 11230000.mmc: msdc_request_timeout: aborting cmd=13
[   15.888694] mtk-msdc 11230000.mmc: msdc_track_cmd_data: cmd=13 arg=00010000; host->error=0x00000002

so minItems:4 is imho right here

Quoted 4 lines

Best regards,
Krzysztof

#6 lore raw

Re: Aw: Re: Re: [PATCH v2 1/2] dt-bindings: mmc: mtk-sd: Add mt7988 SoC

Quoted 86 lines · Frank Wunderlich

Hi

Quoted 65 lines

Gesendet: Montag, 07. Oktober 2024 um 09:04 Uhr
Von: "Krzysztof Kozlowski" <[email protected]>
Betreff: Re: Aw: Re: [PATCH v2 1/2] dt-bindings: mmc: mtk-sd: Add mt7988 SoC

Quoted 34 lines · Frank Wunderlich
Quoted 34 lines

Gesendet: Montag, 07. Oktober 2024 um 07:55 Uhr
Von: "Krzysztof Kozlowski" <[email protected]>
An: "Frank Wunderlich" <[email protected]>
Betreff: Re: [PATCH v2 1/2] dt-bindings: mmc: mtk-sd: Add mt7988 SoC

Quoted 28 lines · Frank Wunderlich

From: Frank Wunderlich <[email protected]>

Add binding definitions for mmc on MT7988 SoC.

---
v2:
- fixed minItems to 4

---
 .../devicetree/bindings/mmc/mtk-sd.yaml       | 24 +++++++++++++++++++
 1 file changed, 24 insertions(+)
Documentation/devicetree/bindings/mmc/mtk-sd.yaml +1 -0
index c532ec92d2d9..7380f72ea189 100644
@@ -21,6 +21,7 @@ properties:
           - mediatek,mt7620-mmc
           - mediatek,mt7622-mmc
           - mediatek,mt7986-mmc
+          - mediatek,mt7988-mmc
           - mediatek,mt8135-mmc
           - mediatek,mt8173-mmc
           - mediatek,mt8183-mmc
@@ -263,6 +264,29 @@ allOf:
             - const: bus_clk
             - const: sys_cg
 
Quoted 12 lines
Quoted 11 lines

Documentation/devicetree/bindings/mmc/mtk-sd.yaml allOf: · line 276

Quoted 10 lines
Documentation/devicetree/bindings/mmc/mtk-sd.yaml +10 -0
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - mediatek,mt7988-mmc
+    then:
+      properties:
+        clocks:
+          minItems: 4
Quoted 1 line

Drop

Drop this line.

Quoted 11 lines
Quoted 10 lines

Documentation/devicetree/bindings/mmc/mtk-sd.yaml allOf: · line 283

Quoted 8 lines
Documentation/devicetree/bindings/mmc/mtk-sd.yaml +7 -0
+          items:
+            - description: source clock
+            - description: HCLK which used for host
+            - description: Advanced eXtensible Interface
+            - description: Advanced High-performance Bus clock
+        clock-names:
+          minItems: 3

This is still wrong... anyway, drop.

Quoted 8 lines
Quoted 1 line

arg, sorry again...i should triple-check all before resending.

Drop this line.

Quoted 2 lines

but dropping means the global 2 is used (making axi+ahb optional), or am i wrong? afaik "minItems: 4" is right here

How minItems:4 is right here?

mt7988 needs all 4 clocks, tested with only first 2 (based on global minitems) and got this (similar with first 3 clocks):

[   10.826271] mtk-msdc 11230000.mmc: msdc_request_timeout: aborting cmd/data/mrq
[   10.833485] mtk-msdc 11230000.mmc: msdc_request_timeout: aborting mrq=(____ptrval____) cmd=18
[   10.842006] mtk-msdc 11230000.mmc: msdc_request_timeout: aborting cmd=23
[   10.848704] mtk-msdc 11230000.mmc: msdc_track_cmd_data: cmd=18 arg=00036402; host->error=0x00000002
[   15.866269] mtk-msdc 11230000.mmc: msdc_request_timeout: aborting cmd/data/mrq
[   15.873480] mtk-msdc 11230000.mmc: msdc_request_timeout: aborting mrq=(____ptrval____) cmd=13
[   15.881998] mtk-msdc 11230000.mmc: msdc_request_timeout: aborting cmd=13
[   15.888694] mtk-msdc 11230000.mmc: msdc_track_cmd_data: cmd=13 arg=00010000; host->error=0x00000002
Quoted 1 line

so minItems:4 is imho right here

So the list has 5 items? Then your binding is incomplete.

Best regards,
Krzysztof

#7 lore raw

Re: [PATCH v2 1/2] dt-bindings: mmc: mtk-sd: Add mt7988 SoC

In reply to Frank Wunderlich

Il 06/10/24 17:34, Frank Wunderlich ha scritto:

Quoted 25 lines

From: Frank Wunderlich <[email protected]>

Add binding definitions for mmc on MT7988 SoC.

---
v2:
- fixed minItems to 4

---
  .../devicetree/bindings/mmc/mtk-sd.yaml       | 24 +++++++++++++++++++
  1 file changed, 24 insertions(+)
Documentation/devicetree/bindings/mmc/mtk-sd.yaml +1 -0
index c532ec92d2d9..7380f72ea189 100644
@@ -21,6 +21,7 @@ properties:
            - mediatek,mt7620-mmc
            - mediatek,mt7622-mmc
            - mediatek,mt7986-mmc
+          - mediatek,mt7988-mmc
            - mediatek,mt8135-mmc
            - mediatek,mt8173-mmc
            - mediatek,mt8183-mmc

Documentation/devicetree/bindings/mmc/mtk-sd.yaml allOf: · line 272

Quoted 9 lines
Documentation/devicetree/bindings/mmc/mtk-sd.yaml +6 -0
@@ -263,6 +264,29 @@ allOf:
              - const: bus_clk
              - const: sys_cg
 
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - mediatek,mt7988-mmc

Are you really sure that you can't reuse the MT7986 compatible?

Cheers,
Angelo

Quoted 20 lines
Documentation/devicetree/bindings/mmc/mtk-sd.yaml +17 -0
+    then:
+      properties:
+        clocks:
+          minItems: 4
+          items:
+            - description: source clock
+            - description: HCLK which used for host
+            - description: Advanced eXtensible Interface
+            - description: Advanced High-performance Bus clock
+        clock-names:
+          minItems: 3
+          items:
+            - const: source
+            - const: hclk
+            - const: axi_cg
+            - const: ahb_cg
+
    - if:
        properties:
          compatible:
#8 lore raw

Aw: Re: [PATCH v2 1/2] dt-bindings: mmc: mtk-sd: Add mt7988 SoC

Hi

Quoted 33 lines

Gesendet: Montag, 07. Oktober 2024 um 10:00 Uhr
Von: "AngeloGioacchino Del Regno" <[email protected]>
Betreff: Re: [PATCH v2 1/2] dt-bindings: mmc: mtk-sd: Add mt7988 SoC

Il 06/10/24 17:34, Frank Wunderlich ha scritto:

Quoted 28 lines

From: Frank Wunderlich <[email protected]>

Add binding definitions for mmc on MT7988 SoC.

---
v2:
- fixed minItems to 4

---
  .../devicetree/bindings/mmc/mtk-sd.yaml       | 24 +++++++++++++++++++
  1 file changed, 24 insertions(+)
Documentation/devicetree/bindings/mmc/mtk-sd.yaml +1 -0
index c532ec92d2d9..7380f72ea189 100644
@@ -21,6 +21,7 @@ properties:
            - mediatek,mt7620-mmc
            - mediatek,mt7622-mmc
            - mediatek,mt7986-mmc
+          - mediatek,mt7988-mmc
            - mediatek,mt8135-mmc
            - mediatek,mt8173-mmc
            - mediatek,mt8183-mmc
@@ -263,6 +264,29 @@ allOf:
              - const: bus_clk
              - const: sys_cg
 
Quoted 8 lines

Documentation/devicetree/bindings/mmc/mtk-sd.yaml allOf: · line 272

Quoted 6 lines
Documentation/devicetree/bindings/mmc/mtk-sd.yaml +6 -0
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - mediatek,mt7988-mmc

Are you really sure that you can't reuse the MT7986 compatible?

have not found a way to reuse mt7986 binding because clock-config is different... from driver view we can use the mt7986 compatible, but from binding view it is different.

regards Frank

Quoted 26 lines

Cheers,
Angelo

Quoted 20 lines
Documentation/devicetree/bindings/mmc/mtk-sd.yaml +17 -0
+    then:
+      properties:
+        clocks:
+          minItems: 4
+          items:
+            - description: source clock
+            - description: HCLK which used for host
+            - description: Advanced eXtensible Interface
+            - description: Advanced High-performance Bus clock
+        clock-names:
+          minItems: 3
+          items:
+            - const: source
+            - const: hclk
+            - const: axi_cg
+            - const: ahb_cg
+
    - if:
        properties:
          compatible:
#9 lore raw

Re: Aw: Re: [PATCH v2 1/2] dt-bindings: mmc: mtk-sd: Add mt7988 SoC

Il 07/10/24 10:33, Frank Wunderlich ha scritto:

Quoted 44 lines

Hi

Quoted 33 lines

Gesendet: Montag, 07. Oktober 2024 um 10:00 Uhr
Von: "AngeloGioacchino Del Regno" <[email protected]>
Betreff: Re: [PATCH v2 1/2] dt-bindings: mmc: mtk-sd: Add mt7988 SoC

Il 06/10/24 17:34, Frank Wunderlich ha scritto:

Quoted 28 lines

From: Frank Wunderlich <[email protected]>

Add binding definitions for mmc on MT7988 SoC.

---
v2:
- fixed minItems to 4

---
   .../devicetree/bindings/mmc/mtk-sd.yaml       | 24 +++++++++++++++++++
   1 file changed, 24 insertions(+)
Documentation/devicetree/bindings/mmc/mtk-sd.yaml +1 -0
index c532ec92d2d9..7380f72ea189 100644
@@ -21,6 +21,7 @@ properties:
             - mediatek,mt7620-mmc
             - mediatek,mt7622-mmc
             - mediatek,mt7986-mmc
+          - mediatek,mt7988-mmc
             - mediatek,mt8135-mmc
             - mediatek,mt8173-mmc
             - mediatek,mt8183-mmc
@@ -263,6 +264,29 @@ allOf:
               - const: bus_clk
               - const: sys_cg
 
Quoted 8 lines

Documentation/devicetree/bindings/mmc/mtk-sd.yaml allOf: · line 272

Quoted 6 lines
Documentation/devicetree/bindings/mmc/mtk-sd.yaml +6 -0
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - mediatek,mt7988-mmc

Are you really sure that you can't reuse the MT7986 compatible?

Quoted 3 lines

have not found a way to reuse mt7986 binding because clock-config is different... from driver view we can use the mt7986 compatible, but from binding view it is different.

Okay, that's fair.

Quoted 28 lines

regards Frank

Quoted 26 lines

Cheers,
Angelo

Quoted 20 lines
Documentation/devicetree/bindings/mmc/mtk-sd.yaml +17 -0
+    then:
+      properties:
+        clocks:
+          minItems: 4
+          items:
+            - description: source clock
+            - description: HCLK which used for host
+            - description: Advanced eXtensible Interface
+            - description: Advanced High-performance Bus clock
+        clock-names:
+          minItems: 3
+          items:
+            - const: source
+            - const: hclk
+            - const: axi_cg
+            - const: ahb_cg
+
     - if:
         properties:
           compatible:
#10 lore raw

Re: [PATCH v2 1/2] dt-bindings: mmc: mtk-sd: Add mt7988 SoC

In reply to AngeloGioacchino Del Regno
Quoted 28 lines · AngeloGioacchino Del Regno

Il 06/10/24 17:34, Frank Wunderlich ha scritto:

Quoted 27 lines

From: Frank Wunderlich <[email protected]>

Add binding definitions for mmc on MT7988 SoC.

---
v2:
- fixed minItems to 4

---
  .../devicetree/bindings/mmc/mtk-sd.yaml       | 24 +++++++++++++++++++
  1 file changed, 24 insertions(+)
Documentation/devicetree/bindings/mmc/mtk-sd.yaml +1 -0
index c532ec92d2d9..7380f72ea189 100644
@@ -21,6 +21,7 @@ properties:
            - mediatek,mt7620-mmc
            - mediatek,mt7622-mmc
            - mediatek,mt7986-mmc
+          - mediatek,mt7988-mmc
            - mediatek,mt8135-mmc
            - mediatek,mt8173-mmc
            - mediatek,mt8183-mmc
@@ -263,6 +264,29 @@ allOf:
              - const: bus_clk
              - const: sys_cg
Quoted 8 lines

Documentation/devicetree/bindings/mmc/mtk-sd.yaml allOf: · line 272

Quoted 6 lines
Documentation/devicetree/bindings/mmc/mtk-sd.yaml +6 -0
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - mediatek,mt7988-mmc

Are you really sure that you can't reuse the MT7986 compatible?

In OpenWrt we are doing exactly that. The MMC controller of MT7988 (and MT7981) seems 100% the same as in MT7986 and hence works just fine with the mediatek,mt7986-mmc compatible.

#11 lore raw

PATCH v2 2/2 mmc: mtk-sd: add support for mt7988

In reply to Frank Wunderlich

From: Frank Wunderlich <[email protected]>

Add support for mmc on MT7988 SoC.

---
 drivers/mmc/host/mtk-sd.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
drivers/mmc/host/mtk-sd.c +14 -0
index 89018b6c97b9..6d5afe51a61d 100644
@@ -571,6 +571,19 @@ static const struct mtk_mmc_compatible mt7986_compat = {
 	.support_64g = true,
 };
 
+static const struct mtk_mmc_compatible mt7988_compat = {
+	.clk_div_bits = 12,
+	.recheck_sdio_irq = true,
+	.hs400_tune = false,
+	.pad_tune_reg = MSDC_PAD_TUNE0,
+	.async_fifo = true,
+	.data_tune = true,
+	.busy_check = true,
+	.stop_clk_fix = true,
+	.enhance_rx = true,
+	.support_64g = true,
+};
+
 static const struct mtk_mmc_compatible mt8135_compat = {
 	.clk_div_bits = 8,
 	.recheck_sdio_irq = true,
@@ -629,6 +642,7 @@ static const struct of_device_id msdc_of_ids[] = {
 	{ .compatible = "mediatek,mt7620-mmc", .data = &mt7620_compat},
 	{ .compatible = "mediatek,mt7622-mmc", .data = &mt7622_compat},
 	{ .compatible = "mediatek,mt7986-mmc", .data = &mt7986_compat},
+	{ .compatible = "mediatek,mt7988-mmc", .data = &mt7988_compat},
 	{ .compatible = "mediatek,mt8135-mmc", .data = &mt8135_compat},
 	{ .compatible = "mediatek,mt8173-mmc", .data = &mt8173_compat},
 	{ .compatible = "mediatek,mt8183-mmc", .data = &mt8183_compat},
Signature · 1 line
2.43.0
#12 lore raw

Re: [PATCH v2 2/2] mmc: mtk-sd: add support for mt7988

Il 06/10/24 17:34, Frank Wunderlich ha scritto:

Quoted 5 lines

From: Frank Wunderlich <[email protected]>

Add support for mmc on MT7988 SoC.

There's no need to add yet one more duplicate mtk_mmc_compatible platform data, nor one more compatible string to this driver, as this is exactly the same as mt7986.

Please reuse the MT7986 compatible; in DT you'll have:

compatible = "mediatek,mt7988-mmc", "mediatek,mt7986-mmc";

Cheers,
Angelo

Quoted 36 lines
---
  drivers/mmc/host/mtk-sd.c | 14 ++++++++++++++
  1 file changed, 14 insertions(+)
drivers/mmc/host/mtk-sd.c +14 -0
index 89018b6c97b9..6d5afe51a61d 100644
@@ -571,6 +571,19 @@ static const struct mtk_mmc_compatible mt7986_compat = {
  	.support_64g = true,
  };
 
+static const struct mtk_mmc_compatible mt7988_compat = {
+	.clk_div_bits = 12,
+	.recheck_sdio_irq = true,
+	.hs400_tune = false,
+	.pad_tune_reg = MSDC_PAD_TUNE0,
+	.async_fifo = true,
+	.data_tune = true,
+	.busy_check = true,
+	.stop_clk_fix = true,
+	.enhance_rx = true,
+	.support_64g = true,
+};
+
  static const struct mtk_mmc_compatible mt8135_compat = {
  	.clk_div_bits = 8,
  	.recheck_sdio_irq = true,
@@ -629,6 +642,7 @@ static const struct of_device_id msdc_of_ids[] = {
  	{ .compatible = "mediatek,mt7620-mmc", .data = &mt7620_compat},
  	{ .compatible = "mediatek,mt7622-mmc", .data = &mt7622_compat},
  	{ .compatible = "mediatek,mt7986-mmc", .data = &mt7986_compat},
+	{ .compatible = "mediatek,mt7988-mmc", .data = &mt7988_compat},
  	{ .compatible = "mediatek,mt8135-mmc", .data = &mt8135_compat},
  	{ .compatible = "mediatek,mt8173-mmc", .data = &mt8173_compat},
  	{ .compatible = "mediatek,mt8183-mmc", .data = &mt8183_compat},
#13 lore raw

Aw: Re: [PATCH v2 2/2] mmc: mtk-sd: add support for mt7988

Hi

Quoted 11 lines

Gesendet: Montag, 07. Oktober 2024 um 09:58 Uhr
Von: "AngeloGioacchino Del Regno" <[email protected]>
Betreff: Re: [PATCH v2 2/2] mmc: mtk-sd: add support for mt7988

Il 06/10/24 17:34, Frank Wunderlich ha scritto:

Quoted 5 lines

From: Frank Wunderlich <[email protected]>

Add support for mmc on MT7988 SoC.

Quoted 7 lines

There's no need to add yet one more duplicate mtk_mmc_compatible platform data, nor one more compatible string to this driver, as this is exactly the same as mt7986.

Please reuse the MT7986 compatible; in DT you'll have:

compatible = "mediatek,mt7988-mmc", "mediatek,mt7986-mmc";

as explained in binding, the clock config is completely different (except first 2 also required by driver - 3-7 are optional there). mt7988 uses axi and ahb clocks.

but i could of course use the mt7988 compatible with mt7986 compat data...but looked dirty to me so just copied the block (to allow later changes if needed).

Quoted 41 lines

Cheers,
Angelo

Quoted 36 lines
---
  drivers/mmc/host/mtk-sd.c | 14 ++++++++++++++
  1 file changed, 14 insertions(+)
drivers/mmc/host/mtk-sd.c +14 -0
index 89018b6c97b9..6d5afe51a61d 100644
@@ -571,6 +571,19 @@ static const struct mtk_mmc_compatible mt7986_compat = {
  	.support_64g = true,
  };
 
+static const struct mtk_mmc_compatible mt7988_compat = {
+	.clk_div_bits = 12,
+	.recheck_sdio_irq = true,
+	.hs400_tune = false,
+	.pad_tune_reg = MSDC_PAD_TUNE0,
+	.async_fifo = true,
+	.data_tune = true,
+	.busy_check = true,
+	.stop_clk_fix = true,
+	.enhance_rx = true,
+	.support_64g = true,
+};
+
  static const struct mtk_mmc_compatible mt8135_compat = {
  	.clk_div_bits = 8,
  	.recheck_sdio_irq = true,
@@ -629,6 +642,7 @@ static const struct of_device_id msdc_of_ids[] = {
  	{ .compatible = "mediatek,mt7620-mmc", .data = &mt7620_compat},
  	{ .compatible = "mediatek,mt7622-mmc", .data = &mt7622_compat},
  	{ .compatible = "mediatek,mt7986-mmc", .data = &mt7986_compat},
+	{ .compatible = "mediatek,mt7988-mmc", .data = &mt7988_compat},
  	{ .compatible = "mediatek,mt8135-mmc", .data = &mt8135_compat},
  	{ .compatible = "mediatek,mt8173-mmc", .data = &mt8173_compat},
  	{ .compatible = "mediatek,mt8183-mmc", .data = &mt8183_compat},
#14 lore raw

Re: Aw: Re: [PATCH v2 2/2] mmc: mtk-sd: add support for mt7988

Il 07/10/24 10:37, Frank Wunderlich ha scritto:

Quoted 17 lines

Hi

Quoted 15 lines

Gesendet: Montag, 07. Oktober 2024 um 09:58 Uhr
Von: "AngeloGioacchino Del Regno" <[email protected]>
Betreff: Re: [PATCH v2 2/2] mmc: mtk-sd: add support for mt7988

Il 06/10/24 17:34, Frank Wunderlich ha scritto:

Quoted 5 lines

From: Frank Wunderlich <[email protected]>

Add support for mmc on MT7988 SoC.

There's no need to add yet one more duplicate mtk_mmc_compatible platform data, nor one more compatible string to this driver, as this is exactly the same as mt7986.

Quoted 8 lines
Quoted 3 lines

Please reuse the MT7986 compatible; in DT you'll have:

compatible = "mediatek,mt7988-mmc", "mediatek,mt7986-mmc";

as explained in binding, the clock config is completely different (except first 2 also required by driver - 3-7 are optional there). mt7988 uses axi and ahb clocks.

but i could of course use the mt7988 compatible with mt7986 compat data...but looked dirty to me so just copied the block (to allow later changes if needed).

In case there will be any changes required *later*, you can always add new platform data for the MT7988 compatible, as it's just only a code change and nothing else.

For now, since they're the same, just reuse mt7986_compat.

Reusing is way better than duplicating - here and everywhere else - especially when this implies a 100% duplication.

Quoted 41 lines
Quoted 41 lines

Cheers,
Angelo

Quoted 36 lines
---
   drivers/mmc/host/mtk-sd.c | 14 ++++++++++++++
   1 file changed, 14 insertions(+)
drivers/mmc/host/mtk-sd.c +14 -0
index 89018b6c97b9..6d5afe51a61d 100644
@@ -571,6 +571,19 @@ static const struct mtk_mmc_compatible mt7986_compat = {
   	.support_64g = true,
   };
 
+static const struct mtk_mmc_compatible mt7988_compat = {
+	.clk_div_bits = 12,
+	.recheck_sdio_irq = true,
+	.hs400_tune = false,
+	.pad_tune_reg = MSDC_PAD_TUNE0,
+	.async_fifo = true,
+	.data_tune = true,
+	.busy_check = true,
+	.stop_clk_fix = true,
+	.enhance_rx = true,
+	.support_64g = true,
+};
+
   static const struct mtk_mmc_compatible mt8135_compat = {
   	.clk_div_bits = 8,
   	.recheck_sdio_irq = true,
@@ -629,6 +642,7 @@ static const struct of_device_id msdc_of_ids[] = {
   	{ .compatible = "mediatek,mt7620-mmc", .data = &mt7620_compat},
   	{ .compatible = "mediatek,mt7622-mmc", .data = &mt7622_compat},
   	{ .compatible = "mediatek,mt7986-mmc", .data = &mt7986_compat},
+	{ .compatible = "mediatek,mt7988-mmc", .data = &mt7988_compat},
   	{ .compatible = "mediatek,mt8135-mmc", .data = &mt8135_compat},
   	{ .compatible = "mediatek,mt8173-mmc", .data = &mt8173_compat},
   	{ .compatible = "mediatek,mt8183-mmc", .data = &mt8183_compat},
#15 lore raw

Re: Aw: Re: [PATCH v2 2/2] mmc: mtk-sd: add support for mt7988

Quoted 27 lines · AngeloGioacchino Del Regno

Il 07/10/24 10:37, Frank Wunderlich ha scritto:

Quoted 17 lines

Hi

Quoted 15 lines

Gesendet: Montag, 07. Oktober 2024 um 09:58 Uhr
Von: "AngeloGioacchino Del Regno" <[email protected]>
Betreff: Re: [PATCH v2 2/2] mmc: mtk-sd: add support for mt7988

Il 06/10/24 17:34, Frank Wunderlich ha scritto:

Quoted 5 lines

From: Frank Wunderlich <[email protected]>

Add support for mmc on MT7988 SoC.

There's no need to add yet one more duplicate mtk_mmc_compatible platform data, nor one more compatible string to this driver, as this is exactly the same as mt7986.

Quoted 8 lines
Quoted 3 lines

Please reuse the MT7986 compatible; in DT you'll have:

compatible = "mediatek,mt7988-mmc", "mediatek,mt7986-mmc";

as explained in binding, the clock config is completely different (except first 2 also required by driver - 3-7 are optional there). mt7988 uses axi and ahb clocks.

but i could of course use the mt7988 compatible with mt7986 compat data...but looked dirty to me so just copied the block (to allow later changes if needed).

Quoted 7 lines

In case there will be any changes required *later*, you can always add new platform data for the MT7988 compatible, as it's just only a code change and nothing else.

For now, since they're the same, just reuse mt7986_compat.

Reusing is way better than duplicating - here and everywhere else - especially when this implies a 100% duplication.

If you use same match data, then entire change should be dropped because it is redundant. Instead express compatibility in the bindings and use fallback.

Best regards,
Krzysztof