hal_efuse_def.h 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. /* Copyright (C) 2020 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 _HAL_EFUSE_DEF_H_
  13. #define _HAL_EFUSE_DEF_H_
  14. #include "osi_compiler.h"
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. #define HAL_EFUSE_SINGLE_BLOCK_COUNT (192)
  19. #define HAL_EFUSE_DOUBLE_BLOCK_COUNT (HAL_EFUSE_SINGLE_BLOCK_COUNT / 2)
  20. #define HAL_EFUSE_SINGLE_BLOCK_LOCK_0 (0)
  21. #define HAL_EFUSE_SINGLE_BLOCK_LOCK_1 (1)
  22. #define HAL_EFUSE_SINGLE_BLOCK_LOCK_2 (2)
  23. #define HAL_EFUSE_SINGLE_BLOCK_LOCK_3 (3)
  24. #define HAL_EFUSE_SINGLE_BLOCK_LOCK_4 (4)
  25. #define HAL_EFUSE_SINGLE_BLOCK_LOCK_5 (5)
  26. #define HAL_EFUSE_DOUBLE_BLOCK_RMA (3)
  27. #define HAL_EFUSE_DOUBLE_BLOCK_MEDKEY_0 (4) // inaccessible
  28. #define HAL_EFUSE_DOUBLE_BLOCK_MEDKEY_3 (7) // inaccessible
  29. #define HAL_EFUSE_DOUBLE_BLOCK_HUK_0 (8) // inaccessible
  30. #define HAL_EFUSE_DOUBLE_BLOCK_HUK_7 (15) // inaccessible
  31. #define HAL_EFUSE_DOUBLE_BLOCK_PRIKEY1_0 (16) // inaccessible
  32. #define HAL_EFUSE_DOUBLE_BLOCK_PRIKEY1_7 (23) // inaccessible
  33. #define HAL_EFUSE_DOUBLE_BLOCK_PRIKEY2_0 (24) // inaccessible
  34. #define HAL_EFUSE_DOUBLE_BLOCK_PRIKEY2_7 (31) // inaccessible
  35. #define HAL_EFUSE_DOUBLE_BLOCK_SK_0 (32) // inaccessible
  36. #define HAL_EFUSE_DOUBLE_BLOCK_SK_7 (39) // inaccessible
  37. #define HAL_EFUSE_DOUBLE_BLOCK_KCE_0 (40) // writable, unreadable
  38. #define HAL_EFUSE_DOUBLE_BLOCK_KCE_1 (41) // writable, unreadable
  39. #define HAL_EFUSE_DOUBLE_BLOCK_KCE_2 (42) // writable, unreadable
  40. #define HAL_EFUSE_DOUBLE_BLOCK_KCE_3 (43) // writable, unreadable
  41. #define HAL_EFUSE_DOUBLE_BLOCK_KCE_4 (44) // writable, unreadable
  42. #define HAL_EFUSE_DOUBLE_BLOCK_KCE_5 (45) // writable, unreadable
  43. #define HAL_EFUSE_DOUBLE_BLOCK_KCE_6 (46) // writable, unreadable
  44. #define HAL_EFUSE_DOUBLE_BLOCK_KCE_7 (47) // writable, unreadable
  45. #define HAL_EFUSE_DOUBLE_BLOCK_ROTPK_0 (48)
  46. #define HAL_EFUSE_DOUBLE_BLOCK_ROTPK_1 (49)
  47. #define HAL_EFUSE_DOUBLE_BLOCK_ROTPK_2 (50)
  48. #define HAL_EFUSE_DOUBLE_BLOCK_ROTPK_3 (51)
  49. #define HAL_EFUSE_DOUBLE_BLOCK_ROTPK_4 (52)
  50. #define HAL_EFUSE_DOUBLE_BLOCK_ROTPK_5 (53)
  51. #define HAL_EFUSE_DOUBLE_BLOCK_ROTPK_6 (54)
  52. #define HAL_EFUSE_DOUBLE_BLOCK_ROTPK_7 (55)
  53. #define HAL_EFUSE_DOUBLE_BLOCK_SM_FW_HASH_0 (56)
  54. #define HAL_EFUSE_DOUBLE_BLOCK_SM_FW_HASH_1 (57)
  55. #define HAL_EFUSE_DOUBLE_BLOCK_SM_FW_HASH_2 (58)
  56. #define HAL_EFUSE_DOUBLE_BLOCK_SM_FW_HASH_3 (59)
  57. #define HAL_EFUSE_DOUBLE_BLOCK_SM_FW_HASH_4 (60)
  58. #define HAL_EFUSE_DOUBLE_BLOCK_SM_FW_HASH_5 (61)
  59. #define HAL_EFUSE_DOUBLE_BLOCK_SM_FW_HASH_6 (62)
  60. #define HAL_EFUSE_DOUBLE_BLOCK_SM_FW_HASH_7 (63)
  61. #define HAL_EFUSE_DOUBLE_BLOCK_NONSECURE_COUNTER_0 (64)
  62. #define HAL_EFUSE_DOUBLE_BLOCK_NONSECURE_COUNTER_7 (71)
  63. #define HAL_EFUSE_DOUBLE_BLOCK_SECURE_COUNTER1_0 (72)
  64. #define HAL_EFUSE_DOUBLE_BLOCK_SECURE_COUNTER1_1 (73)
  65. #define HAL_EFUSE_DOUBLE_BLOCK_SECURE_COUNTER2_0 (74)
  66. #define HAL_EFUSE_DOUBLE_BLOCK_SECURE_COUNTER2_1 (75)
  67. #define HAL_EFUSE_DOUBLE_BLOCK_SIMLOCK_COUNTER_0 (76)
  68. #define HAL_EFUSE_DOUBLE_BLOCK_SIMLOCK_COUNTER_1 (77)
  69. #define HAL_EFUSE_DOUBLE_BLOCK_SM_BONDING (80)
  70. #define HAL_EFUSE_DOUBLE_BLOCK_BONDING (89)
  71. #define HAL_EFUSE_DOUBLE_BLOCK_USB (90)
  72. #define HAL_EFUSE_SINGLE_BLOCK_UID_0 (190)
  73. #define HAL_EFUSE_SINGLE_BLOCK_UID_1 (191)
  74. typedef union {
  75. uint32_t v;
  76. struct
  77. {
  78. uint32_t enable_secure_boot : 1; // [0]
  79. uint32_t __1 : 1; // [1]
  80. uint32_t disable_swd_jtag : 1; // [2]
  81. uint32_t disable_apa5_debug : 1; // [3]
  82. uint32_t disable_cpa5_debug : 1; // [4]
  83. uint32_t disable_fdma : 1; // [5]
  84. uint32_t disable_swd_dbg_sys : 1; // [6]
  85. uint32_t disable_djtag : 1; // [7]
  86. uint32_t disable_pad_jtag : 1; // [8]
  87. uint32_t disable_dbghost : 1; // [9]
  88. uint32_t disable_sec_dap : 1; // [10]
  89. uint32_t disable_med_soft_key : 1; // [11]
  90. uint32_t __12 : 1; // [12]
  91. uint32_t disable_ptest : 1; // [13]
  92. uint32_t disable_develcert : 1; // [14]
  93. uint32_t enable_boot_med_encrypt : 1; // [15]
  94. uint32_t disable_faster_flash : 1; // [16]
  95. uint32_t disable_uart1_boot : 1; // [17]
  96. uint32_t __19_18 : 2; // [19:18]
  97. uint32_t boot_sector_count : 8; // [27:20]
  98. uint32_t disable_download : 1; // [28]
  99. uint32_t disable_keypad_entermode : 1; // [29]
  100. uint32_t disable_usb_boot : 1; // [30]
  101. uint32_t disable_sdcard_boot : 1; // [31]
  102. } b;
  103. } halEfuseBonding_t;
  104. typedef union {
  105. uint32_t v;
  106. struct
  107. {
  108. uint32_t firmware_selection : 2; // [1:0]
  109. uint32_t life_cycle : 3; // [4:2]
  110. uint32_t destroy_key : 2; // [6:5]
  111. uint32_t dont_use_rng_pattern : 2; // [8:7]
  112. uint32_t rng_param : 3; // [11:9]
  113. uint32_t disable_param : 2; // [12]
  114. uint32_t __31_13 : 19; // [31:13]
  115. } b;
  116. } halEfuseSmBonding_t;
  117. typedef union {
  118. uint32_t v;
  119. struct
  120. {
  121. uint32_t rma_huk : 1; // [0]
  122. uint32_t rma_med : 1; // [1]
  123. uint32_t rma_iapk1 : 1; // [2]
  124. uint32_t rma_iapk2 : 1; // [3]
  125. uint32_t rma_sk : 1; // [4]
  126. uint32_t rma_kce_lo : 1; // [5]
  127. uint32_t rma_kce_hi : 1; // [6]
  128. uint32_t __31_7 : 25; // [31:7]
  129. } b;
  130. } halEfuseRma_t;
  131. typedef union {
  132. uint32_t v;
  133. struct
  134. {
  135. uint32_t lock0 : 1; // [0]
  136. uint32_t lock1 : 1; // [1]
  137. uint32_t lock2 : 1; // [2]
  138. uint32_t lock3 : 1; // [3]
  139. uint32_t lock4 : 1; // [4]
  140. uint32_t lock5 : 1; // [5]
  141. uint32_t rma : 2; // [7:6]
  142. uint32_t med : 8; // [15:8]
  143. uint32_t huk : 16; // [31:16]
  144. } b;
  145. } halEfuseLock0_t;
  146. typedef union {
  147. uint32_t v;
  148. struct
  149. {
  150. uint32_t attestation_1 : 16; // [15:0]
  151. uint32_t attestation_2 : 16; // [31:16]
  152. } b;
  153. } halEfuseLock1_t;
  154. typedef union {
  155. uint32_t v;
  156. struct
  157. {
  158. uint32_t sm2 : 16; // [15:0]
  159. uint32_t kce : 16; // [31:16]
  160. } b;
  161. } halEfuseLock2_t;
  162. typedef union {
  163. uint32_t v;
  164. struct
  165. {
  166. uint32_t rotpk : 16; // [15:0]
  167. uint32_t simlock : 16; // [31:16]
  168. } b;
  169. } halEfuseLock3_t;
  170. typedef union {
  171. uint32_t v;
  172. struct
  173. {
  174. uint32_t __7_0 : 8; // [7:0]
  175. uint32_t __15_8 : 8; // [15:8]
  176. uint32_t ns_counter : 16; // [31:16]
  177. } b;
  178. } halEfuseLock4_t;
  179. typedef union {
  180. uint32_t v;
  181. struct
  182. {
  183. uint32_t secure_counter1 : 4; // [3:0]
  184. uint32_t secure_counter2 : 4; // [7:4]
  185. uint32_t integrity : 2; // [9:8]
  186. uint32_t __15_10 : 6; // [15:10]
  187. uint32_t sm_bonding : 2; // [17:16]
  188. uint32_t bonding : 2; // [19:18]
  189. uint32_t rf_usb_ldo : 8; // [27:20]
  190. uint32_t __28 : 1; // [28]
  191. uint32_t pts : 1; // [29]
  192. uint32_t uid : 2; // [31:30]
  193. } b;
  194. } halEfuseLock5_t;
  195. #ifdef __cplusplus
  196. }
  197. #endif
  198. #endif