aboutsummaryrefslogtreecommitdiff
path: root/sys/contrib/alpine-hal/eth/al_hal_pcie_w_reg.h
blob: 44e9d952655d58fa7bcae00bc16357ad6ae4ffd1 (plain) (blame)
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
/*-
********************************************************************************
Copyright (C) 2015 Annapurna Labs Ltd.

This file may be licensed under the terms of the Annapurna Labs Commercial
License Agreement.

Alternatively, this file can be distributed under the terms of the GNU General
Public License V2 as published by the Free Software Foundation and can be
found at http://www.gnu.org/licenses/gpl-2.0.html

Alternatively, redistribution and use in source and binary forms, with or
without modification, are permitted provided that the following conditions are
met:

    *     Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.

    *     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.

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 OWNER 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 __AL_HAL_PCIE_W_REG_H__
#define __AL_HAL_PCIE_W_REG_H__

#ifdef __cplusplus
extern "C" {
#endif
/*
* Unit Registers
*/



struct al_pcie_rev1_w_global_ctrl {
	/* [0x0]  */
	uint32_t port_init;
	/* [0x4]  */
	uint32_t port_status;
	/* [0x8]  */
	uint32_t pm_control;
	uint32_t rsrvd_0;
	/* [0x10]  */
	uint32_t events_gen;
	uint32_t rsrvd[3];
};
struct al_pcie_rev2_w_global_ctrl {
	/* [0x0]  */
	uint32_t port_init;
	/* [0x4]  */
	uint32_t port_status;
	/* [0x8]  */
	uint32_t pm_control;
	uint32_t rsrvd_0;
	/* [0x10]  */
	uint32_t events_gen;
	/* [0x14]  */
	uint32_t pended_corr_err_sts_int;
	/* [0x18]  */
	uint32_t pended_uncorr_err_sts_int;
	/* [0x1c]  */
	uint32_t sris_kp_counter_value;
};
struct al_pcie_rev3_w_global_ctrl {
	/* [0x0]  */
	uint32_t port_init;
	/* [0x4]  */
	uint32_t port_status;
	/* [0x8]  */
	uint32_t pm_control;
	/* [0xc]  */
	uint32_t pended_corr_err_sts_int;
	/* [0x10]  */
	uint32_t pended_uncorr_err_sts_int;
	/* [0x14]  */
	uint32_t sris_kp_counter_value;
	uint32_t rsrvd[2];
};

struct al_pcie_rev3_w_events_gen_per_func {
	/* [0x0]  */
	uint32_t events_gen;
};
struct al_pcie_rev3_w_pm_state_per_func {
	/* [0x0]  */
	uint32_t pm_state_per_func;
};
struct al_pcie_rev3_w_cfg_bars_ovrd {
	/* [0x0]  */
	uint32_t bar0_mask_lsb;
	/* [0x4]  */
	uint32_t bar0_mask_msb;
	/* [0x8]  */
	uint32_t bar0_limit_lsb;
	/* [0xc]  */
	uint32_t bar0_limit_msb;
	/* [0x10]  */
	uint32_t bar0_start_lsb;
	/* [0x14]  */
	uint32_t bar0_start_msb;
	/* [0x18]  */
	uint32_t bar0_ctrl;
	/* [0x1c]  */
	uint32_t bar1_mask_lsb;
	/* [0x20]  */
	uint32_t bar1_mask_msb;
	/* [0x24]  */
	uint32_t bar1_limit_lsb;
	/* [0x28]  */
	uint32_t bar1_limit_msb;
	/* [0x2c]  */
	uint32_t bar1_start_lsb;
	/* [0x30]  */
	uint32_t bar1_start_msb;
	/* [0x34]  */
	uint32_t bar1_ctrl;
	/* [0x38]  */
	uint32_t bar2_mask_lsb;
	/* [0x3c]  */
	uint32_t bar2_mask_msb;
	/* [0x40]  */
	uint32_t bar2_limit_lsb;
	/* [0x44]  */
	uint32_t bar2_limit_msb;
	/* [0x48]  */
	uint32_t bar2_start_lsb;
	/* [0x4c]  */
	uint32_t bar2_start_msb;
	/* [0x50]  */
	uint32_t bar2_ctrl;
	/* [0x54]  */
	uint32_t bar3_mask_lsb;
	/* [0x58]  */
	uint32_t bar3_mask_msb;
	/* [0x5c]  */
	uint32_t bar3_limit_lsb;
	/* [0x60]  */
	uint32_t bar3_limit_msb;
	/* [0x64]  */
	uint32_t bar3_start_lsb;
	/* [0x68]  */
	uint32_t bar3_start_msb;
	/* [0x6c]  */
	uint32_t bar3_ctrl;
	/* [0x70]  */
	uint32_t bar4_mask_lsb;
	/* [0x74]  */
	uint32_t bar4_mask_msb;
	/* [0x78]  */
	uint32_t bar4_limit_lsb;
	/* [0x7c]  */
	uint32_t bar4_limit_msb;
	/* [0x80]  */
	uint32_t bar4_start_lsb;
	/* [0x84]  */
	uint32_t bar4_start_msb;
	/* [0x88]  */
	uint32_t bar4_ctrl;
	/* [0x8c]  */
	uint32_t bar5_mask_lsb;
	/* [0x90]  */
	uint32_t bar5_mask_msb;
	/* [0x94]  */
	uint32_t bar5_limit_lsb;
	/* [0x98]  */
	uint32_t bar5_limit_msb;
	/* [0x9c]  */
	uint32_t bar5_start_lsb;
	/* [0xa0]  */
	uint32_t bar5_start_msb;
	/* [0xa4]  */
	uint32_t bar5_ctrl;
	uint32_t rsrvd[2];
};

struct al_pcie_revx_w_debug {
	/* [0x0]  */
	uint32_t info_0;
	/* [0x4]  */
	uint32_t info_1;
	/* [0x8]  */
	uint32_t info_2;
	/* [0xc]  */
	uint32_t info_3;
};
struct al_pcie_revx_w_ob_ven_msg {
	/* [0x0]  */
	uint32_t control;
	/* [0x4]  */
	uint32_t param_1;
	/* [0x8]  */
	uint32_t param_2;
	/* [0xc]  */
	uint32_t data_high;
	uint32_t rsrvd_0;
	/* [0x14]  */
	uint32_t data_low;
};
struct al_pcie_revx_w_ap_user_send_msg {
	/* [0x0]  */
	uint32_t req_info;
	/* [0x4]  */
	uint32_t ack_info;
};
struct al_pcie_revx_w_link_down {
	/* [0x0]  */
	uint32_t reset_delay;
	/* [0x4]  */
	uint32_t reset_extend_rsrvd;
};
struct al_pcie_revx_w_cntl_gen {
	/* [0x0]  */
	uint32_t features;
};
struct al_pcie_revx_w_parity {
	/* [0x0]  */
	uint32_t en_core;
	/* [0x4]  */
	uint32_t status_core;
};
struct al_pcie_revx_w_last_wr {
	/* [0x0]  */
	uint32_t cfg_addr;
};
struct al_pcie_rev1_2_w_atu {
	/* [0x0]  */
	uint32_t in_mask_pair[6];
	/* [0x18]  */
	uint32_t out_mask_pair[6];
};
struct al_pcie_rev3_w_atu {
	/* [0x0]  */
	uint32_t in_mask_pair[12];
	/* [0x30]  */
	uint32_t out_mask_pair[8];
	/* [0x50] */
	uint32_t reg_out_mask;
	uint32_t rsrvd[11];
};
struct al_pcie_rev3_w_cfg_func_ext {
	/* [0x0]  */
	uint32_t cfg;
};
struct al_pcie_rev3_w_app_hdr_interface_send {
	/* [0x0]  */
	uint32_t app_hdr_31_0;
	/* [0x4]  */
	uint32_t app_hdr_63_32;
	/* [0x8]  */
	uint32_t app_hdr_95_64;
	/* [0xc]  */
	uint32_t app_hdr_127_96;
	/* [0x10]  */
	uint32_t app_err_bus;
	/* [0x14]  */
	uint32_t app_func_num_advisory;
	/* [0x18]  */
	uint32_t app_hdr_cmd;
};
struct al_pcie_rev3_w_diag_command {
	/* [0x0]  */
	uint32_t diag_ctrl;
};
struct al_pcie_rev1_w_soc_int {
	/* [0x0]  */
	uint32_t status_0;
	/* [0x4]  */
	uint32_t status_1;
	/* [0x8]  */
	uint32_t status_2;
	/* [0xc]  */
	uint32_t mask_inta_leg_0;
	/* [0x10]  */
	uint32_t mask_inta_leg_1;
	/* [0x14]  */
	uint32_t mask_inta_leg_2;
	/* [0x18]  */
	uint32_t mask_msi_leg_0;
	/* [0x1c]  */
	uint32_t mask_msi_leg_1;
	/* [0x20]  */
	uint32_t mask_msi_leg_2;
	/* [0x24]  */
	uint32_t msi_leg_cntl;
};
struct al_pcie_rev2_w_soc_int {
	/* [0x0]  */
	uint32_t status_0;
	/* [0x4]  */
	uint32_t status_1;
	/* [0x8]  */
	uint32_t status_2;
	/* [0xc]  */
	uint32_t status_3;
	/* [0x10]  */
	uint32_t mask_inta_leg_0;
	/* [0x14]  */
	uint32_t mask_inta_leg_1;
	/* [0x18]  */
	uint32_t mask_inta_leg_2;
	/* [0x1c]  */
	uint32_t mask_inta_leg_3;
	/* [0x20]  */
	uint32_t mask_msi_leg_0;
	/* [0x24]  */
	uint32_t mask_msi_leg_1;
	/* [0x28]  */
	uint32_t mask_msi_leg_2;
	/* [0x2c]  */
	uint32_t mask_msi_leg_3;
	/* [0x30]  */
	uint32_t msi_leg_cntl;
};
struct al_pcie_rev3_w_soc_int_per_func {
	/* [0x0]  */
	uint32_t status_0;
	/* [0x4]  */
	uint32_t status_1;
	/* [0x8]  */
	uint32_t status_2;
	/* [0xc]  */
	uint32_t status_3;
	/* [0x10]  */
	uint32_t mask_inta_leg_0;
	/* [0x14]  */
	uint32_t mask_inta_leg_1;
	/* [0x18]  */
	uint32_t mask_inta_leg_2;
	/* [0x1c]  */
	uint32_t mask_inta_leg_3;
	/* [0x20]  */
	uint32_t mask_msi_leg_0;
	/* [0x24]  */
	uint32_t mask_msi_leg_1;
	/* [0x28]  */
	uint32_t mask_msi_leg_2;
	/* [0x2c]  */
	uint32_t mask_msi_leg_3;
	/* [0x30]  */
	uint32_t msi_leg_cntl;
};

struct al_pcie_revx_w_ap_err {
	/*
	 * [0x0] latch the header in case of any error occur in the core, read
	 * on clear of the last register in the bind.
	 */
	uint32_t hdr_log;
};
struct al_pcie_revx_w_status_per_func {
	/*
	 * [0x0] latch the header in case of any error occure in the core, read
	 * on clear of the last register in the bind.
	 */
	uint32_t status_per_func;
};
struct al_pcie_revx_w_int_grp {
	/*
	 * [0x0] Interrupt Cause Register
	 * Set by hardware
	 * - If MSI-X is enabled and auto_clear control bit =TRUE, automatically
	 * cleared after MSI-X message associated with this specific interrupt
	 * bit is sent (MSI-X acknowledge is received).
	 * - Software can set a bit in this register by writing 1 to the
	 * associated bit in the Interrupt Cause Set register
	 * Write-0 clears a bit. Write-1 has no effect.
	 * - On CPU Read - If clear_on_read control bit =TRUE, automatically
	 * cleared (all bits are cleared).
	 * When there is a conflict and on the same clock cycle, hardware tries
	 * to set a bit in the Interrupt Cause register, the specific bit is set
	 * to ensure the interrupt indication is not lost.
	 */
	uint32_t cause;
	uint32_t rsrvd_0;
	/*
	 * [0x8] Interrupt Cause Set Register
	 * Writing 1 to a bit in this register sets its corresponding cause bit,
	 * enabling software to generate a hardware interrupt. Write 0 has no
	 * effect.
	 */
	uint32_t cause_set;
	uint32_t rsrvd_1;
	/*
	 * [0x10] Interrupt Mask Register
	 * If Auto-mask control bit =TRUE, automatically set to 1 after MSI-X
	 * message associatd with the associated interrupt bit is sent (AXI
	 * write acknowledge is received).
	 */
	uint32_t mask;
	uint32_t rsrvd_2;
	/*
	 * [0x18] Interrupt Mask Clear Register
	 * Used when auto-mask control bit=True. Enables CPU to clear a specific
	 * bit. It prevents a scenario in which the CPU overrides another bit
	 * with 1 (old value) that hardware has just cleared to 0.
	 * Write 0 to this register clears its corresponding mask bit. Write 1
	 * has no effect.
	 */
	uint32_t mask_clear;
	uint32_t rsrvd_3;
	/*
	 * [0x20] Interrupt Status Register
	 * This register latches the status of the interrupt source.
	 */
	uint32_t status;
	uint32_t rsrvd_4;
	/* [0x28] Interrupt Control Register */
	uint32_t control;
	uint32_t rsrvd_5;
	/*
	 * [0x30] Interrupt Mask Register
	 * Each bit in this register masks the corresponding cause bit for
	 * generating an Abort signal. Its default value is determined by unit
	 * instantiation.
	 * (Abort = Wire-OR of Cause & !Interrupt_Abort_Mask)
	 * This register provides error handling configuration for error
	 * interrupts
	 */
	uint32_t abort_mask;
	uint32_t rsrvd_6;
	/*
	 * [0x38] Interrupt Log Register
	 * Each bit in this register masks the corresponding cause bit for
	 * capturing the log registers. Its default value is determined by unit
	 * instantiation.
	 * (Log_capture = Wire-OR of Cause & !Interrupt_Log_Mask)
	 * This register provides error handling configuration for error
	 * interrupts.
	 */
	uint32_t log_mask;
	uint32_t rsrvd;
};

struct al_pcie_rev1_w_regs {
	struct al_pcie_rev1_w_global_ctrl global_ctrl;     /* [0x0] */
	uint32_t rsrvd_0[24];
	struct al_pcie_revx_w_debug debug;                     /* [0x80] */
	struct al_pcie_revx_w_ob_ven_msg ob_ven_msg; /* [0x90] */
	uint32_t rsrvd_1[86];
	struct al_pcie_rev1_w_soc_int soc_int;                 /* [0x200] */
	struct al_pcie_revx_w_link_down link_down;             /* [0x228] */
	struct al_pcie_revx_w_cntl_gen ctrl_gen;               /* [0x230] */
	struct al_pcie_revx_w_parity parity;                   /* [0x234] */
	struct al_pcie_revx_w_last_wr last_wr;                 /* [0x23c] */
	struct al_pcie_rev1_2_w_atu atu;                         /* [0x240] */
	uint32_t rsrvd_2[36];
	struct al_pcie_revx_w_int_grp int_grp_a_m0; /* [0x300] */
	struct al_pcie_revx_w_int_grp int_grp_b_m0; /* [0x340] */
	uint32_t rsrvd_3[32];
	struct al_pcie_revx_w_int_grp int_grp_a; /* [0x400] */
	struct al_pcie_revx_w_int_grp int_grp_b; /* [0x440] */
};

struct al_pcie_rev2_w_regs {
	struct al_pcie_rev2_w_global_ctrl global_ctrl;     /* [0x0] */
	uint32_t rsrvd_0[24];
	struct al_pcie_revx_w_debug debug;                     /* [0x80] */
	struct al_pcie_revx_w_ob_ven_msg ob_ven_msg; /* [0x90] */
	struct al_pcie_revx_w_ap_user_send_msg ap_user_send_msg; /* [0xa8] */
	uint32_t rsrvd_1[20];
	struct al_pcie_rev2_w_soc_int soc_int;                 /* [0x100] */
	uint32_t rsrvd_2[61];
	struct al_pcie_revx_w_link_down link_down;             /* [0x228] */
	struct al_pcie_revx_w_cntl_gen ctrl_gen;               /* [0x230] */
	struct al_pcie_revx_w_parity parity;                   /* [0x234] */
	struct al_pcie_revx_w_last_wr last_wr;                 /* [0x23c] */
	struct al_pcie_rev1_2_w_atu atu;                         /* [0x240] */
	uint32_t rsrvd_3[6];
	struct al_pcie_revx_w_ap_err ap_err[4];             /* [0x288] */
	uint32_t rsrvd_4[26];
	struct al_pcie_revx_w_status_per_func status_per_func; /* [0x300] */
	uint32_t rsrvd_5[63];
	struct al_pcie_revx_w_int_grp int_grp_a; /* [0x400] */
	struct al_pcie_revx_w_int_grp int_grp_b; /* [0x440] */
};

struct al_pcie_rev3_w_regs {
	struct al_pcie_rev3_w_global_ctrl global_ctrl;     /* [0x0] */
	uint32_t rsrvd_0[24];
	struct al_pcie_revx_w_debug debug;                     /* [0x80] */
	struct al_pcie_revx_w_ob_ven_msg ob_ven_msg; /* [0x90] */
	struct al_pcie_revx_w_ap_user_send_msg ap_user_send_msg; /* [0xa8] */
	uint32_t rsrvd_1[94];
	struct al_pcie_revx_w_link_down link_down;             /* [0x228] */
	struct al_pcie_revx_w_cntl_gen ctrl_gen;               /* [0x230] */
	struct al_pcie_revx_w_parity parity;                   /* [0x234] */
	struct al_pcie_revx_w_last_wr last_wr;                 /* [0x23c] */
	struct al_pcie_rev3_w_atu atu;                         /* [0x240] */
	uint32_t rsrvd_2[8];
	struct al_pcie_rev3_w_cfg_func_ext cfg_func_ext;    /* [0x2e0] */
	struct al_pcie_rev3_w_app_hdr_interface_send app_hdr_interface_send;/* [0x2e4] */
	struct al_pcie_rev3_w_diag_command diag_command;    /* [0x300] */
	uint32_t rsrvd_3[3];
	struct al_pcie_rev3_w_soc_int_per_func soc_int_per_func[REV3_MAX_NUM_OF_PFS]; /* [0x310] */
	uint32_t rsrvd_4[44];
	struct al_pcie_rev3_w_events_gen_per_func events_gen_per_func[REV3_MAX_NUM_OF_PFS]; /* [0x490] */
	uint32_t rsrvd_5[4];
	struct al_pcie_rev3_w_pm_state_per_func pm_state_per_func[REV3_MAX_NUM_OF_PFS];/* [0x4b0] */
	uint32_t rsrvd_6[16];
	struct al_pcie_rev3_w_cfg_bars_ovrd cfg_bars_ovrd[REV3_MAX_NUM_OF_PFS]; /* [0x500] */
	uint32_t rsrvd_7[176];
	uint32_t rsrvd_8[16];
	struct al_pcie_revx_w_ap_err ap_err[5]; /* [0xac0] */
	uint32_t rsrvd_9[11];
	struct al_pcie_revx_w_status_per_func status_per_func[4]; /* [0xb00] */
	uint32_t rsrvd_10[316];
	struct al_pcie_revx_w_int_grp int_grp_a; /* [0x1000] */
	struct al_pcie_revx_w_int_grp int_grp_b; /* [0x1040] */
	struct al_pcie_revx_w_int_grp int_grp_c; /* [0x1080] */
	struct al_pcie_revx_w_int_grp int_grp_d; /* [0x10c0] */
};

/*
* Registers Fields
*/


/**** Port_Init register ****/
/* Enable port to start LTSSM Link Training */
#define PCIE_W_GLOBAL_CTRL_PORT_INIT_APP_LTSSM_EN_MASK (1 << 0)
#define PCIE_W_GLOBAL_CTRL_PORT_INIT_APP_LTSSM_EN_SHIFT (0)
/*
 * Device Type
 * Indicates the specific type of this PCIe Function. It is also used to set the
 * Device/Port Type field.
 * 4'b0000: PCIe Endpoint
 * 4'b0001: Legacy PCIe Endpoint
 * 4'b0100: Root Port of PCIe Root Complex
 * Must be programmed before link training sequence. According to the reset
 * strap
 */
#define PCIE_W_GLOBAL_CTRL_PORT_INIT_DEVICE_TYPE_MASK 0x000000F0
#define PCIE_W_GLOBAL_CTRL_PORT_INIT_DEVICE_TYPE_SHIFT 4
/*
 * Performs Manual Lane reversal for transmit Lanes.
 * Must be programmed before link training sequence.
 */
#define PCIE_W_GLOBAL_CTRL_PORT_INIT_TX_LANE_FLIP_EN (1 << 8)
/*
 * Performs Manual Lane reversal for receive Lanes.
 * Must be programmed before link training sequence.
 */
#define PCIE_W_GLOBAL_CTRL_PORT_INIT_RX_LANE_FLIP_EN (1 << 9)
/*
 * Auxiliary Power Detected
 * Indicates that auxiliary power (Vaux) is present. This one move to reset
 * strap from
 */
#define PCIE_W_GLOBAL_CTRL_PORT_INIT_SYS_AUX_PWR_DET_NOT_USE (1 << 10)

/**** Port_Status register ****/
/* PHY Link up/down indicator */
#define PCIE_W_GLOBAL_CTRL_PORT_STS_PHY_LINK_UP (1 << 0)
/*
 * Data Link Layer up/down indicator
 * This status from the Flow Control Initialization State Machine indicates that
 * Flow Control has been initiated and the Data Link Layer is ready to transmit
 * and receive packets.
 */
#define PCIE_W_GLOBAL_CTRL_PORT_STS_DL_LINK_UP (1 << 1)
/* Reset request due to link down status. */
#define PCIE_W_GLOBAL_CTRL_PORT_STS_LINK_REQ_RST (1 << 2)
/* Power management is in L0s state.. */
#define PCIE_W_GLOBAL_CTRL_PORT_STS_PM_LINKST_IN_L0S (1 << 3)
/* Power management is in L1 state. */
#define PCIE_W_GLOBAL_CTRL_PORT_STS_PM_LINKST_IN_L1 (1 << 4)
/* Power management is in L2 state. */
#define PCIE_W_GLOBAL_CTRL_PORT_STS_PM_LINKST_IN_L2 (1 << 5)
/* Power management is exiting L2 state. */
#define PCIE_W_GLOBAL_CTRL_PORT_STS_PM_LINKST_L2_EXIT (1 << 6)
/* Power state of the device. */
#define PCIE_W_GLOBAL_CTRL_PORT_STS_PM_DSTATE_MASK 0x00000380
#define PCIE_W_GLOBAL_CTRL_PORT_STS_PM_DSTATE_SHIFT 7
/* tie to zero. */
#define PCIE_W_GLOBAL_CTRL_PORT_STS_XMLH_IN_RL0S (1 << 10)
/* Timeout count before flush */
#define PCIE_W_GLOBAL_CTRL_PORT_STS_LINK_TOUT_FLUSH_NOT (1 << 11)
/* Segmentation buffer not empty  */
#define PCIE_W_GLOBAL_CTRL_PORT_STS_RADM_Q_NOT_EMPTY (1 << 12)
/*
 * Clock Turnoff Request
 * Allows clock generation module to turn off core_clk based on the current
 * power management state:
 * 0: core_clk is required to be active for the current power state.
 * 1: The current power state allows core_clk to be shut down.
 * This does not indicate the clock requirement for the PHY.
 */
#define PCIE_W_GLOBAL_CTRL_PORT_STS_CORE_CLK_REQ_N (1 << 31)

/**** PM_Control register ****/
/*
 * Wake Up. Used by application logic to wake up the PMC state machine from a
 * D1, D2, or D3 power state. EP mode only. Change the value from 0 to 1 to send
 * the message. Per function the upper bits are not use for ocie core less than
 * 8 functions
 */
#define PCIE_W_REV1_2_GLOBAL_CTRL_PM_CONTROL_PM_XMT_PME (1 << 0)
#define PCIE_W_REV3_GLOBAL_CTRL_PM_CONTROL_PM_XMT_PME_FUNC_MASK 0x000000FF
#define PCIE_W_REV3_GLOBAL_CTRL_PM_CONTROL_PM_XMT_PME_FUNC_SHIFT 0
/*
 * Request to Enter ASPM L1.
 * The core ignores the L1 entry request on app_req_entr_l1 when it is busy
 * processing a transaction.
 */
#define PCIE_W_REV1_2_GLOBAL_CTRL_PM_CONTROL_REQ_ENTR_L1 (1 << 3)
#define PCIE_W_REV3_GLOBAL_CTRL_PM_CONTROL_REQ_ENTR_L1 (1 << 8)
/*
 * Request to exit ASPM L1.
 * Only effective if L1 is enabled.
 */
#define PCIE_W_REV1_2_GLOBAL_CTRL_PM_CONTROL_REQ_EXIT_L1 (1 << 4)
#define PCIE_W_REV3_GLOBAL_CTRL_PM_CONTROL_REQ_EXIT_L1 (1 << 9)
/*
 * Indication that component is ready to enter the L23 state. The core delays
 * sending PM_Enter_L23 (in response to PM_Turn_Off) until this signal becomes
 * active.
 * EP mode
 */
#define PCIE_W_REV1_2_GLOBAL_CTRL_PM_CONTROL_READY_ENTR_L23 (1 << 5)
#define PCIE_W_REV3_GLOBAL_CTRL_PM_CONTROL_READY_ENTR_L23 (1 << 10)
/*
 * Request to generate a PM_Turn_Off Message to communicate transition to L2/L3
 * Ready state to downstream components. Host must wait PM_Turn_Off_Ack messages
 * acceptance RC mode.
 */
#define PCIE_W_REV1_2_GLOBAL_CTRL_PM_CONTROL_PM_XMT_TURNOFF (1 << 6)
#define PCIE_W_REV3_GLOBAL_CTRL_PM_CONTROL_PM_XMT_TURNOFF (1 << 11)
/*
 * Provides a capability to defer incoming Configuration Requests until
 * initialization is complete. When app_req_retry_en is asserted, the core
 * completes incoming Configuration Requests with a Configuration Request Retry
 * Status. Other incoming Requests complete with Unsupported Request status.
 */
#define PCIE_W_REV1_2_GLOBAL_CTRL_PM_CONTROL_APP_REQ_RETRY_EN (1 << 7)
#define PCIE_W_REV3_GLOBAL_CTRL_PM_CONTROL_APP_REQ_RETRY_EN (1 << 12)
/*
 * Core core gate enable
 * If set, core_clk is gated off whenever a clock turnoff request allows the
 * clock generation module to turn off core_clk (Port_Status.core_clk_req_n
 * field), and the PHY supports a request to disable clock gating. If not, the
 * core clock turns off in P2 mode in any case (PIPE).
 */
#define PCIE_W_GLOBAL_CTRL_PM_CONTROL_CORE_CLK_GATE (1 << 31)

/**** sris_kp_counter_value register ****/
/* skp counter when SRIS disable */
#define PCIE_W_GLOBAL_CTRL_SRIS_KP_COUNTER_VALUE_GEN3_NO_SRIS_MASK 0x000001FF
#define PCIE_W_GLOBAL_CTRL_SRIS_KP_COUNTER_VALUE_GEN3_NO_SRIS_SHIFT 0
/* skp counter when SRIS enable */
#define PCIE_W_GLOBAL_CTRL_SRIS_KP_COUNTER_VALUE_GEN3_SRIS_MASK 0x0003FE00
#define PCIE_W_GLOBAL_CTRL_SRIS_KP_COUNTER_VALUE_GEN3_SRIS_SHIFT 9
/* skp counter when SRIS enable for gen3 */
#define PCIE_W_GLOBAL_CTRL_SRIS_KP_COUNTER_VALUE_GEN21_SRIS_MASK 0x1FFC0000
#define PCIE_W_GLOBAL_CTRL_SRIS_KP_COUNTER_VALUE_GEN21_SRIS_SHIFT 18
/* mask the interrupt to the soc in case correctable error occur in the ARI.  */
#define PCIE_W_GLOBAL_CTRL_SRIS_KP_COUNTER_VALUE_RSRVD_MASK 0x60000000
#define PCIE_W_GLOBAL_CTRL_SRIS_KP_COUNTER_VALUE_RSRVD_SHIFT 29
/* not in use in the pcie_x8 core. */
#define PCIE_W_GLOBAL_CTRL_SRIS_KP_COUNTER_VALUE_PCIE_X4_SRIS_EN (1 << 31)

/**** Events_Gen register ****/
/* INT_D. Not supported  */
#define PCIE_W_GLOBAL_CTRL_EVENTS_GEN_ASSERT_INTD (1 << 0)
/* INT_C. Not supported  */
#define PCIE_W_GLOBAL_CTRL_EVENTS_GEN_ASSERT_INTC (1 << 1)
/* INT_B. Not supported  */
#define PCIE_W_GLOBAL_CTRL_EVENTS_GEN_ASSERT_INTB (1 << 2)
/* Transmit INT_A Interrupt ControlEvery transition from 0 to 1  ... */
#define PCIE_W_GLOBAL_CTRL_EVENTS_GEN_ASSERT_INTA (1 << 3)
/* A request to generate an outbound MSI interrupt when MSI is e ... */
#define PCIE_W_GLOBAL_CTRL_EVENTS_GEN_MSI_TRNS_REQ (1 << 4)
/* Set the MSI vector before issuing msi_trans_req. */
#define PCIE_W_GLOBAL_CTRL_EVENTS_GEN_MSI_VECTOR_MASK 0x000003E0
#define PCIE_W_GLOBAL_CTRL_EVENTS_GEN_MSI_VECTOR_SHIFT 5
/* The application requests hot reset to a downstream device */
#define PCIE_W_GLOBAL_CTRL_EVENTS_GEN_APP_RST_INIT (1 << 10)
/* The application request unlock message to be sent */
#define PCIE_W_GLOBAL_CTRL_EVENTS_GEN_UNLOCK_GEN (1 << 30)
/* Indicates that FLR on a Physical Function has been completed */
#define PCIE_W_GLOBAL_CTRL_EVENTS_GEN_FLR_PF_DONE (1 << 31)

/**** Cpl_TO_Info register ****/
/* The Traffic Class of the timed out CPL */
#define PCIE_W_LCL_LOG_CPL_TO_INFO_TC_MASK 0x00000003
#define PCIE_W_LCL_LOG_CPL_TO_INFO_TC_SHIFT 0
/* Indicates which Virtual Function (VF) had a CPL timeout */
#define PCIE_W_LCL_LOG_CPL_TO_INFO_FUN_NUM_MASK 0x000000FC
#define PCIE_W_LCL_LOG_CPL_TO_INFO_FUN_NUM_SHIFT 2
/* The Tag field of the timed out CPL */
#define PCIE_W_LCL_LOG_CPL_TO_INFO_TAG_MASK 0x0000FF00
#define PCIE_W_LCL_LOG_CPL_TO_INFO_TAG_SHIFT 8
/* The Attributes field of the timed out CPL */
#define PCIE_W_LCL_LOG_CPL_TO_INFO_ATTR_MASK 0x00030000
#define PCIE_W_LCL_LOG_CPL_TO_INFO_ATTR_SHIFT 16
/* The Len field of the timed out CPL */
#define PCIE_W_LCL_LOG_CPL_TO_INFO_LEN_MASK 0x3FFC0000
#define PCIE_W_LCL_LOG_CPL_TO_INFO_LEN_SHIFT 18
/*
 * Write 1 to this field to clear the information logged in the register. New
 * logged information will only be valid when the interrupt is cleared .
 */
#define PCIE_W_LCL_LOG_CPL_TO_INFO_VALID (1 << 31)
#define PCIE_W_LCL_LOG_CPL_TO_INFO_VALID_SHIFT (31)

/**** Rcv_Msg0_0 register ****/
/* The Requester ID of the received message */
#define PCIE_W_LCL_LOG_RCV_MSG0_0_REQ_ID_MASK 0x0000FFFF
#define PCIE_W_LCL_LOG_RCV_MSG0_0_REQ_ID_SHIFT 0
/*
 * Valid logged message
 * Writing 1 to this bit enables new message capturing. Write one to clear
 */
#define PCIE_W_LCL_LOG_RCV_MSG0_0_VALID (1 << 31)

/**** Rcv_Msg1_0 register ****/
/* The Requester ID of the received message */
#define PCIE_W_LCL_LOG_RCV_MSG1_0_REQ_ID_MASK 0x0000FFFF
#define PCIE_W_LCL_LOG_RCV_MSG1_0_REQ_ID_SHIFT 0
/*
 * Valid logged message
 * Writing 1 to this bit enables new message capturing. Write one to clear
 */
#define PCIE_W_LCL_LOG_RCV_MSG1_0_VALID (1 << 31)

/**** Core_Queues_Status register ****/
/*
 * Indicates which entries in the CPL lookup table
 * have valid entries stored. NOT supported.
 */
#define PCIE_W_LCL_LOG_CORE_Q_STATUS_CPL_LUT_VALID_MASK 0x0000FFFF
#define PCIE_W_LCL_LOG_CORE_Q_STATUS_CPL_LUT_VALID_SHIFT 0

/**** Cpl_to register ****/
#define PCIE_W_LCL_LOG_CPL_TO_REQID_MASK 0x0000FFFF
#define PCIE_W_LCL_LOG_CPL_TO_REQID_SHIFT 0

/**** Debug_Info_0 register ****/
/* Indicates the current power state */
#define PCIE_W_DEBUG_INFO_0_PM_CURRENT_STATE_MASK 0x00000007
#define PCIE_W_DEBUG_INFO_0_PM_CURRENT_STATE_SHIFT 0
/* Current state of the LTSSM */
#define PCIE_W_DEBUG_INFO_0_LTSSM_STATE_MASK 0x000001F8
#define PCIE_W_DEBUG_INFO_0_LTSSM_STATE_SHIFT 3
/* Decode of the Recovery. Equalization LTSSM state */
#define PCIE_W_DEBUG_INFO_0_LTSSM_STATE_RCVRY_EQ (1 << 9)
/* State of selected internal signals, for debug purposes only */
#define PCIE_W_DEBUG_INFO_0_CXPL_DEBUG_INFO_EI_MASK 0x03FFFC00
#define PCIE_W_DEBUG_INFO_0_CXPL_DEBUG_INFO_EI_SHIFT 10

/**** control register ****/
/* Indication to send vendor message; when clear the message was sent. */
#define PCIE_W_OB_VEN_MSG_CONTROL_REQ (1 << 0)

/**** param_1 register ****/
/* Vendor message parameters */
#define PCIE_W_OB_VEN_MSG_PARAM_1_FMT_MASK 0x00000003
#define PCIE_W_OB_VEN_MSG_PARAM_1_FMT_SHIFT 0
/* Vendor message parameters */
#define PCIE_W_OB_VEN_MSG_PARAM_1_TYPE_MASK 0x0000007C
#define PCIE_W_OB_VEN_MSG_PARAM_1_TYPE_SHIFT 2
/* Vendor message parameters */
#define PCIE_W_OB_VEN_MSG_PARAM_1_TC_MASK 0x00000380
#define PCIE_W_OB_VEN_MSG_PARAM_1_TC_SHIFT 7
/* Vendor message parameters */
#define PCIE_W_OB_VEN_MSG_PARAM_1_TD (1 << 10)
/* Vendor message parameters */
#define PCIE_W_OB_VEN_MSG_PARAM_1_EP (1 << 11)
/* Vendor message parameters */
#define PCIE_W_OB_VEN_MSG_PARAM_1_ATTR_MASK 0x00003000
#define PCIE_W_OB_VEN_MSG_PARAM_1_ATTR_SHIFT 12
/* Vendor message parameters */
#define PCIE_W_OB_VEN_MSG_PARAM_1_LEN_MASK 0x00FFC000
#define PCIE_W_OB_VEN_MSG_PARAM_1_LEN_SHIFT 14
/* Vendor message parameters */
#define PCIE_W_OB_VEN_MSG_PARAM_1_TAG_MASK 0xFF000000
#define PCIE_W_OB_VEN_MSG_PARAM_1_TAG_SHIFT 24

/**** param_2 register ****/
/* Vendor message parameters */
#define PCIE_W_OB_VEN_MSG_PARAM_2_REQ_ID_MASK 0x0000FFFF
#define PCIE_W_OB_VEN_MSG_PARAM_2_REQ_ID_SHIFT 0
/* Vendor message parameters */
#define PCIE_W_OB_VEN_MSG_PARAM_2_CODE_MASK 0x00FF0000
#define PCIE_W_OB_VEN_MSG_PARAM_2_CODE_SHIFT 16
/* Vendor message parameters */
#define PCIE_W_OB_VEN_MSG_PARAM_2_RSVD_31_24_MASK 0xFF000000
#define PCIE_W_OB_VEN_MSG_PARAM_2_RSVD_31_24_SHIFT 24

/**** ack_info register ****/
/* Vendor message parameters */
#define PCIE_W_AP_USER_SEND_MSG_ACK_INFO_ACK (1 << 0)

/**** features register ****/
/* Enable MSI fix from the SATA to the PCIe EP - Only valid for port zero */
#define PCIE_W_CTRL_GEN_FEATURES_SATA_EP_MSI_FIX	AL_BIT(16)

/**** in/out_mask_x_y register ****/
/* When bit [i] set to 1 it maks the compare in the atu_in/out wind ... */
#define PCIE_W_ATU_MASK_EVEN_ODD_ATU_MASK_40_32_EVEN_MASK 0x0000FFFF
#define PCIE_W_ATU_MASK_EVEN_ODD_ATU_MASK_40_32_EVEN_SHIFT 0
/* When bit [i] set to 1 it maks the compare in the atu_in/out wind ... */
#define PCIE_W_ATU_MASK_EVEN_ODD_ATU_MASK_40_32_ODD_MASK 0xFFFF0000
#define PCIE_W_ATU_MASK_EVEN_ODD_ATU_MASK_40_32_ODD_SHIFT 16

/**** cfg register ****/
/*
 * The 2-bit TPH Requester Enabled field of each TPH
 * Requester Control register.
 */
#define PCIE_W_CFG_FUNC_EXT_CFG_CFG_TPH_REQ_EN_MASK 0x000000FF
#define PCIE_W_CFG_FUNC_EXT_CFG_CFG_TPH_REQ_EN_SHIFT 0
/* SRIS mode enable. */
#define PCIE_W_CFG_FUNC_EXT_CFG_APP_SRIS_MODE (1 << 8)
/*
 *
 */
#define PCIE_W_CFG_FUNC_EXT_CFG_RSRVD_MASK 0xFFFFFE00
#define PCIE_W_CFG_FUNC_EXT_CFG_RSRVD_SHIFT 9

/**** app_func_num_advisory register ****/
/*
 * The number of the function that is reporting the error
 * indicated app_err_bus, valid when app_hdr_valid is asserted.
 * Correctable and Uncorrected Internal errors (app_err_bus[10:9]) are
 * not function specific, and are recorded for all physical functions,
 * regardless of the value this bus. Function numbering starts at '0'.
 */
#define PCIE_W_APP_HDR_INTERFACE_SEND_APP_FUNC_NUM_ADVISORY_APP_ERR_FUNC_NUM_MASK 0x0000FFFF
#define PCIE_W_APP_HDR_INTERFACE_SEND_APP_FUNC_NUM_ADVISORY_APP_ERR_FUNC_NUM_SHIFT 0
/*
 * Description: Indicates that your application error is an advisory
 * error. Your application should assert app_err_advisory under either
 * of the following conditions:
 * - The core is configured to mask completion timeout errors, your
 * application is reporting a completion timeout error app_err_bus,
 * and your application intends to resend the request. In such cases
 * the error is an advisory error, as described in PCI Express 3.0
 * Specification. When your application does not intend to resend
 * the request, then your application must keep app_err_advisory
 * de-asserted when reporting a completion timeout error.
 * - The core is configured to forward poisoned TLPs to your
 * application and your application is going to treat the poisoned
 * TLP as a normal TLP, as described in PCI Express 3.0
 * Specification. Upon receipt of a poisoned TLP, your application
 * must report the error app_err_bus, and either assert
 * app_err_advisory (to indicate an advisory error) or de-assert
 * app_err_advisory (to indicate that your application is dropping the
 * TLP).
 * For more details, see the PCI Express 3.0 Specification to determine
 * when an application error is an advisory error.
 */
#define PCIE_W_APP_HDR_INTERFACE_SEND_APP_FUNC_NUM_ADVISORY_APP_ERR_ADVISORY (1 << 16)
/*
 * Rsrvd.
 */
#define PCIE_W_APP_HDR_INTERFACE_SEND_APP_FUNC_NUM_ADVISORY_RSRVD_MASK 0xFFFE0000
#define PCIE_W_APP_HDR_INTERFACE_SEND_APP_FUNC_NUM_ADVISORY_RSRVD_SHIFT 17

/**** app_hdr_cmd register ****/
/*
 * When set the header is send (need to clear before sending the next message).
 */
#define PCIE_W_APP_HDR_INTERFACE_SEND_APP_HDR_CMD_APP_HDR_VALID (1 << 0)
/*
 * Rsrvd.
 */
#define PCIE_W_APP_HDR_INTERFACE_SEND_APP_HDR_CMD_RSRVD_MASK 0xFFFFFFFE
#define PCIE_W_APP_HDR_INTERFACE_SEND_APP_HDR_CMD_RSRVD_SHIFT 1

/**** diag_ctrl register ****/
/*
 * The 2-bit TPH Requester Enabled field of each TPH
 * Requester Control register.
 */
#define PCIE_W_DIAG_COMMAND_DIAG_CTRL_DIAG_CTRL_BUS_MASK 0x00000007
#define PCIE_W_DIAG_COMMAND_DIAG_CTRL_DIAG_CTRL_BUS_SHIFT 0
/*
 *
 */
#define PCIE_W_DIAG_COMMAND_DIAG_CTRL_RSRVD_MASK 0xFFFFFFF8
#define PCIE_W_DIAG_COMMAND_DIAG_CTRL_RSRVD_SHIFT 3


/**** Events_Gen register ****/
/* INT_D. Not supported  */
#define PCIE_W_GLOBAL_CTRL_EVENTS_GEN_ASSERT_INTD (1 << 0)
/* INT_C. Not supported  */
#define PCIE_W_GLOBAL_CTRL_EVENTS_GEN_ASSERT_INTC (1 << 1)
/* INT_B. Not supported  */
#define PCIE_W_GLOBAL_CTRL_EVENTS_GEN_ASSERT_INTB (1 << 2)
/*
 * Transmit INT_A Interrupt Control
 * Every transition from 0 to 1 schedules an Assert_ INT interrupt message for
 * transmit.
 * Every transition from 1 to 0, schedules a Deassert_INT interrupt message for
 * transmit. Which interrupt, the PCIe only use INTA message.
 */
#define PCIE_W_GLOBAL_CTRL_EVENTS_GEN_ASSERT_INTA (1 << 3)
/*
 * A request to generate an outbound MSI interrupt when MSI is enabled. Change
 * from 1'b0 to 1'b1 to create an MSI write to be sent.
 */
#define PCIE_W_GLOBAL_CTRL_EVENTS_GEN_MSI_TRNS_REQ (1 << 4)
/* Set the MSI vector before issuing msi_trans_req. */
#define PCIE_W_GLOBAL_CTRL_EVENTS_GEN_MSI_VECTOR_MASK 0x000003E0
#define PCIE_W_GLOBAL_CTRL_EVENTS_GEN_MSI_VECTOR_SHIFT 5
/*
 * The application requests hot reset to a downstream device. Change the value
 * from 0 to 1 to send hot reset. Only func 0 is supported.
 */
#define PCIE_W_GLOBAL_CTRL_EVENTS_GEN_APP_RST_INIT (1 << 10)
/*
 * The application request unlock message to be sent. Change the value from 0 to
 * 1 to send the message. Only func 0 is supported.
 */
#define PCIE_W_GLOBAL_CTRL_EVENTS_GEN_UNLOCK_GEN (1 << 30)
/* Indicates that FLR on a Physical Function has been completed. */
#define PCIE_W_GLOBAL_CTRL_EVENTS_GEN_FLR_PF_DONE (1 << 31)

/**** pm_state_per_func register ****/
/*
 * Description: The current power management D-state of the
 * function:
 * \u25a0 000b: D0
 * \u25a0 001b: D1
 * \u25a0 010b: D2
 * \u25a0 011b: D3
 * \u25a0 100b: Uninitialized
 * \u25a0 Other values: Not applicable
 * There are 3 bits of pm_dstate for each configured function.
 */
#define PCIE_W_PM_STATE_PER_FUNC_PM_STATE_PER_FUNC_PM_DSTATE_MASK 0x0000000F
#define PCIE_W_PM_STATE_PER_FUNC_PM_STATE_PER_FUNC_PM_DSTATE_SHIFT 0
/*
 * PME Status bit from the PMCSR. There is 1 bit of
 * pm_status for each configured function
 */
#define PCIE_W_PM_STATE_PER_FUNC_PM_STATE_PER_FUNC_PM_STATUS (1 << 4)
/*
 * PME Enable bit in the PMCSR. There is 1 bit of
 * pm_pme_en for each configured function.
 */
#define PCIE_W_PM_STATE_PER_FUNC_PM_STATE_PER_FUNC_PM_PME_EN (1 << 5)
/*
 * Auxiliary Power Enable bit in the Device Control
 * register. There is 1 bit of aux_pm_en for each configured function.
 */
#define PCIE_W_PM_STATE_PER_FUNC_PM_STATE_PER_FUNC_AUX_PME_EN (1 << 6)
/*
 * This field should be set according to the MAX_FUNC_NUM set in the PCIe core,
 * it uses as mask (bit per function) to the dsate when set to zero.
 */
#define PCIE_W_PM_STATE_PER_FUNC_PM_STATE_PER_FUNC_ASPM_PF_ENABLE_MAX_FUNC_NUMBER (1 << 7)
/*
 * This field should be set according to the MAX_FUNC_NUM set in the PCIe core,
 * it uses as mask (bit per function) to the ASPM contrl bit, when set to zero.
 */
#define PCIE_W_PM_STATE_PER_FUNC_PM_STATE_PER_FUNC_DSATE_PF_ENABLE_MAX_FUNC_NUMBER (1 << 8)

/**** bar0_ctrl register ****/
/* bar is en and override the internal PF bar. */
#define PCIE_W_CFG_BARS_OVRD_BAR0_CTRL_BAR_EN_MASK 0x00000003
#define PCIE_W_CFG_BARS_OVRD_BAR0_CTRL_BAR_EN_SHIFT 0
/* bar is io */
#define PCIE_W_CFG_BARS_OVRD_BAR0_CTRL_BAR_IO_MASK 0x0000000C
#define PCIE_W_CFG_BARS_OVRD_BAR0_CTRL_BAR_IO_SHIFT 2
/* Reserved. */
#define PCIE_W_CFG_BARS_OVRD_BAR0_CTRL_RSRVS_MASK 0xFFFFFFF0
#define PCIE_W_CFG_BARS_OVRD_BAR0_CTRL_RSRVS_SHIFT 4

/**** bar1_ctrl register ****/
/* bar is en and override the internal PF bar. */
#define PCIE_W_CFG_BARS_OVRD_BAR1_CTRL_BAR_EN_MASK 0x00000003
#define PCIE_W_CFG_BARS_OVRD_BAR1_CTRL_BAR_EN_SHIFT 0
/* bar is io */
#define PCIE_W_CFG_BARS_OVRD_BAR1_CTRL_BAR_IO_MASK 0x0000000C
#define PCIE_W_CFG_BARS_OVRD_BAR1_CTRL_BAR_IO_SHIFT 2
/* Reserved. */
#define PCIE_W_CFG_BARS_OVRD_BAR1_CTRL_RSRVS_MASK 0xFFFFFFF0
#define PCIE_W_CFG_BARS_OVRD_BAR1_CTRL_RSRVS_SHIFT 4

/**** bar2_ctrl register ****/
/* bar is en and override the internal PF bar. */
#define PCIE_W_CFG_BARS_OVRD_BAR2_CTRL_BAR_EN_MASK 0x00000003
#define PCIE_W_CFG_BARS_OVRD_BAR2_CTRL_BAR_EN_SHIFT 0
/* bar is io */
#define PCIE_W_CFG_BARS_OVRD_BAR2_CTRL_BAR_IO_MASK 0x0000000C
#define PCIE_W_CFG_BARS_OVRD_BAR2_CTRL_BAR_IO_SHIFT 2
/* Reserved. */
#define PCIE_W_CFG_BARS_OVRD_BAR2_CTRL_RSRVS_MASK 0xFFFFFFF0
#define PCIE_W_CFG_BARS_OVRD_BAR2_CTRL_RSRVS_SHIFT 4

/**** bar3_ctrl register ****/
/* bar is en and override the internal PF bar. */
#define PCIE_W_CFG_BARS_OVRD_BAR3_CTRL_BAR_EN_MASK 0x00000003
#define PCIE_W_CFG_BARS_OVRD_BAR3_CTRL_BAR_EN_SHIFT 0
/* bar is io */
#define PCIE_W_CFG_BARS_OVRD_BAR3_CTRL_BAR_IO_MASK 0x0000000C
#define PCIE_W_CFG_BARS_OVRD_BAR3_CTRL_BAR_IO_SHIFT 2
/* Reserved. */
#define PCIE_W_CFG_BARS_OVRD_BAR3_CTRL_RSRVS_MASK 0xFFFFFFF0
#define PCIE_W_CFG_BARS_OVRD_BAR3_CTRL_RSRVS_SHIFT 4

/**** bar4_ctrl register ****/
/* bar is en and override the internal PF bar. */
#define PCIE_W_CFG_BARS_OVRD_BAR4_CTRL_BAR_EN_MASK 0x00000003
#define PCIE_W_CFG_BARS_OVRD_BAR4_CTRL_BAR_EN_SHIFT 0
/* bar is io */
#define PCIE_W_CFG_BARS_OVRD_BAR4_CTRL_BAR_IO_MASK 0x0000000C
#define PCIE_W_CFG_BARS_OVRD_BAR4_CTRL_BAR_IO_SHIFT 2
/* Reserved. */
#define PCIE_W_CFG_BARS_OVRD_BAR4_CTRL_RSRVS_MASK 0xFFFFFFF0
#define PCIE_W_CFG_BARS_OVRD_BAR4_CTRL_RSRVS_SHIFT 4

/**** bar5_ctrl register ****/
/* bar is en and override the internal PF bar. */
#define PCIE_W_CFG_BARS_OVRD_BAR5_CTRL_BAR_EN_MASK 0x00000003
#define PCIE_W_CFG_BARS_OVRD_BAR5_CTRL_BAR_EN_SHIFT 0
/* bar is io */
#define PCIE_W_CFG_BARS_OVRD_BAR5_CTRL_BAR_IO_MASK 0x0000000C
#define PCIE_W_CFG_BARS_OVRD_BAR5_CTRL_BAR_IO_SHIFT 2
/* Reserved. */
#define PCIE_W_CFG_BARS_OVRD_BAR5_CTRL_RSRVS_MASK 0xFFFFFFF0
#define PCIE_W_CFG_BARS_OVRD_BAR5_CTRL_RSRVS_SHIFT 4

/**** cause_A register ****/
/* Deassert_INTD received. Write zero to clear this bit. */
#define PCIE_W_INT_GRP_A_CAUSE_A_DEASSERT_INTD (1 << 0)
/* Deassert_INTC received. Write zero to clear this bit. */
#define PCIE_W_INT_GRP_A_CAUSE_A_DEASSERT_INTC (1 << 1)
/* Deassert_INTB received. Write zero to clear this bit. */
#define PCIE_W_INT_GRP_A_CAUSE_A_DEASSERT_INTB (1 << 2)
/* Deassert_INTA received. Write zero to clear this bit. */
#define PCIE_W_INT_GRP_A_CAUSE_A_DEASSERT_INTA (1 << 3)
/* Assert_INTD received. Write zero to clear this bit. */
#define PCIE_W_INT_GRP_A_CAUSE_A_ASSERT_INTD (1 << 4)
/* Assert_INTC received. Write zero to clear this bit. */
#define PCIE_W_INT_GRP_A_CAUSE_A_ASSERT_INTC (1 << 5)
/* Assert_INTC received. Write zero to clear this bit. */
#define PCIE_W_INT_GRP_A_CAUSE_A_ASSERT_INTB (1 << 6)
/* Assert_INTA received. Write zero to clear this bit. */
#define PCIE_W_INT_GRP_A_CAUSE_A_ASSERT_INTA (1 << 7)
/*
 * MSI Controller Interrupt
 * MSI interrupt is being received. Write zero to clear this bit
 */
#define PCIE_W_INT_GRP_A_CAUSE_A_MSI_CNTR_RCV_INT (1 << 8)
/*
 * MSI sent grant. Write zero to clear this bit.
 */
#define PCIE_W_INT_GRP_A_CAUSE_A_MSI_TRNS_GNT (1 << 9)
/*
 * System error detected
 * Indicates if any device in the hierarchy reports any of the following errors
 * and the associated enable bit is set in the Root Control register:
 * ERR_COR
 * ERR_FATAL
 * ERR_NONFATAL
 * Also asserted when an internal error is detected. Write zero to clear this
 * bit.
 */
#define PCIE_W_INT_GRP_A_CAUSE_A_SYS_ERR_RC (1 << 10)
/*
 * Set when software initiates FLR on a Physical Function by writing to the
 * Initiate FLR register bit of that function Write zero to clear this bit.
 */
#define PCIE_W_REV1_2_INT_GRP_A_CAUSE_A_FLR_PF_ACTIVE (1 << 11)
#define PCIE_W_REV3_INT_GRP_A_CAUSE_A_RSRVD_11 (1 << 11)
/*
 * Reported error condition causes a bit to be set in the Root Error Status
 * register and the associated error message reporting enable bit is set in the
 * Root Error Command Register. Write zero to clear this bit.
 */
#define PCIE_W_REV1_2_INT_GRP_A_CAUSE_A_AER_RC_ERR (1 << 12)
#define PCIE_W_REV3_INT_GRP_A_CAUSE_A_RSRVD_12 (1 << 12)
/*
 * The core asserts aer_rc_err_msi when all of the following conditions are
 * true:
 * - MSI or MSI-X is enabled.
 * - A reported error condition causes a bit to be set in the Root Error Status
 * register.
 * - The associated error message reporting enable bit is set in the Root Error
 * Command register Write zero to clear this bit
 */
#define PCIE_W_REV1_2_INT_GRP_A_CAUSE_A_AER_RC_ERR_MSI (1 << 13)
#define PCIE_W_REV3_INT_GRP_A_CAUSE_A_RSRVD_13 (1 << 13)
/*
 * Wake Up. Wake up from power management unit.
 * The core generates wake to request the system to restore power and clock when
 * a beacon has been detected. wake is an active high signal and its rising edge
 * should be detected to drive the WAKE# on the connector Write zero to clear
 * this bit
 */
#define PCIE_W_INT_GRP_A_CAUSE_A_WAKE (1 << 14)
/*
 * The core asserts cfg_pme_int when all of the following conditions are true:
 * - INTx Assertion Disable bit in the Command register is 0.
 * - PME Interrupt Enable bit in the Root Control register is set to 1.
 * - PME Status bit in the Root Status register is set to 1. Write zero to clear
 * this bit
 */
#define PCIE_W_REV1_2_INT_GRP_A_CAUSE_A_PME_INT (1 << 15)
#define PCIE_W_REV3_INT_GRP_A_CAUSE_A_RSRVD_15 (1 << 15)
/*
 * The core asserts cfg_pme_msi when all of the following conditions are true:
 * - MSI or MSI-X is enabled.
 * - PME Interrupt Enable bit in the Root Control register is set to 1.
 * - PME Status bit in the Root Status register is set to 1. Write zero to clear
 * this bit
 */
#define PCIE_W_REV1_2_INT_GRP_A_CAUSE_A_PME_MSI (1 << 16)
#define PCIE_W_REV3_INT_GRP_A_CAUSE_A_RSRVD_16 (1 << 16)
/*
 * The core asserts hp_pme when all of the following conditions are true:
 * - The PME Enable bit in the Power Management Control and Status register is
 * set to 1.
 * - Any bit in the Slot Status register transitions from 0 to 1 and the
 * associated event notification is enabled in the Slot Control register. Write
 * zero to clear this bit
 */
#define PCIE_W_INT_GRP_A_CAUSE_A_HP_PME (1 << 17)
/*
 * The core asserts hp_int when all of the following conditions are true:
 * - INTx Assertion Disable bit in the Command register is 0.
 * - Hot-Plug interrupts are enabled in the Slot Control register.
 * - Any bit in the Slot Status register is equal to 1, and the associated event
 * notification is enabled in the Slot Control register. Write zero to clear
 * this bit
 */
#define PCIE_W_REV1_2_INT_GRP_A_CAUSE_A_HP_INT (1 << 18)
/* The outstanding write counter become  full should never happen */
#define PCIE_W_REV3_INT_GRP_A_CAUSE_A_WRITE_COUNTER_FULL_ERR (1 << 18)


/*
 * The core asserts hp_msi when the logical AND of the following conditions
 * transitions from false to true:
 * - MSI or MSI-X is enabled.
 * - Hot-Plug interrupts are enabled in the Slot Control register.
 * - Any bit in the Slot Status register transitions from 0 to 1 and the
 * associated event notification is enabled in the Slot Control register.
 */
#define PCIE_W_INT_GRP_A_CAUSE_A_HP_MSI (1 << 19)
/* Read VPD registers notification */
#define PCIE_W_REV1_2_INT_GRP_A_CAUSE_A_VPD_INT (1 << 20)
/* not use */
#define PCIE_W_REV3_INT_GRP_A_CAUSE_A_NOT_USE (1 << 20)

/*
 * The core assert link down event, whenever the link is going down. Write zero
 * to clear this bit, pulse signal
 */
#define PCIE_W_INT_GRP_A_CAUSE_A_LINK_DOWN_EVENT (1 << 21)
/*
 * When the EP gets a command to shut down, signal the software to block any new
 * TLP.
 */
#define PCIE_W_INT_GRP_A_CAUSE_A_PM_XTLH_BLOCK_TLP (1 << 22)
/* PHY/MAC link up */
#define PCIE_W_INT_GRP_A_CAUSE_A_XMLH_LINK_UP (1 << 23)
/* Data link up */
#define PCIE_W_INT_GRP_A_CAUSE_A_RDLH_LINK_UP (1 << 24)
/* The ltssm is in RCVRY_LOCK state. */
#define PCIE_W_INT_GRP_A_CAUSE_A_LTSSM_RCVRY_STATE (1 << 25)
/*
 * Config write transaction to the config space by the RC peer, enable this
 * interrupt only for EP mode.
 */
#define PCIE_W_INT_GRP_A_CAUSE_A_CFG_WR_EVENT (1 << 26)
/* AER error */
#define PCIE_W_INT_GRP_A_CAUSE_A_AP_PENDED_CORR_ERR_STS_INT (1 << 28)
/* AER error */
#define PCIE_W_INT_GRP_A_CAUSE_A_AP_PENDED_UNCORR_ERR_STS_INT (1 << 29)

/**** control_A register ****/
/* When Clear_on_Read =1, all bits of  Cause register are cleared on read. */
#define PCIE_W_INT_GRP_A_CONTROL_A_CLEAR_ON_READ (1 << 0)
/*
 * (Must be set only when MSIX is enabled.)
 * When Auto-Mask =1 and an MSI-X ACK for this bit is received, its
 * corresponding bit in the Mask register is set, masking future interrupts.
 */
#define PCIE_W_INT_GRP_A_CONTROL_A_AUTO_MASK (1 << 1)
/*
 * Auto_Clear (RW)
 * When Auto-Clear =1, the bits in the Interrupt Cause register are auto-cleared
 * after MSI-X is acknowledged. Must be used only if MSI-X is enabled.
 */
#define PCIE_W_INT_GRP_A_CONTROL_A_AUTO_CLEAR (1 << 2)
/*
 * When Set_on_Posedge =1, the bits in the Interrupt Cause register are set on
 * the posedge of the interrupt source, i.e., when interrupt source =1 and
 * Interrupt Status = 0.
 * When Set_on_Posedge =0, the bits in the Interrupt Cause register are set when
 * interrupt source =1.
 */
#define PCIE_W_INT_GRP_A_CONTROL_A_SET_ON_POSEDGE (1 << 3)
/*
 * When Moderation_Reset =1, all Moderation timers associated with the interrupt
 * cause bits are cleared to 0, enabling immediate interrupt assertion if any
 * unmasked cause bit is set to 1. This bit is self-negated.
 */
#define PCIE_W_INT_GRP_A_CONTROL_A_MOD_RST (1 << 4)
/*
 * When mask_msi_x =1, no MSI-X from this group is sent. This bit must be set to
 * 1 when the associated summary bit in this group is used to generate a single
 * MSI-X for this group.
 */
#define PCIE_W_INT_GRP_A_CONTROL_A_MASK_MSI_X (1 << 5)
/* MSI-X AWID value. Same ID for all cause bits. */
#define PCIE_W_INT_GRP_A_CONTROL_A_AWID_MASK 0x00000F00
#define PCIE_W_INT_GRP_A_CONTROL_A_AWID_SHIFT 8
/*
 * This value determines the interval between interrupts; writing ZERO disables
 * Moderation.
 */
#define PCIE_W_INT_GRP_A_CONTROL_A_MOD_INTV_MASK 0x00FF0000
#define PCIE_W_INT_GRP_A_CONTROL_A_MOD_INTV_SHIFT 16
/*
 * This value determines the Moderation_Timer_Clock speed.
 * 0- Moderation-timer is decremented every 1x256 SB clock cycles ~1uS.
 * 1- Moderation-timer is decremented every 2x256 SB clock cycles ~2uS.
 * N- Moderation-timer is decremented every Nx256 SB clock cycles ~(N+1) uS.
 */
#define PCIE_W_INT_GRP_A_CONTROL_A_MOD_RES_MASK 0x0F000000
#define PCIE_W_INT_GRP_A_CONTROL_A_MOD_RES_SHIFT 24

/**** cause_B register ****/
/* Indicates that the core received a PM_PME Message. Write Zero to clear. */
#define PCIE_W_INT_GRP_B_CAUSE_B_MSG_PM_PME (1 << 0)
/*
 * Indicates that the core received a PME_TO_Ack Message. Write Zero to clear.
 */
#define PCIE_W_INT_GRP_B_CAUSE_B_MSG_PM_TO_ACK (1 << 1)
/*
 * Indicates that the core received an PME_Turn_Off Message. Write Zero to
 * clear.
 * EP mode only
 */
#define PCIE_W_INT_GRP_B_CAUSE_B_MSG_PM_TURNOFF (1 << 2)
/* Indicates that the core received an ERR_CORR Message. Write Zero to clear. */
#define PCIE_W_INT_GRP_B_CAUSE_B_MSG_CORRECTABLE_ERR (1 << 3)
/*
 * Indicates that the core received an ERR_NONFATAL Message. Write Zero to
 * clear.
 */
#define PCIE_W_INT_GRP_B_CAUSE_B_MSG_NONFATAL_ERR (1 << 4)
/*
 * Indicates that the core received an ERR_FATAL Message. Write Zero to clear.
 */
#define PCIE_W_INT_GRP_B_CAUSE_B_MSG_FATAL_ERR (1 << 5)
/*
 * Indicates that the core received a Vendor Defined Message. Write Zero to
 * clear.
 */
#define PCIE_W_INT_GRP_B_CAUSE_B_MSG_VENDOR_0 (1 << 6)
/*
 * Indicates that the core received a Vendor Defined Message. Write Zero to
 * clear.
 */
#define PCIE_W_INT_GRP_B_CAUSE_B_MSG_VENDOR_1 (1 << 7)
/* Indicates that the core received an Unlock Message. Write Zero to clear. */
#define PCIE_W_INT_GRP_B_CAUSE_B_MSG_UNLOCK (1 << 8)
/*
 * Notification when the Link Autonomous Bandwidth Status register (Link Status
 * register bit 15) is updated and the Link Autonomous Bandwidth Interrupt
 * Enable (Link Control register bit 11) is set. This bit is not applicable to,
 * and is reserved, for Endpoint device. Write Zero to clear
 */
#define PCIE_W_INT_GRP_B_CAUSE_B_LINK_AUTO_BW_INT (1 << 12)
/*
 * Notification that the Link Equalization Request bit in the Link Status 2
 * Register has been set. Write Zero to clear.
 */
#define PCIE_W_INT_GRP_B_CAUSE_B_LINK_EQ_REQ_INT (1 << 13)
/*
 * OB Vendor message request is granted by the PCIe core Write Zero to clear.
 */
#define PCIE_W_INT_GRP_B_CAUSE_B_VENDOR_MSG_GRANT (1 << 14)
/* CPL timeout from the PCIe core inidication. Write Zero to clear */
#define PCIE_W_INT_GRP_B_CAUSE_B_CMP_TIME_OUT (1 << 15)
/*
 * Slave Response Composer Lookup Error
 * Indicates that an overflow occurred in a lookup table of the Inbound
 * responses. This indicates that there was a violation of the number of
 * outstanding NP requests issued for the Outbound direction. Write zero to
 * clear
 */
#define PCIE_W_INT_GRP_B_CAUSE_B_RADMX_CMPOSER_LOOKUP_ERR (1 << 16)
/* Parity Error */
#define PCIE_W_INT_GRP_B_CAUSE_B_PARITY_ERROR_CORE (1 << 17)

/**** control_B register ****/
/* When Clear_on_Read =1, all bits of the Cause register are cleared on read. */
#define PCIE_W_INT_GRP_B_CONTROL_B_CLEAR_ON_READ (1 << 0)
/*
 * (Must be set only when MSIX is enabled.)
 * When Auto-Mask =1 and an MSI-X ACK for this bit is received, its
 * corresponding bit in the Mask register is set, masking future interrupts.
 */
#define PCIE_W_INT_GRP_B_CONTROL_B_AUTO_MASK (1 << 1)
/*
 * Auto_Clear (RW)
 * When Auto-Clear =1, the bits in the Interrupt Cause register are auto-cleared
 * after MSI-X is acknowledged. Must be used only if MSI-X is enabled.
 */
#define PCIE_W_INT_GRP_B_CONTROL_B_AUTO_CLEAR (1 << 2)
/*
 * When Set_on_Posedge =1, the bits in the interrupt Cause register are set on
 * the posedge of the interrupt source, i.e., when Interrupt Source =1 and
 * Interrupt Status = 0.
 * When Set_on_Posedge =0, the bits in the Interrupt Cause register are set when
 * Interrupt Source =1.
 */
#define PCIE_W_INT_GRP_B_CONTROL_B_SET_ON_POSEDGE (1 << 3)
/*
 * When Moderation_Reset =1, all Moderation timers associated with the interrupt
 * cause bits are cleared to 0, enabling an immediate interrupt assertion if any
 * unmasked cause bit is set to 1. This bit is self-negated.
 */
#define PCIE_W_INT_GRP_B_CONTROL_B_MOD_RST (1 << 4)
/*
 * When mask_msi_x =1, no MSI-X from this group is sent. This bit must be set to
 * 1 when the associated summary bit in this group is used to generate a single
 * MSI-X for this group.
 */
#define PCIE_W_INT_GRP_B_CONTROL_B_MASK_MSI_X (1 << 5)
/* MSI-X AWID value. Same ID for all cause bits. */
#define PCIE_W_INT_GRP_B_CONTROL_B_AWID_MASK 0x00000F00
#define PCIE_W_INT_GRP_B_CONTROL_B_AWID_SHIFT 8
/*
 * This value determines the interval between interrupts. Writing ZERO disables
 * Moderation.
 */
#define PCIE_W_INT_GRP_B_CONTROL_B_MOD_INTV_MASK 0x00FF0000
#define PCIE_W_INT_GRP_B_CONTROL_B_MOD_INTV_SHIFT 16
/*
 * This value determines the Moderation_Timer_Clock speed.
 * 0- Moderation-timer is decremented every 1x256 SB clock cycles ~1uS.
 * 1- Moderation-timer is decremented every 2x256 SB clock cycles ~2uS.
 * N- Moderation-timer is decremented every Nx256 SB clock cycles ~(N+1) uS.
 */
#define PCIE_W_INT_GRP_B_CONTROL_B_MOD_RES_MASK 0x0F000000
#define PCIE_W_INT_GRP_B_CONTROL_B_MOD_RES_SHIFT 24

/**** cause_C register ****/
/* VPD interrupt, ot read/write frpm EEPROM */
#define PCIE_W_INTERRUPT_GRP_C_INT_CAUSE_GRP_C_VPD_INT_FUNC_MASK 0x0000000F
#define PCIE_W_INTERRUPT_GRP_C_INT_CAUSE_GRP_C_VPD_INT_FUNC_SHIFT 0
/* flr PF active */
#define PCIE_W_INTERRUPT_GRP_C_INT_CAUSE_GRP_C_CFG_FLR_PF_ACTIVE_MASK 0x000000F0
#define PCIE_W_INTERRUPT_GRP_C_INT_CAUSE_GRP_C_CFG_FLR_PF_ACTIVE_SHIFT 4
/* System ERR RC. */
#define PCIE_W_INTERRUPT_GRP_C_INT_CAUSE_GRP_C_CFG_SYS_ERR_RC_MASK 0x00000F00
#define PCIE_W_INTERRUPT_GRP_C_INT_CAUSE_GRP_C_CFG_SYS_ERR_RC_SHIFT 8
/* AER RC INT */
#define PCIE_W_INTERRUPT_GRP_C_INT_CAUSE_GRP_C_CFG_AER_RC_ERR_INT_MASK 0x0000F000
#define PCIE_W_INTERRUPT_GRP_C_INT_CAUSE_GRP_C_CFG_AER_RC_ERR_INT_SHIFT 12
/* AER RC MSI */
#define PCIE_W_INTERRUPT_GRP_C_INT_CAUSE_GRP_C_CFG_AER_RC_ERR_MSI_MASK 0x000F0000
#define PCIE_W_INTERRUPT_GRP_C_INT_CAUSE_GRP_C_CFG_AER_RC_ERR_MSI_SHIFT 16
/* PME MSI */
#define PCIE_W_INTERRUPT_GRP_C_INT_CAUSE_GRP_C_CFG_PME_MSI_MASK 0x00F00000
#define PCIE_W_INTERRUPT_GRP_C_INT_CAUSE_GRP_C_CFG_PME_MSI_SHIFT 20
/* PME int */
#define PCIE_W_INTERRUPT_GRP_C_INT_CAUSE_GRP_C_CFG_PME_INT_MASK 0x0F000000
#define PCIE_W_INTERRUPT_GRP_C_INT_CAUSE_GRP_C_CFG_PME_INT_SHIFT 24
/* SB overflow */
#define PCIE_W_INTERRUPT_GRP_C_INT_CAUSE_GRP_C_RADM_QOVERFLOW (1 << 28)
/* ecrc was injected through the diag_ctrl bus */
#define PCIE_W_INTERRUPT_GRP_C_INT_CAUSE_GRP_C_ECRC_INJECTED (1 << 29)
/* lcrc was injected through the diag_ctrl bus */
#define PCIE_W_INTERRUPT_GRP_C_INT_CAUSE_GRP_C_LCRC_INJECTED (1 << 30)
/* lcrc was injected through the diag_ctrl bus */
#define PCIE_W_INTERRUPT_GRP_C_INT_CAUSE_GRP_C_RSRVD (1 << 31)

/**** control_C register ****/
/* When Clear_on_Read =1, all bits of  Cause register are cleared on read. */
#define PCIE_W_INTERRUPT_GRP_C_INT_CONTROL_GRP_C_CLEAR_ON_READ (1 << 0)
/*
 * (Must be set only when MSIX is enabled.)
 * When Auto-Mask =1 and an MSI-X ACK for this bit is received, its
 * corresponding bit in the Mask register is set, masking future interrupts.
 */
#define PCIE_W_INTERRUPT_GRP_C_INT_CONTROL_GRP_C_AUTO_MASK (1 << 1)
/*
 * Auto_Clear (RW)
 * When Auto-Clear =1, the bits in the Interrupt Cause register are auto-cleared
 * after MSI-X is acknowledged. Must be used only if MSI-X is enabled.
 */
#define PCIE_W_INTERRUPT_GRP_C_INT_CONTROL_GRP_C_AUTO_CLEAR (1 << 2)
/*
 * When Set_on_Posedge =1, the bits in the Interrupt Cause register are set on
 * the posedge of the interrupt source, i.e., when interrupt source =1 and
 * Interrupt Status = 0.
 * When Set_on_Posedge =0, the bits in the Interrupt Cause register are set when
 * interrupt source =1.
 */
#define PCIE_W_INTERRUPT_GRP_C_INT_CONTROL_GRP_C_SET_ON_POSEDGE (1 << 3)
/*
 * When Moderation_Reset =1, all Moderation timers associated with the interrupt
 * cause bits are cleared to 0, enabling immediate interrupt assertion if any
 * unmasked cause bit is set to 1. This bit is self-negated.
 */
#define PCIE_W_INTERRUPT_GRP_C_INT_CONTROL_GRP_C_MOD_RST (1 << 4)
/*
 * When mask_msi_x =1, no MSI-X from this group is sent. This bit must be set to
 * 1 when the associated summary bit in this group is used to generate a single
 * MSI-X for this group.
 */
#define PCIE_W_INTERRUPT_GRP_C_INT_CONTROL_GRP_C_MASK_MSI_X (1 << 5)
/* MSI-X AWID value. Same ID for all cause bits. */
#define PCIE_W_INTERRUPT_GRP_C_INT_CONTROL_GRP_C_AWID_MASK 0x00000F00
#define PCIE_W_INTERRUPT_GRP_C_INT_CONTROL_GRP_C_AWID_SHIFT 8
/*
 * This value determines the interval between interrupts; writing ZERO disables
 * Moderation.
 */
#define PCIE_W_INTERRUPT_GRP_C_INT_CONTROL_GRP_C_MOD_INTV_MASK 0x00FF0000
#define PCIE_W_INTERRUPT_GRP_C_INT_CONTROL_GRP_C_MOD_INTV_SHIFT 16
/*
 * This value determines the Moderation_Timer_Clock speed.
 * 0- Moderation-timer is decremented every 1x256 SB clock cycles ~1uS.
 * 1- Moderation-timer is decremented every 2x256 SB clock cycles ~2uS.
 * N- Moderation-timer is decremented every Nx256 SB clock cycles ~(N+1) uS.
 */
#define PCIE_W_INTERRUPT_GRP_C_INT_CONTROL_GRP_C_MOD_RES_MASK 0x0F000000
#define PCIE_W_INTERRUPT_GRP_C_INT_CONTROL_GRP_C_MOD_RES_SHIFT 24

/**** control_D register ****/
/* When Clear_on_Read =1, all bits of  Cause register are cleared on read. */
#define PCIE_W_INTERRUPT_GRP_D_INT_CONTROL_GRP_D_CLEAR_ON_READ (1 << 0)
/*
 * (Must be set only when MSIX is enabled.)
 * When Auto-Mask =1 and an MSI-X ACK for this bit is received, its
 * corresponding bit in the Mask register is set, masking future interrupts.
 */
#define PCIE_W_INTERRUPT_GRP_D_INT_CONTROL_GRP_D_AUTO_MASK (1 << 1)
/*
 * Auto_Clear (RW)
 * When Auto-Clear =1, the bits in the Interrupt Cause register are auto-cleared
 * after MSI-X is acknowledged. Must be used only if MSI-X is enabled.
 */
#define PCIE_W_INTERRUPT_GRP_D_INT_CONTROL_GRP_D_AUTO_CLEAR (1 << 2)
/*
 * When Set_on_Posedge =1, the bits in the Interrupt Cause register are set on
 * the posedge of the interrupt source, i.e., when interrupt source =1 and
 * Interrupt Status = 0.
 * When Set_on_Posedge =0, the bits in the Interrupt Cause register are set when
 * interrupt source =1.
 */
#define PCIE_W_INTERRUPT_GRP_D_INT_CONTROL_GRP_D_SET_ON_POSEDGE (1 << 3)
/*
 * When Moderation_Reset =1, all Moderation timers associated with the interrupt
 * cause bits are cleared to 0, enabling immediate interrupt assertion if any
 * unmasked cause bit is set to 1. This bit is self-negated.
 */
#define PCIE_W_INTERRUPT_GRP_D_INT_CONTROL_GRP_D_MOD_RST (1 << 4)
/*
 * When mask_msi_x =1, no MSI-X from this group is sent. This bit must be set to
 * 1 when the associated summary bit in this group is used to generate a single
 * MSI-X for this group.
 */
#define PCIE_W_INTERRUPT_GRP_D_INT_CONTROL_GRP_D_MASK_MSI_X (1 << 5)
/* MSI-X AWID value. Same ID for all cause bits. */
#define PCIE_W_INTERRUPT_GRP_D_INT_CONTROL_GRP_D_AWID_MASK 0x00000F00
#define PCIE_W_INTERRUPT_GRP_D_INT_CONTROL_GRP_D_AWID_SHIFT 8
/*
 * This value determines the interval between interrupts; writing ZERO disables
 * Moderation.
 */
#define PCIE_W_INTERRUPT_GRP_D_INT_CONTROL_GRP_D_MOD_INTV_MASK 0x00FF0000
#define PCIE_W_INTERRUPT_GRP_D_INT_CONTROL_GRP_D_MOD_INTV_SHIFT 16
/*
 * This value determines the Moderation_Timer_Clock speed.
 * 0- Moderation-timer is decremented every 1x256 SB clock cycles ~1uS.
 * 1- Moderation-timer is decremented every 2x256 SB clock cycles ~2uS.
 * N- Moderation-timer is decremented every Nx256 SB clock cycles ~(N+1) uS.
 */
#define PCIE_W_INTERRUPT_GRP_D_INT_CONTROL_GRP_D_MOD_RES_MASK 0x0F000000
#define PCIE_W_INTERRUPT_GRP_D_INT_CONTROL_GRP_D_MOD_RES_SHIFT 24
#ifdef __cplusplus
}
#endif

#endif /* __AL_HAL_PCIE_W_REG_H */

/** @} end of ... group */