1# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/mmc/arm,pl18x.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: ARM PrimeCell MultiMedia Card Interface (MMCI) PL180 and PL181
8
9maintainers:
10  - Linus Walleij <linus.walleij@linaro.org>
11  - Ulf Hansson <ulf.hansson@linaro.org>
12
13description:
14  The ARM PrimeCells MMCI PL180 and PL181 provides an interface for
15  reading and writing to MultiMedia and SD cards alike. Over the years
16  vendors have use the VHDL code from ARM to create derivative MMC/SD/SDIO
17  host controllers with very similar characteristics.
18
19allOf:
20  - $ref: /schemas/arm/primecell.yaml#
21  - $ref: mmc-controller.yaml#
22
23# We need a select here so we don't match all nodes with 'arm,primecell'
24select:
25  properties:
26    compatible:
27      contains:
28        enum:
29          - arm,pl180
30          - arm,pl181
31          - arm,pl18x
32  required:
33    - compatible
34
35properties:
36  compatible:
37    oneOf:
38      - description: The first version of the block, simply called
39          PL180 and found in the ARM Integrator IM/PD1 logic module.
40        items:
41          - const: arm,pl180
42          - const: arm,primecell
43      - description: The improved version of the block, found in the
44          ARM Versatile and later reference designs. Further revisions
45          exist but get detected at runtime by reading some magic numbers
46          in the PrimeCell ID registers.
47        items:
48          - const: arm,pl181
49          - const: arm,primecell
50      - description: Wildcard entry that will let the operating system
51          inspect the PrimeCell ID registers to determine which hardware
52          variant of PL180 or PL181 this is.
53        items:
54          - const: arm,pl18x
55          - const: arm,primecell
56
57  clocks:
58    description: One or two clocks, the "apb_pclk" and the "MCLK"
59      which is the core block clock. The names are not compulsory.
60    minItems: 1
61    maxItems: 2
62
63  power-domains: true
64
65  resets:
66    maxItems: 1
67
68  reg:
69    description: the MMIO memory window must be exactly 4KB (0x1000) and the
70      layout should provide the PrimeCell ID registers so that the device can
71      be discovered. On ST Micro variants, a second register window may be
72      defined if a delay block is present and used for tuning.
73
74  interrupts:
75    description: The first interrupt is the command interrupt and corresponds
76      to the event at the end of a command. The second interrupt is the
77      PIO (polled I/O) interrupt and occurs when the FIFO needs to be
78      emptied as part of a bulk read from the card. Some variants have these
79      two interrupts wired into the same line (logic OR) and in that case
80      only one interrupt may be provided.
81    minItems: 1
82    maxItems: 2
83
84  st,sig-dir-dat0:
85    $ref: /schemas/types.yaml#/definitions/flag
86    description: ST Micro-specific property, bus signal direction pins used for
87      DAT[0].
88
89  st,sig-dir-dat2:
90    $ref: /schemas/types.yaml#/definitions/flag
91    description: ST Micro-specific property, bus signal direction pins used for
92      DAT[2].
93
94  st,sig-dir-dat31:
95    $ref: /schemas/types.yaml#/definitions/flag
96    description: ST Micro-specific property, bus signal direction pins used for
97      DAT[3] and DAT[1].
98
99  st,sig-dir-dat74:
100    $ref: /schemas/types.yaml#/definitions/flag
101    description: ST Micro-specific property, bus signal direction pins used for
102      DAT[7] and DAT[4].
103
104  st,sig-dir-cmd:
105    $ref: /schemas/types.yaml#/definitions/flag
106    description: ST Micro-specific property, CMD signal direction used for
107      pin CMD.
108
109  st,sig-pin-fbclk:
110    $ref: /schemas/types.yaml#/definitions/flag
111    description: ST Micro-specific property, feedback clock FBCLK signal pin
112      in use.
113
114  st,sig-dir:
115    $ref: /schemas/types.yaml#/definitions/flag
116    description: ST Micro-specific property, signal direction polarity used for
117      pins CMD, DAT[0], DAT[1], DAT[2] and DAT[3].
118
119  st,neg-edge:
120    $ref: /schemas/types.yaml#/definitions/flag
121    description: ST Micro-specific property, data and command phase relation,
122      generated on the sd clock falling edge.
123
124  st,use-ckin:
125    $ref: /schemas/types.yaml#/definitions/flag
126    description: ST Micro-specific property, use CKIN pin from an external
127      driver to sample the receive data (for example with a voltage switch
128      transceiver).
129
130  st,cmd-gpios:
131    maxItems: 1
132    description:
133      The GPIO matching the CMD pin.
134
135  st,ck-gpios:
136    maxItems: 1
137    description:
138      The GPIO matching the CK pin.
139
140  st,ckin-gpios:
141    maxItems: 1
142    description:
143      The GPIO matching the CKIN pin.
144
145dependencies:
146  st,cmd-gpios: [ "st,use-ckin" ]
147  st,ck-gpios: [ "st,use-ckin" ]
148  st,ckin-gpios: [ "st,use-ckin" ]
149
150unevaluatedProperties: false
151
152required:
153  - compatible
154  - reg
155  - interrupts
156
157examples:
158  - |
159    #include <dt-bindings/interrupt-controller/irq.h>
160    #include <dt-bindings/gpio/gpio.h>
161
162    mmc@5000 {
163      compatible = "arm,pl180", "arm,primecell";
164      reg = <0x5000 0x1000>;
165      interrupts-extended = <&vic 22 &sic 1>;
166      clocks = <&xtal24mhz>, <&pclk>;
167      clock-names = "mclk", "apb_pclk";
168    };
169
170  - |
171    #include <dt-bindings/interrupt-controller/irq.h>
172
173    mmc@80126000 {
174      compatible = "arm,pl18x", "arm,primecell";
175      reg = <0x80126000 0x1000>;
176      interrupts = <0 60 IRQ_TYPE_LEVEL_HIGH>;
177      dmas = <&dma 29 0 0x2>, <&dma 29 0 0x0>;
178      dma-names = "rx", "tx";
179      clocks = <&prcc_kclk 1 5>, <&prcc_pclk 1 5>;
180      clock-names = "sdi", "apb_pclk";
181      max-frequency = <100000000>;
182      bus-width = <4>;
183      cap-sd-highspeed;
184      cap-mmc-highspeed;
185      cd-gpios  = <&gpio2 31 0x4>;
186      st,sig-dir-dat0;
187      st,sig-dir-dat2;
188      st,sig-dir-cmd;
189      st,sig-pin-fbclk;
190      vmmc-supply = <&ab8500_ldo_aux3_reg>;
191      vqmmc-supply = <&vmmci>;
192    };
193
194  - |
195    mmc@101f6000 {
196      compatible = "arm,pl18x", "arm,primecell";
197      reg = <0x101f6000 0x1000>;
198      clocks = <&sdiclk>, <&pclksdi>;
199      clock-names = "mclk", "apb_pclk";
200      interrupts = <22>;
201      max-frequency = <400000>;
202      bus-width = <4>;
203      cap-mmc-highspeed;
204      cap-sd-highspeed;
205      full-pwr-cycle;
206      st,sig-dir-dat0;
207      st,sig-dir-dat2;
208      st,sig-dir-dat31;
209      st,sig-dir-cmd;
210      st,sig-pin-fbclk;
211      vmmc-supply = <&vmmc_regulator>;
212    };
213
214  - |
215    mmc@52007000 {
216      compatible = "arm,pl18x", "arm,primecell";
217      arm,primecell-periphid = <0x10153180>;
218      reg = <0x52007000 0x1000>;
219      interrupts = <49>;
220      interrupt-names = "cmd_irq";
221      clocks = <&rcc 0>;
222      clock-names = "apb_pclk";
223      resets = <&rcc 1>;
224      cap-sd-highspeed;
225      cap-mmc-highspeed;
226      max-frequency = <120000000>;
227    };
228