Debian Codegraph @

src/vendorcode/cavium/include/bdk/libbdk-arch/bdk-csrs-rnm.h

raw symbols SCIP
1 #ifndef __BDK_CSRS_RNM_H__
2 #define __BDK_CSRS_RNM_H__
3 /* This file is auto-generated. Do not edit */
4
5 /***********************license start***************
6 * Copyright (c) 2003-2017 Cavium Inc. ([email protected]). All rights
7 * reserved.
8 *
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions are
12 * met:
13 *
14 * * Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
16 *
17 * * Redistributions in binary form must reproduce the above
18 * copyright notice, this list of conditions and the following
19 * disclaimer in the documentation and/or other materials provided
20 * with the distribution.
21
22 * * Neither the name of Cavium Inc. nor the names of
23 * its contributors may be used to endorse or promote products
24 * derived from this software without specific prior written
25 * permission.
26
27 * This Software, including technical data, may be subject to U.S. export control
28 * laws, including the U.S. Export Administration Act and its associated
29 * regulations, and may be subject to export or import regulations in other
30 * countries.
31
32 * TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS"
33 * AND WITH ALL FAULTS AND CAVIUM NETWORKS MAKES NO PROMISES, REPRESENTATIONS OR
34 * WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH RESPECT TO
35 * THE SOFTWARE, INCLUDING ITS CONDITION, ITS CONFORMITY TO ANY REPRESENTATION OR
36 * DESCRIPTION, OR THE EXISTENCE OF ANY LATENT OR PATENT DEFECTS, AND CAVIUM
37 * SPECIFICALLY DISCLAIMS ALL IMPLIED (IF ANY) WARRANTIES OF TITLE,
38 * MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE, LACK OF
39 * VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION OR
40 * CORRESPONDENCE TO DESCRIPTION. THE ENTIRE RISK ARISING OUT OF USE OR
41 * PERFORMANCE OF THE SOFTWARE LIES WITH YOU.
42 ***********************license end**************************************/
43
44
45 /**
46 * @file
47 *
48 * Configuration and status register (CSR) address and type definitions for
49 * Cavium RNM.
50 *
51 * This file is auto generated. Do not edit.
52 *
53 */
54
55 /**
56 * Enumeration rnm_bar_e
57 *
58 * RNM Base Address Register Enumeration
59 * Enumerates the base address registers.
60 */
61 #define BDK_RNM_BAR_E_RNM_PF_BAR0 (0x87e040000000ll)
62 #define BDK_RNM_BAR_E_RNM_PF_BAR0_SIZE 0x100000ull
63 #define BDK_RNM_BAR_E_RNM_VF_BAR0 (0x840000800000ll)
64 #define BDK_RNM_BAR_E_RNM_VF_BAR0_SIZE 0x100000ull
65
66 /**
67 * Register (RSL) rnm_bist_status
68 *
69 * RNM BIST Status Register
70 * This register is the RNM memory BIST status register, indicating status of built-in self-
71 * tests. 0 = passed BIST, 1 = failed BIST.
72 */
73 union bdk_rnm_bist_status
74 {
75 uint64_t u;
76 struct bdk_rnm_bist_status_s
77 {
78 #if __BYTE_ORDER == __BIG_ENDIAN /* Word 0 - Big Endian */
79 uint64_t reserved_0_63 : 64;
80 #else /* Word 0 - Little Endian */
81 uint64_t reserved_0_63 : 64;
82 #endif /* Word 0 - End */
83 } s;
84 struct bdk_rnm_bist_status_cn81xx
85 {
86 #if __BYTE_ORDER == __BIG_ENDIAN /* Word 0 - Big Endian */
87 uint64_t reserved_2_63 : 62;
88 uint64_t nz : 1; /**< [ 1: 1](RO/H) Status of the no-zeros memory BIST. 0 = passed BIST, 1 = failed BIST. */
89 uint64_t nml : 1; /**< [ 0: 0](RO/H) Status of the normal memory BIST. 0 = passed BIST, 1 = failed BIST. */
90 #else /* Word 0 - Little Endian */
91 uint64_t nml : 1; /**< [ 0: 0](RO/H) Status of the normal memory BIST. 0 = passed BIST, 1 = failed BIST. */
92 uint64_t nz : 1; /**< [ 1: 1](RO/H) Status of the no-zeros memory BIST. 0 = passed BIST, 1 = failed BIST. */
93 uint64_t reserved_2_63 : 62;
94 #endif /* Word 0 - End */
95 } cn81xx;
96 struct bdk_rnm_bist_status_cn88xx
97 {
98 #if __BYTE_ORDER == __BIG_ENDIAN /* Word 0 - Big Endian */
99 uint64_t reserved_2_63 : 62;
100 uint64_t rrc : 1; /**< [ 1: 1](RO/H) Status of the RRC memory block BIST. 0 = passed BIST, 1 = failed BIST. */
101 uint64_t mem : 1; /**< [ 0: 0](RO/H) Status of MEM memory block BIST. 0 = passed BIST, 1 = failed BIST. */
102 #else /* Word 0 - Little Endian */
103 uint64_t mem : 1; /**< [ 0: 0](RO/H) Status of MEM memory block BIST. 0 = passed BIST, 1 = failed BIST. */
104 uint64_t rrc : 1; /**< [ 1: 1](RO/H) Status of the RRC memory block BIST. 0 = passed BIST, 1 = failed BIST. */
105 uint64_t reserved_2_63 : 62;
106 #endif /* Word 0 - End */
107 } cn88xx;
108 /* struct bdk_rnm_bist_status_cn81xx cn83xx; */
109 };
110 typedef union bdk_rnm_bist_status bdk_rnm_bist_status_t;
111
112 #define BDK_RNM_BIST_STATUS BDK_RNM_BIST_STATUS_FUNC()
113 static inline uint64_t BDK_RNM_BIST_STATUS_FUNC(void) __attribute__ ((pure, always_inline));
114 static inline uint64_t BDK_RNM_BIST_STATUS_FUNC(void)
115 {
116 if (CAVIUM_IS_MODEL(CAVIUM_CN8XXX))
117 return 0x87e040000008ll;
118 __bdk_csr_fatal("RNM_BIST_STATUS", 0, 0, 0, 0, 0);
119 }
120
121 #define typedef_BDK_RNM_BIST_STATUS bdk_rnm_bist_status_t
122 #define bustype_BDK_RNM_BIST_STATUS BDK_CSR_TYPE_RSL
123 #define basename_BDK_RNM_BIST_STATUS "RNM_BIST_STATUS"
124 #define device_bar_BDK_RNM_BIST_STATUS 0x0 /* PF_BAR0 */
125 #define busnum_BDK_RNM_BIST_STATUS 0
126 #define arguments_BDK_RNM_BIST_STATUS -1,-1,-1,-1
127
128 /**
129 * Register (RSL) rnm_bp_test
130 *
131 * INTERNAL: RNM Backpressure Test Register
132 */
133 union bdk_rnm_bp_test
134 {
135 uint64_t u;
136 struct bdk_rnm_bp_test_s
137 {
138 #if __BYTE_ORDER == __BIG_ENDIAN /* Word 0 - Big Endian */
139 uint64_t enable : 3; /**< [ 63: 61](R/W) Enable test mode. For diagnostic use only.
140 Internal:
141 Once a bit is set, random backpressure is generated
142 at the corresponding point to allow for more frequent backpressure.
143 \<63\> = Normal random number memory writes.
144 \<62\> = No-zeros random number memory writes.
145 \<61\> = No-zeros random number memory reads. */
146 uint64_t reserved_24_60 : 37;
147 uint64_t bp_cfg : 6; /**< [ 23: 18](R/W) Backpressure weight. For diagnostic use only.
148 Internal:
149 There are 2 backpressure configuration bits per enable, with the two bits
150 defined as 0x0=100% of the time, 0x1=75% of the time, 0x2=50% of the time,
151 0x3=25% of the time.
152 \<23:22\> = Normal random number memory writes.
153 \<21:20\> = No-zeros random number memory writes.
154 \<19:18\> = No-zeros random number memory reads. */
155 uint64_t reserved_12_17 : 6;
156 uint64_t lfsr_freq : 12; /**< [ 11: 0](R/W) Test LFSR update frequency in coprocessor-clocks minus one. */
157 #else /* Word 0 - Little Endian */
158 uint64_t lfsr_freq : 12; /**< [ 11: 0](R/W) Test LFSR update frequency in coprocessor-clocks minus one. */
159 uint64_t reserved_12_17 : 6;
160 uint64_t bp_cfg : 6; /**< [ 23: 18](R/W) Backpressure weight. For diagnostic use only.
161 Internal:
162 There are 2 backpressure configuration bits per enable, with the two bits
163 defined as 0x0=100% of the time, 0x1=75% of the time, 0x2=50% of the time,
164 0x3=25% of the time.
165 \<23:22\> = Normal random number memory writes.
166 \<21:20\> = No-zeros random number memory writes.
167 \<19:18\> = No-zeros random number memory reads. */
168 uint64_t reserved_24_60 : 37;
169 uint64_t enable : 3; /**< [ 63: 61](R/W) Enable test mode. For diagnostic use only.
170 Internal:
171 Once a bit is set, random backpressure is generated
172 at the corresponding point to allow for more frequent backpressure.
173 \<63\> = Normal random number memory writes.
174 \<62\> = No-zeros random number memory writes.
175 \<61\> = No-zeros random number memory reads. */
176 #endif /* Word 0 - End */
177 } s;
178 /* struct bdk_rnm_bp_test_s cn; */
179 };
180 typedef union bdk_rnm_bp_test bdk_rnm_bp_test_t;
181
182 #define BDK_RNM_BP_TEST BDK_RNM_BP_TEST_FUNC()
183 static inline uint64_t BDK_RNM_BP_TEST_FUNC(void) __attribute__ ((pure, always_inline));
184 static inline uint64_t BDK_RNM_BP_TEST_FUNC(void)
185 {
186 if (CAVIUM_IS_MODEL(CAVIUM_CN9XXX))
187 return 0x87e040000028ll;
188 __bdk_csr_fatal("RNM_BP_TEST", 0, 0, 0, 0, 0);
189 }
190
191 #define typedef_BDK_RNM_BP_TEST bdk_rnm_bp_test_t
192 #define bustype_BDK_RNM_BP_TEST BDK_CSR_TYPE_RSL
193 #define basename_BDK_RNM_BP_TEST "RNM_BP_TEST"
194 #define device_bar_BDK_RNM_BP_TEST 0x0 /* PF_BAR0 */
195 #define busnum_BDK_RNM_BP_TEST 0
196 #define arguments_BDK_RNM_BP_TEST -1,-1,-1,-1
197
198 /**
199 * Register (RSL) rnm_const
200 *
201 * RNM PF Constants Register
202 * This register is used for software discovery.
203 */
204 union bdk_rnm_const
205 {
206 uint64_t u;
207 struct bdk_rnm_const_s
208 {
209 #if __BYTE_ORDER == __BIG_ENDIAN /* Word 0 - Big Endian */
210 uint64_t reserved_0_63 : 64;
211 #else /* Word 0 - Little Endian */
212 uint64_t reserved_0_63 : 64;
213 #endif /* Word 0 - End */
214 } s;
215 /* struct bdk_rnm_const_s cn; */
216 };
217 typedef union bdk_rnm_const bdk_rnm_const_t;
218
219 #define BDK_RNM_CONST BDK_RNM_CONST_FUNC()
220 static inline uint64_t BDK_RNM_CONST_FUNC(void) __attribute__ ((pure, always_inline));
221 static inline uint64_t BDK_RNM_CONST_FUNC(void)
222 {
223 if (CAVIUM_IS_MODEL(CAVIUM_CN9XXX))
224 return 0x87e040000030ll;
225 __bdk_csr_fatal("RNM_CONST", 0, 0, 0, 0, 0);
226 }
227
228 #define typedef_BDK_RNM_CONST bdk_rnm_const_t
229 #define bustype_BDK_RNM_CONST BDK_CSR_TYPE_RSL
230 #define basename_BDK_RNM_CONST "RNM_CONST"
231 #define device_bar_BDK_RNM_CONST 0x0 /* PF_BAR0 */
232 #define busnum_BDK_RNM_CONST 0
233 #define arguments_BDK_RNM_CONST -1,-1,-1,-1
234
235 /**
236 * Register (RSL) rnm_ctl_status
237 *
238 * RNM Control and Status Register
239 * This register is the RNM control register.
240 * This register is secure only to prevent the nonsecure world from affecting
241 * secure-world clients using true random numbers.
242 */
243 union bdk_rnm_ctl_status
244 {
245 uint64_t u;
246 struct bdk_rnm_ctl_status_s
247 {
248 #if __BYTE_ORDER == __BIG_ENDIAN /* Word 0 - Big Endian */
249 uint64_t reserved_11_63 : 53;
250 uint64_t eer_lck : 1; /**< [ 10: 10](SRO/H) Encryption enable register locked. */
251 uint64_t eer_val : 1; /**< [ 9: 9](SRO/H) Dormant encryption key match. */
252 uint64_t ent_sel : 4; /**< [ 8: 5](SR/W) Select input to RNM FIFO.
253 0x0 = 0-7.
254 0x1 = 8-15.
255 0x2 = 16-23.
256 0x3 = 24-31.
257 0x4 = 32-39.
258 0x5 = 40-47.
259 0x6 = 48-55.
260 0x7 = 56-63.
261 0x8 = 64-71.
262 0x9 = 72-79.
263 0xA = 80-87.
264 0xB = 88-95.
265 0xC = 96-103.
266 0xD = 104-111.
267 0xE = 112-119.
268 0xF = 120-127. */
269 uint64_t exp_ent : 1; /**< [ 4: 4](SR/W) Exported entropy enable for random number generator. The next random number is
270 available 80 coprocessor-clock cycles after switching this bit from zero to one. The
271 next random number is available 730 coprocessor-clock cycles after switching this
272 bit from one to zero. */
273 uint64_t rng_rst : 1; /**< [ 3: 3](SR/W) Reset the RNG. Setting this bit to one cancels the generation of the current random
274 number. The next random number is available 730 coprocessor-clock cycles after this
275 bit is cleared if [EXP_ENT] is set to zero. The next random number is available 80
276 coprocessor-clock cycles after this bit is cleared if [EXP_ENT] is set to one. This bit is
277 not automatically cleared. */
278 uint64_t rnm_rst : 1; /**< [ 2: 2](SR/W) Reset the RNM. Setting this bit to 1 drops all RNM transactions in flight and clears
279 all stored numbers in the random number memory. Any outstanding NCBO credits will
280 not be returned. RNM will not respond to any pending NCBI grants. RNM can accept
281 new requests immediately after reset is cleared. This bit is not automatically
282 cleared and will not reset any CSR fields. */
283 uint64_t rng_en : 1; /**< [ 1: 1](SR/W) Enables the output of the RNG. */
284 uint64_t ent_en : 1; /**< [ 0: 0](SR/W) Entropy enable for random number generator. */
285 #else /* Word 0 - Little Endian */
286 uint64_t ent_en : 1; /**< [ 0: 0](SR/W) Entropy enable for random number generator. */
287 uint64_t rng_en : 1; /**< [ 1: 1](SR/W) Enables the output of the RNG. */
288 uint64_t rnm_rst : 1; /**< [ 2: 2](SR/W) Reset the RNM. Setting this bit to 1 drops all RNM transactions in flight and clears
289 all stored numbers in the random number memory. Any outstanding NCBO credits will
290 not be returned. RNM will not respond to any pending NCBI grants. RNM can accept
291 new requests immediately after reset is cleared. This bit is not automatically
292 cleared and will not reset any CSR fields. */
293 uint64_t rng_rst : 1; /**< [ 3: 3](SR/W) Reset the RNG. Setting this bit to one cancels the generation of the current random
294 number. The next random number is available 730 coprocessor-clock cycles after this
295 bit is cleared if [EXP_ENT] is set to zero. The next random number is available 80
296 coprocessor-clock cycles after this bit is cleared if [EXP_ENT] is set to one. This bit is
297 not automatically cleared. */
298 uint64_t exp_ent : 1; /**< [ 4: 4](SR/W) Exported entropy enable for random number generator. The next random number is
299 available 80 coprocessor-clock cycles after switching this bit from zero to one. The
300 next random number is available 730 coprocessor-clock cycles after switching this
301 bit from one to zero. */
302 uint64_t ent_sel : 4; /**< [ 8: 5](SR/W) Select input to RNM FIFO.
303 0x0 = 0-7.
304 0x1 = 8-15.
305 0x2 = 16-23.
306 0x3 = 24-31.
307 0x4 = 32-39.
308 0x5 = 40-47.
309 0x6 = 48-55.
310 0x7 = 56-63.
311 0x8 = 64-71.
312 0x9 = 72-79.
313 0xA = 80-87.
314 0xB = 88-95.
315 0xC = 96-103.
316 0xD = 104-111.
317 0xE = 112-119.
318 0xF = 120-127. */
319 uint64_t eer_val : 1; /**< [ 9: 9](SRO/H) Dormant encryption key match. */
320 uint64_t eer_lck : 1; /**< [ 10: 10](SRO/H) Encryption enable register locked. */
321 uint64_t reserved_11_63 : 53;
322 #endif /* Word 0 - End */
323 } s;
324 struct bdk_rnm_ctl_status_cn8
325 {
326 #if __BYTE_ORDER == __BIG_ENDIAN /* Word 0 - Big Endian */
327 uint64_t reserved_12_63 : 52;
328 uint64_t dis_mak : 1; /**< [ 11: 11](SR/W1S/H) Disable use of master AES KEY. */
329 uint64_t eer_lck : 1; /**< [ 10: 10](SRO/H) Encryption enable register locked. */
330 uint64_t eer_val : 1; /**< [ 9: 9](SRO/H) Dormant encryption key match. */
331 uint64_t ent_sel : 4; /**< [ 8: 5](SR/W) Select input to RNM FIFO.
332 0x0 = 0-7.
333 0x1 = 8-15.
334 0x2 = 16-23.
335 0x3 = 24-31.
336 0x4 = 32-39.
337 0x5 = 40-47.
338 0x6 = 48-55.
339 0x7 = 56-63.
340 0x8 = 64-71.
341 0x9 = 72-79.
342 0xA = 80-87.
343 0xB = 88-95.
344 0xC = 96-103.
345 0xD = 104-111.
346 0xE = 112-119.
347 0xF = 120-127. */
348 uint64_t exp_ent : 1; /**< [ 4: 4](SR/W) Exported entropy enable for random number generator. The next random number is
349 available 80 coprocessor-clock cycles after switching this bit from zero to one. The
350 next random number is available 730 coprocessor-clock cycles after switching this
351 bit from one to zero. */
352 uint64_t rng_rst : 1; /**< [ 3: 3](SR/W) Reset the RNG. Setting this bit to one cancels the generation of the current random
353 number. The next random number is available 730 coprocessor-clock cycles after this
354 bit is cleared if [EXP_ENT] is set to zero. The next random number is available 80
355 coprocessor-clock cycles after this bit is cleared if [EXP_ENT] is set to one. This bit is
356 not automatically cleared. */
357 uint64_t rnm_rst : 1; /**< [ 2: 2](SR/W) Reset the RNM. Setting this bit to 1 drops all RNM transactions in flight and clears
358 all stored numbers in the random number memory. Any outstanding NCBO credits will
359 not be returned. RNM will not respond to any pending NCBI grants. RNM can accept
360 new requests immediately after reset is cleared. This bit is not automatically
361 cleared and will not reset any CSR fields. */
362 uint64_t rng_en : 1; /**< [ 1: 1](SR/W) Enables the output of the RNG. */
363 uint64_t ent_en : 1; /**< [ 0: 0](SR/W) Entropy enable for random number generator. */
364 #else /* Word 0 - Little Endian */
365 uint64_t ent_en : 1; /**< [ 0: 0](SR/W) Entropy enable for random number generator. */
366 uint64_t rng_en : 1; /**< [ 1: 1](SR/W) Enables the output of the RNG. */
367 uint64_t rnm_rst : 1; /**< [ 2: 2](SR/W) Reset the RNM. Setting this bit to 1 drops all RNM transactions in flight and clears
368 all stored numbers in the random number memory. Any outstanding NCBO credits will
369 not be returned. RNM will not respond to any pending NCBI grants. RNM can accept
370 new requests immediately after reset is cleared. This bit is not automatically
371 cleared and will not reset any CSR fields. */
372 uint64_t rng_rst : 1; /**< [ 3: 3](SR/W) Reset the RNG. Setting this bit to one cancels the generation of the current random
373 number. The next random number is available 730 coprocessor-clock cycles after this
374 bit is cleared if [EXP_ENT] is set to zero. The next random number is available 80
375 coprocessor-clock cycles after this bit is cleared if [EXP_ENT] is set to one. This bit is
376 not automatically cleared. */
377 uint64_t exp_ent : 1; /**< [ 4: 4](SR/W) Exported entropy enable for random number generator. The next random number is
378 available 80 coprocessor-clock cycles after switching this bit from zero to one. The
379 next random number is available 730 coprocessor-clock cycles after switching this
380 bit from one to zero. */
381 uint64_t ent_sel : 4; /**< [ 8: 5](SR/W) Select input to RNM FIFO.
382 0x0 = 0-7.
383 0x1 = 8-15.
384 0x2 = 16-23.
385 0x3 = 24-31.
386 0x4 = 32-39.
387 0x5 = 40-47.
388 0x6 = 48-55.
389 0x7 = 56-63.
390 0x8 = 64-71.
391 0x9 = 72-79.
392 0xA = 80-87.
393 0xB = 88-95.
394 0xC = 96-103.
395 0xD = 104-111.
396 0xE = 112-119.
397 0xF = 120-127. */
398 uint64_t eer_val : 1; /**< [ 9: 9](SRO/H) Dormant encryption key match. */
399 uint64_t eer_lck : 1; /**< [ 10: 10](SRO/H) Encryption enable register locked. */
400 uint64_t dis_mak : 1; /**< [ 11: 11](SR/W1S/H) Disable use of master AES KEY. */
401 uint64_t reserved_12_63 : 52;
402 #endif /* Word 0 - End */
403 } cn8;
404 struct bdk_rnm_ctl_status_cn9
405 {
406 #if __BYTE_ORDER == __BIG_ENDIAN /* Word 0 - Big Endian */
407 uint64_t reserved_12_63 : 52;
408 uint64_t zuc_en : 1; /**< [ 11: 11](SR/W) Enable output of the ZUC engine. Before setting this bit software must write to
409 all RNM_ZUC_INIT_LFSR(), and RNM_ZUC_INIT_NLF() registers. */
410 uint64_t eer_lck : 1; /**< [ 10: 10](SRO/H) Encryption enable register locked. */
411 uint64_t eer_val : 1; /**< [ 9: 9](SRO/H) Dormant encryption key match. */
412 uint64_t ent_sel : 4; /**< [ 8: 5](SR/W) Select input to RNM FIFO.
413 0x0 = 0-7.
414 0x1 = 8-15.
415 0x2 = 16-23.
416 0x3 = 24-31.
417 0x4 = 32-39.
418 0x5 = 40-47.
419 0x6 = 48-55.
420 0x7 = 56-63.
421 0x8 = 64-71.
422 0x9 = 72-79.
423 0xA = 80-87.
424 0xB = 88-95.
425 0xC = 96-103.
426 0xD = 104-111.
427 0xE = 112-119.
428 0xF = 120-127. */
429 uint64_t exp_ent : 1; /**< [ 4: 4](SR/W) Exported entropy enable for random number generator. The next random number is
430 available 80 coprocessor-clock cycles after switching this bit from zero to one. The
431 next random number is available 730 coprocessor-clock cycles after switching this
432 bit from one to zero. */
433 uint64_t rng_rst : 1; /**< [ 3: 3](SR/W) Reset the RNG. Setting this bit to one cancels the generation of the current random
434 number. The next random number is available 730 coprocessor-clock cycles after this
435 bit is cleared if [EXP_ENT] is set to zero. The next random number is available 80
436 coprocessor-clock cycles after this bit is cleared if [EXP_ENT] is set to one. This bit is
437 not automatically cleared. */
438 uint64_t rnm_rst : 1; /**< [ 2: 2](SRO) Reserved. Writes are ignored for backward compatibility. */
439 uint64_t rng_en : 1; /**< [ 1: 1](SR/W) Enables the output of the RNG. */
440 uint64_t ent_en : 1; /**< [ 0: 0](SR/W) Entropy enable for random number generator. */
441 #else /* Word 0 - Little Endian */
442 uint64_t ent_en : 1; /**< [ 0: 0](SR/W) Entropy enable for random number generator. */
443 uint64_t rng_en : 1; /**< [ 1: 1](SR/W) Enables the output of the RNG. */
444 uint64_t rnm_rst : 1; /**< [ 2: 2](SRO) Reserved. Writes are ignored for backward compatibility. */
445 uint64_t rng_rst : 1; /**< [ 3: 3](SR/W) Reset the RNG. Setting this bit to one cancels the generation of the current random
446 number. The next random number is available 730 coprocessor-clock cycles after this
447 bit is cleared if [EXP_ENT] is set to zero. The next random number is available 80
448 coprocessor-clock cycles after this bit is cleared if [EXP_ENT] is set to one. This bit is
449 not automatically cleared. */
450 uint64_t exp_ent : 1; /**< [ 4: 4](SR/W) Exported entropy enable for random number generator. The next random number is
451 available 80 coprocessor-clock cycles after switching this bit from zero to one. The
452 next random number is available 730 coprocessor-clock cycles after switching this
453 bit from one to zero. */
454 uint64_t ent_sel : 4; /**< [ 8: 5](SR/W) Select input to RNM FIFO.
455 0x0 = 0-7.
456 0x1 = 8-15.
457 0x2 = 16-23.
458 0x3 = 24-31.
459 0x4 = 32-39.
460 0x5 = 40-47.
461 0x6 = 48-55.
462 0x7 = 56-63.
463 0x8 = 64-71.
464 0x9 = 72-79.
465 0xA = 80-87.
466 0xB = 88-95.
467 0xC = 96-103.
468 0xD = 104-111.
469 0xE = 112-119.
470 0xF = 120-127. */
471 uint64_t eer_val : 1; /**< [ 9: 9](SRO/H) Dormant encryption key match. */
472 uint64_t eer_lck : 1; /**< [ 10: 10](SRO/H) Encryption enable register locked. */
473 uint64_t zuc_en : 1; /**< [ 11: 11](SR/W) Enable output of the ZUC engine. Before setting this bit software must write to
474 all RNM_ZUC_INIT_LFSR(), and RNM_ZUC_INIT_NLF() registers. */
475 uint64_t reserved_12_63 : 52;
476 #endif /* Word 0 - End */
477 } cn9;
478 };
479 typedef union bdk_rnm_ctl_status bdk_rnm_ctl_status_t;
480
481 #define BDK_RNM_CTL_STATUS BDK_RNM_CTL_STATUS_FUNC()
482 static inline uint64_t BDK_RNM_CTL_STATUS_FUNC(void) __attribute__ ((pure, always_inline));
483 static inline uint64_t BDK_RNM_CTL_STATUS_FUNC(void)
484 {
485 return 0x87e040000000ll;
486 }
487
488 #define typedef_BDK_RNM_CTL_STATUS bdk_rnm_ctl_status_t
489 #define bustype_BDK_RNM_CTL_STATUS BDK_CSR_TYPE_RSL
490 #define basename_BDK_RNM_CTL_STATUS "RNM_CTL_STATUS"
491 #define device_bar_BDK_RNM_CTL_STATUS 0x0 /* PF_BAR0 */
492 #define busnum_BDK_RNM_CTL_STATUS 0
493 #define arguments_BDK_RNM_CTL_STATUS -1,-1,-1,-1
494
495 /**
496 * Register (RSL) rnm_eer_dbg
497 *
498 * INTERNAL: RNM Encryption Enable Debug Register
499 *
500 * This register is the encryption enable debug register.
501 */
502 union bdk_rnm_eer_dbg
503 {
504 uint64_t u;
505 struct bdk_rnm_eer_dbg_s
506 {
507 #if __BYTE_ORDER == __BIG_ENDIAN /* Word 0 - Big Endian */
508 uint64_t dat : 64; /**< [ 63: 0](SRO/H) Dormant encryption debug info. */
509 #else /* Word 0 - Little Endian */
510 uint64_t dat : 64; /**< [ 63: 0](SRO/H) Dormant encryption debug info. */
511 #endif /* Word 0 - End */
512 } s;
513 /* struct bdk_rnm_eer_dbg_s cn; */
514 };
515 typedef union bdk_rnm_eer_dbg bdk_rnm_eer_dbg_t;
516
517 #define BDK_RNM_EER_DBG BDK_RNM_EER_DBG_FUNC()
518 static inline uint64_t BDK_RNM_EER_DBG_FUNC(void) __attribute__ ((pure, always_inline));
519 static inline uint64_t BDK_RNM_EER_DBG_FUNC(void)
520 {
521 if (CAVIUM_IS_MODEL(CAVIUM_CN88XX_PASS1_X))
522 return 0x87e040000018ll;
523 __bdk_csr_fatal("RNM_EER_DBG", 0, 0, 0, 0, 0);
524 }
525
526 #define typedef_BDK_RNM_EER_DBG bdk_rnm_eer_dbg_t
527 #define bustype_BDK_RNM_EER_DBG BDK_CSR_TYPE_RSL
528 #define basename_BDK_RNM_EER_DBG "RNM_EER_DBG"
529 #define device_bar_BDK_RNM_EER_DBG 0x0 /* PF_BAR0 */
530 #define busnum_BDK_RNM_EER_DBG 0
531 #define arguments_BDK_RNM_EER_DBG -1,-1,-1,-1
532
533 /**
534 * Register (RSL) rnm_eer_key
535 *
536 * RNM Encryption Enable Register
537 * This register is the encryption enable register.
538 */
539 union bdk_rnm_eer_key
540 {
541 uint64_t u;
542 struct bdk_rnm_eer_key_s
543 {
544 #if __BYTE_ORDER == __BIG_ENDIAN /* Word 0 - Big Endian */
545 uint64_t key : 64; /**< [ 63: 0](SWO) Dormant encryption key. If dormant crypto is fuse-enabled, crypto can be enabled by
546 writing this register with the correct key. */
547 #else /* Word 0 - Little Endian */
548 uint64_t key : 64; /**< [ 63: 0](SWO) Dormant encryption key. If dormant crypto is fuse-enabled, crypto can be enabled by
549 writing this register with the correct key. */
550 #endif /* Word 0 - End */
551 } s;
552 /* struct bdk_rnm_eer_key_s cn; */
553 };
554 typedef union bdk_rnm_eer_key bdk_rnm_eer_key_t;
555
556 #define BDK_RNM_EER_KEY BDK_RNM_EER_KEY_FUNC()
557 static inline uint64_t BDK_RNM_EER_KEY_FUNC(void) __attribute__ ((pure, always_inline));
558 static inline uint64_t BDK_RNM_EER_KEY_FUNC(void)
559 {
560 return 0x87e040000010ll;
561 }
562
563 #define typedef_BDK_RNM_EER_KEY bdk_rnm_eer_key_t
564 #define bustype_BDK_RNM_EER_KEY BDK_CSR_TYPE_RSL
565 #define basename_BDK_RNM_EER_KEY "RNM_EER_KEY"
566 #define device_bar_BDK_RNM_EER_KEY 0x0 /* PF_BAR0 */
567 #define busnum_BDK_RNM_EER_KEY 0
568 #define arguments_BDK_RNM_EER_KEY -1,-1,-1,-1
569
570 /**
571 * Register (NCB) rnm_random
572 *
573 * RNM Random Register
574 */
575 union bdk_rnm_random
576 {
577 uint64_t u;
578 struct bdk_rnm_random_s
579 {
580 #if __BYTE_ORDER == __BIG_ENDIAN /* Word 0 - Big Endian */
581 uint64_t dat : 64; /**< [ 63: 0](RO/H) Generated random number. This register may be accessed with a 8, 16, 32 or 64-bit
582 operation. This register is on a independent page, and may be mapped into guest operating
583 systems. */
584 #else /* Word 0 - Little Endian */
585 uint64_t dat : 64; /**< [ 63: 0](RO/H) Generated random number. This register may be accessed with a 8, 16, 32 or 64-bit
586 operation. This register is on a independent page, and may be mapped into guest operating
587 systems. */
588 #endif /* Word 0 - End */
589 } s;
590 /* struct bdk_rnm_random_s cn8; */
591 struct bdk_rnm_random_cn9
592 {
593 #if __BYTE_ORDER == __BIG_ENDIAN /* Word 0 - Big Endian */
594 uint64_t dat : 64; /**< [ 63: 0](RO/H) Generated random number. This register may be accessed with a 8, 16, 32 or 64-bit
595 operation. This register is on a independent page, and may be mapped into guest operating
596 systems. Accesses to RNM_RANDOM larger than 64 bits will return 0x0 and fault. */
597 #else /* Word 0 - Little Endian */
598 uint64_t dat : 64; /**< [ 63: 0](RO/H) Generated random number. This register may be accessed with a 8, 16, 32 or 64-bit
599 operation. This register is on a independent page, and may be mapped into guest operating
600 systems. Accesses to RNM_RANDOM larger than 64 bits will return 0x0 and fault. */
601 #endif /* Word 0 - End */
602 } cn9;
603 };
604 typedef union bdk_rnm_random bdk_rnm_random_t;
605
606 #define BDK_RNM_RANDOM BDK_RNM_RANDOM_FUNC()
607 static inline uint64_t BDK_RNM_RANDOM_FUNC(void) __attribute__ ((pure, always_inline));
608 static inline uint64_t BDK_RNM_RANDOM_FUNC(void)
609 {
610 return 0x840000800000ll;
611 }
612
613 #define typedef_BDK_RNM_RANDOM bdk_rnm_random_t
614 #define bustype_BDK_RNM_RANDOM BDK_CSR_TYPE_NCB
615 #define basename_BDK_RNM_RANDOM "RNM_RANDOM"
616 #define device_bar_BDK_RNM_RANDOM 0x0 /* VF_BAR0 */
617 #define busnum_BDK_RNM_RANDOM 0
618 #define arguments_BDK_RNM_RANDOM -1,-1,-1,-1
619
620 /**
621 * Register (RSL) rnm_serial_num
622 *
623 * RNM Fuse Serial Number Register
624 */
625 union bdk_rnm_serial_num
626 {
627 uint64_t u;
628 struct bdk_rnm_serial_num_s
629 {
630 #if __BYTE_ORDER == __BIG_ENDIAN /* Word 0 - Big Endian */
631 uint64_t dat : 64; /**< [ 63: 0](RO/H) Dormant encryption serial number. */
632 #else /* Word 0 - Little Endian */
633 uint64_t dat : 64; /**< [ 63: 0](RO/H) Dormant encryption serial number. */
634 #endif /* Word 0 - End */
635 } s;
636 /* struct bdk_rnm_serial_num_s cn; */
637 };
638 typedef union bdk_rnm_serial_num bdk_rnm_serial_num_t;
639
640 #define BDK_RNM_SERIAL_NUM BDK_RNM_SERIAL_NUM_FUNC()
641 static inline uint64_t BDK_RNM_SERIAL_NUM_FUNC(void) __attribute__ ((pure, always_inline));
642 static inline uint64_t BDK_RNM_SERIAL_NUM_FUNC(void)
643 {
644 return 0x87e040000020ll;
645 }
646
647 #define typedef_BDK_RNM_SERIAL_NUM bdk_rnm_serial_num_t
648 #define bustype_BDK_RNM_SERIAL_NUM BDK_CSR_TYPE_RSL
649 #define basename_BDK_RNM_SERIAL_NUM "RNM_SERIAL_NUM"
650 #define device_bar_BDK_RNM_SERIAL_NUM 0x0 /* PF_BAR0 */
651 #define busnum_BDK_RNM_SERIAL_NUM 0
652 #define arguments_BDK_RNM_SERIAL_NUM -1,-1,-1,-1
653
654 /**
655 * Register (RSL) rnm_zuc_init_lfsr#
656 *
657 * RNM ZUC LFSR Initialization Register
658 * This register is used to initialize the state of the 16 state elements in RNM's ZUC
659 * LFSR. See RNM_CTL_STATUS[ZUC_EN].
660 *
661 * Before writing to this register, RNM_CTL_STATUS[ZUC_EN] must be zero to turn off the
662 * ZUC engine.
663 */
664 union bdk_rnm_zuc_init_lfsrx
665 {
666 uint64_t u;
667 struct bdk_rnm_zuc_init_lfsrx_s
668 {
669 #if __BYTE_ORDER == __BIG_ENDIAN /* Word 0 - Big Endian */
670 uint64_t reserved_31_63 : 33;
671 uint64_t lfsr : 31; /**< [ 30: 0](SWO) Write the state of one ZUC LFSR element. */
672 #else /* Word 0 - Little Endian */
673 uint64_t lfsr : 31; /**< [ 30: 0](SWO) Write the state of one ZUC LFSR element. */
674 uint64_t reserved_31_63 : 33;
675 #endif /* Word 0 - End */
676 } s;
677 /* struct bdk_rnm_zuc_init_lfsrx_s cn; */
678 };
679 typedef union bdk_rnm_zuc_init_lfsrx bdk_rnm_zuc_init_lfsrx_t;
680
681 static inline uint64_t BDK_RNM_ZUC_INIT_LFSRX(unsigned long a) __attribute__ ((pure, always_inline));
682 static inline uint64_t BDK_RNM_ZUC_INIT_LFSRX(unsigned long a)
683 {
684 if (CAVIUM_IS_MODEL(CAVIUM_CN9XXX) && (a<=15))
685 return 0x87e040000100ll + 8ll * ((a) & 0xf);
686 __bdk_csr_fatal("RNM_ZUC_INIT_LFSRX", 1, a, 0, 0, 0);
687 }
688
689 #define typedef_BDK_RNM_ZUC_INIT_LFSRX(a) bdk_rnm_zuc_init_lfsrx_t
690 #define bustype_BDK_RNM_ZUC_INIT_LFSRX(a) BDK_CSR_TYPE_RSL
691 #define basename_BDK_RNM_ZUC_INIT_LFSRX(a) "RNM_ZUC_INIT_LFSRX"
692 #define device_bar_BDK_RNM_ZUC_INIT_LFSRX(a) 0x0 /* PF_BAR0 */
693 #define busnum_BDK_RNM_ZUC_INIT_LFSRX(a) (a)
694 #define arguments_BDK_RNM_ZUC_INIT_LFSRX(a) (a),-1,-1,-1
695
696 /**
697 * Register (RSL) rnm_zuc_init_nlf#
698 *
699 * RNM ZUC LFSR Initialization Register
700 * This register is used to initialize the state of the two 32-bit memory cells in
701 * ZUC's nonlinear function. See RNM_CTL_STATUS[ZUC_EN].
702 *
703 * Before writing to this register, RNM_CTL_STATUS[ZUC_EN] must be zero to turn off the
704 * ZUC engine.
705 */
706 union bdk_rnm_zuc_init_nlfx
707 {
708 uint64_t u;
709 struct bdk_rnm_zuc_init_nlfx_s
710 {
711 #if __BYTE_ORDER == __BIG_ENDIAN /* Word 0 - Big Endian */
712 uint64_t reserved_32_63 : 32;
713 uint64_t r_state : 32; /**< [ 31: 0](SWO) Write the state of one ZUC nonlinear function element. */
714 #else /* Word 0 - Little Endian */
715 uint64_t r_state : 32; /**< [ 31: 0](SWO) Write the state of one ZUC nonlinear function element. */
716 uint64_t reserved_32_63 : 32;
717 #endif /* Word 0 - End */
718 } s;
719 /* struct bdk_rnm_zuc_init_nlfx_s cn; */
720 };
721 typedef union bdk_rnm_zuc_init_nlfx bdk_rnm_zuc_init_nlfx_t;
722
723 static inline uint64_t BDK_RNM_ZUC_INIT_NLFX(unsigned long a) __attribute__ ((pure, always_inline));
724 static inline uint64_t BDK_RNM_ZUC_INIT_NLFX(unsigned long a)
725 {
726 if (CAVIUM_IS_MODEL(CAVIUM_CN9XXX) && (a<=1))
727 return 0x87e040000200ll + 8ll * ((a) & 0x1);
728 __bdk_csr_fatal("RNM_ZUC_INIT_NLFX", 1, a, 0, 0, 0);
729 }
730
731 #define typedef_BDK_RNM_ZUC_INIT_NLFX(a) bdk_rnm_zuc_init_nlfx_t
732 #define bustype_BDK_RNM_ZUC_INIT_NLFX(a) BDK_CSR_TYPE_RSL
733 #define basename_BDK_RNM_ZUC_INIT_NLFX(a) "RNM_ZUC_INIT_NLFX"
734 #define device_bar_BDK_RNM_ZUC_INIT_NLFX(a) 0x0 /* PF_BAR0 */
735 #define busnum_BDK_RNM_ZUC_INIT_NLFX(a) (a)
736 #define arguments_BDK_RNM_ZUC_INIT_NLFX(a) (a),-1,-1,-1
737
738 #endif /* __BDK_CSRS_RNM_H__ */