fsl-sec4.txt 16 KB

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