# Generic on-chip SRAM

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

> Device-tree binding reference for Generic on-chip SRAM.

<!-- SPDX-License-Identifier: GPL-2.0 -->


<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;sram&#47;sram&#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>

**Maintainers (<code>maintainers</code>):** <a id="dt-fbc39820abb8bb999095"></a> <span id="dt-fb78ddfc22abfc6fe56d"><code>&#34;Rob Herring &#60;robh&#64;kernel&#46;org&#62;&#34;</code></span>

<div id="dt-6d1c5ef59f0239d38c02">
<p style="white-space: pre-wrap">Simple IO memory regions to be managed by the genalloc API.</p>
<p style="white-space: pre-wrap">Each child of the sram node specifies a region of reserved memory. Each
child node should use a 'reg' property to specify a specific range of
reserved memory.</p>
<p style="white-space: pre-wrap">Following the generic-names recommended practice, node names should
reflect the purpose of the node. Unit address (@&lt;address&gt;) should be
appended to the name.</p>
</div>

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

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

<a id="dt-5155525ecd924660ec0a"></a>

### <code>&#36;nodename</code> — not listed as required here

**String pattern (<code>pattern</code>):** <span id="dt-0b2111a24a010949ece7"><code>&#34;&#94;sram&#40;&#64;&#46;&#42;&#41;&#63;&#34;</code></span>

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

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

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

#### Rule for matching array elements (<code>contains</code>)

> **Allowed values (<code>enum</code>):** <a id="dt-e94a17cf5e636efa744d"></a> <span id="dt-fc12e483d817548be400"><code>&#34;mmio&#45;sram&#34;</code></span>, <span id="dt-20064a6865f5d9b325e1"><code>&#34;amlogic&#44;meson&#45;gxbb&#45;sram&#34;</code></span>, <span id="dt-954101434505e339409d"><code>&#34;arm&#44;juno&#45;sram&#45;ns&#34;</code></span>, <span id="dt-8da9d8f65c7ab916e113"><code>&#34;atmel&#44;sama5d2&#45;securam&#34;</code></span>, <span id="dt-d5dbee9079153b8ef68a"><code>&#34;nvidia&#44;tegra186&#45;sysram&#34;</code></span>, <span id="dt-13fdb966f0a61c66b262"><code>&#34;nvidia&#44;tegra194&#45;sysram&#34;</code></span>, <span id="dt-db1d9a2e1223697dcaea"><code>&#34;nvidia&#44;tegra234&#45;sysram&#34;</code></span>, <span id="dt-59d5e1bcb383b687345d"><code>&#34;qcom&#44;kaanapali&#45;imem&#34;</code></span>, <span id="dt-694307034b041c019102"><code>&#34;qcom&#44;rpm&#45;msg&#45;ram&#34;</code></span>, <span id="dt-068759e9fb2d14a47615"><code>&#34;rockchip&#44;rk3288&#45;pmu&#45;sram&#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> — not listed as required here

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

<div id="dt-853257adf43f6880d753">
<p style="white-space: pre-wrap">A list of phandle and clock specifier pair that controls the single SRAM clock.</p>
</div>

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

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

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

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

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

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

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

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

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

<div id="dt-e09d62fd28b1cb158f01">
<p style="white-space: pre-wrap">Should translate from local addresses within the sram to bus addresses.</p>
</div>

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

### <code>no&#45;memory&#45;wc</code> — not listed as required here

<div id="dt-5c15f006c5ea6c81c195">
<p style="white-space: pre-wrap">The flag indicating, that SRAM memory region has not to be remapped as write combining. WC is used by default.</p>
</div>

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

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

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

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

### <code>&#94;&#40;&#91;a&#45;z0&#45;9&#93;&#42;&#45;&#41;&#63;sram&#40;&#45;section&#41;&#63;&#64;&#91;a&#45;f0&#45;9&#93;&#43;&#36;</code> — name matches this regular expression

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

<div id="dt-a2e422b1185d525ac9a3">
<p style="white-space: pre-wrap">Each child of the sram node specifies a region of reserved memory.</p>
</div>

<a id="dt-0956e54edee344779197"></a>

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

<a id="dt-011fbabce647e1bd065e"></a>

**<code>compatible</code> — not listed as required here**

<div id="dt-61dbadc0992f8c5fc4b6">
<p style="white-space: pre-wrap">Should contain a vendor specific string in the form &lt;vendor&gt;,[&lt;device&gt;-]&lt;usage&gt;</p>
</div>

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

**Rule for matching array elements (<code>contains</code>)**

> **Allowed values (<code>enum</code>):** <a id="dt-0cbd89db6765e1786478"></a> <span id="dt-15303916bfc594843500"><code>&#34;allwinner&#44;sun4i&#45;a10&#45;sram&#45;a3&#45;a4&#34;</code></span>, <span id="dt-aebe6a8e9c3d7946bc14"><code>&#34;allwinner&#44;sun4i&#45;a10&#45;sram&#45;c1&#34;</code></span>, <span id="dt-cf31e682066746e43407"><code>&#34;allwinner&#44;sun4i&#45;a10&#45;sram&#45;d&#34;</code></span>, <span id="dt-4fc35057c9576b130e29"><code>&#34;allwinner&#44;sun9i&#45;a80&#45;smp&#45;sram&#34;</code></span>, <span id="dt-3432f7af99d8679517b7"><code>&#34;allwinner&#44;sun50i&#45;a64&#45;sram&#45;c&#34;</code></span>, <span id="dt-809b05c6cae7737f3ca5"><code>&#34;amlogic&#44;meson8&#45;ao&#45;arc&#45;sram&#34;</code></span>, <span id="dt-59bb9b92957fbe22bd14"><code>&#34;amlogic&#44;meson8b&#45;ao&#45;arc&#45;sram&#34;</code></span>, <span id="dt-a933da46a75c8776824e"><code>&#34;amlogic&#44;meson8&#45;smp&#45;sram&#34;</code></span>, <span id="dt-bcceaa4b759f86b95f53"><code>&#34;amlogic&#44;meson8b&#45;smp&#45;sram&#34;</code></span>, <span id="dt-7c7e7d890c0cf2199a54"><code>&#34;amlogic&#44;meson&#45;gxbb&#45;scp&#45;shmem&#34;</code></span>, <span id="dt-e0bff3f7228f0b68f118"><code>&#34;amlogic&#44;meson&#45;axg&#45;scp&#45;shmem&#34;</code></span>, <span id="dt-20f18e2863ad7daecdaf"><code>&#34;arm&#44;juno&#45;scp&#45;shmem&#34;</code></span>, <span id="dt-1d1f61a5523809587f91"><code>&#34;arm&#44;scmi&#45;shmem&#34;</code></span>, <span id="dt-06be449963938280813a"><code>&#34;arm&#44;scp&#45;shmem&#34;</code></span>, <span id="dt-226409d35463369f7d58"><code>&#34;qcom&#44;pil&#45;reloc&#45;info&#34;</code></span>, <span id="dt-9981f0e40c14ec6d703f"><code>&#34;renesas&#44;smp&#45;sram&#34;</code></span>, <span id="dt-4fc1b8e8bf4faac29a78"><code>&#34;rockchip&#44;rk3066&#45;smp&#45;sram&#34;</code></span>, <span id="dt-3ca266b067a7ff6855ce"><code>&#34;samsung&#44;exynos4210&#45;sysram&#34;</code></span>, <span id="dt-24439ac3289d3eb5b92d"><code>&#34;samsung&#44;exynos4210&#45;sysram&#45;ns&#34;</code></span>, <span id="dt-daf8ba6ef48b7debedcd"><code>&#34;socionext&#44;milbeaut&#45;smp&#45;sram&#34;</code></span>, <span id="dt-d661c1c58c403e7bbd35"><code>&#34;stericsson&#44;u8500&#45;esram&#34;</code></span>

<a id="dt-6ec83390bf6df3f424a5"></a>

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

<div id="dt-c5f3a70d8456df01fc0b">
<p style="white-space: pre-wrap">IO mem address range, relative to the SRAM range.</p>
</div>

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

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

**<code>reg&#45;io&#45;width</code> — not listed as required here**

<div id="dt-e60caf378168bf979d1f">
<p style="white-space: pre-wrap">The size (in bytes) of the IO accesses that should be performed on the SRAM.</p>
</div>

**Allowed values (<code>enum</code>):** <a id="dt-0e0515beef6600fb3a34"></a> <span id="dt-a7effd3d5bbcb42a0d44"><code>1</code></span>, <span id="dt-c8d4e437a746a1ff3c51"><code>2</code></span>, <span id="dt-ccea17924c46a9a9d2f2"><code>4</code></span>, <span id="dt-794b4064f6bd7cd79771"><code>8</code></span>

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

**<code>pool</code> — not listed as required here**

<div id="dt-8289b4118755a7a74bbc">
<p style="white-space: pre-wrap">Indicates that the particular reserved SRAM area is addressable and in use by another device or devices.</p>
</div>

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

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

**<code>export</code> — not listed as required here**

<div id="dt-ea3f564de8f4d69d4f98">
<p style="white-space: pre-wrap">Indicates that the reserved SRAM area may be accessed outside of the kernel, e.g. by bootloader or userspace.</p>
</div>

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

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

**<code>protect&#45;exec</code> — not listed as required here**

<div id="dt-9c285a63590ea0ce952b">
<p style="white-space: pre-wrap">Same as 'pool' above but with the additional constraint that code
will be run from the region and that the memory is maintained as
read-only, executable during code execution. NOTE: This region must
be page aligned on start and end in order to properly allow
manipulation of the page attributes.</p>
</div>

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

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

**<code>label</code> — not listed as required here**

<div id="dt-f7883bc8c56e1b021633">
<p style="white-space: pre-wrap">The name for the reserved partition, if omitted, the label is taken from the node name excluding the unit address.</p>
</div>

**Required in this object (<code>required</code>):** <a id="dt-fab6c60ddd914945d87e"></a> <span id="dt-03e3927fe970e38dca9d"><code>&#34;reg&#34;</code></span>

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

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

<code>false</code>

Not allowed by this rule.

**Required in this object (<code>required</code>):** <a id="dt-8313173ff1c9b300d560"></a> <span id="dt-048b70ee865d6847aa3d"><code>&#34;compatible&#34;</code></span>, <span id="dt-ee7433925c1528c16b99"><code>&#34;reg&#34;</code></span>

<a id="dt-158e3f6339df9dc0e448"></a>

## Condition (<code>if</code>)

> <a id="dt-3bfe73d6d5d592adab9c"></a>
>
> ### This rule must not match (<code>not</code>)
>
> > <a id="dt-f5021076855403a9683d"></a>
> >
> > #### Properties and child nodes (<code>properties</code>)
> >
> > <a id="dt-ec318efdc6e27fef954f"></a>
> >
> > **<code>compatible</code> — not listed as required here**
> >
> > <a id="dt-026175eea792feb254b1"></a>
> >
> > **Rule for matching array elements (<code>contains</code>)**
> >
> > > **Allowed values (<code>enum</code>):** <a id="dt-74e1084322f82a11eb8c"></a> <span id="dt-a0a2e4a684c3c0084c59"><code>&#34;qcom&#44;rpm&#45;msg&#45;ram&#34;</code></span>, <span id="dt-0f0833d357c44a3952f4"><code>&#34;rockchip&#44;rk3288&#45;pmu&#45;sram&#34;</code></span>

<a id="dt-94d3067a06aec87aad7f"></a>

## When the condition matches (<code>then</code>)

> **Required in this object (<code>required</code>):** <a id="dt-824165741bab07e919e7"></a> <span id="dt-0be16f81402541b26aff"><code>&#34;&#35;address&#45;cells&#34;</code></span>, <span id="dt-dd9db9085e2885964a9c"><code>&#34;&#35;size&#45;cells&#34;</code></span>, <span id="dt-0d447fba1979bb23b68c"><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">sram@5c000000 {
    compatible = "mmio-sram";
    reg = &lt;0x5c000000 0x40000&gt;; /* 256 KiB SRAM at address 0x5c000000 */

    #address-cells = &lt;1&gt;;
    #size-cells = &lt;1&gt;;
    ranges = &lt;0 0x5c000000 0x40000&gt;;

    smp-sram@100 {
        reg = &lt;0x100 0x50&gt;;
    };

    device-sram@1000 {
        reg = &lt;0x1000 0x1000&gt;;
        pool;
    };

    exported-sram@20000 {
        reg = &lt;0x20000 0x20000&gt;;
        export;
    };
};
</code></pre>

<pre id="dt-bae0d43ea48e35208b4a"><code class="language-dts">// Samsung SMP-capable Exynos SoCs use part of the SYSRAM for the bringup
// of the secondary cores. Once the core gets powered up it executes the
// code that is residing at some specific location of the SYSRAM.
//
// Therefore reserved section sub-nodes have to be added to the mmio-sram
// declaration. These nodes are of two types depending upon secure or
// non-secure execution environment.
sram@2020000 {
    compatible = "mmio-sram";
    reg = &lt;0x02020000 0x54000&gt;;
    #address-cells = &lt;1&gt;;
    #size-cells = &lt;1&gt;;
    ranges = &lt;0 0x02020000 0x54000&gt;;

    smp-sram@0 {
        compatible = "samsung,exynos4210-sysram";
        reg = &lt;0x0 0x1000&gt;;
    };

    smp-sram@53000 {
        compatible = "samsung,exynos4210-sysram-ns";
        reg = &lt;0x53000 0x1000&gt;;
    };
};
</code></pre>

<pre id="dt-d0212a4cd671f89a0b40"><code class="language-dts">// Amlogic's SMP-capable SoCs use part of the sram for the bringup of the cores.
// Once the core gets powered up it executes the code that is residing at a
// specific location.
//
// Therefore a reserved section sub-node has to be added to the mmio-sram
// declaration.
sram@d9000000 {
    compatible = "mmio-sram";
    reg = &lt;0xd9000000 0x20000&gt;;
    #address-cells = &lt;1&gt;;
    #size-cells = &lt;1&gt;;
    ranges = &lt;0 0xd9000000 0x20000&gt;;

    smp-sram@1ff80 {
        compatible = "amlogic,meson8b-smp-sram";
        reg = &lt;0x1ff80 0x8&gt;;
    };
};
</code></pre>

<pre id="dt-cf8a683b5a963eb1c566"><code class="language-dts">sram@e63c0000 {
    compatible = "mmio-sram";
    reg = &lt;0xe63c0000 0x1000&gt;;
    #address-cells = &lt;1&gt;;
    #size-cells = &lt;1&gt;;
    ranges = &lt;0 0xe63c0000 0x1000&gt;;

    smp-sram@0 {
        compatible = "renesas,smp-sram";
        reg = &lt;0 0x10&gt;;
    };
};
</code></pre>

<pre id="dt-89dd782fdab7d446b5b9"><code class="language-dts">sram@10080000 {
    compatible = "mmio-sram";
    reg = &lt;0x10080000 0x10000&gt;;
    #address-cells = &lt;1&gt;;
    #size-cells = &lt;1&gt;;
    ranges;

    smp-sram@10080000 {
        compatible = "rockchip,rk3066-smp-sram";
        reg = &lt;0x10080000 0x50&gt;;
    };
};
</code></pre>

<pre id="dt-0a7a1e02b6a2bd0df8c7"><code class="language-dts">// Rockchip's rk3288 SoC uses the sram of pmu to store the function of
// resume from maskrom(the 1st level loader). This is a common use of
// the "pmu-sram" because it keeps power even in low power states
// in the system.
sram@ff720000 {
  compatible = "rockchip,rk3288-pmu-sram", "mmio-sram";
  reg = &lt;0xff720000 0x1000&gt;;
};
</code></pre>

<pre id="dt-f015148604ca561352a9"><code class="language-dts">// Allwinner's A80 SoC uses part of the secure sram for hotplugging of the
// primary core (cpu0). Once the core gets powered up it checks if a magic
// value is set at a specific location. If it is then the BROM will jump
// to the software entry address, instead of executing a standard boot.
//
// Also there are no "secure-only" properties. The implementation should
// check if this SRAM is usable first.
sram@20000 {
    // 256 KiB secure SRAM at 0x20000
    compatible = "mmio-sram";
    reg = &lt;0x00020000 0x40000&gt;;
    #address-cells = &lt;1&gt;;
    #size-cells = &lt;1&gt;;
    ranges = &lt;0 0x00020000 0x40000&gt;;

    smp-sram@1000 {
        // This is checked by BROM to determine if
        // cpu0 should jump to SMP entry vector
        compatible = "allwinner,sun9i-a80-smp-sram";
        reg = &lt;0x1000 0x8&gt;;
    };
};
</code></pre>

<pre id="dt-f95d9c221ee84555767e"><code class="language-dts">sram@0 {
    compatible = "mmio-sram";
    reg = &lt;0x0 0x10000&gt;;
    #address-cells = &lt;1&gt;;
    #size-cells = &lt;1&gt;;
    ranges = &lt;0 0x0 0x10000&gt;;

    smp-sram@f100 {
        compatible = "socionext,milbeaut-smp-sram";
        reg = &lt;0xf100 0x20&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</span></p>

</details>
