cslr_rng.h 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512
  1. /********************************************************************
  2. * Copyright (C) 2013-2014 Texas Instruments Incorporated.
  3. *
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions
  6. * are met:
  7. *
  8. * Redistributions of source code must retain the above copyright
  9. * notice, this list of conditions and the following disclaimer.
  10. *
  11. * Redistributions in binary form must reproduce the above copyright
  12. * notice, this list of conditions and the following disclaimer in the
  13. * documentation and/or other materials provided with the
  14. * distribution.
  15. *
  16. * Neither the name of Texas Instruments Incorporated nor the names of
  17. * its contributors may be used to endorse or promote products derived
  18. * from this software without specific prior written permission.
  19. *
  20. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  21. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  22. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  23. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  24. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  25. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  26. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  27. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  28. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  29. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  30. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  31. *
  32. */
  33. #ifndef CSLR_RNG_H_
  34. #define CSLR_RNG_H_
  35. #ifdef __cplusplus
  36. extern "C"
  37. {
  38. #endif
  39. #include <ti/csl/cslr.h>
  40. #include <ti/csl/tistdtypes.h>
  41. /**************************************************************************
  42. * Register Overlay Structure for __ALL__
  43. **************************************************************************/
  44. typedef struct {
  45. volatile Uint32 TRNG_OUTPUT_L;
  46. volatile Uint32 TRNG_OUTPUT_H;
  47. volatile Uint32 TRNG_STATUS;
  48. volatile Uint32 TRNG_INTMASK;
  49. volatile Uint32 TRNG_INTACK;
  50. volatile Uint32 TRNG_CONTROL;
  51. volatile Uint32 TRNG_CONFIG;
  52. volatile Uint32 TRNG_ALARMCNT;
  53. volatile Uint32 TRNG_FROENABLE;
  54. volatile Uint32 TRNG_FRODETUNE;
  55. volatile Uint32 TRNG_ALARMMASK;
  56. volatile Uint32 TRNG_ALARMSTOP;
  57. volatile Uint32 TRNG_LFSR_L;
  58. volatile Uint32 TRNG_LFSR_M;
  59. volatile Uint32 TRNG_LFSR_H;
  60. volatile Uint32 TRNG_COUNT;
  61. volatile Uint32 TRNG_TEST;
  62. volatile Uint8 RSVD0[52];
  63. volatile Uint32 TRNG_OPTIONS;
  64. volatile Uint32 TRNG_EIP_REV;
  65. volatile Uint8 RSVD1[8024];
  66. volatile Uint32 MMR_STATUS_EN;
  67. volatile Uint8 RSVD2[4];
  68. volatile Uint32 TRNG_REV;
  69. volatile Uint32 SYS_CONFIG_REG;
  70. volatile Uint8 RSVD3[4];
  71. volatile Uint32 MMR_STATUS_SET;
  72. volatile Uint32 SOFT_RESET_REG;
  73. volatile Uint32 IRQ_EOI_REG;
  74. volatile Uint32 TRNG_IRQSTATUS;
  75. } CSL_RngRegs;
  76. /**************************************************************************
  77. * Register Macros
  78. **************************************************************************/
  79. /* Output register for LSW randon number read access to LSW of 64-bit random
  80. * number */
  81. #define CSL_RNG_TRNG_OUTPUT_L (0x0U)
  82. /* To Read MSW of Random Number read access to MSW of 64-bit random number */
  83. #define CSL_RNG_TRNG_OUTPUT_H (0x4U)
  84. /* Status register */
  85. #define CSL_RNG_TRNG_STATUS (0x8U)
  86. /* Interrupt mask register */
  87. #define CSL_RNG_TRNG_INTMASK (0xCU)
  88. /* Interrupt acknowledge register */
  89. #define CSL_RNG_TRNG_INTACK (0x10U)
  90. /* Control register */
  91. #define CSL_RNG_TRNG_CONTROL (0x14U)
  92. /* Contains the seed */
  93. #define CSL_RNG_TRNG_CONFIG (0x18U)
  94. /* Shutdown interr cntrl registers */
  95. #define CSL_RNG_TRNG_ALARMCNT (0x1CU)
  96. /* FRO enable register */
  97. #define CSL_RNG_TRNG_FROENABLE (0x20U)
  98. /* FRO de-tune bits register */
  99. #define CSL_RNG_TRNG_FRODETUNE (0x24U)
  100. /* Alarm event log register */
  101. #define CSL_RNG_TRNG_ALARMMASK (0x28U)
  102. /* Alarm shutdown register */
  103. #define CSL_RNG_TRNG_ALARMSTOP (0x2CU)
  104. /* Main LFSR bits [31:0] */
  105. #define CSL_RNG_TRNG_LFSR_L (0x30U)
  106. /* Main LFSR bits [63:32] */
  107. #define CSL_RNG_TRNG_LFSR_M (0x34U)
  108. /* Main LFSR bits [80:64] */
  109. #define CSL_RNG_TRNG_LFSR_H (0x38U)
  110. /* Revision number */
  111. #define CSL_RNG_TRNG_COUNT (0x3CU)
  112. /* Engine options information */
  113. #define CSL_RNG_TRNG_TEST (0x40U)
  114. /* Engine options information */
  115. #define CSL_RNG_TRNG_OPTIONS (0x78U)
  116. /* EIP number and core revision */
  117. #define CSL_RNG_TRNG_EIP_REV (0x7CU)
  118. /* A read only reg indicating the Overall interrupt status */
  119. #define CSL_RNG_MMR_STATUS_EN (0x1FD8U)
  120. /* EIP-75t Module revision number */
  121. #define CSL_RNG_TRNG_REV (0x1FE0U)
  122. /* SYS_CONFIG_REG */
  123. #define CSL_RNG_SYS_CONFIG_REG (0x1FE4U)
  124. /* A read write register where the contents of mmr_status_raw can be read from
  125. * this address. */
  126. #define CSL_RNG_MMR_STATUS_SET (0x1FECU)
  127. /* SOFT_RESET_REG */
  128. #define CSL_RNG_SOFT_RESET_REG (0x1FF0U)
  129. /* To clear top_intr_req */
  130. #define CSL_RNG_IRQ_EOI_REG (0x1FF4U)
  131. /* Interrupt Status */
  132. #define CSL_RNG_TRNG_IRQSTATUS (0x1FF8U)
  133. /**************************************************************************
  134. * Field Definition Macros
  135. **************************************************************************/
  136. /* TRNG_OUTPUT_L */
  137. #define CSL_RNG_TRNG_OUTPUT_L_RNG_OUT_L_MASK (0xFFFFFFFFU)
  138. #define CSL_RNG_TRNG_OUTPUT_L_RNG_OUT_L_SHIFT (0U)
  139. #define CSL_RNG_TRNG_OUTPUT_L_RNG_OUT_L_RESETVAL (0x00000000U)
  140. #define CSL_RNG_TRNG_OUTPUT_L_RNG_OUT_L_MAX (0xffffffffU)
  141. #define CSL_RNG_TRNG_OUTPUT_L_RESETVAL (0x00000000U)
  142. /* TRNG_OUTPUT_H */
  143. #define CSL_RNG_TRNG_OUTPUT_H_RNG_OUT_H_MASK (0xFFFFFFFFU)
  144. #define CSL_RNG_TRNG_OUTPUT_H_RNG_OUT_H_SHIFT (0U)
  145. #define CSL_RNG_TRNG_OUTPUT_H_RNG_OUT_H_RESETVAL (0x00000000U)
  146. #define CSL_RNG_TRNG_OUTPUT_H_RNG_OUT_H_MAX (0xffffffffU)
  147. #define CSL_RNG_TRNG_OUTPUT_H_RESETVAL (0x00000000U)
  148. /* TRNG_STATUS */
  149. #define CSL_RNG_TRNG_STATUS_READY_MASK (0x00000001U)
  150. #define CSL_RNG_TRNG_STATUS_READY_SHIFT (0U)
  151. #define CSL_RNG_TRNG_STATUS_READY_RESETVAL (0x00000000U)
  152. #define CSL_RNG_TRNG_STATUS_READY_MAX (0x00000001U)
  153. #define CSL_RNG_TRNG_STATUS_SHUTDOWN_OFLO_MASK (0x00000002U)
  154. #define CSL_RNG_TRNG_STATUS_SHUTDOWN_OFLO_SHIFT (1U)
  155. #define CSL_RNG_TRNG_STATUS_SHUTDOWN_OFLO_RESETVAL (0x00000000U)
  156. #define CSL_RNG_TRNG_STATUS_SHUTDOWN_OFLO_MAX (0x00000001U)
  157. #define CSL_RNG_TRNG_STATUS_NEED_CLOCK_MASK (0x80000000U)
  158. #define CSL_RNG_TRNG_STATUS_NEED_CLOCK_SHIFT (31U)
  159. #define CSL_RNG_TRNG_STATUS_NEED_CLOCK_RESETVAL (0x00000000U)
  160. #define CSL_RNG_TRNG_STATUS_NEED_CLOCK_MAX (0x00000001U)
  161. #define CSL_RNG_TRNG_STATUS_RESETVAL (0x00000000U)
  162. /* TRNG_INTMASK */
  163. #define CSL_RNG_TRNG_INTMASK_READY_MASK (0x00000001U)
  164. #define CSL_RNG_TRNG_INTMASK_READY_SHIFT (0U)
  165. #define CSL_RNG_TRNG_INTMASK_READY_RESETVAL (0x00000000U)
  166. #define CSL_RNG_TRNG_INTMASK_READY_MAX (0x00000001U)
  167. #define CSL_RNG_TRNG_INTMASK_SHUTDOWN_OFLO_MASK (0x00000002U)
  168. #define CSL_RNG_TRNG_INTMASK_SHUTDOWN_OFLO_SHIFT (1U)
  169. #define CSL_RNG_TRNG_INTMASK_SHUTDOWN_OFLO_RESETVAL (0x00000000U)
  170. #define CSL_RNG_TRNG_INTMASK_SHUTDOWN_OFLO_MAX (0x00000001U)
  171. #define CSL_RNG_TRNG_INTMASK_RESETVAL (0x00000000U)
  172. /* TRNG_INTACK */
  173. #define CSL_RNG_TRNG_INTACK_READY_MASK (0x00000001U)
  174. #define CSL_RNG_TRNG_INTACK_READY_SHIFT (0U)
  175. #define CSL_RNG_TRNG_INTACK_READY_RESETVAL (0x00000000U)
  176. #define CSL_RNG_TRNG_INTACK_READY_MAX (0x00000001U)
  177. #define CSL_RNG_TRNG_INTACK_SHUTDOWN_OFLO_MASK (0x00000002U)
  178. #define CSL_RNG_TRNG_INTACK_SHUTDOWN_OFLO_SHIFT (1U)
  179. #define CSL_RNG_TRNG_INTACK_SHUTDOWN_OFLO_RESETVAL (0x00000000U)
  180. #define CSL_RNG_TRNG_INTACK_SHUTDOWN_OFLO_MAX (0x00000001U)
  181. #define CSL_RNG_TRNG_INTACK_RESETVAL (0x00000000U)
  182. /* TRNG_CONTROL */
  183. #define CSL_RNG_TRNG_CONTROL_TEST_MODE_MASK (0x00000002U)
  184. #define CSL_RNG_TRNG_CONTROL_TEST_MODE_SHIFT (1U)
  185. #define CSL_RNG_TRNG_CONTROL_TEST_MODE_RESETVAL (0x00000000U)
  186. #define CSL_RNG_TRNG_CONTROL_TEST_MODE_MAX (0x00000001U)
  187. #define CSL_RNG_TRNG_CONTROL_NO_LFSR_FB_MASK (0x00000004U)
  188. #define CSL_RNG_TRNG_CONTROL_NO_LFSR_FB_SHIFT (2U)
  189. #define CSL_RNG_TRNG_CONTROL_NO_LFSR_FB_RESETVAL (0x00000000U)
  190. #define CSL_RNG_TRNG_CONTROL_NO_LFSR_FB_MAX (0x00000001U)
  191. #define CSL_RNG_TRNG_CONTROL_ENABLE_TRNG_MASK (0x00000400U)
  192. #define CSL_RNG_TRNG_CONTROL_ENABLE_TRNG_SHIFT (10U)
  193. #define CSL_RNG_TRNG_CONTROL_ENABLE_TRNG_RESETVAL (0x00000000U)
  194. #define CSL_RNG_TRNG_CONTROL_ENABLE_TRNG_MAX (0x00000001U)
  195. #define CSL_RNG_TRNG_CONTROL_STARTUP_CYCLES_MASK (0xFFFF0000U)
  196. #define CSL_RNG_TRNG_CONTROL_STARTUP_CYCLES_SHIFT (16U)
  197. #define CSL_RNG_TRNG_CONTROL_STARTUP_CYCLES_RESETVAL (0x00000000U)
  198. #define CSL_RNG_TRNG_CONTROL_STARTUP_CYCLES_MAX (0x0000ffffU)
  199. #define CSL_RNG_TRNG_CONTROL_RESETVAL (0x00000000U)
  200. /* TRNG_CONFIG */
  201. #define CSL_RNG_TRNG_CONFIG_MIN_REFILL_CYCLES_MASK (0x000000FFU)
  202. #define CSL_RNG_TRNG_CONFIG_MIN_REFILL_CYCLES_SHIFT (0U)
  203. #define CSL_RNG_TRNG_CONFIG_MIN_REFILL_CYCLES_RESETVAL (0x00000000U)
  204. #define CSL_RNG_TRNG_CONFIG_MIN_REFILL_CYCLES_MAX (0x000000ffU)
  205. #define CSL_RNG_TRNG_CONFIG_SAMPLE_DIV_MASK (0x00000F00U)
  206. #define CSL_RNG_TRNG_CONFIG_SAMPLE_DIV_SHIFT (8U)
  207. #define CSL_RNG_TRNG_CONFIG_SAMPLE_DIV_RESETVAL (0x00000000U)
  208. #define CSL_RNG_TRNG_CONFIG_SAMPLE_DIV_MAX (0x0000000fU)
  209. #define CSL_RNG_TRNG_CONFIG_MAX_REFILL_CYCLES_MASK (0xFFFF0000U)
  210. #define CSL_RNG_TRNG_CONFIG_MAX_REFILL_CYCLES_SHIFT (16U)
  211. #define CSL_RNG_TRNG_CONFIG_MAX_REFILL_CYCLES_RESETVAL (0x00000000U)
  212. #define CSL_RNG_TRNG_CONFIG_MAX_REFILL_CYCLES_MAX (0x0000ffffU)
  213. #define CSL_RNG_TRNG_CONFIG_RESETVAL (0x00000000U)
  214. /* TRNG_ALARMCNT */
  215. #define CSL_RNG_TRNG_ALARMCNT_ALARM_THRESHOLD_MASK (0x000000FFU)
  216. #define CSL_RNG_TRNG_ALARMCNT_ALARM_THRESHOLD_SHIFT (0U)
  217. #define CSL_RNG_TRNG_ALARMCNT_ALARM_THRESHOLD_RESETVAL (0x000000ffU)
  218. #define CSL_RNG_TRNG_ALARMCNT_ALARM_THRESHOLD_MAX (0x000000ffU)
  219. #define CSL_RNG_TRNG_ALARMCNT_SHUTDOWN_THRESHOLD_MASK (0x001F0000U)
  220. #define CSL_RNG_TRNG_ALARMCNT_SHUTDOWN_THRESHOLD_SHIFT (16U)
  221. #define CSL_RNG_TRNG_ALARMCNT_SHUTDOWN_THRESHOLD_RESETVAL (0x00000000U)
  222. #define CSL_RNG_TRNG_ALARMCNT_SHUTDOWN_THRESHOLD_MAX (0x0000001fU)
  223. #define CSL_RNG_TRNG_ALARMCNT_SHUTDOWN_COUNT_MASK (0x3F000000U)
  224. #define CSL_RNG_TRNG_ALARMCNT_SHUTDOWN_COUNT_SHIFT (24U)
  225. #define CSL_RNG_TRNG_ALARMCNT_SHUTDOWN_COUNT_RESETVAL (0x00000000U)
  226. #define CSL_RNG_TRNG_ALARMCNT_SHUTDOWN_COUNT_MAX (0x0000003fU)
  227. #define CSL_RNG_TRNG_ALARMCNT_RESETVAL (0x000000ffU)
  228. /* TRNG_FROENABLE */
  229. #define CSL_RNG_TRNG_FROENABLE_FRO_ENABLES_MASK (0x00FFFFFFU)
  230. #define CSL_RNG_TRNG_FROENABLE_FRO_ENABLES_SHIFT (0U)
  231. #define CSL_RNG_TRNG_FROENABLE_FRO_ENABLES_RESETVAL (0x00ffffffU)
  232. #define CSL_RNG_TRNG_FROENABLE_FRO_ENABLES_MAX (0x00ffffffU)
  233. #define CSL_RNG_TRNG_FROENABLE_RESETVAL (0x00ffffffU)
  234. /* TRNG_FRODETUNE */
  235. #define CSL_RNG_TRNG_FRODETUNE_FRO_DETUNES_MASK (0x00FFFFFFU)
  236. #define CSL_RNG_TRNG_FRODETUNE_FRO_DETUNES_SHIFT (0U)
  237. #define CSL_RNG_TRNG_FRODETUNE_FRO_DETUNES_RESETVAL (0x00000000U)
  238. #define CSL_RNG_TRNG_FRODETUNE_FRO_DETUNES_MAX (0x00ffffffU)
  239. #define CSL_RNG_TRNG_FRODETUNE_RESETVAL (0x00000000U)
  240. /* TRNG_ALARMMASK */
  241. #define CSL_RNG_TRNG_ALARMMASK_FRO_ALARMMASKS_MASK (0x00FFFFFFU)
  242. #define CSL_RNG_TRNG_ALARMMASK_FRO_ALARMMASKS_SHIFT (0U)
  243. #define CSL_RNG_TRNG_ALARMMASK_FRO_ALARMMASKS_RESETVAL (0x00000000U)
  244. #define CSL_RNG_TRNG_ALARMMASK_FRO_ALARMMASKS_MAX (0x00ffffffU)
  245. #define CSL_RNG_TRNG_ALARMMASK_RESETVAL (0x00000000U)
  246. /* TRNG_ALARMSTOP */
  247. #define CSL_RNG_TRNG_ALARMSTOP_FRO_ALARMSTOPS_MASK (0x00FFFFFFU)
  248. #define CSL_RNG_TRNG_ALARMSTOP_FRO_ALARMSTOPS_SHIFT (0U)
  249. #define CSL_RNG_TRNG_ALARMSTOP_FRO_ALARMSTOPS_RESETVAL (0x00000000U)
  250. #define CSL_RNG_TRNG_ALARMSTOP_FRO_ALARMSTOPS_MAX (0x00ffffffU)
  251. #define CSL_RNG_TRNG_ALARMSTOP_RESETVAL (0x00000000U)
  252. /* TRNG_LFSR_L */
  253. #define CSL_RNG_TRNG_LFSR_L_LFSR_31_0_MASK (0xFFFFFFFFU)
  254. #define CSL_RNG_TRNG_LFSR_L_LFSR_31_0_SHIFT (0U)
  255. #define CSL_RNG_TRNG_LFSR_L_LFSR_31_0_RESETVAL (0x00000000U)
  256. #define CSL_RNG_TRNG_LFSR_L_LFSR_31_0_MAX (0xffffffffU)
  257. #define CSL_RNG_TRNG_LFSR_L_RESETVAL (0x00000000U)
  258. /* TRNG_LFSR_M */
  259. #define CSL_RNG_TRNG_LFSR_M_LFSR_63_32_MASK (0xFFFFFFFFU)
  260. #define CSL_RNG_TRNG_LFSR_M_LFSR_63_32_SHIFT (0U)
  261. #define CSL_RNG_TRNG_LFSR_M_LFSR_63_32_RESETVAL (0x00000000U)
  262. #define CSL_RNG_TRNG_LFSR_M_LFSR_63_32_MAX (0xffffffffU)
  263. #define CSL_RNG_TRNG_LFSR_M_RESETVAL (0x00000000U)
  264. /* TRNG_LFSR_H */
  265. #define CSL_RNG_TRNG_LFSR_H_LFSR_80_64_MASK (0xFFFFFFFFU)
  266. #define CSL_RNG_TRNG_LFSR_H_LFSR_80_64_SHIFT (0U)
  267. #define CSL_RNG_TRNG_LFSR_H_LFSR_80_64_RESETVAL (0x00000000U)
  268. #define CSL_RNG_TRNG_LFSR_H_LFSR_80_64_MAX (0xffffffffU)
  269. #define CSL_RNG_TRNG_LFSR_H_RESETVAL (0x00000000U)
  270. /* TRNG_COUNT */
  271. #define CSL_RNG_TRNG_COUNT_SAMPLE_COUNTER_MASK (0x00FFFFFFU)
  272. #define CSL_RNG_TRNG_COUNT_SAMPLE_COUNTER_SHIFT (0U)
  273. #define CSL_RNG_TRNG_COUNT_SAMPLE_COUNTER_RESETVAL (0x00000000U)
  274. #define CSL_RNG_TRNG_COUNT_SAMPLE_COUNTER_MAX (0x00ffffffU)
  275. #define CSL_RNG_TRNG_COUNT_RESETVAL (0x00000000U)
  276. /* TRNG_TEST */
  277. #define CSL_RNG_TRNG_TEST_TEST_EN_OUT_MASK (0x00000001U)
  278. #define CSL_RNG_TRNG_TEST_TEST_EN_OUT_SHIFT (0U)
  279. #define CSL_RNG_TRNG_TEST_TEST_EN_OUT_RESETVAL (0x00000000U)
  280. #define CSL_RNG_TRNG_TEST_TEST_EN_OUT_MAX (0x00000001U)
  281. #define CSL_RNG_TRNG_TEST_TEST_PATT_FRO_MASK (0x00000002U)
  282. #define CSL_RNG_TRNG_TEST_TEST_PATT_FRO_SHIFT (1U)
  283. #define CSL_RNG_TRNG_TEST_TEST_PATT_FRO_RESETVAL (0x00000000U)
  284. #define CSL_RNG_TRNG_TEST_TEST_PATT_FRO_MAX (0x00000001U)
  285. #define CSL_RNG_TRNG_TEST_TEST_PATT_DET_MASK (0x00000004U)
  286. #define CSL_RNG_TRNG_TEST_TEST_PATT_DET_SHIFT (2U)
  287. #define CSL_RNG_TRNG_TEST_TEST_PATT_DET_RESETVAL (0x00000000U)
  288. #define CSL_RNG_TRNG_TEST_TEST_PATT_DET_MAX (0x00000001U)
  289. #define CSL_RNG_TRNG_TEST_TEST_SELECT_MASK (0x00001F00U)
  290. #define CSL_RNG_TRNG_TEST_TEST_SELECT_SHIFT (8U)
  291. #define CSL_RNG_TRNG_TEST_TEST_SELECT_RESETVAL (0x00000000U)
  292. #define CSL_RNG_TRNG_TEST_TEST_SELECT_MAX (0x0000001fU)
  293. #define CSL_RNG_TRNG_TEST_TEST_PATTERN_MASK (0x0FFF0000U)
  294. #define CSL_RNG_TRNG_TEST_TEST_PATTERN_SHIFT (16U)
  295. #define CSL_RNG_TRNG_TEST_TEST_PATTERN_RESETVAL (0x00000000U)
  296. #define CSL_RNG_TRNG_TEST_TEST_PATTERN_MAX (0x00000fffU)
  297. #define CSL_RNG_TRNG_TEST_RESETVAL (0x00000000U)
  298. /* TRNG_OPTIONS */
  299. #define CSL_RNG_TRNG_OPTIONS_NR_OF_FROS_MASK (0x00000FC0U)
  300. #define CSL_RNG_TRNG_OPTIONS_NR_OF_FROS_SHIFT (6U)
  301. #define CSL_RNG_TRNG_OPTIONS_NR_OF_FROS_RESETVAL (0x00000018U)
  302. #define CSL_RNG_TRNG_OPTIONS_NR_OF_FROS_MAX (0x0000003fU)
  303. #define CSL_RNG_TRNG_OPTIONS_RESETVAL (0x00000600U)
  304. /* TRNG_EIP_REV */
  305. #define CSL_RNG_TRNG_EIP_REV_BASIC_EIP_NUMBER_MASK (0x000000FFU)
  306. #define CSL_RNG_TRNG_EIP_REV_BASIC_EIP_NUMBER_SHIFT (0U)
  307. #define CSL_RNG_TRNG_EIP_REV_BASIC_EIP_NUMBER_RESETVAL (0x0000004bU)
  308. #define CSL_RNG_TRNG_EIP_REV_BASIC_EIP_NUMBER_MAX (0x000000ffU)
  309. #define CSL_RNG_TRNG_EIP_REV_MAJOR_HW_REVISION_MASK (0x0F000000U)
  310. #define CSL_RNG_TRNG_EIP_REV_MAJOR_HW_REVISION_SHIFT (24U)
  311. #define CSL_RNG_TRNG_EIP_REV_MAJOR_HW_REVISION_RESETVAL (0x00000002U)
  312. #define CSL_RNG_TRNG_EIP_REV_MAJOR_HW_REVISION_MAX (0x0000000fU)
  313. #define CSL_RNG_TRNG_EIP_REV_HW_PATCH_LEVEL_MASK (0x000F0000U)
  314. #define CSL_RNG_TRNG_EIP_REV_HW_PATCH_LEVEL_SHIFT (16U)
  315. #define CSL_RNG_TRNG_EIP_REV_HW_PATCH_LEVEL_RESETVAL (0x00000000U)
  316. #define CSL_RNG_TRNG_EIP_REV_HW_PATCH_LEVEL_MAX (0x0000000fU)
  317. #define CSL_RNG_TRNG_EIP_REV_MINOR_HW_REVISION_MASK (0x00F00000U)
  318. #define CSL_RNG_TRNG_EIP_REV_MINOR_HW_REVISION_SHIFT (20U)
  319. #define CSL_RNG_TRNG_EIP_REV_MINOR_HW_REVISION_RESETVAL (0x00000000U)
  320. #define CSL_RNG_TRNG_EIP_REV_MINOR_HW_REVISION_MAX (0x0000000fU)
  321. #define CSL_RNG_TRNG_EIP_REV_COMPLEMENT_OF_BASIC_EIP_NUMBER_MASK (0x0000FF00U)
  322. #define CSL_RNG_TRNG_EIP_REV_COMPLEMENT_OF_BASIC_EIP_NUMBER_SHIFT (8U)
  323. #define CSL_RNG_TRNG_EIP_REV_COMPLEMENT_OF_BASIC_EIP_NUMBER_RESETVAL (0x000000b4U)
  324. #define CSL_RNG_TRNG_EIP_REV_COMPLEMENT_OF_BASIC_EIP_NUMBER_MAX (0x000000ffU)
  325. #define CSL_RNG_TRNG_EIP_REV_RESETVAL (0x0200b44bU)
  326. /* MMR_STATUS_EN */
  327. #define CSL_RNG_MMR_STATUS_EN_READY_MASK (0x00000001U)
  328. #define CSL_RNG_MMR_STATUS_EN_READY_SHIFT (0U)
  329. #define CSL_RNG_MMR_STATUS_EN_READY_RESETVAL (0x00000000U)
  330. #define CSL_RNG_MMR_STATUS_EN_READY_MAX (0x00000001U)
  331. #define CSL_RNG_MMR_STATUS_EN_SHUTDOWN_OFLO_MASK (0x00000002U)
  332. #define CSL_RNG_MMR_STATUS_EN_SHUTDOWN_OFLO_SHIFT (1U)
  333. #define CSL_RNG_MMR_STATUS_EN_SHUTDOWN_OFLO_RESETVAL (0x00000000U)
  334. #define CSL_RNG_MMR_STATUS_EN_SHUTDOWN_OFLO_MAX (0x00000001U)
  335. #define CSL_RNG_MMR_STATUS_EN_RESETVAL (0x00000000U)
  336. /* TRNG_REV */
  337. #define CSL_RNG_TRNG_REV_REVISION_MASK (0x000000FFU)
  338. #define CSL_RNG_TRNG_REV_REVISION_SHIFT (0U)
  339. #define CSL_RNG_TRNG_REV_REVISION_RESETVAL (0x00000020U)
  340. #define CSL_RNG_TRNG_REV_REVISION_MAX (0x000000ffU)
  341. #define CSL_RNG_TRNG_REV_RESETVAL (0x00000020U)
  342. /* SYS_CONFIG_REG */
  343. #define CSL_RNG_SYS_CONFIG_REG_IDLE_TYPE_MASK (0x00000018U)
  344. #define CSL_RNG_SYS_CONFIG_REG_IDLE_TYPE_SHIFT (3U)
  345. #define CSL_RNG_SYS_CONFIG_REG_IDLE_TYPE_RESETVAL (0x00000000U)
  346. #define CSL_RNG_SYS_CONFIG_REG_IDLE_TYPE_MAX (0x00000003U)
  347. #define CSL_RNG_SYS_CONFIG_REG_AUTOIDLE_MASK (0x00000001U)
  348. #define CSL_RNG_SYS_CONFIG_REG_AUTOIDLE_SHIFT (0U)
  349. #define CSL_RNG_SYS_CONFIG_REG_AUTOIDLE_RESETVAL (0x00000000U)
  350. #define CSL_RNG_SYS_CONFIG_REG_AUTOIDLE_MAX (0x00000001U)
  351. #define CSL_RNG_SYS_CONFIG_REG_RESETVAL (0x00000000U)
  352. /* MMR_STATUS_SET */
  353. #define CSL_RNG_MMR_STATUS_SET_SW_INTR_STATUS_SET_MASK (0x00000003U)
  354. #define CSL_RNG_MMR_STATUS_SET_SW_INTR_STATUS_SET_SHIFT (0U)
  355. #define CSL_RNG_MMR_STATUS_SET_SW_INTR_STATUS_SET_RESETVAL (0x00000000U)
  356. #define CSL_RNG_MMR_STATUS_SET_SW_INTR_STATUS_SET_MAX (0x00000003U)
  357. #define CSL_RNG_MMR_STATUS_SET_RESETVAL (0x00000000U)
  358. /* SOFT_RESET_REG */
  359. #define CSL_RNG_SOFT_RESET_REG_SOFT_RESET_MASK (0x00000001U)
  360. #define CSL_RNG_SOFT_RESET_REG_SOFT_RESET_SHIFT (0U)
  361. #define CSL_RNG_SOFT_RESET_REG_SOFT_RESET_RESETVAL (0x00000000U)
  362. #define CSL_RNG_SOFT_RESET_REG_SOFT_RESET_MAX (0x00000001U)
  363. #define CSL_RNG_SOFT_RESET_REG_RESETVAL (0x00000000U)
  364. /* IRQ_EOI_REG */
  365. #define CSL_RNG_IRQ_EOI_REG_PULSE_INT_CLEAR_MASK (0x00000001U)
  366. #define CSL_RNG_IRQ_EOI_REG_PULSE_INT_CLEAR_SHIFT (0U)
  367. #define CSL_RNG_IRQ_EOI_REG_PULSE_INT_CLEAR_RESETVAL (0x00000000U)
  368. #define CSL_RNG_IRQ_EOI_REG_PULSE_INT_CLEAR_MAX (0x00000001U)
  369. #define CSL_RNG_IRQ_EOI_REG_RESETVAL (0x00000000U)
  370. /* TRNG_IRQSTATUS */
  371. #define CSL_RNG_TRNG_IRQSTATUS_TRNGIRQEN_MASK (0x00000001U)
  372. #define CSL_RNG_TRNG_IRQSTATUS_TRNGIRQEN_SHIFT (0U)
  373. #define CSL_RNG_TRNG_IRQSTATUS_TRNGIRQEN_RESETVAL (0x00000000U)
  374. #define CSL_RNG_TRNG_IRQSTATUS_TRNGIRQEN_MAX (0x00000001U)
  375. #define CSL_RNG_TRNG_IRQSTATUS_RESETVAL (0x00000000U)
  376. #ifdef __cplusplus
  377. }
  378. #endif
  379. #endif