xref: /linux/Documentation/devicetree/bindings/memory-controllers/st,stm32-fmc2-ebi.yaml (revision 5be478f9c24fbdf8162b8118b8da8cc685e2efb4)
11ab2f86fSChristophe Kerello# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
21ab2f86fSChristophe Kerello%YAML 1.2
31ab2f86fSChristophe Kerello---
41ab2f86fSChristophe Kerello$id: http://devicetree.org/schemas/memory-controllers/st,stm32-fmc2-ebi.yaml#
51ab2f86fSChristophe Kerello$schema: http://devicetree.org/meta-schemas/core.yaml#
61ab2f86fSChristophe Kerello
71ab2f86fSChristophe Kerellotitle: STMicroelectronics Flexible Memory Controller 2 (FMC2) Bindings
81ab2f86fSChristophe Kerello
91ab2f86fSChristophe Kerellodescription: |
101ab2f86fSChristophe Kerello  The FMC2 functional block makes the interface with: synchronous and
111ab2f86fSChristophe Kerello  asynchronous static devices (such as PSNOR, PSRAM or other memory-mapped
121ab2f86fSChristophe Kerello  peripherals) and NAND flash memories.
131ab2f86fSChristophe Kerello  Its main purposes are:
141ab2f86fSChristophe Kerello    - to translate AXI transactions into the appropriate external device
151ab2f86fSChristophe Kerello      protocol
161ab2f86fSChristophe Kerello    - to meet the access time requirements of the external devices
171ab2f86fSChristophe Kerello  All external devices share the addresses, data and control signals with the
181ab2f86fSChristophe Kerello  controller. Each external device is accessed by means of a unique Chip
191ab2f86fSChristophe Kerello  Select. The FMC2 performs only one access at a time to an external device.
201ab2f86fSChristophe Kerello
211ab2f86fSChristophe Kerellomaintainers:
221ab2f86fSChristophe Kerello  - Christophe Kerello <christophe.kerello@st.com>
231ab2f86fSChristophe Kerello
241ab2f86fSChristophe Kerelloproperties:
251ab2f86fSChristophe Kerello  compatible:
261ab2f86fSChristophe Kerello    const: st,stm32mp1-fmc2-ebi
271ab2f86fSChristophe Kerello
281ab2f86fSChristophe Kerello  reg:
291ab2f86fSChristophe Kerello    maxItems: 1
301ab2f86fSChristophe Kerello
311ab2f86fSChristophe Kerello  clocks:
321ab2f86fSChristophe Kerello    maxItems: 1
331ab2f86fSChristophe Kerello
341ab2f86fSChristophe Kerello  resets:
351ab2f86fSChristophe Kerello    maxItems: 1
361ab2f86fSChristophe Kerello
371ab2f86fSChristophe Kerello  "#address-cells":
381ab2f86fSChristophe Kerello    const: 2
391ab2f86fSChristophe Kerello
401ab2f86fSChristophe Kerello  "#size-cells":
411ab2f86fSChristophe Kerello    const: 1
421ab2f86fSChristophe Kerello
431ab2f86fSChristophe Kerello  ranges:
441ab2f86fSChristophe Kerello    description: |
451ab2f86fSChristophe Kerello      Reflects the memory layout with four integer values per bank. Format:
461ab2f86fSChristophe Kerello      <bank-number> 0 <address of the bank> <size>
471ab2f86fSChristophe Kerello
481ab2f86fSChristophe KerellopatternProperties:
491ab2f86fSChristophe Kerello  "^.*@[0-4],[a-f0-9]+$":
501ab2f86fSChristophe Kerello    type: object
511ab2f86fSChristophe Kerello
521ab2f86fSChristophe Kerello    properties:
531ab2f86fSChristophe Kerello      reg:
541ab2f86fSChristophe Kerello        description: Bank number, base address and size of the device.
551ab2f86fSChristophe Kerello
561ab2f86fSChristophe Kerello      st,fmc2-ebi-cs-transaction-type:
571ab2f86fSChristophe Kerello        description: |
581ab2f86fSChristophe Kerello          Select one of the transactions type supported
591ab2f86fSChristophe Kerello          0: Asynchronous mode 1 SRAM/FRAM.
601ab2f86fSChristophe Kerello          1: Asynchronous mode 1 PSRAM.
611ab2f86fSChristophe Kerello          2: Asynchronous mode A SRAM/FRAM.
621ab2f86fSChristophe Kerello          3: Asynchronous mode A PSRAM.
631ab2f86fSChristophe Kerello          4: Asynchronous mode 2 NOR.
641ab2f86fSChristophe Kerello          5: Asynchronous mode B NOR.
651ab2f86fSChristophe Kerello          6: Asynchronous mode C NOR.
661ab2f86fSChristophe Kerello          7: Asynchronous mode D NOR.
671ab2f86fSChristophe Kerello          8: Synchronous read synchronous write PSRAM.
681ab2f86fSChristophe Kerello          9: Synchronous read asynchronous write PSRAM.
691ab2f86fSChristophe Kerello          10: Synchronous read synchronous write NOR.
701ab2f86fSChristophe Kerello          11: Synchronous read asynchronous write NOR.
711ab2f86fSChristophe Kerello        $ref: /schemas/types.yaml#/definitions/uint32
721ab2f86fSChristophe Kerello        minimum: 0
731ab2f86fSChristophe Kerello        maximum: 11
741ab2f86fSChristophe Kerello
751ab2f86fSChristophe Kerello      st,fmc2-ebi-cs-cclk-enable:
761ab2f86fSChristophe Kerello        description: Continuous clock enable (first bank must be configured
771ab2f86fSChristophe Kerello          in synchronous mode). The FMC_CLK is generated continuously
781ab2f86fSChristophe Kerello          during asynchronous and synchronous access. By default, the
791ab2f86fSChristophe Kerello          FMC_CLK is only generated during synchronous access.
801ab2f86fSChristophe Kerello        $ref: /schemas/types.yaml#/definitions/flag
811ab2f86fSChristophe Kerello
821ab2f86fSChristophe Kerello      st,fmc2-ebi-cs-mux-enable:
831ab2f86fSChristophe Kerello        description: Address/Data multiplexed on databus (valid only with
841ab2f86fSChristophe Kerello          NOR and PSRAM transactions type). By default, Address/Data
851ab2f86fSChristophe Kerello          are not multiplexed.
861ab2f86fSChristophe Kerello        $ref: /schemas/types.yaml#/definitions/flag
871ab2f86fSChristophe Kerello
881ab2f86fSChristophe Kerello      st,fmc2-ebi-cs-buswidth:
891ab2f86fSChristophe Kerello        description: Data bus width
901ab2f86fSChristophe Kerello        $ref: /schemas/types.yaml#/definitions/uint32
911ab2f86fSChristophe Kerello        enum: [ 8, 16 ]
921ab2f86fSChristophe Kerello        default: 16
931ab2f86fSChristophe Kerello
941ab2f86fSChristophe Kerello      st,fmc2-ebi-cs-waitpol-high:
951ab2f86fSChristophe Kerello        description: Wait signal polarity (NWAIT signal active high).
961ab2f86fSChristophe Kerello          By default, NWAIT is active low.
971ab2f86fSChristophe Kerello        $ref: /schemas/types.yaml#/definitions/flag
981ab2f86fSChristophe Kerello
991ab2f86fSChristophe Kerello      st,fmc2-ebi-cs-waitcfg-enable:
1001ab2f86fSChristophe Kerello        description: The NWAIT signal indicates wheither the data from the
1011ab2f86fSChristophe Kerello          device are valid or if a wait state must be inserted when accessing
1021ab2f86fSChristophe Kerello          the device in synchronous mode. By default, the NWAIT signal is
1031ab2f86fSChristophe Kerello          active one data cycle before wait state.
1041ab2f86fSChristophe Kerello        $ref: /schemas/types.yaml#/definitions/flag
1051ab2f86fSChristophe Kerello
1061ab2f86fSChristophe Kerello      st,fmc2-ebi-cs-wait-enable:
1071ab2f86fSChristophe Kerello        description: The NWAIT signal is enabled (its level is taken into
1081ab2f86fSChristophe Kerello          account after the programmed latency period to insert wait states
1091ab2f86fSChristophe Kerello          if asserted). By default, the NWAIT signal is disabled.
1101ab2f86fSChristophe Kerello        $ref: /schemas/types.yaml#/definitions/flag
1111ab2f86fSChristophe Kerello
1121ab2f86fSChristophe Kerello      st,fmc2-ebi-cs-asyncwait-enable:
1131ab2f86fSChristophe Kerello        description: The NWAIT signal is taken into account during asynchronous
1141ab2f86fSChristophe Kerello          transactions. By default, the NWAIT signal is not taken into account
1151ab2f86fSChristophe Kerello          during asynchronous transactions.
1161ab2f86fSChristophe Kerello        $ref: /schemas/types.yaml#/definitions/flag
1171ab2f86fSChristophe Kerello
1181ab2f86fSChristophe Kerello      st,fmc2-ebi-cs-cpsize:
1191ab2f86fSChristophe Kerello        description: CRAM page size. The controller splits the burst access
1201ab2f86fSChristophe Kerello          when the memory page is reached. By default, no burst split when
1211ab2f86fSChristophe Kerello          crossing page boundary.
1221ab2f86fSChristophe Kerello        $ref: /schemas/types.yaml#/definitions/uint32
1231ab2f86fSChristophe Kerello        enum: [ 0, 128, 256, 512, 1024 ]
1241ab2f86fSChristophe Kerello        default: 0
1251ab2f86fSChristophe Kerello
1261ab2f86fSChristophe Kerello      st,fmc2-ebi-cs-byte-lane-setup-ns:
1271ab2f86fSChristophe Kerello        description: This property configures the byte lane setup timing
1281ab2f86fSChristophe Kerello          defined in nanoseconds from NBLx low to Chip Select NEx low.
1291ab2f86fSChristophe Kerello
1301ab2f86fSChristophe Kerello      st,fmc2-ebi-cs-address-setup-ns:
1311ab2f86fSChristophe Kerello        description: This property defines the duration of the address setup
1321ab2f86fSChristophe Kerello          phase in nanoseconds used for asynchronous read/write transactions.
1331ab2f86fSChristophe Kerello
1341ab2f86fSChristophe Kerello      st,fmc2-ebi-cs-address-hold-ns:
1351ab2f86fSChristophe Kerello        description: This property defines the duration of the address hold
1361ab2f86fSChristophe Kerello          phase in nanoseconds used for asynchronous multiplexed read/write
1371ab2f86fSChristophe Kerello          transactions.
1381ab2f86fSChristophe Kerello
1391ab2f86fSChristophe Kerello      st,fmc2-ebi-cs-data-setup-ns:
1401ab2f86fSChristophe Kerello        description: This property defines the duration of the data setup phase
1411ab2f86fSChristophe Kerello          in nanoseconds used for asynchronous read/write transactions.
1421ab2f86fSChristophe Kerello
1431ab2f86fSChristophe Kerello      st,fmc2-ebi-cs-bus-turnaround-ns:
1441ab2f86fSChristophe Kerello        description: This property defines the delay in nanoseconds between the
1451ab2f86fSChristophe Kerello          end of current read/write transaction and the next transaction.
1461ab2f86fSChristophe Kerello
1471ab2f86fSChristophe Kerello      st,fmc2-ebi-cs-data-hold-ns:
1481ab2f86fSChristophe Kerello        description: This property defines the duration of the data hold phase
1491ab2f86fSChristophe Kerello          in nanoseconds used for asynchronous read/write transactions.
1501ab2f86fSChristophe Kerello
1511ab2f86fSChristophe Kerello      st,fmc2-ebi-cs-clk-period-ns:
1521ab2f86fSChristophe Kerello        description: This property defines the FMC_CLK output signal period in
1531ab2f86fSChristophe Kerello          nanoseconds.
1541ab2f86fSChristophe Kerello
1551ab2f86fSChristophe Kerello      st,fmc2-ebi-cs-data-latency-ns:
1561ab2f86fSChristophe Kerello        description: This property defines the data latency before reading or
1571ab2f86fSChristophe Kerello          writing the first data in nanoseconds.
1581ab2f86fSChristophe Kerello
1591ab2f86fSChristophe Kerello      st,fmc2_ebi-cs-write-address-setup-ns:
1601ab2f86fSChristophe Kerello        description: This property defines the duration of the address setup
1611ab2f86fSChristophe Kerello          phase in nanoseconds used for asynchronous write transactions.
1621ab2f86fSChristophe Kerello
1631ab2f86fSChristophe Kerello      st,fmc2-ebi-cs-write-address-hold-ns:
1641ab2f86fSChristophe Kerello        description: This property defines the duration of the address hold
1651ab2f86fSChristophe Kerello          phase in nanoseconds used for asynchronous multiplexed write
1661ab2f86fSChristophe Kerello          transactions.
1671ab2f86fSChristophe Kerello
1681ab2f86fSChristophe Kerello      st,fmc2-ebi-cs-write-data-setup-ns:
1691ab2f86fSChristophe Kerello        description: This property defines the duration of the data setup
1701ab2f86fSChristophe Kerello          phase in nanoseconds used for asynchronous write transactions.
1711ab2f86fSChristophe Kerello
1721ab2f86fSChristophe Kerello      st,fmc2-ebi-cs-write-bus-turnaround-ns:
1731ab2f86fSChristophe Kerello        description: This property defines the delay between the end of current
1741ab2f86fSChristophe Kerello          write transaction and the next transaction in nanoseconds.
1751ab2f86fSChristophe Kerello
1761ab2f86fSChristophe Kerello      st,fmc2-ebi-cs-write-data-hold-ns:
1771ab2f86fSChristophe Kerello        description: This property defines the duration of the data hold phase
1781ab2f86fSChristophe Kerello          in nanoseconds used for asynchronous write transactions.
1791ab2f86fSChristophe Kerello
1801ab2f86fSChristophe Kerello      st,fmc2-ebi-cs-max-low-pulse-ns:
1811ab2f86fSChristophe Kerello        description: This property defines the maximum chip select low pulse
1821ab2f86fSChristophe Kerello          duration in nanoseconds for synchronous transactions. When this timing
1831ab2f86fSChristophe Kerello          reaches 0, the controller splits the current access, toggles NE to
1841ab2f86fSChristophe Kerello          allow device refresh and restarts a new access.
1851ab2f86fSChristophe Kerello
1861ab2f86fSChristophe Kerello    required:
1871ab2f86fSChristophe Kerello      - reg
1881ab2f86fSChristophe Kerello
1891ab2f86fSChristophe Kerellorequired:
1901ab2f86fSChristophe Kerello  - "#address-cells"
1911ab2f86fSChristophe Kerello  - "#size-cells"
1921ab2f86fSChristophe Kerello  - compatible
1931ab2f86fSChristophe Kerello  - reg
1941ab2f86fSChristophe Kerello  - clocks
1951ab2f86fSChristophe Kerello  - ranges
1961ab2f86fSChristophe Kerello
197*5be478f9SRob HerringadditionalProperties: false
198*5be478f9SRob Herring
1991ab2f86fSChristophe Kerelloexamples:
2001ab2f86fSChristophe Kerello  - |
2011ab2f86fSChristophe Kerello    #include <dt-bindings/interrupt-controller/arm-gic.h>
2021ab2f86fSChristophe Kerello    #include <dt-bindings/clock/stm32mp1-clks.h>
2031ab2f86fSChristophe Kerello    #include <dt-bindings/reset/stm32mp1-resets.h>
2041ab2f86fSChristophe Kerello    memory-controller@58002000 {
2051ab2f86fSChristophe Kerello      #address-cells = <2>;
2061ab2f86fSChristophe Kerello      #size-cells = <1>;
2071ab2f86fSChristophe Kerello      compatible = "st,stm32mp1-fmc2-ebi";
2081ab2f86fSChristophe Kerello      reg = <0x58002000 0x1000>;
2091ab2f86fSChristophe Kerello      clocks = <&rcc FMC_K>;
2101ab2f86fSChristophe Kerello      resets = <&rcc FMC_R>;
2111ab2f86fSChristophe Kerello
2121ab2f86fSChristophe Kerello      ranges = <0 0 0x60000000 0x04000000>, /* EBI CS 1 */
2131ab2f86fSChristophe Kerello               <1 0 0x64000000 0x04000000>, /* EBI CS 2 */
2141ab2f86fSChristophe Kerello               <2 0 0x68000000 0x04000000>, /* EBI CS 3 */
2151ab2f86fSChristophe Kerello               <3 0 0x6c000000 0x04000000>, /* EBI CS 4 */
2161ab2f86fSChristophe Kerello               <4 0 0x80000000 0x10000000>; /* NAND */
2171ab2f86fSChristophe Kerello
2181ab2f86fSChristophe Kerello      psram@0,0 {
2191ab2f86fSChristophe Kerello        compatible = "mtd-ram";
2201ab2f86fSChristophe Kerello        reg = <0 0x00000000 0x100000>;
2211ab2f86fSChristophe Kerello        bank-width = <2>;
2221ab2f86fSChristophe Kerello
2231ab2f86fSChristophe Kerello        st,fmc2-ebi-cs-transaction-type = <1>;
2241ab2f86fSChristophe Kerello        st,fmc2-ebi-cs-address-setup-ns = <60>;
2251ab2f86fSChristophe Kerello        st,fmc2-ebi-cs-data-setup-ns = <30>;
2261ab2f86fSChristophe Kerello        st,fmc2-ebi-cs-bus-turnaround-ns = <5>;
2271ab2f86fSChristophe Kerello      };
2281ab2f86fSChristophe Kerello
2291ab2f86fSChristophe Kerello      nand-controller@4,0 {
2301ab2f86fSChristophe Kerello        #address-cells = <1>;
2311ab2f86fSChristophe Kerello        #size-cells = <0>;
2321ab2f86fSChristophe Kerello        compatible = "st,stm32mp1-fmc2-nfc";
2331ab2f86fSChristophe Kerello        reg = <4 0x00000000 0x1000>,
2341ab2f86fSChristophe Kerello              <4 0x08010000 0x1000>,
2351ab2f86fSChristophe Kerello              <4 0x08020000 0x1000>,
2361ab2f86fSChristophe Kerello              <4 0x01000000 0x1000>,
2371ab2f86fSChristophe Kerello              <4 0x09010000 0x1000>,
2381ab2f86fSChristophe Kerello              <4 0x09020000 0x1000>;
2391ab2f86fSChristophe Kerello        interrupts = <GIC_SPI 48 IRQ_TYPE_LEVEL_HIGH>;
2401ab2f86fSChristophe Kerello        dmas = <&mdma1 20 0x2 0x12000a02 0x0 0x0>,
2411ab2f86fSChristophe Kerello               <&mdma1 20 0x2 0x12000a08 0x0 0x0>,
2421ab2f86fSChristophe Kerello               <&mdma1 21 0x2 0x12000a0a 0x0 0x0>;
2431ab2f86fSChristophe Kerello        dma-names = "tx", "rx", "ecc";
2441ab2f86fSChristophe Kerello
2451ab2f86fSChristophe Kerello        nand@0 {
2461ab2f86fSChristophe Kerello          reg = <0>;
2471ab2f86fSChristophe Kerello          nand-on-flash-bbt;
2481ab2f86fSChristophe Kerello          #address-cells = <1>;
2491ab2f86fSChristophe Kerello          #size-cells = <1>;
2501ab2f86fSChristophe Kerello        };
2511ab2f86fSChristophe Kerello      };
2521ab2f86fSChristophe Kerello    };
2531ab2f86fSChristophe Kerello
2541ab2f86fSChristophe Kerello...
255