diff mbox series

[v1,3/4] dt-bindings: mmc: loongson,ls2k-mmc: Add compatible for Loongson-2K2000

Message ID cefcd16d303936247b94bc13047c8a1861bb8330.1744273956.git.zhoubinbin@loongson.cn (mailing list archive)
State New
Headers show
Series LoongArch: Introduce the Loongson-2K MMC host controller driver | expand

Commit Message

Binbin Zhou April 10, 2025, 8:40 a.m. UTC
Add the devicetree compatible for Loongson-2K2000 EMMC/SD/SDIO controller.

Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
---
 .../bindings/mmc/loongson,ls2k-mmc.yaml       | 47 ++++++++++++++++++-
 1 file changed, 45 insertions(+), 2 deletions(-)

Comments

Rob Herring (Arm) April 11, 2025, 5:05 p.m. UTC | #1
On Thu, Apr 10, 2025 at 04:40:37PM +0800, Binbin Zhou wrote:
> Add the devicetree compatible for Loongson-2K2000 EMMC/SD/SDIO controller.
> 
> Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
> ---
>  .../bindings/mmc/loongson,ls2k-mmc.yaml       | 47 ++++++++++++++++++-
>  1 file changed, 45 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/mmc/loongson,ls2k-mmc.yaml b/Documentation/devicetree/bindings/mmc/loongson,ls2k-mmc.yaml
> index f3e94f5f3a35..24d217a9bbe6 100644
> --- a/Documentation/devicetree/bindings/mmc/loongson,ls2k-mmc.yaml
> +++ b/Documentation/devicetree/bindings/mmc/loongson,ls2k-mmc.yaml
> @@ -9,6 +9,9 @@ title: The SD/SDIO/eMMC host controller for Loongson-2K family SoCs
>  description:
>    The MMC host controller on the Loongson-2K0500/2K1000 (using an externally
>    shared apbdma controller) provides the SD and SDIO device interfaces.
> +  The two MMC host controllers on the Loongson-2K2000 are similar,
> +  except that they use internal exclusive DMA. one controller provides
> +  the eMMC interface and the other provides the SD/SDIO interface.
>  
>  maintainers:
>    - Binbin Zhou <zhoubinbin@loongson.cn>
> @@ -21,8 +24,10 @@ properties:
>      enum:
>        - loongson,ls2k0500-mmc
>        - loongson,ls2k1000-mmc
> +      - loongson,ls2k2000-mmc
>  
>    reg:
> +    minItems: 1
>      maxItems: 2

Missed this in the first patch, but you need to define what each entry 
is.

>  
>    interrupts:
> @@ -42,11 +47,31 @@ required:
>    - reg
>    - interrupts
>    - clocks
> -  - dmas
> -  - dma-names
>  
>  unevaluatedProperties: false
>  
> +if:
> +  properties:
> +    compatible:
> +      contains:
> +        enum:
> +          - loongson,ls2k0500-mmc
> +          - loongson,ls2k1000-mmc
> +
> +then:
> +  properties:
> +    reg:
> +      minItems: 2
> +
> +  required:
> +    - dmas
> +    - dma-names
> +
> +else:
> +  properties:
> +    reg:
> +      maxItems: 1
> +
>  examples:
>    - |
>      #include <dt-bindings/gpio/gpio.h>
> @@ -65,3 +90,21 @@ examples:
>          bus-width = <4>;
>          cd-gpios = <&gpio0 22 GPIO_ACTIVE_LOW>;
>      };
> +
> +  - |
> +    #include <dt-bindings/interrupt-controller/irq.h>
> +    #include <dt-bindings/clock/loongson,ls2k-clk.h>
> +
> +    mmc@79990000 {
> +        compatible = "loongson,ls2k2000-mmc";
> +        reg = <0x79990000 0x1000>;
> +        interrupt-parent = <&pic>;
> +        interrupts = <51 IRQ_TYPE_LEVEL_HIGH>;
> +        clocks = <&clk LOONGSON2_EMMC_CLK>;
> +        bus-width = <8>;
> +        non-removable;
> +        cap-mmc-highspeed;
> +        mmc-hs200-1_8v;
> +        no-sd;
> +        no-sdio;
> +    };
> -- 
> 2.47.1
>
Binbin Zhou April 14, 2025, 1:31 a.m. UTC | #2
Hi Rob:

Thanks for your reply.


On Sat, Apr 12, 2025 at 1:05 AM Rob Herring <robh@kernel.org> wrote:
>
> On Thu, Apr 10, 2025 at 04:40:37PM +0800, Binbin Zhou wrote:
> > Add the devicetree compatible for Loongson-2K2000 EMMC/SD/SDIO controller.
> >
> > Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
> > ---
> >  .../bindings/mmc/loongson,ls2k-mmc.yaml       | 47 ++++++++++++++++++-
> >  1 file changed, 45 insertions(+), 2 deletions(-)
> >
> > diff --git a/Documentation/devicetree/bindings/mmc/loongson,ls2k-mmc.yaml b/Documentation/devicetree/bindings/mmc/loongson,ls2k-mmc.yaml
> > index f3e94f5f3a35..24d217a9bbe6 100644
> > --- a/Documentation/devicetree/bindings/mmc/loongson,ls2k-mmc.yaml
> > +++ b/Documentation/devicetree/bindings/mmc/loongson,ls2k-mmc.yaml
> > @@ -9,6 +9,9 @@ title: The SD/SDIO/eMMC host controller for Loongson-2K family SoCs
> >  description:
> >    The MMC host controller on the Loongson-2K0500/2K1000 (using an externally
> >    shared apbdma controller) provides the SD and SDIO device interfaces.
> > +  The two MMC host controllers on the Loongson-2K2000 are similar,
> > +  except that they use internal exclusive DMA. one controller provides
> > +  the eMMC interface and the other provides the SD/SDIO interface.
> >
> >  maintainers:
> >    - Binbin Zhou <zhoubinbin@loongson.cn>
> > @@ -21,8 +24,10 @@ properties:
> >      enum:
> >        - loongson,ls2k0500-mmc
> >        - loongson,ls2k1000-mmc
> > +      - loongson,ls2k2000-mmc
> >
> >    reg:
> > +    minItems: 1
> >      maxItems: 2
>
> Missed this in the first patch, but you need to define what each entry
> is.
Are you thinking that “minItems” should be added in patch-1?
I'm not sure if I'm right, but for patch-1 (Loongson-2K1000), his reg
count must be 2, so it doesn't need the “ minItems: 1” limitation,
whereas Loongson-2K2000 needs this limitation, and so it was put in
this patch.

Of course, for the reg description, it is true that I missed it, and I
will add it in patch-1.

>
> >
> >    interrupts:
> > @@ -42,11 +47,31 @@ required:
> >    - reg
> >    - interrupts
> >    - clocks
> > -  - dmas
> > -  - dma-names
> >
> >  unevaluatedProperties: false
> >
> > +if:
> > +  properties:
> > +    compatible:
> > +      contains:
> > +        enum:
> > +          - loongson,ls2k0500-mmc
> > +          - loongson,ls2k1000-mmc
> > +
> > +then:
> > +  properties:
> > +    reg:
> > +      minItems: 2
> > +
> > +  required:
> > +    - dmas
> > +    - dma-names
> > +
> > +else:
> > +  properties:
> > +    reg:
> > +      maxItems: 1
> > +
> >  examples:
> >    - |
> >      #include <dt-bindings/gpio/gpio.h>
> > @@ -65,3 +90,21 @@ examples:
> >          bus-width = <4>;
> >          cd-gpios = <&gpio0 22 GPIO_ACTIVE_LOW>;
> >      };
> > +
> > +  - |
> > +    #include <dt-bindings/interrupt-controller/irq.h>
> > +    #include <dt-bindings/clock/loongson,ls2k-clk.h>
> > +
> > +    mmc@79990000 {
> > +        compatible = "loongson,ls2k2000-mmc";
> > +        reg = <0x79990000 0x1000>;
> > +        interrupt-parent = <&pic>;
> > +        interrupts = <51 IRQ_TYPE_LEVEL_HIGH>;
> > +        clocks = <&clk LOONGSON2_EMMC_CLK>;
> > +        bus-width = <8>;
> > +        non-removable;
> > +        cap-mmc-highspeed;
> > +        mmc-hs200-1_8v;
> > +        no-sd;
> > +        no-sdio;
> > +    };
> > --
> > 2.47.1
> >

--
Thanks.
Binbin
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/mmc/loongson,ls2k-mmc.yaml b/Documentation/devicetree/bindings/mmc/loongson,ls2k-mmc.yaml
index f3e94f5f3a35..24d217a9bbe6 100644
--- a/Documentation/devicetree/bindings/mmc/loongson,ls2k-mmc.yaml
+++ b/Documentation/devicetree/bindings/mmc/loongson,ls2k-mmc.yaml
@@ -9,6 +9,9 @@  title: The SD/SDIO/eMMC host controller for Loongson-2K family SoCs
 description:
   The MMC host controller on the Loongson-2K0500/2K1000 (using an externally
   shared apbdma controller) provides the SD and SDIO device interfaces.
+  The two MMC host controllers on the Loongson-2K2000 are similar,
+  except that they use internal exclusive DMA. one controller provides
+  the eMMC interface and the other provides the SD/SDIO interface.
 
 maintainers:
   - Binbin Zhou <zhoubinbin@loongson.cn>
@@ -21,8 +24,10 @@  properties:
     enum:
       - loongson,ls2k0500-mmc
       - loongson,ls2k1000-mmc
+      - loongson,ls2k2000-mmc
 
   reg:
+    minItems: 1
     maxItems: 2
 
   interrupts:
@@ -42,11 +47,31 @@  required:
   - reg
   - interrupts
   - clocks
-  - dmas
-  - dma-names
 
 unevaluatedProperties: false
 
+if:
+  properties:
+    compatible:
+      contains:
+        enum:
+          - loongson,ls2k0500-mmc
+          - loongson,ls2k1000-mmc
+
+then:
+  properties:
+    reg:
+      minItems: 2
+
+  required:
+    - dmas
+    - dma-names
+
+else:
+  properties:
+    reg:
+      maxItems: 1
+
 examples:
   - |
     #include <dt-bindings/gpio/gpio.h>
@@ -65,3 +90,21 @@  examples:
         bus-width = <4>;
         cd-gpios = <&gpio0 22 GPIO_ACTIVE_LOW>;
     };
+
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    #include <dt-bindings/clock/loongson,ls2k-clk.h>
+
+    mmc@79990000 {
+        compatible = "loongson,ls2k2000-mmc";
+        reg = <0x79990000 0x1000>;
+        interrupt-parent = <&pic>;
+        interrupts = <51 IRQ_TYPE_LEVEL_HIGH>;
+        clocks = <&clk LOONGSON2_EMMC_CLK>;
+        bus-width = <8>;
+        non-removable;
+        cap-mmc-highspeed;
+        mmc-hs200-1_8v;
+        no-sd;
+        no-sdio;
+    };