1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/mtd/rockchip,nand-controller.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Rockchip SoCs NAND FLASH Controller (NFC)
8
9allOf:
10  - $ref: nand-controller.yaml#
11
12maintainers:
13  - Heiko Stuebner <heiko@sntech.de>
14
15properties:
16  compatible:
17    oneOf:
18      - const: rockchip,px30-nfc
19      - const: rockchip,rk2928-nfc
20      - const: rockchip,rv1108-nfc
21      - items:
22          - enum:
23              - rockchip,rk3036-nfc
24              - rockchip,rk3128-nfc
25          - const: rockchip,rk2928-nfc
26      - items:
27          - const: rockchip,rk3308-nfc
28          - const: rockchip,rv1108-nfc
29
30  reg:
31    maxItems: 1
32
33  interrupts:
34    maxItems: 1
35
36  clocks:
37    minItems: 1
38    items:
39      - description: Bus Clock
40      - description: Module Clock
41
42  clock-names:
43    minItems: 1
44    items:
45      - const: ahb
46      - const: nfc
47
48  assigned-clocks:
49    maxItems: 1
50
51  assigned-clock-rates:
52    maxItems: 1
53
54  power-domains:
55    maxItems: 1
56
57patternProperties:
58  "^nand@[0-7]$":
59    type: object
60    properties:
61      reg:
62        minimum: 0
63        maximum: 7
64
65      nand-ecc-mode:
66        const: hw
67
68      nand-ecc-step-size:
69        const: 1024
70
71      nand-ecc-strength:
72        enum: [16, 24, 40, 60, 70]
73        description: |
74          The ECC configurations that can be supported are as follows.
75            NFC v600 ECC 16, 24, 40, 60
76              RK2928, RK3066, RK3188
77
78            NFC v622 ECC 16, 24, 40, 60
79              RK3036, RK3128
80
81            NFC v800 ECC 16
82              RK3308, RV1108
83
84            NFC v900 ECC 16, 40, 60, 70
85              RK3326, PX30
86
87      nand-bus-width:
88        const: 8
89
90      rockchip,boot-blks:
91        $ref: /schemas/types.yaml#/definitions/uint32
92        minimum: 2
93        default: 16
94        description:
95          The NFC driver need this information to select ECC
96          algorithms supported by the boot ROM.
97          Only used in combination with 'nand-is-boot-medium'.
98
99      rockchip,boot-ecc-strength:
100        enum: [16, 24, 40, 60, 70]
101        $ref: /schemas/types.yaml#/definitions/uint32
102        description: |
103          If specified it indicates that a different BCH/ECC setting is
104          supported by the boot ROM.
105            NFC v600 ECC 16, 24
106              RK2928, RK3066, RK3188
107
108            NFC v622 ECC 16, 24, 40, 60
109              RK3036, RK3128
110
111            NFC v800 ECC 16
112              RK3308, RV1108
113
114            NFC v900 ECC 16, 70
115              RK3326, PX30
116
117          Only used in combination with 'nand-is-boot-medium'.
118
119required:
120  - compatible
121  - reg
122  - interrupts
123  - clocks
124  - clock-names
125
126unevaluatedProperties: false
127
128examples:
129  - |
130    #include <dt-bindings/clock/rk3308-cru.h>
131    #include <dt-bindings/interrupt-controller/arm-gic.h>
132    nfc: nand-controller@ff4b0000 {
133      compatible = "rockchip,rk3308-nfc",
134                   "rockchip,rv1108-nfc";
135      reg = <0xff4b0000 0x4000>;
136      interrupts = <GIC_SPI 81 IRQ_TYPE_LEVEL_HIGH>;
137      clocks = <&cru HCLK_NANDC>, <&cru SCLK_NANDC>;
138      clock-names = "ahb", "nfc";
139      assigned-clocks = <&clks SCLK_NANDC>;
140      assigned-clock-rates = <150000000>;
141
142      pinctrl-0 = <&flash_ale &flash_bus8 &flash_cle &flash_csn0
143                   &flash_rdn &flash_rdy &flash_wrn>;
144      pinctrl-names = "default";
145
146      #address-cells = <1>;
147      #size-cells = <0>;
148
149      nand@0 {
150        reg = <0>;
151        label = "rk-nand";
152        nand-bus-width = <8>;
153        nand-ecc-mode = "hw";
154        nand-ecc-step-size = <1024>;
155        nand-ecc-strength = <16>;
156        nand-is-boot-medium;
157        rockchip,boot-blks = <8>;
158        rockchip,boot-ecc-strength = <16>;
159      };
160    };
161
162...
163