ce_sec.h 56 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432
  1. /* Copyright (C) 2018 RDA Technologies Limited and/or its affiliates("RDA").
  2. * All rights reserved.
  3. *
  4. * This software is supplied "AS IS" without any warranties.
  5. * RDA assumes no responsibility or liability for the use of the software,
  6. * conveys no license or title under any patent, copyright, or mask work
  7. * right to the product. RDA reserves the right to make changes in the
  8. * software without notification. RDA also make no representation or
  9. * warranty that such application will be suitable for the specified use
  10. * without further testing or modification.
  11. */
  12. #ifndef _CE_SEC_H_
  13. #define _CE_SEC_H_
  14. // Auto generated by dtools(see dtools.txt for its version).
  15. // Don't edit it manually!
  16. #define REG_CE_SEC_BASE (0x04004000)
  17. typedef volatile struct
  18. {
  19. uint32_t ce_debug_dma_status; // 0x00000000
  20. uint32_t ce_debug_aes_status; // 0x00000004
  21. uint32_t ce_debug_tdes_status; // 0x00000008
  22. uint32_t ce_debug_hash_status0; // 0x0000000c
  23. uint32_t ce_debug_hash_status1; // 0x00000010
  24. uint32_t __20[1]; // 0x00000014
  25. uint32_t ce_clk_en; // 0x00000018
  26. uint32_t ce_int_en; // 0x0000001c
  27. uint32_t ce_int_status; // 0x00000020
  28. uint32_t ce_int_clear; // 0x00000024
  29. uint32_t ce_start; // 0x00000028
  30. uint32_t ce_clear; // 0x0000002c
  31. uint32_t ce_aes_mode; // 0x00000030
  32. uint32_t ce_tdes_mode; // 0x00000034
  33. uint32_t ce_hash_mode; // 0x00000038
  34. uint32_t ce_chacha_poly_mode; // 0x0000003c
  35. uint32_t ce_simon_speck_mode; // 0x00000040
  36. uint32_t ce_cfg; // 0x00000044
  37. uint32_t ce_src_frag_length; // 0x00000048
  38. uint32_t ce_dst_frag_length; // 0x0000004c
  39. uint32_t ce_src_addr; // 0x00000050
  40. uint32_t ce_dst_addr; // 0x00000054
  41. uint32_t ce_list_length; // 0x00000058
  42. uint32_t ce_list_ptr; // 0x0000005c
  43. uint32_t ce_aes_tdes_rsa_key_length; // 0x00000060
  44. uint32_t ce_aes_tdes_rsa_key_address; // 0x00000064
  45. uint32_t ce_aes_tag_length; // 0x00000068
  46. uint32_t ce_aes_tag_address; // 0x0000006c
  47. uint32_t ce_iv_sec_cnt0; // 0x00000070
  48. uint32_t ce_iv_sec_cnt1; // 0x00000074
  49. uint32_t ce_iv_sec_cnt2; // 0x00000078
  50. uint32_t ce_iv_sec_cnt3; // 0x0000007c
  51. uint32_t ce_aes_des_key10; // 0x00000080
  52. uint32_t ce_aes_des_key11; // 0x00000084
  53. uint32_t ce_aes_des_key12; // 0x00000088
  54. uint32_t ce_aes_des_key13; // 0x0000008c
  55. uint32_t ce_aes_des_key14; // 0x00000090
  56. uint32_t ce_aes_des_key15; // 0x00000094
  57. uint32_t ce_aes_des_key16; // 0x00000098
  58. uint32_t ce_aes_des_key17; // 0x0000009c
  59. uint32_t ce_aes_des_key20; // 0x000000a0
  60. uint32_t ce_aes_des_key21; // 0x000000a4
  61. uint32_t ce_aes_des_key22; // 0x000000a8
  62. uint32_t ce_aes_des_key23; // 0x000000ac
  63. uint32_t ce_aes_des_key24; // 0x000000b0
  64. uint32_t ce_aes_des_key25; // 0x000000b4
  65. uint32_t ce_aes_des_key26; // 0x000000b8
  66. uint32_t ce_aes_des_key27; // 0x000000bc
  67. uint32_t ce_sm4_mode; // 0x000000c0
  68. uint32_t __196[1]; // 0x000000c4
  69. uint32_t ce_ip_version; // 0x000000c8
  70. uint32_t ce_pka_mode; // 0x000000cc
  71. uint32_t ce_pka_reg_length01; // 0x000000d0
  72. uint32_t ce_pka_reg_length23; // 0x000000d4
  73. uint32_t __216[22]; // 0x000000d8
  74. uint32_t ce_pka_inst_pc; // 0x00000130
  75. uint32_t ce_pka_debug0; // 0x00000134
  76. uint32_t ce_pka_debug1; // 0x00000138
  77. uint32_t ce_pka_debug2; // 0x0000013c
  78. uint32_t ce_pka_debug3; // 0x00000140
  79. uint32_t __324[3]; // 0x00000144
  80. uint32_t ce_pf_calc; // 0x00000150
  81. uint32_t ce_user_flag; // 0x00000154
  82. uint32_t ce_axi_axcache; // 0x00000158
  83. uint32_t ce_cmd_stop_ctrl; // 0x0000015c
  84. uint32_t ce_axi_protect_sel; // 0x00000160
  85. uint32_t ce_pf_calc_high; // 0x00000164
  86. uint32_t __360[38]; // 0x00000168
  87. uint32_t ce_rng_en; // 0x00000200
  88. uint32_t ce_rng_config; // 0x00000204
  89. uint32_t ce_rng_data; // 0x00000208
  90. uint32_t ce_rng_sample_period; // 0x0000020c
  91. uint32_t ce_rng_post_process_en; // 0x00000210
  92. uint32_t ce_rng_work_status; // 0x00000214
  93. uint32_t ce_rng_timeout_cnt; // 0x00000218
  94. uint32_t ce_rng_int_en; // 0x0000021c
  95. uint32_t ce_rng_sts; // 0x00000220
  96. uint32_t ce_rng_int_clr; // 0x00000224
  97. uint32_t ce_rng_mode; // 0x00000228
  98. uint32_t ce_prng_seed_update; // 0x0000022c
  99. uint32_t ce_prng_seed_config; // 0x00000230
  100. uint32_t ce_rng_bit_rate; // 0x00000234
  101. uint32_t ce_rng_sram_data_threshhold; // 0x00000238
  102. uint32_t ce_rng_sram_data_residue_num; // 0x0000023c
  103. uint32_t ce_rng_exotic_fault_counter_config; // 0x00000240
  104. uint32_t ce_rng_drbg_seed_cnt; // 0x00000244
  105. uint32_t ce_rng_ring_num_cfg_l; // 0x00000248
  106. uint32_t ce_rng_ring_num_cfg_h; // 0x0000024c
  107. uint32_t ce_rng_health_test_config; // 0x00000250
  108. uint32_t ce_rng_drbg_test_pattern_l; // 0x00000254
  109. uint32_t ce_rng_drbg_test_pattern_h; // 0x00000258
  110. uint32_t ce_rng_raw_data_to_cpu; // 0x0000025c
  111. uint32_t ce_rng_drbg_test_result; // 0x00000260
  112. uint32_t __612[39]; // 0x00000264
  113. uint32_t ce_session_key0; // 0x00000300
  114. uint32_t ce_session_key1; // 0x00000304
  115. uint32_t ce_session_key2; // 0x00000308
  116. uint32_t ce_session_key3; // 0x0000030c
  117. uint32_t ce_session_key4; // 0x00000310
  118. uint32_t ce_session_key5; // 0x00000314
  119. uint32_t ce_session_key6; // 0x00000318
  120. uint32_t ce_session_key7; // 0x0000031c
  121. uint32_t ce_iram_key0; // 0x00000320
  122. uint32_t ce_iram_key1; // 0x00000324
  123. uint32_t ce_iram_key2; // 0x00000328
  124. uint32_t ce_iram_key3; // 0x0000032c
  125. uint32_t ce_iram_key4; // 0x00000330
  126. uint32_t ce_iram_key5; // 0x00000334
  127. uint32_t ce_iram_key6; // 0x00000338
  128. uint32_t ce_iram_key7; // 0x0000033c
  129. uint32_t ce_secure_key_use_way; // 0x00000340
  130. uint32_t ce_huk_key_config; // 0x00000344
  131. uint32_t ce_pka_key_config; // 0x00000348
  132. uint32_t __844[109]; // 0x0000034c
  133. uint32_t ce_cmd_fifo_entry; // 0x00000500
  134. uint32_t ce_cmd_fifo_status; // 0x00000504
  135. uint32_t ce_rcv_addr_lo; // 0x00000508
  136. uint32_t ce_dump_addr_lo; // 0x0000050c
  137. uint32_t ce_dump_addr_hi; // 0x00000510
  138. uint32_t ce_finish_cmd_cnt; // 0x00000514
  139. uint32_t __1304[58]; // 0x00000518
  140. uint32_t ce_pka_cmd_fifo_entry; // 0x00000600
  141. uint32_t ce_pka_cmd_fifo_status; // 0x00000604
  142. uint32_t ce_pka_cmd_addr; // 0x00000608
  143. uint32_t ce_pka_store_addr_hi; // 0x0000060c
  144. uint32_t ce_pka_load_addr_hi; // 0x00000610
  145. uint32_t ce_pka_finish_cmd_cnt; // 0x00000614
  146. uint32_t ce_pka_start; // 0x00000618
  147. uint32_t ce_pka_clear; // 0x0000061c
  148. uint32_t __1568[1]; // 0x00000620
  149. uint32_t ce_pka_rng_force_ssb_bit; // 0x00000624
  150. uint32_t ce_pka_ctrl_operate_bit; // 0x00000628
  151. uint32_t ce_pka_efs_debug_status; // 0x0000062c
  152. } HWP_CE_SEC_T;
  153. #define hwp_ceSec ((HWP_CE_SEC_T *)REG_ACCESS_ADDRESS(REG_CE_SEC_BASE))
  154. // ce_debug_dma_status
  155. typedef union {
  156. uint32_t v;
  157. struct
  158. {
  159. uint32_t rf_ce_dma_main_read_state : 5; // [4:0], read only
  160. uint32_t rf_ce_dma_pka_main_read_state : 3; // [7:5], read only
  161. uint32_t rf_ce_dma_main_write_state : 5; // [12:8], read only
  162. uint32_t rf_ce_dma_err : 1; // [13], read only
  163. uint32_t rf_ce_int_raw_status_vld : 1; // [14], read only
  164. uint32_t rf_ce_cmd_fifo_non_empty : 1; // [15], read only
  165. uint32_t rf_ce_pka_cmd_fifo_non_empty : 1; // [16], read only
  166. uint32_t rf_ce_dma_src_state : 5; // [21:17], read only
  167. uint32_t rf_ce_dma_dst_state : 5; // [26:22], read only
  168. uint32_t __27_27 : 1; // [27]
  169. uint32_t rf_ce_busy : 1; // [28], read only
  170. uint32_t rf_ce_arready : 1; // [29], read only
  171. uint32_t rf_ce_awready : 1; // [30], read only
  172. uint32_t rf_ce_wready : 1; // [31], read only
  173. } b;
  174. } REG_CE_SEC_CE_DEBUG_DMA_STATUS_T;
  175. // ce_debug_aes_status
  176. typedef union {
  177. uint32_t v;
  178. struct
  179. {
  180. uint32_t rf_ce_aes_status : 8; // [7:0], read only
  181. uint32_t __9_8 : 2; // [9:8]
  182. uint32_t rf_ce_wdma_data_status : 2; // [11:10], read only
  183. uint32_t rf_ce_sm4_status : 3; // [14:12], read only
  184. uint32_t rf_ce_rdma_data_status : 3; // [17:15], read only
  185. uint32_t __19_18 : 2; // [19:18]
  186. uint32_t rf_ce_fde_dma_main_read_state : 5; // [24:20], read only
  187. uint32_t rf_ce_fde_wdma_data_status : 2; // [26:25], read only
  188. uint32_t rf_ce_fde_rdma_data_status : 2; // [28:27], read only
  189. uint32_t __31_29 : 3; // [31:29]
  190. } b;
  191. } REG_CE_SEC_CE_DEBUG_AES_STATUS_T;
  192. // ce_debug_tdes_status
  193. typedef union {
  194. uint32_t v;
  195. struct
  196. {
  197. uint32_t rf_ce_fde_aes_status : 8; // [7:0], read only
  198. uint32_t rf_ce_fde_dma_main_write_state : 5; // [12:8], read only
  199. uint32_t rf_ce_pka_dma_main_write_state : 3; // [15:13], read only
  200. uint32_t rf_ce_efuse_access_status : 5; // [20:16], read only
  201. uint32_t rf_ce_dma_wvalid_state : 4; // [24:21], read only
  202. uint32_t rf_ce_tdes_status : 5; // [29:25], read only
  203. uint32_t __31_30 : 2; // [31:30]
  204. } b;
  205. } REG_CE_SEC_CE_DEBUG_TDES_STATUS_T;
  206. // ce_debug_hash_status1
  207. typedef union {
  208. uint32_t v;
  209. struct
  210. {
  211. uint32_t rf_ce_hash_status1 : 10; // [9:0], read only
  212. uint32_t __31_10 : 22; // [31:10]
  213. } b;
  214. } REG_CE_SEC_CE_DEBUG_HASH_STATUS1_T;
  215. // ce_clk_en
  216. typedef union {
  217. uint32_t v;
  218. struct
  219. {
  220. uint32_t rf_ce_dma_ck_en : 1; // [0]
  221. uint32_t rf_ce_aes_ck_en : 1; // [1]
  222. uint32_t rf_ce_fde_aes_ck_en : 1; // [2]
  223. uint32_t rf_ce_hash_ck_en : 1; // [3]
  224. uint32_t rf_ce_des_ck_en : 1; // [4]
  225. uint32_t rf_ce_trng_ck_en : 1; // [5]
  226. uint32_t rf_ce_sm4_ck_en : 1; // [6]
  227. uint32_t rf_ce_chacah_poly_ck_en : 1; // [7]
  228. uint32_t rf_ce_pka_ck_en : 1; // [8]
  229. uint32_t rf_ce_simon_speck_ck_en : 1; // [9]
  230. uint32_t __15_10 : 6; // [15:10]
  231. uint32_t rf_ce_apb_rf_clk_en : 1; // [16]
  232. uint32_t rf_ce_dma_ctrl_clk_en : 1; // [17]
  233. uint32_t rf_ce_dma_axi_clk_en : 1; // [18]
  234. uint32_t __19_19 : 1; // [19]
  235. uint32_t rf_ce_aes_clk_en : 1; // [20]
  236. uint32_t rf_ce_rng_clk_en : 1; // [21]
  237. uint32_t rf_ce_poly_clk_en : 1; // [22]
  238. uint32_t rf_ce_chacha_clk_en : 1; // [23]
  239. uint32_t rf_ce_trng_pub_clk_en : 1; // [24]
  240. uint32_t rf_ce_rng_pub_clk_en : 1; // [25]
  241. uint32_t __27_26 : 2; // [27:26]
  242. uint32_t rf_ce_fde_aes_clk_en : 1; // [28]
  243. uint32_t __31_29 : 3; // [31:29]
  244. } b;
  245. } REG_CE_SEC_CE_CLK_EN_T;
  246. // ce_int_en
  247. typedef union {
  248. uint32_t v;
  249. struct
  250. {
  251. uint32_t rf_ce_en_cmd_done_int : 1; // [0]
  252. uint32_t rf_ce_en_efs_huk_unstable_int : 1; // [1]
  253. uint32_t rf_ce_en_efs_all_zero_int : 1; // [2]
  254. uint32_t __3_3 : 1; // [3]
  255. uint32_t rf_ce_en_len_err_int : 1; // [4]
  256. uint32_t rf_ce_en_tdes_key_err_int : 1; // [5]
  257. uint32_t __6_6 : 1; // [6]
  258. uint32_t rf_ce_en_rng_int : 1; // [7]
  259. uint32_t rf_ce_en_pka_store_done_int : 1; // [8]
  260. uint32_t rf_ce_en_pka_one_cmd_done_int : 1; // [9]
  261. uint32_t rf_ce_en_use_efuse_err_int : 1; // [10]
  262. uint32_t rf_ce_en_pka_div_zero_err_int : 1; // [11]
  263. uint32_t rf_ce_en_pka_find_prime_err_int : 1; // [12]
  264. uint32_t rf_ce_en_pka_cmd_done_done_int : 1; // [13]
  265. uint32_t rf_ce_en_pka_len_err_int : 1; // [14]
  266. uint32_t rf_ce_en_pka_wr_efuse_key_addr_int : 1; // [15]
  267. uint32_t rf_ce_en_pka_rd_efuse_key_addr_int : 1; // [16]
  268. uint32_t __31_17 : 15; // [31:17]
  269. } b;
  270. } REG_CE_SEC_CE_INT_EN_T;
  271. // ce_int_status
  272. typedef union {
  273. uint32_t v;
  274. struct
  275. {
  276. uint32_t rf_ce_cmd_done_int_status : 1; // [0], read only
  277. uint32_t rf_ce_efs_huk_unstable_int_status : 1; // [1], read only
  278. uint32_t rf_ce_efs_all_zero_int_status : 1; // [2], read only
  279. uint32_t __3_3 : 1; // [3]
  280. uint32_t rf_ce_len_err_int_status : 1; // [4], read only
  281. uint32_t rf_ce_tdes_key_err_int_status : 1; // [5], read only
  282. uint32_t __6_6 : 1; // [6]
  283. uint32_t rf_ce_rng_int_status : 1; // [7], read only
  284. uint32_t rf_ce_pka_store_done_flag : 1; // [8], read only
  285. uint32_t rf_ce_pka_one_cmd_done_flag : 1; // [9], read only
  286. uint32_t rf_ce_use_efuse_err_flag : 1; // [10], read only
  287. uint32_t rf_ce_pka_div_zero_err_flag : 1; // [11], read only
  288. uint32_t rf_ce_pka_find_prime_err_flag : 1; // [12], read only
  289. uint32_t rf_ce_pka_cmd_done_done_int_status : 1; // [13], read only
  290. uint32_t rf_ce_pka_len_err_int_status : 1; // [14], read only
  291. uint32_t rf_ce_pka_wr_efuse_key_addr_int_status : 1; // [15], read only
  292. uint32_t rf_ce_pka_rd_efuse_key_addr_int_status : 1; // [16], read only
  293. uint32_t __31_17 : 15; // [31:17]
  294. } b;
  295. } REG_CE_SEC_CE_INT_STATUS_T;
  296. // ce_int_clear
  297. typedef union {
  298. uint32_t v;
  299. struct
  300. {
  301. uint32_t rf_ce_clear_cmd_done_int : 1; // [0], write clear
  302. uint32_t rf_ce_clear_efs_huk_unstable_int : 1; // [1], write clear
  303. uint32_t rf_ce_clear_efs_all_zero_int : 1; // [2], write clear
  304. uint32_t __3_3 : 1; // [3]
  305. uint32_t rf_ce_clear_len_err_int : 1; // [4], write clear
  306. uint32_t rf_ce_clear_tdes_key_err_int : 1; // [5], write clear
  307. uint32_t __7_6 : 2; // [7:6]
  308. uint32_t rf_ce_clear_pka_store_done_int : 1; // [8], write clear
  309. uint32_t rf_ce_clear_pka_one_cmd_done_int : 1; // [9], write clear
  310. uint32_t rf_ce_clear_use_efuse_err_int : 1; // [10], write clear
  311. uint32_t rf_ce_clear_pka_div_zero_err_int : 1; // [11], write clear
  312. uint32_t rf_ce_clear_pka_find_prime_err_int : 1; // [12], write clear
  313. uint32_t rf_ce_clear_pka_cmd_done_done_int : 1; // [13], write clear
  314. uint32_t rf_ce_clear_pka_len_err_int : 1; // [14], write clear
  315. uint32_t rf_ce_clear_pka_wr_efuse_key_addr_int : 1; // [15], write clear
  316. uint32_t rf_ce_clear_pka_rd_efuse_key_addr_int : 1; // [16], write clear
  317. uint32_t __31_17 : 15; // [31:17]
  318. } b;
  319. } REG_CE_SEC_CE_INT_CLEAR_T;
  320. // ce_start
  321. typedef union {
  322. uint32_t v;
  323. struct
  324. {
  325. uint32_t rf_ce_start : 1; // [0], write clear
  326. uint32_t __31_1 : 31; // [31:1]
  327. } b;
  328. } REG_CE_SEC_CE_START_T;
  329. // ce_clear
  330. typedef union {
  331. uint32_t v;
  332. struct
  333. {
  334. uint32_t rf_ce_clear : 1; // [0], write clear
  335. uint32_t __31_1 : 31; // [31:1]
  336. } b;
  337. } REG_CE_SEC_CE_CLEAR_T;
  338. // ce_aes_mode
  339. typedef union {
  340. uint32_t v;
  341. struct
  342. {
  343. uint32_t rf_ce_aes_en : 1; // [0]
  344. uint32_t __3_1 : 3; // [3:1]
  345. uint32_t rf_ce_aes_enc_dec_sel : 1; // [4]
  346. uint32_t rf_ce_aes_mac_ctr_inc_mode : 2; // [6:5]
  347. uint32_t __7_7 : 1; // [7]
  348. uint32_t rf_ce_aes_work_mode : 4; // [11:8]
  349. uint32_t rf_ce_aes_key_len_sel : 2; // [13:12]
  350. uint32_t rf_ce_aes_xts_iv_rotation : 1; // [14]
  351. uint32_t rf_ce_aes_key_update_n : 1; // [15]
  352. uint32_t __31_16 : 16; // [31:16]
  353. } b;
  354. } REG_CE_SEC_CE_AES_MODE_T;
  355. // ce_tdes_mode
  356. typedef union {
  357. uint32_t v;
  358. struct
  359. {
  360. uint32_t rf_ce_tdes_en : 1; // [0]
  361. uint32_t __3_1 : 3; // [3:1]
  362. uint32_t rf_ce_tdes_enc_dec_sel : 1; // [4]
  363. uint32_t __7_5 : 3; // [7:5]
  364. uint32_t rf_ce_tdes_work_mode : 2; // [9:8]
  365. uint32_t __11_10 : 2; // [11:10]
  366. uint32_t rf_ce_tdes_key_even_sel : 1; // [12]
  367. uint32_t rf_ce_tdes_key_evenodd_check_on : 1; // [13]
  368. uint32_t __31_14 : 18; // [31:14]
  369. } b;
  370. } REG_CE_SEC_CE_TDES_MODE_T;
  371. // ce_hash_mode
  372. typedef union {
  373. uint32_t v;
  374. struct
  375. {
  376. uint32_t rf_ce_hash_en : 1; // [0]
  377. uint32_t __3_1 : 3; // [3:1]
  378. uint32_t rf_ce_hash_mode : 5; // [8:4]
  379. uint32_t __11_9 : 3; // [11:9]
  380. uint32_t rf_hash_hmac_pad_sel : 2; // [13:12]
  381. uint32_t __15_14 : 2; // [15:14]
  382. uint32_t rf_hash_sha3_shake_out_len : 8; // [23:16]
  383. uint32_t __31_24 : 8; // [31:24]
  384. } b;
  385. } REG_CE_SEC_CE_HASH_MODE_T;
  386. // ce_chacha_poly_mode
  387. typedef union {
  388. uint32_t v;
  389. struct
  390. {
  391. uint32_t rf_ce_chacha_poly_en : 1; // [0]
  392. uint32_t __3_1 : 3; // [3:1]
  393. uint32_t rf_ce_chacha_poly_enc_dec_sel : 1; // [4]
  394. uint32_t __7_5 : 3; // [7:5]
  395. uint32_t rf_ce_chacha_poly_mode : 2; // [9:8]
  396. uint32_t __31_10 : 22; // [31:10]
  397. } b;
  398. } REG_CE_SEC_CE_CHACHA_POLY_MODE_T;
  399. // ce_simon_speck_mode
  400. typedef union {
  401. uint32_t v;
  402. struct
  403. {
  404. uint32_t rf_ce_simon_speck_en : 1; // [0]
  405. uint32_t __3_1 : 3; // [3:1]
  406. uint32_t rf_ce_simon_speck_enc_dec_sel : 1; // [4]
  407. uint32_t __7_5 : 3; // [7:5]
  408. uint32_t rf_ce_simon_speck_sel : 1; // [8]
  409. uint32_t rf_ce_simon_speck_work_mode : 3; // [11:9]
  410. uint32_t __12_12 : 1; // [12]
  411. uint32_t rf_ce_simon_speck_key_len_sel : 2; // [14:13]
  412. uint32_t rf_ce_simon_speck_key_update_n : 1; // [15]
  413. uint32_t __31_16 : 16; // [31:16]
  414. } b;
  415. } REG_CE_SEC_CE_SIMON_SPECK_MODE_T;
  416. // ce_cfg
  417. typedef union {
  418. uint32_t v;
  419. struct
  420. {
  421. uint32_t rf_ce_link_mode_flag : 1; // [0]
  422. uint32_t rf_ce_dont_rcv_ddr : 1; // [1]
  423. uint32_t rf_ce_dont_dump_ddr : 1; // [2]
  424. uint32_t rf_ce_cmd_ioc : 1; // [3]
  425. uint32_t rf_ce_std_mode_end_flag : 1; // [4]
  426. uint32_t rf_ce_std_mode_aad_end_flag : 1; // [5]
  427. uint32_t rf_ce_std_mode_aad_flag : 1; // [6]
  428. uint32_t rf_ce_dma_bypass : 1; // [7]
  429. uint32_t rf_ce_key_in_ddr_flag : 1; // [8]
  430. uint32_t rf_ce_key_in_efuse_flag : 1; // [9]
  431. uint32_t rf_ce_key_in_session_key_flag : 1; // [10]
  432. uint32_t rf_ce_key_in_iram_flag : 1; // [11]
  433. uint32_t rf_ce_do_wait_bdone : 1; // [12]
  434. uint32_t rf_ce_list_aad_end_flag : 1; // [13], read only
  435. uint32_t rf_ce_list_aad_flag : 1; // [14], read only
  436. uint32_t rf_ce_list_end_flag : 1; // [15], read only
  437. uint32_t rf_ce_list_data_end_flag : 1; // [16], read only
  438. uint32_t rf_ce_list_update_iv_sec_cnt : 1; // [17], read only
  439. uint32_t rf_ce_key_hdcp_en : 1; // [18], read only
  440. uint32_t __19_19 : 1; // [19]
  441. uint32_t rf_ce_dst_byte_switch : 1; // [20]
  442. uint32_t rf_ce_src_byte_switch : 1; // [21]
  443. uint32_t rf_ce_dst_word_switch : 1; // [22]
  444. uint32_t rf_ce_src_word_switch : 1; // [23]
  445. uint32_t __31_24 : 8; // [31:24]
  446. } b;
  447. } REG_CE_SEC_CE_CFG_T;
  448. // ce_src_frag_length
  449. typedef union {
  450. uint32_t v;
  451. struct
  452. {
  453. uint32_t rf_ce_src_frag_len : 24; // [23:0]
  454. uint32_t rf_ce_src_addr_hi : 4; // [27:24]
  455. uint32_t __31_28 : 4; // [31:28]
  456. } b;
  457. } REG_CE_SEC_CE_SRC_FRAG_LENGTH_T;
  458. // ce_dst_frag_length
  459. typedef union {
  460. uint32_t v;
  461. struct
  462. {
  463. uint32_t rf_ce_dst_frag_len : 24; // [23:0]
  464. uint32_t rf_ce_dst_addr_hi : 4; // [27:24]
  465. uint32_t __31_28 : 4; // [31:28]
  466. } b;
  467. } REG_CE_SEC_CE_DST_FRAG_LENGTH_T;
  468. // ce_list_length
  469. typedef union {
  470. uint32_t v;
  471. struct
  472. {
  473. uint32_t rf_ce_list_len : 12; // [11:0]
  474. uint32_t __15_12 : 4; // [15:12]
  475. uint32_t rf_ce_list_ptr_hi : 4; // [19:16]
  476. uint32_t __31_20 : 12; // [31:20]
  477. } b;
  478. } REG_CE_SEC_CE_LIST_LENGTH_T;
  479. // ce_aes_tdes_rsa_key_length
  480. typedef union {
  481. uint32_t v;
  482. struct
  483. {
  484. uint32_t rf_ce_aes_tdes_rsa_key_len : 24; // [23:0]
  485. uint32_t rf_ce_aes_tdes_rsa_key_addr_hi : 4; // [27:24]
  486. uint32_t __31_28 : 4; // [31:28]
  487. } b;
  488. } REG_CE_SEC_CE_AES_TDES_RSA_KEY_LENGTH_T;
  489. // ce_aes_tag_length
  490. typedef union {
  491. uint32_t v;
  492. struct
  493. {
  494. uint32_t rf_ce_aes_tag_len : 8; // [7:0]
  495. uint32_t rf_ce_aes_tag_addr_hi : 4; // [11:8]
  496. uint32_t __31_12 : 20; // [31:12]
  497. } b;
  498. } REG_CE_SEC_CE_AES_TAG_LENGTH_T;
  499. // ce_sm4_mode
  500. typedef union {
  501. uint32_t v;
  502. struct
  503. {
  504. uint32_t rf_ce_sm4_en : 1; // [0]
  505. uint32_t __3_1 : 3; // [3:1]
  506. uint32_t rf_ce_sm4_enc_dec_sel : 1; // [4]
  507. uint32_t __7_5 : 3; // [7:5]
  508. uint32_t rf_ce_sm4_work_mode : 3; // [10:8]
  509. uint32_t rf_ce_sm4_xts_inv_rotation : 1; // [11]
  510. uint32_t rf_ce_sm4_key_update_n : 1; // [12]
  511. uint32_t __31_13 : 19; // [31:13]
  512. } b;
  513. } REG_CE_SEC_CE_SM4_MODE_T;
  514. // ce_ip_version
  515. typedef union {
  516. uint32_t v;
  517. struct
  518. {
  519. uint32_t rf_ce_ip_version_lo : 4; // [3:0]
  520. uint32_t rf_ce_ip_version_hi : 28; // [31:4], read only
  521. } b;
  522. } REG_CE_SEC_CE_IP_VERSION_T;
  523. // ce_pka_mode
  524. typedef union {
  525. uint32_t v;
  526. struct
  527. {
  528. uint32_t rf_ce_pka_en : 1; // [0]
  529. uint32_t rf_ce_pka_reg_num_sel : 1; // [1]
  530. uint32_t __15_2 : 14; // [15:2]
  531. uint32_t rf_ce_pka_find_prime_num : 8; // [23:16]
  532. uint32_t rf_ce_pka_dst_byte_switch : 1; // [24]
  533. uint32_t rf_ce_pka_src_byte_switch : 1; // [25]
  534. uint32_t rf_ce_pka_dst_word_switch : 1; // [26]
  535. uint32_t rf_ce_pka_src_word_switch : 1; // [27]
  536. uint32_t rf_ce_pka_cmd_addr_hi : 4; // [31:28]
  537. } b;
  538. } REG_CE_SEC_CE_PKA_MODE_T;
  539. // ce_pka_reg_length01
  540. typedef union {
  541. uint32_t v;
  542. struct
  543. {
  544. uint32_t rf_ce_pka_reg_length0 : 10; // [9:0]
  545. uint32_t __15_10 : 6; // [15:10]
  546. uint32_t rf_ce_pka_reg_length1 : 10; // [25:16]
  547. uint32_t __31_26 : 6; // [31:26]
  548. } b;
  549. } REG_CE_SEC_CE_PKA_REG_LENGTH01_T;
  550. // ce_pka_reg_length23
  551. typedef union {
  552. uint32_t v;
  553. struct
  554. {
  555. uint32_t rf_ce_pka_reg_length2 : 10; // [9:0]
  556. uint32_t __15_10 : 6; // [15:10]
  557. uint32_t rf_ce_pka_reg_length3 : 10; // [25:16]
  558. uint32_t __31_26 : 6; // [31:26]
  559. } b;
  560. } REG_CE_SEC_CE_PKA_REG_LENGTH23_T;
  561. // ce_pka_inst_pc
  562. typedef union {
  563. uint32_t v;
  564. struct
  565. {
  566. uint32_t rf_ce_pka_inst_pc : 17; // [16:0], read only
  567. uint32_t __23_17 : 7; // [23:17]
  568. uint32_t rf_ce_pka_store_done : 1; // [24], read only
  569. uint32_t rf_ce_pka_one_cmd_done : 1; // [25], read only
  570. uint32_t __26_26 : 1; // [26]
  571. uint32_t rf_ce_pka_find_prime_err_flag : 1; // [27], read only
  572. uint32_t rf_ce_pka_addsub_co : 1; // [28], read only
  573. uint32_t rf_ce_pka_modinv_err : 1; // [29], read only
  574. uint32_t rf_ce_pka_infinity_point_flag : 1; // [30], read only
  575. uint32_t rf_ce_pka_div_zero_err_flag : 1; // [31], read only
  576. } b;
  577. } REG_CE_SEC_CE_PKA_INST_PC_T;
  578. // ce_user_flag
  579. typedef union {
  580. uint32_t v;
  581. struct
  582. {
  583. uint32_t rf_ce_use_flag : 1; // [0]
  584. uint32_t __3_1 : 3; // [3:1]
  585. uint32_t rf_ce_sec_priority_vld : 1; // [4], read only
  586. uint32_t __7_5 : 3; // [7:5]
  587. uint32_t rf_ce_pub_priority_vld : 1; // [8], read only
  588. uint32_t __15_9 : 7; // [15:9]
  589. uint32_t rf_ce_efuse_double_bit_en : 1; // [16]
  590. uint32_t __31_17 : 15; // [31:17]
  591. } b;
  592. } REG_CE_SEC_CE_USER_FLAG_T;
  593. // ce_axi_axcache
  594. typedef union {
  595. uint32_t v;
  596. struct
  597. {
  598. uint32_t rf_ce_axi_arcache : 4; // [3:0]
  599. uint32_t rf_ce_axi_awcache : 4; // [7:4]
  600. uint32_t rf_ce_dst_outstanding_num : 4; // [11:8]
  601. uint32_t rf_ce_src_outstanding_num : 4; // [15:12]
  602. uint32_t __31_16 : 16; // [31:16]
  603. } b;
  604. } REG_CE_SEC_CE_AXI_AXCACHE_T;
  605. // ce_cmd_stop_ctrl
  606. typedef union {
  607. uint32_t v;
  608. struct
  609. {
  610. uint32_t rf_ce_cmd_stop : 1; // [0]
  611. uint32_t rf_ce_cmd_stop_status : 1; // [1], read only
  612. uint32_t __3_2 : 2; // [3:2]
  613. uint32_t rf_ce_cmd_stop_clear : 1; // [4], write clear
  614. uint32_t __7_5 : 3; // [7:5]
  615. uint32_t rf_ce_pka_cmd_stop : 1; // [8]
  616. uint32_t rf_ce_pka_cmd_stop_status : 1; // [9], read only
  617. uint32_t __11_10 : 2; // [11:10]
  618. uint32_t rf_ce_pka_cmd_stop_clear : 1; // [12], write clear
  619. uint32_t __31_13 : 19; // [31:13]
  620. } b;
  621. } REG_CE_SEC_CE_CMD_STOP_CTRL_T;
  622. // ce_axi_protect_sel
  623. typedef union {
  624. uint32_t v;
  625. struct
  626. {
  627. uint32_t sec_axi_prot_sel_en : 1; // [0]
  628. uint32_t sec_axi_prot_sel_rkey : 1; // [1]
  629. uint32_t sec_axi_prot_sel_rlist : 1; // [2]
  630. uint32_t sec_axi_prot_sel_rtxt : 1; // [3]
  631. uint32_t sec_axi_prot_sel_wtxt : 1; // [4]
  632. uint32_t sec_dummy : 3; // [7:5]
  633. uint32_t pka_axi_prot_sel_en : 1; // [8]
  634. uint32_t pka_axi_prot_sel_cmd : 1; // [9]
  635. uint32_t pka_axi_prot_sel_ld : 1; // [10]
  636. uint32_t pka_axi_prot_sel_st : 1; // [11]
  637. uint32_t pka_dummy : 4; // [15:12]
  638. uint32_t __31_16 : 16; // [31:16]
  639. } b;
  640. } REG_CE_SEC_CE_AXI_PROTECT_SEL_T;
  641. // ce_rng_en
  642. typedef union {
  643. uint32_t v;
  644. struct
  645. {
  646. uint32_t rf_ce_rng_en : 1; // [0]
  647. uint32_t rf_ce_trng_src_en : 1; // [1], write clear
  648. uint32_t rf_ce_rng_src_from_cpu_enable : 1; // [2]
  649. uint32_t rf_ce_rng_rst_from_cpu : 1; // [3], write clear
  650. uint32_t rf_ce_trng_ptest_mode_en : 1; // [4]
  651. uint32_t __7_5 : 3; // [7:5]
  652. uint32_t rf_rng_src_sel_enable : 8; // [15:8]
  653. uint32_t rf_rng_auto_enable : 1; // [16]
  654. uint32_t rf_ce_rng_mux_ring_enable : 1; // [17]
  655. uint32_t rf_ce_rng_data_mux_enable : 1; // [18]
  656. uint32_t __31_19 : 13; // [31:19]
  657. } b;
  658. } REG_CE_SEC_CE_RNG_EN_T;
  659. // ce_rng_config
  660. typedef union {
  661. uint32_t v;
  662. struct
  663. {
  664. uint32_t rf_ce_rng_ring_sel : 3; // [2:0]
  665. uint32_t rf_ce_rng_trng_sel : 1; // [3]
  666. uint32_t rf_ce_rng_data_len_sel : 1; // [4]
  667. uint32_t rf_ce_rng_source_sel : 2; // [6:5]
  668. uint32_t rf_ce_rng_exotic_fault_rst_sel : 1; // [7]
  669. uint32_t rf_ce_rng_data_valid_threshold : 4; // [11:8]
  670. uint32_t __15_12 : 4; // [15:12]
  671. uint32_t rf_ce_rng_ptest_data_in : 1; // [16]
  672. uint32_t __19_17 : 3; // [19:17]
  673. uint32_t number_of_samples_threshold : 12; // [31:20]
  674. } b;
  675. } REG_CE_SEC_CE_RNG_CONFIG_T;
  676. // ce_rng_sample_period
  677. typedef union {
  678. uint32_t v;
  679. struct
  680. {
  681. uint32_t rf_ce_rng_second_sample_period : 16; // [15:0]
  682. uint32_t rf_ce_rng_first_sample_period : 15; // [30:16]
  683. uint32_t rf_ce_rng_first_sample_en : 1; // [31]
  684. } b;
  685. } REG_CE_SEC_CE_RNG_SAMPLE_PERIOD_T;
  686. // ce_rng_post_process_en
  687. typedef union {
  688. uint32_t v;
  689. struct
  690. {
  691. uint32_t rf_ce_rng_post_first_en : 1; // [0]
  692. uint32_t rf_ce_rng_post_second_en : 1; // [1]
  693. uint32_t rf_ce_rng_post_three_en : 1; // [2]
  694. uint32_t rf_ce_rng_post_four_en : 1; // [3]
  695. uint32_t rf_ce_rng_post_five_en : 1; // [4]
  696. uint32_t rf_ce_rng_post_six_en : 1; // [5]
  697. uint32_t rf_ce_rng_post_seven_en : 1; // [6]
  698. uint32_t rf_ce_rng_post_eight_en : 1; // [7]
  699. uint32_t __31_8 : 24; // [31:8]
  700. } b;
  701. } REG_CE_SEC_CE_RNG_POST_PROCESS_EN_T;
  702. // ce_rng_work_status
  703. typedef union {
  704. uint32_t v;
  705. struct
  706. {
  707. uint32_t rf_ce_rng_auto_mode_ongoing : 1; // [0], read only
  708. uint32_t rf_ce_rng_data_valid : 1; // [1], read only
  709. uint32_t rf_rng_rsa_pka_busy : 1; // [2], read only
  710. uint32_t rf_ce_rng_error_fault : 1; // [3], read only
  711. uint32_t rf_ce_rng_fifo_empty : 1; // [4], read only
  712. uint32_t rf_ce_rng_drbg_test_data_type : 2; // [6:5], read only
  713. uint32_t rf_ce_rng_drbg_test_result_vld : 1; // [7], read only
  714. uint32_t rf_ce_rng_test_result : 1; // [8], read only
  715. uint32_t rf_ce_rng_es_test_done : 1; // [9], read only
  716. uint32_t rf_ce_rng_es_test_fail : 1; // [10], read only
  717. uint32_t rf_ce_rng_drbg_test_done : 1; // [11], read only
  718. uint32_t rf_ce_rng_drbg_test_fail : 1; // [12], read only
  719. uint32_t rf_ce_rng_drbg_pattern_req : 1; // [13], read only
  720. uint32_t rf_ce_rng_drbg_test_process : 2; // [15:14], read only
  721. uint32_t rf_ce_rng_rsa_key_gen_rand_num : 16; // [31:16], read only
  722. } b;
  723. } REG_CE_SEC_CE_RNG_WORK_STATUS_T;
  724. // ce_rng_int_en
  725. typedef union {
  726. uint32_t v;
  727. struct
  728. {
  729. uint32_t rf_ce_rng_process0_int_en : 1; // [0]
  730. uint32_t rf_ce_rng_process1_int_en : 1; // [1]
  731. uint32_t rf_ce_rng_process2_int_en : 1; // [2]
  732. uint32_t rf_ce_rng_timeout_int_en : 1; // [3]
  733. uint32_t rf_ce_rng_sram_short_int_en : 1; // [4]
  734. uint32_t rf_ce_rng_cont_htest_int_en : 1; // [5]
  735. uint32_t __31_6 : 26; // [31:6]
  736. } b;
  737. } REG_CE_SEC_CE_RNG_INT_EN_T;
  738. // ce_rng_sts
  739. typedef union {
  740. uint32_t v;
  741. struct
  742. {
  743. uint32_t rf_ce_rng_process0_int_sts : 1; // [0], read only
  744. uint32_t rf_ce_rng_process1_int_sts : 1; // [1], read only
  745. uint32_t rf_ce_rng_process2_int_sts : 1; // [2], read only
  746. uint32_t rf_ce_rng_timeout_int_sts : 1; // [3], read only
  747. uint32_t rf_ce_rng_sram_short_int_sts : 1; // [4], read only
  748. uint32_t rf_ce_rng_con_htest_int_sts : 1; // [5], read only
  749. uint32_t __31_6 : 26; // [31:6]
  750. } b;
  751. } REG_CE_SEC_CE_RNG_STS_T;
  752. // ce_rng_int_clr
  753. typedef union {
  754. uint32_t v;
  755. struct
  756. {
  757. uint32_t rf_ce_rng_clear_process0_int : 1; // [0], write clear
  758. uint32_t rf_ce_rng_clear_process1_int : 1; // [1], write clear
  759. uint32_t rf_ce_rng_clear_process2_int : 1; // [2], write clear
  760. uint32_t rf_ce_rng_clear_timeout_int : 1; // [3], write clear
  761. uint32_t rf_ce_rng_clear_sram_short_int : 1; // [4], write clear
  762. uint32_t rf_ce_rng_clear_con_htest_int : 1; // [5], write clear
  763. uint32_t __31_6 : 26; // [31:6]
  764. } b;
  765. } REG_CE_SEC_CE_RNG_INT_CLR_T;
  766. // ce_rng_mode
  767. typedef union {
  768. uint32_t v;
  769. struct
  770. {
  771. uint32_t rf_ce_rng_mode : 2; // [1:0]
  772. uint32_t __7_2 : 6; // [7:2]
  773. uint32_t rf_ce_prng_mode : 1; // [8]
  774. uint32_t __31_9 : 23; // [31:9]
  775. } b;
  776. } REG_CE_SEC_CE_RNG_MODE_T;
  777. // ce_prng_seed_update
  778. typedef union {
  779. uint32_t v;
  780. struct
  781. {
  782. uint32_t rf_ce_prng_seed_update : 1; // [0], write clear
  783. uint32_t __31_1 : 31; // [31:1]
  784. } b;
  785. } REG_CE_SEC_CE_PRNG_SEED_UPDATE_T;
  786. // ce_rng_bit_rate
  787. typedef union {
  788. uint32_t v;
  789. struct
  790. {
  791. uint32_t rf_rng_bit_rate : 16; // [15:0], read only
  792. uint32_t rf_rng_gen_bit_cnt : 16; // [31:16], read only
  793. } b;
  794. } REG_CE_SEC_CE_RNG_BIT_RATE_T;
  795. // ce_rng_sram_data_threshhold
  796. typedef union {
  797. uint32_t v;
  798. struct
  799. {
  800. uint32_t rf_ce_rng_sram_valid_threshholdd : 4; // [3:0]
  801. uint32_t __31_4 : 28; // [31:4]
  802. } b;
  803. } REG_CE_SEC_CE_RNG_SRAM_DATA_THRESHHOLD_T;
  804. // ce_rng_sram_data_residue_num
  805. typedef union {
  806. uint32_t v;
  807. struct
  808. {
  809. uint32_t rf_ce_rng_sram_data_residue_num : 4; // [3:0], read only
  810. uint32_t __31_4 : 28; // [31:4]
  811. } b;
  812. } REG_CE_SEC_CE_RNG_SRAM_DATA_RESIDUE_NUM_T;
  813. // ce_rng_exotic_fault_counter_config
  814. typedef union {
  815. uint32_t v;
  816. struct
  817. {
  818. uint32_t rf_ce_exotic_fault_counter_config : 16; // [15:0]
  819. uint32_t __31_16 : 16; // [31:16]
  820. } b;
  821. } REG_CE_SEC_CE_RNG_EXOTIC_FAULT_COUNTER_CONFIG_T;
  822. // ce_rng_drbg_seed_cnt
  823. typedef union {
  824. uint32_t v;
  825. struct
  826. {
  827. uint32_t rf_ce_rng_drbg_seed_cnt : 16; // [15:0]
  828. uint32_t __31_16 : 16; // [31:16]
  829. } b;
  830. } REG_CE_SEC_CE_RNG_DRBG_SEED_CNT_T;
  831. // ce_rng_health_test_config
  832. typedef union {
  833. uint32_t v;
  834. struct
  835. {
  836. uint32_t rf_ce_rng_es_test_en : 1; // [0]
  837. uint32_t rf_ce_rng_drbg_test_en : 1; // [1]
  838. uint32_t rf_ce_rng_long_term_bit_max : 6; // [7:2]
  839. uint32_t rf_ce_rng_ones_freq_max : 11; // [18:8]
  840. uint32_t __31_19 : 13; // [31:19]
  841. } b;
  842. } REG_CE_SEC_CE_RNG_HEALTH_TEST_CONFIG_T;
  843. // ce_secure_key_use_way
  844. typedef union {
  845. uint32_t v;
  846. struct
  847. {
  848. uint32_t rf_ce_secure_key2_en : 1; // [0]
  849. uint32_t rf_ce_secure_key1_start_raddr : 10; // [10:1]
  850. uint32_t rf_ce_secure_key2_start_raddr : 10; // [20:11]
  851. uint32_t rf_ce_secure_key_len : 9; // [29:21]
  852. uint32_t rf_ce_secure_key_cpu_access : 1; // [30]
  853. uint32_t rf_ce_secure_key_trng_write : 1; // [31]
  854. } b;
  855. } REG_CE_SEC_CE_SECURE_KEY_USE_WAY_T;
  856. // ce_huk_key_config
  857. typedef union {
  858. uint32_t v;
  859. struct
  860. {
  861. uint32_t rf_ce_write_efs_length : 8; // [7:0]
  862. uint32_t __15_8 : 8; // [15:8]
  863. uint32_t rf_ce_write_efs_addr : 16; // [31:16]
  864. } b;
  865. } REG_CE_SEC_CE_HUK_KEY_CONFIG_T;
  866. // ce_pka_key_config
  867. typedef union {
  868. uint32_t v;
  869. struct
  870. {
  871. uint32_t rf_pka_write_efs_start_addr : 10; // [9:0]
  872. uint32_t __15_10 : 6; // [15:10]
  873. uint32_t rf_pka_write_efs_end_addr : 10; // [25:16]
  874. uint32_t __31_26 : 6; // [31:26]
  875. } b;
  876. } REG_CE_SEC_CE_PKA_KEY_CONFIG_T;
  877. // ce_dump_addr_hi
  878. typedef union {
  879. uint32_t v;
  880. struct
  881. {
  882. uint32_t rf_ce_rcv_addr_hi : 4; // [3:0]
  883. uint32_t rf_ce_dump_addr_hi : 4; // [7:4]
  884. uint32_t __31_8 : 24; // [31:8]
  885. } b;
  886. } REG_CE_SEC_CE_DUMP_ADDR_HI_T;
  887. // ce_pka_store_addr_hi
  888. typedef union {
  889. uint32_t v;
  890. struct
  891. {
  892. uint32_t rf_ce_pka_store_addr_hi : 19; // [18:0]
  893. uint32_t __31_19 : 13; // [31:19]
  894. } b;
  895. } REG_CE_SEC_CE_PKA_STORE_ADDR_HI_T;
  896. // ce_pka_load_addr_hi
  897. typedef union {
  898. uint32_t v;
  899. struct
  900. {
  901. uint32_t rf_ce_pka_load_addr_hi : 19; // [18:0]
  902. uint32_t __31_19 : 13; // [31:19]
  903. } b;
  904. } REG_CE_SEC_CE_PKA_LOAD_ADDR_HI_T;
  905. // ce_pka_start
  906. typedef union {
  907. uint32_t v;
  908. struct
  909. {
  910. uint32_t rf_ce_pka_start : 1; // [0], write clear
  911. uint32_t __31_1 : 31; // [31:1]
  912. } b;
  913. } REG_CE_SEC_CE_PKA_START_T;
  914. // ce_pka_clear
  915. typedef union {
  916. uint32_t v;
  917. struct
  918. {
  919. uint32_t rf_ce_pka_clear : 1; // [0], write clear
  920. uint32_t __31_1 : 31; // [31:1]
  921. } b;
  922. } REG_CE_SEC_CE_PKA_CLEAR_T;
  923. // ce_pka_rng_force_ssb_bit
  924. typedef union {
  925. uint32_t v;
  926. struct
  927. {
  928. uint32_t rf_ce_pka_rng_force_ssb_bit : 1; // [0]
  929. uint32_t __31_1 : 31; // [31:1]
  930. } b;
  931. } REG_CE_SEC_CE_PKA_RNG_FORCE_SSB_BIT_T;
  932. // ce_pka_ctrl_operate_bit
  933. typedef union {
  934. uint32_t v;
  935. struct
  936. {
  937. uint32_t ce_pka_store_limit_cfg_disable : 1; // [0]
  938. uint32_t __31_1 : 31; // [31:1]
  939. } b;
  940. } REG_CE_SEC_CE_PKA_CTRL_OPERATE_BIT_T;
  941. // ce_pka_efs_debug_status
  942. typedef union {
  943. uint32_t v;
  944. struct
  945. {
  946. uint32_t rf_pka_write_efuse_count : 8; // [7:0], read only
  947. uint32_t rf_pka_read_efuse_count : 8; // [15:8], read only
  948. uint32_t rf_pka_and_huk_access_efuse_status : 4; // [19:16], read only
  949. uint32_t rf_pka_access_efuse_flag : 4; // [23:20], read only
  950. uint32_t __31_24 : 8; // [31:24]
  951. } b;
  952. } REG_CE_SEC_CE_PKA_EFS_DEBUG_STATUS_T;
  953. // ce_debug_dma_status
  954. #define CE_SEC_RF_CE_DMA_MAIN_READ_STATE(n) (((n)&0x1f) << 0)
  955. #define CE_SEC_RF_CE_DMA_PKA_MAIN_READ_STATE(n) (((n)&0x7) << 5)
  956. #define CE_SEC_RF_CE_DMA_MAIN_WRITE_STATE(n) (((n)&0x1f) << 8)
  957. #define CE_SEC_RF_CE_DMA_ERR (1 << 13)
  958. #define CE_SEC_RF_CE_INT_RAW_STATUS_VLD (1 << 14)
  959. #define CE_SEC_RF_CE_CMD_FIFO_NON_EMPTY (1 << 15)
  960. #define CE_SEC_RF_CE_PKA_CMD_FIFO_NON_EMPTY (1 << 16)
  961. #define CE_SEC_RF_CE_DMA_SRC_STATE(n) (((n)&0x1f) << 17)
  962. #define CE_SEC_RF_CE_DMA_DST_STATE(n) (((n)&0x1f) << 22)
  963. #define CE_SEC_RF_CE_BUSY (1 << 28)
  964. #define CE_SEC_RF_CE_ARREADY (1 << 29)
  965. #define CE_SEC_RF_CE_AWREADY (1 << 30)
  966. #define CE_SEC_RF_CE_WREADY (1 << 31)
  967. // ce_debug_aes_status
  968. #define CE_SEC_RF_CE_AES_STATUS(n) (((n)&0xff) << 0)
  969. #define CE_SEC_RF_CE_WDMA_DATA_STATUS(n) (((n)&0x3) << 10)
  970. #define CE_SEC_RF_CE_SM4_STATUS(n) (((n)&0x7) << 12)
  971. #define CE_SEC_RF_CE_RDMA_DATA_STATUS(n) (((n)&0x7) << 15)
  972. #define CE_SEC_RF_CE_FDE_DMA_MAIN_READ_STATE(n) (((n)&0x1f) << 20)
  973. #define CE_SEC_RF_CE_FDE_WDMA_DATA_STATUS(n) (((n)&0x3) << 25)
  974. #define CE_SEC_RF_CE_FDE_RDMA_DATA_STATUS(n) (((n)&0x3) << 27)
  975. // ce_debug_tdes_status
  976. #define CE_SEC_RF_CE_FDE_AES_STATUS(n) (((n)&0xff) << 0)
  977. #define CE_SEC_RF_CE_FDE_DMA_MAIN_WRITE_STATE(n) (((n)&0x1f) << 8)
  978. #define CE_SEC_RF_CE_PKA_DMA_MAIN_WRITE_STATE(n) (((n)&0x7) << 13)
  979. #define CE_SEC_RF_CE_EFUSE_ACCESS_STATUS(n) (((n)&0x1f) << 16)
  980. #define CE_SEC_RF_CE_DMA_WVALID_STATE(n) (((n)&0xf) << 21)
  981. #define CE_SEC_RF_CE_TDES_STATUS(n) (((n)&0x1f) << 25)
  982. // ce_debug_hash_status1
  983. #define CE_SEC_RF_CE_HASH_STATUS1(n) (((n)&0x3ff) << 0)
  984. // ce_clk_en
  985. #define CE_SEC_RF_CE_DMA_CK_EN (1 << 0)
  986. #define CE_SEC_RF_CE_AES_CK_EN (1 << 1)
  987. #define CE_SEC_RF_CE_FDE_AES_CK_EN (1 << 2)
  988. #define CE_SEC_RF_CE_HASH_CK_EN (1 << 3)
  989. #define CE_SEC_RF_CE_DES_CK_EN (1 << 4)
  990. #define CE_SEC_RF_CE_TRNG_CK_EN (1 << 5)
  991. #define CE_SEC_RF_CE_SM4_CK_EN (1 << 6)
  992. #define CE_SEC_RF_CE_CHACAH_POLY_CK_EN (1 << 7)
  993. #define CE_SEC_RF_CE_PKA_CK_EN (1 << 8)
  994. #define CE_SEC_RF_CE_SIMON_SPECK_CK_EN (1 << 9)
  995. #define CE_SEC_RF_CE_APB_RF_CLK_EN (1 << 16)
  996. #define CE_SEC_RF_CE_DMA_CTRL_CLK_EN (1 << 17)
  997. #define CE_SEC_RF_CE_DMA_AXI_CLK_EN (1 << 18)
  998. #define CE_SEC_RF_CE_AES_CLK_EN (1 << 20)
  999. #define CE_SEC_RF_CE_RNG_CLK_EN (1 << 21)
  1000. #define CE_SEC_RF_CE_POLY_CLK_EN (1 << 22)
  1001. #define CE_SEC_RF_CE_CHACHA_CLK_EN (1 << 23)
  1002. #define CE_SEC_RF_CE_TRNG_PUB_CLK_EN (1 << 24)
  1003. #define CE_SEC_RF_CE_RNG_PUB_CLK_EN (1 << 25)
  1004. #define CE_SEC_RF_CE_FDE_AES_CLK_EN (1 << 28)
  1005. // ce_int_en
  1006. #define CE_SEC_RF_CE_EN_CMD_DONE_INT (1 << 0)
  1007. #define CE_SEC_RF_CE_EN_EFS_HUK_UNSTABLE_INT (1 << 1)
  1008. #define CE_SEC_RF_CE_EN_EFS_ALL_ZERO_INT (1 << 2)
  1009. #define CE_SEC_RF_CE_EN_LEN_ERR_INT (1 << 4)
  1010. #define CE_SEC_RF_CE_EN_TDES_KEY_ERR_INT (1 << 5)
  1011. #define CE_SEC_RF_CE_EN_RNG_INT (1 << 7)
  1012. #define CE_SEC_RF_CE_EN_PKA_STORE_DONE_INT (1 << 8)
  1013. #define CE_SEC_RF_CE_EN_PKA_ONE_CMD_DONE_INT (1 << 9)
  1014. #define CE_SEC_RF_CE_EN_USE_EFUSE_ERR_INT (1 << 10)
  1015. #define CE_SEC_RF_CE_EN_PKA_DIV_ZERO_ERR_INT (1 << 11)
  1016. #define CE_SEC_RF_CE_EN_PKA_FIND_PRIME_ERR_INT (1 << 12)
  1017. #define CE_SEC_RF_CE_EN_PKA_CMD_DONE_DONE_INT (1 << 13)
  1018. #define CE_SEC_RF_CE_EN_PKA_LEN_ERR_INT (1 << 14)
  1019. #define CE_SEC_RF_CE_EN_PKA_WR_EFUSE_KEY_ADDR_INT (1 << 15)
  1020. #define CE_SEC_RF_CE_EN_PKA_RD_EFUSE_KEY_ADDR_INT (1 << 16)
  1021. // ce_int_status
  1022. #define CE_SEC_RF_CE_CMD_DONE_INT_STATUS (1 << 0)
  1023. #define CE_SEC_RF_CE_EFS_HUK_UNSTABLE_INT_STATUS (1 << 1)
  1024. #define CE_SEC_RF_CE_EFS_ALL_ZERO_INT_STATUS (1 << 2)
  1025. #define CE_SEC_RF_CE_LEN_ERR_INT_STATUS (1 << 4)
  1026. #define CE_SEC_RF_CE_TDES_KEY_ERR_INT_STATUS (1 << 5)
  1027. #define CE_SEC_RF_CE_RNG_INT_STATUS (1 << 7)
  1028. #define CE_SEC_RF_CE_PKA_STORE_DONE_FLAG (1 << 8)
  1029. #define CE_SEC_RF_CE_PKA_ONE_CMD_DONE_FLAG (1 << 9)
  1030. #define CE_SEC_RF_CE_USE_EFUSE_ERR_FLAG (1 << 10)
  1031. #define CE_SEC_CE_INT_STATUS_RF_CE_PKA_DIV_ZERO_ERR_FLAG (1 << 11)
  1032. #define CE_SEC_CE_INT_STATUS_RF_CE_PKA_FIND_PRIME_ERR_FLAG (1 << 12)
  1033. #define CE_SEC_RF_CE_PKA_CMD_DONE_DONE_INT_STATUS (1 << 13)
  1034. #define CE_SEC_RF_CE_PKA_LEN_ERR_INT_STATUS (1 << 14)
  1035. #define CE_SEC_RF_CE_PKA_WR_EFUSE_KEY_ADDR_INT_STATUS (1 << 15)
  1036. #define CE_SEC_RF_CE_PKA_RD_EFUSE_KEY_ADDR_INT_STATUS (1 << 16)
  1037. // ce_int_clear
  1038. #define CE_SEC_RF_CE_CLEAR_CMD_DONE_INT (1 << 0)
  1039. #define CE_SEC_RF_CE_CLEAR_EFS_HUK_UNSTABLE_INT (1 << 1)
  1040. #define CE_SEC_RF_CE_CLEAR_EFS_ALL_ZERO_INT (1 << 2)
  1041. #define CE_SEC_RF_CE_CLEAR_LEN_ERR_INT (1 << 4)
  1042. #define CE_SEC_RF_CE_CLEAR_TDES_KEY_ERR_INT (1 << 5)
  1043. #define CE_SEC_RF_CE_CLEAR_PKA_STORE_DONE_INT (1 << 8)
  1044. #define CE_SEC_RF_CE_CLEAR_PKA_ONE_CMD_DONE_INT (1 << 9)
  1045. #define CE_SEC_RF_CE_CLEAR_USE_EFUSE_ERR_INT (1 << 10)
  1046. #define CE_SEC_RF_CE_CLEAR_PKA_DIV_ZERO_ERR_INT (1 << 11)
  1047. #define CE_SEC_RF_CE_CLEAR_PKA_FIND_PRIME_ERR_INT (1 << 12)
  1048. #define CE_SEC_RF_CE_CLEAR_PKA_CMD_DONE_DONE_INT (1 << 13)
  1049. #define CE_SEC_RF_CE_CLEAR_PKA_LEN_ERR_INT (1 << 14)
  1050. #define CE_SEC_RF_CE_CLEAR_PKA_WR_EFUSE_KEY_ADDR_INT (1 << 15)
  1051. #define CE_SEC_RF_CE_CLEAR_PKA_RD_EFUSE_KEY_ADDR_INT (1 << 16)
  1052. // ce_start
  1053. #define CE_SEC_RF_CE_START (1 << 0)
  1054. // ce_clear
  1055. #define CE_SEC_RF_CE_CLEAR (1 << 0)
  1056. // ce_aes_mode
  1057. #define CE_SEC_RF_CE_AES_EN (1 << 0)
  1058. #define CE_SEC_RF_CE_AES_ENC_DEC_SEL (1 << 4)
  1059. #define CE_SEC_RF_CE_AES_MAC_CTR_INC_MODE(n) (((n)&0x3) << 5)
  1060. #define CE_SEC_RF_CE_AES_WORK_MODE(n) (((n)&0xf) << 8)
  1061. #define CE_SEC_RF_CE_AES_KEY_LEN_SEL(n) (((n)&0x3) << 12)
  1062. #define CE_SEC_RF_CE_AES_XTS_IV_ROTATION (1 << 14)
  1063. #define CE_SEC_RF_CE_AES_KEY_UPDATE_N (1 << 15)
  1064. // ce_tdes_mode
  1065. #define CE_SEC_RF_CE_TDES_EN (1 << 0)
  1066. #define CE_SEC_RF_CE_TDES_ENC_DEC_SEL (1 << 4)
  1067. #define CE_SEC_RF_CE_TDES_WORK_MODE(n) (((n)&0x3) << 8)
  1068. #define CE_SEC_RF_CE_TDES_KEY_EVEN_SEL (1 << 12)
  1069. #define CE_SEC_RF_CE_TDES_KEY_EVENODD_CHECK_ON (1 << 13)
  1070. // ce_hash_mode
  1071. #define CE_SEC_RF_CE_HASH_EN (1 << 0)
  1072. #define CE_SEC_RF_CE_HASH_MODE(n) (((n)&0x1f) << 4)
  1073. #define CE_SEC_RF_HASH_HMAC_PAD_SEL(n) (((n)&0x3) << 12)
  1074. #define CE_SEC_RF_HASH_SHA3_SHAKE_OUT_LEN(n) (((n)&0xff) << 16)
  1075. // ce_chacha_poly_mode
  1076. #define CE_SEC_RF_CE_CHACHA_POLY_EN (1 << 0)
  1077. #define CE_SEC_RF_CE_CHACHA_POLY_ENC_DEC_SEL (1 << 4)
  1078. #define CE_SEC_RF_CE_CHACHA_POLY_MODE(n) (((n)&0x3) << 8)
  1079. // ce_simon_speck_mode
  1080. #define CE_SEC_RF_CE_SIMON_SPECK_EN (1 << 0)
  1081. #define CE_SEC_RF_CE_SIMON_SPECK_ENC_DEC_SEL (1 << 4)
  1082. #define CE_SEC_RF_CE_SIMON_SPECK_SEL (1 << 8)
  1083. #define CE_SEC_RF_CE_SIMON_SPECK_WORK_MODE(n) (((n)&0x7) << 9)
  1084. #define CE_SEC_RF_CE_SIMON_SPECK_KEY_LEN_SEL(n) (((n)&0x3) << 13)
  1085. #define CE_SEC_RF_CE_SIMON_SPECK_KEY_UPDATE_N (1 << 15)
  1086. // ce_cfg
  1087. #define CE_SEC_RF_CE_LINK_MODE_FLAG (1 << 0)
  1088. #define CE_SEC_RF_CE_DONT_RCV_DDR (1 << 1)
  1089. #define CE_SEC_RF_CE_DONT_DUMP_DDR (1 << 2)
  1090. #define CE_SEC_RF_CE_CMD_IOC (1 << 3)
  1091. #define CE_SEC_RF_CE_STD_MODE_END_FLAG (1 << 4)
  1092. #define CE_SEC_RF_CE_STD_MODE_AAD_END_FLAG (1 << 5)
  1093. #define CE_SEC_RF_CE_STD_MODE_AAD_FLAG (1 << 6)
  1094. #define CE_SEC_RF_CE_DMA_BYPASS (1 << 7)
  1095. #define CE_SEC_RF_CE_KEY_IN_DDR_FLAG (1 << 8)
  1096. #define CE_SEC_RF_CE_KEY_IN_EFUSE_FLAG (1 << 9)
  1097. #define CE_SEC_RF_CE_KEY_IN_SESSION_KEY_FLAG (1 << 10)
  1098. #define CE_SEC_RF_CE_KEY_IN_IRAM_FLAG (1 << 11)
  1099. #define CE_SEC_RF_CE_DO_WAIT_BDONE (1 << 12)
  1100. #define CE_SEC_RF_CE_LIST_AAD_END_FLAG (1 << 13)
  1101. #define CE_SEC_RF_CE_LIST_AAD_FLAG (1 << 14)
  1102. #define CE_SEC_RF_CE_LIST_END_FLAG (1 << 15)
  1103. #define CE_SEC_RF_CE_LIST_DATA_END_FLAG (1 << 16)
  1104. #define CE_SEC_RF_CE_LIST_UPDATE_IV_SEC_CNT (1 << 17)
  1105. #define CE_SEC_RF_CE_KEY_HDCP_EN (1 << 18)
  1106. #define CE_SEC_RF_CE_DST_BYTE_SWITCH (1 << 20)
  1107. #define CE_SEC_RF_CE_SRC_BYTE_SWITCH (1 << 21)
  1108. #define CE_SEC_RF_CE_DST_WORD_SWITCH (1 << 22)
  1109. #define CE_SEC_RF_CE_SRC_WORD_SWITCH (1 << 23)
  1110. // ce_src_frag_length
  1111. #define CE_SEC_RF_CE_SRC_FRAG_LEN(n) (((n)&0xffffff) << 0)
  1112. #define CE_SEC_RF_CE_SRC_ADDR_HI(n) (((n)&0xf) << 24)
  1113. // ce_dst_frag_length
  1114. #define CE_SEC_RF_CE_DST_FRAG_LEN(n) (((n)&0xffffff) << 0)
  1115. #define CE_SEC_RF_CE_DST_ADDR_HI(n) (((n)&0xf) << 24)
  1116. // ce_list_length
  1117. #define CE_SEC_RF_CE_LIST_LEN(n) (((n)&0xfff) << 0)
  1118. #define CE_SEC_RF_CE_LIST_PTR_HI(n) (((n)&0xf) << 16)
  1119. // ce_aes_tdes_rsa_key_length
  1120. #define CE_SEC_RF_CE_AES_TDES_RSA_KEY_LEN(n) (((n)&0xffffff) << 0)
  1121. #define CE_SEC_RF_CE_AES_TDES_RSA_KEY_ADDR_HI(n) (((n)&0xf) << 24)
  1122. // ce_aes_tag_length
  1123. #define CE_SEC_RF_CE_AES_TAG_LEN(n) (((n)&0xff) << 0)
  1124. #define CE_SEC_RF_CE_AES_TAG_ADDR_HI(n) (((n)&0xf) << 8)
  1125. // ce_sm4_mode
  1126. #define CE_SEC_RF_CE_SM4_EN (1 << 0)
  1127. #define CE_SEC_RF_CE_SM4_ENC_DEC_SEL (1 << 4)
  1128. #define CE_SEC_RF_CE_SM4_WORK_MODE(n) (((n)&0x7) << 8)
  1129. #define CE_SEC_RF_CE_SM4_XTS_INV_ROTATION (1 << 11)
  1130. #define CE_SEC_RF_CE_SM4_KEY_UPDATE_N (1 << 12)
  1131. // ce_ip_version
  1132. #define CE_SEC_RF_CE_IP_VERSION_LO(n) (((n)&0xf) << 0)
  1133. #define CE_SEC_RF_CE_IP_VERSION_HI(n) (((n)&0xfffffff) << 4)
  1134. // ce_pka_mode
  1135. #define CE_SEC_RF_CE_PKA_EN (1 << 0)
  1136. #define CE_SEC_RF_CE_PKA_REG_NUM_SEL (1 << 1)
  1137. #define CE_SEC_RF_CE_PKA_FIND_PRIME_NUM(n) (((n)&0xff) << 16)
  1138. #define CE_SEC_RF_CE_PKA_DST_BYTE_SWITCH (1 << 24)
  1139. #define CE_SEC_RF_CE_PKA_SRC_BYTE_SWITCH (1 << 25)
  1140. #define CE_SEC_RF_CE_PKA_DST_WORD_SWITCH (1 << 26)
  1141. #define CE_SEC_RF_CE_PKA_SRC_WORD_SWITCH (1 << 27)
  1142. #define CE_SEC_RF_CE_PKA_CMD_ADDR_HI(n) (((n)&0xf) << 28)
  1143. // ce_pka_reg_length01
  1144. #define CE_SEC_RF_CE_PKA_REG_LENGTH0(n) (((n)&0x3ff) << 0)
  1145. #define CE_SEC_RF_CE_PKA_REG_LENGTH1(n) (((n)&0x3ff) << 16)
  1146. // ce_pka_reg_length23
  1147. #define CE_SEC_RF_CE_PKA_REG_LENGTH2(n) (((n)&0x3ff) << 0)
  1148. #define CE_SEC_RF_CE_PKA_REG_LENGTH3(n) (((n)&0x3ff) << 16)
  1149. // ce_pka_inst_pc
  1150. #define CE_SEC_RF_CE_PKA_INST_PC(n) (((n)&0x1ffff) << 0)
  1151. #define CE_SEC_RF_CE_PKA_STORE_DONE (1 << 24)
  1152. #define CE_SEC_RF_CE_PKA_ONE_CMD_DONE (1 << 25)
  1153. #define CE_SEC_CE_PKA_INST_PC_RF_CE_PKA_FIND_PRIME_ERR_FLAG (1 << 27)
  1154. #define CE_SEC_RF_CE_PKA_ADDSUB_CO (1 << 28)
  1155. #define CE_SEC_RF_CE_PKA_MODINV_ERR (1 << 29)
  1156. #define CE_SEC_RF_CE_PKA_INFINITY_POINT_FLAG (1 << 30)
  1157. #define CE_SEC_CE_PKA_INST_PC_RF_CE_PKA_DIV_ZERO_ERR_FLAG (1 << 31)
  1158. // ce_user_flag
  1159. #define CE_SEC_RF_CE_USE_FLAG (1 << 0)
  1160. #define CE_SEC_RF_CE_SEC_PRIORITY_VLD (1 << 4)
  1161. #define CE_SEC_RF_CE_PUB_PRIORITY_VLD (1 << 8)
  1162. #define CE_SEC_RF_CE_EFUSE_DOUBLE_BIT_EN (1 << 16)
  1163. // ce_axi_axcache
  1164. #define CE_SEC_RF_CE_AXI_ARCACHE(n) (((n)&0xf) << 0)
  1165. #define CE_SEC_RF_CE_AXI_AWCACHE(n) (((n)&0xf) << 4)
  1166. #define CE_SEC_RF_CE_DST_OUTSTANDING_NUM(n) (((n)&0xf) << 8)
  1167. #define CE_SEC_RF_CE_SRC_OUTSTANDING_NUM(n) (((n)&0xf) << 12)
  1168. // ce_cmd_stop_ctrl
  1169. #define CE_SEC_RF_CE_CMD_STOP (1 << 0)
  1170. #define CE_SEC_RF_CE_CMD_STOP_STATUS (1 << 1)
  1171. #define CE_SEC_RF_CE_CMD_STOP_CLEAR (1 << 4)
  1172. #define CE_SEC_RF_CE_PKA_CMD_STOP (1 << 8)
  1173. #define CE_SEC_RF_CE_PKA_CMD_STOP_STATUS (1 << 9)
  1174. #define CE_SEC_RF_CE_PKA_CMD_STOP_CLEAR (1 << 12)
  1175. // ce_axi_protect_sel
  1176. #define CE_SEC_SEC_AXI_PROT_SEL_EN (1 << 0)
  1177. #define CE_SEC_SEC_AXI_PROT_SEL_RKEY (1 << 1)
  1178. #define CE_SEC_SEC_AXI_PROT_SEL_RLIST (1 << 2)
  1179. #define CE_SEC_SEC_AXI_PROT_SEL_RTXT (1 << 3)
  1180. #define CE_SEC_SEC_AXI_PROT_SEL_WTXT (1 << 4)
  1181. #define CE_SEC_SEC_DUMMY(n) (((n)&0x7) << 5)
  1182. #define CE_SEC_PKA_AXI_PROT_SEL_EN (1 << 8)
  1183. #define CE_SEC_PKA_AXI_PROT_SEL_CMD (1 << 9)
  1184. #define CE_SEC_PKA_AXI_PROT_SEL_LD (1 << 10)
  1185. #define CE_SEC_PKA_AXI_PROT_SEL_ST (1 << 11)
  1186. #define CE_SEC_PKA_DUMMY(n) (((n)&0xf) << 12)
  1187. // ce_rng_en
  1188. #define CE_SEC_RF_CE_RNG_EN (1 << 0)
  1189. #define CE_SEC_RF_CE_TRNG_SRC_EN (1 << 1)
  1190. #define CE_SEC_RF_CE_RNG_SRC_FROM_CPU_ENABLE (1 << 2)
  1191. #define CE_SEC_RF_CE_RNG_RST_FROM_CPU (1 << 3)
  1192. #define CE_SEC_RF_CE_TRNG_PTEST_MODE_EN (1 << 4)
  1193. #define CE_SEC_RF_RNG_SRC_SEL_ENABLE(n) (((n)&0xff) << 8)
  1194. #define CE_SEC_RF_RNG_AUTO_ENABLE (1 << 16)
  1195. #define CE_SEC_RF_CE_RNG_MUX_RING_ENABLE (1 << 17)
  1196. #define CE_SEC_RF_CE_RNG_DATA_MUX_ENABLE (1 << 18)
  1197. // ce_rng_config
  1198. #define CE_SEC_RF_CE_RNG_RING_SEL(n) (((n)&0x7) << 0)
  1199. #define CE_SEC_RF_CE_RNG_TRNG_SEL (1 << 3)
  1200. #define CE_SEC_RF_CE_RNG_DATA_LEN_SEL (1 << 4)
  1201. #define CE_SEC_RF_CE_RNG_SOURCE_SEL(n) (((n)&0x3) << 5)
  1202. #define CE_SEC_RF_CE_RNG_EXOTIC_FAULT_RST_SEL (1 << 7)
  1203. #define CE_SEC_RF_CE_RNG_DATA_VALID_THRESHOLD(n) (((n)&0xf) << 8)
  1204. #define CE_SEC_RF_CE_RNG_PTEST_DATA_IN (1 << 16)
  1205. #define CE_SEC_NUMBER_OF_SAMPLES_THRESHOLD(n) (((n)&0xfff) << 20)
  1206. // ce_rng_sample_period
  1207. #define CE_SEC_RF_CE_RNG_SECOND_SAMPLE_PERIOD(n) (((n)&0xffff) << 0)
  1208. #define CE_SEC_RF_CE_RNG_FIRST_SAMPLE_PERIOD(n) (((n)&0x7fff) << 16)
  1209. #define CE_SEC_RF_CE_RNG_FIRST_SAMPLE_EN (1 << 31)
  1210. // ce_rng_post_process_en
  1211. #define CE_SEC_RF_CE_RNG_POST_FIRST_EN (1 << 0)
  1212. #define CE_SEC_RF_CE_RNG_POST_SECOND_EN (1 << 1)
  1213. #define CE_SEC_RF_CE_RNG_POST_THREE_EN (1 << 2)
  1214. #define CE_SEC_RF_CE_RNG_POST_FOUR_EN (1 << 3)
  1215. #define CE_SEC_RF_CE_RNG_POST_FIVE_EN (1 << 4)
  1216. #define CE_SEC_RF_CE_RNG_POST_SIX_EN (1 << 5)
  1217. #define CE_SEC_RF_CE_RNG_POST_SEVEN_EN (1 << 6)
  1218. #define CE_SEC_RF_CE_RNG_POST_EIGHT_EN (1 << 7)
  1219. // ce_rng_work_status
  1220. #define CE_SEC_RF_CE_RNG_AUTO_MODE_ONGOING (1 << 0)
  1221. #define CE_SEC_RF_CE_RNG_DATA_VALID (1 << 1)
  1222. #define CE_SEC_RF_RNG_RSA_PKA_BUSY (1 << 2)
  1223. #define CE_SEC_RF_CE_RNG_ERROR_FAULT (1 << 3)
  1224. #define CE_SEC_RF_CE_RNG_FIFO_EMPTY (1 << 4)
  1225. #define CE_SEC_RF_CE_RNG_DRBG_TEST_DATA_TYPE(n) (((n)&0x3) << 5)
  1226. #define CE_SEC_RF_CE_RNG_DRBG_TEST_RESULT_VLD (1 << 7)
  1227. #define CE_SEC_RF_CE_RNG_TEST_RESULT (1 << 8)
  1228. #define CE_SEC_RF_CE_RNG_ES_TEST_DONE (1 << 9)
  1229. #define CE_SEC_RF_CE_RNG_ES_TEST_FAIL (1 << 10)
  1230. #define CE_SEC_RF_CE_RNG_DRBG_TEST_DONE (1 << 11)
  1231. #define CE_SEC_RF_CE_RNG_DRBG_TEST_FAIL (1 << 12)
  1232. #define CE_SEC_RF_CE_RNG_DRBG_PATTERN_REQ (1 << 13)
  1233. #define CE_SEC_RF_CE_RNG_DRBG_TEST_PROCESS(n) (((n)&0x3) << 14)
  1234. #define CE_SEC_RF_CE_RNG_RSA_KEY_GEN_RAND_NUM(n) (((n)&0xffff) << 16)
  1235. // ce_rng_int_en
  1236. #define CE_SEC_RF_CE_RNG_PROCESS0_INT_EN (1 << 0)
  1237. #define CE_SEC_RF_CE_RNG_PROCESS1_INT_EN (1 << 1)
  1238. #define CE_SEC_RF_CE_RNG_PROCESS2_INT_EN (1 << 2)
  1239. #define CE_SEC_RF_CE_RNG_TIMEOUT_INT_EN (1 << 3)
  1240. #define CE_SEC_RF_CE_RNG_SRAM_SHORT_INT_EN (1 << 4)
  1241. #define CE_SEC_RF_CE_RNG_CONT_HTEST_INT_EN (1 << 5)
  1242. // ce_rng_sts
  1243. #define CE_SEC_RF_CE_RNG_PROCESS0_INT_STS (1 << 0)
  1244. #define CE_SEC_RF_CE_RNG_PROCESS1_INT_STS (1 << 1)
  1245. #define CE_SEC_RF_CE_RNG_PROCESS2_INT_STS (1 << 2)
  1246. #define CE_SEC_RF_CE_RNG_TIMEOUT_INT_STS (1 << 3)
  1247. #define CE_SEC_RF_CE_RNG_SRAM_SHORT_INT_STS (1 << 4)
  1248. #define CE_SEC_RF_CE_RNG_CON_HTEST_INT_STS (1 << 5)
  1249. // ce_rng_int_clr
  1250. #define CE_SEC_RF_CE_RNG_CLEAR_PROCESS0_INT (1 << 0)
  1251. #define CE_SEC_RF_CE_RNG_CLEAR_PROCESS1_INT (1 << 1)
  1252. #define CE_SEC_RF_CE_RNG_CLEAR_PROCESS2_INT (1 << 2)
  1253. #define CE_SEC_RF_CE_RNG_CLEAR_TIMEOUT_INT (1 << 3)
  1254. #define CE_SEC_RF_CE_RNG_CLEAR_SRAM_SHORT_INT (1 << 4)
  1255. #define CE_SEC_RF_CE_RNG_CLEAR_CON_HTEST_INT (1 << 5)
  1256. // ce_rng_mode
  1257. #define CE_SEC_RF_CE_RNG_MODE(n) (((n)&0x3) << 0)
  1258. #define CE_SEC_RF_CE_PRNG_MODE (1 << 8)
  1259. // ce_prng_seed_update
  1260. #define CE_SEC_RF_CE_PRNG_SEED_UPDATE (1 << 0)
  1261. // ce_rng_bit_rate
  1262. #define CE_SEC_RF_RNG_BIT_RATE(n) (((n)&0xffff) << 0)
  1263. #define CE_SEC_RF_RNG_GEN_BIT_CNT(n) (((n)&0xffff) << 16)
  1264. // ce_rng_sram_data_threshhold
  1265. #define CE_SEC_RF_CE_RNG_SRAM_VALID_THRESHHOLDD(n) (((n)&0xf) << 0)
  1266. // ce_rng_sram_data_residue_num
  1267. #define CE_SEC_RF_CE_RNG_SRAM_DATA_RESIDUE_NUM(n) (((n)&0xf) << 0)
  1268. // ce_rng_exotic_fault_counter_config
  1269. #define CE_SEC_RF_CE_EXOTIC_FAULT_COUNTER_CONFIG(n) (((n)&0xffff) << 0)
  1270. // ce_rng_drbg_seed_cnt
  1271. #define CE_SEC_RF_CE_RNG_DRBG_SEED_CNT(n) (((n)&0xffff) << 0)
  1272. // ce_rng_health_test_config
  1273. #define CE_SEC_RF_CE_RNG_ES_TEST_EN (1 << 0)
  1274. #define CE_SEC_RF_CE_RNG_DRBG_TEST_EN (1 << 1)
  1275. #define CE_SEC_RF_CE_RNG_LONG_TERM_BIT_MAX(n) (((n)&0x3f) << 2)
  1276. #define CE_SEC_RF_CE_RNG_ONES_FREQ_MAX(n) (((n)&0x7ff) << 8)
  1277. // ce_secure_key_use_way
  1278. #define CE_SEC_RF_CE_SECURE_KEY2_EN (1 << 0)
  1279. #define CE_SEC_RF_CE_SECURE_KEY1_START_RADDR(n) (((n)&0x3ff) << 1)
  1280. #define CE_SEC_RF_CE_SECURE_KEY2_START_RADDR(n) (((n)&0x3ff) << 11)
  1281. #define CE_SEC_RF_CE_SECURE_KEY_LEN(n) (((n)&0x1ff) << 21)
  1282. #define CE_SEC_RF_CE_SECURE_KEY_CPU_ACCESS (1 << 30)
  1283. #define CE_SEC_RF_CE_SECURE_KEY_TRNG_WRITE (1 << 31)
  1284. // ce_huk_key_config
  1285. #define CE_SEC_RF_CE_WRITE_EFS_LENGTH(n) (((n)&0xff) << 0)
  1286. #define CE_SEC_RF_CE_WRITE_EFS_ADDR(n) (((n)&0xffff) << 16)
  1287. // ce_pka_key_config
  1288. #define CE_SEC_RF_PKA_WRITE_EFS_START_ADDR(n) (((n)&0x3ff) << 0)
  1289. #define CE_SEC_RF_PKA_WRITE_EFS_END_ADDR(n) (((n)&0x3ff) << 16)
  1290. // ce_dump_addr_hi
  1291. #define CE_SEC_RF_CE_RCV_ADDR_HI(n) (((n)&0xf) << 0)
  1292. #define CE_SEC_RF_CE_DUMP_ADDR_HI(n) (((n)&0xf) << 4)
  1293. // ce_pka_store_addr_hi
  1294. #define CE_SEC_RF_CE_PKA_STORE_ADDR_HI(n) (((n)&0x7ffff) << 0)
  1295. // ce_pka_load_addr_hi
  1296. #define CE_SEC_RF_CE_PKA_LOAD_ADDR_HI(n) (((n)&0x7ffff) << 0)
  1297. // ce_pka_start
  1298. #define CE_SEC_RF_CE_PKA_START (1 << 0)
  1299. // ce_pka_clear
  1300. #define CE_SEC_RF_CE_PKA_CLEAR (1 << 0)
  1301. // ce_pka_rng_force_ssb_bit
  1302. #define CE_SEC_RF_CE_PKA_RNG_FORCE_SSB_BIT (1 << 0)
  1303. // ce_pka_ctrl_operate_bit
  1304. #define CE_SEC_CE_PKA_STORE_LIMIT_CFG_DISABLE (1 << 0)
  1305. // ce_pka_efs_debug_status
  1306. #define CE_SEC_RF_PKA_WRITE_EFUSE_COUNT(n) (((n)&0xff) << 0)
  1307. #define CE_SEC_RF_PKA_READ_EFUSE_COUNT(n) (((n)&0xff) << 8)
  1308. #define CE_SEC_RF_PKA_AND_HUK_ACCESS_EFUSE_STATUS(n) (((n)&0xf) << 16)
  1309. #define CE_SEC_RF_PKA_ACCESS_EFUSE_FLAG(n) (((n)&0xf) << 20)
  1310. #endif // _CE_SEC_H_