18c2ecf20Sopenharmony_ci# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
28c2ecf20Sopenharmony_ci%YAML 1.2
38c2ecf20Sopenharmony_ci---
48c2ecf20Sopenharmony_ci$id: http://devicetree.org/schemas/mtd/ingenic,nand.yaml#
58c2ecf20Sopenharmony_ci$schema: http://devicetree.org/meta-schemas/core.yaml#
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_cititle: Ingenic SoCs NAND controller devicetree bindings
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_cimaintainers:
108c2ecf20Sopenharmony_ci  - Paul Cercueil <paul@crapouillou.net>
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ciallOf:
138c2ecf20Sopenharmony_ci  - $ref: nand-controller.yaml#
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ciproperties:
168c2ecf20Sopenharmony_ci  compatible:
178c2ecf20Sopenharmony_ci    enum:
188c2ecf20Sopenharmony_ci      - ingenic,jz4740-nand
198c2ecf20Sopenharmony_ci      - ingenic,jz4725b-nand
208c2ecf20Sopenharmony_ci      - ingenic,jz4780-nand
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ci  reg:
238c2ecf20Sopenharmony_ci    items:
248c2ecf20Sopenharmony_ci      - description: Bank number, offset and size of first attached NAND chip
258c2ecf20Sopenharmony_ci      - description: Bank number, offset and size of second attached NAND chip
268c2ecf20Sopenharmony_ci      - description: Bank number, offset and size of third attached NAND chip
278c2ecf20Sopenharmony_ci      - description: Bank number, offset and size of fourth attached NAND chip
288c2ecf20Sopenharmony_ci    minItems: 1
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ci  ecc-engine: true
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ci  partitions:
338c2ecf20Sopenharmony_ci    type: object
348c2ecf20Sopenharmony_ci    description:
358c2ecf20Sopenharmony_ci      Node containing description of fixed partitions.
368c2ecf20Sopenharmony_ci      See Documentation/devicetree/bindings/mtd/partition.txt
378c2ecf20Sopenharmony_ci
388c2ecf20Sopenharmony_cipatternProperties:
398c2ecf20Sopenharmony_ci  "^nand@[a-f0-9]$":
408c2ecf20Sopenharmony_ci    type: object
418c2ecf20Sopenharmony_ci    properties:
428c2ecf20Sopenharmony_ci      rb-gpios:
438c2ecf20Sopenharmony_ci        description: GPIO specifier for the busy pin.
448c2ecf20Sopenharmony_ci        maxItems: 1
458c2ecf20Sopenharmony_ci
468c2ecf20Sopenharmony_ci      wp-gpios:
478c2ecf20Sopenharmony_ci        description: GPIO specifier for the write-protect pin.
488c2ecf20Sopenharmony_ci        maxItems: 1
498c2ecf20Sopenharmony_ci
508c2ecf20Sopenharmony_cirequired:
518c2ecf20Sopenharmony_ci  - compatible
528c2ecf20Sopenharmony_ci  - reg
538c2ecf20Sopenharmony_ci
548c2ecf20Sopenharmony_ciunevaluatedProperties: false
558c2ecf20Sopenharmony_ci
568c2ecf20Sopenharmony_ciexamples:
578c2ecf20Sopenharmony_ci  - |
588c2ecf20Sopenharmony_ci    #include <dt-bindings/clock/jz4780-cgu.h>
598c2ecf20Sopenharmony_ci    memory-controller@13410000 {
608c2ecf20Sopenharmony_ci      compatible = "ingenic,jz4780-nemc";
618c2ecf20Sopenharmony_ci      reg = <0x13410000 0x10000>;
628c2ecf20Sopenharmony_ci      #address-cells = <2>;
638c2ecf20Sopenharmony_ci      #size-cells = <1>;
648c2ecf20Sopenharmony_ci      ranges = <1 0 0x1b000000 0x1000000>,
658c2ecf20Sopenharmony_ci         <2 0 0x1a000000 0x1000000>,
668c2ecf20Sopenharmony_ci         <3 0 0x19000000 0x1000000>,
678c2ecf20Sopenharmony_ci         <4 0 0x18000000 0x1000000>,
688c2ecf20Sopenharmony_ci         <5 0 0x17000000 0x1000000>,
698c2ecf20Sopenharmony_ci         <6 0 0x16000000 0x1000000>;
708c2ecf20Sopenharmony_ci
718c2ecf20Sopenharmony_ci      clocks = <&cgu JZ4780_CLK_NEMC>;
728c2ecf20Sopenharmony_ci
738c2ecf20Sopenharmony_ci      nand-controller@1 {
748c2ecf20Sopenharmony_ci        compatible = "ingenic,jz4780-nand";
758c2ecf20Sopenharmony_ci        reg = <1 0 0x1000000>;
768c2ecf20Sopenharmony_ci
778c2ecf20Sopenharmony_ci        #address-cells = <1>;
788c2ecf20Sopenharmony_ci        #size-cells = <0>;
798c2ecf20Sopenharmony_ci
808c2ecf20Sopenharmony_ci        ecc-engine = <&bch>;
818c2ecf20Sopenharmony_ci
828c2ecf20Sopenharmony_ci        ingenic,nemc-tAS = <10>;
838c2ecf20Sopenharmony_ci        ingenic,nemc-tAH = <5>;
848c2ecf20Sopenharmony_ci        ingenic,nemc-tBP = <10>;
858c2ecf20Sopenharmony_ci        ingenic,nemc-tAW = <15>;
868c2ecf20Sopenharmony_ci        ingenic,nemc-tSTRV = <100>;
878c2ecf20Sopenharmony_ci
888c2ecf20Sopenharmony_ci        pinctrl-names = "default";
898c2ecf20Sopenharmony_ci        pinctrl-0 = <&pins_nemc>;
908c2ecf20Sopenharmony_ci
918c2ecf20Sopenharmony_ci        nand@1 {
928c2ecf20Sopenharmony_ci          reg = <1>;
938c2ecf20Sopenharmony_ci
948c2ecf20Sopenharmony_ci          nand-ecc-step-size = <1024>;
958c2ecf20Sopenharmony_ci          nand-ecc-strength = <24>;
968c2ecf20Sopenharmony_ci          nand-ecc-mode = "hw";
978c2ecf20Sopenharmony_ci          nand-on-flash-bbt;
988c2ecf20Sopenharmony_ci
998c2ecf20Sopenharmony_ci          pinctrl-names = "default";
1008c2ecf20Sopenharmony_ci          pinctrl-0 = <&pins_nemc_cs1>;
1018c2ecf20Sopenharmony_ci
1028c2ecf20Sopenharmony_ci          partitions {
1038c2ecf20Sopenharmony_ci            compatible = "fixed-partitions";
1048c2ecf20Sopenharmony_ci            #address-cells = <2>;
1058c2ecf20Sopenharmony_ci            #size-cells = <2>;
1068c2ecf20Sopenharmony_ci
1078c2ecf20Sopenharmony_ci            partition@0 {
1088c2ecf20Sopenharmony_ci              label = "u-boot-spl";
1098c2ecf20Sopenharmony_ci              reg = <0x0 0x0 0x0 0x800000>;
1108c2ecf20Sopenharmony_ci            };
1118c2ecf20Sopenharmony_ci
1128c2ecf20Sopenharmony_ci            partition@800000 {
1138c2ecf20Sopenharmony_ci              label = "u-boot";
1148c2ecf20Sopenharmony_ci              reg = <0x0 0x800000 0x0 0x200000>;
1158c2ecf20Sopenharmony_ci            };
1168c2ecf20Sopenharmony_ci
1178c2ecf20Sopenharmony_ci            partition@a00000 {
1188c2ecf20Sopenharmony_ci              label = "u-boot-env";
1198c2ecf20Sopenharmony_ci              reg = <0x0 0xa00000 0x0 0x200000>;
1208c2ecf20Sopenharmony_ci            };
1218c2ecf20Sopenharmony_ci
1228c2ecf20Sopenharmony_ci            partition@c00000 {
1238c2ecf20Sopenharmony_ci              label = "boot";
1248c2ecf20Sopenharmony_ci              reg = <0x0 0xc00000 0x0 0x4000000>;
1258c2ecf20Sopenharmony_ci            };
1268c2ecf20Sopenharmony_ci
1278c2ecf20Sopenharmony_ci            partition@4c00000 {
1288c2ecf20Sopenharmony_ci              label = "system";
1298c2ecf20Sopenharmony_ci              reg = <0x0 0x4c00000 0x1 0xfb400000>;
1308c2ecf20Sopenharmony_ci            };
1318c2ecf20Sopenharmony_ci          };
1328c2ecf20Sopenharmony_ci        };
1338c2ecf20Sopenharmony_ci      };
1348c2ecf20Sopenharmony_ci    };
135