WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
hal_pke_reg.h
浏览该文件的文档.
1
8#ifndef HAL_PKE_REG_H
9#define HAL_PKE_REG_H
10
11/************************************************** reg related MICRO DEFINE start************************************/
12/* Define non-special val for secure enhancement */
13#define PKE_NON_SPECIAL_VAL 0xA5C36987 // 0xA5C36987 is for secure enhancement (with bit 0/1 the same count)
14#define PKE_START0_CODE 0xAA5
15#define PKE_START1_CODE 0xA5A
16#define PKE_BATCH_START_CODE 0x5AA
17#define PKE_INT_NOMASK_FINISH_EFFECTIVE_CODE 0x5
18#define PKE_INT_NOMASK_FINISH_INVALID_CODE 0xA
19#define PKE_ALARM_STATUS_EFFECTIVE_CODE 0x5
20#define PKE_ALARM_STATUS_INVALID_CODE 0xA
21#define PKE_ALARM_STATUS_CLEAN_CODE 0x6B4A89C6
22#define DEFAULT_MASK_CODE 0xE69BC3A7
23#define PKE_DRAM_BLOCK_LENGTH 32
24#define ALIGNED_TO_WORK_LEN_IN_BYTE 8
25#define PKE_MONT_PARAM_LEN 2
26#define PKE_FAIL_FLAG_CNT 0xB
27#define PKE_MONT_BIT_LEN 64
28
29/* define logic related register micro. */
30#define PKE_WORK_LEN (0x00)
31#define PKE_INSTR0 (0x04)
32#define PKE_INSTR1 (0x08)
33#define PKE_INSTR_ADDR_LOW (0x0c)
34#define PKE_INSTR_ADDR_HIG (0x10)
35#define PKE_INSTR_LEN (0x14)
36#define PKE_MASK_RNG_CFG (0x18)
37#define PKE_MONT_PARA0 (0x20)
38#define PKE_MONT_PARA1 (0x24)
39#define PKE_INSTR_RDY (0x44)
40#define PKE_BUSY (0x48)
41#define PKE_NOISE_EN (0x4c)
42#define PKE_START (0x40)
43#define PKE_INT_ENABLE (0x80)
44#define PKE_INT_NOMASK_STATUS (0x84)
45#define PKE_ALARM_STATUS (0x8c)
46#define PKE_FAILURE_FLAG (0x90)
47#define PKE_DRAM_CLR (0xc0)
48#define PKE_DRAM_MASK (0xf0)
49#define PKE_LOCK_CTRL (0x810)
50#define PKE_LOCK_STATUS (0x814)
51#define PKE_DRAM_BASE (0x1000)
52
53/* define the instr mode num */
54#define CMD_MUL_MOD 0
55#define CMD_ADD_MOD 1
56#define CMD_SUB_MOD 2
57#define MAX_RAM_SECTION 127
58#define OPCODE_OFFSET 0
59#define APOS_OFFSET 4
60#define BPOS_OFFSET 11
61#define TPOS_OFFSET 18
62#define RPOS_OFFSET 25
63
64/************************************************** reg related MICRO DEFINE end************************************/
65
66/************************************************** reg related struct start************************************/
67
68/* Define the union U_PKE_LOCK_CTRL */
69typedef union {
70 /* Define the struct bits */
71 struct {
72 unsigned int pke_lock : 1; /* [0] */
73 unsigned int pke_lock_type : 1; /* [1] */
74 unsigned int reserved_0 : 30; /* [31..2] */
75 } bits;
76 /* Define an unsigned member */
77 unsigned int u32;
79
80/* Define the union U_PKE_LOCK_STATUS */
81typedef union {
82 /* Define the struct bits */
83 struct {
84 unsigned int pke_lock_busy : 1; /* [0] */
85 unsigned int pke_unlock_fail : 1; /* [1] */
86 unsigned int reserved_0 : 2; /* [3..2] */
87 unsigned int pke_lock_cnt : 3; /* [6..4] */
88 unsigned int reserved_1 : 1; /* [7] */
89 unsigned int pke_lock_stat : 8; /* [15..8] */
90 unsigned int reserved_2 : 16; /* [31..16] */
91 } bits;
92 /* Define an unsigned member */
93 unsigned int u32;
95
96/* Define the union U_PKE_POWER_NOISE_LOCK */
97typedef union {
98 /* Define the struct bits */
99 struct {
100 unsigned int noise_en : 1; /* [0] */
101 unsigned int reserved_0 : 31; /* [31..1] */
102 } bits;
103
104 /* Define an unsigned member */
105 unsigned int u32;
107
108/* Define the union U_PKE_INT_NOMASK_STATUS */
109typedef union {
110 /* Define the struct bits */
111 struct {
112 unsigned int finish_int_nomask : 4; /* [0:3] */
113 unsigned int reserved_0 : 28; /* [4:31] */
114 } bits;
115
116 /* Define an unsigned member */
117 unsigned int u32;
119
120/* Define the union U_PKE_ALARM_STATUS */
121typedef union {
122 /* Define the struct bits */
123 struct {
124 unsigned int alarm_int : 4; /* [0:3] */
125 unsigned int reserved_0 : 28; /* [4:31] */
126 } bits;
127
128 /* Define an unsigned member */
129 unsigned int u32;
131
132/* Define the union U_PKE_FAILURE_FLAG */
133typedef union {
134 /* Define the struct bits */
135 struct {
136 unsigned int pke_failure_flag : 11; /* [0:10] */
137 unsigned int reserved_0 : 21; /* [11:31] */
138 } bits;
139
140 /* Define an unsigned member */
141 unsigned int u32;
143
144/* Define the union U_PKE_INT_ENABLE */
145typedef union {
146 /* Define the struct bits */
147 struct {
148 unsigned int finish_int_enable : 1; /* [0] */
149 unsigned int reserved_0 : 31; /* [31..1] */
150 } bits;
151
152 /* Define an unsigned member */
153 unsigned int u32;
155
156/* Define the union U_PKE_START */
157typedef union {
158 /* Define the struct bits */
159 struct {
160 unsigned int pke_start0 : 4; /* [0:3] */
161 unsigned int pke_start1 : 4; /* [4:7] */
162 unsigned int pke_batch_start : 4; /* [8:11] */
163 unsigned int reserved_0 : 20; /* [12:31] */
164 } bits;
165
166 /* Define an unsigned member */
167 unsigned int u32;
168} pke_start;
169
170/* Define the union U_PKE_BUSY */
171typedef union {
172 /* Define the struct bits */
173 struct {
174 unsigned int pke_busy : 1; /* [0] */
175 unsigned int reserved_0 : 31; /* [31..1] */
176 } bits;
177
178 /* Define an unsigned member */
179 unsigned int u32;
180} pke_busy;
181
182/* Define the union U_PKE_DRAM_CLR */
183typedef union {
184 /* Define the struct bits */
185 struct {
186 unsigned int dram_clr : 1; /* [0] */
187 unsigned int reserved_0 : 31; /* [1:31] */
188 } bits;
189
190 /* Define an unsigned member */
191 unsigned int u32;
193
194/* Define the union U_PKE_MASK_RNG_CFG */
195typedef union {
196 /* Define the struct bits */
197 struct {
198 unsigned int mask_rng_cfg : 1; /* [0] */
199 unsigned int reserved_0 : 31; /* [1:31] */
200 } bits;
201
202 /* Define an unsigned member */
203 unsigned int u32;
205
206/* Define the union U_PKE_INSTR_RDY: */
207typedef union {
208 /* Define the struct bits */
209 struct {
210 unsigned int instr0_rdy : 1; /* [0] */
211 unsigned int instr1_rdy : 1; /* [1] */
212 unsigned int batch_instr_rdy : 1; /* [2] */
213 unsigned int reserved_0 : 29; /* [3:31] */
214 } bits;
215
216 /* Define an unsigned member */
217 unsigned int u32;
219
220/************************************************** reg related struct end************************************/
221
222#endif
Definition hal_pke_reg.h:121
unsigned int reserved_0
Definition hal_pke_reg.h:125
unsigned int alarm_int
Definition hal_pke_reg.h:124
unsigned int u32
Definition hal_pke_reg.h:129
Definition hal_pke_reg.h:171
unsigned int pke_busy
Definition hal_pke_reg.h:174
unsigned int u32
Definition hal_pke_reg.h:179
unsigned int reserved_0
Definition hal_pke_reg.h:175
Definition hal_pke_reg.h:183
unsigned int dram_clr
Definition hal_pke_reg.h:186
unsigned int reserved_0
Definition hal_pke_reg.h:187
unsigned int u32
Definition hal_pke_reg.h:191
Definition hal_pke_reg.h:133
unsigned int pke_failure_flag
Definition hal_pke_reg.h:136
unsigned int u32
Definition hal_pke_reg.h:141
unsigned int reserved_0
Definition hal_pke_reg.h:137
Definition hal_pke_reg.h:207
unsigned int reserved_0
Definition hal_pke_reg.h:213
unsigned int instr1_rdy
Definition hal_pke_reg.h:211
unsigned int batch_instr_rdy
Definition hal_pke_reg.h:212
unsigned int instr0_rdy
Definition hal_pke_reg.h:210
unsigned int u32
Definition hal_pke_reg.h:217
Definition hal_pke_reg.h:145
unsigned int u32
Definition hal_pke_reg.h:153
unsigned int reserved_0
Definition hal_pke_reg.h:149
unsigned int finish_int_enable
Definition hal_pke_reg.h:148
Definition hal_pke_reg.h:109
unsigned int u32
Definition hal_pke_reg.h:117
unsigned int finish_int_nomask
Definition hal_pke_reg.h:112
unsigned int reserved_0
Definition hal_pke_reg.h:113
Definition hal_pke_reg.h:69
unsigned int pke_lock_type
Definition hal_pke_reg.h:73
unsigned int pke_lock
Definition hal_pke_reg.h:72
unsigned int reserved_0
Definition hal_pke_reg.h:74
unsigned int u32
Definition hal_pke_reg.h:77
Definition hal_pke_reg.h:81
unsigned int reserved_0
Definition hal_pke_reg.h:86
unsigned int u32
Definition hal_pke_reg.h:93
unsigned int pke_lock_stat
Definition hal_pke_reg.h:89
unsigned int reserved_1
Definition hal_pke_reg.h:88
unsigned int pke_lock_busy
Definition hal_pke_reg.h:84
unsigned int pke_lock_cnt
Definition hal_pke_reg.h:87
unsigned int reserved_2
Definition hal_pke_reg.h:90
unsigned int pke_unlock_fail
Definition hal_pke_reg.h:85
Definition hal_pke_reg.h:195
unsigned int reserved_0
Definition hal_pke_reg.h:199
unsigned int mask_rng_cfg
Definition hal_pke_reg.h:198
unsigned int u32
Definition hal_pke_reg.h:203
Definition hal_pke_reg.h:97
unsigned int noise_en
Definition hal_pke_reg.h:100
unsigned int reserved_0
Definition hal_pke_reg.h:101
unsigned int u32
Definition hal_pke_reg.h:105
Definition hal_pke_reg.h:157
unsigned int pke_start0
Definition hal_pke_reg.h:160
unsigned int pke_start1
Definition hal_pke_reg.h:161
unsigned int u32
Definition hal_pke_reg.h:167
unsigned int pke_batch_start
Definition hal_pke_reg.h:162
unsigned int reserved_0
Definition hal_pke_reg.h:163