xref: /freebsd-src/sys/contrib/device-tree/Bindings/mtd/marvell,nand-controller.yaml (revision aa1a8ff2d6dbc51ef058f46f3db5a8bb77967145)
1f126890aSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2f126890aSEmmanuel Vadot%YAML 1.2
3f126890aSEmmanuel Vadot---
4f126890aSEmmanuel Vadot$id: http://devicetree.org/schemas/mtd/marvell,nand-controller.yaml#
5f126890aSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6f126890aSEmmanuel Vadot
7f126890aSEmmanuel Vadottitle: Marvell NAND Flash Controller (NFC)
8f126890aSEmmanuel Vadot
9f126890aSEmmanuel Vadotmaintainers:
10f126890aSEmmanuel Vadot  - Miquel Raynal <miquel.raynal@bootlin.com>
11f126890aSEmmanuel Vadot
12f126890aSEmmanuel Vadotproperties:
13f126890aSEmmanuel Vadot  compatible:
14f126890aSEmmanuel Vadot    oneOf:
15f126890aSEmmanuel Vadot      - items:
16f126890aSEmmanuel Vadot          - const: marvell,armada-8k-nand-controller
17f126890aSEmmanuel Vadot          - const: marvell,armada370-nand-controller
18f126890aSEmmanuel Vadot      - enum:
19*aa1a8ff2SEmmanuel Vadot          - marvell,ac5-nand-controller
20f126890aSEmmanuel Vadot          - marvell,armada370-nand-controller
21f126890aSEmmanuel Vadot          - marvell,pxa3xx-nand-controller
22f126890aSEmmanuel Vadot      - description: legacy bindings
23f126890aSEmmanuel Vadot        deprecated: true
24f126890aSEmmanuel Vadot        enum:
25f126890aSEmmanuel Vadot          - marvell,armada-8k-nand
26f126890aSEmmanuel Vadot          - marvell,armada370-nand
27f126890aSEmmanuel Vadot          - marvell,pxa3xx-nand
28f126890aSEmmanuel Vadot
29f126890aSEmmanuel Vadot  reg:
30f126890aSEmmanuel Vadot    maxItems: 1
31f126890aSEmmanuel Vadot
32f126890aSEmmanuel Vadot  interrupts:
33f126890aSEmmanuel Vadot    maxItems: 1
34f126890aSEmmanuel Vadot
35f126890aSEmmanuel Vadot  clocks:
36f126890aSEmmanuel Vadot    description:
37f126890aSEmmanuel Vadot      Shall reference the NAND controller clocks, the second one is
38f126890aSEmmanuel Vadot      is only needed for the Armada 7K/8K SoCs
39f126890aSEmmanuel Vadot    minItems: 1
40f126890aSEmmanuel Vadot    maxItems: 2
41f126890aSEmmanuel Vadot
42f126890aSEmmanuel Vadot  clock-names:
43f126890aSEmmanuel Vadot    minItems: 1
44f126890aSEmmanuel Vadot    items:
45f126890aSEmmanuel Vadot      - const: core
46f126890aSEmmanuel Vadot      - const: reg
47f126890aSEmmanuel Vadot
48f126890aSEmmanuel Vadot  dmas:
49f126890aSEmmanuel Vadot    maxItems: 1
50f126890aSEmmanuel Vadot
51f126890aSEmmanuel Vadot  dma-names:
52f126890aSEmmanuel Vadot    items:
53f126890aSEmmanuel Vadot      - const: data
54f126890aSEmmanuel Vadot
55f126890aSEmmanuel Vadot  marvell,system-controller:
56f126890aSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/phandle
57f126890aSEmmanuel Vadot    description: Syscon node that handles NAND controller related registers
58f126890aSEmmanuel Vadot
59f126890aSEmmanuel VadotpatternProperties:
60f126890aSEmmanuel Vadot  "^nand@[a-f0-9]$":
61f126890aSEmmanuel Vadot    type: object
62f126890aSEmmanuel Vadot    $ref: raw-nand-chip.yaml
63f126890aSEmmanuel Vadot
64f126890aSEmmanuel Vadot    properties:
65f126890aSEmmanuel Vadot      reg:
66f126890aSEmmanuel Vadot        minimum: 0
67f126890aSEmmanuel Vadot        maximum: 3
68f126890aSEmmanuel Vadot
69f126890aSEmmanuel Vadot      nand-rb:
70f126890aSEmmanuel Vadot        items:
71f126890aSEmmanuel Vadot          - minimum: 0
72f126890aSEmmanuel Vadot            maximum: 1
73f126890aSEmmanuel Vadot
74f126890aSEmmanuel Vadot      nand-ecc-step-size:
75f126890aSEmmanuel Vadot        const: 512
76f126890aSEmmanuel Vadot
77f126890aSEmmanuel Vadot      nand-ecc-strength:
78f126890aSEmmanuel Vadot        enum: [1, 4, 8, 12, 16]
79f126890aSEmmanuel Vadot
80f126890aSEmmanuel Vadot      nand-ecc-mode:
81f126890aSEmmanuel Vadot        const: hw
82f126890aSEmmanuel Vadot
83f126890aSEmmanuel Vadot      marvell,nand-keep-config:
84f126890aSEmmanuel Vadot        $ref: /schemas/types.yaml#/definitions/flag
85f126890aSEmmanuel Vadot        description:
86f126890aSEmmanuel Vadot          Orders the driver not to take the timings from the core and
87f126890aSEmmanuel Vadot          leaving them completely untouched. Bootloader timings will then
88f126890aSEmmanuel Vadot          be used.
89f126890aSEmmanuel Vadot
90f126890aSEmmanuel Vadot      marvell,nand-enable-arbiter:
91f126890aSEmmanuel Vadot        $ref: /schemas/types.yaml#/definitions/flag
92f126890aSEmmanuel Vadot        description:
93f126890aSEmmanuel Vadot          To enable the arbiter, all boards blindly used it,
94f126890aSEmmanuel Vadot          this bit was set by the bootloader for many boards and even if
95f126890aSEmmanuel Vadot          it is marked reserved in several datasheets, it might be needed to set
96f126890aSEmmanuel Vadot          it (otherwise it is harmless).
97f126890aSEmmanuel Vadot        deprecated: true
98f126890aSEmmanuel Vadot
99f126890aSEmmanuel Vadot    required:
100f126890aSEmmanuel Vadot      - reg
101f126890aSEmmanuel Vadot      - nand-rb
102f126890aSEmmanuel Vadot
103f126890aSEmmanuel Vadot    unevaluatedProperties: false
104f126890aSEmmanuel Vadot
105f126890aSEmmanuel Vadotrequired:
106f126890aSEmmanuel Vadot  - compatible
107f126890aSEmmanuel Vadot  - reg
108f126890aSEmmanuel Vadot  - interrupts
109f126890aSEmmanuel Vadot  - clocks
110f126890aSEmmanuel Vadot
111f126890aSEmmanuel VadotallOf:
112f126890aSEmmanuel Vadot  - $ref: nand-controller.yaml#
113f126890aSEmmanuel Vadot
114f126890aSEmmanuel Vadot  - if:
115f126890aSEmmanuel Vadot      properties:
116f126890aSEmmanuel Vadot        compatible:
117f126890aSEmmanuel Vadot          contains:
118f126890aSEmmanuel Vadot            const: marvell,pxa3xx-nand-controller
119f126890aSEmmanuel Vadot    then:
120f126890aSEmmanuel Vadot      required:
121f126890aSEmmanuel Vadot        - dmas
122f126890aSEmmanuel Vadot        - dma-names
123f126890aSEmmanuel Vadot
124f126890aSEmmanuel Vadot  - if:
125f126890aSEmmanuel Vadot      properties:
126f126890aSEmmanuel Vadot        compatible:
127f126890aSEmmanuel Vadot          contains:
128f126890aSEmmanuel Vadot            const: marvell,armada-8k-nand-controller
129f126890aSEmmanuel Vadot    then:
130f126890aSEmmanuel Vadot      properties:
131f126890aSEmmanuel Vadot        clocks:
132f126890aSEmmanuel Vadot          minItems: 2
133f126890aSEmmanuel Vadot
134f126890aSEmmanuel Vadot        clock-names:
135f126890aSEmmanuel Vadot          minItems: 2
136f126890aSEmmanuel Vadot
137f126890aSEmmanuel Vadot      required:
138f126890aSEmmanuel Vadot        - marvell,system-controller
139f126890aSEmmanuel Vadot
140f126890aSEmmanuel Vadot    else:
141f126890aSEmmanuel Vadot      properties:
142f126890aSEmmanuel Vadot        clocks:
143f126890aSEmmanuel Vadot          minItems: 1
144f126890aSEmmanuel Vadot
145f126890aSEmmanuel Vadot        clock-names:
146f126890aSEmmanuel Vadot          minItems: 1
147f126890aSEmmanuel Vadot
148f126890aSEmmanuel Vadot
149f126890aSEmmanuel VadotunevaluatedProperties: false
150f126890aSEmmanuel Vadot
151f126890aSEmmanuel Vadotexamples:
152f126890aSEmmanuel Vadot  - |
153f126890aSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/arm-gic.h>
154f126890aSEmmanuel Vadot    nand_controller: nand-controller@d0000 {
155f126890aSEmmanuel Vadot        compatible = "marvell,armada370-nand-controller";
156f126890aSEmmanuel Vadot        reg = <0xd0000 0x54>;
157f126890aSEmmanuel Vadot        #address-cells = <1>;
158f126890aSEmmanuel Vadot        #size-cells = <0>;
159f126890aSEmmanuel Vadot        interrupts = <GIC_SPI 84 IRQ_TYPE_LEVEL_HIGH>;
160f126890aSEmmanuel Vadot        clocks = <&coredivclk 0>;
161f126890aSEmmanuel Vadot
162f126890aSEmmanuel Vadot        nand@0 {
163f126890aSEmmanuel Vadot            reg = <0>;
164f126890aSEmmanuel Vadot            label = "main-storage";
165f126890aSEmmanuel Vadot            nand-rb = <0>;
166f126890aSEmmanuel Vadot            nand-ecc-mode = "hw";
167f126890aSEmmanuel Vadot            marvell,nand-keep-config;
168f126890aSEmmanuel Vadot            nand-on-flash-bbt;
169f126890aSEmmanuel Vadot            nand-ecc-strength = <4>;
170f126890aSEmmanuel Vadot            nand-ecc-step-size = <512>;
171f126890aSEmmanuel Vadot
172f126890aSEmmanuel Vadot            partitions {
173f126890aSEmmanuel Vadot                compatible = "fixed-partitions";
174f126890aSEmmanuel Vadot                #address-cells = <1>;
175f126890aSEmmanuel Vadot                #size-cells = <1>;
176f126890aSEmmanuel Vadot
177f126890aSEmmanuel Vadot                partition@0 {
178f126890aSEmmanuel Vadot                    label = "Rootfs";
179f126890aSEmmanuel Vadot                    reg = <0x00000000 0x40000000>;
180f126890aSEmmanuel Vadot                };
181f126890aSEmmanuel Vadot            };
182f126890aSEmmanuel Vadot        };
183f126890aSEmmanuel Vadot    };
184f126890aSEmmanuel Vadot
185f126890aSEmmanuel Vadot  - |
186f126890aSEmmanuel Vadot    cp0_nand_controller: nand-controller@720000 {
187f126890aSEmmanuel Vadot        compatible = "marvell,armada-8k-nand-controller",
188f126890aSEmmanuel Vadot                "marvell,armada370-nand-controller";
189f126890aSEmmanuel Vadot        reg = <0x720000 0x54>;
190f126890aSEmmanuel Vadot        #address-cells = <1>;
191f126890aSEmmanuel Vadot        #size-cells = <0>;
192f126890aSEmmanuel Vadot        interrupts = <115 IRQ_TYPE_LEVEL_HIGH>;
193f126890aSEmmanuel Vadot        clock-names = "core", "reg";
194f126890aSEmmanuel Vadot        clocks = <&cp0_clk 1 2>,
195f126890aSEmmanuel Vadot                 <&cp0_clk 1 17>;
196f126890aSEmmanuel Vadot        marvell,system-controller = <&cp0_syscon0>;
197f126890aSEmmanuel Vadot
198f126890aSEmmanuel Vadot        nand@0 {
199f126890aSEmmanuel Vadot            reg = <0>;
200f126890aSEmmanuel Vadot            label = "main-storage";
201f126890aSEmmanuel Vadot            nand-rb = <0>;
202f126890aSEmmanuel Vadot            nand-ecc-mode = "hw";
203f126890aSEmmanuel Vadot            nand-ecc-strength = <8>;
204f126890aSEmmanuel Vadot            nand-ecc-step-size = <512>;
205f126890aSEmmanuel Vadot        };
206f126890aSEmmanuel Vadot    };
207f126890aSEmmanuel Vadot
208f126890aSEmmanuel Vadot  - |
209f126890aSEmmanuel Vadot    nand-controller@43100000 {
210f126890aSEmmanuel Vadot        compatible = "marvell,pxa3xx-nand-controller";
211f126890aSEmmanuel Vadot        reg = <0x43100000 90>;
212f126890aSEmmanuel Vadot        interrupts = <45>;
213f126890aSEmmanuel Vadot        clocks = <&clks 1>;
214f126890aSEmmanuel Vadot        clock-names = "core";
215f126890aSEmmanuel Vadot        dmas = <&pdma 97 3>;
216f126890aSEmmanuel Vadot        dma-names = "data";
217f126890aSEmmanuel Vadot        #address-cells = <1>;
218f126890aSEmmanuel Vadot        #size-cells = <0>;
219f126890aSEmmanuel Vadot        nand@0 {
220f126890aSEmmanuel Vadot            reg = <0>;
221f126890aSEmmanuel Vadot            nand-rb = <0>;
222f126890aSEmmanuel Vadot            nand-ecc-mode = "hw";
223f126890aSEmmanuel Vadot            marvell,nand-keep-config;
224f126890aSEmmanuel Vadot        };
225f126890aSEmmanuel Vadot    };
226f126890aSEmmanuel Vadot
227f126890aSEmmanuel Vadot...
228