linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/7] Add mmc-support for mt7986
@ 2022-10-23  9:12 Frank Wunderlich
  2022-10-23  9:12 ` [PATCH v3 1/7] dt-bindings: mmc: Add compatible for Mediatek MT7986 Frank Wunderlich
                   ` (6 more replies)
  0 siblings, 7 replies; 14+ messages in thread
From: Frank Wunderlich @ 2022-10-23  9:12 UTC (permalink / raw)
  To: linux-mediatek
  Cc: Frank Wunderlich, Chaotian Jing, Ulf Hansson, Rob Herring,
	Krzysztof Kozlowski, Matthias Brugger, Wenbin Mei, linux-mmc,
	devicetree, linux-arm-kernel, linux-kernel

From: Frank Wunderlich <frank-w@public-files.de>

I've noticed the mtk-sd binding needs a bit more work get into a more
clean state.

There are 2 properties missing that maybe need to be added later or
dropped from devicetrees:
drv-type (which is used in mt8183-kukui.dtsi and set to <2>)
and
r_smpl (used in mt7622-rfb1.dts and mt7622-bananapi-bpi-r64.dts, both
times set to <1>)

i don't know their function and boundaries and i do not find them in
driver. I guess they are added by accident, so i removing them in the
patches 5+6.

v2:
- add compatible based binding
v3:
- solve "not" statement in binding and reorder if statements,drop mt8183
- added patches removing invalid properties (not in driver)


Frank Wunderlich (4):
  dt-bindings: mmc: mtk-sd: add mt7986
  arm64: dts: mediatek: mt2712e: swap last 2 clocks to match binding
  arm64: dts: mt8183: drop drv-type from mmc-node
  arm64: dts: mt7622: drop r_smpl property from mmc node

Nícolas F. R. A. Prado (1):
  dt-bindings: mmc: mtk-sd: Set clocks based on compatible

Sam Shih (2):
  dt-bindings: mmc: Add compatible for Mediatek MT7986
  mmc: mediatek: add support for MT7986 SoC

 .../devicetree/bindings/mmc/mtk-sd.yaml       | 137 ++++++++++++++----
 arch/arm64/boot/dts/mediatek/mt2712e.dtsi     |   6 +-
 .../dts/mediatek/mt7622-bananapi-bpi-r64.dts  |   1 -
 arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts  |   1 -
 .../arm64/boot/dts/mediatek/mt8183-kukui.dtsi |   1 -
 drivers/mmc/host/mtk-sd.c                     |  14 ++
 6 files changed, 124 insertions(+), 36 deletions(-)

-- 
2.34.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] 14+ messages in thread

* [PATCH v3 1/7] dt-bindings: mmc: Add compatible for Mediatek MT7986
  2022-10-23  9:12 [PATCH v3 0/7] Add mmc-support for mt7986 Frank Wunderlich
@ 2022-10-23  9:12 ` Frank Wunderlich
  2022-10-23  9:12 ` [PATCH v3 2/7] dt-bindings: mmc: mtk-sd: Set clocks based on compatible Frank Wunderlich
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 14+ messages in thread
From: Frank Wunderlich @ 2022-10-23  9:12 UTC (permalink / raw)
  To: linux-mediatek
  Cc: Frank Wunderlich, Chaotian Jing, Ulf Hansson, Rob Herring,
	Krzysztof Kozlowski, Matthias Brugger, Wenbin Mei, linux-mmc,
	devicetree, linux-arm-kernel, linux-kernel, Sam Shih,
	Rob Herring

From: Sam Shih <sam.shih@mediatek.com>

This commit adds dt-binding documentation of mmc for Mediatek MT7986 SoC
Platform.

Signed-off-by: Sam Shih <sam.shih@mediatek.com>
Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
Acked-by: Rob Herring <robh@kernel.org>
---
 Documentation/devicetree/bindings/mmc/mtk-sd.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/mmc/mtk-sd.yaml b/Documentation/devicetree/bindings/mmc/mtk-sd.yaml
index d8e1e2e9adf2..3cbf0208f1b4 100644
--- a/Documentation/devicetree/bindings/mmc/mtk-sd.yaml
+++ b/Documentation/devicetree/bindings/mmc/mtk-sd.yaml
@@ -23,6 +23,7 @@ properties:
           - mediatek,mt6795-mmc
           - mediatek,mt7620-mmc
           - mediatek,mt7622-mmc
+          - mediatek,mt7986-mmc
           - mediatek,mt8135-mmc
           - mediatek,mt8173-mmc
           - mediatek,mt8183-mmc
-- 
2.34.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] 14+ messages in thread

* [PATCH v3 2/7] dt-bindings: mmc: mtk-sd: Set clocks based on compatible
  2022-10-23  9:12 [PATCH v3 0/7] Add mmc-support for mt7986 Frank Wunderlich
  2022-10-23  9:12 ` [PATCH v3 1/7] dt-bindings: mmc: Add compatible for Mediatek MT7986 Frank Wunderlich
@ 2022-10-23  9:12 ` Frank Wunderlich
  2022-10-23 12:56   ` Krzysztof Kozlowski
  2022-10-24 16:43   ` Nícolas F. R. A. Prado
  2022-10-23  9:12 ` [PATCH v3 3/7] dt-bindings: mmc: mtk-sd: add mt7986 Frank Wunderlich
                   ` (4 subsequent siblings)
  6 siblings, 2 replies; 14+ messages in thread
From: Frank Wunderlich @ 2022-10-23  9:12 UTC (permalink / raw)
  To: linux-mediatek
  Cc: Frank Wunderlich, Chaotian Jing, Ulf Hansson, Rob Herring,
	Krzysztof Kozlowski, Matthias Brugger, Wenbin Mei, linux-mmc,
	devicetree, linux-arm-kernel, linux-kernel,
	Nícolas F. R. A. Prado

From: Nícolas F. R. A. Prado <nfraprado@collabora.com>

The binding was describing a single clock list for all platforms, but
that's not really suitable:

Most platforms using at least 2 clocks (source, hclk), some of them
a third "source_cg". Mt2712 requires an extra 'bus_clk' on some of
its controllers, while mt8192 requires 8 clocks.

Move the clock definitions inside if blocks that match on the
compatibles.

I used Patch from Nícolas F. R. A. Prado and modified it to not using
"not" statement.

Fixes: 59a23395d8aa ("dt-bindings: mmc: Add support for MT8192 SoC")
Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Signed-off-by: Frank Wunderlich <frank-w@public-files.de>

---
v2:
- add this patch
v3:
- add blank lines and change "not" to matchlist
- reorder entries - make generic first then order alphanumeric
- rewrite commit description
- drop soc-specific mt8183 - constraints were also set for it above
---
 .../devicetree/bindings/mmc/mtk-sd.yaml       | 113 +++++++++++++-----
 1 file changed, 83 insertions(+), 30 deletions(-)

diff --git a/Documentation/devicetree/bindings/mmc/mtk-sd.yaml b/Documentation/devicetree/bindings/mmc/mtk-sd.yaml
index 3cbf0208f1b4..31bb6dc329d2 100644
--- a/Documentation/devicetree/bindings/mmc/mtk-sd.yaml
+++ b/Documentation/devicetree/bindings/mmc/mtk-sd.yaml
@@ -10,9 +10,6 @@ maintainers:
   - Chaotian Jing <chaotian.jing@mediatek.com>
   - Wenbin Mei <wenbin.mei@mediatek.com>
 
-allOf:
-  - $ref: mmc-controller.yaml#
-
 properties:
   compatible:
     oneOf:
@@ -49,27 +46,11 @@ properties:
     description:
       Should contain phandle for the clock feeding the MMC controller.
     minItems: 2
-    items:
-      - description: source clock (required).
-      - description: HCLK which used for host (required).
-      - description: independent source clock gate (required for MT2712).
-      - description: bus clock used for internal register access (required for MT2712 MSDC0/3).
-      - description: msdc subsys clock gate (required for MT8192).
-      - description: peripheral bus clock gate (required for MT8192).
-      - description: AXI bus clock gate (required for MT8192).
-      - description: AHB bus clock gate (required for MT8192).
+    maxItems: 7
 
   clock-names:
     minItems: 2
-    items:
-      - const: source
-      - const: hclk
-      - const: source_cg
-      - const: bus_clk
-      - const: sys_cg
-      - const: pclk_cg
-      - const: axi_cg
-      - const: ahb_cg
+    maxItems: 7
 
   interrupts:
     description:
@@ -191,15 +172,87 @@ required:
   - vmmc-supply
   - vqmmc-supply
 
-if:
-  properties:
-    compatible:
-      contains:
-        const: mediatek,mt8183-mmc
-then:
-  properties:
-    reg:
-      minItems: 2
+allOf:
+  - $ref: mmc-controller.yaml#
+  - if:
+      properties:
+        compatible:
+          enum:
+            - mediatek,mt2701-mmc
+            - mediatek,mt6779-mmc
+            - mediatek,mt6795-mmc
+            - mediatek,mt7620-mmc
+            - mediatek,mt7622-mmc
+            - mediatek,mt7623-mmc
+            - mediatek,mt8135-mmc
+            - mediatek,mt8173-mmc
+            - mediatek,mt8183-mmc
+            - mediatek,mt8186-mmc
+            - mediatek,mt8188-mmc
+            - mediatek,mt8195-mmc
+            - mediatek,mt8516-mmc
+    then:
+      properties:
+        clocks:
+          minItems: 2
+          items:
+            - description: source clock
+            - description: HCLK which used for host
+            - description: independent source clock gate
+        clock-names:
+          minItems: 2
+          items:
+            - const: source
+            - const: hclk
+            - const: source_cg
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: mediatek,mt2712-mmc
+    then:
+      properties:
+        clocks:
+          minItems: 3
+          items:
+            - description: source clock
+            - description: HCLK which used for host
+            - description: independent source clock gate
+            - description: bus clock used for internal register access (required for MSDC0/3).
+        clock-names:
+          minItems: 3
+          items:
+            - const: source
+            - const: hclk
+            - const: source_cg
+            - const: bus_clk
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: mediatek,mt8192-mmc
+    then:
+      properties:
+        clocks:
+          items:
+            - description: source clock
+            - description: HCLK which used for host
+            - description: independent source clock gate
+            - description: msdc subsys clock gate
+            - description: peripheral bus clock gate
+            - description: AXI bus clock gate
+            - description: AHB bus clock gate
+        clock-names:
+          items:
+            - const: source
+            - const: hclk
+            - const: source_cg
+            - const: sys_cg
+            - const: pclk_cg
+            - const: axi_cg
+            - const: ahb_cg
 
 unevaluatedProperties: false
 
-- 
2.34.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] 14+ messages in thread

* [PATCH v3 3/7] dt-bindings: mmc: mtk-sd: add mt7986
  2022-10-23  9:12 [PATCH v3 0/7] Add mmc-support for mt7986 Frank Wunderlich
  2022-10-23  9:12 ` [PATCH v3 1/7] dt-bindings: mmc: Add compatible for Mediatek MT7986 Frank Wunderlich
  2022-10-23  9:12 ` [PATCH v3 2/7] dt-bindings: mmc: mtk-sd: Set clocks based on compatible Frank Wunderlich
@ 2022-10-23  9:12 ` Frank Wunderlich
  2022-10-23 12:56   ` Krzysztof Kozlowski
  2022-10-23  9:12 ` [PATCH v3 4/7] arm64: dts: mediatek: mt2712e: swap last 2 clocks to match binding Frank Wunderlich
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 14+ messages in thread
From: Frank Wunderlich @ 2022-10-23  9:12 UTC (permalink / raw)
  To: linux-mediatek
  Cc: Frank Wunderlich, Chaotian Jing, Ulf Hansson, Rob Herring,
	Krzysztof Kozlowski, Matthias Brugger, Wenbin Mei, linux-mmc,
	devicetree, linux-arm-kernel, linux-kernel

From: Frank Wunderlich <frank-w@public-files.de>

Add SoC specific section for defining clock configuration.

Signed-off-by: Frank Wunderlich <frank-w@public-files.de>

---
v3:
- drop assigned-clocks/assigned-clock-parents
- fix clock description
---
 .../devicetree/bindings/mmc/mtk-sd.yaml       | 23 +++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/Documentation/devicetree/bindings/mmc/mtk-sd.yaml b/Documentation/devicetree/bindings/mmc/mtk-sd.yaml
index 31bb6dc329d2..17b346a60e4c 100644
--- a/Documentation/devicetree/bindings/mmc/mtk-sd.yaml
+++ b/Documentation/devicetree/bindings/mmc/mtk-sd.yaml
@@ -228,6 +228,29 @@ allOf:
             - const: source_cg
             - const: bus_clk
 
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - mediatek,mt7986-mmc
+    then:
+      properties:
+        clocks:
+          minItems: 3
+          items:
+            - description: source clock
+            - description: HCLK which used for host
+            - description: AXI bus clock gate
+            - description: AHB bus clock gate
+        clock-names:
+          minItems: 3
+          items:
+            - const: source
+            - const: hclk
+            - const: axi_cg
+            - const: ahb_cg
+
   - if:
       properties:
         compatible:
-- 
2.34.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] 14+ messages in thread

* [PATCH v3 4/7] arm64: dts: mediatek: mt2712e: swap last 2 clocks to match binding
  2022-10-23  9:12 [PATCH v3 0/7] Add mmc-support for mt7986 Frank Wunderlich
                   ` (2 preceding siblings ...)
  2022-10-23  9:12 ` [PATCH v3 3/7] dt-bindings: mmc: mtk-sd: add mt7986 Frank Wunderlich
@ 2022-10-23  9:12 ` Frank Wunderlich
  2022-10-23  9:12 ` [PATCH v3 5/7] arm64: dts: mt8183: drop drv-type from mmc-node Frank Wunderlich
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 14+ messages in thread
From: Frank Wunderlich @ 2022-10-23  9:12 UTC (permalink / raw)
  To: linux-mediatek
  Cc: Frank Wunderlich, Chaotian Jing, Ulf Hansson, Rob Herring,
	Krzysztof Kozlowski, Matthias Brugger, Wenbin Mei, linux-mmc,
	devicetree, linux-arm-kernel, linux-kernel

From: Frank Wunderlich <frank-w@public-files.de>

First 3 clocks for mt2712 need to be "source", "hclk", "source_cg"
so swap last 2 of mmc0 to match the binding.

Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
---
 arch/arm64/boot/dts/mediatek/mt2712e.dtsi | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm64/boot/dts/mediatek/mt2712e.dtsi b/arch/arm64/boot/dts/mediatek/mt2712e.dtsi
index e6d7453e56e0..9dc0794fcd2e 100644
--- a/arch/arm64/boot/dts/mediatek/mt2712e.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt2712e.dtsi
@@ -766,9 +766,9 @@ mmc0: mmc@11230000 {
 		interrupts = <GIC_SPI 79 IRQ_TYPE_LEVEL_LOW>;
 		clocks = <&pericfg CLK_PERI_MSDC30_0>,
 			 <&pericfg CLK_PERI_MSDC50_0_HCLK_EN>,
-			 <&pericfg CLK_PERI_MSDC30_0_QTR_EN>,
-			 <&pericfg CLK_PERI_MSDC50_0_EN>;
-		clock-names = "source", "hclk", "bus_clk", "source_cg";
+			 <&pericfg CLK_PERI_MSDC50_0_EN>,
+			 <&pericfg CLK_PERI_MSDC30_0_QTR_EN>;
+		clock-names = "source", "hclk", "source_cg", "bus_clk";
 		status = "disabled";
 	};
 
-- 
2.34.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] 14+ messages in thread

* [PATCH v3 5/7] arm64: dts: mt8183: drop drv-type from mmc-node
  2022-10-23  9:12 [PATCH v3 0/7] Add mmc-support for mt7986 Frank Wunderlich
                   ` (3 preceding siblings ...)
  2022-10-23  9:12 ` [PATCH v3 4/7] arm64: dts: mediatek: mt2712e: swap last 2 clocks to match binding Frank Wunderlich
@ 2022-10-23  9:12 ` Frank Wunderlich
  2022-10-23  9:12 ` [PATCH v3 6/7] arm64: dts: mt7622: drop r_smpl property from mmc node Frank Wunderlich
  2022-10-23  9:12 ` [PATCH v3 7/7] mmc: mediatek: add support for MT7986 SoC Frank Wunderlich
  6 siblings, 0 replies; 14+ messages in thread
From: Frank Wunderlich @ 2022-10-23  9:12 UTC (permalink / raw)
  To: linux-mediatek
  Cc: Frank Wunderlich, Chaotian Jing, Ulf Hansson, Rob Herring,
	Krzysztof Kozlowski, Matthias Brugger, Wenbin Mei, linux-mmc,
	devicetree, linux-arm-kernel, linux-kernel

From: Frank Wunderlich <frank-w@public-files.de>

This property is not defined in binding and driver.

Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
---
 arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi b/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi
index b4b86bb1f1a7..0c9b18c16c89 100644
--- a/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi
@@ -378,7 +378,6 @@ &mmc1 {
 	mmc-pwrseq = <&wifi_pwrseq>;
 	bus-width = <4>;
 	max-frequency = <200000000>;
-	drv-type = <2>;
 	cap-sd-highspeed;
 	sd-uhs-sdr50;
 	sd-uhs-sdr104;
-- 
2.34.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] 14+ messages in thread

* [PATCH v3 6/7] arm64: dts: mt7622: drop r_smpl property from mmc node
  2022-10-23  9:12 [PATCH v3 0/7] Add mmc-support for mt7986 Frank Wunderlich
                   ` (4 preceding siblings ...)
  2022-10-23  9:12 ` [PATCH v3 5/7] arm64: dts: mt8183: drop drv-type from mmc-node Frank Wunderlich
@ 2022-10-23  9:12 ` Frank Wunderlich
  2022-10-23  9:12 ` [PATCH v3 7/7] mmc: mediatek: add support for MT7986 SoC Frank Wunderlich
  6 siblings, 0 replies; 14+ messages in thread
From: Frank Wunderlich @ 2022-10-23  9:12 UTC (permalink / raw)
  To: linux-mediatek
  Cc: Frank Wunderlich, Chaotian Jing, Ulf Hansson, Rob Herring,
	Krzysztof Kozlowski, Matthias Brugger, Wenbin Mei, linux-mmc,
	devicetree, linux-arm-kernel, linux-kernel

From: Frank Wunderlich <frank-w@public-files.de>

This property is not defined in binding and driver.

Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
---
 arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts | 1 -
 arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts             | 1 -
 2 files changed, 2 deletions(-)

diff --git a/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts b/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts
index d3f9eab2b784..af3fe61e4093 100644
--- a/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts
+++ b/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts
@@ -235,7 +235,6 @@ &mmc1 {
 	bus-width = <4>;
 	max-frequency = <50000000>;
 	cap-sd-highspeed;
-	r_smpl = <1>;
 	cd-gpios = <&pio 81 GPIO_ACTIVE_LOW>;
 	vmmc-supply = <&reg_3p3v>;
 	vqmmc-supply = <&reg_3p3v>;
diff --git a/arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts b/arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts
index 36722cabe626..b74e774c6eba 100644
--- a/arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts
+++ b/arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts
@@ -208,7 +208,6 @@ &mmc1 {
 	bus-width = <4>;
 	max-frequency = <50000000>;
 	cap-sd-highspeed;
-	r_smpl = <1>;
 	cd-gpios = <&pio 81 GPIO_ACTIVE_LOW>;
 	vmmc-supply = <&reg_3p3v>;
 	vqmmc-supply = <&reg_3p3v>;
-- 
2.34.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] 14+ messages in thread

* [PATCH v3 7/7] mmc: mediatek: add support for MT7986 SoC
  2022-10-23  9:12 [PATCH v3 0/7] Add mmc-support for mt7986 Frank Wunderlich
                   ` (5 preceding siblings ...)
  2022-10-23  9:12 ` [PATCH v3 6/7] arm64: dts: mt7622: drop r_smpl property from mmc node Frank Wunderlich
@ 2022-10-23  9:12 ` Frank Wunderlich
  6 siblings, 0 replies; 14+ messages in thread
From: Frank Wunderlich @ 2022-10-23  9:12 UTC (permalink / raw)
  To: linux-mediatek
  Cc: Frank Wunderlich, Chaotian Jing, Ulf Hansson, Rob Herring,
	Krzysztof Kozlowski, Matthias Brugger, Wenbin Mei, linux-mmc,
	devicetree, linux-arm-kernel, linux-kernel, Sam Shih

From: Sam Shih <sam.shih@mediatek.com>

Adding mt7986 own characteristics and of_device_id to have support
of MT7986 SoC.

Signed-off-by: Sam Shih <sam.shih@mediatek.com>
Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
---
 drivers/mmc/host/mtk-sd.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c
index df941438aef5..3f7f3a1e0df8 100644
--- a/drivers/mmc/host/mtk-sd.c
+++ b/drivers/mmc/host/mtk-sd.c
@@ -552,6 +552,19 @@ static const struct mtk_mmc_compatible mt7622_compat = {
 	.support_64g = false,
 };
 
+static const struct mtk_mmc_compatible mt7986_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,
@@ -609,6 +622,7 @@ static const struct of_device_id msdc_of_ids[] = {
 	{ .compatible = "mediatek,mt6795-mmc", .data = &mt6795_compat},
 	{ .compatible = "mediatek,mt7620-mmc", .data = &mt7620_compat},
 	{ .compatible = "mediatek,mt7622-mmc", .data = &mt7622_compat},
+	{ .compatible = "mediatek,mt7986-mmc", .data = &mt7986_compat},
 	{ .compatible = "mediatek,mt8135-mmc", .data = &mt8135_compat},
 	{ .compatible = "mediatek,mt8173-mmc", .data = &mt8173_compat},
 	{ .compatible = "mediatek,mt8183-mmc", .data = &mt8183_compat},
-- 
2.34.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] 14+ messages in thread

* Re: [PATCH v3 2/7] dt-bindings: mmc: mtk-sd: Set clocks based on compatible
  2022-10-23  9:12 ` [PATCH v3 2/7] dt-bindings: mmc: mtk-sd: Set clocks based on compatible Frank Wunderlich
@ 2022-10-23 12:56   ` Krzysztof Kozlowski
  2022-10-24 16:43   ` Nícolas F. R. A. Prado
  1 sibling, 0 replies; 14+ messages in thread
From: Krzysztof Kozlowski @ 2022-10-23 12:56 UTC (permalink / raw)
  To: Frank Wunderlich, linux-mediatek
  Cc: Frank Wunderlich, Chaotian Jing, Ulf Hansson, Rob Herring,
	Krzysztof Kozlowski, Matthias Brugger, Wenbin Mei, linux-mmc,
	devicetree, linux-arm-kernel, linux-kernel,
	Nícolas F. R. A. Prado

On 23/10/2022 05:12, Frank Wunderlich wrote:
> From: Nícolas F. R. A. Prado <nfraprado@collabora.com>
> 
> The binding was describing a single clock list for all platforms, but
> that's not really suitable:
> 
> Most platforms using at least 2 clocks (source, hclk), some of them
> a third "source_cg". Mt2712 requires an extra 'bus_clk' on some of
> its controllers, while mt8192 requires 8 clocks.
> 
> Move the clock definitions inside if blocks that match on the
> compatibles.
> 
> I used Patch from Nícolas F. R. A. Prado and modified it to not using
> "not" statement.
> 
> Fixes: 59a23395d8aa ("dt-bindings: mmc: Add support for MT8192 SoC")
> Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
> Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
> 


Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof


_______________________________________________
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] 14+ messages in thread

* Re: [PATCH v3 3/7] dt-bindings: mmc: mtk-sd: add mt7986
  2022-10-23  9:12 ` [PATCH v3 3/7] dt-bindings: mmc: mtk-sd: add mt7986 Frank Wunderlich
@ 2022-10-23 12:56   ` Krzysztof Kozlowski
  2022-10-24 14:55     ` Aw: " Frank Wunderlich
  0 siblings, 1 reply; 14+ messages in thread
From: Krzysztof Kozlowski @ 2022-10-23 12:56 UTC (permalink / raw)
  To: Frank Wunderlich, linux-mediatek
  Cc: Frank Wunderlich, Chaotian Jing, Ulf Hansson, Rob Herring,
	Krzysztof Kozlowski, Matthias Brugger, Wenbin Mei, linux-mmc,
	devicetree, linux-arm-kernel, linux-kernel

On 23/10/2022 05:12, Frank Wunderlich wrote:
> From: Frank Wunderlich <frank-w@public-files.de>
> 
> Add SoC specific section for defining clock configuration.
> 
> Signed-off-by: Frank Wunderlich <frank-w@public-files.de>


Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof


_______________________________________________
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] 14+ messages in thread

* Aw: Re: [PATCH v3 3/7] dt-bindings: mmc: mtk-sd: add mt7986
  2022-10-23 12:56   ` Krzysztof Kozlowski
@ 2022-10-24 14:55     ` Frank Wunderlich
  2022-10-24 16:48       ` Krzysztof Kozlowski
  0 siblings, 1 reply; 14+ messages in thread
From: Frank Wunderlich @ 2022-10-24 14:55 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Frank Wunderlich, linux-mediatek, Chaotian Jing, Ulf Hansson,
	Rob Herring, Krzysztof Kozlowski, Matthias Brugger, Wenbin Mei,
	linux-mmc, devicetree, linux-arm-kernel, linux-kernel

Hi

> Gesendet: Sonntag, 23. Oktober 2022 um 14:56 Uhr
> Von: "Krzysztof Kozlowski" <krzysztof.kozlowski@linaro.org>
> An: "Frank Wunderlich" <linux@fw-web.de>, linux-mediatek@lists.infradead.org
> Cc: "Frank Wunderlich" <frank-w@public-files.de>, "Chaotian Jing" <chaotian.jing@mediatek.com>, "Ulf Hansson" <ulf.hansson@linaro.org>, "Rob Herring" <robh+dt@kernel.org>, "Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>, "Matthias Brugger" <matthias.bgg@gmail.com>, "Wenbin Mei" <wenbin.mei@mediatek.com>, linux-mmc@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org
> Betreff: Re: [PATCH v3 3/7] dt-bindings: mmc: mtk-sd: add mt7986
>
> On 23/10/2022 05:12, Frank Wunderlich wrote:
> > From: Frank Wunderlich <frank-w@public-files.de>
> >
> > Add SoC specific section for defining clock configuration.
> >
> > Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
>
>
> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Hi,

got another config from mtk which requires changing binding a bit

                       clocks = <&topckgen CLK_TOP_EMMC_416M_SEL>,
                                <&infracfg CLK_INFRA_MSDC_HCK_CK>,
                                <&infracfg CLK_INFRA_MSDC_CK>,
                                <&infracfg CLK_INFRA_MSDC_133M_CK>,
                                 <&infracfg CLK_INFRA_MSDC_66M_CK>;
                       clock-names = "source", "hclk", "source_cg", "bus_clk",
                                     "sys_cg";
in binding:

+++ b/Documentation/devicetree/bindings/mmc/mtk-sd.yaml
@@ -241,15 +241,17 @@ allOf:
           items:
             - description: source clock
             - description: HCLK which used for host
-            - description: AXI bus clock gate
-            - description: AHB bus clock gate
+            - description: independent source clock gate
+            - description: bus clock used for internal register access (required for MSDC0/3).
+            - description: msdc subsys clock gate
         clock-names:
           minItems: 3
           items:
             - const: source
             - const: hclk
-            - const: axi_cg
-            - const: ahb_cg
+            - const: "source_cg"
+            - const: "bus_clk"
+            - const: "sys_cg"

will send an updated v4...old version was working but i should use the new one.

@Krzysztof can i take your RB here or should i leave it as Patch was changed?

regards Frank

_______________________________________________
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] 14+ messages in thread

* Re: [PATCH v3 2/7] dt-bindings: mmc: mtk-sd: Set clocks based on compatible
  2022-10-23  9:12 ` [PATCH v3 2/7] dt-bindings: mmc: mtk-sd: Set clocks based on compatible Frank Wunderlich
  2022-10-23 12:56   ` Krzysztof Kozlowski
@ 2022-10-24 16:43   ` Nícolas F. R. A. Prado
  2022-10-24 18:42     ` Frank Wunderlich
  1 sibling, 1 reply; 14+ messages in thread
From: Nícolas F. R. A. Prado @ 2022-10-24 16:43 UTC (permalink / raw)
  To: Frank Wunderlich
  Cc: linux-mediatek, Frank Wunderlich, Chaotian Jing, Ulf Hansson,
	Rob Herring, Krzysztof Kozlowski, Matthias Brugger, Wenbin Mei,
	linux-mmc, devicetree, linux-arm-kernel, linux-kernel

Hi,

thank you for picking this up.

On Sun, Oct 23, 2022 at 11:12:42AM +0200, Frank Wunderlich wrote:
> From: Nícolas F. R. A. Prado <nfraprado@collabora.com>
> 
> The binding was describing a single clock list for all platforms, but
> that's not really suitable:
> 
> Most platforms using at least 2 clocks (source, hclk), some of them
> a third "source_cg". Mt2712 requires an extra 'bus_clk' on some of
> its controllers, while mt8192 requires 8 clocks.
> 
> Move the clock definitions inside if blocks that match on the
> compatibles.
> 
> I used Patch from Nícolas F. R. A. Prado and modified it to not using
> "not" statement.
> 
> Fixes: 59a23395d8aa ("dt-bindings: mmc: Add support for MT8192 SoC")
> Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
> Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
> 
> ---
> v2:
> - add this patch
> v3:
> - add blank lines and change "not" to matchlist
> - reorder entries - make generic first then order alphanumeric
> - rewrite commit description
> - drop soc-specific mt8183 - constraints were also set for it above

This is wrong, see below.

> ---
>  .../devicetree/bindings/mmc/mtk-sd.yaml       | 113 +++++++++++++-----
>  1 file changed, 83 insertions(+), 30 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/mmc/mtk-sd.yaml b/Documentation/devicetree/bindings/mmc/mtk-sd.yaml
> index 3cbf0208f1b4..31bb6dc329d2 100644
> --- a/Documentation/devicetree/bindings/mmc/mtk-sd.yaml
> +++ b/Documentation/devicetree/bindings/mmc/mtk-sd.yaml
[..]
>  
> -if:
> -  properties:
> -    compatible:
> -      contains:
> -        const: mediatek,mt8183-mmc
> -then:
> -  properties:
> -    reg:
> -      minItems: 2

You can't drop this. Nodes with the mt8183 compatible should keep requiring two
reg values. It's not covered by the branch below.

Thanks,
Nícolas

> +allOf:
> +  - $ref: mmc-controller.yaml#
> +  - if:
> +      properties:
> +        compatible:
> +          enum:
> +            - mediatek,mt2701-mmc
> +            - mediatek,mt6779-mmc
> +            - mediatek,mt6795-mmc
> +            - mediatek,mt7620-mmc
> +            - mediatek,mt7622-mmc
> +            - mediatek,mt7623-mmc
> +            - mediatek,mt8135-mmc
> +            - mediatek,mt8173-mmc
> +            - mediatek,mt8183-mmc
> +            - mediatek,mt8186-mmc
> +            - mediatek,mt8188-mmc
> +            - mediatek,mt8195-mmc
> +            - mediatek,mt8516-mmc
> +    then:
> +      properties:
> +        clocks:
> +          minItems: 2
> +          items:
> +            - description: source clock
> +            - description: HCLK which used for host
> +            - description: independent source clock gate
> +        clock-names:
> +          minItems: 2
> +          items:
> +            - const: source
> +            - const: hclk
> +            - const: source_cg
> +
[..]

_______________________________________________
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] 14+ messages in thread

* Re: Aw: Re: [PATCH v3 3/7] dt-bindings: mmc: mtk-sd: add mt7986
  2022-10-24 14:55     ` Aw: " Frank Wunderlich
@ 2022-10-24 16:48       ` Krzysztof Kozlowski
  0 siblings, 0 replies; 14+ messages in thread
From: Krzysztof Kozlowski @ 2022-10-24 16:48 UTC (permalink / raw)
  To: Frank Wunderlich
  Cc: Frank Wunderlich, linux-mediatek, Chaotian Jing, Ulf Hansson,
	Rob Herring, Krzysztof Kozlowski, Matthias Brugger, Wenbin Mei,
	linux-mmc, devicetree, linux-arm-kernel, linux-kernel

On 24/10/2022 10:55, Frank Wunderlich wrote:
> Hi
> 
>> Gesendet: Sonntag, 23. Oktober 2022 um 14:56 Uhr
>> Von: "Krzysztof Kozlowski" <krzysztof.kozlowski@linaro.org>
>> An: "Frank Wunderlich" <linux@fw-web.de>, linux-mediatek@lists.infradead.org
>> Cc: "Frank Wunderlich" <frank-w@public-files.de>, "Chaotian Jing" <chaotian.jing@mediatek.com>, "Ulf Hansson" <ulf.hansson@linaro.org>, "Rob Herring" <robh+dt@kernel.org>, "Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>, "Matthias Brugger" <matthias.bgg@gmail.com>, "Wenbin Mei" <wenbin.mei@mediatek.com>, linux-mmc@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org
>> Betreff: Re: [PATCH v3 3/7] dt-bindings: mmc: mtk-sd: add mt7986
>>
>> On 23/10/2022 05:12, Frank Wunderlich wrote:
>>> From: Frank Wunderlich <frank-w@public-files.de>
>>>
>>> Add SoC specific section for defining clock configuration.
>>>
>>> Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
>>
>>
>> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> 
> Hi,
> 
> got another config from mtk which requires changing binding a bit
> 
>                        clocks = <&topckgen CLK_TOP_EMMC_416M_SEL>,
>                                 <&infracfg CLK_INFRA_MSDC_HCK_CK>,
>                                 <&infracfg CLK_INFRA_MSDC_CK>,
>                                 <&infracfg CLK_INFRA_MSDC_133M_CK>,
>                                  <&infracfg CLK_INFRA_MSDC_66M_CK>;
>                        clock-names = "source", "hclk", "source_cg", "bus_clk",
>                                      "sys_cg";
> in binding:
> 
> +++ b/Documentation/devicetree/bindings/mmc/mtk-sd.yaml
> @@ -241,15 +241,17 @@ allOf:
>            items:
>              - description: source clock
>              - description: HCLK which used for host
> -            - description: AXI bus clock gate
> -            - description: AHB bus clock gate
> +            - description: independent source clock gate
> +            - description: bus clock used for internal register access (required for MSDC0/3).
> +            - description: msdc subsys clock gate
>          clock-names:
>            minItems: 3
>            items:
>              - const: source
>              - const: hclk
> -            - const: axi_cg
> -            - const: ahb_cg
> +            - const: "source_cg"
> +            - const: "bus_clk"
> +            - const: "sys_cg"
> 
> will send an updated v4...old version was working but i should use the new one.
> 
> @Krzysztof can i take your RB here or should i leave it as Patch was changed?

Please drop my tag, so I will re-review it.

Thanks!

Best regards,
Krzysztof


_______________________________________________
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] 14+ messages in thread

* Re: [PATCH v3 2/7] dt-bindings: mmc: mtk-sd: Set clocks based on compatible
  2022-10-24 16:43   ` Nícolas F. R. A. Prado
@ 2022-10-24 18:42     ` Frank Wunderlich
  0 siblings, 0 replies; 14+ messages in thread
From: Frank Wunderlich @ 2022-10-24 18:42 UTC (permalink / raw)
  To: Nícolas F. R. A. Prado
  Cc: linux-mediatek, Frank Wunderlich, Chaotian Jing, Ulf Hansson,
	Rob Herring, Krzysztof Kozlowski, Matthias Brugger, Wenbin Mei,
	linux-mmc, devicetree, linux-arm-kernel, linux-kernel

Am 24. Oktober 2022 18:43:53 MESZ schrieb "Nícolas F. R. A. Prado" <nfraprado@collabora.com>:
>Hi,
>
>thank you for picking this up.
>
>On Sun, Oct 23, 2022 at 11:12:42AM +0200, Frank Wunderlich wrote:
>> From: Nícolas F. R. A. Prado <nfraprado@collabora.com>
>> 
>> The binding was describing a single clock list for all platforms, but
>> that's not really suitable:
>> 
>> Most platforms using at least 2 clocks (source, hclk), some of them
>> a third "source_cg". Mt2712 requires an extra 'bus_clk' on some of
>> its controllers, while mt8192 requires 8 clocks.
>> 
>> Move the clock definitions inside if blocks that match on the
>> compatibles.
>> 
>> I used Patch from Nícolas F. R. A. Prado and modified it to not using
>> "not" statement.
>> 
>> Fixes: 59a23395d8aa ("dt-bindings: mmc: Add support for MT8192 SoC")
>> Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
>> Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
>> 
>> ---
>> v2:
>> - add this patch
>> v3:
>> - add blank lines and change "not" to matchlist
>> - reorder entries - make generic first then order alphanumeric
>> - rewrite commit description
>> - drop soc-specific mt8183 - constraints were also set for it above
>
>This is wrong, see below.

You are right,will fix in v4

>> ---
>>  .../devicetree/bindings/mmc/mtk-sd.yaml       | 113 +++++++++++++-----
>>  1 file changed, 83 insertions(+), 30 deletions(-)
>> 
>> diff --git a/Documentation/devicetree/bindings/mmc/mtk-sd.yaml b/Documentation/devicetree/bindings/mmc/mtk-sd.yaml
>> index 3cbf0208f1b4..31bb6dc329d2 100644
>> --- a/Documentation/devicetree/bindings/mmc/mtk-sd.yaml
>> +++ b/Documentation/devicetree/bindings/mmc/mtk-sd.yaml
>[..]
>>  
>> -if:
>> -  properties:
>> -    compatible:
>> -      contains:
>> -        const: mediatek,mt8183-mmc
>> -then:
>> -  properties:
>> -    reg:
>> -      minItems: 2
>
>You can't drop this. Nodes with the mt8183 compatible should keep requiring two
>reg values. It's not covered by the branch below.
>
>Thanks,
>Nícolas


regards Frank

_______________________________________________
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] 14+ messages in thread

end of thread, other threads:[~2022-10-24 18:43 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-23  9:12 [PATCH v3 0/7] Add mmc-support for mt7986 Frank Wunderlich
2022-10-23  9:12 ` [PATCH v3 1/7] dt-bindings: mmc: Add compatible for Mediatek MT7986 Frank Wunderlich
2022-10-23  9:12 ` [PATCH v3 2/7] dt-bindings: mmc: mtk-sd: Set clocks based on compatible Frank Wunderlich
2022-10-23 12:56   ` Krzysztof Kozlowski
2022-10-24 16:43   ` Nícolas F. R. A. Prado
2022-10-24 18:42     ` Frank Wunderlich
2022-10-23  9:12 ` [PATCH v3 3/7] dt-bindings: mmc: mtk-sd: add mt7986 Frank Wunderlich
2022-10-23 12:56   ` Krzysztof Kozlowski
2022-10-24 14:55     ` Aw: " Frank Wunderlich
2022-10-24 16:48       ` Krzysztof Kozlowski
2022-10-23  9:12 ` [PATCH v3 4/7] arm64: dts: mediatek: mt2712e: swap last 2 clocks to match binding Frank Wunderlich
2022-10-23  9:12 ` [PATCH v3 5/7] arm64: dts: mt8183: drop drv-type from mmc-node Frank Wunderlich
2022-10-23  9:12 ` [PATCH v3 6/7] arm64: dts: mt7622: drop r_smpl property from mmc node Frank Wunderlich
2022-10-23  9:12 ` [PATCH v3 7/7] mmc: mediatek: add support for MT7986 SoC Frank Wunderlich

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