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