Skip to contentSkip to conversation

dt-bindings: mmc: st,sdhci: convert STMicroelectronics SDHCI-ST MMC/SD Controller controller binding to YAML

PATCH Superseded Charan Pedumuru 2 participants 5 messages May 3 – May 6

Subsystems (3)

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

v2 cover dt-bindings: mmc: st,sdhci: convert STMicroelectronics SDHCI-ST MMC/SD Controller controller binding to YAML

This patch series converts the legacy text-based Device Tree binding for STMicroelectronics SDHCI-ST MMC/SD controller to DT schema (YAML) format.

Note:
The patch "dt-bindings: mmc: st,sdhci: convert to DT schema" depends on the patch "arm: dts: st: align node patterns with established convention". If the DT schema patch is applied before the DTS cleanup patch, dtbs_check will fail due to the presence of the removed properties in the existing DTS.

---
Changes in v2:
- Fix node name in DTS for the MMC to match with the estableshed convention.
- st,sdhci: drop unnecessary properties, modify "reg", "reg-names" and "clock-names" properties, include an allOf with $ref to mmc-controller.
- Link to v1: https://patch.msgid.link/[email protected]

---
Charan Pedumuru (2):
arm: dts: st: align node patterns with established convention
dt-bindings: mmc: st,sdhci: convert to DT schema

 Documentation/devicetree/bindings/mmc/sdhci-st.txt | 110 ---------------------
 .../devicetree/bindings/mmc/st,sdhci.yaml          |  93 +++++++++++++++++
 arch/arm/boot/dts/st/stih407-family.dtsi           |   4 +-
 3 files changed, 95 insertions(+), 112 deletions(-)

---
base-commit: cf2cd8efd046c561191b8541d32a8bfe845bf06b
change-id: 20260327-st-mmc-c906ad95ff83

Best regards,

Signature · 1 line
Charan Pedumuru <[email protected]>
#1 lore raw

PATCH v2 1/2 arm: dts: st: align node patterns with established convention

Update ST MMC DTS node patterns to match established convention.

---
 arch/arm/boot/dts/st/stih407-family.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/dts/st/stih407-family.dtsi +2 -2
index 3e6a0542e3ae..08acba209c56 100644
@@ -596,7 +596,7 @@ spi@9542000 {
 			status = "disabled";
 		};
 
-		mmc0: sdhci@9060000 {
+		mmc0: mmc@9060000 {
 			compatible = "st,sdhci-stih407", "st,sdhci";
 			status = "disabled";
 			reg = <0x09060000 0x7ff>, <0x9061008 0x20>;
@@ -611,7 +611,7 @@ mmc0: sdhci@9060000 {
 			bus-width = <8>;
 		};
 
-		mmc1: sdhci@9080000 {
+		mmc1: mmc@9080000 {
 			compatible = "st,sdhci-stih407", "st,sdhci";
 			status = "disabled";
 			reg = <0x09080000 0x7ff>;
Signature · 1 line
2.54.0
#2 lore raw

PATCH v2 2/2 dt-bindings: mmc: st,sdhci: convert to DT schema

In reply to Charan Pedumuru

Convert STMicroelectronics sdhci-st MMC/SD controller binding to DT schema.

---
 Documentation/devicetree/bindings/mmc/sdhci-st.txt | 110 ---------------------
 .../devicetree/bindings/mmc/st,sdhci.yaml          |  93 +++++++++++++++++
 2 files changed, 93 insertions(+), 110 deletions(-)
Documentation/devicetree/bindings/mmc/sdhci-st.txt deleted +0 -110
deleted file mode 100644
index ccf82b4ee838..000000000000
@@ -1,110 +0,0 @@
-* STMicroelectronics sdhci-st MMC/SD controller
-
-This file documents the differences between the core properties in
-Documentation/devicetree/bindings/mmc/mmc.txt and the properties
-used by the sdhci-st driver.
-
-Required properties:
-- compatible:		Must be "st,sdhci" and it can be compatible to "st,sdhci-stih407"
-			to set the internal glue logic used for configuring the MMC
-			subsystem (mmcss) inside the FlashSS (available in STiH407 SoC
-			family).
-
-- clock-names:		Should be "mmc" and "icn".  (NB: The latter is not compulsory)
-			See: Documentation/devicetree/bindings/resource-names.txt
-- clocks:		Phandle to the clock.
-			See: Documentation/devicetree/bindings/clock/clock-bindings.txt
-
-- interrupts:		One mmc interrupt should be described here.
-- interrupt-names:	Should be "mmcirq".
-
-- pinctrl-names:	A pinctrl state names "default" must be defined.
-- pinctrl-0:		Phandle referencing pin configuration of the sd/emmc controller.
-			See: Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt
-
-- reg:			This must provide the host controller base address and it can also
-			contain the FlashSS Top register for TX/RX delay used by the driver
-			to configure DLL inside the flashSS, if so reg-names must also be
-			specified.
-
-Optional properties:
-- reg-names:		Should be "mmc" and "top-mmc-delay". "top-mmc-delay" is optional
-			for eMMC on stih407 family silicon to configure DLL inside FlashSS.
-
-- non-removable:	Non-removable slot. Also used for configuring mmcss in STiH407 SoC
-			family.
-			See:  Documentation/devicetree/bindings/mmc/mmc.txt.
-
-- bus-width:		Number of data lines.
-			See:  Documentation/devicetree/bindings/mmc/mmc.txt.
-
-- max-frequency:	Can be 200MHz, 100MHz or 50MHz (default) and used for
-			configuring the CCONFIG3 in the mmcss.
-			See:  Documentation/devicetree/bindings/mmc/mmc.txt.
-
-- resets:		Phandle and reset specifier pair to softreset line of HC IP.
-			See: Documentation/devicetree/bindings/reset/reset.txt
-
-- vqmmc-supply:		Phandle to the regulator dt node, mentioned as the vcc/vdd
-			supply in eMMC/SD specs.
-
-- sd-uhs-sdr50:	To enable the SDR50 in the mmcss.
-			See:  Documentation/devicetree/bindings/mmc/mmc.txt.
-
-- sd-uhs-sdr104:	To enable the SDR104 in the mmcss.
-			See:  Documentation/devicetree/bindings/mmc/mmc.txt.
-
-- sd-uhs-ddr50:		To enable the DDR50 in the mmcss.
-			See:  Documentation/devicetree/bindings/mmc/mmc.txt.
-
-Example:
-
-/* Example stih416e eMMC configuration */
-
-mmc0: sdhci@fe81e000 {
-	compatible	= "st,sdhci";
-	reg		= <0xfe81e000 0x1000>;
-	interrupts	= <GIC_SPI 127 IRQ_TYPE_NONE>;
-	interrupt-names	= "mmcirq";
-	pinctrl-names	= "default";
-	pinctrl-0	= <&pinctrl_mmc0>;
-	clock-names	= "mmc";
-	clocks		= <&clk_s_a1_ls 1>;
-	bus-width	= <8>
-
-/* Example SD stih407 family configuration */
-
-mmc1: sdhci@9080000 {
-	compatible	= "st,sdhci-stih407", "st,sdhci";
-	reg		= <0x09080000 0x7ff>;
-	reg-names	= "mmc";
-	interrupts	= <GIC_SPI 90 IRQ_TYPE_NONE>;
-	interrupt-names	= "mmcirq";
-	pinctrl-names	= "default";
-	pinctrl-0	= <&pinctrl_sd1>;
-	clock-names	= "mmc";
-	clocks		= <&clk_s_c0_flexgen CLK_MMC_1>;
-	resets		= <&softreset STIH407_MMC1_SOFTRESET>;
-	bus-width	= <4>;
-};
-
-/* Example eMMC stih407 family configuration */
-
-mmc0: sdhci@9060000 {
-	compatible	= "st,sdhci-stih407", "st,sdhci";
-	reg		= <0x09060000 0x7ff>, <0x9061008 0x20>;
-	reg-names	= "mmc", "top-mmc-delay";
-	interrupts	= <GIC_SPI 92 IRQ_TYPE_NONE>;
-	interrupt-names	= "mmcirq";
-	pinctrl-names	= "default";
-	pinctrl-0	= <&pinctrl_mmc0>;
-	clock-names	= "mmc";
-	clocks		= <&clk_s_c0_flexgen CLK_MMC_0>;
-	vqmmc-supply	= <&vmmc_reg>;
-	max-frequency	= <200000000>;
-	bus-width	= <8>;
-	non-removable;
-	sd-uhs-sdr50;
-	sd-uhs-sdr104;
-	sd-uhs-ddr50;
-};
Documentation/devicetree/bindings/mmc/st,sdhci.yaml new file +93 -0

93 lines not on this page · raw message

Signature · 1 line
2.54.0
#3 lore raw

Re: [PATCH v2 2/2] dt-bindings: mmc: st,sdhci: convert to DT schema

Quoted 23 lines · Charan Pedumuru

+$id: http://devicetree.org/schemas/mmc/st,sdhci.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#

Documentation/devicetree/bindings/mmc/st,sdhci.yaml new file +21 -0
+
+title: STMicroelectronics SDHCI-ST MMC/SD Controller
+
+description:
+  The STMicroelectronics SDHCI-ST MMC/SD host controller, which is
+  compliant with the SD Host Controller Interface (SDHCI) specification and
+  is used to interface with MMC, SD and SDIO cards. The ST SDHCI controller
+  extends the standard SDHCI capabilities with platform-specific
+  configurations such as additional register regions,clock inputs, and delay
+  control mechanisms required for signal timing adjustments which are
+  necessary to support high-speed modes and ensure reliable data transfer
+  across different ST SoCs.
+
+allOf:
+  - $ref: mmc-controller.yaml#
+
+maintainers:
+  - Peter Griffin <[email protected]>
+
+properties:
+  compatible:

Documentation/devicetree/bindings/mmc/st,sdhci.yaml line 36

Quoted 10 lines
Documentation/devicetree/bindings/mmc/st,sdhci.yaml new file +10 -0
+    oneOf:
+      - const: st,sdhci
+      - items:
+          - const: st,sdhci-stih407
+          - const: st,sdhci
+
+  reg:
+    minItems: 1
+    items:
+      - description: Base address and size of the MMC controller registers

s/Base address and size of the//

Quoted 1 line

+ - description: Base address and size of the MMC delay/auxiliary registers

Here the same

Documentation/devicetree/bindings/mmc/st,sdhci.yaml line 42

Quoted 5 lines
Documentation/devicetree/bindings/mmc/st,sdhci.yaml new file +5 -0
+
+  reg-names:
+    oneOf:
+      - items:
+          - const: mmc

Drop three lines above

Quoted 1 line

+ - items:

So this is just items like you have in "reg" part. Same syntax.

Documentation/devicetree/bindings/mmc/st,sdhci.yaml line 47

Quoted 4 lines
Documentation/devicetree/bindings/mmc/st,sdhci.yaml new file +4 -0
+          - const: mmc
+          - const: top-mmc-delay
+
+  clocks:

Here and:

Documentation/devicetree/bindings/mmc/st,sdhci.yaml line 52

Quoted 5 lines
Documentation/devicetree/bindings/mmc/st,sdhci.yaml new file +5 -0
+    items:
+      - description: Clock for the MMC controller
+      - description: Interconnect (ICN) clock
+
+  clock-names:

here: Old binding icn is optional. You need to explain in the commit msg all the changes done during conversion.

Documentation/devicetree/bindings/mmc/st,sdhci.yaml line 64

Quoted 12 lines
Documentation/devicetree/bindings/mmc/st,sdhci.yaml new file +12 -0
+    items:
+      - const: mmc
+      - const: icn
+
+  interrupts:
+    maxItems: 1
+
+  interrupt-names:
+    const: mmcirq
+
+  resets:
+    maxItems: 1

Best regards,
Krzysztof

#4 lore raw

Re: [PATCH v2 2/2] dt-bindings: mmc: st,sdhci: convert to DT schema

Quoted 28 lines · Krzysztof Kozlowski
Quoted 27 lines · Charan Pedumuru

+$id: http://devicetree.org/schemas/mmc/st,sdhci.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#

Documentation/devicetree/bindings/mmc/st,sdhci.yaml new file +25 -0
+
+title: STMicroelectronics SDHCI-ST MMC/SD Controller
+
+description:
+  The STMicroelectronics SDHCI-ST MMC/SD host controller, which is
+  compliant with the SD Host Controller Interface (SDHCI) specification and
+  is used to interface with MMC, SD and SDIO cards. The ST SDHCI controller
+  extends the standard SDHCI capabilities with platform-specific
+  configurations such as additional register regions,clock inputs, and delay
+  control mechanisms required for signal timing adjustments which are
+  necessary to support high-speed modes and ensure reliable data transfer
+  across different ST SoCs.
+
+allOf:
+  - $ref: mmc-controller.yaml#
+
+maintainers:
+  - Peter Griffin <[email protected]>
+
+properties:
+  compatible:
+    oneOf:
+      - const: st,sdhci
+      - items:
+          - const: st,sdhci-stih407
Quoted 8 lines

Documentation/devicetree/bindings/mmc/st,sdhci.yaml line 36

Quoted 6 lines
Documentation/devicetree/bindings/mmc/st,sdhci.yaml new file +6 -0
+          - const: st,sdhci
+
+  reg:
+    minItems: 1
+    items:
+      - description: Base address and size of the MMC controller registers

s/Base address and size of the//

Okay, I will remove these words.

Quoted 4 lines
Quoted 2 lines

+ - description: Base address and size of the MMC delay/auxiliary registers

Here the same

Okay.

Quoted 8 lines

Documentation/devicetree/bindings/mmc/st,sdhci.yaml line 42

Quoted 6 lines
Documentation/devicetree/bindings/mmc/st,sdhci.yaml new file +5 -0
+
+  reg-names:
+    oneOf:
+      - items:
+          - const: mmc

Drop three lines above

Sure.

Quoted 11 lines
Quoted 2 lines

+ - items:

So this is just items like you have in "reg" part. Same syntax.

Documentation/devicetree/bindings/mmc/st,sdhci.yaml line 47

Quoted 4 lines
Documentation/devicetree/bindings/mmc/st,sdhci.yaml new file +4 -0
+          - const: mmc
+          - const: top-mmc-delay
+
+  clocks:

Here and:

Should I add minItems and maxItems instead of items?

Quoted 9 lines

Documentation/devicetree/bindings/mmc/st,sdhci.yaml line 52

Quoted 6 lines
Documentation/devicetree/bindings/mmc/st,sdhci.yaml new file +5 -0
+    items:
+      - description: Clock for the MMC controller
+      - description: Interconnect (ICN) clock
+
+  clock-names:

here: Old binding icn is optional. You need to explain in the commit msg all the changes done during conversion.

Okay, I will write this change in commit message.

Quoted 17 lines

Documentation/devicetree/bindings/mmc/st,sdhci.yaml line 64

Quoted 13 lines
Documentation/devicetree/bindings/mmc/st,sdhci.yaml new file +12 -0
+    items:
+      - const: mmc
+      - const: icn
+
+  interrupts:
+    maxItems: 1
+
+  interrupt-names:
+    const: mmcirq
+
+  resets:
+    maxItems: 1

Best regards,
Krzysztof

Signature · 2 lines
Best Regards,
Charan.