xref: /linux/Documentation/devicetree/bindings/mtd/loongson,ls1b-nand-controller.yaml (revision d8d2b1f81530988abe2e2bfaceec1c5d30b9a0b4)
1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/mtd/loongson,ls1b-nand-controller.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Loongson NAND Controller
8
9maintainers:
10  - Keguang Zhang <keguang.zhang@gmail.com>
11  - Binbin Zhou <zhoubinbin@loongson.cn>
12
13description:
14  The Loongson NAND controller abstracts all supported operations,
15  meaning it does not support low-level access to raw NAND flash chips.
16  Moreover, the controller is paired with the DMA engine to perform
17  READ and PROGRAM functions.
18
19allOf:
20  - $ref: nand-controller.yaml
21
22properties:
23  compatible:
24    oneOf:
25      - enum:
26          - loongson,ls1b-nand-controller
27          - loongson,ls1c-nand-controller
28          - loongson,ls2k0500-nand-controller
29          - loongson,ls2k1000-nand-controller
30      - items:
31          - enum:
32              - loongson,ls1a-nand-controller
33          - const: loongson,ls1b-nand-controller
34
35  reg:
36    minItems: 2
37    maxItems: 3
38
39  reg-names:
40    minItems: 2
41    items:
42      - const: nand
43      - const: nand-dma
44      - const: dma-config
45
46  dmas:
47    maxItems: 1
48
49  dma-names:
50    const: rxtx
51
52required:
53  - compatible
54  - reg
55  - reg-names
56  - dmas
57  - dma-names
58
59unevaluatedProperties: false
60
61if:
62  properties:
63    compatible:
64      contains:
65        enum:
66          - loongson,ls2k1000-nand-controller
67
68then:
69  properties:
70    reg:
71      minItems: 3
72    reg-names:
73      minItems: 3
74
75else:
76  properties:
77    reg:
78      maxItems: 2
79    reg-names:
80      maxItems: 2
81
82examples:
83  - |
84    nand-controller@1fe78000 {
85        compatible = "loongson,ls1b-nand-controller";
86        reg = <0x1fe78000 0x24>, <0x1fe78040 0x4>;
87        reg-names = "nand", "nand-dma";
88        dmas = <&dma 0>;
89        dma-names = "rxtx";
90        #address-cells = <1>;
91        #size-cells = <0>;
92
93        nand@0 {
94            reg = <0>;
95            label = "ls1x-nand";
96            nand-use-soft-ecc-engine;
97            nand-ecc-algo = "hamming";
98        };
99    };
100
101  - |
102    nand-controller@1fe26000 {
103        compatible = "loongson,ls2k1000-nand-controller";
104        reg = <0x1fe26000 0x24>,
105              <0x1fe26040 0x4>,
106              <0x1fe00438 0x8>;
107        reg-names = "nand", "nand-dma", "dma-config";
108        dmas = <&apbdma0 0>;
109        dma-names = "rxtx";
110
111        #address-cells = <1>;
112        #size-cells = <0>;
113
114        nand@0 {
115            reg = <0>;
116            label = "ls2k1000-nand";
117            nand-use-soft-ecc-engine;
118            nand-ecc-algo = "bch";
119            nand-ecc-strength = <8>;
120            nand-ecc-step-size = <512>;
121        };
122    };
123