xref: /linux/Documentation/devicetree/bindings/mtd/gpmi-nand.yaml (revision a1ff5a7d78a036d6c2178ee5acd6ba4946243800)
1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/mtd/gpmi-nand.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Freescale General-Purpose Media Interface (GPMI)
8
9maintainers:
10  - Han Xu <han.xu@nxp.com>
11
12description: |
13  The GPMI nand controller provides an interface to control the NAND
14  flash chips. The device tree may optionally contain sub-nodes
15  describing partitions of the address space. See mtd.yaml for
16  more detail.
17
18properties:
19  compatible:
20    oneOf:
21      - enum:
22          - fsl,imx23-gpmi-nand
23          - fsl,imx28-gpmi-nand
24          - fsl,imx6q-gpmi-nand
25          - fsl,imx6sx-gpmi-nand
26          - fsl,imx7d-gpmi-nand
27          - fsl,imx8qxp-gpmi-nand
28      - items:
29          - enum:
30              - fsl,imx8mm-gpmi-nand
31              - fsl,imx8mn-gpmi-nand
32          - const: fsl,imx7d-gpmi-nand
33
34  reg:
35    items:
36      - description: Address and length of gpmi block.
37      - description: Address and length of bch block.
38
39  reg-names:
40    items:
41      - const: gpmi-nand
42      - const: bch
43
44  interrupts:
45    maxItems: 1
46
47  interrupt-names:
48    const: bch
49
50  dmas:
51    maxItems: 1
52
53  dma-names:
54    const: rx-tx
55
56  clocks:
57    minItems: 1
58    maxItems: 5
59
60  clock-names:
61    minItems: 1
62    maxItems: 5
63
64  fsl,use-minimum-ecc:
65    type: boolean
66    description: |
67      Protect this NAND flash with the minimum ECC strength required.
68      The required ECC strength is automatically discoverable for some
69      flash (e.g., according to the ONFI standard). However, note that
70      if this strength is not discoverable or this property is not enabled,
71      the software may chooses an implementation-defined ECC scheme.
72
73  fsl,no-blockmark-swap:
74    type: boolean
75    description: |
76      Don't swap the bad block marker from the OOB area with the byte in
77      the data area but rely on the flash based BBT for identifying bad blocks.
78      NOTE: this is only valid in conjunction with 'nand-on-flash-bbt'.
79      WARNING: on i.MX28 blockmark swapping cannot be disabled for the BootROM
80      in the FCB. Thus, partitions written from Linux with this feature turned
81      on may not be accessible by the BootROM code.
82
83required:
84  - compatible
85  - reg
86  - reg-names
87  - interrupts
88  - interrupt-names
89  - clocks
90  - clock-names
91  - dmas
92  - dma-names
93
94unevaluatedProperties: false
95
96allOf:
97  - $ref: nand-controller.yaml
98
99  - if:
100      properties:
101        compatible:
102          contains:
103            enum:
104              - fsl,imx23-gpmi-nand
105              - fsl,imx28-gpmi-nand
106    then:
107      properties:
108        clocks:
109          items:
110            - description: SoC gpmi io clock
111        clock-names:
112          items:
113            - const: gpmi_io
114
115  - if:
116      properties:
117        compatible:
118          contains:
119            enum:
120              - fsl,imx6q-gpmi-nand
121              - fsl,imx6sx-gpmi-nand
122    then:
123      properties:
124        clocks:
125          items:
126            - description: SoC gpmi io clock
127            - description: SoC gpmi apb clock
128            - description: SoC gpmi bch clock
129            - description: SoC gpmi bch apb clock
130            - description: SoC per1 bch clock
131        clock-names:
132          items:
133            - const: gpmi_io
134            - const: gpmi_apb
135            - const: gpmi_bch
136            - const: gpmi_bch_apb
137            - const: per1_bch
138
139  - if:
140      properties:
141        compatible:
142          contains:
143            const: fsl,imx7d-gpmi-nand
144    then:
145      properties:
146        clocks:
147          items:
148            - description: SoC gpmi io clock
149            - description: SoC gpmi bch apb clock
150        clock-names:
151          items:
152            - const: gpmi_io
153            - const: gpmi_bch_apb
154
155  - if:
156      properties:
157        compatible:
158          contains:
159            enum:
160              - fsl,imx8qxp-gpmi-nand
161    then:
162      properties:
163        clocks:
164          items:
165            - description: SoC gpmi io clock
166            - description: SoC gpmi apb clock
167            - description: SoC gpmi bch clock
168            - description: SoC gpmi bch apb clock
169        clock-names:
170          items:
171            - const: gpmi_io
172            - const: gpmi_apb
173            - const: gpmi_bch
174            - const: gpmi_bch_apb
175
176examples:
177  - |
178    nand-controller@8000c000 {
179        #address-cells = <1>;
180        #size-cells = <0>;
181        compatible = "fsl,imx28-gpmi-nand";
182        reg = <0x8000c000 0x2000>, <0x8000a000 0x2000>;
183        reg-names = "gpmi-nand", "bch";
184        interrupts = <41>;
185        interrupt-names = "bch";
186        clocks = <&clks 50>;
187        clock-names = "gpmi_io";
188        dmas = <&dma_apbh 4>;
189        dma-names = "rx-tx";
190    };
191