summaryrefslogtreecommitdiff
path: root/arch/arm/include/asm/arch-octeontx2/csrs/csrs-npc.h
blob: c1c4baabe7acab7e92278cd71601be3f8fb49554 (plain)
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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
/* SPDX-License-Identifier:    GPL-2.0
 *
 * Copyright (C) 2020 Marvell International Ltd.
 *
 * https://spdx.org/licenses
 */
#ifndef __CSRS_NPC_H__
#define __CSRS_NPC_H__

/**
 * @file
 *
 * Configuration and status register (CSR) address and type definitions for
 * NPC.
 *
 * This file is auto generated.  Do not edit.
 *
 */

/**
 * Enumeration npc_errlev_e
 *
 * NPC Error Level Enumeration Enumerates the lowest protocol layer
 * containing an error.
 */
#define NPC_ERRLEV_E_LA (1)
#define NPC_ERRLEV_E_LB (2)
#define NPC_ERRLEV_E_LC (3)
#define NPC_ERRLEV_E_LD (4)
#define NPC_ERRLEV_E_LE (5)
#define NPC_ERRLEV_E_LF (6)
#define NPC_ERRLEV_E_LG (7)
#define NPC_ERRLEV_E_LH (8)
#define NPC_ERRLEV_E_NIX (0xf)
#define NPC_ERRLEV_E_RX(a) (0 + (a))
#define NPC_ERRLEV_E_RE (0)

/**
 * Enumeration npc_intf_e
 *
 * NPC Interface Enumeration Enumerates the NPC interfaces.
 */
#define NPC_INTF_E_NIXX_RX(a) (0 + 2 * (a))
#define NPC_INTF_E_NIXX_TX(a) (1 + 2 * (a))

/**
 * Enumeration npc_lid_e
 *
 * NPC Layer ID Enumeration Enumerates layers parsed by NPC.
 */
#define NPC_LID_E_LA (0)
#define NPC_LID_E_LB (1)
#define NPC_LID_E_LC (2)
#define NPC_LID_E_LD (3)
#define NPC_LID_E_LE (4)
#define NPC_LID_E_LF (5)
#define NPC_LID_E_LG (6)
#define NPC_LID_E_LH (7)

/**
 * Enumeration npc_lkupop_e
 *
 * NPC Lookup Operation Enumeration Enumerates the lookup operation for
 * NPC_AF_LKUP_CTL[OP].
 */
#define NPC_LKUPOP_E_KEY (1)
#define NPC_LKUPOP_E_PKT (0)

/**
 * Enumeration npc_mcamkeyw_e
 *
 * NPC MCAM Search Key Width Enumeration
 */
#define NPC_MCAMKEYW_E_X1 (0)
#define NPC_MCAMKEYW_E_X2 (1)
#define NPC_MCAMKEYW_E_X4 (2)

/**
 * Structure npc_layer_info_s
 *
 * NPC Layer Parse Information Structure This structure specifies the
 * format of NPC_RESULT_S[LA,LB,...,LH].
 */
union npc_layer_info_s {
	u32 u;
	struct npc_layer_info_s_s {
		u32 lptr                             : 8;
		u32 flags                            : 8;
		u32 ltype                            : 4;
		u32 reserved_20_31                   : 12;
	} s;
	/* struct npc_layer_info_s_s cn; */
};

/**
 * Structure npc_layer_kex_s
 *
 * NPC Layer MCAM Search Key Extract Structure This structure specifies
 * the format of each of the NPC_PARSE_KEX_S[LA,LB,...,LH] fields. It
 * contains the subset of NPC_LAYER_INFO_S fields that can be included in
 * the MCAM search key. See NPC_PARSE_KEX_S and NPC_AF_INTF()_KEX_CFG.
 */
union npc_layer_kex_s {
	u32 u;
	struct npc_layer_kex_s_s {
		u32 flags                            : 8;
		u32 ltype                            : 4;
		u32 reserved_12_31                   : 20;
	} s;
	/* struct npc_layer_kex_s_s cn; */
};

/**
 * Structure npc_mcam_key_x1_s
 *
 * NPC MCAM Search Key X1 Structure This structure specifies the MCAM
 * search key format used by an interface when
 * NPC_AF_INTF()_KEX_CFG[KEYW] = NPC_MCAMKEYW_E::X1.
 */
union npc_mcam_key_x1_s {
	u64 u[3];
	struct npc_mcam_key_x1_s_s {
		u64 intf                             : 2;
		u64 reserved_2_63                    : 62;
		u64 kw0                              : 64;
		u64 kw1                              : 48;
		u64 reserved_176_191                 : 16;
	} s;
	/* struct npc_mcam_key_x1_s_s cn; */
};

/**
 * Structure npc_mcam_key_x2_s
 *
 * NPC MCAM Search Key X2 Structure This structure specifies the MCAM
 * search key format used by an interface when
 * NPC_AF_INTF()_KEX_CFG[KEYW] = NPC_MCAMKEYW_E::X2.
 */
union npc_mcam_key_x2_s {
	u64 u[5];
	struct npc_mcam_key_x2_s_s {
		u64 intf                             : 2;
		u64 reserved_2_63                    : 62;
		u64 kw0                              : 64;
		u64 kw1                              : 64;
		u64 kw2                              : 64;
		u64 kw3                              : 32;
		u64 reserved_288_319                 : 32;
	} s;
	/* struct npc_mcam_key_x2_s_s cn; */
};

/**
 * Structure npc_mcam_key_x4_s
 *
 * NPC MCAM Search Key X4 Structure This structure specifies the MCAM
 * search key format used by an interface when
 * NPC_AF_INTF()_KEX_CFG[KEYW] = NPC_MCAMKEYW_E::X4.
 */
union npc_mcam_key_x4_s {
	u64 u[8];
	struct npc_mcam_key_x4_s_s {
		u64 intf                             : 2;
		u64 reserved_2_63                    : 62;
		u64 kw0                              : 64;
		u64 kw1                              : 64;
		u64 kw2                              : 64;
		u64 kw3                              : 64;
		u64 kw4                              : 64;
		u64 kw5                              : 64;
		u64 kw6                              : 64;
	} s;
	/* struct npc_mcam_key_x4_s_s cn; */
};

/**
 * Structure npc_parse_kex_s
 *
 * NPC Parse Key Extract Structure This structure contains the subset of
 * NPC_RESULT_S fields that can be included in the MCAM search key. See
 * NPC_AF_INTF()_KEX_CFG.
 */
union npc_parse_kex_s {
	u64 u[2];
	struct npc_parse_kex_s_s {
		u64 chan                             : 12;
		u64 errlev                           : 4;
		u64 errcode                          : 8;
		u64 l2m                              : 1;
		u64 l2b                              : 1;
		u64 l3m                              : 1;
		u64 l3b                              : 1;
		u64 la                               : 12;
		u64 lb                               : 12;
		u64 lc                               : 12;
		u64 ld                               : 12;
		u64 le                               : 12;
		u64 lf                               : 12;
		u64 lg                               : 12;
		u64 lh                               : 12;
		u64 reserved_124_127                 : 4;
	} s;
	/* struct npc_parse_kex_s_s cn; */
};

/**
 * Structure npc_result_s
 *
 * NPC Result Structure This structure contains a packet's parse and flow
 * identification information.
 */
union npc_result_s {
	u64 u[6];
	struct npc_result_s_s {
		u64 intf                             : 2;
		u64 pkind                            : 6;
		u64 chan                             : 12;
		u64 errlev                           : 4;
		u64 errcode                          : 8;
		u64 l2m                              : 1;
		u64 l2b                              : 1;
		u64 l3m                              : 1;
		u64 l3b                              : 1;
		u64 eoh_ptr                          : 8;
		u64 reserved_44_63                   : 20;
		u64 action                           : 64;
		u64 vtag_action                      : 64;
		u64 la                               : 20;
		u64 lb                               : 20;
		u64 lc                               : 20;
		u64 reserved_252_255                 : 4;
		u64 ld                               : 20;
		u64 le                               : 20;
		u64 lf                               : 20;
		u64 reserved_316_319                 : 4;
		u64 lg                               : 20;
		u64 lh                               : 20;
		u64 reserved_360_383                 : 24;
	} s;
	/* struct npc_result_s_s cn; */
};

/**
 * Register (RVU_PF_BAR0) npc_af_active_pc
 *
 * NPC Interrupt-Timer Configuration Register
 */
union npc_af_active_pc {
	u64 u;
	struct npc_af_active_pc_s {
		u64 active_pc                        : 64;
	} s;
	/* struct npc_af_active_pc_s cn; */
};

static inline u64 NPC_AF_ACTIVE_PC(void)
	__attribute__ ((pure, always_inline));
static inline u64 NPC_AF_ACTIVE_PC(void)
{
	return 0x10;
}

/**
 * Register (RVU_PF_BAR0) npc_af_blk_rst
 *
 * NPC AF Block Reset Register
 */
union npc_af_blk_rst {
	u64 u;
	struct npc_af_blk_rst_s {
		u64 rst                              : 1;
		u64 reserved_1_62                    : 62;
		u64 busy                             : 1;
	} s;
	/* struct npc_af_blk_rst_s cn; */
};

static inline u64 NPC_AF_BLK_RST(void)
	__attribute__ ((pure, always_inline));
static inline u64 NPC_AF_BLK_RST(void)
{
	return 0x40;
}

/**
 * Register (RVU_PF_BAR0) npc_af_cfg
 *
 * NPC AF General Configuration Register
 */
union npc_af_cfg {
	u64 u;
	struct npc_af_cfg_s {
		u64 reserved_0_1                     : 2;
		u64 cclk_force                       : 1;
		u64 force_intf_clk_en                : 1;
		u64 reserved_4_63                    : 60;
	} s;
	/* struct npc_af_cfg_s cn; */
};

static inline u64 NPC_AF_CFG(void)
	__attribute__ ((pure, always_inline));
static inline u64 NPC_AF_CFG(void)
{
	return 0;
}

/**
 * Register (RVU_PF_BAR0) npc_af_const
 *
 * NPC AF Constants Register This register contains constants for
 * software discovery.
 */
union npc_af_const {
	u64 u;
	struct npc_af_const_s {
		u64 intfs                            : 4;
		u64 lids                             : 4;
		u64 kpus                             : 5;
		u64 reserved_13_15                   : 3;
		u64 mcam_bank_width                  : 10;
		u64 reserved_26_27                   : 2;
		u64 mcam_bank_depth                  : 16;
		u64 mcam_banks                       : 4;
		u64 match_stats                      : 16;
	} s;
	/* struct npc_af_const_s cn; */
};

static inline u64 NPC_AF_CONST(void)
	__attribute__ ((pure, always_inline));
static inline u64 NPC_AF_CONST(void)
{
	return 0x20;
}

/**
 * Register (RVU_PF_BAR0) npc_af_const1
 *
 * NPC AF Constants 1 Register This register contains constants for
 * software discovery.
 */
union npc_af_const1 {
	u64 u;
	struct npc_af_const1_s {
		u64 kpu_entries                      : 12;
		u64 pkinds                           : 8;
		u64 cpi_size                         : 16;
		u64 reserved_36_63                   : 28;
	} s;
	/* struct npc_af_const1_s cn; */
};

static inline u64 NPC_AF_CONST1(void)
	__attribute__ ((pure, always_inline));
static inline u64 NPC_AF_CONST1(void)
{
	return 0x30;
}

/**
 * Register (RVU_PF_BAR0) npc_af_cpi#_cfg
 *
 * NPC AF Channel Parse Index Table Registers
 */
union npc_af_cpix_cfg {
	u64 u;
	struct npc_af_cpix_cfg_s {
		u64 padd                             : 4;
		u64 reserved_4_63                    : 60;
	} s;
	/* struct npc_af_cpix_cfg_s cn; */
};

static inline u64 NPC_AF_CPIX_CFG(u64 a)
	__attribute__ ((pure, always_inline));
static inline u64 NPC_AF_CPIX_CFG(u64 a)
{
	return 0x200000 + 8 * a;
}

/**
 * Register (RVU_PF_BAR0) npc_af_dbg_ctl
 *
 * NPC AF Debug Control Register This register controls the capture of
 * debug information in NPC_AF_KPU()_DBG, NPC_AF_MCAM_DBG,
 * NPC_AF_DBG_DATA() and NPC_AF_DBG_RESULT().
 */
union npc_af_dbg_ctl {
	u64 u;
	struct npc_af_dbg_ctl_s {
		u64 continuous                       : 1;
		u64 lkup_dbg                         : 1;
		u64 intf_dbg                         : 4;
		u64 reserved_6_63                    : 58;
	} s;
	/* struct npc_af_dbg_ctl_s cn; */
};

static inline u64 NPC_AF_DBG_CTL(void)
	__attribute__ ((pure, always_inline));
static inline u64 NPC_AF_DBG_CTL(void)
{
	return 0x3000000;
}

/**
 * Register (RVU_PF_BAR0) npc_af_dbg_data#
 *
 * NPC AF Debug Data Registers These registers contain the packet header
 * data of the last packet/lookup whose debug information is captured by
 * NPC_AF_DBG_CTL[INTF_DBG,LKUP_DBG].
 */
union npc_af_dbg_datax {
	u64 u;
	struct npc_af_dbg_datax_s {
		u64 data                             : 64;
	} s;
	/* struct npc_af_dbg_datax_s cn; */
};

static inline u64 NPC_AF_DBG_DATAX(u64 a)
	__attribute__ ((pure, always_inline));
static inline u64 NPC_AF_DBG_DATAX(u64 a)
{
	return 0x3001400 + 0x10 * a;
}

/**
 * Register (RVU_PF_BAR0) npc_af_dbg_result#
 *
 * NPC AF Debug Result Registers These registers contain the result data
 * of the last packet/lookup whose debug information is captured by
 * NPC_AF_DBG_CTL[INTF_DBG,LKUP_DBG].  Internal: FIXME - add note about
 * coherency of data in continuous packet capture mode.
 */
union npc_af_dbg_resultx {
	u64 u;
	struct npc_af_dbg_resultx_s {
		u64 data                             : 64;
	} s;
	/* struct npc_af_dbg_resultx_s cn; */
};

static inline u64 NPC_AF_DBG_RESULTX(u64 a)
	__attribute__ ((pure, always_inline));
static inline u64 NPC_AF_DBG_RESULTX(u64 a)
{
	return 0x3001800 + 0x10 * a;
}

/**
 * Register (RVU_PF_BAR0) npc_af_dbg_status
 *
 * NPC AF Debug Status Register
 */
union npc_af_dbg_status {
	u64 u;
	struct npc_af_dbg_status_s {
		u64 done                             : 1;
		u64 reserved_1_63                    : 63;
	} s;
	/* struct npc_af_dbg_status_s cn; */
};

static inline u64 NPC_AF_DBG_STATUS(void)
	__attribute__ ((pure, always_inline));
static inline u64 NPC_AF_DBG_STATUS(void)
{
	return 0x3000010;
}

/**
 * Register (RVU_PF_BAR0) npc_af_dv_fc_scratch
 *
 * INTERNAL: NPC AF Scratch Register  Internal: This register is for
 * internal DV purpose.
 */
union npc_af_dv_fc_scratch {
	u64 u;
	struct npc_af_dv_fc_scratch_s {
		u64 it                               : 64;
	} s;
	/* struct npc_af_dv_fc_scratch_s cn; */
};

static inline u64 NPC_AF_DV_FC_SCRATCH(void)
	__attribute__ ((pure, always_inline));
static inline u64 NPC_AF_DV_FC_SCRATCH(void)
{
	return 0x60;
}

/**
 * Register (RVU_PF_BAR0) npc_af_eco0
 *
 * INTERNAL: ECO 0 Register
 */
union npc_af_eco0 {
	u64 u;
	struct npc_af_eco0_s {
		u64 eco_rw                           : 32;
		u64 reserved_32_63                   : 32;
	} s;
	/* struct npc_af_eco0_s cn; */
};

static inline u64 NPC_AF_ECO0(void)
	__attribute__ ((pure, always_inline));
static inline u64 NPC_AF_ECO0(void)
{
	return 0x200;
}

/**
 * Register (RVU_PF_BAR0) npc_af_ikpu_err_ctl
 *
 * NPC AF Initial KPU Error Control Registers Similar to
 * NPC_AF_KPU()_ERR_CTL, but specifies values captured in
 * NPC_RESULT_S[ERRLEV,ERRCODE] for errors detected by the PKIND-based
 * initial actions from NPC_AF_PKIND()_ACTION0 and
 * NPC_AF_PKIND()_ACTION1. [DP_OFFSET_ERRCODE] from this register is
 * never used.
 */
union npc_af_ikpu_err_ctl {
	u64 u;
	struct npc_af_ikpu_err_ctl_s {
		u64 errlev                           : 4;
		u64 dp_offset_errcode                : 8;
		u64 ptr_advance_errcode              : 8;
		u64 var_len_offset_errcode           : 8;
		u64 reserved_28_63                   : 36;
	} s;
	/* struct npc_af_ikpu_err_ctl_s cn; */
};

static inline u64 NPC_AF_IKPU_ERR_CTL(void)
	__attribute__ ((pure, always_inline));
static inline u64 NPC_AF_IKPU_ERR_CTL(void)
{
	return 0x3000080;
}

/**
 * Register (RVU_PF_BAR0) npc_af_intf#_kex_cfg
 *
 * NPC AF Interface Key Extract Configuration Registers
 */
union npc_af_intfx_kex_cfg {
	u64 u;
	struct npc_af_intfx_kex_cfg_s {
		u64 parse_nibble_ena                 : 31;
		u64 reserved_31                      : 1;
		u64 keyw                             : 3;
		u64 reserved_35_63                   : 29;
	} s;
	/* struct npc_af_intfx_kex_cfg_s cn; */
};

static inline u64 NPC_AF_INTFX_KEX_CFG(u64 a)
	__attribute__ ((pure, always_inline));
static inline u64 NPC_AF_INTFX_KEX_CFG(u64 a)
{
	return 0x1010 + 0x100 * a;
}

/**
 * Register (RVU_PF_BAR0) npc_af_intf#_ldata#_flags#_cfg
 *
 * NPC AF Interface Layer Data Flags Configuration Registers These
 * registers control the extraction of layer data (LDATA) into the MCAM
 * search key for each interface based on the FLAGS\<3:0\> bits of two
 * layers selected by NPC_AF_KEX_LDATA()_FLAGS_CFG.
 */
union npc_af_intfx_ldatax_flagsx_cfg {
	u64 u;
	struct npc_af_intfx_ldatax_flagsx_cfg_s {
		u64 key_offset                       : 6;
		u64 reserved_6                       : 1;
		u64 ena                              : 1;
		u64 hdr_offset                       : 8;
		u64 bytesm1                          : 4;
		u64 reserved_20_63                   : 44;
	} s;
	/* struct npc_af_intfx_ldatax_flagsx_cfg_s cn; */
};

static inline u64 NPC_AF_INTFX_LDATAX_FLAGSX_CFG(u64 a, u64 b, u64 c)
	__attribute__ ((pure, always_inline));
static inline u64 NPC_AF_INTFX_LDATAX_FLAGSX_CFG(u64 a, u64 b, u64 c)
{
	return 0x980000 + 0x10000 * a + 0x1000 * b + 8 * c;
}

/**
 * Register (RVU_PF_BAR0) npc_af_intf#_lid#_lt#_ld#_cfg
 *
 * NPC AF Interface Layer Data Extract Configuration Registers These
 * registers control the extraction of layer data (LDATA) into the MCAM
 * search key for each interface. Up to two LDATA fields can be extracted
 * per layer (LID(0..7) indexed by NPC_LID_E), with up to 16 bytes per
 * LDATA field. For each layer, the corresponding NPC_LAYER_INFO_S[LTYPE]
 * value in NPC_RESULT_S is used as the LTYPE(0..15) index and select the
 * associated LDATA(0..1) registers.  NPC_LAYER_INFO_S[LTYPE]=0x0 means
 * the corresponding layer not parsed (invalid), so software should keep
 * NPC_AF_INTF()_LID()_LT(0)_LD()_CFG[ENA] clear to disable extraction
 * when LTYPE is zero.
 */
union npc_af_intfx_lidx_ltx_ldx_cfg {
	u64 u;
	struct npc_af_intfx_lidx_ltx_ldx_cfg_s {
		u64 key_offset                       : 6;
		u64 flags_ena                        : 1;
		u64 ena                              : 1;
		u64 hdr_offset                       : 8;
		u64 bytesm1                          : 4;
		u64 reserved_20_63                   : 44;
	} s;
	/* struct npc_af_intfx_lidx_ltx_ldx_cfg_s cn; */
};

static inline u64 NPC_AF_INTFX_LIDX_LTX_LDX_CFG(u64 a, u64 b, u64 c, u64 d)
	__attribute__ ((pure, always_inline));
static inline u64 NPC_AF_INTFX_LIDX_LTX_LDX_CFG(u64 a, u64 b, u64 c, u64 d)
{
	return 0x900000 + 0x10000 * a + 0x1000 * b + 0x20 * c + 8 * d;
}

/**
 * Register (RVU_PF_BAR0) npc_af_intf#_miss_act
 *
 * NPC AF Interface MCAM Miss Action Data Registers When a combination of
 * NPC_AF_MCAME()_BANK()_CAM()_* and NPC_AF_MCAME()_BANK()_CFG[ENA]
 * yields an MCAM miss for a packet, this register specifies the packet's
 * match action captured in NPC_RESULT_S[ACTION].
 */
union npc_af_intfx_miss_act {
	u64 u;
	struct npc_af_intfx_miss_act_s {
		u64 action                           : 64;
	} s;
	/* struct npc_af_intfx_miss_act_s cn; */
};

static inline u64 NPC_AF_INTFX_MISS_ACT(u64 a)
	__attribute__ ((pure, always_inline));
static inline u64 NPC_AF_INTFX_MISS_ACT(u64 a)
{
	return 0x1a00000 + 0x10 * a;
}

/**
 * Register (RVU_PF_BAR0) npc_af_intf#_miss_stat_act
 *
 * NPC AF Interface MCAM Miss Stat Action Data Registers Used to
 * optionally increment a NPC_AF_MATCH_STAT() counter when a packet
 * misses an MCAM entry.
 */
union npc_af_intfx_miss_stat_act {
	u64 u;
	struct npc_af_intfx_miss_stat_act_s {
		u64 stat_sel                         : 9;
		u64 ena                              : 1;
		u64 reserved_10_63                   : 54;
	} s;
	/* struct npc_af_intfx_miss_stat_act_s cn; */
};

static inline u64 NPC_AF_INTFX_MISS_STAT_ACT(u64 a)
	__attribute__ ((pure, always_inline));
static inline u64 NPC_AF_INTFX_MISS_STAT_ACT(u64 a)
{
	return 0x1880040 + 8 * a;
}

/**
 * Register (RVU_PF_BAR0) npc_af_intf#_miss_tag_act
 *
 * NPC AF Interface MCAM Miss VTag Action Data Registers When a
 * combination of NPC_AF_MCAME()_BANK()_CAM()_* and
 * NPC_AF_MCAME()_BANK()_CFG[ENA] yields an MCAM miss for a packet, this
 * register specifies the packet's match Vtag action captured in
 * NPC_RESULT_S[VTAG_ACTION].
 */
union npc_af_intfx_miss_tag_act {
	u64 u;
	struct npc_af_intfx_miss_tag_act_s {
		u64 vtag_action                      : 64;
	} s;
	/* struct npc_af_intfx_miss_tag_act_s cn; */
};

static inline u64 NPC_AF_INTFX_MISS_TAG_ACT(u64 a)
	__attribute__ ((pure, always_inline));
static inline u64 NPC_AF_INTFX_MISS_TAG_ACT(u64 a)
{
	return 0x1b00008 + 0x10 * a;
}

/**
 * Register (RVU_PF_BAR0) npc_af_intf#_stat
 *
 * NPC AF Interface Statistics Registers Statistics per interface. Index
 * enumerated by NPC_INTF_E.
 */
union npc_af_intfx_stat {
	u64 u;
	struct npc_af_intfx_stat_s {
		u64 count                            : 48;
		u64 reserved_48_63                   : 16;
	} s;
	/* struct npc_af_intfx_stat_s cn; */
};

static inline u64 NPC_AF_INTFX_STAT(u64 a)
	__attribute__ ((pure, always_inline));
static inline u64 NPC_AF_INTFX_STAT(u64 a)
{
	return 0x2000800 + 0x10 * a;
}

/**
 * Register (RVU_PF_BAR0) npc_af_kcam_scrub_ctl
 *
 * NPC AF KCAM Scrub Control Register
 */
union npc_af_kcam_scrub_ctl {
	u64 u;
	struct npc_af_kcam_scrub_ctl_s {
		u64 ena                              : 1;
		u64 reserved_1_7                     : 7;
		u64 lp_dis                           : 1;
		u64 reserved_9_15                    : 7;
		u64 toth                             : 4;
		u64 reserved_20_63                   : 44;
	} s;
	/* struct npc_af_kcam_scrub_ctl_s cn; */
};

static inline u64 NPC_AF_KCAM_SCRUB_CTL(void)
	__attribute__ ((pure, always_inline));
static inline u64 NPC_AF_KCAM_SCRUB_CTL(void)
{
	return 0xb0;
}

/**
 * Register (RVU_PF_BAR0) npc_af_kex_ldata#_flags_cfg
 *
 * NPC AF Key Extract Layer Data Flags Configuration Register
 */
union npc_af_kex_ldatax_flags_cfg {
	u64 u;
	struct npc_af_kex_ldatax_flags_cfg_s {
		u64 lid                              : 3;
		u64 reserved_3_63                    : 61;
	} s;
	/* struct npc_af_kex_ldatax_flags_cfg_s cn; */
};

static inline u64 NPC_AF_KEX_LDATAX_FLAGS_CFG(u64 a)
	__attribute__ ((pure, always_inline));
static inline u64 NPC_AF_KEX_LDATAX_FLAGS_CFG(u64 a)
{
	return 0x800 + 8 * a;
}

/**
 * Register (RVU_PF_BAR0) npc_af_kpu#_cfg
 *
 * NPC AF KPU Configuration Registers
 */
union npc_af_kpux_cfg {
	u64 u;
	struct npc_af_kpux_cfg_s {
		u64 ena                              : 1;
		u64 reserved_1_63                    : 63;
	} s;
	/* struct npc_af_kpux_cfg_s cn; */
};

static inline u64 NPC_AF_KPUX_CFG(u64 a)
	__attribute__ ((pure, always_inline));
static inline u64 NPC_AF_KPUX_CFG(u64 a)
{
	return 0x500 + 8 * a;
}

/**
 * Register (RVU_PF_BAR0) npc_af_kpu#_dbg
 *
 * NPC AF KPU Debug Registers This register contains information for the
 * last packet/lookup for which debug is enabled by
 * NPC_AF_DBG_CTL[INTF_DBG,LKUP_DBG]. The register contents are undefined
 * when debug information is captured for a software key lookup
 * (NPC_AF_LKUP_CTL[OP] = NPC_LKUPOP_E::KEY).
 */
union npc_af_kpux_dbg {
	u64 u;
	struct npc_af_kpux_dbg_s {
		u64 hit_entry                        : 8;
		u64 byp                              : 1;
		u64 reserved_9_63                    : 55;
	} s;
	/* struct npc_af_kpux_dbg_s cn; */
};

static inline u64 NPC_AF_KPUX_DBG(u64 a)
	__attribute__ ((pure, always_inline));
static inline u64 NPC_AF_KPUX_DBG(u64 a)
{
	return 0x3000020 + 0x100 * a;
}

/**
 * Register (RVU_PF_BAR0) npc_af_kpu#_entry#_action0
 *
 * NPC AF KPU Entry Action Data 0 Registers When a KPU's search data
 * matches a KPU CAM entry in NPC_AF_KPU()_ENTRY()_CAM(), the
 * corresponding entry action in NPC_AF_KPU()_ENTRY()_ACTION0 and
 * NPC_AF_KPU()_ENTRY()_ACTION1 specifies the next state and operations
 * to perform before exiting the KPU.
 */
union npc_af_kpux_entryx_action0 {
	u64 u;
	struct npc_af_kpux_entryx_action0_s {
		u64 var_len_shift                    : 3;
		u64 var_len_right                    : 1;
		u64 var_len_mask                     : 8;
		u64 var_len_offset                   : 8;
		u64 ptr_advance                      : 8;
		u64 capture_flags                    : 8;
		u64 capture_ltype                    : 4;
		u64 capture_lid                      : 3;
		u64 reserved_43                      : 1;
		u64 next_state                       : 8;
		u64 parse_done                       : 1;
		u64 capture_ena                      : 1;
		u64 byp_count                        : 3;
		u64 reserved_57_63                   : 7;
	} s;
	/* struct npc_af_kpux_entryx_action0_s cn; */
};

static inline u64 NPC_AF_KPUX_ENTRYX_ACTION0(u64 a, u64 b)
	__attribute__ ((pure, always_inline));
static inline u64 NPC_AF_KPUX_ENTRYX_ACTION0(u64 a, u64 b)
{
	return 0x100020 + 0x4000 * a + 0x40 * b;
}

/**
 * Register (RVU_PF_BAR0) npc_af_kpu#_entry#_action1
 *
 * NPC AF KPU Entry Action Data 0 Registers See
 * NPC_AF_KPU()_ENTRY()_ACTION0.
 */
union npc_af_kpux_entryx_action1 {
	u64 u;
	struct npc_af_kpux_entryx_action1_s {
		u64 dp0_offset                       : 8;
		u64 dp1_offset                       : 8;
		u64 dp2_offset                       : 8;
		u64 errcode                          : 8;
		u64 errlev                           : 4;
		u64 reserved_36_63                   : 28;
	} s;
	/* struct npc_af_kpux_entryx_action1_s cn; */
};

static inline u64 NPC_AF_KPUX_ENTRYX_ACTION1(u64 a, u64 b)
	__attribute__ ((pure, always_inline));
static inline u64 NPC_AF_KPUX_ENTRYX_ACTION1(u64 a, u64 b)
{
	return 0x100028 + 0x4000 * a + 0x40 * b;
}

/**
 * Register (RVU_PF_BAR0) npc_af_kpu#_entry#_cam#
 *
 * NPC AF KPU Entry CAM Registers KPU comparison ternary data. The field
 * values in NPC_AF_KPU()_ENTRY()_CAM() are ternary, where  each data bit
 * of the search key matches as follows: _ [CAM(1)]\<n\>=0,
 * [CAM(0)]\<n\>=0: Always match; search key data\<n\> don't care. _
 * [CAM(1)]\<n\>=0, [CAM(0)]\<n\>=1: Match when search key data\<n\> ==
 * 0. _ [CAM(1)]\<n\>=1, [CAM(0)]\<n\>=0: Match when search key data\<n\>
 * == 1. _ [CAM(1)]\<n\>=1, [CAM(0)]\<n\>=1: Reserved.  The reserved
 * combination is not allowed. Hardware suppresses any write to CAM(0) or
 * CAM(1) that would result in the reserved combination for any CAM bit.
 * The reset value for all non-reserved fields is all zeros for CAM(1)
 * and all ones for CAM(0), matching a search key of all zeros.  Software
 * must program a default entry for each KPU, e.g. by programming each
 * KPU's last entry {b} (NPC_AF_KPU()_ENTRY({b})_CAM()) to always match
 * all bits.
 */
union npc_af_kpux_entryx_camx {
	u64 u;
	struct npc_af_kpux_entryx_camx_s {
		u64 dp0_data                         : 16;
		u64 dp1_data                         : 16;
		u64 dp2_data                         : 16;
		u64 state                            : 8;
		u64 reserved_56_63                   : 8;
	} s;
	/* struct npc_af_kpux_entryx_camx_s cn; */
};

static inline u64 NPC_AF_KPUX_ENTRYX_CAMX(u64 a, u64 b, u64 c)
	__attribute__ ((pure, always_inline));
static inline u64 NPC_AF_KPUX_ENTRYX_CAMX(u64 a, u64 b, u64 c)
{
	return 0x100000 + 0x4000 * a + 0x40 * b + 8 * c;
}

/**
 * Register (RVU_PF_BAR0) npc_af_kpu#_entry_dis#
 *
 * NPC AF KPU Entry Disable Registers See NPC_AF_KPU()_ENTRY()_ACTION0.
 */
union npc_af_kpux_entry_disx {
	u64 u;
	struct npc_af_kpux_entry_disx_s {
		u64 dis                              : 64;
	} s;
	/* struct npc_af_kpux_entry_disx_s cn; */
};

static inline u64 NPC_AF_KPUX_ENTRY_DISX(u64 a, u64 b)
	__attribute__ ((pure, always_inline));
static inline u64 NPC_AF_KPUX_ENTRY_DISX(u64 a, u64 b)
{
	return 0x180000 + 0x40 * a + 8 * b;
}

/**
 * Register (RVU_PF_BAR0) npc_af_kpu#_err_ctl
 *
 * NPC AF KPU Error Control Registers This register specifies values
 * captured in NPC_RESULT_S[ERRLEV,ERRCODE] when errors are detected by a
 * KPU.
 */
union npc_af_kpux_err_ctl {
	u64 u;
	struct npc_af_kpux_err_ctl_s {
		u64 errlev                           : 4;
		u64 dp_offset_errcode                : 8;
		u64 ptr_advance_errcode              : 8;
		u64 var_len_offset_errcode           : 8;
		u64 reserved_28_63                   : 36;
	} s;
	/* struct npc_af_kpux_err_ctl_s cn; */
};

static inline u64 NPC_AF_KPUX_ERR_CTL(u64 a)
	__attribute__ ((pure, always_inline));
static inline u64 NPC_AF_KPUX_ERR_CTL(u64 a)
{
	return 0x30000a0 + 0x100 * a;
}

/**
 * Register (RVU_PF_BAR0) npc_af_kpu_diag
 *
 * INTERNAL : NPC AF Debug Result Registers
 */
union npc_af_kpu_diag {
	u64 u;
	struct npc_af_kpu_diag_s {
		u64 skip_dis                         : 1;
		u64 reserved_1_63                    : 63;
	} s;
	/* struct npc_af_kpu_diag_s cn; */
};

static inline u64 NPC_AF_KPU_DIAG(void)
	__attribute__ ((pure, always_inline));
static inline u64 NPC_AF_KPU_DIAG(void)
{
	return 0x3002000;
}

/**
 * Register (RVU_PF_BAR0) npc_af_lkup_ctl
 *
 * NPC AF Software Lookup Control Registers
 */
union npc_af_lkup_ctl {
	u64 u;
	struct npc_af_lkup_ctl_s {
		u64 intf                             : 2;
		u64 pkind                            : 6;
		u64 chan                             : 12;
		u64 hdr_sizem1                       : 8;
		u64 op                               : 3;
		u64 exec                             : 1;
		u64 reserved_32_63                   : 32;
	} s;
	/* struct npc_af_lkup_ctl_s cn; */
};

static inline u64 NPC_AF_LKUP_CTL(void)
	__attribute__ ((pure, always_inline));
static inline u64 NPC_AF_LKUP_CTL(void)
{
	return 0x2000000;
}

/**
 * Register (RVU_PF_BAR0) npc_af_lkup_data#
 *
 * NPC AF Software Lookup Data Registers
 */
union npc_af_lkup_datax {
	u64 u;
	struct npc_af_lkup_datax_s {
		u64 data                             : 64;
	} s;
	/* struct npc_af_lkup_datax_s cn; */
};

static inline u64 NPC_AF_LKUP_DATAX(u64 a)
	__attribute__ ((pure, always_inline));
static inline u64 NPC_AF_LKUP_DATAX(u64 a)
{
	return 0x2000200 + 0x10 * a;
}

/**
 * Register (RVU_PF_BAR0) npc_af_lkup_result#
 *
 * NPC AF Software Lookup Result Registers
 */
union npc_af_lkup_resultx {
	u64 u;
	struct npc_af_lkup_resultx_s {
		u64 data                             : 64;
	} s;
	/* struct npc_af_lkup_resultx_s cn; */
};

static inline u64 NPC_AF_LKUP_RESULTX(u64 a)
	__attribute__ ((pure, always_inline));
static inline u64 NPC_AF_LKUP_RESULTX(u64 a)
{
	return 0x2000400 + 0x10 * a;
}

/**
 * Register (RVU_PF_BAR0) npc_af_match_stat#
 *
 * NPC AF Match Statistics Registers
 */
union npc_af_match_statx {
	u64 u;
	struct npc_af_match_statx_s {
		u64 count                            : 48;
		u64 reserved_48_63                   : 16;
	} s;
	/* struct npc_af_match_statx_s cn; */
};

static inline u64 NPC_AF_MATCH_STATX(u64 a)
	__attribute__ ((pure, always_inline));
static inline u64 NPC_AF_MATCH_STATX(u64 a)
{
	return 0x1880008 + 0x100 * a;
}

/**
 * Register (RVU_PF_BAR0) npc_af_mcam_bank#_hit#
 *
 * NPC AF MCAM Bank Hit Registers
 */
union npc_af_mcam_bankx_hitx {
	u64 u;
	struct npc_af_mcam_bankx_hitx_s {
		u64 hit                              : 64;
	} s;
	/* struct npc_af_mcam_bankx_hitx_s cn; */
};

static inline u64 NPC_AF_MCAM_BANKX_HITX(u64 a, u64 b)
	__attribute__ ((pure, always_inline));
static inline u64 NPC_AF_MCAM_BANKX_HITX(u64 a, u64 b)
{
	return 0x1c80000 + 0x100 * a + 0x10 * b;
}

/**
 * Register (RVU_PF_BAR0) npc_af_mcam_dbg
 *
 * NPC AF MCAM Debug Register This register contains information for the
 * last packet/lookup for which debug is enabled by
 * NPC_AF_DBG_CTL[INTF_DBG,LKUP_DBG].
 */
union npc_af_mcam_dbg {
	u64 u;
	struct npc_af_mcam_dbg_s {
		u64 hit_entry                        : 10;
		u64 reserved_10_11                   : 2;
		u64 hit_bank                         : 2;
		u64 reserved_14_15                   : 2;
		u64 miss                             : 1;
		u64 reserved_17_63                   : 47;
	} s;
	/* struct npc_af_mcam_dbg_s cn; */
};

static inline u64 NPC_AF_MCAM_DBG(void)
	__attribute__ ((pure, always_inline));
static inline u64 NPC_AF_MCAM_DBG(void)
{
	return 0x3001000;
}

/**
 * Register (RVU_PF_BAR0) npc_af_mcam_scrub_ctl
 *
 * NPC AF MCAM Scrub Control Register
 */
union npc_af_mcam_scrub_ctl {
	u64 u;
	struct npc_af_mcam_scrub_ctl_s {
		u64 ena                              : 1;
		u64 reserved_1_7                     : 7;
		u64 lp_dis                           : 1;
		u64 reserved_9_15                    : 7;
		u64 toth                             : 4;
		u64 reserved_20_63                   : 44;
	} s;
	/* struct npc_af_mcam_scrub_ctl_s cn; */
};

static inline u64 NPC_AF_MCAM_SCRUB_CTL(void)
	__attribute__ ((pure, always_inline));
static inline u64 NPC_AF_MCAM_SCRUB_CTL(void)
{
	return 0xa0;
}

/**
 * Register (RVU_PF_BAR0) npc_af_mcame#_bank#_action
 *
 * NPC AF MCAM Entry Bank Action Data Registers Specifies a packet's
 * match action captured in NPC_RESULT_S[ACTION].  When an interface is
 * configured to use the NPC_MCAM_KEY_X2_S search key format
 * (NPC_AF_INTF()_KEX_CFG[KEYW] = NPC_MCAMKEYW_E::X2), *
 * NPC_AF_MCAME()_BANK(0)_ACTION/_TAG_ACT/_STAT_ACT are used if the
 * search key matches NPC_AF_MCAME()_BANK(0..1)_CAM()_W*. *
 * NPC_AF_MCAME()_BANK(2)_ACTION/_TAG_ACT/_STAT_ACT are used if the
 * search key matches NPC_AF_MCAME()_BANK(2..3)_CAM()_W*. *
 * NPC_AF_MCAME()_BANK(1,3)_ACTION/_TAG_ACT/_STAT_ACT are not used.  When
 * an interface is configured to use the NPC_MCAM_KEY_X4_S search key
 * format (NPC_AF_INTF()_KEX_CFG[KEYW] = NPC_MCAMKEYW_E::X4): *
 * NPC_AF_MCAME()_BANK(0)_ACTION/_TAG_ACT/_STAT_ACT are used if the
 * search key matches NPC_AF_MCAME()_BANK(0..3)_CAM()_W*. *
 * NPC_AF_MCAME()_BANK(1..3)_ACTION/_TAG_ACT/_STAT_ACT are not used.
 */
union npc_af_mcamex_bankx_action {
	u64 u;
	struct npc_af_mcamex_bankx_action_s {
		u64 action                           : 64;
	} s;
	/* struct npc_af_mcamex_bankx_action_s cn; */
};

static inline u64 NPC_AF_MCAMEX_BANKX_ACTION(u64 a, u64 b)
	__attribute__ ((pure, always_inline));
static inline u64 NPC_AF_MCAMEX_BANKX_ACTION(u64 a, u64 b)
{
	return 0x1900000 + 0x100 * a + 0x10 * b;
}

/**
 * Register (RVU_PF_BAR0) npc_af_mcame#_bank#_cam#_intf
 *
 * NPC AF MCAM Entry Bank CAM Data Interface Registers MCAM comparison
 * ternary data interface word. The field values in
 * NPC_AF_MCAME()_BANK()_CAM()_INTF, NPC_AF_MCAME()_BANK()_CAM()_W0 and
 * NPC_AF_MCAME()_BANK()_CAM()_W1 are ternary, where  each data bit of
 * the search key matches as follows: _ [CAM(1)]\<n\>=0, [CAM(0)]\<n\>=0:
 * Always match; search key data\<n\> don't care. _ [CAM(1)]\<n\>=0,
 * [CAM(0)]\<n\>=1: Match when search key data\<n\> == 0. _
 * [CAM(1)]\<n\>=1, [CAM(0)]\<n\>=0: Match when search key data\<n\> ==
 * 1. _ [CAM(1)]\<n\>=1, [CAM(0)]\<n\>=1: Reserved.  The reserved
 * combination is not allowed. Hardware suppresses any write to CAM(0) or
 * CAM(1) that would result in the reserved combination for any CAM bit.
 * The reset value for all non-reserved fields in
 * NPC_AF_MCAME()_BANK()_CAM()_INTF, NPC_AF_MCAME()_BANK()_CAM()_W0 and
 * NPC_AF_MCAME()_BANK()_CAM()_W1 is all zeros for CAM(1) and all ones
 * for CAM(0), matching a search key of all zeros.  When an interface is
 * configured to use the NPC_MCAM_KEY_X1_S search key format
 * (NPC_AF_INTF()_KEX_CFG[KEYW] = NPC_MCAMKEYW_E::X1), the four banks of
 * every MCAM entry are used as individual entries, each of which is
 * independently compared with the search key as follows: _
 * NPC_AF_MCAME()_BANK()_CAM()_INTF[INTF] corresponds to
 * NPC_MCAM_KEY_X1_S[INTF]. _ NPC_AF_MCAME()_BANK()_CAM()_W0[MD]
 * corresponds to NPC_MCAM_KEY_X1_S[KW0]. _
 * NPC_AF_MCAME()_BANK()_CAM()_W1[MD] corresponds to
 * NPC_MCAM_KEY_X1_S[KW1].  When an interface is configured to use the
 * NPC_MCAM_KEY_X2_S search key format (NPC_AF_INTF()_KEX_CFG[KEYW] =
 * NPC_MCAMKEYW_E::X2), banks 0-1 of every MCAM entry are used as one
 * double-wide entry, banks 2-3 as a second double-wide entry, and each
 * double-wide entry is independently compared with the search key as
 * follows: _ NPC_AF_MCAME()_BANK(0,2)_CAM()_INTF[INTF] corresponds to
 * NPC_MCAM_KEY_X2_S[INTF]. _ NPC_AF_MCAME()_BANK(0,2)_CAM()_W0[MD]
 * corresponds to NPC_MCAM_KEY_X2_S[KW0]. _
 * NPC_AF_MCAME()_BANK(0,2)_CAM()_W1[MD] corresponds to
 * NPC_MCAM_KEY_X2_S[KW1]\<47:0\>. _
 * NPC_AF_MCAME()_BANK(1,3)_CAM()_INTF[INTF] corresponds to
 * NPC_MCAM_KEY_X2_S[INTF]. _
 * NPC_AF_MCAME()_BANK(1,3)_CAM()_W0[MD]\<15:0\> corresponds to
 * NPC_MCAM_KEY_X2_S[KW1]\<63:48\>. _
 * NPC_AF_MCAME()_BANK(1,3)_CAM()_W0[MD]\<63:16\> corresponds to
 * NPC_MCAM_KEY_X2_S[KW2]\<47:0\>. _
 * NPC_AF_MCAME()_BANK(1,3)_CAM()_W1[MD]\<15:0\> corresponds to
 * NPC_MCAM_KEY_X2_S[KW2]\<63:48\>. _
 * NPC_AF_MCAME()_BANK(1,3)_CAM()_W1[MD]\<47:16\> corresponds to
 * NPC_MCAM_KEY_X2_S[KW3]\<31:0\>.  When an interface is configured to
 * use the NPC_MCAM_KEY_X4_S search key format
 * (NPC_AF_INTF()_KEX_CFG[KEYW] = NPC_MCAMKEYW_E::X4), the four banks of
 * every MCAM entry are used as a single quad-wide entry that is compared
 * with the search key as follows: _
 * NPC_AF_MCAME()_BANK(0)_CAM()_INTF[INTF] corresponds to
 * NPC_MCAM_KEY_X4_S[INTF]. _ NPC_AF_MCAME()_BANK(0)_CAM()_W0[MD]
 * corresponds to NPC_MCAM_KEY_X4_S[KW0]. _
 * NPC_AF_MCAME()_BANK(0)_CAM()_W1[MD] corresponds to
 * NPC_MCAM_KEY_X4_S[KW1]\<47:0\>. _
 * NPC_AF_MCAME()_BANK(1)_CAM()_INTF[INTF] corresponds to
 * NPC_MCAM_KEY_X4_S[INTF]. _ NPC_AF_MCAME()_BANK(1)_CAM()_W0[MD]\<15:0\>
 * corresponds to NPC_MCAM_KEY_X4_S[KW1]\<63:48\>. _
 * NPC_AF_MCAME()_BANK(1)_CAM()_W0[MD]\<63:16\> corresponds to
 * NPC_MCAM_KEY_X4_S[KW2]\<47:0\>. _
 * NPC_AF_MCAME()_BANK(1)_CAM()_W1[MD]\<15:0\> corresponds to
 * NPC_MCAM_KEY_X4_S[KW2]\<63:48\>. _
 * NPC_AF_MCAME()_BANK(1)_CAM()_W1[MD]\<47:16\> corresponds to
 * NPC_MCAM_KEY_X4_S[KW3]\<31:0\>. _
 * NPC_AF_MCAME()_BANK(2)_CAM()_INTF[INTF] corresponds to
 * NPC_MCAM_KEY_X4_S[INTF]. _ NPC_AF_MCAME()_BANK(2)_CAM()_W0[MD]\<31:0\>
 * corresponds to NPC_MCAM_KEY_X4_S[KW3]\<63:32\>. _
 * NPC_AF_MCAME()_BANK(2)_CAM()_W0[MD]\<63:32\> corresponds to
 * NPC_MCAM_KEY_X4_S[KW4]\<31:0\>. _
 * NPC_AF_MCAME()_BANK(2)_CAM()_W1[MD]\<31:0\> corresponds to
 * NPC_MCAM_KEY_X4_S[KW4]\<63:32\>. _
 * NPC_AF_MCAME()_BANK(2)_CAM()_W1[MD]\<47:32\> corresponds to
 * NPC_MCAM_KEY_X4_S[KW5]\<15:0\>. _
 * NPC_AF_MCAME()_BANK(3)_CAM()_INTF[INTF] corresponds to
 * NPC_MCAM_KEY_X4_S[INTF]. _ NPC_AF_MCAME()_BANK(3)_CAM()_W0[MD]\<47:0\>
 * corresponds to NPC_MCAM_KEY_X4_S[KW5]\<63:16\>. _
 * NPC_AF_MCAME()_BANK(3)_CAM()_W0[MD]\<63:48\> corresponds to
 * NPC_MCAM_KEY_X4_S[KW6]\<15:0\>. _ NPC_AF_MCAME()_BANK(3)_CAM()_W1[MD]
 * corresponds to NPC_MCAM_KEY_X4_S[KW6]\<63:16\>.  Note that for the X2
 * and X4 formats, a wide entry will not match unless the INTF fields
 * from the associated two or four banks match the INTF value from the
 * search key.  For the X1 and X2 formats, a match in a lower-numbered
 * bank takes priority over a match in any higher numbered banks. Within
 * each bank, the lowest numbered matching entry takes priority over any
 * higher numbered entry.
 */
union npc_af_mcamex_bankx_camx_intf {
	u64 u;
	struct npc_af_mcamex_bankx_camx_intf_s {
		u64 intf                             : 2;
		u64 reserved_2_63                    : 62;
	} s;
	/* struct npc_af_mcamex_bankx_camx_intf_s cn; */
};

static inline u64 NPC_AF_MCAMEX_BANKX_CAMX_INTF(u64 a, u64 b, u64 c)
	__attribute__ ((pure, always_inline));
static inline u64 NPC_AF_MCAMEX_BANKX_CAMX_INTF(u64 a, u64 b, u64 c)
{
	return 0x1000000 + 0x400 * a + 0x40 * b + 8 * c;
}

/**
 * Register (RVU_PF_BAR0) npc_af_mcame#_bank#_cam#_w0
 *
 * NPC AF MCAM Entry Bank CAM Data Word 0 Registers MCAM comparison
 * ternary data word 0. See NPC_AF_MCAME()_BANK()_CAM()_INTF.
 */
union npc_af_mcamex_bankx_camx_w0 {
	u64 u;
	struct npc_af_mcamex_bankx_camx_w0_s {
		u64 md                               : 64;
	} s;
	/* struct npc_af_mcamex_bankx_camx_w0_s cn; */
};

static inline u64 NPC_AF_MCAMEX_BANKX_CAMX_W0(u64 a, u64 b, u64 c)
	__attribute__ ((pure, always_inline));
static inline u64 NPC_AF_MCAMEX_BANKX_CAMX_W0(u64 a, u64 b, u64 c)
{
	return 0x1000010 + 0x400 * a + 0x40 * b + 8 * c;
}

/**
 * Register (RVU_PF_BAR0) npc_af_mcame#_bank#_cam#_w1
 *
 * NPC AF MCAM Entry Bank Data Word 1 Registers MCAM comparison ternary
 * data word 1. See NPC_AF_MCAME()_BANK()_CAM()_INTF.
 */
union npc_af_mcamex_bankx_camx_w1 {
	u64 u;
	struct npc_af_mcamex_bankx_camx_w1_s {
		u64 md                               : 48;
		u64 reserved_48_63                   : 16;
	} s;
	/* struct npc_af_mcamex_bankx_camx_w1_s cn; */
};

static inline u64 NPC_AF_MCAMEX_BANKX_CAMX_W1(u64 a, u64 b, u64 c)
	__attribute__ ((pure, always_inline));
static inline u64 NPC_AF_MCAMEX_BANKX_CAMX_W1(u64 a, u64 b, u64 c)
{
	return 0x1000020 + 0x400 * a + 0x40 * b + 8 * c;
}

/**
 * Register (RVU_PF_BAR0) npc_af_mcame#_bank#_cfg
 *
 * NPC AF MCAM Entry Bank Configuration Registers
 */
union npc_af_mcamex_bankx_cfg {
	u64 u;
	struct npc_af_mcamex_bankx_cfg_s {
		u64 ena                              : 1;
		u64 reserved_1_63                    : 63;
	} s;
	/* struct npc_af_mcamex_bankx_cfg_s cn; */
};

static inline u64 NPC_AF_MCAMEX_BANKX_CFG(u64 a, u64 b)
	__attribute__ ((pure, always_inline));
static inline u64 NPC_AF_MCAMEX_BANKX_CFG(u64 a, u64 b)
{
	return 0x1800000 + 0x100 * a + 0x10 * b;
}

/**
 * Register (RVU_PF_BAR0) npc_af_mcame#_bank#_stat_act
 *
 * NPC AF MCAM Entry Bank Statistics Action Registers Used to optionally
 * increment a NPC_AF_MATCH_STAT() counter when a packet matches an MCAM
 * entry. See also NPC_AF_MCAME()_BANK()_ACTION.
 */
union npc_af_mcamex_bankx_stat_act {
	u64 u;
	struct npc_af_mcamex_bankx_stat_act_s {
		u64 stat_sel                         : 9;
		u64 ena                              : 1;
		u64 reserved_10_63                   : 54;
	} s;
	/* struct npc_af_mcamex_bankx_stat_act_s cn; */
};

static inline u64 NPC_AF_MCAMEX_BANKX_STAT_ACT(u64 a, u64 b)
	__attribute__ ((pure, always_inline));
static inline u64 NPC_AF_MCAMEX_BANKX_STAT_ACT(u64 a, u64 b)
{
	return 0x1880000 + 0x100 * a + 0x10 * b;
}

/**
 * Register (RVU_PF_BAR0) npc_af_mcame#_bank#_tag_act
 *
 * NPC AF MCAM Entry Bank VTag Action Data Registers Specifies a packet's
 * match Vtag action captured in NPC_RESULT_S[VTAG_ACTION]. See also
 * NPC_AF_MCAME()_BANK()_ACTION.
 */
union npc_af_mcamex_bankx_tag_act {
	u64 u;
	struct npc_af_mcamex_bankx_tag_act_s {
		u64 vtag_action                      : 64;
	} s;
	/* struct npc_af_mcamex_bankx_tag_act_s cn; */
};

static inline u64 NPC_AF_MCAMEX_BANKX_TAG_ACT(u64 a, u64 b)
	__attribute__ ((pure, always_inline));
static inline u64 NPC_AF_MCAMEX_BANKX_TAG_ACT(u64 a, u64 b)
{
	return 0x1900008 + 0x100 * a + 0x10 * b;
}

/**
 * Register (RVU_PF_BAR0) npc_af_pck_cfg
 *
 * NPC AF Protocol Check Configuration Register
 */
union npc_af_pck_cfg {
	u64 u;
	struct npc_af_pck_cfg_s {
		u64 reserved_0                       : 1;
		u64 iip4_cksum                       : 1;
		u64 oip4_cksum                       : 1;
		u64 reserved_3                       : 1;
		u64 l3b                              : 1;
		u64 l3m                              : 1;
		u64 l2b                              : 1;
		u64 l2m                              : 1;
		u64 reserved_8_23                    : 16;
		u64 iip4_cksum_errcode               : 8;
		u64 oip4_cksum_errcode               : 8;
		u64 reserved_40_63                   : 24;
	} s;
	/* struct npc_af_pck_cfg_s cn; */
};

static inline u64 NPC_AF_PCK_CFG(void)
	__attribute__ ((pure, always_inline));
static inline u64 NPC_AF_PCK_CFG(void)
{
	return 0x600;
}

/**
 * Register (RVU_PF_BAR0) npc_af_pck_def_iip4
 *
 * NPC AF Protocol Check Inner IPv4 Definition Register Provides layer
 * information used by the protocol checker to identify an inner IPv4
 * header.
 */
union npc_af_pck_def_iip4 {
	u64 u;
	struct npc_af_pck_def_iip4_s {
		u64 ltype_mask                       : 4;
		u64 ltype_match                      : 4;
		u64 lid                              : 3;
		u64 reserved_11_63                   : 53;
	} s;
	/* struct npc_af_pck_def_iip4_s cn; */
};

static inline u64 NPC_AF_PCK_DEF_IIP4(void)
	__attribute__ ((pure, always_inline));
static inline u64 NPC_AF_PCK_DEF_IIP4(void)
{
	return 0x640;
}

/**
 * Register (RVU_PF_BAR0) npc_af_pck_def_oip4
 *
 * NPC AF Protocol Check Outer IPv4 Definition Register Provides layer
 * information used by the protocol checker to identify an outer IPv4
 * header.
 */
union npc_af_pck_def_oip4 {
	u64 u;
	struct npc_af_pck_def_oip4_s {
		u64 ltype_mask                       : 4;
		u64 ltype_match                      : 4;
		u64 lid                              : 3;
		u64 reserved_11_63                   : 53;
	} s;
	/* struct npc_af_pck_def_oip4_s cn; */
};

static inline u64 NPC_AF_PCK_DEF_OIP4(void)
	__attribute__ ((pure, always_inline));
static inline u64 NPC_AF_PCK_DEF_OIP4(void)
{
	return 0x620;
}

/**
 * Register (RVU_PF_BAR0) npc_af_pck_def_oip6
 *
 * NPC AF Protocol Check Outer IPv6 Definition Register Provides layer
 * information used by the protocol checker to identify an outer IPv6
 * header. [LID] must have the same value as NPC_AF_PCK_DEF_OIP4[LID].
 */
union npc_af_pck_def_oip6 {
	u64 u;
	struct npc_af_pck_def_oip6_s {
		u64 ltype_mask                       : 4;
		u64 ltype_match                      : 4;
		u64 lid                              : 3;
		u64 reserved_11_63                   : 53;
	} s;
	/* struct npc_af_pck_def_oip6_s cn; */
};

static inline u64 NPC_AF_PCK_DEF_OIP6(void)
	__attribute__ ((pure, always_inline));
static inline u64 NPC_AF_PCK_DEF_OIP6(void)
{
	return 0x630;
}

/**
 * Register (RVU_PF_BAR0) npc_af_pck_def_ol2
 *
 * NPC AF Protocol Check Outer L2 Definition Register Provides layer
 * information used by the protocol checker to identify an outer L2
 * header.
 */
union npc_af_pck_def_ol2 {
	u64 u;
	struct npc_af_pck_def_ol2_s {
		u64 ltype_mask                       : 4;
		u64 ltype_match                      : 4;
		u64 lid                              : 3;
		u64 reserved_11_63                   : 53;
	} s;
	/* struct npc_af_pck_def_ol2_s cn; */
};

static inline u64 NPC_AF_PCK_DEF_OL2(void)
	__attribute__ ((pure, always_inline));
static inline u64 NPC_AF_PCK_DEF_OL2(void)
{
	return 0x610;
}

/**
 * Register (RVU_PF_BAR0) npc_af_pkind#_action0
 *
 * NPC AF Port Kind Action Data 0 Registers NPC_AF_PKIND()_ACTION0 and
 * NPC_AF_PKIND()_ACTION1 specify the initial parse state and operations
 * to perform before entering KPU 0.
 */
union npc_af_pkindx_action0 {
	u64 u;
	struct npc_af_pkindx_action0_s {
		u64 var_len_shift                    : 3;
		u64 var_len_right                    : 1;
		u64 var_len_mask                     : 8;
		u64 var_len_offset                   : 8;
		u64 ptr_advance                      : 8;
		u64 capture_flags                    : 8;
		u64 capture_ltype                    : 4;
		u64 capture_lid                      : 3;
		u64 reserved_43                      : 1;
		u64 next_state                       : 8;
		u64 parse_done                       : 1;
		u64 capture_ena                      : 1;
		u64 byp_count                        : 3;
		u64 reserved_57_63                   : 7;
	} s;
	/* struct npc_af_pkindx_action0_s cn; */
};

static inline u64 NPC_AF_PKINDX_ACTION0(u64 a)
	__attribute__ ((pure, always_inline));
static inline u64 NPC_AF_PKINDX_ACTION0(u64 a)
{
	return 0x80000 + 0x40 * a;
}

/**
 * Register (RVU_PF_BAR0) npc_af_pkind#_action1
 *
 * NPC AF Port Kind Action Data 1 Registers NPC_AF_PKIND()_ACTION0 and
 * NPC_AF_PKIND()_ACTION1 specify the initial parse state and operations
 * to perform before entering KPU 0.
 */
union npc_af_pkindx_action1 {
	u64 u;
	struct npc_af_pkindx_action1_s {
		u64 dp0_offset                       : 8;
		u64 dp1_offset                       : 8;
		u64 dp2_offset                       : 8;
		u64 errcode                          : 8;
		u64 errlev                           : 4;
		u64 reserved_36_63                   : 28;
	} s;
	/* struct npc_af_pkindx_action1_s cn; */
};

static inline u64 NPC_AF_PKINDX_ACTION1(u64 a)
	__attribute__ ((pure, always_inline));
static inline u64 NPC_AF_PKINDX_ACTION1(u64 a)
{
	return 0x80008 + 0x40 * a;
}

/**
 * Register (RVU_PF_BAR0) npc_af_pkind#_cpi_def#
 *
 * NPC AF Port Kind Channel Parse Index Definition Registers These
 * registers specify the layer information and algorithm to compute a
 * packet's channel parse index (CPI), which provides a port to channel
 * adder for calculating NPC_RESULT_S[CHAN].  There are two CPI
 * definitions per port kind, allowing the CPI computation to use two
 * possible layer definitions in the parsed packet, e.g. DiffServ DSCP
 * from either IPv4 or IPv6 header.  CPI pseudocode: \<pre\> for (i = 0;
 * i \< 2; i++) {    cpi_def = NPC_AF_PKIND()_CPI_DEF(i);    LX = LA, LB,
 * ..., or LH as selected by cpi_def[LID];     if (cpi_def[ENA]        &&
 * ((cpi_def[LTYPE_MATCH] & cpi_def[LTYPE_MASK])             ==
 * (NPC_RESULT_S[LX[LTYPE]] & cpi_def[LTYPE_MASK]))        &&
 * ((cpi_def[FLAGS_MATCH] & cpi_def[FLAGS_MASK])             ==
 * (NPC_RESULT_S[LX[FLAGS]] & cpi_def[FLAGS_MASK])))    {       // Found
 * matching layer       nibble_offset = (2*NPC_RESULT_S[LX[LPTR]]) +
 * cpi_def[ADD_OFFSET];       add_byte = byte at nibble_offset from start
 * of packet;       cpi_add = (add_byte & cpi_def[ADD_MASK]) \>\>
 * cpi_def[ADD_SHIFT];       cpi = cpi_def[CPI_BASE] + cpi_add;
 * NPC_RESULT_S[CHAN] += NPC_AF_CPI(cpi)_CFG[PADD];       break;    } }
 * \</pre\>
 */
union npc_af_pkindx_cpi_defx {
	u64 u;
	struct npc_af_pkindx_cpi_defx_s {
		u64 cpi_base                         : 10;
		u64 reserved_10_11                   : 2;
		u64 add_shift                        : 3;
		u64 reserved_15                      : 1;
		u64 add_mask                         : 8;
		u64 add_offset                       : 8;
		u64 flags_mask                       : 8;
		u64 flags_match                      : 8;
		u64 ltype_mask                       : 4;
		u64 ltype_match                      : 4;
		u64 lid                              : 3;
		u64 reserved_59_62                   : 4;
		u64 ena                              : 1;
	} s;
	/* struct npc_af_pkindx_cpi_defx_s cn; */
};

static inline u64 NPC_AF_PKINDX_CPI_DEFX(u64 a, u64 b)
	__attribute__ ((pure, always_inline));
static inline u64 NPC_AF_PKINDX_CPI_DEFX(u64 a, u64 b)
{
	return 0x80020 + 0x40 * a + 8 * b;
}

#endif /* __CSRS_NPC_H__ */