-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathhw_crypto.h
1914 lines (1750 loc) · 88.7 KB
/
hw_crypto.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
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/******************************************************************************
* Filename: hw_crypto_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_CRYPTO_H__
#define __HW_CRYPTO_H__
//*****************************************************************************
//
// This section defines the register offsets of
// CRYPTO component
//
//*****************************************************************************
// DMA Channel 0 Control
#define CRYPTO_O_DMACH0CTL 0x00000000
// DMA Channel 0 External Address
#define CRYPTO_O_DMACH0EXTADDR 0x00000004
// DMA Channel 0 Length
#define CRYPTO_O_DMACH0LEN 0x0000000C
// DMA Controller Status
#define CRYPTO_O_DMASTAT 0x00000018
// DMA Controller Software Reset
#define CRYPTO_O_DMASWRESET 0x0000001C
// DMA Channel 1 Control
#define CRYPTO_O_DMACH1CTL 0x00000020
// DMA Channel 1 External Address
#define CRYPTO_O_DMACH1EXTADDR 0x00000024
// DMA Channel 1 Length
#define CRYPTO_O_DMACH1LEN 0x0000002C
// DMA Controller Master Configuration
#define CRYPTO_O_DMABUSCFG 0x00000078
// DMA Controller Port Error
#define CRYPTO_O_DMAPORTERR 0x0000007C
// DMA Controller Version
#define CRYPTO_O_DMAHWVER 0x000000FC
// Key Write Area
#define CRYPTO_O_KEYWRITEAREA 0x00000400
// Key Written Area Status
#define CRYPTO_O_KEYWRITTENAREA 0x00000404
// Key Size
#define CRYPTO_O_KEYSIZE 0x00000408
// Key Read Area
#define CRYPTO_O_KEYREADAREA 0x0000040C
// Clear AES_KEY2/GHASH Key
#define CRYPTO_O_AESKEY20 0x00000500
// Clear AES_KEY2/GHASH Key
#define CRYPTO_O_AESKEY21 0x00000504
// Clear AES_KEY2/GHASH Key
#define CRYPTO_O_AESKEY22 0x00000508
// Clear AES_KEY2/GHASH Key
#define CRYPTO_O_AESKEY23 0x0000050C
// Clear AES_KEY3
#define CRYPTO_O_AESKEY30 0x00000510
// Clear AES_KEY3
#define CRYPTO_O_AESKEY31 0x00000514
// Clear AES_KEY3
#define CRYPTO_O_AESKEY32 0x00000518
// Clear AES_KEY3
#define CRYPTO_O_AESKEY33 0x0000051C
// AES Initialization Vector
#define CRYPTO_O_AESIV0 0x00000540
// AES Initialization Vector
#define CRYPTO_O_AESIV1 0x00000544
// AES Initialization Vector
#define CRYPTO_O_AESIV2 0x00000548
// AES Initialization Vector
#define CRYPTO_O_AESIV3 0x0000054C
// AES Input/Output Buffer Control
#define CRYPTO_O_AESCTL 0x00000550
// Crypto Data Length LSW
#define CRYPTO_O_AESDATALEN0 0x00000554
// Crypto Data Length MSW
#define CRYPTO_O_AESDATALEN1 0x00000558
// AES Authentication Length
#define CRYPTO_O_AESAUTHLEN 0x0000055C
// Data Input/Output
#define CRYPTO_O_AESDATAOUT0 0x00000560
// AES Data Input/Output 0
#define CRYPTO_O_AESDATAIN0 0x00000560
// AES Data Input/Output 3
#define CRYPTO_O_AESDATAOUT1 0x00000564
// AES Data Input/Output 1
#define CRYPTO_O_AESDATAIN1 0x00000564
// AES Data Input/Output 2
#define CRYPTO_O_AESDATAOUT2 0x00000568
// AES Data Input/Output 2
#define CRYPTO_O_AESDATAIN2 0x00000568
// AES Data Input/Output 3
#define CRYPTO_O_AESDATAOUT3 0x0000056C
// Data Input/Output
#define CRYPTO_O_AESDATAIN3 0x0000056C
// AES Tag Output
#define CRYPTO_O_AESTAGOUT0 0x00000570
// AES Tag Output
#define CRYPTO_O_AESTAGOUT1 0x00000574
// AES Tag Output
#define CRYPTO_O_AESTAGOUT2 0x00000578
// AES Tag Output
#define CRYPTO_O_AESTAGOUT3 0x0000057C
// Master Algorithm Select
#define CRYPTO_O_ALGSEL 0x00000700
// Master Protection Control
#define CRYPTO_O_DMAPROTCTL 0x00000704
// Software Reset
#define CRYPTO_O_SWRESET 0x00000740
// Control Interrupt Configuration
#define CRYPTO_O_IRQTYPE 0x00000780
// Interrupt Enable
#define CRYPTO_O_IRQEN 0x00000784
// Interrupt Clear
#define CRYPTO_O_IRQCLR 0x00000788
// Interrupt Set
#define CRYPTO_O_IRQSET 0x0000078C
// Interrupt Status
#define CRYPTO_O_IRQSTAT 0x00000790
// CTRL Module Version
#define CRYPTO_O_HWVER 0x000007FC
//*****************************************************************************
//
// Register: CRYPTO_O_DMACH0CTL
//
//*****************************************************************************
// Field: [1] PRIO
//
// Channel priority:
//
// A channel with high priority will be served before a channel with low
// priority in cases with simultaneous access requests. If both channels have
// the same priority access of the channels to the external port is arbitrated
// using a Round Robin scheme.
// ENUMs:
// HIGH Priority high
// LOW Priority low
#define CRYPTO_DMACH0CTL_PRIO 0x00000002
#define CRYPTO_DMACH0CTL_PRIO_BITN 1
#define CRYPTO_DMACH0CTL_PRIO_M 0x00000002
#define CRYPTO_DMACH0CTL_PRIO_S 1
#define CRYPTO_DMACH0CTL_PRIO_HIGH 0x00000002
#define CRYPTO_DMACH0CTL_PRIO_LOW 0x00000000
// Field: [0] EN
//
// DMA Channel 0 Control
// ENUMs:
// EN Channel enabled
// DIS Channel disabled
#define CRYPTO_DMACH0CTL_EN 0x00000001
#define CRYPTO_DMACH0CTL_EN_BITN 0
#define CRYPTO_DMACH0CTL_EN_M 0x00000001
#define CRYPTO_DMACH0CTL_EN_S 0
#define CRYPTO_DMACH0CTL_EN_EN 0x00000001
#define CRYPTO_DMACH0CTL_EN_DIS 0x00000000
//*****************************************************************************
//
// Register: CRYPTO_O_DMACH0EXTADDR
//
//*****************************************************************************
// Field: [31:0] ADDR
//
// Channel external address value.
// Holds the last updated external address after being sent to the master
// interface.
#define CRYPTO_DMACH0EXTADDR_ADDR_W 32
#define CRYPTO_DMACH0EXTADDR_ADDR_M 0xFFFFFFFF
#define CRYPTO_DMACH0EXTADDR_ADDR_S 0
//*****************************************************************************
//
// Register: CRYPTO_O_DMACH0LEN
//
//*****************************************************************************
// Field: [15:0] LEN
//
// DMA transfer length in bytes.
// During configuration, this register contains the DMA transfer length in
// bytes. During operation, it contains the last updated value of the DMA
// transfer length after being sent to the master interface.
// Note: Writing a non-zero value to this register field starts the transfer if
// the channel is enabled by setting DMACH0CTL.EN.
#define CRYPTO_DMACH0LEN_LEN_W 16
#define CRYPTO_DMACH0LEN_LEN_M 0x0000FFFF
#define CRYPTO_DMACH0LEN_LEN_S 0
//*****************************************************************************
//
// Register: CRYPTO_O_DMASTAT
//
//*****************************************************************************
// Field: [17] PORT_ERR
//
// Reflects possible transfer errors on the AHB port.
#define CRYPTO_DMASTAT_PORT_ERR 0x00020000
#define CRYPTO_DMASTAT_PORT_ERR_BITN 17
#define CRYPTO_DMASTAT_PORT_ERR_M 0x00020000
#define CRYPTO_DMASTAT_PORT_ERR_S 17
// Field: [1] CH1_ACTIVE
//
// This register field indicates if DMA channel 1 is active or not.
// 0: Not active
// 1: Active
#define CRYPTO_DMASTAT_CH1_ACTIVE 0x00000002
#define CRYPTO_DMASTAT_CH1_ACTIVE_BITN 1
#define CRYPTO_DMASTAT_CH1_ACTIVE_M 0x00000002
#define CRYPTO_DMASTAT_CH1_ACTIVE_S 1
// Field: [0] CH0_ACTIVE
//
// This register field indicates if DMA channel 0 is active or not.
// 0: Not active
// 1: Active
#define CRYPTO_DMASTAT_CH0_ACTIVE 0x00000001
#define CRYPTO_DMASTAT_CH0_ACTIVE_BITN 0
#define CRYPTO_DMASTAT_CH0_ACTIVE_M 0x00000001
#define CRYPTO_DMASTAT_CH0_ACTIVE_S 0
//*****************************************************************************
//
// Register: CRYPTO_O_DMASWRESET
//
//*****************************************************************************
// Field: [0] RESET
//
// Software reset enable
//
// 0: Disable
// 1: Enable (self-cleared to zero).
//
// Note: Completion of the software reset must be checked in DMASTAT.CH0_ACTIVE
// and DMASTAT.CH1_ACTIVE.
#define CRYPTO_DMASWRESET_RESET 0x00000001
#define CRYPTO_DMASWRESET_RESET_BITN 0
#define CRYPTO_DMASWRESET_RESET_M 0x00000001
#define CRYPTO_DMASWRESET_RESET_S 0
//*****************************************************************************
//
// Register: CRYPTO_O_DMACH1CTL
//
//*****************************************************************************
// Field: [1] PRIO
//
// Channel priority:
//
// A channel with high priority will be served before a channel with low
// priority in cases with simultaneous access requests. If both channels have
// the same priority access of the channels to the external port is arbitrated
// using a Round Robin scheme.
// ENUMs:
// HIGH Priority high
// LOW Priority low
#define CRYPTO_DMACH1CTL_PRIO 0x00000002
#define CRYPTO_DMACH1CTL_PRIO_BITN 1
#define CRYPTO_DMACH1CTL_PRIO_M 0x00000002
#define CRYPTO_DMACH1CTL_PRIO_S 1
#define CRYPTO_DMACH1CTL_PRIO_HIGH 0x00000002
#define CRYPTO_DMACH1CTL_PRIO_LOW 0x00000000
// Field: [0] EN
//
// Channel enable:
//
// Note: Disabling an active channel will interrupt the DMA operation. The
// ongoing block transfer will be completed, but no new transfers will be
// requested.
// ENUMs:
// EN Channel enabled
// DIS Channel disabled
#define CRYPTO_DMACH1CTL_EN 0x00000001
#define CRYPTO_DMACH1CTL_EN_BITN 0
#define CRYPTO_DMACH1CTL_EN_M 0x00000001
#define CRYPTO_DMACH1CTL_EN_S 0
#define CRYPTO_DMACH1CTL_EN_EN 0x00000001
#define CRYPTO_DMACH1CTL_EN_DIS 0x00000000
//*****************************************************************************
//
// Register: CRYPTO_O_DMACH1EXTADDR
//
//*****************************************************************************
// Field: [31:0] ADDR
//
// Channel external address value.
// Holds the last updated external address after being sent to the master
// interface.
#define CRYPTO_DMACH1EXTADDR_ADDR_W 32
#define CRYPTO_DMACH1EXTADDR_ADDR_M 0xFFFFFFFF
#define CRYPTO_DMACH1EXTADDR_ADDR_S 0
//*****************************************************************************
//
// Register: CRYPTO_O_DMACH1LEN
//
//*****************************************************************************
// Field: [15:0] LEN
//
// DMA transfer length in bytes.
// During configuration, this register contains the DMA transfer length in
// bytes. During operation, it contains the last updated value of the DMA
// transfer length after being sent to the master interface.
// Note: Writing a non-zero value to this register field starts the transfer if
// the channel is enabled by setting DMACH1CTL.EN.
#define CRYPTO_DMACH1LEN_LEN_W 16
#define CRYPTO_DMACH1LEN_LEN_M 0x0000FFFF
#define CRYPTO_DMACH1LEN_LEN_S 0
//*****************************************************************************
//
// Register: CRYPTO_O_DMABUSCFG
//
//*****************************************************************************
// Field: [15:12] AHB_MST1_BURST_SIZE
//
// Maximum burst size that can be performed on the AHB bus
// ENUMs:
// 64_BYTE 64 bytes
// 32_BYTE 32 bytes
// 16_BYTE 16 bytes
// 8_BYTE 8 bytes
// 4_BYTE 4 bytes
#define CRYPTO_DMABUSCFG_AHB_MST1_BURST_SIZE_W 4
#define CRYPTO_DMABUSCFG_AHB_MST1_BURST_SIZE_M 0x0000F000
#define CRYPTO_DMABUSCFG_AHB_MST1_BURST_SIZE_S 12
#define CRYPTO_DMABUSCFG_AHB_MST1_BURST_SIZE_64_BYTE 0x00006000
#define CRYPTO_DMABUSCFG_AHB_MST1_BURST_SIZE_32_BYTE 0x00005000
#define CRYPTO_DMABUSCFG_AHB_MST1_BURST_SIZE_16_BYTE 0x00004000
#define CRYPTO_DMABUSCFG_AHB_MST1_BURST_SIZE_8_BYTE 0x00003000
#define CRYPTO_DMABUSCFG_AHB_MST1_BURST_SIZE_4_BYTE 0x00002000
// Field: [11] AHB_MST1_IDLE_EN
//
// Idle transfer insertion between consecutive burst transfers on AHB
// ENUMs:
// IDLE Idle transfer insertion enabled
// NO_IDLE Do not insert idle transfers.
#define CRYPTO_DMABUSCFG_AHB_MST1_IDLE_EN 0x00000800
#define CRYPTO_DMABUSCFG_AHB_MST1_IDLE_EN_BITN 11
#define CRYPTO_DMABUSCFG_AHB_MST1_IDLE_EN_M 0x00000800
#define CRYPTO_DMABUSCFG_AHB_MST1_IDLE_EN_S 11
#define CRYPTO_DMABUSCFG_AHB_MST1_IDLE_EN_IDLE 0x00000800
#define CRYPTO_DMABUSCFG_AHB_MST1_IDLE_EN_NO_IDLE 0x00000000
// Field: [10] AHB_MST1_INCR_EN
//
// Burst length type of AHB transfer
// ENUMs:
// SPECIFIED Fixed length bursts or single transfers
// UNSPECIFIED Unspecified length burst transfers
#define CRYPTO_DMABUSCFG_AHB_MST1_INCR_EN 0x00000400
#define CRYPTO_DMABUSCFG_AHB_MST1_INCR_EN_BITN 10
#define CRYPTO_DMABUSCFG_AHB_MST1_INCR_EN_M 0x00000400
#define CRYPTO_DMABUSCFG_AHB_MST1_INCR_EN_S 10
#define CRYPTO_DMABUSCFG_AHB_MST1_INCR_EN_SPECIFIED 0x00000400
#define CRYPTO_DMABUSCFG_AHB_MST1_INCR_EN_UNSPECIFIED 0x00000000
// Field: [9] AHB_MST1_LOCK_EN
//
// Locked transform on AHB
// ENUMs:
// LOCKED Transfers are locked
// NOT_LOCKED Transfers are not locked
#define CRYPTO_DMABUSCFG_AHB_MST1_LOCK_EN 0x00000200
#define CRYPTO_DMABUSCFG_AHB_MST1_LOCK_EN_BITN 9
#define CRYPTO_DMABUSCFG_AHB_MST1_LOCK_EN_M 0x00000200
#define CRYPTO_DMABUSCFG_AHB_MST1_LOCK_EN_S 9
#define CRYPTO_DMABUSCFG_AHB_MST1_LOCK_EN_LOCKED 0x00000200
#define CRYPTO_DMABUSCFG_AHB_MST1_LOCK_EN_NOT_LOCKED 0x00000000
// Field: [8] AHB_MST1_BIGEND
//
// Endianess for the AHB master
// ENUMs:
// BIG_ENDIAN Big Endian
// LITTLE_ENDIAN Little Endian
#define CRYPTO_DMABUSCFG_AHB_MST1_BIGEND 0x00000100
#define CRYPTO_DMABUSCFG_AHB_MST1_BIGEND_BITN 8
#define CRYPTO_DMABUSCFG_AHB_MST1_BIGEND_M 0x00000100
#define CRYPTO_DMABUSCFG_AHB_MST1_BIGEND_S 8
#define CRYPTO_DMABUSCFG_AHB_MST1_BIGEND_BIG_ENDIAN 0x00000100
#define CRYPTO_DMABUSCFG_AHB_MST1_BIGEND_LITTLE_ENDIAN 0x00000000
//*****************************************************************************
//
// Register: CRYPTO_O_DMAPORTERR
//
//*****************************************************************************
// Field: [12] AHB_ERR
//
// A 1 indicates that the Crypto peripheral has detected an AHB bus error
#define CRYPTO_DMAPORTERR_AHB_ERR 0x00001000
#define CRYPTO_DMAPORTERR_AHB_ERR_BITN 12
#define CRYPTO_DMAPORTERR_AHB_ERR_M 0x00001000
#define CRYPTO_DMAPORTERR_AHB_ERR_S 12
// Field: [9] LAST_CH
//
// Indicates which channel was serviced last (channel 0 or channel 1) by the
// AHB master port.
#define CRYPTO_DMAPORTERR_LAST_CH 0x00000200
#define CRYPTO_DMAPORTERR_LAST_CH_BITN 9
#define CRYPTO_DMAPORTERR_LAST_CH_M 0x00000200
#define CRYPTO_DMAPORTERR_LAST_CH_S 9
//*****************************************************************************
//
// Register: CRYPTO_O_DMAHWVER
//
//*****************************************************************************
// Field: [27:24] HW_MAJOR_VER
//
// Major version number
#define CRYPTO_DMAHWVER_HW_MAJOR_VER_W 4
#define CRYPTO_DMAHWVER_HW_MAJOR_VER_M 0x0F000000
#define CRYPTO_DMAHWVER_HW_MAJOR_VER_S 24
// Field: [23:20] HW_MINOR_VER
//
// Minor version number
#define CRYPTO_DMAHWVER_HW_MINOR_VER_W 4
#define CRYPTO_DMAHWVER_HW_MINOR_VER_M 0x00F00000
#define CRYPTO_DMAHWVER_HW_MINOR_VER_S 20
// Field: [19:16] HW_PATCH_LVL
//
// Patch level.
#define CRYPTO_DMAHWVER_HW_PATCH_LVL_W 4
#define CRYPTO_DMAHWVER_HW_PATCH_LVL_M 0x000F0000
#define CRYPTO_DMAHWVER_HW_PATCH_LVL_S 16
// Field: [15:8] VER_NUM_COMPL
//
// Bit-by-bit complement of the VER_NUM field bits.
#define CRYPTO_DMAHWVER_VER_NUM_COMPL_W 8
#define CRYPTO_DMAHWVER_VER_NUM_COMPL_M 0x0000FF00
#define CRYPTO_DMAHWVER_VER_NUM_COMPL_S 8
// Field: [7:0] VER_NUM
//
// Version number of the DMA Controller (209)
#define CRYPTO_DMAHWVER_VER_NUM_W 8
#define CRYPTO_DMAHWVER_VER_NUM_M 0x000000FF
#define CRYPTO_DMAHWVER_VER_NUM_S 0
//*****************************************************************************
//
// Register: CRYPTO_O_KEYWRITEAREA
//
//*****************************************************************************
// Field: [7] RAM_AREA7
//
// Represents an area of 128 bits.
// Select the key store RAM area(s) where the key(s) needs to be written.
//
// Writing to multiple RAM locations is only possible when the selected RAM
// areas are sequential.
// ENUMs:
// SEL This RAM area is selected to be written
// NOT_SEL This RAM area is not selected to be written
#define CRYPTO_KEYWRITEAREA_RAM_AREA7 0x00000080
#define CRYPTO_KEYWRITEAREA_RAM_AREA7_BITN 7
#define CRYPTO_KEYWRITEAREA_RAM_AREA7_M 0x00000080
#define CRYPTO_KEYWRITEAREA_RAM_AREA7_S 7
#define CRYPTO_KEYWRITEAREA_RAM_AREA7_SEL 0x00000080
#define CRYPTO_KEYWRITEAREA_RAM_AREA7_NOT_SEL 0x00000000
// Field: [6] RAM_AREA6
//
// Represents an area of 128 bits.
// Select the key store RAM area(s) where the key(s) needs to be written.
//
// Writing to multiple RAM locations is only possible when the selected RAM
// areas are sequential.
// ENUMs:
// SEL This RAM area is selected to be written
// NOT_SEL This RAM area is not selected to be written
#define CRYPTO_KEYWRITEAREA_RAM_AREA6 0x00000040
#define CRYPTO_KEYWRITEAREA_RAM_AREA6_BITN 6
#define CRYPTO_KEYWRITEAREA_RAM_AREA6_M 0x00000040
#define CRYPTO_KEYWRITEAREA_RAM_AREA6_S 6
#define CRYPTO_KEYWRITEAREA_RAM_AREA6_SEL 0x00000040
#define CRYPTO_KEYWRITEAREA_RAM_AREA6_NOT_SEL 0x00000000
// Field: [5] RAM_AREA5
//
// Represents an area of 128 bits.
// Select the key store RAM area(s) where the key(s) needs to be written.
//
// Writing to multiple RAM locations is only possible when the selected RAM
// areas are sequential.
// ENUMs:
// SEL This RAM area is selected to be written
// NOT_SEL This RAM area is not selected to be written
#define CRYPTO_KEYWRITEAREA_RAM_AREA5 0x00000020
#define CRYPTO_KEYWRITEAREA_RAM_AREA5_BITN 5
#define CRYPTO_KEYWRITEAREA_RAM_AREA5_M 0x00000020
#define CRYPTO_KEYWRITEAREA_RAM_AREA5_S 5
#define CRYPTO_KEYWRITEAREA_RAM_AREA5_SEL 0x00000020
#define CRYPTO_KEYWRITEAREA_RAM_AREA5_NOT_SEL 0x00000000
// Field: [4] RAM_AREA4
//
// Represents an area of 128 bits.
// Select the key store RAM area(s) where the key(s) needs to be written.
//
// Writing to multiple RAM locations is only possible when the selected RAM
// areas are sequential.
// ENUMs:
// SEL This RAM area is selected to be written
// NOT_SEL This RAM area is not selected to be written
#define CRYPTO_KEYWRITEAREA_RAM_AREA4 0x00000010
#define CRYPTO_KEYWRITEAREA_RAM_AREA4_BITN 4
#define CRYPTO_KEYWRITEAREA_RAM_AREA4_M 0x00000010
#define CRYPTO_KEYWRITEAREA_RAM_AREA4_S 4
#define CRYPTO_KEYWRITEAREA_RAM_AREA4_SEL 0x00000010
#define CRYPTO_KEYWRITEAREA_RAM_AREA4_NOT_SEL 0x00000000
// Field: [3] RAM_AREA3
//
// Represents an area of 128 bits.
// Select the key store RAM area(s) where the key(s) needs to be written.
//
// Writing to multiple RAM locations is only possible when the selected RAM
// areas are sequential.
// ENUMs:
// SEL This RAM area is selected to be written
// NOT_SEL This RAM area is not selected to be written
#define CRYPTO_KEYWRITEAREA_RAM_AREA3 0x00000008
#define CRYPTO_KEYWRITEAREA_RAM_AREA3_BITN 3
#define CRYPTO_KEYWRITEAREA_RAM_AREA3_M 0x00000008
#define CRYPTO_KEYWRITEAREA_RAM_AREA3_S 3
#define CRYPTO_KEYWRITEAREA_RAM_AREA3_SEL 0x00000008
#define CRYPTO_KEYWRITEAREA_RAM_AREA3_NOT_SEL 0x00000000
// Field: [2] RAM_AREA2
//
// Represents an area of 128 bits.
// Select the key store RAM area(s) where the key(s) needs to be written.
//
// Writing to multiple RAM locations is only possible when the selected RAM
// areas are sequential.
// ENUMs:
// SEL This RAM area is selected to be written
// NOT_SEL This RAM area is not selected to be written
#define CRYPTO_KEYWRITEAREA_RAM_AREA2 0x00000004
#define CRYPTO_KEYWRITEAREA_RAM_AREA2_BITN 2
#define CRYPTO_KEYWRITEAREA_RAM_AREA2_M 0x00000004
#define CRYPTO_KEYWRITEAREA_RAM_AREA2_S 2
#define CRYPTO_KEYWRITEAREA_RAM_AREA2_SEL 0x00000004
#define CRYPTO_KEYWRITEAREA_RAM_AREA2_NOT_SEL 0x00000000
// Field: [1] RAM_AREA1
//
// Represents an area of 128 bits.
// Select the key store RAM area(s) where the key(s) needs to be written.
//
// Writing to multiple RAM locations is only possible when the selected RAM
// areas are sequential.
// ENUMs:
// SEL This RAM area is selected to be written
// NOT_SEL This RAM area is not selected to be written
#define CRYPTO_KEYWRITEAREA_RAM_AREA1 0x00000002
#define CRYPTO_KEYWRITEAREA_RAM_AREA1_BITN 1
#define CRYPTO_KEYWRITEAREA_RAM_AREA1_M 0x00000002
#define CRYPTO_KEYWRITEAREA_RAM_AREA1_S 1
#define CRYPTO_KEYWRITEAREA_RAM_AREA1_SEL 0x00000002
#define CRYPTO_KEYWRITEAREA_RAM_AREA1_NOT_SEL 0x00000000
// Field: [0] RAM_AREA0
//
// Represents an area of 128 bits.
// Select the key store RAM area(s) where the key(s) needs to be written.
//
// Writing to multiple RAM locations is only possible when the selected RAM
// areas are sequential.
// ENUMs:
// SEL This RAM area is selected to be written
// NOT_SEL This RAM area is not selected to be written
#define CRYPTO_KEYWRITEAREA_RAM_AREA0 0x00000001
#define CRYPTO_KEYWRITEAREA_RAM_AREA0_BITN 0
#define CRYPTO_KEYWRITEAREA_RAM_AREA0_M 0x00000001
#define CRYPTO_KEYWRITEAREA_RAM_AREA0_S 0
#define CRYPTO_KEYWRITEAREA_RAM_AREA0_SEL 0x00000001
#define CRYPTO_KEYWRITEAREA_RAM_AREA0_NOT_SEL 0x00000000
//*****************************************************************************
//
// Register: CRYPTO_O_KEYWRITTENAREA
//
//*****************************************************************************
// Field: [7] RAM_AREA_WRITTEN7
//
// On read this bit returns the key area written status.
//
// This bit can be reset by writing a 1.
//
// Note: This register will be reset on a soft reset initiated by writing to
// DMASWRESET.RESET. After a soft reset, all keys must be rewritten to the key
// store memory.
// ENUMs:
// WRITTEN This RAM area is written with valid key
// information
// NOT_WRITTEN This RAM area is not written with valid key
// information
#define CRYPTO_KEYWRITTENAREA_RAM_AREA_WRITTEN7 0x00000080
#define CRYPTO_KEYWRITTENAREA_RAM_AREA_WRITTEN7_BITN 7
#define CRYPTO_KEYWRITTENAREA_RAM_AREA_WRITTEN7_M 0x00000080
#define CRYPTO_KEYWRITTENAREA_RAM_AREA_WRITTEN7_S 7
#define CRYPTO_KEYWRITTENAREA_RAM_AREA_WRITTEN7_WRITTEN 0x00000080
#define CRYPTO_KEYWRITTENAREA_RAM_AREA_WRITTEN7_NOT_WRITTEN 0x00000000
// Field: [6] RAM_AREA_WRITTEN6
//
// On read this bit returns the key area written status.
//
// This bit can be reset by writing a 1.
//
// Note: This register will be reset on a soft reset initiated by writing to
// DMASWRESET.RESET. After a soft reset, all keys must be rewritten to the key
// store memory.
// ENUMs:
// WRITTEN This RAM area is written with valid key
// information
// NOT_WRITTEN This RAM area is not written with valid key
// information
#define CRYPTO_KEYWRITTENAREA_RAM_AREA_WRITTEN6 0x00000040
#define CRYPTO_KEYWRITTENAREA_RAM_AREA_WRITTEN6_BITN 6
#define CRYPTO_KEYWRITTENAREA_RAM_AREA_WRITTEN6_M 0x00000040
#define CRYPTO_KEYWRITTENAREA_RAM_AREA_WRITTEN6_S 6
#define CRYPTO_KEYWRITTENAREA_RAM_AREA_WRITTEN6_WRITTEN 0x00000040
#define CRYPTO_KEYWRITTENAREA_RAM_AREA_WRITTEN6_NOT_WRITTEN 0x00000000
// Field: [5] RAM_AREA_WRITTEN5
//
// On read this bit returns the key area written status.
//
// This bit can be reset by writing a 1.
//
// Note: This register will be reset on a soft reset initiated by writing to
// DMASWRESET.RESET. After a soft reset, all keys must be rewritten to the key
// store memory.
// ENUMs:
// WRITTEN This RAM area is written with valid key
// information
// NOT_WRITTEN This RAM area is not written with valid key
// information
#define CRYPTO_KEYWRITTENAREA_RAM_AREA_WRITTEN5 0x00000020
#define CRYPTO_KEYWRITTENAREA_RAM_AREA_WRITTEN5_BITN 5
#define CRYPTO_KEYWRITTENAREA_RAM_AREA_WRITTEN5_M 0x00000020
#define CRYPTO_KEYWRITTENAREA_RAM_AREA_WRITTEN5_S 5
#define CRYPTO_KEYWRITTENAREA_RAM_AREA_WRITTEN5_WRITTEN 0x00000020
#define CRYPTO_KEYWRITTENAREA_RAM_AREA_WRITTEN5_NOT_WRITTEN 0x00000000
// Field: [4] RAM_AREA_WRITTEN4
//
// On read this bit returns the key area written status.
//
// This bit can be reset by writing a 1.
//
// Note: This register will be reset on a soft reset initiated by writing to
// DMASWRESET.RESET. After a soft reset, all keys must be rewritten to the key
// store memory.
// ENUMs:
// WRITTEN This RAM area is written with valid key
// information
// NOT_WRITTEN This RAM area is not written with valid key
// information
#define CRYPTO_KEYWRITTENAREA_RAM_AREA_WRITTEN4 0x00000010
#define CRYPTO_KEYWRITTENAREA_RAM_AREA_WRITTEN4_BITN 4
#define CRYPTO_KEYWRITTENAREA_RAM_AREA_WRITTEN4_M 0x00000010
#define CRYPTO_KEYWRITTENAREA_RAM_AREA_WRITTEN4_S 4
#define CRYPTO_KEYWRITTENAREA_RAM_AREA_WRITTEN4_WRITTEN 0x00000010
#define CRYPTO_KEYWRITTENAREA_RAM_AREA_WRITTEN4_NOT_WRITTEN 0x00000000
// Field: [3] RAM_AREA_WRITTEN3
//
// On read this bit returns the key area written status.
//
// This bit can be reset by writing a 1.
//
// Note: This register will be reset on a soft reset initiated by writing to
// DMASWRESET.RESET. After a soft reset, all keys must be rewritten to the key
// store memory.
// ENUMs:
// WRITTEN This RAM area is written with valid key
// information
// NOT_WRITTEN This RAM area is not written with valid key
// information
#define CRYPTO_KEYWRITTENAREA_RAM_AREA_WRITTEN3 0x00000008
#define CRYPTO_KEYWRITTENAREA_RAM_AREA_WRITTEN3_BITN 3
#define CRYPTO_KEYWRITTENAREA_RAM_AREA_WRITTEN3_M 0x00000008
#define CRYPTO_KEYWRITTENAREA_RAM_AREA_WRITTEN3_S 3
#define CRYPTO_KEYWRITTENAREA_RAM_AREA_WRITTEN3_WRITTEN 0x00000008
#define CRYPTO_KEYWRITTENAREA_RAM_AREA_WRITTEN3_NOT_WRITTEN 0x00000000
// Field: [2] RAM_AREA_WRITTEN2
//
// On read this bit returns the key area written status.
//
// This bit can be reset by writing a 1.
//
// Note: This register will be reset on a soft reset initiated by writing to
// DMASWRESET.RESET. After a soft reset, all keys must be rewritten to the key
// store memory.
// ENUMs:
// WRITTEN This RAM area is written with valid key
// information
// NOT_WRITTEN This RAM area is not written with valid key
// information
#define CRYPTO_KEYWRITTENAREA_RAM_AREA_WRITTEN2 0x00000004
#define CRYPTO_KEYWRITTENAREA_RAM_AREA_WRITTEN2_BITN 2
#define CRYPTO_KEYWRITTENAREA_RAM_AREA_WRITTEN2_M 0x00000004
#define CRYPTO_KEYWRITTENAREA_RAM_AREA_WRITTEN2_S 2
#define CRYPTO_KEYWRITTENAREA_RAM_AREA_WRITTEN2_WRITTEN 0x00000004
#define CRYPTO_KEYWRITTENAREA_RAM_AREA_WRITTEN2_NOT_WRITTEN 0x00000000
// Field: [1] RAM_AREA_WRITTEN1
//
// On read this bit returns the key area written status.
//
// This bit can be reset by writing a 1.
//
// Note: This register will be reset on a soft reset initiated by writing to
// DMASWRESET.RESET. After a soft reset, all keys must be rewritten to the key
// store memory.
// ENUMs:
// WRITTEN This RAM area is written with valid key
// information
// NOT_WRITTEN This RAM area is not written with valid key
// information
#define CRYPTO_KEYWRITTENAREA_RAM_AREA_WRITTEN1 0x00000002
#define CRYPTO_KEYWRITTENAREA_RAM_AREA_WRITTEN1_BITN 1
#define CRYPTO_KEYWRITTENAREA_RAM_AREA_WRITTEN1_M 0x00000002
#define CRYPTO_KEYWRITTENAREA_RAM_AREA_WRITTEN1_S 1
#define CRYPTO_KEYWRITTENAREA_RAM_AREA_WRITTEN1_WRITTEN 0x00000002
#define CRYPTO_KEYWRITTENAREA_RAM_AREA_WRITTEN1_NOT_WRITTEN 0x00000000
// Field: [0] RAM_AREA_WRITTEN0
//
// On read this bit returns the key area written status.
//
//
// This bit can be reset by writing a 1.
//
// Note: This register will be reset on a soft reset initiated by writing to
// DMASWRESET.RESET. After a soft reset, all keys must be rewritten to the key
// store memory.
// ENUMs:
// WRITTEN This RAM area is written with valid key
// information
// NOT_WRITTEN This RAM area is not written with valid key
// information
#define CRYPTO_KEYWRITTENAREA_RAM_AREA_WRITTEN0 0x00000001
#define CRYPTO_KEYWRITTENAREA_RAM_AREA_WRITTEN0_BITN 0
#define CRYPTO_KEYWRITTENAREA_RAM_AREA_WRITTEN0_M 0x00000001
#define CRYPTO_KEYWRITTENAREA_RAM_AREA_WRITTEN0_S 0
#define CRYPTO_KEYWRITTENAREA_RAM_AREA_WRITTEN0_WRITTEN 0x00000001
#define CRYPTO_KEYWRITTENAREA_RAM_AREA_WRITTEN0_NOT_WRITTEN 0x00000000
//*****************************************************************************
//
// Register: CRYPTO_O_KEYSIZE
//
//*****************************************************************************
// Field: [1:0] SIZE
//
// Key size
//
// When writing to this register, KEYWRITTENAREA will be reset.
//
// Note: For the Crypto peripheral this field is fixed to 128 bits. For
// software compatibility KEYWRITTENAREA will be reset when writing to this
// register.
// ENUMs:
// 256_BIT Not supported
// 192_BIT Not supported
// 128_BIT 128 bits
#define CRYPTO_KEYSIZE_SIZE_W 2
#define CRYPTO_KEYSIZE_SIZE_M 0x00000003
#define CRYPTO_KEYSIZE_SIZE_S 0
#define CRYPTO_KEYSIZE_SIZE_256_BIT 0x00000003
#define CRYPTO_KEYSIZE_SIZE_192_BIT 0x00000002
#define CRYPTO_KEYSIZE_SIZE_128_BIT 0x00000001
//*****************************************************************************
//
// Register: CRYPTO_O_KEYREADAREA
//
//*****************************************************************************
// Field: [31] BUSY
//
// Key store operation busy status flag (read only)
//
// 0: operation is completed.
// 1: operation is not completed and the key store is busy.
#define CRYPTO_KEYREADAREA_BUSY 0x80000000
#define CRYPTO_KEYREADAREA_BUSY_BITN 31
#define CRYPTO_KEYREADAREA_BUSY_M 0x80000000
#define CRYPTO_KEYREADAREA_BUSY_S 31
// Field: [3:0] RAM_AREA
//
// Selects the area of the key store RAM from where the key needs to be read
// that will be written to the AES engine.
//
// Only RAM areas that contain valid written keys can be selected.
// ENUMs:
// NO_RAM No RAM
// RAM_AREA7 RAM Area 7
// RAM_AREA6 RAM Area 6
// RAM_AREA5 RAM Area 5
// RAM_AREA4 RAM Area 4
// RAM_AREA3 RAM Area 3
// RAM_AREA2 RAM Area 2
// RAM_AREA1 RAM Area 1
// RAM_AREA0 RAM Area 0
#define CRYPTO_KEYREADAREA_RAM_AREA_W 4
#define CRYPTO_KEYREADAREA_RAM_AREA_M 0x0000000F
#define CRYPTO_KEYREADAREA_RAM_AREA_S 0
#define CRYPTO_KEYREADAREA_RAM_AREA_NO_RAM 0x00000008
#define CRYPTO_KEYREADAREA_RAM_AREA_RAM_AREA7 0x00000007
#define CRYPTO_KEYREADAREA_RAM_AREA_RAM_AREA6 0x00000006
#define CRYPTO_KEYREADAREA_RAM_AREA_RAM_AREA5 0x00000005
#define CRYPTO_KEYREADAREA_RAM_AREA_RAM_AREA4 0x00000004
#define CRYPTO_KEYREADAREA_RAM_AREA_RAM_AREA3 0x00000003
#define CRYPTO_KEYREADAREA_RAM_AREA_RAM_AREA2 0x00000002
#define CRYPTO_KEYREADAREA_RAM_AREA_RAM_AREA1 0x00000001
#define CRYPTO_KEYREADAREA_RAM_AREA_RAM_AREA0 0x00000000
//*****************************************************************************
//
// Register: CRYPTO_O_AESKEY20
//
//*****************************************************************************
// Field: [31:0] KEY2
//
// AESKEY2.* bits 31+x:0+x or AES_GHASH_H.* bits 31+x:0+x, where x = 0, 32, 64,
// 96 ordered from the LSW entry of this 4-deep register array.
// The interpretation of this field depends on the crypto operation mode.
#define CRYPTO_AESKEY20_KEY2_W 32
#define CRYPTO_AESKEY20_KEY2_M 0xFFFFFFFF
#define CRYPTO_AESKEY20_KEY2_S 0
//*****************************************************************************
//
// Register: CRYPTO_O_AESKEY21
//
//*****************************************************************************
// Field: [31:0] KEY2
//
// AESKEY2.* bits 31+x:0+x or AES_GHASH_H.* bits 31+x:0+x, where x = 0, 32, 64,
// 96 ordered from the LSW entry of this 4-deep register array.
// The interpretation of this field depends on the crypto operation mode.
#define CRYPTO_AESKEY21_KEY2_W 32
#define CRYPTO_AESKEY21_KEY2_M 0xFFFFFFFF
#define CRYPTO_AESKEY21_KEY2_S 0
//*****************************************************************************
//
// Register: CRYPTO_O_AESKEY22
//
//*****************************************************************************
// Field: [31:0] KEY2
//
// AESKEY2.* bits 31+x:0+x or AES_GHASH_H.* bits 31+x:0+x, where x = 0, 32, 64,
// 96 ordered from the LSW entry of this 4-deep register array.
// The interpretation of this field depends on the crypto operation mode.
#define CRYPTO_AESKEY22_KEY2_W 32
#define CRYPTO_AESKEY22_KEY2_M 0xFFFFFFFF
#define CRYPTO_AESKEY22_KEY2_S 0
//*****************************************************************************
//
// Register: CRYPTO_O_AESKEY23
//
//*****************************************************************************
// Field: [31:0] KEY2
//
// AESKEY2.* bits 31+x:0+x or AES_GHASH_H.* bits 31+x:0+x, where x = 0, 32, 64,
// 96 ordered from the LSW entry of this 4-deep register array.
// The interpretation of this field depends on the crypto operation mode.
#define CRYPTO_AESKEY23_KEY2_W 32
#define CRYPTO_AESKEY23_KEY2_M 0xFFFFFFFF
#define CRYPTO_AESKEY23_KEY2_S 0
//*****************************************************************************
//
// Register: CRYPTO_O_AESKEY30
//
//*****************************************************************************
// Field: [31:0] KEY3
//
// AESKEY3.* bits 31+x:0+x or AESKEY2.* bits 159+x:128+x, where x = 0, 32, 64,
// 96 ordered from the LSW entry of this 4-deep register arrary.
// The interpretation of this field depends on the crypto operation mode.
#define CRYPTO_AESKEY30_KEY3_W 32
#define CRYPTO_AESKEY30_KEY3_M 0xFFFFFFFF
#define CRYPTO_AESKEY30_KEY3_S 0
//*****************************************************************************
//
// Register: CRYPTO_O_AESKEY31
//
//*****************************************************************************
// Field: [31:0] KEY3
//
// AESKEY3.* bits 31+x:0+x or AESKEY2.* bits 159+x:128+x, where x = 0, 32, 64,
// 96 ordered from the LSW entry of this 4-deep register arrary.
// The interpretation of this field depends on the crypto operation mode.
#define CRYPTO_AESKEY31_KEY3_W 32
#define CRYPTO_AESKEY31_KEY3_M 0xFFFFFFFF
#define CRYPTO_AESKEY31_KEY3_S 0
//*****************************************************************************
//
// Register: CRYPTO_O_AESKEY32