]> Pileus Git - ~andy/linux/blob - Documentation/devicetree/bindings/crypto/fsl-sec4.txt
bd7ce120bc135e9eccb9f2cbdb3a38fdc15f9702
[~andy/linux] / Documentation / devicetree / bindings / crypto / fsl-sec4.txt
1 =====================================================================
2 SEC 4 Device Tree Binding
3 Copyright (C) 2008-2011 Freescale Semiconductor Inc.
4
5  CONTENTS
6    -Overview
7    -SEC 4 Node
8    -Job Ring Node
9    -Run Time Integrity Check (RTIC) Node
10    -Run Time Integrity Check (RTIC) Memory Node
11    -Secure Non-Volatile Storage (SNVS) Node
12    -Secure Non-Volatile Storage (SNVS) Low Power (LP) RTC Node
13    -Full Example
14
15 NOTE: the SEC 4 is also known as Freescale's Cryptographic Accelerator
16 Accelerator and Assurance Module (CAAM).
17
18 =====================================================================
19 Overview
20
21 DESCRIPTION
22
23 SEC 4 h/w can process requests from 2 types of sources.
24 1. DPAA Queue Interface (HW interface between Queue Manager & SEC 4).
25 2. Job Rings (HW interface between cores & SEC 4 registers).
26
27 High Speed Data Path Configuration:
28
29 HW interface between QM & SEC 4 and also BM & SEC 4, on DPAA-enabled parts
30 such as the P4080.  The number of simultaneous dequeues the QI can make is
31 equal to the number of Descriptor Controller (DECO) engines in a particular
32 SEC version.  E.g., the SEC 4.0 in the P4080 has 5 DECOs and can thus
33 dequeue from 5 subportals simultaneously.
34
35 Job Ring Data Path Configuration:
36
37 Each JR is located on a separate 4k page, they may (or may not) be made visible
38 in the memory partition devoted to a particular core.  The P4080 has 4 JRs, so
39 up to 4 JRs can be configured; and all 4 JRs process requests in parallel.
40
41 =====================================================================
42 SEC 4 Node
43
44 Description
45
46     Node defines the base address of the SEC 4 block.
47     This block specifies the address range of all global
48     configuration registers for the SEC 4 block.  It
49     also receives interrupts from the Run Time Integrity Check
50     (RTIC) function within the SEC 4 block.
51
52 PROPERTIES
53
54    - compatible
55       Usage: required
56       Value type: <string>
57       Definition: Must include "fsl,sec-v4.0"
58
59    - #address-cells
60        Usage: required
61        Value type: <u32>
62        Definition: A standard property.  Defines the number of cells
63            for representing physical addresses in child nodes.
64
65    - #size-cells
66        Usage: required
67        Value type: <u32>
68        Definition: A standard property.  Defines the number of cells
69            for representing the size of physical addresses in
70            child nodes.
71
72    - reg
73       Usage: required
74       Value type: <prop-encoded-array>
75       Definition: A standard property.  Specifies the physical
76           address and length of the SEC4 configuration registers.
77           registers
78
79    - ranges
80        Usage: required
81        Value type: <prop-encoded-array>
82        Definition: A standard property.  Specifies the physical address
83            range of the SEC 4.0 register space (-SNVS not included).  A
84            triplet that includes the child address, parent address, &
85            length.
86
87    - interrupts
88       Usage: required
89       Value type: <prop_encoded-array>
90       Definition:  Specifies the interrupts generated by this
91            device.  The value of the interrupts property
92            consists of one interrupt specifier. The format
93            of the specifier is defined by the binding document
94            describing the node's interrupt parent.
95
96    - interrupt-parent
97       Usage: (required if interrupt property is defined)
98       Value type: <phandle>
99       Definition: A single <phandle> value that points
100           to the interrupt parent to which the child domain
101           is being mapped.
102
103    Note: All other standard properties (see the ePAPR) are allowed
104    but are optional.
105
106
107 EXAMPLE
108         crypto@300000 {
109                 compatible = "fsl,sec-v4.0";
110                 #address-cells = <1>;
111                 #size-cells = <1>;
112                 reg = <0x300000 0x10000>;
113                 ranges = <0 0x300000 0x10000>;
114                 interrupt-parent = <&mpic>;
115                 interrupts = <92 2>;
116         };
117
118 =====================================================================
119 Job Ring (JR) Node
120
121     Child of the crypto node defines data processing interface to SEC 4
122     across the peripheral bus for purposes of processing
123     cryptographic descriptors. The specified address
124     range can be made visible to one (or more) cores.
125     The interrupt defined for this node is controlled within
126     the address range of this node.
127
128   - compatible
129       Usage: required
130       Value type: <string>
131       Definition: Must include "fsl,sec-v4.0-job-ring"
132
133   - reg
134       Usage: required
135       Value type: <prop-encoded-array>
136       Definition: Specifies a two JR parameters:  an offset from
137           the parent physical address and the length the JR registers.
138
139    - fsl,liodn
140        Usage: optional-but-recommended
141        Value type: <prop-encoded-array>
142        Definition:
143            Specifies the LIODN to be used in conjunction with
144            the ppid-to-liodn table that specifies the PPID to LIODN mapping.
145            Needed if the PAMU is used.  Value is a 12 bit value
146            where value is a LIODN ID for this JR. This property is
147            normally set by boot firmware.
148
149    - interrupts
150       Usage: required
151       Value type: <prop_encoded-array>
152       Definition:  Specifies the interrupts generated by this
153            device.  The value of the interrupts property
154            consists of one interrupt specifier. The format
155            of the specifier is defined by the binding document
156            describing the node's interrupt parent.
157
158    - interrupt-parent
159       Usage: (required if interrupt property is defined)
160       Value type: <phandle>
161       Definition: A single <phandle> value that points
162           to the interrupt parent to which the child domain
163           is being mapped.
164
165 EXAMPLE
166         jr@1000 {
167                 compatible = "fsl,sec-v4.0-job-ring";
168                 reg = <0x1000 0x1000>;
169                 fsl,liodn = <0x081>;
170                 interrupt-parent = <&mpic>;
171                 interrupts = <88 2>;
172         };
173
174
175 =====================================================================
176 Run Time Integrity Check (RTIC) Node
177
178   Child node of the crypto node.  Defines a register space that
179   contains up to 5 sets of addresses and their lengths (sizes) that
180   will be checked at run time.  After an initial hash result is
181   calculated, these addresses are checked by HW to monitor any
182   change.  If any memory is modified, a Security Violation is
183   triggered (see SNVS definition).
184
185
186   - compatible
187       Usage: required
188       Value type: <string>
189       Definition: Must include "fsl,sec-v4.0-rtic".
190
191    - #address-cells
192        Usage: required
193        Value type: <u32>
194        Definition: A standard property.  Defines the number of cells
195            for representing physical addresses in child nodes.  Must
196            have a value of 1.
197
198    - #size-cells
199        Usage: required
200        Value type: <u32>
201        Definition: A standard property.  Defines the number of cells
202            for representing the size of physical addresses in
203            child nodes.  Must have a value of 1.
204
205   - reg
206       Usage: required
207       Value type: <prop-encoded-array>
208       Definition: A standard property.  Specifies a two parameters:
209           an offset from the parent physical address and the length
210           the SEC4 registers.
211
212    - ranges
213        Usage: required
214        Value type: <prop-encoded-array>
215        Definition: A standard property.  Specifies the physical address
216            range of the SEC 4 register space (-SNVS not included).  A
217            triplet that includes the child address, parent address, &
218            length.
219
220 EXAMPLE
221         rtic@6000 {
222                 compatible = "fsl,sec-v4.0-rtic";
223                 #address-cells = <1>;
224                 #size-cells = <1>;
225                 reg = <0x6000 0x100>;
226                 ranges = <0x0 0x6100 0xe00>;
227         };
228
229 =====================================================================
230 Run Time Integrity Check (RTIC) Memory Node
231   A child node that defines individual RTIC memory regions that are used to
232   perform run-time integrity check of memory areas that should not modified.
233   The node defines a register that contains the memory address &
234   length (combined) and a second register that contains the hash result
235   in big endian format.
236
237   - compatible
238       Usage: required
239       Value type: <string>
240       Definition: Must include "fsl,sec-v4.0-rtic-memory".
241
242   - reg
243       Usage: required
244       Value type: <prop-encoded-array>
245       Definition: A standard property.  Specifies two parameters:
246           an offset from the parent physical address and the length:
247
248           1. The location of the RTIC memory address & length registers.
249           2. The location RTIC hash result.
250
251   - fsl,rtic-region
252        Usage: optional-but-recommended
253        Value type: <prop-encoded-array>
254        Definition:
255            Specifies the HW address (36 bit address) for this region
256            followed by the length of the HW partition to be checked;
257            the address is represented as a 64 bit quantity followed
258            by a 32 bit length.
259
260    - fsl,liodn
261        Usage: optional-but-recommended
262        Value type: <prop-encoded-array>
263        Definition:
264            Specifies the LIODN to be used in conjunction with
265            the ppid-to-liodn table that specifies the PPID to LIODN
266            mapping.  Needed if the PAMU is used.  Value is a 12 bit value
267            where value is a LIODN ID for this RTIC memory region. This
268            property is normally set by boot firmware.
269
270 EXAMPLE
271         rtic-a@0 {
272                 compatible = "fsl,sec-v4.0-rtic-memory";
273                 reg = <0x00 0x20 0x100 0x80>;
274                 fsl,liodn   = <0x03c>;
275                 fsl,rtic-region  = <0x12345678 0x12345678 0x12345678>;
276         };
277
278 =====================================================================
279 Secure Non-Volatile Storage (SNVS) Node
280
281     Node defines address range and the associated
282     interrupt for the SNVS function.  This function
283     monitors security state information & reports
284     security violations.
285
286   - compatible
287       Usage: required
288       Value type: <string>
289       Definition: Must include "fsl,sec-v4.0-mon".
290
291   - reg
292       Usage: required
293       Value type: <prop-encoded-array>
294       Definition: A standard property.  Specifies the physical
295           address and length of the SEC4 configuration
296           registers.
297
298    - #address-cells
299        Usage: required
300        Value type: <u32>
301        Definition: A standard property.  Defines the number of cells
302            for representing physical addresses in child nodes.  Must
303            have a value of 1.
304
305    - #size-cells
306        Usage: required
307        Value type: <u32>
308        Definition: A standard property.  Defines the number of cells
309            for representing the size of physical addresses in
310            child nodes.  Must have a value of 1.
311
312    - ranges
313        Usage: required
314        Value type: <prop-encoded-array>
315        Definition: A standard property.  Specifies the physical address
316            range of the SNVS register space.  A triplet that includes
317            the child address, parent address, & length.
318
319    - interrupts
320       Usage: required
321       Value type: <prop_encoded-array>
322       Definition:  Specifies the interrupts generated by this
323            device.  The value of the interrupts property
324            consists of one interrupt specifier. The format
325            of the specifier is defined by the binding document
326            describing the node's interrupt parent.
327
328    - interrupt-parent
329       Usage: (required if interrupt property is defined)
330       Value type: <phandle>
331       Definition: A single <phandle> value that points
332           to the interrupt parent to which the child domain
333           is being mapped.
334
335 EXAMPLE
336         sec_mon@314000 {
337                 compatible = "fsl,sec-v4.0-mon";
338                 reg = <0x314000 0x1000>;
339                 ranges = <0 0x314000 0x1000>;
340                 interrupt-parent = <&mpic>;
341                 interrupts = <93 2>;
342         };
343
344 =====================================================================
345 Secure Non-Volatile Storage (SNVS) Low Power (LP) RTC Node
346
347   A SNVS child node that defines SNVS LP RTC.
348
349   - compatible
350       Usage: required
351       Value type: <string>
352       Definition: Must include "fsl,sec-v4.0-mon-rtc-lp".
353
354   - reg
355       Usage: required
356       Value type: <prop-encoded-array>
357       Definition: A standard property.  Specifies the physical
358           address and length of the SNVS LP configuration registers.
359
360 EXAMPLE
361         sec_mon_rtc_lp@314000 {
362                 compatible = "fsl,sec-v4.0-mon-rtc-lp";
363                 reg = <0x34 0x58>;
364         };
365
366 =====================================================================
367 FULL EXAMPLE
368
369         crypto: crypto@300000 {
370                 compatible = "fsl,sec-v4.0";
371                 #address-cells = <1>;
372                 #size-cells = <1>;
373                 reg = <0x300000 0x10000>;
374                 ranges = <0 0x300000 0x10000>;
375                 interrupt-parent = <&mpic>;
376                 interrupts = <92 2>;
377
378                 sec_jr0: jr@1000 {
379                         compatible = "fsl,sec-v4.0-job-ring";
380                         reg = <0x1000 0x1000>;
381                         interrupt-parent = <&mpic>;
382                         interrupts = <88 2>;
383                 };
384
385                 sec_jr1: jr@2000 {
386                         compatible = "fsl,sec-v4.0-job-ring";
387                         reg = <0x2000 0x1000>;
388                         interrupt-parent = <&mpic>;
389                         interrupts = <89 2>;
390                 };
391
392                 sec_jr2: jr@3000 {
393                         compatible = "fsl,sec-v4.0-job-ring";
394                         reg = <0x3000 0x1000>;
395                         interrupt-parent = <&mpic>;
396                         interrupts = <90 2>;
397                 };
398
399                 sec_jr3: jr@4000 {
400                         compatible = "fsl,sec-v4.0-job-ring";
401                         reg = <0x4000 0x1000>;
402                         interrupt-parent = <&mpic>;
403                         interrupts = <91 2>;
404                 };
405
406                 rtic@6000 {
407                         compatible = "fsl,sec-v4.0-rtic";
408                         #address-cells = <1>;
409                         #size-cells = <1>;
410                         reg = <0x6000 0x100>;
411                         ranges = <0x0 0x6100 0xe00>;
412
413                         rtic_a: rtic-a@0 {
414                                 compatible = "fsl,sec-v4.0-rtic-memory";
415                                 reg = <0x00 0x20 0x100 0x80>;
416                         };
417
418                         rtic_b: rtic-b@20 {
419                                 compatible = "fsl,sec-v4.0-rtic-memory";
420                                 reg = <0x20 0x20 0x200 0x80>;
421                         };
422
423                         rtic_c: rtic-c@40 {
424                                 compatible = "fsl,sec-v4.0-rtic-memory";
425                                 reg = <0x40 0x20 0x300 0x80>;
426                         };
427
428                         rtic_d: rtic-d@60 {
429                                 compatible = "fsl,sec-v4.0-rtic-memory";
430                                 reg = <0x60 0x20 0x500 0x80>;
431                         };
432                 };
433         };
434
435         sec_mon: sec_mon@314000 {
436                 compatible = "fsl,sec-v4.0-mon";
437                 reg = <0x314000 0x1000>;
438                 ranges = <0 0x314000 0x1000>;
439                 interrupt-parent = <&mpic>;
440                 interrupts = <93 2>;
441
442                 sec_mon_rtc_lp@34 {
443                         compatible = "fsl,sec-v4.0-mon-rtc-lp";
444                         reg = <0x34 0x58>;
445                 };
446         };
447
448 =====================================================================