xref: /freebsd/sys/contrib/device-tree/Bindings/mtd/ti,gpmc-nand.yaml (revision fac71e4e09885bb2afa3d984a0c239a52e1a7418)
18cc087a1SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
28cc087a1SEmmanuel Vadot%YAML 1.2
38cc087a1SEmmanuel Vadot---
48cc087a1SEmmanuel Vadot$id: http://devicetree.org/schemas/mtd/ti,gpmc-nand.yaml#
58cc087a1SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
68cc087a1SEmmanuel Vadot
78cc087a1SEmmanuel Vadottitle: Texas Instruments GPMC NAND Flash controller.
88cc087a1SEmmanuel Vadot
98cc087a1SEmmanuel Vadotmaintainers:
108cc087a1SEmmanuel Vadot  - Tony Lindgren <tony@atomide.com>
118cc087a1SEmmanuel Vadot  - Roger Quadros <rogerq@kernel.org>
128cc087a1SEmmanuel Vadot
138cc087a1SEmmanuel Vadotdescription:
148cc087a1SEmmanuel Vadot  GPMC NAND controller/Flash is represented as a child of the
158cc087a1SEmmanuel Vadot  GPMC controller node.
168cc087a1SEmmanuel Vadot
178cc087a1SEmmanuel Vadotproperties:
188cc087a1SEmmanuel Vadot  compatible:
19e67e8565SEmmanuel Vadot    items:
20e67e8565SEmmanuel Vadot      - enum:
21e67e8565SEmmanuel Vadot          - ti,am64-nand
22e67e8565SEmmanuel Vadot          - ti,omap2-nand
238cc087a1SEmmanuel Vadot
248cc087a1SEmmanuel Vadot  reg:
258cc087a1SEmmanuel Vadot    maxItems: 1
268cc087a1SEmmanuel Vadot
278cc087a1SEmmanuel Vadot  interrupts:
288cc087a1SEmmanuel Vadot    items:
298cc087a1SEmmanuel Vadot      - description: Interrupt for fifoevent
308cc087a1SEmmanuel Vadot      - description: Interrupt for termcount
318cc087a1SEmmanuel Vadot
328cc087a1SEmmanuel Vadot  "#address-cells": true
338cc087a1SEmmanuel Vadot
348cc087a1SEmmanuel Vadot  "#size-cells": true
358cc087a1SEmmanuel Vadot
368cc087a1SEmmanuel Vadot  ti,nand-ecc-opt:
378cc087a1SEmmanuel Vadot    description: Desired ECC algorithm
388cc087a1SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/string
398cc087a1SEmmanuel Vadot    enum: [sw, ham1, bch4, bch8, bch16]
408cc087a1SEmmanuel Vadot
418cc087a1SEmmanuel Vadot  ti,nand-xfer-type:
428cc087a1SEmmanuel Vadot    description: Data transfer method between controller and chip.
438cc087a1SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/string
448cc087a1SEmmanuel Vadot    enum: [prefetch-polled, polled, prefetch-dma, prefetch-irq]
458cc087a1SEmmanuel Vadot    default: prefetch-polled
468cc087a1SEmmanuel Vadot
478cc087a1SEmmanuel Vadot  ti,elm-id:
488cc087a1SEmmanuel Vadot    description:
498cc087a1SEmmanuel Vadot      phandle to the ELM (Error Location Module).
508cc087a1SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/phandle
518cc087a1SEmmanuel Vadot
528cc087a1SEmmanuel Vadot  nand-bus-width:
538cc087a1SEmmanuel Vadot    description:
548cc087a1SEmmanuel Vadot      Bus width to the NAND chip
558cc087a1SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
568cc087a1SEmmanuel Vadot    enum: [8, 16]
578cc087a1SEmmanuel Vadot    default: 8
588cc087a1SEmmanuel Vadot
59e67e8565SEmmanuel Vadot  rb-gpios:
60e67e8565SEmmanuel Vadot    description:
61e67e8565SEmmanuel Vadot      GPIO connection to R/B signal from NAND chip
62e67e8565SEmmanuel Vadot    maxItems: 1
63e67e8565SEmmanuel Vadot
648cc087a1SEmmanuel VadotpatternProperties:
658cc087a1SEmmanuel Vadot  "@[0-9a-f]+$":
66*fac71e4eSEmmanuel Vadot    $ref: /schemas/mtd/partitions/partition.yaml
678cc087a1SEmmanuel Vadot
688cc087a1SEmmanuel VadotallOf:
69*fac71e4eSEmmanuel Vadot  - $ref: /schemas/memory-controllers/ti,gpmc-child.yaml
708cc087a1SEmmanuel Vadot
718cc087a1SEmmanuel Vadotrequired:
728cc087a1SEmmanuel Vadot  - compatible
738cc087a1SEmmanuel Vadot  - reg
748cc087a1SEmmanuel Vadot  - ti,nand-ecc-opt
758cc087a1SEmmanuel Vadot
768cc087a1SEmmanuel VadotunevaluatedProperties: false
778cc087a1SEmmanuel Vadot
788cc087a1SEmmanuel Vadotexamples:
798cc087a1SEmmanuel Vadot  - |
808cc087a1SEmmanuel Vadot    #include <dt-bindings/interrupt-controller/arm-gic.h>
818cc087a1SEmmanuel Vadot    #include <dt-bindings/gpio/gpio.h>
828cc087a1SEmmanuel Vadot
838cc087a1SEmmanuel Vadot    gpmc: memory-controller@50000000 {
848cc087a1SEmmanuel Vadot      compatible = "ti,am3352-gpmc";
858cc087a1SEmmanuel Vadot      dmas = <&edma 52 0>;
868cc087a1SEmmanuel Vadot      dma-names = "rxtx";
878cc087a1SEmmanuel Vadot      clocks = <&l3s_gclk>;
888cc087a1SEmmanuel Vadot      clock-names = "fck";
898cc087a1SEmmanuel Vadot      reg = <0x50000000 0x2000>;
908cc087a1SEmmanuel Vadot      interrupts = <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>;
918cc087a1SEmmanuel Vadot      gpmc,num-cs = <7>;
928cc087a1SEmmanuel Vadot      gpmc,num-waitpins = <2>;
938cc087a1SEmmanuel Vadot      #address-cells = <2>;
948cc087a1SEmmanuel Vadot      #size-cells = <1>;
958cc087a1SEmmanuel Vadot      interrupt-controller;
968cc087a1SEmmanuel Vadot      #interrupt-cells = <2>;
978cc087a1SEmmanuel Vadot      gpio-controller;
988cc087a1SEmmanuel Vadot      #gpio-cells = <2>;
998cc087a1SEmmanuel Vadot
1008cc087a1SEmmanuel Vadot      ranges = <0 0 0x08000000 0x01000000>;   /* CS0 space. Min partition = 16MB */
1018cc087a1SEmmanuel Vadot      nand@0,0 {
1028cc087a1SEmmanuel Vadot        compatible = "ti,omap2-nand";
1038cc087a1SEmmanuel Vadot        reg = <0 0 4>;          /* device IO registers */
1048cc087a1SEmmanuel Vadot        interrupt-parent = <&gpmc>;
1058cc087a1SEmmanuel Vadot        interrupts = <0 IRQ_TYPE_NONE>, /* fifoevent */
1068cc087a1SEmmanuel Vadot                     <1 IRQ_TYPE_NONE>; /* termcount */
1078cc087a1SEmmanuel Vadot        ti,nand-xfer-type = "prefetch-dma";
1088cc087a1SEmmanuel Vadot        ti,nand-ecc-opt = "bch16";
1098cc087a1SEmmanuel Vadot        ti,elm-id = <&elm>;
1108cc087a1SEmmanuel Vadot        #address-cells = <1>;
1118cc087a1SEmmanuel Vadot        #size-cells = <1>;
1128cc087a1SEmmanuel Vadot
1138cc087a1SEmmanuel Vadot        /* NAND generic properties */
1148cc087a1SEmmanuel Vadot        nand-bus-width = <8>;
1158cc087a1SEmmanuel Vadot        rb-gpios = <&gpmc 0 GPIO_ACTIVE_HIGH>;  /* gpmc_wait0 */
1168cc087a1SEmmanuel Vadot
1178cc087a1SEmmanuel Vadot        /* GPMC properties*/
1188cc087a1SEmmanuel Vadot        gpmc,device-width = <1>;
1198cc087a1SEmmanuel Vadot
1208cc087a1SEmmanuel Vadot        partition@0 {
1218cc087a1SEmmanuel Vadot          label = "NAND.SPL";
1228cc087a1SEmmanuel Vadot          reg = <0x00000000 0x00040000>;
1238cc087a1SEmmanuel Vadot        };
1248cc087a1SEmmanuel Vadot        partition@1 {
1258cc087a1SEmmanuel Vadot          label = "NAND.SPL.backup1";
1268cc087a1SEmmanuel Vadot          reg = <0x00040000 0x00040000>;
1278cc087a1SEmmanuel Vadot        };
1288cc087a1SEmmanuel Vadot      };
1298cc087a1SEmmanuel Vadot    };
130