efuse.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415
  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 _EFUSE_H_
  13. #define _EFUSE_H_
  14. // Auto generated by dtools(see dtools.txt for its version).
  15. // Don't edit it manually!
  16. #define REG_EFUSE_BASE (0x51200000)
  17. typedef volatile struct
  18. {
  19. uint32_t __0[2]; // 0x00000000
  20. uint32_t efuse_all0_index; // 0x00000008
  21. uint32_t efuse_mode_ctrl; // 0x0000000c
  22. uint32_t efuse_cfg1; // 0x00000010
  23. uint32_t efuse_ip_ver; // 0x00000014
  24. uint32_t efuse_cfg0; // 0x00000018
  25. uint32_t efuse_cfg2; // 0x0000001c
  26. uint32_t efuse_ns_en; // 0x00000020
  27. uint32_t efuse_ns_err_flag; // 0x00000024
  28. uint32_t efuse_ns_flag_clr; // 0x00000028
  29. uint32_t efuse_ns_magic_number; // 0x0000002c
  30. uint32_t __48[4]; // 0x00000030
  31. uint32_t efuse_s_en; // 0x00000040
  32. uint32_t efuse_s_err_flag; // 0x00000044
  33. uint32_t efuse_s_flag_clr; // 0x00000048
  34. uint32_t efuse_s_magic_number; // 0x0000004c
  35. uint32_t efuse_fw_cfg; // 0x00000050
  36. uint32_t efuse_pw_swt; // 0x00000054
  37. uint32_t __88[4]; // 0x00000058
  38. uint32_t pw_on_rd_end_flag; // 0x00000068
  39. uint32_t ns_s_flag; // 0x0000006c
  40. uint32_t por_read_data_sp; // 0x00000070
  41. uint32_t por_read_data_sp1; // 0x00000074
  42. uint32_t block3; // 0x00000078
  43. uint32_t block89; // 0x0000007c
  44. uint32_t efuse_enc_bypass_en; // 0x00000080
  45. } HWP_EFUSE_T;
  46. #define hwp_efuse ((HWP_EFUSE_T *)REG_ACCESS_ADDRESS(REG_EFUSE_BASE))
  47. // efuse_all0_index
  48. typedef union {
  49. uint32_t v;
  50. struct
  51. {
  52. uint32_t efuse_all0_end_index : 16; // [15:0]
  53. uint32_t efuse_all0_start_index : 16; // [31:16]
  54. } b;
  55. } REG_EFUSE_EFUSE_ALL0_INDEX_T;
  56. // efuse_mode_ctrl
  57. typedef union {
  58. uint32_t v;
  59. struct
  60. {
  61. uint32_t efuse_all0_check_start : 1; // [0]
  62. uint32_t __31_1 : 31; // [31:1]
  63. } b;
  64. } REG_EFUSE_EFUSE_MODE_CTRL_T;
  65. // efuse_cfg1
  66. typedef union {
  67. uint32_t v;
  68. struct
  69. {
  70. uint32_t tpgm_time_cnt1 : 9; // [8:0]
  71. uint32_t __15_9 : 7; // [15:9]
  72. uint32_t tpgm_time_cnt2 : 9; // [24:16]
  73. uint32_t __31_25 : 7; // [31:25]
  74. } b;
  75. } REG_EFUSE_EFUSE_CFG1_T;
  76. // efuse_ip_ver
  77. typedef union {
  78. uint32_t v;
  79. struct
  80. {
  81. uint32_t efuse_ip_ver : 16; // [15:0], read only
  82. uint32_t efuse_type : 2; // [17:16], read only
  83. uint32_t __31_18 : 14; // [31:18]
  84. } b;
  85. } REG_EFUSE_EFUSE_IP_VER_T;
  86. // efuse_cfg0
  87. typedef union {
  88. uint32_t v;
  89. struct
  90. {
  91. uint32_t tpgm_time_cnt : 9; // [8:0]
  92. uint32_t __15_9 : 7; // [15:9]
  93. uint32_t efuse_strobe_low_width : 8; // [23:16]
  94. uint32_t clk_efs_div : 8; // [31:24]
  95. } b;
  96. } REG_EFUSE_EFUSE_CFG0_T;
  97. // efuse_cfg2
  98. typedef union {
  99. uint32_t v;
  100. struct
  101. {
  102. uint32_t tpgm_time_cnt3 : 9; // [8:0]
  103. uint32_t __15_9 : 7; // [15:9]
  104. uint32_t tpgm_time_bist : 9; // [24:16]
  105. uint32_t __31_25 : 7; // [31:25]
  106. } b;
  107. } REG_EFUSE_EFUSE_CFG2_T;
  108. // efuse_ns_en
  109. typedef union {
  110. uint32_t v;
  111. struct
  112. {
  113. uint32_t ns_vdd_en : 1; // [0]
  114. uint32_t ns_auto_check_enable : 1; // [1]
  115. uint32_t double_bit_en_ns : 1; // [2]
  116. uint32_t ns_margin_rd_enable : 1; // [3]
  117. uint32_t ns_lock_bit_wr_en : 1; // [4]
  118. uint32_t __31_5 : 27; // [31:5]
  119. } b;
  120. } REG_EFUSE_EFUSE_NS_EN_T;
  121. // efuse_ns_err_flag
  122. typedef union {
  123. uint32_t v;
  124. struct
  125. {
  126. uint32_t ns_word0_err_flag : 1; // [0], read only
  127. uint32_t ns_word1_err_flag : 1; // [1], read only
  128. uint32_t __3_2 : 2; // [3:2]
  129. uint32_t ns_word0_prot_flag : 1; // [4], read only
  130. uint32_t ns_word1_prot_flag : 1; // [5], read only
  131. uint32_t __7_6 : 2; // [7:6]
  132. uint32_t ns_pg_en_wr_flag : 1; // [8], read only
  133. uint32_t ns_vdd_on_rd_flag : 1; // [9], read only
  134. uint32_t ns_block0_rd_flag : 1; // [10], read only
  135. uint32_t ns_magnum_wr_flag : 1; // [11], read only
  136. uint32_t ns_enk_err_flag : 1; // [12], read only
  137. uint32_t ns_all0_check_flag : 1; // [13], read only
  138. uint32_t __31_14 : 18; // [31:14]
  139. } b;
  140. } REG_EFUSE_EFUSE_NS_ERR_FLAG_T;
  141. // efuse_ns_flag_clr
  142. typedef union {
  143. uint32_t v;
  144. struct
  145. {
  146. uint32_t ns_word0_err_clr : 1; // [0]
  147. uint32_t ns_word1_err_clr : 1; // [1]
  148. uint32_t __3_2 : 2; // [3:2]
  149. uint32_t ns_word0_prot_clr : 1; // [4]
  150. uint32_t ns_word1_prot_clr : 1; // [5]
  151. uint32_t __7_6 : 2; // [7:6]
  152. uint32_t ns_pg_en_wr_clr : 1; // [8]
  153. uint32_t ns_vdd_on_rd_clr : 1; // [9]
  154. uint32_t ns_block0_rd_clr : 1; // [10]
  155. uint32_t ns_magnum_wr_clr : 1; // [11]
  156. uint32_t ns_enk_err_clr : 1; // [12]
  157. uint32_t ns_all0_check_clr : 1; // [13]
  158. uint32_t __31_14 : 18; // [31:14]
  159. } b;
  160. } REG_EFUSE_EFUSE_NS_FLAG_CLR_T;
  161. // efuse_ns_magic_number
  162. typedef union {
  163. uint32_t v;
  164. struct
  165. {
  166. uint32_t ns_magic_nubmer : 16; // [15:0]
  167. uint32_t __31_16 : 16; // [31:16]
  168. } b;
  169. } REG_EFUSE_EFUSE_NS_MAGIC_NUMBER_T;
  170. // efuse_s_en
  171. typedef union {
  172. uint32_t v;
  173. struct
  174. {
  175. uint32_t s_vdd_en : 1; // [0]
  176. uint32_t s_auto_check_enable : 1; // [1]
  177. uint32_t double_bit_en_s : 1; // [2]
  178. uint32_t s_margin_rd_enable : 1; // [3]
  179. uint32_t s_lock_bit_wr_en : 1; // [4]
  180. uint32_t __31_5 : 27; // [31:5]
  181. } b;
  182. } REG_EFUSE_EFUSE_S_EN_T;
  183. // efuse_s_err_flag
  184. typedef union {
  185. uint32_t v;
  186. struct
  187. {
  188. uint32_t s_word0_err_flag : 1; // [0], read only
  189. uint32_t s_word1_err_flag : 1; // [1], read only
  190. uint32_t __3_2 : 2; // [3:2]
  191. uint32_t s_word0_prot_flag : 1; // [4], read only
  192. uint32_t s_word1_prot_flag : 1; // [5], read only
  193. uint32_t __7_6 : 2; // [7:6]
  194. uint32_t s_pg_en_wr_flag : 1; // [8], read only
  195. uint32_t s_vdd_on_rd_flag : 1; // [9], read only
  196. uint32_t s_block0_rd_flag : 1; // [10], read only
  197. uint32_t s_magnum_wr_flag : 1; // [11], read only
  198. uint32_t s_enk_err_flag : 1; // [12], read only
  199. uint32_t s_all0_check_flag : 1; // [13], read only
  200. uint32_t __31_14 : 18; // [31:14]
  201. } b;
  202. } REG_EFUSE_EFUSE_S_ERR_FLAG_T;
  203. // efuse_s_flag_clr
  204. typedef union {
  205. uint32_t v;
  206. struct
  207. {
  208. uint32_t s_word0_err_clr : 1; // [0]
  209. uint32_t s_word1_err_clr : 1; // [1]
  210. uint32_t __3_2 : 2; // [3:2]
  211. uint32_t s_word0_prot_clr : 1; // [4]
  212. uint32_t s_word1_prot_clr : 1; // [5]
  213. uint32_t __7_6 : 2; // [7:6]
  214. uint32_t s_pg_en_wr_clr : 1; // [8]
  215. uint32_t s_vdd_on_rd_clr : 1; // [9]
  216. uint32_t s_block0_rd_clr : 1; // [10]
  217. uint32_t s_magnum_wr_clr : 1; // [11]
  218. uint32_t s_enk_err_clr : 1; // [12]
  219. uint32_t s_all0_check_clr : 1; // [13]
  220. uint32_t __31_14 : 18; // [31:14]
  221. } b;
  222. } REG_EFUSE_EFUSE_S_FLAG_CLR_T;
  223. // efuse_s_magic_number
  224. typedef union {
  225. uint32_t v;
  226. struct
  227. {
  228. uint32_t s_magic_nubmer : 16; // [15:0]
  229. uint32_t __31_16 : 16; // [31:16]
  230. } b;
  231. } REG_EFUSE_EFUSE_S_MAGIC_NUMBER_T;
  232. // efuse_fw_cfg
  233. typedef union {
  234. uint32_t v;
  235. struct
  236. {
  237. uint32_t conf_prot : 1; // [0]
  238. uint32_t access_prot : 1; // [1]
  239. uint32_t __31_2 : 30; // [31:2]
  240. } b;
  241. } REG_EFUSE_EFUSE_FW_CFG_T;
  242. // efuse_pw_swt
  243. typedef union {
  244. uint32_t v;
  245. struct
  246. {
  247. uint32_t efs_enk1_on : 1; // [0]
  248. uint32_t efs_enk2_on : 1; // [1]
  249. uint32_t ns_s_pg_en : 1; // [2]
  250. uint32_t __31_3 : 29; // [31:3]
  251. } b;
  252. } REG_EFUSE_EFUSE_PW_SWT_T;
  253. // pw_on_rd_end_flag
  254. typedef union {
  255. uint32_t v;
  256. struct
  257. {
  258. uint32_t pw_on_rd_end_flag : 1; // [0], read only
  259. uint32_t __31_1 : 31; // [31:1]
  260. } b;
  261. } REG_EFUSE_PW_ON_RD_END_FLAG_T;
  262. // ns_s_flag
  263. typedef union {
  264. uint32_t v;
  265. struct
  266. {
  267. uint32_t ns_s_flag : 1; // [0], read only
  268. uint32_t __31_1 : 31; // [31:1]
  269. } b;
  270. } REG_EFUSE_NS_S_FLAG_T;
  271. // efuse_enc_bypass_en
  272. typedef union {
  273. uint32_t v;
  274. struct
  275. {
  276. uint32_t efuse_enc_bypass_en : 8; // [7:0]
  277. uint32_t __31_8 : 24; // [31:8]
  278. } b;
  279. } REG_EFUSE_EFUSE_ENC_BYPASS_EN_T;
  280. // efuse_all0_index
  281. #define EFUSE_EFUSE_ALL0_END_INDEX(n) (((n)&0xffff) << 0)
  282. #define EFUSE_EFUSE_ALL0_START_INDEX(n) (((n)&0xffff) << 16)
  283. // efuse_mode_ctrl
  284. #define EFUSE_EFUSE_ALL0_CHECK_START (1 << 0)
  285. // efuse_cfg1
  286. #define EFUSE_TPGM_TIME_CNT1(n) (((n)&0x1ff) << 0)
  287. #define EFUSE_TPGM_TIME_CNT2(n) (((n)&0x1ff) << 16)
  288. // efuse_ip_ver
  289. #define EFUSE_EFUSE_IP_VER(n) (((n)&0xffff) << 0)
  290. #define EFUSE_EFUSE_TYPE(n) (((n)&0x3) << 16)
  291. // efuse_cfg0
  292. #define EFUSE_TPGM_TIME_CNT(n) (((n)&0x1ff) << 0)
  293. #define EFUSE_EFUSE_STROBE_LOW_WIDTH(n) (((n)&0xff) << 16)
  294. #define EFUSE_CLK_EFS_DIV(n) (((n)&0xff) << 24)
  295. // efuse_cfg2
  296. #define EFUSE_TPGM_TIME_CNT3(n) (((n)&0x1ff) << 0)
  297. #define EFUSE_TPGM_TIME_BIST(n) (((n)&0x1ff) << 16)
  298. // efuse_ns_en
  299. #define EFUSE_NS_VDD_EN (1 << 0)
  300. #define EFUSE_NS_AUTO_CHECK_ENABLE (1 << 1)
  301. #define EFUSE_DOUBLE_BIT_EN_NS (1 << 2)
  302. #define EFUSE_NS_MARGIN_RD_ENABLE (1 << 3)
  303. #define EFUSE_NS_LOCK_BIT_WR_EN (1 << 4)
  304. // efuse_ns_err_flag
  305. #define EFUSE_NS_WORD0_ERR_FLAG (1 << 0)
  306. #define EFUSE_NS_WORD1_ERR_FLAG (1 << 1)
  307. #define EFUSE_NS_WORD0_PROT_FLAG (1 << 4)
  308. #define EFUSE_NS_WORD1_PROT_FLAG (1 << 5)
  309. #define EFUSE_NS_PG_EN_WR_FLAG (1 << 8)
  310. #define EFUSE_NS_VDD_ON_RD_FLAG (1 << 9)
  311. #define EFUSE_NS_BLOCK0_RD_FLAG (1 << 10)
  312. #define EFUSE_NS_MAGNUM_WR_FLAG (1 << 11)
  313. #define EFUSE_NS_ENK_ERR_FLAG (1 << 12)
  314. #define EFUSE_NS_ALL0_CHECK_FLAG (1 << 13)
  315. // efuse_ns_flag_clr
  316. #define EFUSE_NS_WORD0_ERR_CLR (1 << 0)
  317. #define EFUSE_NS_WORD1_ERR_CLR (1 << 1)
  318. #define EFUSE_NS_WORD0_PROT_CLR (1 << 4)
  319. #define EFUSE_NS_WORD1_PROT_CLR (1 << 5)
  320. #define EFUSE_NS_PG_EN_WR_CLR (1 << 8)
  321. #define EFUSE_NS_VDD_ON_RD_CLR (1 << 9)
  322. #define EFUSE_NS_BLOCK0_RD_CLR (1 << 10)
  323. #define EFUSE_NS_MAGNUM_WR_CLR (1 << 11)
  324. #define EFUSE_NS_ENK_ERR_CLR (1 << 12)
  325. #define EFUSE_NS_ALL0_CHECK_CLR (1 << 13)
  326. // efuse_ns_magic_number
  327. #define EFUSE_NS_MAGIC_NUBMER(n) (((n)&0xffff) << 0)
  328. // efuse_s_en
  329. #define EFUSE_S_VDD_EN (1 << 0)
  330. #define EFUSE_S_AUTO_CHECK_ENABLE (1 << 1)
  331. #define EFUSE_DOUBLE_BIT_EN_S (1 << 2)
  332. #define EFUSE_S_MARGIN_RD_ENABLE (1 << 3)
  333. #define EFUSE_S_LOCK_BIT_WR_EN (1 << 4)
  334. // efuse_s_err_flag
  335. #define EFUSE_S_WORD0_ERR_FLAG (1 << 0)
  336. #define EFUSE_S_WORD1_ERR_FLAG (1 << 1)
  337. #define EFUSE_S_WORD0_PROT_FLAG (1 << 4)
  338. #define EFUSE_S_WORD1_PROT_FLAG (1 << 5)
  339. #define EFUSE_S_PG_EN_WR_FLAG (1 << 8)
  340. #define EFUSE_S_VDD_ON_RD_FLAG (1 << 9)
  341. #define EFUSE_S_BLOCK0_RD_FLAG (1 << 10)
  342. #define EFUSE_S_MAGNUM_WR_FLAG (1 << 11)
  343. #define EFUSE_S_ENK_ERR_FLAG (1 << 12)
  344. #define EFUSE_S_ALL0_CHECK_FLAG (1 << 13)
  345. // efuse_s_flag_clr
  346. #define EFUSE_S_WORD0_ERR_CLR (1 << 0)
  347. #define EFUSE_S_WORD1_ERR_CLR (1 << 1)
  348. #define EFUSE_S_WORD0_PROT_CLR (1 << 4)
  349. #define EFUSE_S_WORD1_PROT_CLR (1 << 5)
  350. #define EFUSE_S_PG_EN_WR_CLR (1 << 8)
  351. #define EFUSE_S_VDD_ON_RD_CLR (1 << 9)
  352. #define EFUSE_S_BLOCK0_RD_CLR (1 << 10)
  353. #define EFUSE_S_MAGNUM_WR_CLR (1 << 11)
  354. #define EFUSE_S_ENK_ERR_CLR (1 << 12)
  355. #define EFUSE_S_ALL0_CHECK_CLR (1 << 13)
  356. // efuse_s_magic_number
  357. #define EFUSE_S_MAGIC_NUBMER(n) (((n)&0xffff) << 0)
  358. // efuse_fw_cfg
  359. #define EFUSE_CONF_PROT (1 << 0)
  360. #define EFUSE_ACCESS_PROT (1 << 1)
  361. // efuse_pw_swt
  362. #define EFUSE_EFS_ENK1_ON (1 << 0)
  363. #define EFUSE_EFS_ENK2_ON (1 << 1)
  364. #define EFUSE_NS_S_PG_EN (1 << 2)
  365. // pw_on_rd_end_flag
  366. #define EFUSE_PW_ON_RD_END_FLAG (1 << 0)
  367. // ns_s_flag
  368. #define EFUSE_NS_S_FLAG (1 << 0)
  369. // efuse_enc_bypass_en
  370. #define EFUSE_EFUSE_ENC_BYPASS_EN(n) (((n)&0xff) << 0)
  371. #endif // _EFUSE_H_