xref: /freebsd-src/sys/contrib/device-tree/Bindings/mtd/qcom,nandc.yaml (revision 0e8011faf58b743cc652e3b2ad0f7671227610df)
12eb4d8dcSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
22eb4d8dcSEmmanuel Vadot%YAML 1.2
32eb4d8dcSEmmanuel Vadot---
42eb4d8dcSEmmanuel Vadot$id: http://devicetree.org/schemas/mtd/qcom,nandc.yaml#
52eb4d8dcSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
62eb4d8dcSEmmanuel Vadot
72eb4d8dcSEmmanuel Vadottitle: Qualcomm NAND controller
82eb4d8dcSEmmanuel Vadot
92eb4d8dcSEmmanuel Vadotmaintainers:
102eb4d8dcSEmmanuel Vadot  - Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
112eb4d8dcSEmmanuel Vadot
122eb4d8dcSEmmanuel Vadotproperties:
132eb4d8dcSEmmanuel Vadot  compatible:
142eb4d8dcSEmmanuel Vadot    enum:
152eb4d8dcSEmmanuel Vadot      - qcom,ipq806x-nand
162eb4d8dcSEmmanuel Vadot      - qcom,ipq4019-nand
172eb4d8dcSEmmanuel Vadot      - qcom,ipq6018-nand
182eb4d8dcSEmmanuel Vadot      - qcom,ipq8074-nand
192eb4d8dcSEmmanuel Vadot      - qcom,sdx55-nand
202eb4d8dcSEmmanuel Vadot
212eb4d8dcSEmmanuel Vadot  reg:
222eb4d8dcSEmmanuel Vadot    maxItems: 1
232eb4d8dcSEmmanuel Vadot
242eb4d8dcSEmmanuel Vadot  clocks:
252eb4d8dcSEmmanuel Vadot    items:
262eb4d8dcSEmmanuel Vadot      - description: Core Clock
272eb4d8dcSEmmanuel Vadot      - description: Always ON Clock
282eb4d8dcSEmmanuel Vadot
292eb4d8dcSEmmanuel Vadot  clock-names:
302eb4d8dcSEmmanuel Vadot    items:
312eb4d8dcSEmmanuel Vadot      - const: core
322eb4d8dcSEmmanuel Vadot      - const: aon
332eb4d8dcSEmmanuel Vadot
34*0e8011faSEmmanuel Vadot  qcom,cmd-crci:
35*0e8011faSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
36*0e8011faSEmmanuel Vadot    description:
37*0e8011faSEmmanuel Vadot      Must contain the ADM command type CRCI block instance number specified for
38*0e8011faSEmmanuel Vadot      the NAND controller on the given platform
39*0e8011faSEmmanuel Vadot
40*0e8011faSEmmanuel Vadot  qcom,data-crci:
41*0e8011faSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
42*0e8011faSEmmanuel Vadot    description:
43*0e8011faSEmmanuel Vadot      Must contain the ADM data type CRCI block instance number specified for
44*0e8011faSEmmanuel Vadot      the NAND controller on the given platform
45*0e8011faSEmmanuel Vadot
462eb4d8dcSEmmanuel VadotpatternProperties:
472eb4d8dcSEmmanuel Vadot  "^nand@[a-f0-9]$":
482eb4d8dcSEmmanuel Vadot    type: object
49f126890aSEmmanuel Vadot    $ref: raw-nand-chip.yaml
502eb4d8dcSEmmanuel Vadot    properties:
51f126890aSEmmanuel Vadot
522eb4d8dcSEmmanuel Vadot      nand-bus-width:
532eb4d8dcSEmmanuel Vadot        const: 8
542eb4d8dcSEmmanuel Vadot
552eb4d8dcSEmmanuel Vadot      nand-ecc-strength:
562eb4d8dcSEmmanuel Vadot        enum: [1, 4, 8]
572eb4d8dcSEmmanuel Vadot
582eb4d8dcSEmmanuel Vadot      nand-ecc-step-size:
592eb4d8dcSEmmanuel Vadot        enum:
602eb4d8dcSEmmanuel Vadot          - 512
612eb4d8dcSEmmanuel Vadot
62f126890aSEmmanuel Vadot      qcom,boot-partitions:
63f126890aSEmmanuel Vadot        $ref: /schemas/types.yaml#/definitions/uint32-matrix
64f126890aSEmmanuel Vadot        items:
65f126890aSEmmanuel Vadot          items:
66f126890aSEmmanuel Vadot            - description: offset
67f126890aSEmmanuel Vadot            - description: size
68f126890aSEmmanuel Vadot        description:
69f126890aSEmmanuel Vadot          Boot partition use a different layout where the 4 bytes of spare
70f126890aSEmmanuel Vadot          data are not protected by ECC. Use this to declare these special
71f126890aSEmmanuel Vadot          partitions by defining first the offset and then the size.
72f126890aSEmmanuel Vadot
73f126890aSEmmanuel Vadot          It's in the form of <offset1 size1 offset2 size2 offset3 ...>
74f126890aSEmmanuel Vadot          and should be declared in ascending order.
75f126890aSEmmanuel Vadot
76f126890aSEmmanuel Vadot          Refer to the ipq8064 example on how to use this special binding.
77f126890aSEmmanuel Vadot
78f126890aSEmmanuel Vadot    unevaluatedProperties: false
79f126890aSEmmanuel Vadot
802eb4d8dcSEmmanuel VadotallOf:
81fac71e4eSEmmanuel Vadot  - $ref: nand-controller.yaml#
822eb4d8dcSEmmanuel Vadot
832eb4d8dcSEmmanuel Vadot  - if:
842eb4d8dcSEmmanuel Vadot      properties:
852eb4d8dcSEmmanuel Vadot        compatible:
862eb4d8dcSEmmanuel Vadot          contains:
872eb4d8dcSEmmanuel Vadot            const: qcom,ipq806x-nand
882eb4d8dcSEmmanuel Vadot    then:
892eb4d8dcSEmmanuel Vadot      properties:
902eb4d8dcSEmmanuel Vadot        dmas:
912eb4d8dcSEmmanuel Vadot          items:
922eb4d8dcSEmmanuel Vadot            - description: rxtx DMA channel
932eb4d8dcSEmmanuel Vadot
942eb4d8dcSEmmanuel Vadot        dma-names:
952eb4d8dcSEmmanuel Vadot          items:
962eb4d8dcSEmmanuel Vadot            - const: rxtx
972eb4d8dcSEmmanuel Vadot
982eb4d8dcSEmmanuel Vadot  - if:
992eb4d8dcSEmmanuel Vadot      properties:
1002eb4d8dcSEmmanuel Vadot        compatible:
1012eb4d8dcSEmmanuel Vadot          contains:
1022eb4d8dcSEmmanuel Vadot            enum:
1032eb4d8dcSEmmanuel Vadot              - qcom,ipq4019-nand
1042eb4d8dcSEmmanuel Vadot              - qcom,ipq6018-nand
1052eb4d8dcSEmmanuel Vadot              - qcom,ipq8074-nand
1062eb4d8dcSEmmanuel Vadot              - qcom,sdx55-nand
1072eb4d8dcSEmmanuel Vadot
1082eb4d8dcSEmmanuel Vadot    then:
1092eb4d8dcSEmmanuel Vadot      properties:
1102eb4d8dcSEmmanuel Vadot        dmas:
1112eb4d8dcSEmmanuel Vadot          items:
1122eb4d8dcSEmmanuel Vadot            - description: tx DMA channel
1132eb4d8dcSEmmanuel Vadot            - description: rx DMA channel
1142eb4d8dcSEmmanuel Vadot            - description: cmd DMA channel
1152eb4d8dcSEmmanuel Vadot
1162eb4d8dcSEmmanuel Vadot        dma-names:
1172eb4d8dcSEmmanuel Vadot          items:
1182eb4d8dcSEmmanuel Vadot            - const: tx
1192eb4d8dcSEmmanuel Vadot            - const: rx
1202eb4d8dcSEmmanuel Vadot            - const: cmd
1212eb4d8dcSEmmanuel Vadot
122*0e8011faSEmmanuel Vadot        qcom,cmd-crci: false
123*0e8011faSEmmanuel Vadot        qcom,data-crci: false
124b97ee269SEmmanuel Vadot
125f126890aSEmmanuel Vadot      patternProperties:
126f126890aSEmmanuel Vadot        "^nand@[a-f0-9]$":
127f126890aSEmmanuel Vadot          properties:
128f126890aSEmmanuel Vadot            qcom,boot-partitions: false
129b97ee269SEmmanuel Vadot
1302eb4d8dcSEmmanuel Vadotrequired:
1312eb4d8dcSEmmanuel Vadot  - compatible
1322eb4d8dcSEmmanuel Vadot  - reg
1332eb4d8dcSEmmanuel Vadot  - clocks
1342eb4d8dcSEmmanuel Vadot  - clock-names
1352eb4d8dcSEmmanuel Vadot
1362eb4d8dcSEmmanuel VadotunevaluatedProperties: false
1372eb4d8dcSEmmanuel Vadot
1382eb4d8dcSEmmanuel Vadotexamples:
1392eb4d8dcSEmmanuel Vadot  - |
1402eb4d8dcSEmmanuel Vadot    #include <dt-bindings/clock/qcom,gcc-ipq806x.h>
1412eb4d8dcSEmmanuel Vadot    nand-controller@1ac00000 {
1422eb4d8dcSEmmanuel Vadot        compatible = "qcom,ipq806x-nand";
1432eb4d8dcSEmmanuel Vadot        reg = <0x1ac00000 0x800>;
1442eb4d8dcSEmmanuel Vadot
1452eb4d8dcSEmmanuel Vadot        clocks = <&gcc EBI2_CLK>,
1462eb4d8dcSEmmanuel Vadot                 <&gcc EBI2_AON_CLK>;
1472eb4d8dcSEmmanuel Vadot        clock-names = "core", "aon";
1482eb4d8dcSEmmanuel Vadot
1492eb4d8dcSEmmanuel Vadot        dmas = <&adm_dma 3>;
1502eb4d8dcSEmmanuel Vadot        dma-names = "rxtx";
1512eb4d8dcSEmmanuel Vadot        qcom,cmd-crci = <15>;
1522eb4d8dcSEmmanuel Vadot        qcom,data-crci = <3>;
1532eb4d8dcSEmmanuel Vadot
1542eb4d8dcSEmmanuel Vadot        #address-cells = <1>;
1552eb4d8dcSEmmanuel Vadot        #size-cells = <0>;
1562eb4d8dcSEmmanuel Vadot
1572eb4d8dcSEmmanuel Vadot        nand@0 {
1582eb4d8dcSEmmanuel Vadot            reg = <0>;
1592eb4d8dcSEmmanuel Vadot
1602eb4d8dcSEmmanuel Vadot            nand-ecc-strength = <4>;
1612eb4d8dcSEmmanuel Vadot            nand-bus-width = <8>;
1622eb4d8dcSEmmanuel Vadot
163b97ee269SEmmanuel Vadot            qcom,boot-partitions = <0x0 0x58a0000>;
164b97ee269SEmmanuel Vadot
1652eb4d8dcSEmmanuel Vadot            partitions {
1662eb4d8dcSEmmanuel Vadot                compatible = "fixed-partitions";
1672eb4d8dcSEmmanuel Vadot                #address-cells = <1>;
1682eb4d8dcSEmmanuel Vadot                #size-cells = <1>;
1692eb4d8dcSEmmanuel Vadot
1702eb4d8dcSEmmanuel Vadot                partition@0 {
1712eb4d8dcSEmmanuel Vadot                    label = "boot-nand";
1722eb4d8dcSEmmanuel Vadot                    reg = <0 0x58a0000>;
1732eb4d8dcSEmmanuel Vadot                };
1742eb4d8dcSEmmanuel Vadot
1752eb4d8dcSEmmanuel Vadot                partition@58a0000 {
1762eb4d8dcSEmmanuel Vadot                    label = "fs-nand";
1772eb4d8dcSEmmanuel Vadot                    reg = <0x58a0000 0x4000000>;
1782eb4d8dcSEmmanuel Vadot                };
1792eb4d8dcSEmmanuel Vadot            };
1802eb4d8dcSEmmanuel Vadot        };
1812eb4d8dcSEmmanuel Vadot    };
1822eb4d8dcSEmmanuel Vadot
1832eb4d8dcSEmmanuel Vadot    #include <dt-bindings/clock/qcom,gcc-ipq4019.h>
1842eb4d8dcSEmmanuel Vadot    nand-controller@79b0000 {
1852eb4d8dcSEmmanuel Vadot        compatible = "qcom,ipq4019-nand";
1862eb4d8dcSEmmanuel Vadot        reg = <0x79b0000 0x1000>;
1872eb4d8dcSEmmanuel Vadot
1882eb4d8dcSEmmanuel Vadot        clocks = <&gcc GCC_QPIC_CLK>,
1892eb4d8dcSEmmanuel Vadot                 <&gcc GCC_QPIC_AHB_CLK>;
1902eb4d8dcSEmmanuel Vadot        clock-names = "core", "aon";
1912eb4d8dcSEmmanuel Vadot
1922eb4d8dcSEmmanuel Vadot        dmas = <&qpicbam 0>,
1932eb4d8dcSEmmanuel Vadot               <&qpicbam 1>,
1942eb4d8dcSEmmanuel Vadot               <&qpicbam 2>;
1952eb4d8dcSEmmanuel Vadot        dma-names = "tx", "rx", "cmd";
1962eb4d8dcSEmmanuel Vadot
1972eb4d8dcSEmmanuel Vadot        #address-cells = <1>;
1982eb4d8dcSEmmanuel Vadot        #size-cells = <0>;
1992eb4d8dcSEmmanuel Vadot
2002eb4d8dcSEmmanuel Vadot        nand@0 {
2012eb4d8dcSEmmanuel Vadot            reg = <0>;
2022eb4d8dcSEmmanuel Vadot            nand-ecc-strength = <4>;
2032eb4d8dcSEmmanuel Vadot            nand-bus-width = <8>;
2042eb4d8dcSEmmanuel Vadot
2052eb4d8dcSEmmanuel Vadot            partitions {
2062eb4d8dcSEmmanuel Vadot                compatible = "fixed-partitions";
2072eb4d8dcSEmmanuel Vadot                #address-cells = <1>;
2082eb4d8dcSEmmanuel Vadot                #size-cells = <1>;
2092eb4d8dcSEmmanuel Vadot
2102eb4d8dcSEmmanuel Vadot                partition@0 {
2112eb4d8dcSEmmanuel Vadot                    label = "boot-nand";
2122eb4d8dcSEmmanuel Vadot                    reg = <0 0x58a0000>;
2132eb4d8dcSEmmanuel Vadot                };
2142eb4d8dcSEmmanuel Vadot
2152eb4d8dcSEmmanuel Vadot                partition@58a0000 {
2162eb4d8dcSEmmanuel Vadot                    label = "fs-nand";
2172eb4d8dcSEmmanuel Vadot                    reg = <0x58a0000 0x4000000>;
2182eb4d8dcSEmmanuel Vadot                };
2192eb4d8dcSEmmanuel Vadot            };
2202eb4d8dcSEmmanuel Vadot        };
2212eb4d8dcSEmmanuel Vadot    };
2222eb4d8dcSEmmanuel Vadot
2232eb4d8dcSEmmanuel Vadot...
224