xref: /linux/Documentation/devicetree/bindings/memory-controllers/ti,gpmc.yaml (revision 0ea5c948cb64bab5bc7a5516774eb8536f05aa0d)
1c346eb1cSRoger Quadros# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2c346eb1cSRoger Quadros%YAML 1.2
3c346eb1cSRoger Quadros---
4c346eb1cSRoger Quadros$id: http://devicetree.org/schemas/memory-controllers/ti,gpmc.yaml#
5c346eb1cSRoger Quadros$schema: http://devicetree.org/meta-schemas/core.yaml#
6c346eb1cSRoger Quadros
7a612130cSKrzysztof Kozlowskititle: Texas Instruments GPMC Memory Controller
8c346eb1cSRoger Quadros
9c346eb1cSRoger Quadrosmaintainers:
10c346eb1cSRoger Quadros  - Tony Lindgren <tony@atomide.com>
11c346eb1cSRoger Quadros  - Roger Quadros <rogerq@kernel.org>
12c346eb1cSRoger Quadros
13c346eb1cSRoger Quadrosdescription:
14c346eb1cSRoger Quadros  The GPMC is a unified memory controller dedicated for interfacing
15c346eb1cSRoger Quadros  with external memory devices like
16c346eb1cSRoger Quadros  - Asynchronous SRAM-like memories and ASICs
17c346eb1cSRoger Quadros  - Asynchronous, synchronous, and page mode burst NOR flash
18c346eb1cSRoger Quadros  - NAND flash
19c346eb1cSRoger Quadros  - Pseudo-SRAM devices
20c346eb1cSRoger Quadros
21c346eb1cSRoger Quadrosproperties:
22c346eb1cSRoger Quadros  compatible:
23c346eb1cSRoger Quadros    items:
24c346eb1cSRoger Quadros      - enum:
25c346eb1cSRoger Quadros          - ti,am3352-gpmc
2648922427SRoger Quadros          - ti,am64-gpmc
27c346eb1cSRoger Quadros          - ti,omap2420-gpmc
28c346eb1cSRoger Quadros          - ti,omap2430-gpmc
29c346eb1cSRoger Quadros          - ti,omap3430-gpmc
30c346eb1cSRoger Quadros          - ti,omap4430-gpmc
31c346eb1cSRoger Quadros
32c346eb1cSRoger Quadros  reg:
3348922427SRoger Quadros    minItems: 1
3448922427SRoger Quadros    maxItems: 2
3548922427SRoger Quadros
3648922427SRoger Quadros  reg-names:
3748922427SRoger Quadros    items:
3848922427SRoger Quadros      - const: cfg
3948922427SRoger Quadros      - const: data
40c346eb1cSRoger Quadros
41c346eb1cSRoger Quadros  interrupts:
42c346eb1cSRoger Quadros    maxItems: 1
43c346eb1cSRoger Quadros
44c346eb1cSRoger Quadros  clocks:
45c346eb1cSRoger Quadros    maxItems: 1
46c346eb1cSRoger Quadros    description: |
47c346eb1cSRoger Quadros      Functional clock. Used for bus timing calculations and
48c346eb1cSRoger Quadros      GPMC configuration.
49c346eb1cSRoger Quadros
50c346eb1cSRoger Quadros  clock-names:
51c346eb1cSRoger Quadros    items:
52c346eb1cSRoger Quadros      - const: fck
53c346eb1cSRoger Quadros
5448922427SRoger Quadros  power-domains:
5548922427SRoger Quadros    maxItems: 1
5648922427SRoger Quadros
57c346eb1cSRoger Quadros  dmas:
58c346eb1cSRoger Quadros    items:
59c346eb1cSRoger Quadros      - description: DMA channel for GPMC NAND prefetch
60c346eb1cSRoger Quadros
61c346eb1cSRoger Quadros  dma-names:
62c346eb1cSRoger Quadros    items:
63c346eb1cSRoger Quadros      - const: rxtx
64c346eb1cSRoger Quadros
65c346eb1cSRoger Quadros  "#address-cells": true
66c346eb1cSRoger Quadros
67c346eb1cSRoger Quadros  "#size-cells": true
68c346eb1cSRoger Quadros
69c346eb1cSRoger Quadros  gpmc,num-cs:
70c346eb1cSRoger Quadros    description: maximum number of supported chip-select lines.
71c346eb1cSRoger Quadros    $ref: /schemas/types.yaml#/definitions/uint32
72c346eb1cSRoger Quadros
73c346eb1cSRoger Quadros  gpmc,num-waitpins:
74c346eb1cSRoger Quadros    description: maximum number of supported wait pins.
75c346eb1cSRoger Quadros    $ref: /schemas/types.yaml#/definitions/uint32
76c346eb1cSRoger Quadros
77c346eb1cSRoger Quadros  ranges:
78c346eb1cSRoger Quadros    minItems: 1
79c346eb1cSRoger Quadros    description: |
80c346eb1cSRoger Quadros      Must be set up to reflect the memory layout with four
81c346eb1cSRoger Quadros      integer values for each chip-select line in use,
82c346eb1cSRoger Quadros      <cs-number> 0 <physical address of mapping> <size>
83c346eb1cSRoger Quadros    items:
84c346eb1cSRoger Quadros      - description: NAND bank 0
85c346eb1cSRoger Quadros      - description: NOR/SRAM bank 0
86c346eb1cSRoger Quadros      - description: NOR/SRAM bank 1
87c346eb1cSRoger Quadros
88c346eb1cSRoger Quadros  '#interrupt-cells':
89c346eb1cSRoger Quadros    const: 2
90c346eb1cSRoger Quadros
91c346eb1cSRoger Quadros  interrupt-controller:
92c346eb1cSRoger Quadros    description: |
9300f2a08cSColin Foster      The GPMC driver implements an interrupt controller for
94c346eb1cSRoger Quadros      the NAND events "fifoevent" and "termcount" plus the
95c346eb1cSRoger Quadros      rising/falling edges on the GPMC_WAIT pins.
96c346eb1cSRoger Quadros      The interrupt number mapping is as follows
97c346eb1cSRoger Quadros      0 - NAND_fifoevent
98c346eb1cSRoger Quadros      1 - NAND_termcount
99c346eb1cSRoger Quadros      2 - GPMC_WAIT0 pin edge
100c346eb1cSRoger Quadros      3 - GPMC_WAIT1 pin edge, and so on.
101c346eb1cSRoger Quadros
102c346eb1cSRoger Quadros  '#gpio-cells':
103c346eb1cSRoger Quadros    const: 2
104c346eb1cSRoger Quadros
105c346eb1cSRoger Quadros  gpio-controller:
106c346eb1cSRoger Quadros    description: |
107c346eb1cSRoger Quadros      The GPMC driver implements a GPIO controller for the
108c346eb1cSRoger Quadros      GPMC WAIT pins that can be used as general purpose inputs.
109c346eb1cSRoger Quadros      0 maps to GPMC_WAIT0 pin.
110c346eb1cSRoger Quadros
111c346eb1cSRoger Quadros  ti,hwmods:
112c346eb1cSRoger Quadros    description:
113c346eb1cSRoger Quadros      Name of the HWMOD associated with GPMC. This is for legacy
114c346eb1cSRoger Quadros      omap2/3 platforms only.
115c346eb1cSRoger Quadros    $ref: /schemas/types.yaml#/definitions/string
116c346eb1cSRoger Quadros    deprecated: true
117c346eb1cSRoger Quadros
118c346eb1cSRoger Quadros  ti,no-idle-on-init:
119c346eb1cSRoger Quadros    description:
120c346eb1cSRoger Quadros      Prevent idling the module at init. This is for legacy omap2/3
121c346eb1cSRoger Quadros      platforms only.
122c346eb1cSRoger Quadros    type: boolean
123c346eb1cSRoger Quadros    deprecated: true
124c346eb1cSRoger Quadros
125c346eb1cSRoger QuadrospatternProperties:
126c346eb1cSRoger Quadros  "@[0-7],[a-f0-9]+$":
127c346eb1cSRoger Quadros    type: object
128c346eb1cSRoger Quadros    description: |
129c346eb1cSRoger Quadros      The child device node represents the device connected to the GPMC
130c346eb1cSRoger Quadros      bus. The device can be a NAND chip, SRAM device, NOR device
131c346eb1cSRoger Quadros      or an ASIC.
1326a66fb9fSKrzysztof Kozlowski    $ref: ti,gpmc-child.yaml
133*387bb6fdSRob Herring    additionalProperties: true
134c346eb1cSRoger Quadros
135c346eb1cSRoger Quadrosrequired:
136c346eb1cSRoger Quadros  - compatible
137c346eb1cSRoger Quadros  - reg
138c346eb1cSRoger Quadros  - gpmc,num-cs
139c346eb1cSRoger Quadros  - gpmc,num-waitpins
140c346eb1cSRoger Quadros  - "#address-cells"
141c346eb1cSRoger Quadros  - "#size-cells"
142c346eb1cSRoger Quadros
14348922427SRoger QuadrosallOf:
14448922427SRoger Quadros  - if:
14548922427SRoger Quadros      properties:
14648922427SRoger Quadros        compatible:
14748922427SRoger Quadros          contains:
14848922427SRoger Quadros            const: ti,am64-gpmc
14948922427SRoger Quadros    then:
15048922427SRoger Quadros      required:
15148922427SRoger Quadros        - reg-names
15248922427SRoger Quadros        - power-domains
15348922427SRoger Quadros
154c346eb1cSRoger QuadrosadditionalProperties: false
155c346eb1cSRoger Quadros
156c346eb1cSRoger Quadrosexamples:
157c346eb1cSRoger Quadros  - |
158c346eb1cSRoger Quadros    #include <dt-bindings/interrupt-controller/arm-gic.h>
159c346eb1cSRoger Quadros    #include <dt-bindings/gpio/gpio.h>
160c346eb1cSRoger Quadros
161c346eb1cSRoger Quadros    gpmc: memory-controller@50000000 {
162c346eb1cSRoger Quadros      compatible = "ti,am3352-gpmc";
163c346eb1cSRoger Quadros      reg = <0x50000000 0x2000>;
164c346eb1cSRoger Quadros      interrupts = <100>;
165c346eb1cSRoger Quadros      clocks = <&l3s_clkctrl>;
166c346eb1cSRoger Quadros      clock-names = "fck";
167c346eb1cSRoger Quadros      dmas = <&edma 52 0>;
168c346eb1cSRoger Quadros      dma-names = "rxtx";
169c346eb1cSRoger Quadros      gpmc,num-cs = <8>;
170c346eb1cSRoger Quadros      gpmc,num-waitpins = <2>;
171c346eb1cSRoger Quadros      #address-cells = <2>;
172c346eb1cSRoger Quadros      #size-cells = <1>;
173c346eb1cSRoger Quadros      ranges = <0 0 0x08000000 0x10000000>; /* CS0 @addr 0x8000000, size 0x10000000 */
174c346eb1cSRoger Quadros      interrupt-controller;
175c346eb1cSRoger Quadros      #interrupt-cells = <2>;
176c346eb1cSRoger Quadros      gpio-controller;
177c346eb1cSRoger Quadros      #gpio-cells = <2>;
178c346eb1cSRoger Quadros
179c346eb1cSRoger Quadros      nand@0,0 {
180c346eb1cSRoger Quadros        compatible = "ti,omap2-nand";
181c346eb1cSRoger Quadros        reg = <0 0 4>;
182c346eb1cSRoger Quadros        interrupt-parent = <&gpmc>;
183c346eb1cSRoger Quadros        interrupts = <0 IRQ_TYPE_NONE>, /* fifoevent */
184c346eb1cSRoger Quadros                     <1 IRQ_TYPE_NONE>; /* termcount */
185c346eb1cSRoger Quadros        ti,nand-xfer-type = "prefetch-dma";
186c346eb1cSRoger Quadros        ti,nand-ecc-opt = "bch16";
187c346eb1cSRoger Quadros        ti,elm-id = <&elm>;
188c346eb1cSRoger Quadros        rb-gpios = <&gpmc 0 GPIO_ACTIVE_HIGH>; /* gpmc_wait0 pin */
189c346eb1cSRoger Quadros      };
190c346eb1cSRoger Quadros    };
191