1c66ec88fSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2c66ec88fSEmmanuel Vadot%YAML 1.2
3c66ec88fSEmmanuel Vadot---
4c66ec88fSEmmanuel Vadot$id: http://devicetree.org/schemas/mtd/gpmi-nand.yaml#
5c66ec88fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6c66ec88fSEmmanuel Vadot
78bab661aSEmmanuel Vadottitle: Freescale General-Purpose Media Interface (GPMI)
8c66ec88fSEmmanuel Vadot
9c66ec88fSEmmanuel Vadotmaintainers:
10c66ec88fSEmmanuel Vadot  - Han Xu <han.xu@nxp.com>
11c66ec88fSEmmanuel Vadot
12c66ec88fSEmmanuel Vadotdescription: |
13c66ec88fSEmmanuel Vadot  The GPMI nand controller provides an interface to control the NAND
14c66ec88fSEmmanuel Vadot  flash chips. The device tree may optionally contain sub-nodes
15c66ec88fSEmmanuel Vadot  describing partitions of the address space. See partition.txt for
16c66ec88fSEmmanuel Vadot  more detail.
17c66ec88fSEmmanuel Vadot
18c66ec88fSEmmanuel Vadotproperties:
19c66ec88fSEmmanuel Vadot  compatible:
206be33864SEmmanuel Vadot    oneOf:
216be33864SEmmanuel Vadot      - enum:
22c66ec88fSEmmanuel Vadot          - fsl,imx23-gpmi-nand
23c66ec88fSEmmanuel Vadot          - fsl,imx28-gpmi-nand
24c66ec88fSEmmanuel Vadot          - fsl,imx6q-gpmi-nand
25c66ec88fSEmmanuel Vadot          - fsl,imx6sx-gpmi-nand
26c66ec88fSEmmanuel Vadot          - fsl,imx7d-gpmi-nand
276be33864SEmmanuel Vadot      - items:
286be33864SEmmanuel Vadot          - enum:
296be33864SEmmanuel Vadot              - fsl,imx8mm-gpmi-nand
306be33864SEmmanuel Vadot              - fsl,imx8mn-gpmi-nand
316be33864SEmmanuel Vadot          - const: fsl,imx7d-gpmi-nand
32c66ec88fSEmmanuel Vadot
33c66ec88fSEmmanuel Vadot  reg:
34c66ec88fSEmmanuel Vadot    items:
35c66ec88fSEmmanuel Vadot      - description: Address and length of gpmi block.
36c66ec88fSEmmanuel Vadot      - description: Address and length of bch block.
37c66ec88fSEmmanuel Vadot
38c66ec88fSEmmanuel Vadot  reg-names:
39c66ec88fSEmmanuel Vadot    items:
40c66ec88fSEmmanuel Vadot      - const: gpmi-nand
41c66ec88fSEmmanuel Vadot      - const: bch
42c66ec88fSEmmanuel Vadot
43c66ec88fSEmmanuel Vadot  interrupts:
44c66ec88fSEmmanuel Vadot    maxItems: 1
45c66ec88fSEmmanuel Vadot
46c66ec88fSEmmanuel Vadot  interrupt-names:
47c66ec88fSEmmanuel Vadot    const: bch
48c66ec88fSEmmanuel Vadot
49c66ec88fSEmmanuel Vadot  dmas:
50c66ec88fSEmmanuel Vadot    maxItems: 1
51c66ec88fSEmmanuel Vadot
52c66ec88fSEmmanuel Vadot  dma-names:
53c66ec88fSEmmanuel Vadot    const: rx-tx
54c66ec88fSEmmanuel Vadot
55c66ec88fSEmmanuel Vadot  clocks:
56c66ec88fSEmmanuel Vadot    minItems: 1
57c66ec88fSEmmanuel Vadot    maxItems: 5
58c66ec88fSEmmanuel Vadot
59c66ec88fSEmmanuel Vadot  clock-names:
60c66ec88fSEmmanuel Vadot    minItems: 1
61c66ec88fSEmmanuel Vadot    maxItems: 5
62c66ec88fSEmmanuel Vadot
63c66ec88fSEmmanuel Vadot  fsl,use-minimum-ecc:
64c66ec88fSEmmanuel Vadot    type: boolean
65c66ec88fSEmmanuel Vadot    description: |
66c66ec88fSEmmanuel Vadot      Protect this NAND flash with the minimum ECC strength required.
67c66ec88fSEmmanuel Vadot      The required ECC strength is automatically discoverable for some
68c66ec88fSEmmanuel Vadot      flash (e.g., according to the ONFI standard). However, note that
69c66ec88fSEmmanuel Vadot      if this strength is not discoverable or this property is not enabled,
70c66ec88fSEmmanuel Vadot      the software may chooses an implementation-defined ECC scheme.
71c66ec88fSEmmanuel Vadot
72c66ec88fSEmmanuel Vadot  fsl,no-blockmark-swap:
73c66ec88fSEmmanuel Vadot    type: boolean
74c66ec88fSEmmanuel Vadot    description: |
75c66ec88fSEmmanuel Vadot      Don't swap the bad block marker from the OOB area with the byte in
76c66ec88fSEmmanuel Vadot      the data area but rely on the flash based BBT for identifying bad blocks.
77c66ec88fSEmmanuel Vadot      NOTE: this is only valid in conjunction with 'nand-on-flash-bbt'.
78c66ec88fSEmmanuel Vadot      WARNING: on i.MX28 blockmark swapping cannot be disabled for the BootROM
79c66ec88fSEmmanuel Vadot      in the FCB. Thus, partitions written from Linux with this feature turned
80c66ec88fSEmmanuel Vadot      on may not be accessible by the BootROM code.
81c66ec88fSEmmanuel Vadot
82c66ec88fSEmmanuel Vadotrequired:
83c66ec88fSEmmanuel Vadot  - compatible
84c66ec88fSEmmanuel Vadot  - reg
85c66ec88fSEmmanuel Vadot  - reg-names
86c66ec88fSEmmanuel Vadot  - interrupts
87c66ec88fSEmmanuel Vadot  - interrupt-names
88c66ec88fSEmmanuel Vadot  - clocks
89c66ec88fSEmmanuel Vadot  - clock-names
90c66ec88fSEmmanuel Vadot  - dmas
91c66ec88fSEmmanuel Vadot  - dma-names
92c66ec88fSEmmanuel Vadot
93c66ec88fSEmmanuel VadotunevaluatedProperties: false
94c66ec88fSEmmanuel Vadot
955def4c47SEmmanuel VadotallOf:
96*fac71e4eSEmmanuel Vadot  - $ref: nand-controller.yaml
975def4c47SEmmanuel Vadot
985def4c47SEmmanuel Vadot  - if:
995def4c47SEmmanuel Vadot      properties:
1005def4c47SEmmanuel Vadot        compatible:
1015def4c47SEmmanuel Vadot          contains:
1025def4c47SEmmanuel Vadot            enum:
1035def4c47SEmmanuel Vadot              - fsl,imx23-gpmi-nand
1045def4c47SEmmanuel Vadot              - fsl,imx28-gpmi-nand
1055def4c47SEmmanuel Vadot    then:
1065def4c47SEmmanuel Vadot      properties:
1075def4c47SEmmanuel Vadot        clocks:
1085def4c47SEmmanuel Vadot          items:
1095def4c47SEmmanuel Vadot            - description: SoC gpmi io clock
1105def4c47SEmmanuel Vadot        clock-names:
1115def4c47SEmmanuel Vadot          items:
1125def4c47SEmmanuel Vadot            - const: gpmi_io
1135def4c47SEmmanuel Vadot
1145def4c47SEmmanuel Vadot  - if:
1155def4c47SEmmanuel Vadot      properties:
1165def4c47SEmmanuel Vadot        compatible:
1175def4c47SEmmanuel Vadot          contains:
1185def4c47SEmmanuel Vadot            enum:
1195def4c47SEmmanuel Vadot              - fsl,imx6q-gpmi-nand
1205def4c47SEmmanuel Vadot              - fsl,imx6sx-gpmi-nand
1215def4c47SEmmanuel Vadot    then:
1225def4c47SEmmanuel Vadot      properties:
1235def4c47SEmmanuel Vadot        clocks:
1245def4c47SEmmanuel Vadot          items:
1255def4c47SEmmanuel Vadot            - description: SoC gpmi io clock
1265def4c47SEmmanuel Vadot            - description: SoC gpmi apb clock
1275def4c47SEmmanuel Vadot            - description: SoC gpmi bch clock
1285def4c47SEmmanuel Vadot            - description: SoC gpmi bch apb clock
1295def4c47SEmmanuel Vadot            - description: SoC per1 bch clock
1305def4c47SEmmanuel Vadot        clock-names:
1315def4c47SEmmanuel Vadot          items:
1325def4c47SEmmanuel Vadot            - const: gpmi_io
1335def4c47SEmmanuel Vadot            - const: gpmi_apb
1345def4c47SEmmanuel Vadot            - const: gpmi_bch
1355def4c47SEmmanuel Vadot            - const: gpmi_bch_apb
1365def4c47SEmmanuel Vadot            - const: per1_bch
1375def4c47SEmmanuel Vadot
1385def4c47SEmmanuel Vadot  - if:
1395def4c47SEmmanuel Vadot      properties:
1405def4c47SEmmanuel Vadot        compatible:
1415def4c47SEmmanuel Vadot          contains:
1425def4c47SEmmanuel Vadot            const: fsl,imx7d-gpmi-nand
1435def4c47SEmmanuel Vadot    then:
1445def4c47SEmmanuel Vadot      properties:
1455def4c47SEmmanuel Vadot        clocks:
1465def4c47SEmmanuel Vadot          items:
1475def4c47SEmmanuel Vadot            - description: SoC gpmi io clock
1485def4c47SEmmanuel Vadot            - description: SoC gpmi bch apb clock
1495def4c47SEmmanuel Vadot        clock-names:
1505def4c47SEmmanuel Vadot          items:
1515def4c47SEmmanuel Vadot            - const: gpmi_io
1525def4c47SEmmanuel Vadot            - const: gpmi_bch_apb
1535def4c47SEmmanuel Vadot
154c66ec88fSEmmanuel Vadotexamples:
155c66ec88fSEmmanuel Vadot  - |
156c66ec88fSEmmanuel Vadot    nand-controller@8000c000 {
157c66ec88fSEmmanuel Vadot        #address-cells = <1>;
158c66ec88fSEmmanuel Vadot        #size-cells = <0>;
159c66ec88fSEmmanuel Vadot        compatible = "fsl,imx28-gpmi-nand";
160c66ec88fSEmmanuel Vadot        reg = <0x8000c000 0x2000>, <0x8000a000 0x2000>;
161c66ec88fSEmmanuel Vadot        reg-names = "gpmi-nand", "bch";
162c66ec88fSEmmanuel Vadot        interrupts = <41>;
163c66ec88fSEmmanuel Vadot        interrupt-names = "bch";
164c66ec88fSEmmanuel Vadot        clocks = <&clks 50>;
165c66ec88fSEmmanuel Vadot        clock-names = "gpmi_io";
166c66ec88fSEmmanuel Vadot        dmas = <&dma_apbh 4>;
167c66ec88fSEmmanuel Vadot        dma-names = "rx-tx";
168c66ec88fSEmmanuel Vadot    };
169