summaryrefslogtreecommitdiffstats
path: root/Documentation/devicetree/bindings/mtd/loongson,ls1b-nand-controller.yaml
blob: cf85d0cede00dc1c38aa886c6d7a53f297038f0b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/mtd/loongson,ls1b-nand-controller.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Loongson NAND Controller

maintainers:
  - Keguang Zhang <keguang.zhang@gmail.com>
  - Binbin Zhou <zhoubinbin@loongson.cn>

description:
  The Loongson NAND controller abstracts all supported operations,
  meaning it does not support low-level access to raw NAND flash chips.
  Moreover, the controller is paired with the DMA engine to perform
  READ and PROGRAM functions.

allOf:
  - $ref: nand-controller.yaml

properties:
  compatible:
    oneOf:
      - enum:
          - loongson,ls1b-nand-controller
          - loongson,ls1c-nand-controller
          - loongson,ls2k0500-nand-controller
          - loongson,ls2k1000-nand-controller
      - items:
          - enum:
              - loongson,ls1a-nand-controller
          - const: loongson,ls1b-nand-controller

  reg:
    minItems: 2
    maxItems: 3

  reg-names:
    minItems: 2
    items:
      - const: nand
      - const: nand-dma
      - const: dma-config

  dmas:
    maxItems: 1

  dma-names:
    const: rxtx

required:
  - compatible
  - reg
  - reg-names
  - dmas
  - dma-names

unevaluatedProperties: false

if:
  properties:
    compatible:
      contains:
        enum:
          - loongson,ls2k1000-nand-controller

then:
  properties:
    reg:
      minItems: 3
    reg-names:
      minItems: 3

else:
  properties:
    reg:
      maxItems: 2
    reg-names:
      maxItems: 2

examples:
  - |
    nand-controller@1fe78000 {
        compatible = "loongson,ls1b-nand-controller";
        reg = <0x1fe78000 0x24>, <0x1fe78040 0x4>;
        reg-names = "nand", "nand-dma";
        dmas = <&dma 0>;
        dma-names = "rxtx";
        #address-cells = <1>;
        #size-cells = <0>;

        nand@0 {
            reg = <0>;
            label = "ls1x-nand";
            nand-use-soft-ecc-engine;
            nand-ecc-algo = "hamming";
        };
    };

  - |
    nand-controller@1fe26000 {
        compatible = "loongson,ls2k1000-nand-controller";
        reg = <0x1fe26000 0x24>,
              <0x1fe26040 0x4>,
              <0x1fe00438 0x8>;
        reg-names = "nand", "nand-dma", "dma-config";
        dmas = <&apbdma0 0>;
        dma-names = "rxtx";

        #address-cells = <1>;
        #size-cells = <0>;

        nand@0 {
            reg = <0>;
            label = "ls2k1000-nand";
            nand-use-soft-ecc-engine;
            nand-ecc-algo = "bch";
            nand-ecc-strength = <8>;
            nand-ecc-step-size = <512>;
        };
    };