fsl-sec4.txt 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553
  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. - clocks
  82. Usage: required if SEC 4.0 requires explicit enablement of clocks
  83. Value type: <prop_encoded-array>
  84. Definition: A list of phandle and clock specifier pairs describing
  85. the clocks required for enabling and disabling SEC 4.0.
  86. - clock-names
  87. Usage: required if SEC 4.0 requires explicit enablement of clocks
  88. Value type: <string>
  89. Definition: A list of clock name strings in the same order as the
  90. clocks property.
  91. Note: All other standard properties (see the Devicetree Specification)
  92. are allowed but are optional.
  93. EXAMPLE
  94. iMX6QDL/SX requires four clocks
  95. crypto@300000 {
  96. compatible = "fsl,sec-v4.0";
  97. fsl,sec-era = <2>;
  98. #address-cells = <1>;
  99. #size-cells = <1>;
  100. reg = <0x300000 0x10000>;
  101. ranges = <0 0x300000 0x10000>;
  102. interrupt-parent = <&mpic>;
  103. interrupts = <92 2>;
  104. clocks = <&clks IMX6QDL_CLK_CAAM_MEM>,
  105. <&clks IMX6QDL_CLK_CAAM_ACLK>,
  106. <&clks IMX6QDL_CLK_CAAM_IPG>,
  107. <&clks IMX6QDL_CLK_EIM_SLOW>;
  108. clock-names = "mem", "aclk", "ipg", "emi_slow";
  109. };
  110. iMX6UL does only require three clocks
  111. crypto: caam@2140000 {
  112. compatible = "fsl,sec-v4.0";
  113. #address-cells = <1>;
  114. #size-cells = <1>;
  115. reg = <0x2140000 0x3c000>;
  116. ranges = <0 0x2140000 0x3c000>;
  117. interrupts = <GIC_SPI 48 IRQ_TYPE_LEVEL_HIGH>;
  118. clocks = <&clks IMX6UL_CLK_CAAM_MEM>,
  119. <&clks IMX6UL_CLK_CAAM_ACLK>,
  120. <&clks IMX6UL_CLK_CAAM_IPG>;
  121. clock-names = "mem", "aclk", "ipg";
  122. };
  123. =====================================================================
  124. Job Ring (JR) Node
  125. Child of the crypto node defines data processing interface to SEC 4
  126. across the peripheral bus for purposes of processing
  127. cryptographic descriptors. The specified address
  128. range can be made visible to one (or more) cores.
  129. The interrupt defined for this node is controlled within
  130. the address range of this node.
  131. - compatible
  132. Usage: required
  133. Value type: <string>
  134. Definition: Must include "fsl,sec-v4.0-job-ring"
  135. - reg
  136. Usage: required
  137. Value type: <prop-encoded-array>
  138. Definition: Specifies a two JR parameters: an offset from
  139. the parent physical address and the length the JR registers.
  140. - fsl,liodn
  141. Usage: optional-but-recommended
  142. Value type: <prop-encoded-array>
  143. Definition:
  144. Specifies the LIODN to be used in conjunction with
  145. the ppid-to-liodn table that specifies the PPID to LIODN mapping.
  146. Needed if the PAMU is used. Value is a 12 bit value
  147. where value is a LIODN ID for this JR. This property is
  148. normally set by boot firmware.
  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. EXAMPLE
  158. jr@1000 {
  159. compatible = "fsl,sec-v4.0-job-ring";
  160. reg = <0x1000 0x1000>;
  161. fsl,liodn = <0x081>;
  162. interrupt-parent = <&mpic>;
  163. interrupts = <88 2>;
  164. };
  165. =====================================================================
  166. Run Time Integrity Check (RTIC) Node
  167. Child node of the crypto node. Defines a register space that
  168. contains up to 5 sets of addresses and their lengths (sizes) that
  169. will be checked at run time. After an initial hash result is
  170. calculated, these addresses are checked by HW to monitor any
  171. change. If any memory is modified, a Security Violation is
  172. triggered (see SNVS definition).
  173. - compatible
  174. Usage: required
  175. Value type: <string>
  176. Definition: Must include "fsl,sec-v4.0-rtic".
  177. - #address-cells
  178. Usage: required
  179. Value type: <u32>
  180. Definition: A standard property. Defines the number of cells
  181. for representing physical addresses in child nodes. Must
  182. have a value of 1.
  183. - #size-cells
  184. Usage: required
  185. Value type: <u32>
  186. Definition: A standard property. Defines the number of cells
  187. for representing the size of physical addresses in
  188. child nodes. Must have a value of 1.
  189. - reg
  190. Usage: required
  191. Value type: <prop-encoded-array>
  192. Definition: A standard property. Specifies a two parameters:
  193. an offset from the parent physical address and the length
  194. the SEC4 registers.
  195. - ranges
  196. Usage: required
  197. Value type: <prop-encoded-array>
  198. Definition: A standard property. Specifies the physical address
  199. range of the SEC 4 register space (-SNVS not included). A
  200. triplet that includes the child address, parent address, &
  201. length.
  202. EXAMPLE
  203. rtic@6000 {
  204. compatible = "fsl,sec-v4.0-rtic";
  205. #address-cells = <1>;
  206. #size-cells = <1>;
  207. reg = <0x6000 0x100>;
  208. ranges = <0x0 0x6100 0xe00>;
  209. };
  210. =====================================================================
  211. Run Time Integrity Check (RTIC) Memory Node
  212. A child node that defines individual RTIC memory regions that are used to
  213. perform run-time integrity check of memory areas that should not modified.
  214. The node defines a register that contains the memory address &
  215. length (combined) and a second register that contains the hash result
  216. in big endian format.
  217. - compatible
  218. Usage: required
  219. Value type: <string>
  220. Definition: Must include "fsl,sec-v4.0-rtic-memory".
  221. - reg
  222. Usage: required
  223. Value type: <prop-encoded-array>
  224. Definition: A standard property. Specifies two parameters:
  225. an offset from the parent physical address and the length:
  226. 1. The location of the RTIC memory address & length registers.
  227. 2. The location RTIC hash result.
  228. - fsl,rtic-region
  229. Usage: optional-but-recommended
  230. Value type: <prop-encoded-array>
  231. Definition:
  232. Specifies the HW address (36 bit address) for this region
  233. followed by the length of the HW partition to be checked;
  234. the address is represented as a 64 bit quantity followed
  235. by a 32 bit length.
  236. - fsl,liodn
  237. Usage: optional-but-recommended
  238. Value type: <prop-encoded-array>
  239. Definition:
  240. Specifies the LIODN to be used in conjunction with
  241. the ppid-to-liodn table that specifies the PPID to LIODN
  242. mapping. Needed if the PAMU is used. Value is a 12 bit value
  243. where value is a LIODN ID for this RTIC memory region. This
  244. property is normally set by boot firmware.
  245. EXAMPLE
  246. rtic-a@0 {
  247. compatible = "fsl,sec-v4.0-rtic-memory";
  248. reg = <0x00 0x20 0x100 0x80>;
  249. fsl,liodn = <0x03c>;
  250. fsl,rtic-region = <0x12345678 0x12345678 0x12345678>;
  251. };
  252. =====================================================================
  253. Secure Non-Volatile Storage (SNVS) Node
  254. Node defines address range and the associated
  255. interrupt for the SNVS function. This function
  256. monitors security state information & reports
  257. security violations. This also included rtc,
  258. system power off and ON/OFF key.
  259. - compatible
  260. Usage: required
  261. Value type: <string>
  262. Definition: Must include "fsl,sec-v4.0-mon" and "syscon".
  263. - reg
  264. Usage: required
  265. Value type: <prop-encoded-array>
  266. Definition: A standard property. Specifies the physical
  267. address and length of the SEC4 configuration
  268. registers.
  269. - #address-cells
  270. Usage: required
  271. Value type: <u32>
  272. Definition: A standard property. Defines the number of cells
  273. for representing physical addresses in child nodes. Must
  274. have a value of 1.
  275. - #size-cells
  276. Usage: required
  277. Value type: <u32>
  278. Definition: A standard property. Defines the number of cells
  279. for representing the size of physical addresses in
  280. child nodes. Must have a value of 1.
  281. - ranges
  282. Usage: required
  283. Value type: <prop-encoded-array>
  284. Definition: A standard property. Specifies the physical address
  285. range of the SNVS register space. A triplet that includes
  286. the child address, parent address, & length.
  287. - interrupts
  288. Usage: optional
  289. Value type: <prop_encoded-array>
  290. Definition: Specifies the interrupts generated by this
  291. device. The value of the interrupts property
  292. consists of one interrupt specifier. The format
  293. of the specifier is defined by the binding document
  294. describing the node's interrupt parent.
  295. EXAMPLE
  296. sec_mon@314000 {
  297. compatible = "fsl,sec-v4.0-mon", "syscon";
  298. reg = <0x314000 0x1000>;
  299. ranges = <0 0x314000 0x1000>;
  300. interrupt-parent = <&mpic>;
  301. interrupts = <93 2>;
  302. };
  303. =====================================================================
  304. Secure Non-Volatile Storage (SNVS) Low Power (LP) RTC Node
  305. A SNVS child node that defines SNVS LP RTC.
  306. - compatible
  307. Usage: required
  308. Value type: <string>
  309. Definition: Must include "fsl,sec-v4.0-mon-rtc-lp".
  310. - interrupts
  311. Usage: required
  312. Value type: <prop_encoded-array>
  313. Definition: Specifies the interrupts generated by this
  314. device. The value of the interrupts property
  315. consists of one interrupt specifier. The format
  316. of the specifier is defined by the binding document
  317. describing the node's interrupt parent.
  318. - regmap
  319. Usage: required
  320. Value type: <phandle>
  321. Definition: this is phandle to the register map node.
  322. - offset
  323. Usage: option
  324. value type: <u32>
  325. Definition: LP register offset. default it is 0x34.
  326. - clocks
  327. Usage: optional, required if SNVS LP RTC requires explicit
  328. enablement of clocks
  329. Value type: <prop_encoded-array>
  330. Definition: a clock specifier describing the clock required for
  331. enabling and disabling SNVS LP RTC.
  332. - clock-names
  333. Usage: optional, required if SNVS LP RTC requires explicit
  334. enablement of clocks
  335. Value type: <string>
  336. Definition: clock name string should be "snvs-rtc".
  337. EXAMPLE
  338. sec_mon_rtc_lp@1 {
  339. compatible = "fsl,sec-v4.0-mon-rtc-lp";
  340. interrupts = <93 2>;
  341. regmap = <&snvs>;
  342. offset = <0x34>;
  343. clocks = <&clks IMX7D_SNVS_CLK>;
  344. clock-names = "snvs-rtc";
  345. };
  346. =====================================================================
  347. System ON/OFF key driver
  348. The snvs-pwrkey is designed to enable POWER key function which controlled
  349. by SNVS ONOFF, the driver can report the status of POWER key and wakeup
  350. system if pressed after system suspend.
  351. - compatible:
  352. Usage: required
  353. Value type: <string>
  354. Definition: Mush include "fsl,sec-v4.0-pwrkey".
  355. - interrupts:
  356. Usage: required
  357. Value type: <prop_encoded-array>
  358. Definition: The SNVS ON/OFF interrupt number to the CPU(s).
  359. - linux,keycode:
  360. Usage: option
  361. Value type: <int>
  362. Definition: Keycode to emit, KEY_POWER by default.
  363. - wakeup-source:
  364. Usage: option
  365. Value type: <boo>
  366. Definition: Button can wake-up the system.
  367. - regmap:
  368. Usage: required:
  369. Value type: <phandle>
  370. Definition: this is phandle to the register map node.
  371. EXAMPLE:
  372. snvs-pwrkey@020cc000 {
  373. compatible = "fsl,sec-v4.0-pwrkey";
  374. regmap = <&snvs>;
  375. interrupts = <0 4 0x4>
  376. linux,keycode = <116>; /* KEY_POWER */
  377. wakeup-source;
  378. };
  379. =====================================================================
  380. FULL EXAMPLE
  381. crypto: crypto@300000 {
  382. compatible = "fsl,sec-v4.0";
  383. #address-cells = <1>;
  384. #size-cells = <1>;
  385. reg = <0x300000 0x10000>;
  386. ranges = <0 0x300000 0x10000>;
  387. interrupt-parent = <&mpic>;
  388. interrupts = <92 2>;
  389. sec_jr0: jr@1000 {
  390. compatible = "fsl,sec-v4.0-job-ring";
  391. reg = <0x1000 0x1000>;
  392. interrupt-parent = <&mpic>;
  393. interrupts = <88 2>;
  394. };
  395. sec_jr1: jr@2000 {
  396. compatible = "fsl,sec-v4.0-job-ring";
  397. reg = <0x2000 0x1000>;
  398. interrupt-parent = <&mpic>;
  399. interrupts = <89 2>;
  400. };
  401. sec_jr2: jr@3000 {
  402. compatible = "fsl,sec-v4.0-job-ring";
  403. reg = <0x3000 0x1000>;
  404. interrupt-parent = <&mpic>;
  405. interrupts = <90 2>;
  406. };
  407. sec_jr3: jr@4000 {
  408. compatible = "fsl,sec-v4.0-job-ring";
  409. reg = <0x4000 0x1000>;
  410. interrupt-parent = <&mpic>;
  411. interrupts = <91 2>;
  412. };
  413. rtic@6000 {
  414. compatible = "fsl,sec-v4.0-rtic";
  415. #address-cells = <1>;
  416. #size-cells = <1>;
  417. reg = <0x6000 0x100>;
  418. ranges = <0x0 0x6100 0xe00>;
  419. rtic_a: rtic-a@0 {
  420. compatible = "fsl,sec-v4.0-rtic-memory";
  421. reg = <0x00 0x20 0x100 0x80>;
  422. };
  423. rtic_b: rtic-b@20 {
  424. compatible = "fsl,sec-v4.0-rtic-memory";
  425. reg = <0x20 0x20 0x200 0x80>;
  426. };
  427. rtic_c: rtic-c@40 {
  428. compatible = "fsl,sec-v4.0-rtic-memory";
  429. reg = <0x40 0x20 0x300 0x80>;
  430. };
  431. rtic_d: rtic-d@60 {
  432. compatible = "fsl,sec-v4.0-rtic-memory";
  433. reg = <0x60 0x20 0x500 0x80>;
  434. };
  435. };
  436. };
  437. sec_mon: sec_mon@314000 {
  438. compatible = "fsl,sec-v4.0-mon";
  439. reg = <0x314000 0x1000>;
  440. ranges = <0 0x314000 0x1000>;
  441. sec_mon_rtc_lp@34 {
  442. compatible = "fsl,sec-v4.0-mon-rtc-lp";
  443. regmap = <&sec_mon>;
  444. offset = <0x34>;
  445. interrupts = <93 2>;
  446. clocks = <&clks IMX7D_SNVS_CLK>;
  447. clock-names = "snvs-rtc";
  448. };
  449. snvs-pwrkey@020cc000 {
  450. compatible = "fsl,sec-v4.0-pwrkey";
  451. regmap = <&sec_mon>;
  452. interrupts = <0 4 0x4>;
  453. linux,keycode = <116>; /* KEY_POWER */
  454. wakeup-source;
  455. };
  456. };
  457. =====================================================================