-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathhw_trng.h
609 lines (547 loc) · 26.8 KB
/
hw_trng.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
/******************************************************************************
* Filename: hw_trng_h
* Revised: 2017-01-31 09:37:48 +0100 (Tue, 31 Jan 2017)
* Revision: 48345
*
* Copyright (c) 2015 - 2017, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1) Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2) Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3) Neither the name of the ORGANIZATION nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************/
#ifndef __HW_TRNG_H__
#define __HW_TRNG_H__
//*****************************************************************************
//
// This section defines the register offsets of
// TRNG component
//
//*****************************************************************************
// Random Number Lower Word Readout Value
#define TRNG_O_OUT0 0x00000000
// Random Number Upper Word Readout Value
#define TRNG_O_OUT1 0x00000004
// Interrupt Status
#define TRNG_O_IRQFLAGSTAT 0x00000008
// Interrupt Mask
#define TRNG_O_IRQFLAGMASK 0x0000000C
// Interrupt Flag Clear
#define TRNG_O_IRQFLAGCLR 0x00000010
// Control
#define TRNG_O_CTL 0x00000014
// Configuration 0
#define TRNG_O_CFG0 0x00000018
// Alarm Control
#define TRNG_O_ALARMCNT 0x0000001C
// FRO Enable
#define TRNG_O_FROEN 0x00000020
// FRO De-tune Bit
#define TRNG_O_FRODETUNE 0x00000024
// Alarm Event
#define TRNG_O_ALARMMASK 0x00000028
// Alarm Shutdown
#define TRNG_O_ALARMSTOP 0x0000002C
// LFSR Readout Value
#define TRNG_O_LFSR0 0x00000030
// LFSR Readout Value
#define TRNG_O_LFSR1 0x00000034
// LFSR Readout Value
#define TRNG_O_LFSR2 0x00000038
// TRNG Engine Options Information
#define TRNG_O_HWOPT 0x00000078
// HW Version 0
#define TRNG_O_HWVER0 0x0000007C
// Interrupt Status After Masking
#define TRNG_O_IRQSTATMASK 0x00001FD8
// HW Version 1
#define TRNG_O_HWVER1 0x00001FE0
// Interrupt Set
#define TRNG_O_IRQSET 0x00001FEC
// SW Reset Control
#define TRNG_O_SWRESET 0x00001FF0
// Interrupt Status
#define TRNG_O_IRQSTAT 0x00001FF8
//*****************************************************************************
//
// Register: TRNG_O_OUT0
//
//*****************************************************************************
// Field: [31:0] VALUE_31_0
//
// LSW of 64- bit random value. New value ready when IRQFLAGSTAT.RDY = 1.
#define TRNG_OUT0_VALUE_31_0_W 32
#define TRNG_OUT0_VALUE_31_0_M 0xFFFFFFFF
#define TRNG_OUT0_VALUE_31_0_S 0
//*****************************************************************************
//
// Register: TRNG_O_OUT1
//
//*****************************************************************************
// Field: [31:0] VALUE_63_32
//
// MSW of 64-bit random value. New value ready when IRQFLAGSTAT.RDY = 1.
#define TRNG_OUT1_VALUE_63_32_W 32
#define TRNG_OUT1_VALUE_63_32_M 0xFFFFFFFF
#define TRNG_OUT1_VALUE_63_32_S 0
//*****************************************************************************
//
// Register: TRNG_O_IRQFLAGSTAT
//
//*****************************************************************************
// Field: [31] NEED_CLOCK
//
// 1: Indicates that the TRNG is busy generating entropy or is in one of its
// test modes - clocks may not be turned off and the power supply voltage must
// be kept stable.
// 0: TRNG is idle and can be shut down
#define TRNG_IRQFLAGSTAT_NEED_CLOCK 0x80000000
#define TRNG_IRQFLAGSTAT_NEED_CLOCK_BITN 31
#define TRNG_IRQFLAGSTAT_NEED_CLOCK_M 0x80000000
#define TRNG_IRQFLAGSTAT_NEED_CLOCK_S 31
// Field: [1] SHUTDOWN_OVF
//
// 1: The number of FROs shut down (i.e. the number of '1' bits in the
// ALARMSTOP register) has exceeded the threshold set by ALARMCNT.SHUTDOWN_THR
//
// Writing '1' to IRQFLAGCLR.SHUTDOWN_OVF clears this bit to '0' again.
#define TRNG_IRQFLAGSTAT_SHUTDOWN_OVF 0x00000002
#define TRNG_IRQFLAGSTAT_SHUTDOWN_OVF_BITN 1
#define TRNG_IRQFLAGSTAT_SHUTDOWN_OVF_M 0x00000002
#define TRNG_IRQFLAGSTAT_SHUTDOWN_OVF_S 1
// Field: [0] RDY
//
// 1: Data are available in OUT0 and OUT1.
//
// Acknowledging this state by writing '1' to IRQFLAGCLR.RDY clears this bit to
// '0'.
// If a new number is already available in the internal register of the TRNG,
// the number is directly clocked into the result register. In this case the
// status bit is asserted again, after one clock cycle.
#define TRNG_IRQFLAGSTAT_RDY 0x00000001
#define TRNG_IRQFLAGSTAT_RDY_BITN 0
#define TRNG_IRQFLAGSTAT_RDY_M 0x00000001
#define TRNG_IRQFLAGSTAT_RDY_S 0
//*****************************************************************************
//
// Register: TRNG_O_IRQFLAGMASK
//
//*****************************************************************************
// Field: [1] SHUTDOWN_OVF
//
// 1: Allow IRQFLAGSTAT.SHUTDOWN_OVF to activate the interrupt from this
// module.
#define TRNG_IRQFLAGMASK_SHUTDOWN_OVF 0x00000002
#define TRNG_IRQFLAGMASK_SHUTDOWN_OVF_BITN 1
#define TRNG_IRQFLAGMASK_SHUTDOWN_OVF_M 0x00000002
#define TRNG_IRQFLAGMASK_SHUTDOWN_OVF_S 1
// Field: [0] RDY
//
// 1: Allow IRQFLAGSTAT.RDY to activate the interrupt from this module.
#define TRNG_IRQFLAGMASK_RDY 0x00000001
#define TRNG_IRQFLAGMASK_RDY_BITN 0
#define TRNG_IRQFLAGMASK_RDY_M 0x00000001
#define TRNG_IRQFLAGMASK_RDY_S 0
//*****************************************************************************
//
// Register: TRNG_O_IRQFLAGCLR
//
//*****************************************************************************
// Field: [1] SHUTDOWN_OVF
//
// 1: Clear IRQFLAGSTAT.SHUTDOWN_OVF.
#define TRNG_IRQFLAGCLR_SHUTDOWN_OVF 0x00000002
#define TRNG_IRQFLAGCLR_SHUTDOWN_OVF_BITN 1
#define TRNG_IRQFLAGCLR_SHUTDOWN_OVF_M 0x00000002
#define TRNG_IRQFLAGCLR_SHUTDOWN_OVF_S 1
// Field: [0] RDY
//
// 1: Clear IRQFLAGSTAT.RDY.
#define TRNG_IRQFLAGCLR_RDY 0x00000001
#define TRNG_IRQFLAGCLR_RDY_BITN 0
#define TRNG_IRQFLAGCLR_RDY_M 0x00000001
#define TRNG_IRQFLAGCLR_RDY_S 0
//*****************************************************************************
//
// Register: TRNG_O_CTL
//
//*****************************************************************************
// Field: [31:16] STARTUP_CYCLES
//
// This field determines the number of samples (between 2^8 and 2^24) taken to
// gather entropy from the FROs during startup. If the written value of this
// field is zero, the number of samples is 2^24, otherwise the number of
// samples equals the written value times 2^8.
//
// 0x0000: 2^24 samples
// 0x0001: 1*2^8 samples
// 0x0002: 2*2^8 samples
// 0x0003: 3*2^8 samples
// ...
// 0x8000: 32768*2^8 samples
// 0xC000: 49152*2^8 samples
// ...
// 0xFFFF: 65535*2^8 samples
//
// This field can only be modified while TRNG_EN is 0. If 1 an update will be
// ignored.
#define TRNG_CTL_STARTUP_CYCLES_W 16
#define TRNG_CTL_STARTUP_CYCLES_M 0xFFFF0000
#define TRNG_CTL_STARTUP_CYCLES_S 16
// Field: [10] TRNG_EN
//
// 0: Forces all TRNG logic back into the idle state immediately.
// 1: Starts TRNG, gathering entropy from the FROs for the number of samples
// determined by STARTUP_CYCLES.
#define TRNG_CTL_TRNG_EN 0x00000400
#define TRNG_CTL_TRNG_EN_BITN 10
#define TRNG_CTL_TRNG_EN_M 0x00000400
#define TRNG_CTL_TRNG_EN_S 10
// Field: [2] NO_LFSR_FB
//
// 1: Remove XNOR feedback from the main LFSR, converting it into a normal
// shift register for the XOR-ed outputs of the FROs (shifting data in on the
// LSB side). A '1' also forces the LFSR to sample continuously.
//
// This bit can only be set to '1' when TEST_MODE is also set to '1' and should
// not be used for other than test purposes
#define TRNG_CTL_NO_LFSR_FB 0x00000004
#define TRNG_CTL_NO_LFSR_FB_BITN 2
#define TRNG_CTL_NO_LFSR_FB_M 0x00000004
#define TRNG_CTL_NO_LFSR_FB_S 2
// Field: [1] TEST_MODE
//
// 1: Enables access to the TESTCNT and LFSR0/LFSR1/LFSR2 registers (the latter
// are automatically cleared before enabling access) and keeps
// IRQFLAGSTAT.NEED_CLOCK at '1'.
//
// This bit shall not be used unless you need to change the LFSR seed prior to
// creating a new random value. All other testing is done external to register
// control.
#define TRNG_CTL_TEST_MODE 0x00000002
#define TRNG_CTL_TEST_MODE_BITN 1
#define TRNG_CTL_TEST_MODE_M 0x00000002
#define TRNG_CTL_TEST_MODE_S 1
//*****************************************************************************
//
// Register: TRNG_O_CFG0
//
//*****************************************************************************
// Field: [31:16] MAX_REFILL_CYCLES
//
// This field determines the maximum number of samples (between 2^8 and 2^24)
// taken to re-generate entropy from the FROs after reading out a 64 bits
// random number. If the written value of this field is zero, the number of
// samples is 2^24, otherwise the number of samples equals the written value
// times 2^8.
//
// 0x0000: 2^24 samples
// 0x0001: 1*2^8 samples
// 0x0002: 2*2^8 samples
// 0x0003: 3*2^8 samples
// ...
// 0x8000: 32768*2^8 samples
// 0xC000: 49152*2^8 samples
// ...
// 0xFFFF: 65535*2^8 samples
//
// This field can only be modified while CTL.TRNG_EN is 0.
#define TRNG_CFG0_MAX_REFILL_CYCLES_W 16
#define TRNG_CFG0_MAX_REFILL_CYCLES_M 0xFFFF0000
#define TRNG_CFG0_MAX_REFILL_CYCLES_S 16
// Field: [11:8] SMPL_DIV
//
// This field directly controls the number of clock cycles between samples
// taken from the FROs. Default value 0 indicates that samples are taken every
// clock cycle,
// maximum value 0xF takes one sample every 16 clock cycles.
// This field must be set to a value such that the slowest FRO (even under
// worst-case
// conditions) has a cycle time less than twice the sample period.
//
// This field can only be modified while CTL.TRNG_EN is '0'.
#define TRNG_CFG0_SMPL_DIV_W 4
#define TRNG_CFG0_SMPL_DIV_M 0x00000F00
#define TRNG_CFG0_SMPL_DIV_S 8
// Field: [7:0] MIN_REFILL_CYCLES
//
// This field determines the minimum number of samples (between 2^6 and 2^14)
// taken to re-generate entropy from the FROs after reading out a 64 bits
// random number. If the value of this field is zero, the number of samples is
// fixed to the value determined by the MAX_REFILL_CYCLES field, otherwise the
// minimum number of samples equals the written value times 64 (which can be up
// to 2^14). To ensure same entropy in all generated random numbers the value 0
// should be used. Then MAX_REFILL_CYCLES controls the minimum refill interval.
// The number of samples defined here cannot be higher than the number defined
// by the 'max_refill_cycles' field (i.e. that field takes precedence). No
// random value will be created if min refill > max refill.
//
// This field can only be modified while CTL.TRNG_EN = 0.
//
// 0x00: Minimum samples = MAX_REFILL_CYCLES (all numbers have same entropy)
// 0x01: 1*2^6 samples
// 0x02: 2*2^6 samples
// ...
// 0xFF: 255*2^6 samples
#define TRNG_CFG0_MIN_REFILL_CYCLES_W 8
#define TRNG_CFG0_MIN_REFILL_CYCLES_M 0x000000FF
#define TRNG_CFG0_MIN_REFILL_CYCLES_S 0
//*****************************************************************************
//
// Register: TRNG_O_ALARMCNT
//
//*****************************************************************************
// Field: [29:24] SHUTDOWN_CNT
//
// Read-only, indicates the number of '1' bits in ALARMSTOP register.
// The maximum value equals the number of FROs.
#define TRNG_ALARMCNT_SHUTDOWN_CNT_W 6
#define TRNG_ALARMCNT_SHUTDOWN_CNT_M 0x3F000000
#define TRNG_ALARMCNT_SHUTDOWN_CNT_S 24
// Field: [20:16] SHUTDOWN_THR
//
// Threshold setting for generating IRQFLAGSTAT.SHUTDOWN_OVF interrupt. The
// interrupt is triggered when SHUTDOWN_CNT value exceeds this bit field.
#define TRNG_ALARMCNT_SHUTDOWN_THR_W 5
#define TRNG_ALARMCNT_SHUTDOWN_THR_M 0x001F0000
#define TRNG_ALARMCNT_SHUTDOWN_THR_S 16
// Field: [7:0] ALARM_THR
//
// Alarm detection threshold for the repeating pattern detectors on each FRO.
// An FRO 'alarm event' is declared when a repeating pattern (of up to four
// samples length) is detected continuously for the number of samples defined
// by this field's value. Reset value 0xFF should keep the number of 'alarm
// events' to a manageable level.
#define TRNG_ALARMCNT_ALARM_THR_W 8
#define TRNG_ALARMCNT_ALARM_THR_M 0x000000FF
#define TRNG_ALARMCNT_ALARM_THR_S 0
//*****************************************************************************
//
// Register: TRNG_O_FROEN
//
//*****************************************************************************
// Field: [23:0] FRO_MASK
//
// Enable bits for the individual FROs. A '1' in bit [n] enables FRO 'n'.
// Default state is all '1's to enable all FROs after power-up. Note that they
// are not actually started up before the CTL.TRNG_EN bit is set to '1'.
//
// Bits are automatically forced to '0' here (and cannot be written to '1')
// while the corresponding bit in ALARMSTOP.FRO_FLAGS has value '1'.
#define TRNG_FROEN_FRO_MASK_W 24
#define TRNG_FROEN_FRO_MASK_M 0x00FFFFFF
#define TRNG_FROEN_FRO_MASK_S 0
//*****************************************************************************
//
// Register: TRNG_O_FRODETUNE
//
//*****************************************************************************
// Field: [23:0] FRO_MASK
//
// De-tune bits for the individual FROs. A '1' in bit [n] lets FRO 'n' run
// approximately 5% faster. The value of one of these bits may only be changed
// while the corresponding FRO is turned off (by temporarily writing a '0' in
// the corresponding
// bit of the FROEN.FRO_MASK register).
#define TRNG_FRODETUNE_FRO_MASK_W 24
#define TRNG_FRODETUNE_FRO_MASK_M 0x00FFFFFF
#define TRNG_FRODETUNE_FRO_MASK_S 0
//*****************************************************************************
//
// Register: TRNG_O_ALARMMASK
//
//*****************************************************************************
// Field: [23:0] FRO_MASK
//
// Logging bits for the 'alarm events' of individual FROs. A '1' in bit [n]
// indicates FRO 'n' experienced an 'alarm event'.
#define TRNG_ALARMMASK_FRO_MASK_W 24
#define TRNG_ALARMMASK_FRO_MASK_M 0x00FFFFFF
#define TRNG_ALARMMASK_FRO_MASK_S 0
//*****************************************************************************
//
// Register: TRNG_O_ALARMSTOP
//
//*****************************************************************************
// Field: [23:0] FRO_FLAGS
//
// Logging bits for the 'alarm events' of individual FROs. A '1' in bit [n]
// indicates FRO 'n' experienced more than one 'alarm event' in quick
// succession and has been turned off. A '1' in this field forces the
// corresponding bit in FROEN.FRO_MASK to '0'.
#define TRNG_ALARMSTOP_FRO_FLAGS_W 24
#define TRNG_ALARMSTOP_FRO_FLAGS_M 0x00FFFFFF
#define TRNG_ALARMSTOP_FRO_FLAGS_S 0
//*****************************************************************************
//
// Register: TRNG_O_LFSR0
//
//*****************************************************************************
// Field: [31:0] LFSR_31_0
//
// Bits [31:0] of the main entropy accumulation LFSR. Register can only be
// accessed when CTL.TEST_MODE = 1.
// Register contents will be cleared to zero before access is enabled.
#define TRNG_LFSR0_LFSR_31_0_W 32
#define TRNG_LFSR0_LFSR_31_0_M 0xFFFFFFFF
#define TRNG_LFSR0_LFSR_31_0_S 0
//*****************************************************************************
//
// Register: TRNG_O_LFSR1
//
//*****************************************************************************
// Field: [31:0] LFSR_63_32
//
// Bits [63:32] of the main entropy accumulation LFSR. Register can only be
// accessed when CTL.TEST_MODE = 1.
// Register contents will be cleared to zero before access is enabled.
#define TRNG_LFSR1_LFSR_63_32_W 32
#define TRNG_LFSR1_LFSR_63_32_M 0xFFFFFFFF
#define TRNG_LFSR1_LFSR_63_32_S 0
//*****************************************************************************
//
// Register: TRNG_O_LFSR2
//
//*****************************************************************************
// Field: [16:0] LFSR_80_64
//
// Bits [80:64] of the main entropy accumulation LFSR. Register can only be
// accessed when CTL.TEST_MODE = 1.
// Register contents will be cleared to zero before access is enabled.
#define TRNG_LFSR2_LFSR_80_64_W 17
#define TRNG_LFSR2_LFSR_80_64_M 0x0001FFFF
#define TRNG_LFSR2_LFSR_80_64_S 0
//*****************************************************************************
//
// Register: TRNG_O_HWOPT
//
//*****************************************************************************
// Field: [11:6] NR_OF_FROS
//
// Number of FROs implemented in this TRNG, value 24 (decimal).
#define TRNG_HWOPT_NR_OF_FROS_W 6
#define TRNG_HWOPT_NR_OF_FROS_M 0x00000FC0
#define TRNG_HWOPT_NR_OF_FROS_S 6
//*****************************************************************************
//
// Register: TRNG_O_HWVER0
//
//*****************************************************************************
// Field: [27:24] HW_MAJOR_VER
//
// 4 bits binary encoding of the major hardware revision number.
#define TRNG_HWVER0_HW_MAJOR_VER_W 4
#define TRNG_HWVER0_HW_MAJOR_VER_M 0x0F000000
#define TRNG_HWVER0_HW_MAJOR_VER_S 24
// Field: [23:20] HW_MINOR_VER
//
// 4 bits binary encoding of the minor hardware revision number.
#define TRNG_HWVER0_HW_MINOR_VER_W 4
#define TRNG_HWVER0_HW_MINOR_VER_M 0x00F00000
#define TRNG_HWVER0_HW_MINOR_VER_S 20
// Field: [19:16] HW_PATCH_LVL
//
// 4 bits binary encoding of the hardware patch level, initial release will
// carry value zero.
#define TRNG_HWVER0_HW_PATCH_LVL_W 4
#define TRNG_HWVER0_HW_PATCH_LVL_M 0x000F0000
#define TRNG_HWVER0_HW_PATCH_LVL_S 16
// Field: [15:8] EIP_NUM_COMPL
//
// Bit-by-bit logic complement of bits [7:0]. This TRNG gives 0xB4.
#define TRNG_HWVER0_EIP_NUM_COMPL_W 8
#define TRNG_HWVER0_EIP_NUM_COMPL_M 0x0000FF00
#define TRNG_HWVER0_EIP_NUM_COMPL_S 8
// Field: [7:0] EIP_NUM
//
// 8 bits binary encoding of the module number. This TRNG gives 0x4B.
#define TRNG_HWVER0_EIP_NUM_W 8
#define TRNG_HWVER0_EIP_NUM_M 0x000000FF
#define TRNG_HWVER0_EIP_NUM_S 0
//*****************************************************************************
//
// Register: TRNG_O_IRQSTATMASK
//
//*****************************************************************************
// Field: [1] SHUTDOWN_OVF
//
// Shutdown Overflow (result of IRQFLAGSTAT.SHUTDOWN_OVF AND'ed with
// IRQFLAGMASK.SHUTDOWN_OVF)
#define TRNG_IRQSTATMASK_SHUTDOWN_OVF 0x00000002
#define TRNG_IRQSTATMASK_SHUTDOWN_OVF_BITN 1
#define TRNG_IRQSTATMASK_SHUTDOWN_OVF_M 0x00000002
#define TRNG_IRQSTATMASK_SHUTDOWN_OVF_S 1
// Field: [0] RDY
//
// New random value available (result of IRQFLAGSTAT.RDY AND'ed with
// IRQFLAGMASK.RDY)
#define TRNG_IRQSTATMASK_RDY 0x00000001
#define TRNG_IRQSTATMASK_RDY_BITN 0
#define TRNG_IRQSTATMASK_RDY_M 0x00000001
#define TRNG_IRQSTATMASK_RDY_S 0
//*****************************************************************************
//
// Register: TRNG_O_HWVER1
//
//*****************************************************************************
// Field: [7:0] REV
//
// The revision number of this module is Rev 2.0.
#define TRNG_HWVER1_REV_W 8
#define TRNG_HWVER1_REV_M 0x000000FF
#define TRNG_HWVER1_REV_S 0
//*****************************************************************************
//
// Register: TRNG_O_IRQSET
//
//*****************************************************************************
//*****************************************************************************
//
// Register: TRNG_O_SWRESET
//
//*****************************************************************************
// Field: [0] RESET
//
// Write '1' to soft reset , reset will be low for 4-5 clock cycles. Poll to 0
// for reset to be completed.
#define TRNG_SWRESET_RESET 0x00000001
#define TRNG_SWRESET_RESET_BITN 0
#define TRNG_SWRESET_RESET_M 0x00000001
#define TRNG_SWRESET_RESET_S 0
//*****************************************************************************
//
// Register: TRNG_O_IRQSTAT
//
//*****************************************************************************
// Field: [0] STAT
//
// TRNG Interrupt status. OR'ed version of IRQFLAGSTAT.SHUTDOWN_OVF and
// IRQFLAGSTAT.RDY
#define TRNG_IRQSTAT_STAT 0x00000001
#define TRNG_IRQSTAT_STAT_BITN 0
#define TRNG_IRQSTAT_STAT_M 0x00000001
#define TRNG_IRQSTAT_STAT_S 0
#endif // __TRNG__