xref: /freebsd/sys/contrib/device-tree/Bindings/sram/sram.yaml (revision 5def4c47d4bd90b209b9b4a4ba9faec15846d8fd)
1c66ec88fSEmmanuel Vadot# SPDX-License-Identifier: GPL-2.0
2c66ec88fSEmmanuel Vadot%YAML 1.2
3c66ec88fSEmmanuel Vadot---
4c66ec88fSEmmanuel Vadot$id: http://devicetree.org/schemas/sram/sram.yaml#
5c66ec88fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6c66ec88fSEmmanuel Vadot
7c66ec88fSEmmanuel Vadottitle: Generic on-chip SRAM
8c66ec88fSEmmanuel Vadot
9c66ec88fSEmmanuel Vadotmaintainers:
10c66ec88fSEmmanuel Vadot  - Rob Herring <robh@kernel.org>
11c66ec88fSEmmanuel Vadot
12c66ec88fSEmmanuel Vadotdescription: |+
13c66ec88fSEmmanuel Vadot  Simple IO memory regions to be managed by the genalloc API.
14c66ec88fSEmmanuel Vadot
15c66ec88fSEmmanuel Vadot  Each child of the sram node specifies a region of reserved memory. Each
16c66ec88fSEmmanuel Vadot  child node should use a 'reg' property to specify a specific range of
17c66ec88fSEmmanuel Vadot  reserved memory.
18c66ec88fSEmmanuel Vadot
19c66ec88fSEmmanuel Vadot  Following the generic-names recommended practice, node names should
20c66ec88fSEmmanuel Vadot  reflect the purpose of the node. Unit address (@<address>) should be
21c66ec88fSEmmanuel Vadot  appended to the name.
22c66ec88fSEmmanuel Vadot
23c66ec88fSEmmanuel Vadotproperties:
24c66ec88fSEmmanuel Vadot  $nodename:
25c66ec88fSEmmanuel Vadot    pattern: "^sram(@.*)?"
26c66ec88fSEmmanuel Vadot
27c66ec88fSEmmanuel Vadot  compatible:
28c66ec88fSEmmanuel Vadot    contains:
29c66ec88fSEmmanuel Vadot      enum:
30c66ec88fSEmmanuel Vadot        - mmio-sram
31c66ec88fSEmmanuel Vadot        - atmel,sama5d2-securam
32c66ec88fSEmmanuel Vadot        - rockchip,rk3288-pmu-sram
33c66ec88fSEmmanuel Vadot
34c66ec88fSEmmanuel Vadot  reg:
35c66ec88fSEmmanuel Vadot    maxItems: 1
36c66ec88fSEmmanuel Vadot
37c66ec88fSEmmanuel Vadot  clocks:
38*5def4c47SEmmanuel Vadot    maxItems: 1
39c66ec88fSEmmanuel Vadot    description:
40c66ec88fSEmmanuel Vadot      A list of phandle and clock specifier pair that controls the single
41c66ec88fSEmmanuel Vadot      SRAM clock.
42c66ec88fSEmmanuel Vadot
43c66ec88fSEmmanuel Vadot  "#address-cells":
44c66ec88fSEmmanuel Vadot    const: 1
45c66ec88fSEmmanuel Vadot
46c66ec88fSEmmanuel Vadot  "#size-cells":
47c66ec88fSEmmanuel Vadot    const: 1
48c66ec88fSEmmanuel Vadot
49c66ec88fSEmmanuel Vadot  ranges:
50*5def4c47SEmmanuel Vadot    maxItems: 1
51c66ec88fSEmmanuel Vadot    description:
52c66ec88fSEmmanuel Vadot      Should translate from local addresses within the sram to bus addresses.
53c66ec88fSEmmanuel Vadot
54c66ec88fSEmmanuel Vadot  no-memory-wc:
55c66ec88fSEmmanuel Vadot    description:
56c66ec88fSEmmanuel Vadot      The flag indicating, that SRAM memory region has not to be remapped
57c66ec88fSEmmanuel Vadot      as write combining. WC is used by default.
58c66ec88fSEmmanuel Vadot    type: boolean
59c66ec88fSEmmanuel Vadot
60c66ec88fSEmmanuel VadotpatternProperties:
61c66ec88fSEmmanuel Vadot  "^([a-z]*-)?sram(-section)?@[a-f0-9]+$":
62c66ec88fSEmmanuel Vadot    type: object
63c66ec88fSEmmanuel Vadot    description:
64c66ec88fSEmmanuel Vadot      Each child of the sram node specifies a region of reserved memory.
65c66ec88fSEmmanuel Vadot    properties:
66c66ec88fSEmmanuel Vadot      compatible:
67c66ec88fSEmmanuel Vadot        description:
68c66ec88fSEmmanuel Vadot          Should contain a vendor specific string in the form
69c66ec88fSEmmanuel Vadot          <vendor>,[<device>-]<usage>
70c66ec88fSEmmanuel Vadot        contains:
71c66ec88fSEmmanuel Vadot          enum:
72c66ec88fSEmmanuel Vadot            - allwinner,sun4i-a10-sram-a3-a4
73c66ec88fSEmmanuel Vadot            - allwinner,sun4i-a10-sram-c1
74c66ec88fSEmmanuel Vadot            - allwinner,sun4i-a10-sram-d
75c66ec88fSEmmanuel Vadot            - allwinner,sun9i-a80-smp-sram
76c66ec88fSEmmanuel Vadot            - allwinner,sun50i-a64-sram-c
77*5def4c47SEmmanuel Vadot            - amlogic,meson8-ao-arc-sram
78*5def4c47SEmmanuel Vadot            - amlogic,meson8b-ao-arc-sram
79c66ec88fSEmmanuel Vadot            - amlogic,meson8-smp-sram
80c66ec88fSEmmanuel Vadot            - amlogic,meson8b-smp-sram
81c66ec88fSEmmanuel Vadot            - amlogic,meson-gxbb-scp-shmem
82c66ec88fSEmmanuel Vadot            - amlogic,meson-axg-scp-shmem
83c66ec88fSEmmanuel Vadot            - renesas,smp-sram
84c66ec88fSEmmanuel Vadot            - rockchip,rk3066-smp-sram
85c66ec88fSEmmanuel Vadot            - samsung,exynos4210-sysram
86c66ec88fSEmmanuel Vadot            - samsung,exynos4210-sysram-ns
87c66ec88fSEmmanuel Vadot            - socionext,milbeaut-smp-sram
88c66ec88fSEmmanuel Vadot
89c66ec88fSEmmanuel Vadot      reg:
90c66ec88fSEmmanuel Vadot        description:
91c66ec88fSEmmanuel Vadot          IO mem address range, relative to the SRAM range.
92c66ec88fSEmmanuel Vadot        maxItems: 1
93c66ec88fSEmmanuel Vadot
94c66ec88fSEmmanuel Vadot      pool:
95c66ec88fSEmmanuel Vadot        description:
96c66ec88fSEmmanuel Vadot          Indicates that the particular reserved SRAM area is addressable
97c66ec88fSEmmanuel Vadot          and in use by another device or devices.
98c66ec88fSEmmanuel Vadot        type: boolean
99c66ec88fSEmmanuel Vadot
100c66ec88fSEmmanuel Vadot      export:
101c66ec88fSEmmanuel Vadot        description:
102c66ec88fSEmmanuel Vadot          Indicates that the reserved SRAM area may be accessed outside
103c66ec88fSEmmanuel Vadot          of the kernel, e.g. by bootloader or userspace.
104c66ec88fSEmmanuel Vadot        type: boolean
105c66ec88fSEmmanuel Vadot
106c66ec88fSEmmanuel Vadot      protect-exec:
107c66ec88fSEmmanuel Vadot        description: |
108c66ec88fSEmmanuel Vadot          Same as 'pool' above but with the additional constraint that code
109c66ec88fSEmmanuel Vadot          will be run from the region and that the memory is maintained as
110c66ec88fSEmmanuel Vadot          read-only, executable during code execution. NOTE: This region must
111c66ec88fSEmmanuel Vadot          be page aligned on start and end in order to properly allow
112c66ec88fSEmmanuel Vadot          manipulation of the page attributes.
113c66ec88fSEmmanuel Vadot        type: boolean
114c66ec88fSEmmanuel Vadot
115c66ec88fSEmmanuel Vadot      label:
116c66ec88fSEmmanuel Vadot        description:
117c66ec88fSEmmanuel Vadot          The name for the reserved partition, if omitted, the label is taken
118c66ec88fSEmmanuel Vadot          from the node name excluding the unit address.
119c66ec88fSEmmanuel Vadot
120c66ec88fSEmmanuel Vadot    required:
121c66ec88fSEmmanuel Vadot      - reg
122c66ec88fSEmmanuel Vadot
123c66ec88fSEmmanuel Vadot    additionalProperties: false
124c66ec88fSEmmanuel Vadot
125c66ec88fSEmmanuel Vadotrequired:
126c66ec88fSEmmanuel Vadot  - compatible
127c66ec88fSEmmanuel Vadot  - reg
128c66ec88fSEmmanuel Vadot
129c66ec88fSEmmanuel Vadotif:
130c66ec88fSEmmanuel Vadot  properties:
131c66ec88fSEmmanuel Vadot    compatible:
132c66ec88fSEmmanuel Vadot      contains:
133c66ec88fSEmmanuel Vadot        const: rockchip,rk3288-pmu-sram
134c66ec88fSEmmanuel Vadot
135c66ec88fSEmmanuel Vadotelse:
136c66ec88fSEmmanuel Vadot  required:
137c66ec88fSEmmanuel Vadot    - "#address-cells"
138c66ec88fSEmmanuel Vadot    - "#size-cells"
139c66ec88fSEmmanuel Vadot    - ranges
140c66ec88fSEmmanuel Vadot
141c66ec88fSEmmanuel VadotadditionalProperties: false
142c66ec88fSEmmanuel Vadot
143c66ec88fSEmmanuel Vadotexamples:
144c66ec88fSEmmanuel Vadot  - |
145c66ec88fSEmmanuel Vadot    sram@5c000000 {
146c66ec88fSEmmanuel Vadot        compatible = "mmio-sram";
147c66ec88fSEmmanuel Vadot        reg = <0x5c000000 0x40000>; /* 256 KiB SRAM at address 0x5c000000 */
148c66ec88fSEmmanuel Vadot
149c66ec88fSEmmanuel Vadot        #address-cells = <1>;
150c66ec88fSEmmanuel Vadot        #size-cells = <1>;
151c66ec88fSEmmanuel Vadot        ranges = <0 0x5c000000 0x40000>;
152c66ec88fSEmmanuel Vadot
153c66ec88fSEmmanuel Vadot        smp-sram@100 {
154c66ec88fSEmmanuel Vadot            reg = <0x100 0x50>;
155c66ec88fSEmmanuel Vadot        };
156c66ec88fSEmmanuel Vadot
157c66ec88fSEmmanuel Vadot        device-sram@1000 {
158c66ec88fSEmmanuel Vadot            reg = <0x1000 0x1000>;
159c66ec88fSEmmanuel Vadot            pool;
160c66ec88fSEmmanuel Vadot        };
161c66ec88fSEmmanuel Vadot
162c66ec88fSEmmanuel Vadot        exported-sram@20000 {
163c66ec88fSEmmanuel Vadot            reg = <0x20000 0x20000>;
164c66ec88fSEmmanuel Vadot            export;
165c66ec88fSEmmanuel Vadot        };
166c66ec88fSEmmanuel Vadot    };
167c66ec88fSEmmanuel Vadot
168c66ec88fSEmmanuel Vadot  - |
169c66ec88fSEmmanuel Vadot    // Samsung SMP-capable Exynos SoCs use part of the SYSRAM for the bringup
170c66ec88fSEmmanuel Vadot    // of the secondary cores. Once the core gets powered up it executes the
171c66ec88fSEmmanuel Vadot    // code that is residing at some specific location of the SYSRAM.
172c66ec88fSEmmanuel Vadot    //
173c66ec88fSEmmanuel Vadot    // Therefore reserved section sub-nodes have to be added to the mmio-sram
174c66ec88fSEmmanuel Vadot    // declaration. These nodes are of two types depending upon secure or
175c66ec88fSEmmanuel Vadot    // non-secure execution environment.
176c66ec88fSEmmanuel Vadot    sram@2020000 {
177c66ec88fSEmmanuel Vadot        compatible = "mmio-sram";
178c66ec88fSEmmanuel Vadot        reg = <0x02020000 0x54000>;
179c66ec88fSEmmanuel Vadot        #address-cells = <1>;
180c66ec88fSEmmanuel Vadot        #size-cells = <1>;
181c66ec88fSEmmanuel Vadot        ranges = <0 0x02020000 0x54000>;
182c66ec88fSEmmanuel Vadot
183c66ec88fSEmmanuel Vadot        smp-sram@0 {
184c66ec88fSEmmanuel Vadot            compatible = "samsung,exynos4210-sysram";
185c66ec88fSEmmanuel Vadot            reg = <0x0 0x1000>;
186c66ec88fSEmmanuel Vadot        };
187c66ec88fSEmmanuel Vadot
188c66ec88fSEmmanuel Vadot        smp-sram@53000 {
189c66ec88fSEmmanuel Vadot            compatible = "samsung,exynos4210-sysram-ns";
190c66ec88fSEmmanuel Vadot            reg = <0x53000 0x1000>;
191c66ec88fSEmmanuel Vadot        };
192c66ec88fSEmmanuel Vadot    };
193c66ec88fSEmmanuel Vadot
194c66ec88fSEmmanuel Vadot  - |
195c66ec88fSEmmanuel Vadot    // Amlogic's SMP-capable SoCs use part of the sram for the bringup of the cores.
196c66ec88fSEmmanuel Vadot    // Once the core gets powered up it executes the code that is residing at a
197c66ec88fSEmmanuel Vadot    // specific location.
198c66ec88fSEmmanuel Vadot    //
199c66ec88fSEmmanuel Vadot    // Therefore a reserved section sub-node has to be added to the mmio-sram
200c66ec88fSEmmanuel Vadot    // declaration.
201c66ec88fSEmmanuel Vadot    sram@d9000000 {
202c66ec88fSEmmanuel Vadot        compatible = "mmio-sram";
203c66ec88fSEmmanuel Vadot        reg = <0xd9000000 0x20000>;
204c66ec88fSEmmanuel Vadot        #address-cells = <1>;
205c66ec88fSEmmanuel Vadot        #size-cells = <1>;
206c66ec88fSEmmanuel Vadot        ranges = <0 0xd9000000 0x20000>;
207c66ec88fSEmmanuel Vadot
208c66ec88fSEmmanuel Vadot        smp-sram@1ff80 {
209c66ec88fSEmmanuel Vadot            compatible = "amlogic,meson8b-smp-sram";
210c66ec88fSEmmanuel Vadot            reg = <0x1ff80 0x8>;
211c66ec88fSEmmanuel Vadot        };
212c66ec88fSEmmanuel Vadot    };
213c66ec88fSEmmanuel Vadot
214c66ec88fSEmmanuel Vadot  - |
215c66ec88fSEmmanuel Vadot    sram@e63c0000 {
216c66ec88fSEmmanuel Vadot        compatible = "mmio-sram";
217c66ec88fSEmmanuel Vadot        reg = <0xe63c0000 0x1000>;
218c66ec88fSEmmanuel Vadot        #address-cells = <1>;
219c66ec88fSEmmanuel Vadot        #size-cells = <1>;
220c66ec88fSEmmanuel Vadot        ranges = <0 0xe63c0000 0x1000>;
221c66ec88fSEmmanuel Vadot
222c66ec88fSEmmanuel Vadot        smp-sram@0 {
223c66ec88fSEmmanuel Vadot            compatible = "renesas,smp-sram";
224c66ec88fSEmmanuel Vadot            reg = <0 0x10>;
225c66ec88fSEmmanuel Vadot        };
226c66ec88fSEmmanuel Vadot    };
227c66ec88fSEmmanuel Vadot
228c66ec88fSEmmanuel Vadot  - |
229c66ec88fSEmmanuel Vadot    sram@10080000 {
230c66ec88fSEmmanuel Vadot        compatible = "mmio-sram";
231c66ec88fSEmmanuel Vadot        reg = <0x10080000 0x10000>;
232c66ec88fSEmmanuel Vadot        #address-cells = <1>;
233c66ec88fSEmmanuel Vadot        #size-cells = <1>;
234c66ec88fSEmmanuel Vadot        ranges;
235c66ec88fSEmmanuel Vadot
236c66ec88fSEmmanuel Vadot        smp-sram@10080000 {
237c66ec88fSEmmanuel Vadot            compatible = "rockchip,rk3066-smp-sram";
238c66ec88fSEmmanuel Vadot            reg = <0x10080000 0x50>;
239c66ec88fSEmmanuel Vadot        };
240c66ec88fSEmmanuel Vadot    };
241c66ec88fSEmmanuel Vadot
242c66ec88fSEmmanuel Vadot  - |
243c66ec88fSEmmanuel Vadot    // Rockchip's rk3288 SoC uses the sram of pmu to store the function of
244c66ec88fSEmmanuel Vadot    // resume from maskrom(the 1st level loader). This is a common use of
245c66ec88fSEmmanuel Vadot    // the "pmu-sram" because it keeps power even in low power states
246c66ec88fSEmmanuel Vadot    // in the system.
247c66ec88fSEmmanuel Vadot    sram@ff720000 {
248c66ec88fSEmmanuel Vadot      compatible = "rockchip,rk3288-pmu-sram", "mmio-sram";
249c66ec88fSEmmanuel Vadot      reg = <0xff720000 0x1000>;
250c66ec88fSEmmanuel Vadot    };
251c66ec88fSEmmanuel Vadot
252c66ec88fSEmmanuel Vadot  - |
253c66ec88fSEmmanuel Vadot    // Allwinner's A80 SoC uses part of the secure sram for hotplugging of the
254c66ec88fSEmmanuel Vadot    // primary core (cpu0). Once the core gets powered up it checks if a magic
255c66ec88fSEmmanuel Vadot    // value is set at a specific location. If it is then the BROM will jump
256c66ec88fSEmmanuel Vadot    // to the software entry address, instead of executing a standard boot.
257c66ec88fSEmmanuel Vadot    //
258c66ec88fSEmmanuel Vadot    // Also there are no "secure-only" properties. The implementation should
259c66ec88fSEmmanuel Vadot    // check if this SRAM is usable first.
260c66ec88fSEmmanuel Vadot    sram@20000 {
261c66ec88fSEmmanuel Vadot        // 256 KiB secure SRAM at 0x20000
262c66ec88fSEmmanuel Vadot        compatible = "mmio-sram";
263c66ec88fSEmmanuel Vadot        reg = <0x00020000 0x40000>;
264c66ec88fSEmmanuel Vadot        #address-cells = <1>;
265c66ec88fSEmmanuel Vadot        #size-cells = <1>;
266c66ec88fSEmmanuel Vadot        ranges = <0 0x00020000 0x40000>;
267c66ec88fSEmmanuel Vadot
268c66ec88fSEmmanuel Vadot        smp-sram@1000 {
269c66ec88fSEmmanuel Vadot            // This is checked by BROM to determine if
270c66ec88fSEmmanuel Vadot            // cpu0 should jump to SMP entry vector
271c66ec88fSEmmanuel Vadot            compatible = "allwinner,sun9i-a80-smp-sram";
272c66ec88fSEmmanuel Vadot            reg = <0x1000 0x8>;
273c66ec88fSEmmanuel Vadot        };
274c66ec88fSEmmanuel Vadot    };
275c66ec88fSEmmanuel Vadot
276c66ec88fSEmmanuel Vadot  - |
277c66ec88fSEmmanuel Vadot    sram@0 {
278c66ec88fSEmmanuel Vadot        compatible = "mmio-sram";
279c66ec88fSEmmanuel Vadot        reg = <0x0 0x10000>;
280c66ec88fSEmmanuel Vadot        #address-cells = <1>;
281c66ec88fSEmmanuel Vadot        #size-cells = <1>;
282c66ec88fSEmmanuel Vadot        ranges = <0 0x0 0x10000>;
283c66ec88fSEmmanuel Vadot
284c66ec88fSEmmanuel Vadot        smp-sram@f100 {
285c66ec88fSEmmanuel Vadot            compatible = "socionext,milbeaut-smp-sram";
286c66ec88fSEmmanuel Vadot            reg = <0xf100 0x20>;
287c66ec88fSEmmanuel Vadot        };
288c66ec88fSEmmanuel Vadot    };
289