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