xref: /linux/Documentation/devicetree/bindings/mtd/ti,gpmc-nand.yaml (revision 14a3ca56c09d6b5ffb5f3f0eb83decca9b68d7fa)
102e107e8SRoger Quadros# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
202e107e8SRoger Quadros%YAML 1.2
302e107e8SRoger Quadros---
402e107e8SRoger Quadros$id: http://devicetree.org/schemas/mtd/ti,gpmc-nand.yaml#
502e107e8SRoger Quadros$schema: http://devicetree.org/meta-schemas/core.yaml#
602e107e8SRoger Quadros
702e107e8SRoger Quadrostitle: Texas Instruments GPMC NAND Flash controller.
802e107e8SRoger Quadros
902e107e8SRoger Quadrosmaintainers:
1002e107e8SRoger Quadros  - Tony Lindgren <tony@atomide.com>
1102e107e8SRoger Quadros  - Roger Quadros <rogerq@kernel.org>
1202e107e8SRoger Quadros
1302e107e8SRoger Quadrosdescription:
1402e107e8SRoger Quadros  GPMC NAND controller/Flash is represented as a child of the
1502e107e8SRoger Quadros  GPMC controller node.
1602e107e8SRoger Quadros
1702e107e8SRoger Quadrosproperties:
1802e107e8SRoger Quadros  compatible:
19*14a3ca56SRoger Quadros    items:
20*14a3ca56SRoger Quadros      - enum:
21*14a3ca56SRoger Quadros          - ti,am64-nand
22*14a3ca56SRoger Quadros          - ti,omap2-nand
2302e107e8SRoger Quadros
2402e107e8SRoger Quadros  reg:
2502e107e8SRoger Quadros    maxItems: 1
2602e107e8SRoger Quadros
2702e107e8SRoger Quadros  interrupts:
2802e107e8SRoger Quadros    items:
2902e107e8SRoger Quadros      - description: Interrupt for fifoevent
3002e107e8SRoger Quadros      - description: Interrupt for termcount
3102e107e8SRoger Quadros
3202e107e8SRoger Quadros  "#address-cells": true
3302e107e8SRoger Quadros
3402e107e8SRoger Quadros  "#size-cells": true
3502e107e8SRoger Quadros
3602e107e8SRoger Quadros  ti,nand-ecc-opt:
3702e107e8SRoger Quadros    description: Desired ECC algorithm
3802e107e8SRoger Quadros    $ref: /schemas/types.yaml#/definitions/string
3902e107e8SRoger Quadros    enum: [sw, ham1, bch4, bch8, bch16]
4002e107e8SRoger Quadros
4102e107e8SRoger Quadros  ti,nand-xfer-type:
4202e107e8SRoger Quadros    description: Data transfer method between controller and chip.
4302e107e8SRoger Quadros    $ref: /schemas/types.yaml#/definitions/string
4402e107e8SRoger Quadros    enum: [prefetch-polled, polled, prefetch-dma, prefetch-irq]
4502e107e8SRoger Quadros    default: prefetch-polled
4602e107e8SRoger Quadros
4702e107e8SRoger Quadros  ti,elm-id:
4802e107e8SRoger Quadros    description:
4902e107e8SRoger Quadros      phandle to the ELM (Error Location Module).
5002e107e8SRoger Quadros    $ref: /schemas/types.yaml#/definitions/phandle
5102e107e8SRoger Quadros
5202e107e8SRoger Quadros  nand-bus-width:
5302e107e8SRoger Quadros    description:
5402e107e8SRoger Quadros      Bus width to the NAND chip
5502e107e8SRoger Quadros    $ref: /schemas/types.yaml#/definitions/uint32
5602e107e8SRoger Quadros    enum: [8, 16]
5702e107e8SRoger Quadros    default: 8
5802e107e8SRoger Quadros
59c14e281aSRob Herring  rb-gpios:
60c14e281aSRob Herring    description:
61c14e281aSRob Herring      GPIO connection to R/B signal from NAND chip
62c14e281aSRob Herring    maxItems: 1
63c14e281aSRob Herring
6402e107e8SRoger QuadrospatternProperties:
6502e107e8SRoger Quadros  "@[0-9a-f]+$":
6602e107e8SRoger Quadros    $ref: "/schemas/mtd/partitions/partition.yaml"
6702e107e8SRoger Quadros
6802e107e8SRoger QuadrosallOf:
6902e107e8SRoger Quadros  - $ref: "/schemas/memory-controllers/ti,gpmc-child.yaml"
7002e107e8SRoger Quadros
7102e107e8SRoger Quadrosrequired:
7202e107e8SRoger Quadros  - compatible
7302e107e8SRoger Quadros  - reg
7402e107e8SRoger Quadros  - ti,nand-ecc-opt
7502e107e8SRoger Quadros
7602e107e8SRoger QuadrosunevaluatedProperties: false
7702e107e8SRoger Quadros
7802e107e8SRoger Quadrosexamples:
7902e107e8SRoger Quadros  - |
8002e107e8SRoger Quadros    #include <dt-bindings/interrupt-controller/arm-gic.h>
8102e107e8SRoger Quadros    #include <dt-bindings/gpio/gpio.h>
8202e107e8SRoger Quadros
8302e107e8SRoger Quadros    gpmc: memory-controller@50000000 {
8402e107e8SRoger Quadros      compatible = "ti,am3352-gpmc";
8502e107e8SRoger Quadros      dmas = <&edma 52 0>;
8602e107e8SRoger Quadros      dma-names = "rxtx";
8702e107e8SRoger Quadros      clocks = <&l3s_gclk>;
8802e107e8SRoger Quadros      clock-names = "fck";
8902e107e8SRoger Quadros      reg = <0x50000000 0x2000>;
9002e107e8SRoger Quadros      interrupts = <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>;
9102e107e8SRoger Quadros      gpmc,num-cs = <7>;
9202e107e8SRoger Quadros      gpmc,num-waitpins = <2>;
9302e107e8SRoger Quadros      #address-cells = <2>;
9402e107e8SRoger Quadros      #size-cells = <1>;
9502e107e8SRoger Quadros      interrupt-controller;
9602e107e8SRoger Quadros      #interrupt-cells = <2>;
9702e107e8SRoger Quadros      gpio-controller;
9802e107e8SRoger Quadros      #gpio-cells = <2>;
9902e107e8SRoger Quadros
10002e107e8SRoger Quadros      ranges = <0 0 0x08000000 0x01000000>;   /* CS0 space. Min partition = 16MB */
10102e107e8SRoger Quadros      nand@0,0 {
10202e107e8SRoger Quadros        compatible = "ti,omap2-nand";
10302e107e8SRoger Quadros        reg = <0 0 4>;          /* device IO registers */
10402e107e8SRoger Quadros        interrupt-parent = <&gpmc>;
10502e107e8SRoger Quadros        interrupts = <0 IRQ_TYPE_NONE>, /* fifoevent */
10602e107e8SRoger Quadros                     <1 IRQ_TYPE_NONE>; /* termcount */
10702e107e8SRoger Quadros        ti,nand-xfer-type = "prefetch-dma";
10802e107e8SRoger Quadros        ti,nand-ecc-opt = "bch16";
10902e107e8SRoger Quadros        ti,elm-id = <&elm>;
11002e107e8SRoger Quadros        #address-cells = <1>;
11102e107e8SRoger Quadros        #size-cells = <1>;
11202e107e8SRoger Quadros
11302e107e8SRoger Quadros        /* NAND generic properties */
11402e107e8SRoger Quadros        nand-bus-width = <8>;
11502e107e8SRoger Quadros        rb-gpios = <&gpmc 0 GPIO_ACTIVE_HIGH>;  /* gpmc_wait0 */
11602e107e8SRoger Quadros
11702e107e8SRoger Quadros        /* GPMC properties*/
11802e107e8SRoger Quadros        gpmc,device-width = <1>;
11902e107e8SRoger Quadros
12002e107e8SRoger Quadros        partition@0 {
12102e107e8SRoger Quadros          label = "NAND.SPL";
12202e107e8SRoger Quadros          reg = <0x00000000 0x00040000>;
12302e107e8SRoger Quadros        };
12402e107e8SRoger Quadros        partition@1 {
12502e107e8SRoger Quadros          label = "NAND.SPL.backup1";
12602e107e8SRoger Quadros          reg = <0x00040000 0x00040000>;
12702e107e8SRoger Quadros        };
12802e107e8SRoger Quadros      };
12902e107e8SRoger Quadros    };
130