1*4882a593Smuzhiyun# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2*4882a593Smuzhiyun%YAML 1.2
3*4882a593Smuzhiyun---
4*4882a593Smuzhiyun$id: http://devicetree.org/schemas/memory-controllers/st,stm32-fmc2-ebi.yaml#
5*4882a593Smuzhiyun$schema: http://devicetree.org/meta-schemas/core.yaml#
6*4882a593Smuzhiyun
7*4882a593Smuzhiyuntitle: STMicroelectronics Flexible Memory Controller 2 (FMC2) Bindings
8*4882a593Smuzhiyun
9*4882a593Smuzhiyundescription: |
10*4882a593Smuzhiyun  The FMC2 functional block makes the interface with: synchronous and
11*4882a593Smuzhiyun  asynchronous static devices (such as PSNOR, PSRAM or other memory-mapped
12*4882a593Smuzhiyun  peripherals) and NAND flash memories.
13*4882a593Smuzhiyun  Its main purposes are:
14*4882a593Smuzhiyun    - to translate AXI transactions into the appropriate external device
15*4882a593Smuzhiyun      protocol
16*4882a593Smuzhiyun    - to meet the access time requirements of the external devices
17*4882a593Smuzhiyun  All external devices share the addresses, data and control signals with the
18*4882a593Smuzhiyun  controller. Each external device is accessed by means of a unique Chip
19*4882a593Smuzhiyun  Select. The FMC2 performs only one access at a time to an external device.
20*4882a593Smuzhiyun
21*4882a593Smuzhiyunmaintainers:
22*4882a593Smuzhiyun  - Christophe Kerello <christophe.kerello@st.com>
23*4882a593Smuzhiyun
24*4882a593Smuzhiyunproperties:
25*4882a593Smuzhiyun  compatible:
26*4882a593Smuzhiyun    const: st,stm32mp1-fmc2-ebi
27*4882a593Smuzhiyun
28*4882a593Smuzhiyun  reg:
29*4882a593Smuzhiyun    maxItems: 1
30*4882a593Smuzhiyun
31*4882a593Smuzhiyun  clocks:
32*4882a593Smuzhiyun    maxItems: 1
33*4882a593Smuzhiyun
34*4882a593Smuzhiyun  resets:
35*4882a593Smuzhiyun    maxItems: 1
36*4882a593Smuzhiyun
37*4882a593Smuzhiyun  "#address-cells":
38*4882a593Smuzhiyun    const: 2
39*4882a593Smuzhiyun
40*4882a593Smuzhiyun  "#size-cells":
41*4882a593Smuzhiyun    const: 1
42*4882a593Smuzhiyun
43*4882a593Smuzhiyun  ranges:
44*4882a593Smuzhiyun    description: |
45*4882a593Smuzhiyun      Reflects the memory layout with four integer values per bank. Format:
46*4882a593Smuzhiyun      <bank-number> 0 <address of the bank> <size>
47*4882a593Smuzhiyun
48*4882a593SmuzhiyunpatternProperties:
49*4882a593Smuzhiyun  "^.*@[0-4],[a-f0-9]+$":
50*4882a593Smuzhiyun    type: object
51*4882a593Smuzhiyun
52*4882a593Smuzhiyun    properties:
53*4882a593Smuzhiyun      reg:
54*4882a593Smuzhiyun        description: Bank number, base address and size of the device.
55*4882a593Smuzhiyun
56*4882a593Smuzhiyun      st,fmc2-ebi-cs-transaction-type:
57*4882a593Smuzhiyun        description: |
58*4882a593Smuzhiyun          Select one of the transactions type supported
59*4882a593Smuzhiyun          0: Asynchronous mode 1 SRAM/FRAM.
60*4882a593Smuzhiyun          1: Asynchronous mode 1 PSRAM.
61*4882a593Smuzhiyun          2: Asynchronous mode A SRAM/FRAM.
62*4882a593Smuzhiyun          3: Asynchronous mode A PSRAM.
63*4882a593Smuzhiyun          4: Asynchronous mode 2 NOR.
64*4882a593Smuzhiyun          5: Asynchronous mode B NOR.
65*4882a593Smuzhiyun          6: Asynchronous mode C NOR.
66*4882a593Smuzhiyun          7: Asynchronous mode D NOR.
67*4882a593Smuzhiyun          8: Synchronous read synchronous write PSRAM.
68*4882a593Smuzhiyun          9: Synchronous read asynchronous write PSRAM.
69*4882a593Smuzhiyun          10: Synchronous read synchronous write NOR.
70*4882a593Smuzhiyun          11: Synchronous read asynchronous write NOR.
71*4882a593Smuzhiyun        $ref: /schemas/types.yaml#/definitions/uint32
72*4882a593Smuzhiyun        minimum: 0
73*4882a593Smuzhiyun        maximum: 11
74*4882a593Smuzhiyun
75*4882a593Smuzhiyun      st,fmc2-ebi-cs-cclk-enable:
76*4882a593Smuzhiyun        description: Continuous clock enable (first bank must be configured
77*4882a593Smuzhiyun          in synchronous mode). The FMC_CLK is generated continuously
78*4882a593Smuzhiyun          during asynchronous and synchronous access. By default, the
79*4882a593Smuzhiyun          FMC_CLK is only generated during synchronous access.
80*4882a593Smuzhiyun        $ref: /schemas/types.yaml#/definitions/flag
81*4882a593Smuzhiyun
82*4882a593Smuzhiyun      st,fmc2-ebi-cs-mux-enable:
83*4882a593Smuzhiyun        description: Address/Data multiplexed on databus (valid only with
84*4882a593Smuzhiyun          NOR and PSRAM transactions type). By default, Address/Data
85*4882a593Smuzhiyun          are not multiplexed.
86*4882a593Smuzhiyun        $ref: /schemas/types.yaml#/definitions/flag
87*4882a593Smuzhiyun
88*4882a593Smuzhiyun      st,fmc2-ebi-cs-buswidth:
89*4882a593Smuzhiyun        description: Data bus width
90*4882a593Smuzhiyun        $ref: /schemas/types.yaml#/definitions/uint32
91*4882a593Smuzhiyun        enum: [ 8, 16 ]
92*4882a593Smuzhiyun        default: 16
93*4882a593Smuzhiyun
94*4882a593Smuzhiyun      st,fmc2-ebi-cs-waitpol-high:
95*4882a593Smuzhiyun        description: Wait signal polarity (NWAIT signal active high).
96*4882a593Smuzhiyun          By default, NWAIT is active low.
97*4882a593Smuzhiyun        $ref: /schemas/types.yaml#/definitions/flag
98*4882a593Smuzhiyun
99*4882a593Smuzhiyun      st,fmc2-ebi-cs-waitcfg-enable:
100*4882a593Smuzhiyun        description: The NWAIT signal indicates wheither the data from the
101*4882a593Smuzhiyun          device are valid or if a wait state must be inserted when accessing
102*4882a593Smuzhiyun          the device in synchronous mode. By default, the NWAIT signal is
103*4882a593Smuzhiyun          active one data cycle before wait state.
104*4882a593Smuzhiyun        $ref: /schemas/types.yaml#/definitions/flag
105*4882a593Smuzhiyun
106*4882a593Smuzhiyun      st,fmc2-ebi-cs-wait-enable:
107*4882a593Smuzhiyun        description: The NWAIT signal is enabled (its level is taken into
108*4882a593Smuzhiyun          account after the programmed latency period to insert wait states
109*4882a593Smuzhiyun          if asserted). By default, the NWAIT signal is disabled.
110*4882a593Smuzhiyun        $ref: /schemas/types.yaml#/definitions/flag
111*4882a593Smuzhiyun
112*4882a593Smuzhiyun      st,fmc2-ebi-cs-asyncwait-enable:
113*4882a593Smuzhiyun        description: The NWAIT signal is taken into account during asynchronous
114*4882a593Smuzhiyun          transactions. By default, the NWAIT signal is not taken into account
115*4882a593Smuzhiyun          during asynchronous transactions.
116*4882a593Smuzhiyun        $ref: /schemas/types.yaml#/definitions/flag
117*4882a593Smuzhiyun
118*4882a593Smuzhiyun      st,fmc2-ebi-cs-cpsize:
119*4882a593Smuzhiyun        description: CRAM page size. The controller splits the burst access
120*4882a593Smuzhiyun          when the memory page is reached. By default, no burst split when
121*4882a593Smuzhiyun          crossing page boundary.
122*4882a593Smuzhiyun        $ref: /schemas/types.yaml#/definitions/uint32
123*4882a593Smuzhiyun        enum: [ 0, 128, 256, 512, 1024 ]
124*4882a593Smuzhiyun        default: 0
125*4882a593Smuzhiyun
126*4882a593Smuzhiyun      st,fmc2-ebi-cs-byte-lane-setup-ns:
127*4882a593Smuzhiyun        description: This property configures the byte lane setup timing
128*4882a593Smuzhiyun          defined in nanoseconds from NBLx low to Chip Select NEx low.
129*4882a593Smuzhiyun
130*4882a593Smuzhiyun      st,fmc2-ebi-cs-address-setup-ns:
131*4882a593Smuzhiyun        description: This property defines the duration of the address setup
132*4882a593Smuzhiyun          phase in nanoseconds used for asynchronous read/write transactions.
133*4882a593Smuzhiyun
134*4882a593Smuzhiyun      st,fmc2-ebi-cs-address-hold-ns:
135*4882a593Smuzhiyun        description: This property defines the duration of the address hold
136*4882a593Smuzhiyun          phase in nanoseconds used for asynchronous multiplexed read/write
137*4882a593Smuzhiyun          transactions.
138*4882a593Smuzhiyun
139*4882a593Smuzhiyun      st,fmc2-ebi-cs-data-setup-ns:
140*4882a593Smuzhiyun        description: This property defines the duration of the data setup phase
141*4882a593Smuzhiyun          in nanoseconds used for asynchronous read/write transactions.
142*4882a593Smuzhiyun
143*4882a593Smuzhiyun      st,fmc2-ebi-cs-bus-turnaround-ns:
144*4882a593Smuzhiyun        description: This property defines the delay in nanoseconds between the
145*4882a593Smuzhiyun          end of current read/write transaction and the next transaction.
146*4882a593Smuzhiyun
147*4882a593Smuzhiyun      st,fmc2-ebi-cs-data-hold-ns:
148*4882a593Smuzhiyun        description: This property defines the duration of the data hold phase
149*4882a593Smuzhiyun          in nanoseconds used for asynchronous read/write transactions.
150*4882a593Smuzhiyun
151*4882a593Smuzhiyun      st,fmc2-ebi-cs-clk-period-ns:
152*4882a593Smuzhiyun        description: This property defines the FMC_CLK output signal period in
153*4882a593Smuzhiyun          nanoseconds.
154*4882a593Smuzhiyun
155*4882a593Smuzhiyun      st,fmc2-ebi-cs-data-latency-ns:
156*4882a593Smuzhiyun        description: This property defines the data latency before reading or
157*4882a593Smuzhiyun          writing the first data in nanoseconds.
158*4882a593Smuzhiyun
159*4882a593Smuzhiyun      st,fmc2_ebi-cs-write-address-setup-ns:
160*4882a593Smuzhiyun        description: This property defines the duration of the address setup
161*4882a593Smuzhiyun          phase in nanoseconds used for asynchronous write transactions.
162*4882a593Smuzhiyun
163*4882a593Smuzhiyun      st,fmc2-ebi-cs-write-address-hold-ns:
164*4882a593Smuzhiyun        description: This property defines the duration of the address hold
165*4882a593Smuzhiyun          phase in nanoseconds used for asynchronous multiplexed write
166*4882a593Smuzhiyun          transactions.
167*4882a593Smuzhiyun
168*4882a593Smuzhiyun      st,fmc2-ebi-cs-write-data-setup-ns:
169*4882a593Smuzhiyun        description: This property defines the duration of the data setup
170*4882a593Smuzhiyun          phase in nanoseconds used for asynchronous write transactions.
171*4882a593Smuzhiyun
172*4882a593Smuzhiyun      st,fmc2-ebi-cs-write-bus-turnaround-ns:
173*4882a593Smuzhiyun        description: This property defines the delay between the end of current
174*4882a593Smuzhiyun          write transaction and the next transaction in nanoseconds.
175*4882a593Smuzhiyun
176*4882a593Smuzhiyun      st,fmc2-ebi-cs-write-data-hold-ns:
177*4882a593Smuzhiyun        description: This property defines the duration of the data hold phase
178*4882a593Smuzhiyun          in nanoseconds used for asynchronous write transactions.
179*4882a593Smuzhiyun
180*4882a593Smuzhiyun      st,fmc2-ebi-cs-max-low-pulse-ns:
181*4882a593Smuzhiyun        description: This property defines the maximum chip select low pulse
182*4882a593Smuzhiyun          duration in nanoseconds for synchronous transactions. When this timing
183*4882a593Smuzhiyun          reaches 0, the controller splits the current access, toggles NE to
184*4882a593Smuzhiyun          allow device refresh and restarts a new access.
185*4882a593Smuzhiyun
186*4882a593Smuzhiyun    required:
187*4882a593Smuzhiyun      - reg
188*4882a593Smuzhiyun
189*4882a593Smuzhiyunrequired:
190*4882a593Smuzhiyun  - "#address-cells"
191*4882a593Smuzhiyun  - "#size-cells"
192*4882a593Smuzhiyun  - compatible
193*4882a593Smuzhiyun  - reg
194*4882a593Smuzhiyun  - clocks
195*4882a593Smuzhiyun  - ranges
196*4882a593Smuzhiyun
197*4882a593SmuzhiyunadditionalProperties: false
198*4882a593Smuzhiyun
199*4882a593Smuzhiyunexamples:
200*4882a593Smuzhiyun  - |
201*4882a593Smuzhiyun    #include <dt-bindings/interrupt-controller/arm-gic.h>
202*4882a593Smuzhiyun    #include <dt-bindings/clock/stm32mp1-clks.h>
203*4882a593Smuzhiyun    #include <dt-bindings/reset/stm32mp1-resets.h>
204*4882a593Smuzhiyun    memory-controller@58002000 {
205*4882a593Smuzhiyun      #address-cells = <2>;
206*4882a593Smuzhiyun      #size-cells = <1>;
207*4882a593Smuzhiyun      compatible = "st,stm32mp1-fmc2-ebi";
208*4882a593Smuzhiyun      reg = <0x58002000 0x1000>;
209*4882a593Smuzhiyun      clocks = <&rcc FMC_K>;
210*4882a593Smuzhiyun      resets = <&rcc FMC_R>;
211*4882a593Smuzhiyun
212*4882a593Smuzhiyun      ranges = <0 0 0x60000000 0x04000000>, /* EBI CS 1 */
213*4882a593Smuzhiyun               <1 0 0x64000000 0x04000000>, /* EBI CS 2 */
214*4882a593Smuzhiyun               <2 0 0x68000000 0x04000000>, /* EBI CS 3 */
215*4882a593Smuzhiyun               <3 0 0x6c000000 0x04000000>, /* EBI CS 4 */
216*4882a593Smuzhiyun               <4 0 0x80000000 0x10000000>; /* NAND */
217*4882a593Smuzhiyun
218*4882a593Smuzhiyun      psram@0,0 {
219*4882a593Smuzhiyun        compatible = "mtd-ram";
220*4882a593Smuzhiyun        reg = <0 0x00000000 0x100000>;
221*4882a593Smuzhiyun        bank-width = <2>;
222*4882a593Smuzhiyun
223*4882a593Smuzhiyun        st,fmc2-ebi-cs-transaction-type = <1>;
224*4882a593Smuzhiyun        st,fmc2-ebi-cs-address-setup-ns = <60>;
225*4882a593Smuzhiyun        st,fmc2-ebi-cs-data-setup-ns = <30>;
226*4882a593Smuzhiyun        st,fmc2-ebi-cs-bus-turnaround-ns = <5>;
227*4882a593Smuzhiyun      };
228*4882a593Smuzhiyun
229*4882a593Smuzhiyun      nand-controller@4,0 {
230*4882a593Smuzhiyun        #address-cells = <1>;
231*4882a593Smuzhiyun        #size-cells = <0>;
232*4882a593Smuzhiyun        compatible = "st,stm32mp1-fmc2-nfc";
233*4882a593Smuzhiyun        reg = <4 0x00000000 0x1000>,
234*4882a593Smuzhiyun              <4 0x08010000 0x1000>,
235*4882a593Smuzhiyun              <4 0x08020000 0x1000>,
236*4882a593Smuzhiyun              <4 0x01000000 0x1000>,
237*4882a593Smuzhiyun              <4 0x09010000 0x1000>,
238*4882a593Smuzhiyun              <4 0x09020000 0x1000>;
239*4882a593Smuzhiyun        interrupts = <GIC_SPI 48 IRQ_TYPE_LEVEL_HIGH>;
240*4882a593Smuzhiyun        dmas = <&mdma1 20 0x2 0x12000a02 0x0 0x0>,
241*4882a593Smuzhiyun               <&mdma1 20 0x2 0x12000a08 0x0 0x0>,
242*4882a593Smuzhiyun               <&mdma1 21 0x2 0x12000a0a 0x0 0x0>;
243*4882a593Smuzhiyun        dma-names = "tx", "rx", "ecc";
244*4882a593Smuzhiyun
245*4882a593Smuzhiyun        nand@0 {
246*4882a593Smuzhiyun          reg = <0>;
247*4882a593Smuzhiyun          nand-on-flash-bbt;
248*4882a593Smuzhiyun          #address-cells = <1>;
249*4882a593Smuzhiyun          #size-cells = <1>;
250*4882a593Smuzhiyun        };
251*4882a593Smuzhiyun      };
252*4882a593Smuzhiyun    };
253*4882a593Smuzhiyun
254*4882a593Smuzhiyun...
255