# STMicroelectronics Flexible Memory Controller 2 (FMC2)

_Peios Kernel / Hardware and drivers / Device-tree binding reference / Memory controllers bindings_

> Device-tree binding reference for STMicroelectronics Flexible Memory Controller 2 (FMC2).

<!-- SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) -->


<a id="dt-root"></a>

**Schema identifier (<code>&#36;id</code>):** <span id="dt-09f478f44eb202ea573e"><code>&#34;http&#58;&#47;&#47;devicetree&#46;org&#47;schemas&#47;memory&#45;controllers&#47;st&#44;stm32&#45;fmc2&#45;ebi&#46;yaml&#35;&#34;</code></span>

**Schema dialect (<code>&#36;schema</code>):** <span id="dt-dcb375baab6014763a68"><code>&#34;http&#58;&#47;&#47;devicetree&#46;org&#47;meta&#45;schemas&#47;core&#46;yaml&#35;&#34;</code></span>

<a id="dt-e46b5a5dd81dbd751c9f"></a>

<div id="dt-6d1c5ef59f0239d38c02">
<pre><code>The FMC2 functional block makes the interface with: synchronous and
asynchronous static devices (such as PSNOR, PSRAM or other memory-mapped
peripherals) and NAND flash memories.
Its main purposes are:
  - to translate AXI transactions into the appropriate external device
    protocol
  - to meet the access time requirements of the external devices
All external devices share the addresses, data and control signals with the
controller. Each external device is accessed by means of a unique Chip
Select. The FMC2 performs only one access at a time to an external device.</code></pre>
</div>

**Maintainers (<code>maintainers</code>):** <a id="dt-fbc39820abb8bb999095"></a> <span id="dt-fb78ddfc22abfc6fe56d"><code>&#34;Christophe Kerello &#60;christophe&#46;kerello&#64;foss&#46;st&#46;com&#62;&#34;</code></span>

<a id="dt-e1f655ed0ff4d595dadc"></a>

## Properties and child nodes (<code>properties</code>)

<a id="dt-5c1d81699dcbe840de83"></a>

### <code>compatible</code> — required here

**Allowed values (<code>enum</code>):** <a id="dt-207128c21dbd6355c894"></a> <span id="dt-bd234eb96375d77ca611"><code>&#34;st&#44;stm32mp1&#45;fmc2&#45;ebi&#34;</code></span>, <span id="dt-0d17ba1dd2e75413f7d4"><code>&#34;st&#44;stm32mp25&#45;fmc2&#45;ebi&#34;</code></span>

<a id="dt-9c1635fdb65d87e33d77"></a>

### <code>reg</code> — required here

**Maximum number of items (<code>maxItems</code>):** <span id="dt-71421d35675d9a533ad2"><code>1</code></span>

<a id="dt-4e9a371963ac013ad39d"></a>

### <code>clocks</code> — required here

**Maximum number of items (<code>maxItems</code>):** <span id="dt-c7438d9082840936a9a7"><code>1</code></span>

<a id="dt-df397b2b98a8cf834e89"></a>

### <code>resets</code> — not listed as required here

**Maximum number of items (<code>maxItems</code>):** <span id="dt-86a6993fcd90367ac91d"><code>1</code></span>

<a id="dt-030bda573e8c53177f1a"></a>

### <code>power&#45;domains</code> — not listed as required here

**Maximum number of items (<code>maxItems</code>):** <span id="dt-74e4e6f1d3f2a860fdb9"><code>1</code></span>

<a id="dt-2efe70314a961a652abe"></a>

### <code>&#35;address&#45;cells</code> — required here

**Exact value (<code>const</code>):** <span id="dt-e6e6af09ab617572731b"><code>2</code></span>

<a id="dt-ee0e5bf71366d312f1dc"></a>

### <code>&#35;size&#45;cells</code> — required here

**Exact value (<code>const</code>):** <span id="dt-793e842f88ef513a8f93"><code>1</code></span>

<a id="dt-1e6b10cf5f67a6a268f5"></a>

### <code>ranges</code> — required here

<div id="dt-e09d62fd28b1cb158f01">
<p style="white-space: pre-wrap">Reflects the memory layout with four integer values per bank. Format:
&lt;bank-number&gt; 0 &lt;address of the bank&gt; &lt;size&gt;</p>
</div>

<a id="dt-5f3f3e541535f5466fd9"></a>

### <code>access&#45;controllers</code> — not listed as required here

**Minimum number of items (<code>minItems</code>):** <span id="dt-d4f269b8cc70ecfb4fbb"><code>1</code></span>

**Maximum number of items (<code>maxItems</code>):** <span id="dt-169e64bd1b86d7e387bd"><code>2</code></span>

<a id="dt-e92215bd3c2f5373b164"></a>

## Properties matching a name pattern (<code>patternProperties</code>)

<a id="dt-3837937f4539eb36a610"></a>

### <code>&#94;&#46;&#42;&#64;&#91;0&#45;4&#93;&#44;&#91;a&#45;f0&#45;9&#93;&#43;&#36;</code> — name matches this regular expression

<a id="dt-c87fa134b8aa6368ba6b"></a>

#### Properties not matched by properties or patternProperties in this schema (<code>additionalProperties</code>)

<code>true</code>

Allowed by this rule.

**Value type (<code>type</code>):** <span id="dt-a9326c036a63e02b6873"><code>&#34;object&#34;</code></span>

**Shared schema rule (<code>&#36;ref</code>):** <span id="dt-751e9976ca7cc3eb59a1">[<code>mc&#45;peripheral&#45;props&#46;yaml&#35;</code>](</kernel/hardware/devicetree-bindings/dt-memory-controllers/mc-peripheral-props.md#dt-root>)</span>

**Required in this object (<code>required</code>):** <a id="dt-8313173ff1c9b300d560"></a> <span id="dt-048b70ee865d6847aa3d"><code>&#34;&#35;address&#45;cells&#34;</code></span>, <span id="dt-ee7433925c1528c16b99"><code>&#34;&#35;size&#45;cells&#34;</code></span>, <span id="dt-f3765998c4e103e45f2f"><code>&#34;compatible&#34;</code></span>, <span id="dt-329d9b3604d5b98bc19d"><code>&#34;reg&#34;</code></span>, <span id="dt-391b1d2b563ec12ed437"><code>&#34;clocks&#34;</code></span>, <span id="dt-c127a87237cb22622910"><code>&#34;ranges&#34;</code></span>

<a id="dt-738c4b4f9e483441138b"></a>

## Properties not matched by properties or patternProperties in this schema (<code>additionalProperties</code>)

<code>false</code>

Not allowed by this rule.

<a id="dt-1a130cabaa8a47b058bf"></a>

## Examples (<code>examples</code>)

<pre id="dt-0bd6510295af0c95ff2d"><code class="language-dts">#include &lt;dt-bindings/interrupt-controller/arm-gic.h&gt;
#include &lt;dt-bindings/clock/stm32mp1-clks.h&gt;
#include &lt;dt-bindings/reset/stm32mp1-resets.h&gt;
memory-controller@58002000 {
  #address-cells = &lt;2&gt;;
  #size-cells = &lt;1&gt;;
  compatible = "st,stm32mp1-fmc2-ebi";
  reg = &lt;0x58002000 0x1000&gt;;
  clocks = &lt;&amp;rcc FMC_K&gt;;
  resets = &lt;&amp;rcc FMC_R&gt;;

  ranges = &lt;0 0 0x60000000 0x04000000&gt;, /* EBI CS 1 */
           &lt;1 0 0x64000000 0x04000000&gt;, /* EBI CS 2 */
           &lt;2 0 0x68000000 0x04000000&gt;, /* EBI CS 3 */
           &lt;3 0 0x6c000000 0x04000000&gt;, /* EBI CS 4 */
           &lt;4 0 0x80000000 0x10000000&gt;; /* NAND */

  psram@0,0 {
    compatible = "mtd-ram";
    reg = &lt;0 0x00000000 0x100000&gt;;
    bank-width = &lt;2&gt;;

    st,fmc2-ebi-cs-transaction-type = &lt;1&gt;;
    st,fmc2-ebi-cs-address-setup-ns = &lt;60&gt;;
    st,fmc2-ebi-cs-data-setup-ns = &lt;30&gt;;
    st,fmc2-ebi-cs-bus-turnaround-ns = &lt;5&gt;;
  };

  nand-controller@4,0 {
    #address-cells = &lt;1&gt;;
    #size-cells = &lt;0&gt;;
    compatible = "st,stm32mp1-fmc2-nfc";
    reg = &lt;4 0x00000000 0x1000&gt;,
          &lt;4 0x08010000 0x1000&gt;,
          &lt;4 0x08020000 0x1000&gt;,
          &lt;4 0x01000000 0x1000&gt;,
          &lt;4 0x09010000 0x1000&gt;,
          &lt;4 0x09020000 0x1000&gt;;
    interrupts = &lt;GIC_SPI 48 IRQ_TYPE_LEVEL_HIGH&gt;;
    dmas = &lt;&amp;mdma1 20 0x2 0x12000a02 0x0 0x0&gt;,
           &lt;&amp;mdma1 20 0x2 0x12000a08 0x0 0x0&gt;,
           &lt;&amp;mdma1 21 0x2 0x12000a0a 0x0 0x0&gt;;
    dma-names = "tx", "rx", "ecc";

    nand@0 {
      reg = &lt;0&gt;;
      nand-on-flash-bbt;
      #address-cells = &lt;1&gt;;
      #size-cells = &lt;1&gt;;
    };
  };
};
</code></pre>

## Source notes

<details>
<summary>Annotations retained from the schema source</summary>

<p id="dt-comment-0"><strong>Line 1:</strong> <span> SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)</span></p>

</details>
