devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] dt-bindings: mmc: document mmc-slot and convert amlogic,meson-mx-sdio.txt to dtschema
@ 2024-09-20  8:38 Neil Armstrong
  2024-09-20  8:38 ` [PATCH v2 1/3] dt-bindings: mmc: controller: allow node name to be named slot@* Neil Armstrong
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Neil Armstrong @ 2024-09-20  8:38 UTC (permalink / raw)
  To: Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Kevin Hilman, Jerome Brunet, Martin Blumenstingl
  Cc: linux-mmc, devicetree, linux-arm-kernel, linux-amlogic,
	linux-kernel, Neil Armstrong

Document mmc-slot because used by amlogic,meson-mx-sdio.txt and
cavium-mmc.txt, so make it common.

Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
Changes in v2:
- Fixed description, limited to 3 slots
- Moved out mmc-slot in a separate common schema
- Link to v1: https://lore.kernel.org/r/20240911-topic-amlogic-arm32-upstream-bindings-fixes-convert-meson-mx-sdio-v1-1-b7bfae886211@linaro.org

---
Neil Armstrong (3):
      dt-bindings: mmc: controller: allow node name to be named slot@*
      dt-bindings: mmc: document mmc-slot
      dt-bindings: mmc: convert amlogic,meson-mx-sdio.txt to dtschema

 .../bindings/mmc/amlogic,meson-mx-sdio.txt         | 54 ------------
 .../bindings/mmc/amlogic,meson-mx-sdio.yaml        | 96 ++++++++++++++++++++++
 .../devicetree/bindings/mmc/mmc-controller.yaml    |  4 +-
 .../devicetree/bindings/mmc/mmc-slot.yaml          | 40 +++++++++
 4 files changed, 139 insertions(+), 55 deletions(-)
---
base-commit: 47ac09b91befbb6a235ab620c32af719f8208399
change-id: 20240911-topic-amlogic-arm32-upstream-bindings-fixes-convert-meson-mx-sdio-6fa70546ebb8

Best regards,
-- 
Neil Armstrong <neil.armstrong@linaro.org>


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

* [PATCH v2 1/3] dt-bindings: mmc: controller: allow node name to be named slot@*
  2024-09-20  8:38 [PATCH v2 0/3] dt-bindings: mmc: document mmc-slot and convert amlogic,meson-mx-sdio.txt to dtschema Neil Armstrong
@ 2024-09-20  8:38 ` Neil Armstrong
  2024-09-24  9:12   ` Krzysztof Kozlowski
  2024-09-24 20:28   ` Rob Herring
  2024-09-20  8:38 ` [PATCH v2 2/3] dt-bindings: mmc: document mmc-slot Neil Armstrong
  2024-09-20  8:38 ` [PATCH v2 3/3] dt-bindings: mmc: convert amlogic,meson-mx-sdio.txt to dtschema Neil Armstrong
  2 siblings, 2 replies; 13+ messages in thread
From: Neil Armstrong @ 2024-09-20  8:38 UTC (permalink / raw)
  To: Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Kevin Hilman, Jerome Brunet, Martin Blumenstingl
  Cc: linux-mmc, devicetree, linux-arm-kernel, linux-amlogic,
	linux-kernel, Neil Armstrong

In preparation of supporting the mmc-slot subnode, allow
the nodename to be either mmc@ or mmc-slot@

Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
 Documentation/devicetree/bindings/mmc/mmc-controller.yaml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/mmc/mmc-controller.yaml b/Documentation/devicetree/bindings/mmc/mmc-controller.yaml
index 58ae298cd2fc..f797c32ea688 100644
--- a/Documentation/devicetree/bindings/mmc/mmc-controller.yaml
+++ b/Documentation/devicetree/bindings/mmc/mmc-controller.yaml
@@ -20,7 +20,9 @@ description: |
 
 properties:
   $nodename:
-    pattern: "^mmc(@.*)?$"
+    oneOf:
+      - pattern: "^mmc(@.*)?$"
+      - pattern: "^slot(@.*)?$"
 
   "#address-cells":
     const: 1

-- 
2.34.1


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

* [PATCH v2 2/3] dt-bindings: mmc: document mmc-slot
  2024-09-20  8:38 [PATCH v2 0/3] dt-bindings: mmc: document mmc-slot and convert amlogic,meson-mx-sdio.txt to dtschema Neil Armstrong
  2024-09-20  8:38 ` [PATCH v2 1/3] dt-bindings: mmc: controller: allow node name to be named slot@* Neil Armstrong
@ 2024-09-20  8:38 ` Neil Armstrong
  2024-09-24  9:15   ` Krzysztof Kozlowski
  2024-09-24 20:30   ` Rob Herring
  2024-09-20  8:38 ` [PATCH v2 3/3] dt-bindings: mmc: convert amlogic,meson-mx-sdio.txt to dtschema Neil Armstrong
  2 siblings, 2 replies; 13+ messages in thread
From: Neil Armstrong @ 2024-09-20  8:38 UTC (permalink / raw)
  To: Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Kevin Hilman, Jerome Brunet, Martin Blumenstingl
  Cc: linux-mmc, devicetree, linux-arm-kernel, linux-amlogic,
	linux-kernel, Neil Armstrong

Document the mmc-slot, which is a subnode of a multi-slot
MMC controlle, each slot is represented as a full MMC controller,
the top node handling all the shared resources and slot mux.

Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
 .../devicetree/bindings/mmc/mmc-slot.yaml          | 40 ++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/Documentation/devicetree/bindings/mmc/mmc-slot.yaml b/Documentation/devicetree/bindings/mmc/mmc-slot.yaml
new file mode 100644
index 000000000000..c30eda4fd2a6
--- /dev/null
+++ b/Documentation/devicetree/bindings/mmc/mmc-slot.yaml
@@ -0,0 +1,40 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mmc/mmc-slot.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: MMC/SD/SDIO slot of a multi-slot controller
+
+maintainers:
+  - Ulf Hansson <ulf.hansson@linaro.org>
+
+allOf:
+  - $ref: mmc-controller.yaml
+
+properties:
+  compatible:
+    const: mmc-slot
+
+  reg:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    mmc-controller {
+      #address-cells = <1>;
+      #size-cells = <0>;
+      slot@0 {
+        compatible = "mmc-slot";
+        reg = <0>;
+        bus-width = <4>;
+      };
+    };
+
+...

-- 
2.34.1


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

* [PATCH v2 3/3] dt-bindings: mmc: convert amlogic,meson-mx-sdio.txt to dtschema
  2024-09-20  8:38 [PATCH v2 0/3] dt-bindings: mmc: document mmc-slot and convert amlogic,meson-mx-sdio.txt to dtschema Neil Armstrong
  2024-09-20  8:38 ` [PATCH v2 1/3] dt-bindings: mmc: controller: allow node name to be named slot@* Neil Armstrong
  2024-09-20  8:38 ` [PATCH v2 2/3] dt-bindings: mmc: document mmc-slot Neil Armstrong
@ 2024-09-20  8:38 ` Neil Armstrong
  2024-09-24  9:18   ` Krzysztof Kozlowski
  2 siblings, 1 reply; 13+ messages in thread
From: Neil Armstrong @ 2024-09-20  8:38 UTC (permalink / raw)
  To: Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Kevin Hilman, Jerome Brunet, Martin Blumenstingl
  Cc: linux-mmc, devicetree, linux-arm-kernel, linux-amlogic,
	linux-kernel, Neil Armstrong

Convert the Amlogic Meson6, Meson8 and Meson8b SDIO/MMC controller
bindings to dt-schema.

Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
 .../bindings/mmc/amlogic,meson-mx-sdio.txt         | 54 ------------
 .../bindings/mmc/amlogic,meson-mx-sdio.yaml        | 96 ++++++++++++++++++++++
 2 files changed, 96 insertions(+), 54 deletions(-)

diff --git a/Documentation/devicetree/bindings/mmc/amlogic,meson-mx-sdio.txt b/Documentation/devicetree/bindings/mmc/amlogic,meson-mx-sdio.txt
deleted file mode 100644
index 8765c605e6bc..000000000000
--- a/Documentation/devicetree/bindings/mmc/amlogic,meson-mx-sdio.txt
+++ /dev/null
@@ -1,54 +0,0 @@
-* Amlogic Meson6, Meson8 and Meson8b SDIO/MMC controller
-
-The highspeed MMC host controller on Amlogic SoCs provides an interface
-for MMC, SD, SDIO and SDHC types of memory cards.
-
-Supported maximum speeds are the ones of the eMMC standard 4.41 as well
-as the speed of SD standard 2.0.
-
-The hardware provides an internal "mux" which allows up to three slots
-to be controlled. Only one slot can be accessed at a time.
-
-Required properties:
- - compatible : must be one of
-	- "amlogic,meson8-sdio"
-	- "amlogic,meson8b-sdio"
-	along with the generic "amlogic,meson-mx-sdio"
- - reg : mmc controller base registers
- - interrupts : mmc controller interrupt
- - #address-cells : must be 1
- - size-cells : must be 0
- - clocks : phandle to clock providers
- - clock-names : must contain "core" and "clkin"
-
-Required child nodes:
-A node for each slot provided by the MMC controller is required.
-NOTE: due to a driver limitation currently only one slot (= child node)
-      is supported!
-
-Required properties on each child node (= slot):
- - compatible : must be "mmc-slot" (see mmc.txt within this directory)
- - reg : the slot (or "port") ID
-
-Optional properties on each child node (= slot):
- - bus-width : must be 1 or 4 (8-bit bus is not supported)
- - for cd and all other additional generic mmc parameters
-   please refer to mmc.txt within this directory
-
-Examples:
-	mmc@c1108c20 {
-		compatible = "amlogic,meson8-sdio", "amlogic,meson-mx-sdio";
-		reg = <0xc1108c20 0x20>;
-		interrupts = <0 28 1>;
-		#address-cells = <1>;
-		#size-cells = <0>;
-		clocks = <&clkc CLKID_SDIO>, <&clkc CLKID_CLK81>;
-		clock-names = "core", "clkin";
-
-		slot@1 {
-			compatible = "mmc-slot";
-			reg = <1>;
-
-			bus-width = <4>;
-		};
-	};
diff --git a/Documentation/devicetree/bindings/mmc/amlogic,meson-mx-sdio.yaml b/Documentation/devicetree/bindings/mmc/amlogic,meson-mx-sdio.yaml
new file mode 100644
index 000000000000..3b665396169d
--- /dev/null
+++ b/Documentation/devicetree/bindings/mmc/amlogic,meson-mx-sdio.yaml
@@ -0,0 +1,96 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mmc/amlogic,meson-mx-sdio.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Amlogic Meson6, Meson8 and Meson8b SDIO/MMC controller
+
+description: |
+  The highspeed MMC host controller on Amlogic SoCs provides an interface
+  for MMC, SD, SDIO and SDHC types of memory cards.
+
+  Supported maximum speeds are the ones of the eMMC standard 4.41 as well
+  as the speed of SD standard 2.0.
+
+  The hardware provides an internal "mux" which allows up to three slots
+  to be controlled. Only one slot can be accessed at a time.
+
+maintainers:
+  - Neil Armstrong <neil.armstrong@linaro.org>
+
+properties:
+  compatible:
+    items:
+      - enum:
+          - amlogic,meson8-sdio
+          - amlogic,meson8b-sdio
+      - const: amlogic,meson-mx-sdio
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    maxItems: 2
+
+  clock-names:
+    items:
+      - const: core
+      - const: clkin
+
+  "#address-cells":
+    const: 1
+
+  "#size-cells":
+    const: 0
+
+patternProperties:
+  "slot@[0-2]+$":
+    $ref: mmc-slot.yaml#
+    description:
+      A node for each slot provided by the MMC controller
+
+    properties:
+      reg:
+        description:
+          the slot (or "port") ID
+        enum: [0, 1, 2]
+
+      bus-width:
+        enum: [1, 4]
+
+    unevaluatedProperties: false
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - clocks
+  - clock-names
+  - "#address-cells"
+  - "#size-cells"
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    mmc@c1108c20 {
+        compatible = "amlogic,meson8-sdio", "amlogic,meson-mx-sdio";
+        reg = <0xc1108c20 0x20>;
+        interrupts = <GIC_SPI 28 IRQ_TYPE_EDGE_RISING>;
+        clocks = <&clk_core>, <&clk_in>;
+        clock-names = "core", "clkin";
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        slot@1 {
+            compatible = "mmc-slot";
+            reg = <1>;
+            bus-width = <4>;
+        };
+    };

-- 
2.34.1


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

* Re: [PATCH v2 1/3] dt-bindings: mmc: controller: allow node name to be named slot@*
  2024-09-20  8:38 ` [PATCH v2 1/3] dt-bindings: mmc: controller: allow node name to be named slot@* Neil Armstrong
@ 2024-09-24  9:12   ` Krzysztof Kozlowski
  2024-10-07  9:00     ` Neil Armstrong
  2024-09-24 20:28   ` Rob Herring
  1 sibling, 1 reply; 13+ messages in thread
From: Krzysztof Kozlowski @ 2024-09-24  9:12 UTC (permalink / raw)
  To: Neil Armstrong
  Cc: Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Kevin Hilman, Jerome Brunet, Martin Blumenstingl, linux-mmc,
	devicetree, linux-arm-kernel, linux-amlogic, linux-kernel

On Fri, Sep 20, 2024 at 10:38:03AM +0200, Neil Armstrong wrote:
> In preparation of supporting the mmc-slot subnode, allow
> the nodename to be either mmc@ or mmc-slot@
> 
> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
> ---
>  Documentation/devicetree/bindings/mmc/mmc-controller.yaml | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/mmc/mmc-controller.yaml b/Documentation/devicetree/bindings/mmc/mmc-controller.yaml
> index 58ae298cd2fc..f797c32ea688 100644
> --- a/Documentation/devicetree/bindings/mmc/mmc-controller.yaml
> +++ b/Documentation/devicetree/bindings/mmc/mmc-controller.yaml
> @@ -20,7 +20,9 @@ description: |
>  
>  properties:
>    $nodename:
> -    pattern: "^mmc(@.*)?$"
> +    oneOf:
> +      - pattern: "^mmc(@.*)?$"
> +      - pattern: "^slot(@.*)?$"

I don't think mmc-slot is allowed by this.

This should be squashed with mmc-slot child patch. It does not make
sense to allow mmc-slots if there are no mmc-slots.

Best regards,
Krzysztof


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

* Re: [PATCH v2 2/3] dt-bindings: mmc: document mmc-slot
  2024-09-20  8:38 ` [PATCH v2 2/3] dt-bindings: mmc: document mmc-slot Neil Armstrong
@ 2024-09-24  9:15   ` Krzysztof Kozlowski
  2024-10-07  8:57     ` Neil Armstrong
  2024-09-24 20:30   ` Rob Herring
  1 sibling, 1 reply; 13+ messages in thread
From: Krzysztof Kozlowski @ 2024-09-24  9:15 UTC (permalink / raw)
  To: Neil Armstrong
  Cc: Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Kevin Hilman, Jerome Brunet, Martin Blumenstingl, linux-mmc,
	devicetree, linux-arm-kernel, linux-amlogic, linux-kernel

On Fri, Sep 20, 2024 at 10:38:04AM +0200, Neil Armstrong wrote:
> Document the mmc-slot, which is a subnode of a multi-slot
> MMC controlle, each slot is represented as a full MMC controller,

typo: controller

> the top node handling all the shared resources and slot mux.
> 
> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
> ---
>  .../devicetree/bindings/mmc/mmc-slot.yaml          | 40 ++++++++++++++++++++++
>  1 file changed, 40 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/mmc/mmc-slot.yaml b/Documentation/devicetree/bindings/mmc/mmc-slot.yaml
> new file mode 100644
> index 000000000000..c30eda4fd2a6
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mmc/mmc-slot.yaml
> @@ -0,0 +1,40 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/mmc/mmc-slot.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: MMC/SD/SDIO slot of a multi-slot controller
> +
> +maintainers:
> +  - Ulf Hansson <ulf.hansson@linaro.org>
> +

description here saying what is the MMC slot, e.g. what you wrote in
commit msg.

> +allOf:
> +  - $ref: mmc-controller.yaml
> +

Just to be sure - the slots do not have dedicated resources like clocks,
resets, power supplies, right? IOW, it is indeed one device which
exposes multiple controllers?

> +properties:
> +  compatible:
> +    const: mmc-slot
> +
> +  reg:
> +    maxItems: 1
> +
> +required:
> +  - compatible
> +  - reg
> +
> +unevaluatedProperties: false

Best regards,
Krzysztof


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

* Re: [PATCH v2 3/3] dt-bindings: mmc: convert amlogic,meson-mx-sdio.txt to dtschema
  2024-09-20  8:38 ` [PATCH v2 3/3] dt-bindings: mmc: convert amlogic,meson-mx-sdio.txt to dtschema Neil Armstrong
@ 2024-09-24  9:18   ` Krzysztof Kozlowski
  2024-09-25 17:29     ` Martin Blumenstingl
  0 siblings, 1 reply; 13+ messages in thread
From: Krzysztof Kozlowski @ 2024-09-24  9:18 UTC (permalink / raw)
  To: Neil Armstrong
  Cc: Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Kevin Hilman, Jerome Brunet, Martin Blumenstingl, linux-mmc,
	devicetree, linux-arm-kernel, linux-amlogic, linux-kernel

On Fri, Sep 20, 2024 at 10:38:05AM +0200, Neil Armstrong wrote:
> Convert the Amlogic Meson6, Meson8 and Meson8b SDIO/MMC controller
> bindings to dt-schema.
> 
> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>

...

> +properties:
> +  compatible:
> +    items:
> +      - enum:
> +          - amlogic,meson8-sdio
> +          - amlogic,meson8b-sdio
> +      - const: amlogic,meson-mx-sdio
> +
> +  reg:
> +    maxItems: 1
> +
> +  interrupts:
> +    maxItems: 1
> +
> +  clocks:
> +    maxItems: 2
> +
> +  clock-names:
> +    items:
> +      - const: core
> +      - const: clkin
> +
> +  "#address-cells":
> +    const: 1
> +
> +  "#size-cells":
> +    const: 0
> +
> +patternProperties:
> +  "slot@[0-2]+$":

^slot@[0-2]$

(because foo-slot@22 is wrong)


> +    $ref: mmc-slot.yaml#
> +    description:
> +      A node for each slot provided by the MMC controller
> +
> +    properties:
> +      reg:
> +        description:
> +          the slot (or "port") ID

Drop description. Should be rather part of mmc-slot.yaml.

> +        enum: [0, 1, 2]
> +
> +      bus-width:
> +        enum: [1, 4]
> +
> +    unevaluatedProperties: false

Hm, I wonder why not all slots are defined in your DTS? Why not all of
them are required? I assume the slots are there always, as part of the
controller.

Is this because of driver limitation mentioned in the old binding?

> +
> +required:
> +  - compatible
> +  - reg
> +  - interrupts
> +  - clocks
> +  - clock-names
> +  - "#address-cells"
> +  - "#size-cells"
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/interrupt-controller/irq.h>
> +    #include <dt-bindings/interrupt-controller/arm-gic.h>
> +    mmc@c1108c20 {
> +        compatible = "amlogic,meson8-sdio", "amlogic,meson-mx-sdio";
> +        reg = <0xc1108c20 0x20>;
> +        interrupts = <GIC_SPI 28 IRQ_TYPE_EDGE_RISING>;
> +        clocks = <&clk_core>, <&clk_in>;
> +        clock-names = "core", "clkin";
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        slot@1 {
> +            compatible = "mmc-slot";
> +            reg = <1>;
> +            bus-width = <4>;

Best regards,
Krzysztof


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

* Re: [PATCH v2 1/3] dt-bindings: mmc: controller: allow node name to be named slot@*
  2024-09-20  8:38 ` [PATCH v2 1/3] dt-bindings: mmc: controller: allow node name to be named slot@* Neil Armstrong
  2024-09-24  9:12   ` Krzysztof Kozlowski
@ 2024-09-24 20:28   ` Rob Herring
  1 sibling, 0 replies; 13+ messages in thread
From: Rob Herring @ 2024-09-24 20:28 UTC (permalink / raw)
  To: Neil Armstrong
  Cc: Ulf Hansson, Krzysztof Kozlowski, Conor Dooley, Kevin Hilman,
	Jerome Brunet, Martin Blumenstingl, linux-mmc, devicetree,
	linux-arm-kernel, linux-amlogic, linux-kernel

On Fri, Sep 20, 2024 at 10:38:03AM +0200, Neil Armstrong wrote:
> In preparation of supporting the mmc-slot subnode, allow
> the nodename to be either mmc@ or mmc-slot@
> 
> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
> ---
>  Documentation/devicetree/bindings/mmc/mmc-controller.yaml | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/mmc/mmc-controller.yaml b/Documentation/devicetree/bindings/mmc/mmc-controller.yaml
> index 58ae298cd2fc..f797c32ea688 100644
> --- a/Documentation/devicetree/bindings/mmc/mmc-controller.yaml
> +++ b/Documentation/devicetree/bindings/mmc/mmc-controller.yaml
> @@ -20,7 +20,9 @@ description: |
>  
>  properties:
>    $nodename:
> -    pattern: "^mmc(@.*)?$"
> +    oneOf:
> +      - pattern: "^mmc(@.*)?$"
> +      - pattern: "^slot(@.*)?$"

'^(mmc|slot)(@.*)?$'

But the description says something else...

In any case, avoiding 'oneOf' when possible makes for better warnings.

Rob

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

* Re: [PATCH v2 2/3] dt-bindings: mmc: document mmc-slot
  2024-09-20  8:38 ` [PATCH v2 2/3] dt-bindings: mmc: document mmc-slot Neil Armstrong
  2024-09-24  9:15   ` Krzysztof Kozlowski
@ 2024-09-24 20:30   ` Rob Herring
  1 sibling, 0 replies; 13+ messages in thread
From: Rob Herring @ 2024-09-24 20:30 UTC (permalink / raw)
  To: Neil Armstrong
  Cc: Ulf Hansson, Krzysztof Kozlowski, Conor Dooley, Kevin Hilman,
	Jerome Brunet, Martin Blumenstingl, linux-mmc, devicetree,
	linux-arm-kernel, linux-amlogic, linux-kernel

On Fri, Sep 20, 2024 at 10:38:04AM +0200, Neil Armstrong wrote:
> Document the mmc-slot, which is a subnode of a multi-slot
> MMC controlle, each slot is represented as a full MMC controller,
> the top node handling all the shared resources and slot mux.
> 
> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
> ---
>  .../devicetree/bindings/mmc/mmc-slot.yaml          | 40 ++++++++++++++++++++++
>  1 file changed, 40 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/mmc/mmc-slot.yaml b/Documentation/devicetree/bindings/mmc/mmc-slot.yaml
> new file mode 100644
> index 000000000000..c30eda4fd2a6
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mmc/mmc-slot.yaml
> @@ -0,0 +1,40 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/mmc/mmc-slot.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: MMC/SD/SDIO slot of a multi-slot controller
> +
> +maintainers:
> +  - Ulf Hansson <ulf.hansson@linaro.org>
> +
> +allOf:
> +  - $ref: mmc-controller.yaml
> +
> +properties:
> +  compatible:
> +    const: mmc-slot
> +
> +  reg:
> +    maxItems: 1
> +
> +required:
> +  - compatible
> +  - reg
> +
> +unevaluatedProperties: false
> +
> +examples:
> +  - |
> +    mmc-controller {

mmc {

> +      #address-cells = <1>;
> +      #size-cells = <0>;
> +      slot@0 {
> +        compatible = "mmc-slot";
> +        reg = <0>;
> +        bus-width = <4>;
> +      };
> +    };
> +
> +...
> 
> -- 
> 2.34.1
> 

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

* Re: [PATCH v2 3/3] dt-bindings: mmc: convert amlogic,meson-mx-sdio.txt to dtschema
  2024-09-24  9:18   ` Krzysztof Kozlowski
@ 2024-09-25 17:29     ` Martin Blumenstingl
  2024-09-25 19:31       ` Krzysztof Kozlowski
  0 siblings, 1 reply; 13+ messages in thread
From: Martin Blumenstingl @ 2024-09-25 17:29 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Neil Armstrong, Ulf Hansson, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Kevin Hilman, Jerome Brunet, linux-mmc, devicetree,
	linux-arm-kernel, linux-amlogic, linux-kernel

Hi Krzysztof,

On Tue, Sep 24, 2024 at 11:18 AM Krzysztof Kozlowski <krzk@kernel.org> wrote:
[...]
> > +        enum: [0, 1, 2]
> > +
> > +      bus-width:
> > +        enum: [1, 4]
> > +
> > +    unevaluatedProperties: false
>
> Hm, I wonder why not all slots are defined in your DTS? Why not all of
> them are required? I assume the slots are there always, as part of the
> controller.
>
> Is this because of driver limitation mentioned in the old binding?
The MMC core (still) has a limitation of only supporting one slot per
controller - so a limitation will stay in place.

However, the driver (drivers/mmc/host/meson-mx-sdio.c) uses
of_get_compatible_child(), meaning it will also pick the first child
node with the correct compatible string, even if it has status =
"disabled".
I can send a patch to reduce the scope of this limitation: all slots
can be defined but only the first enabled one is used.
What do you think?


Best regards,
Martin

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

* Re: [PATCH v2 3/3] dt-bindings: mmc: convert amlogic,meson-mx-sdio.txt to dtschema
  2024-09-25 17:29     ` Martin Blumenstingl
@ 2024-09-25 19:31       ` Krzysztof Kozlowski
  0 siblings, 0 replies; 13+ messages in thread
From: Krzysztof Kozlowski @ 2024-09-25 19:31 UTC (permalink / raw)
  To: Martin Blumenstingl
  Cc: Neil Armstrong, Ulf Hansson, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Kevin Hilman, Jerome Brunet, linux-mmc, devicetree,
	linux-arm-kernel, linux-amlogic, linux-kernel

On 25/09/2024 19:29, Martin Blumenstingl wrote:
> Hi Krzysztof,
> 
> On Tue, Sep 24, 2024 at 11:18 AM Krzysztof Kozlowski <krzk@kernel.org> wrote:
> [...]
>>> +        enum: [0, 1, 2]
>>> +
>>> +      bus-width:
>>> +        enum: [1, 4]
>>> +
>>> +    unevaluatedProperties: false
>>
>> Hm, I wonder why not all slots are defined in your DTS? Why not all of
>> them are required? I assume the slots are there always, as part of the
>> controller.
>>
>> Is this because of driver limitation mentioned in the old binding?
> The MMC core (still) has a limitation of only supporting one slot per
> controller - so a limitation will stay in place.
> 
> However, the driver (drivers/mmc/host/meson-mx-sdio.c) uses
> of_get_compatible_child(), meaning it will also pick the first child
> node with the correct compatible string, even if it has status =
> "disabled".
> I can send a patch to reduce the scope of this limitation: all slots
> can be defined but only the first enabled one is used.
> What do you think?

For the conversion it can stay as is. Follow-up patches allowing
multiple slots, adding them in DTC etc. are nice, but not necessary here.

Best regards,
Krzysztof


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

* Re: [PATCH v2 2/3] dt-bindings: mmc: document mmc-slot
  2024-09-24  9:15   ` Krzysztof Kozlowski
@ 2024-10-07  8:57     ` Neil Armstrong
  0 siblings, 0 replies; 13+ messages in thread
From: Neil Armstrong @ 2024-10-07  8:57 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Kevin Hilman, Jerome Brunet, Martin Blumenstingl, linux-mmc,
	devicetree, linux-arm-kernel, linux-amlogic, linux-kernel

Hi,

On 24/09/2024 11:15, Krzysztof Kozlowski wrote:
> On Fri, Sep 20, 2024 at 10:38:04AM +0200, Neil Armstrong wrote:
>> Document the mmc-slot, which is a subnode of a multi-slot
>> MMC controlle, each slot is represented as a full MMC controller,
> 
> typo: controller
> 
>> the top node handling all the shared resources and slot mux.
>>
>> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
>> ---
>>   .../devicetree/bindings/mmc/mmc-slot.yaml          | 40 ++++++++++++++++++++++
>>   1 file changed, 40 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/mmc/mmc-slot.yaml b/Documentation/devicetree/bindings/mmc/mmc-slot.yaml
>> new file mode 100644
>> index 000000000000..c30eda4fd2a6
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/mmc/mmc-slot.yaml
>> @@ -0,0 +1,40 @@
>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>> +%YAML 1.2
>> +---
>> +$id: http://devicetree.org/schemas/mmc/mmc-slot.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: MMC/SD/SDIO slot of a multi-slot controller
>> +
>> +maintainers:
>> +  - Ulf Hansson <ulf.hansson@linaro.org>
>> +
> 
> description here saying what is the MMC slot, e.g. what you wrote in
> commit msg.

Right will fix the description, bad copy paste

> 
>> +allOf:
>> +  - $ref: mmc-controller.yaml
>> +
> 
> Just to be sure - the slots do not have dedicated resources like clocks,
> resets, power supplies, right? IOW, it is indeed one device which
> exposes multiple controllers?

Yes exact, resources are common to the slots

> 
>> +properties:
>> +  compatible:
>> +    const: mmc-slot
>> +
>> +  reg:
>> +    maxItems: 1
>> +
>> +required:
>> +  - compatible
>> +  - reg
>> +
>> +unevaluatedProperties: false
> 
> Best regards,
> Krzysztof
> 


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

* Re: [PATCH v2 1/3] dt-bindings: mmc: controller: allow node name to be named slot@*
  2024-09-24  9:12   ` Krzysztof Kozlowski
@ 2024-10-07  9:00     ` Neil Armstrong
  0 siblings, 0 replies; 13+ messages in thread
From: Neil Armstrong @ 2024-10-07  9:00 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Kevin Hilman, Jerome Brunet, Martin Blumenstingl, linux-mmc,
	devicetree, linux-arm-kernel, linux-amlogic, linux-kernel

Hi Rob, Krzysztof,


On 24/09/2024 11:12, Krzysztof Kozlowski wrote:
> On Fri, Sep 20, 2024 at 10:38:03AM +0200, Neil Armstrong wrote:
>> In preparation of supporting the mmc-slot subnode, allow
>> the nodename to be either mmc@ or mmc-slot@
>>
>> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
>> ---
>>   Documentation/devicetree/bindings/mmc/mmc-controller.yaml | 4 +++-
>>   1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/Documentation/devicetree/bindings/mmc/mmc-controller.yaml b/Documentation/devicetree/bindings/mmc/mmc-controller.yaml
>> index 58ae298cd2fc..f797c32ea688 100644
>> --- a/Documentation/devicetree/bindings/mmc/mmc-controller.yaml
>> +++ b/Documentation/devicetree/bindings/mmc/mmc-controller.yaml
>> @@ -20,7 +20,9 @@ description: |
>>   
>>   properties:
>>     $nodename:
>> -    pattern: "^mmc(@.*)?$"
>> +    oneOf:
>> +      - pattern: "^mmc(@.*)?$"
>> +      - pattern: "^slot(@.*)?$"
> 
> I don't think mmc-slot is allowed by this.
> 
> This should be squashed with mmc-slot child patch. It does not make
> sense to allow mmc-slots if there are no mmc-slots.

Right, I don't like this oneOf/pattern, slot@(@.*)? should really only be for slots,
by I do not see how this can be achieved because we can't override properties: pattern.

Do you have any suggestions ?

Neil

> 
> Best regards,
> Krzysztof
> 


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

end of thread, other threads:[~2024-10-07  9:00 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-20  8:38 [PATCH v2 0/3] dt-bindings: mmc: document mmc-slot and convert amlogic,meson-mx-sdio.txt to dtschema Neil Armstrong
2024-09-20  8:38 ` [PATCH v2 1/3] dt-bindings: mmc: controller: allow node name to be named slot@* Neil Armstrong
2024-09-24  9:12   ` Krzysztof Kozlowski
2024-10-07  9:00     ` Neil Armstrong
2024-09-24 20:28   ` Rob Herring
2024-09-20  8:38 ` [PATCH v2 2/3] dt-bindings: mmc: document mmc-slot Neil Armstrong
2024-09-24  9:15   ` Krzysztof Kozlowski
2024-10-07  8:57     ` Neil Armstrong
2024-09-24 20:30   ` Rob Herring
2024-09-20  8:38 ` [PATCH v2 3/3] dt-bindings: mmc: convert amlogic,meson-mx-sdio.txt to dtschema Neil Armstrong
2024-09-24  9:18   ` Krzysztof Kozlowski
2024-09-25 17:29     ` Martin Blumenstingl
2024-09-25 19:31       ` Krzysztof Kozlowski

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