summaryrefslogtreecommitdiffstats
path: root/sys/contrib/octeon-sdk/cvmx-interrupt-decodes.c
blob: 0902492bd75c9a2972f81fb9a60136714942e84d (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
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
/***********************license start***************
 *  Copyright (c) 2003-2009 Cavium Networks (support@cavium.com). All rights
 *  reserved.
 *
 *
 *  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.
 *
 *      * Neither the name of Cavium Networks nor the names of
 *        its contributors may be used to endorse or promote products
 *        derived from this software without specific prior written
 *        permission.
 *
 *  TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS"
 *  AND WITH ALL FAULTS AND CAVIUM NETWORKS MAKES NO PROMISES, REPRESENTATIONS
 *  OR WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH
 *  RESPECT TO THE SOFTWARE, INCLUDING ITS CONDITION, ITS CONFORMITY TO ANY
 *  REPRESENTATION OR DESCRIPTION, OR THE EXISTENCE OF ANY LATENT OR PATENT
 *  DEFECTS, AND CAVIUM SPECIFICALLY DISCLAIMS ALL IMPLIED (IF ANY) WARRANTIES
 *  OF TITLE, MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR
 *  PURPOSE, LACK OF VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET
 *  POSSESSION OR CORRESPONDENCE TO DESCRIPTION.  THE ENTIRE RISK ARISING OUT
 *  OF USE OR PERFORMANCE OF THE SOFTWARE LIES WITH YOU.
 *
 *
 *  For any questions regarding licensing please contact marketing@caviumnetworks.com
 *
 ***********************license end**************************************/

/**
 * @file
 *
 * Automatically generated functions useful for enabling
 * and decoding RSL_INT_BLOCKS interrupts.
 *
 * This file is auto generated. Do not edit.
 *
 * <hr>$Revision$<hr>
 *
 */

#include "cvmx.h"
#include "cvmx-interrupt.h"
#include "cvmx-pcie.h"

#ifndef PRINT_ERROR
#define PRINT_ERROR(format, ...) cvmx_safe_printf("ERROR " format, ##__VA_ARGS__)
#endif

void __cvmx_interrupt_pci_int_enb2_enable(void);
void __cvmx_interrupt_pci_int_sum2_decode(void);
void __cvmx_interrupt_pescx_dbg_info_en_enable(int index);
void __cvmx_interrupt_pescx_dbg_info_decode(int index);

/**
 * __cvmx_interrupt_agl_gmx_rxx_int_en_enable enables all interrupt bits in cvmx_agl_gmx_rxx_int_en_t
 */
void __cvmx_interrupt_agl_gmx_rxx_int_en_enable(int index)
{
    cvmx_agl_gmx_rxx_int_en_t agl_gmx_rx_int_en;
    cvmx_write_csr(CVMX_AGL_GMX_RXX_INT_REG(index), cvmx_read_csr(CVMX_AGL_GMX_RXX_INT_REG(index)));
    agl_gmx_rx_int_en.u64 = 0;
    if (OCTEON_IS_MODEL(OCTEON_CN56XX))
    {
        // Skipping agl_gmx_rx_int_en.s.reserved_20_63
        agl_gmx_rx_int_en.s.pause_drp = 1;
        // Skipping agl_gmx_rx_int_en.s.reserved_16_18
        agl_gmx_rx_int_en.s.ifgerr = 1;
        //agl_gmx_rx_int_en.s.coldet = 1; // Collsion detect
        //agl_gmx_rx_int_en.s.falerr = 1; // False carrier error or extend error after slottime
        //agl_gmx_rx_int_en.s.rsverr = 1; // RGMII reserved opcodes
        //agl_gmx_rx_int_en.s.pcterr = 1; // Bad Preamble / Protocol
        agl_gmx_rx_int_en.s.ovrerr = 1;
        // Skipping agl_gmx_rx_int_en.s.reserved_9_9
        agl_gmx_rx_int_en.s.skperr = 1;
        agl_gmx_rx_int_en.s.rcverr = 1;
        agl_gmx_rx_int_en.s.lenerr = 1;
        agl_gmx_rx_int_en.s.alnerr = 1;
        agl_gmx_rx_int_en.s.fcserr = 1;
        agl_gmx_rx_int_en.s.jabber = 1;
        agl_gmx_rx_int_en.s.maxerr = 1;
        // Skipping agl_gmx_rx_int_en.s.reserved_1_1
        agl_gmx_rx_int_en.s.minerr = 1;
    }
    if (OCTEON_IS_MODEL(OCTEON_CN52XX))
    {
        // Skipping agl_gmx_rx_int_en.s.reserved_20_63
        agl_gmx_rx_int_en.s.pause_drp = 1;
        // Skipping agl_gmx_rx_int_en.s.reserved_16_18
        agl_gmx_rx_int_en.s.ifgerr = 1;
        //agl_gmx_rx_int_en.s.coldet = 1; // Collsion detect
        //agl_gmx_rx_int_en.s.falerr = 1; // False carrier error or extend error after slottime
        //agl_gmx_rx_int_en.s.rsverr = 1; // RGMII reserved opcodes
        //agl_gmx_rx_int_en.s.pcterr = 1; // Bad Preamble / Protocol
        agl_gmx_rx_int_en.s.ovrerr = 1;
        // Skipping agl_gmx_rx_int_en.s.reserved_9_9
        agl_gmx_rx_int_en.s.skperr = 1;
        agl_gmx_rx_int_en.s.rcverr = 1;
        agl_gmx_rx_int_en.s.lenerr = 1;
        agl_gmx_rx_int_en.s.alnerr = 1;
        agl_gmx_rx_int_en.s.fcserr = 1;
        agl_gmx_rx_int_en.s.jabber = 1;
        agl_gmx_rx_int_en.s.maxerr = 1;
        // Skipping agl_gmx_rx_int_en.s.reserved_1_1
        agl_gmx_rx_int_en.s.minerr = 1;
    }
    cvmx_write_csr(CVMX_AGL_GMX_RXX_INT_EN(index), agl_gmx_rx_int_en.u64);
}


/**
 * __cvmx_interrupt_agl_gmx_rxx_int_reg_decode decodes all interrupt bits in cvmx_agl_gmx_rxx_int_reg_t
 */
void __cvmx_interrupt_agl_gmx_rxx_int_reg_decode(int index)
{
    cvmx_agl_gmx_rxx_int_reg_t agl_gmx_rx_int_reg;
    agl_gmx_rx_int_reg.u64 = cvmx_read_csr(CVMX_AGL_GMX_RXX_INT_REG(index));
    agl_gmx_rx_int_reg.u64 &= cvmx_read_csr(CVMX_AGL_GMX_RXX_INT_EN(index));
    cvmx_write_csr(CVMX_AGL_GMX_RXX_INT_REG(index), agl_gmx_rx_int_reg.u64);
    // Skipping agl_gmx_rx_int_reg.s.reserved_20_63
    if (agl_gmx_rx_int_reg.s.pause_drp)
        PRINT_ERROR("AGL_GMX_RX%d_INT_REG[PAUSE_DRP]: Pause packet was dropped due to full GMX RX FIFO\n", index);
    // Skipping agl_gmx_rx_int_reg.s.reserved_16_18
    if (agl_gmx_rx_int_reg.s.ifgerr)
        PRINT_ERROR("AGL_GMX_RX%d_INT_REG[IFGERR]: Interframe Gap Violation\n"
                    "    Does not necessarily indicate a failure\n", index);
    if (agl_gmx_rx_int_reg.s.coldet)
        PRINT_ERROR("AGL_GMX_RX%d_INT_REG[COLDET]: Collision Detection\n", index);
    if (agl_gmx_rx_int_reg.s.falerr)
        PRINT_ERROR("AGL_GMX_RX%d_INT_REG[FALERR]: False carrier error or extend error after slottime\n", index);
    if (agl_gmx_rx_int_reg.s.rsverr)
        PRINT_ERROR("AGL_GMX_RX%d_INT_REG[RSVERR]: MII reserved opcodes\n", index);
    if (agl_gmx_rx_int_reg.s.pcterr)
        PRINT_ERROR("AGL_GMX_RX%d_INT_REG[PCTERR]: Bad Preamble / Protocol\n", index);
    if (agl_gmx_rx_int_reg.s.ovrerr)
        PRINT_ERROR("AGL_GMX_RX%d_INT_REG[OVRERR]: Internal Data Aggregation Overflow\n"
                    "    This interrupt should never assert\n", index);
    // Skipping agl_gmx_rx_int_reg.s.reserved_9_9
    if (agl_gmx_rx_int_reg.s.skperr)
        PRINT_ERROR("AGL_GMX_RX%d_INT_REG[SKPERR]: Skipper error\n", index);
    if (agl_gmx_rx_int_reg.s.rcverr)
        PRINT_ERROR("AGL_GMX_RX%d_INT_REG[RCVERR]: Frame was received with MII Data reception error\n", index);
    if (agl_gmx_rx_int_reg.s.lenerr)
        PRINT_ERROR("AGL_GMX_RX%d_INT_REG[LENERR]: Frame was received with length error\n", index);
    if (agl_gmx_rx_int_reg.s.alnerr)
        PRINT_ERROR("AGL_GMX_RX%d_INT_REG[ALNERR]: Frame was received with an alignment error\n", index);
    if (agl_gmx_rx_int_reg.s.fcserr)
        PRINT_ERROR("AGL_GMX_RX%d_INT_REG[FCSERR]: Frame was received with FCS/CRC error\n", index);
    if (agl_gmx_rx_int_reg.s.jabber)
        PRINT_ERROR("AGL_GMX_RX%d_INT_REG[JABBER]: Frame was received with length > sys_length\n", index);
    if (agl_gmx_rx_int_reg.s.maxerr)
        PRINT_ERROR("AGL_GMX_RX%d_INT_REG[MAXERR]: Frame was received with length > max_length\n", index);
    // Skipping agl_gmx_rx_int_reg.s.reserved_1_1
    if (agl_gmx_rx_int_reg.s.minerr)
        PRINT_ERROR("AGL_GMX_RX%d_INT_REG[MINERR]: Frame was received with length < min_length\n", index);
}


/**
 * __cvmx_interrupt_fpa_int_enb_enable enables all interrupt bits in cvmx_fpa_int_enb_t
 */
void __cvmx_interrupt_fpa_int_enb_enable(void)
{
    cvmx_fpa_int_enb_t fpa_int_enb;
    cvmx_write_csr(CVMX_FPA_INT_SUM, cvmx_read_csr(CVMX_FPA_INT_SUM));
    fpa_int_enb.u64 = 0;
    if (OCTEON_IS_MODEL(OCTEON_CN56XX))
    {
        // Skipping fpa_int_enb.s.reserved_28_63
        fpa_int_enb.s.q7_perr = 1;
        fpa_int_enb.s.q7_coff = 1;
        fpa_int_enb.s.q7_und = 1;
        fpa_int_enb.s.q6_perr = 1;
        fpa_int_enb.s.q6_coff = 1;
        fpa_int_enb.s.q6_und = 1;
        fpa_int_enb.s.q5_perr = 1;
        fpa_int_enb.s.q5_coff = 1;
        fpa_int_enb.s.q5_und = 1;
        fpa_int_enb.s.q4_perr = 1;
        fpa_int_enb.s.q4_coff = 1;
        fpa_int_enb.s.q4_und = 1;
        fpa_int_enb.s.q3_perr = 1;
        fpa_int_enb.s.q3_coff = 1;
        fpa_int_enb.s.q3_und = 1;
        fpa_int_enb.s.q2_perr = 1;
        fpa_int_enb.s.q2_coff = 1;
        fpa_int_enb.s.q2_und = 1;
        fpa_int_enb.s.q1_perr = 1;
        fpa_int_enb.s.q1_coff = 1;
        fpa_int_enb.s.q1_und = 1;
        fpa_int_enb.s.q0_perr = 1;
        fpa_int_enb.s.q0_coff = 1;
        fpa_int_enb.s.q0_und = 1;
        fpa_int_enb.s.fed1_dbe = 1;
        fpa_int_enb.s.fed1_sbe = 1;
        fpa_int_enb.s.fed0_dbe = 1;
        fpa_int_enb.s.fed0_sbe = 1;
    }
    if (OCTEON_IS_MODEL(OCTEON_CN30XX))
    {
        // Skipping fpa_int_enb.s.reserved_28_63
        fpa_int_enb.s.q7_perr = 1;
        fpa_int_enb.s.q7_coff = 1;
        fpa_int_enb.s.q7_und = 1;
        fpa_int_enb.s.q6_perr = 1;
        fpa_int_enb.s.q6_coff = 1;
        fpa_int_enb.s.q6_und = 1;
        fpa_int_enb.s.q5_perr = 1;
        fpa_int_enb.s.q5_coff = 1;
        fpa_int_enb.s.q5_und = 1;
        fpa_int_enb.s.q4_perr = 1;
        fpa_int_enb.s.q4_coff = 1;
        fpa_int_enb.s.q4_und = 1;
        fpa_int_enb.s.q3_perr = 1;
        fpa_int_enb.s.q3_coff = 1;
        fpa_int_enb.s.q3_und = 1;
        fpa_int_enb.s.q2_perr = 1;
        fpa_int_enb.s.q2_coff = 1;
        fpa_int_enb.s.q2_und = 1;
        fpa_int_enb.s.q1_perr = 1;
        fpa_int_enb.s.q1_coff = 1;
        fpa_int_enb.s.q1_und = 1;
        fpa_int_enb.s.q0_perr = 1;
        fpa_int_enb.s.q0_coff = 1;
        fpa_int_enb.s.q0_und = 1;
        fpa_int_enb.s.fed1_dbe = 1;
        fpa_int_enb.s.fed1_sbe = 1;
        fpa_int_enb.s.fed0_dbe = 1;
        fpa_int_enb.s.fed0_sbe = 1;
    }
    if (OCTEON_IS_MODEL(OCTEON_CN50XX))
    {
        // Skipping fpa_int_enb.s.reserved_28_63
        fpa_int_enb.s.q7_perr = 1;
        fpa_int_enb.s.q7_coff = 1;
        fpa_int_enb.s.q7_und = 1;
        fpa_int_enb.s.q6_perr = 1;
        fpa_int_enb.s.q6_coff = 1;
        fpa_int_enb.s.q6_und = 1;
        fpa_int_enb.s.q5_perr = 1;
        fpa_int_enb.s.q5_coff = 1;
        fpa_int_enb.s.q5_und = 1;
        fpa_int_enb.s.q4_perr = 1;
        fpa_int_enb.s.q4_coff = 1;
        fpa_int_enb.s.q4_und = 1;
        fpa_int_enb.s.q3_perr = 1;
        fpa_int_enb.s.q3_coff = 1;
        fpa_int_enb.s.q3_und = 1;
        fpa_int_enb.s.q2_perr = 1;
        fpa_int_enb.s.q2_coff = 1;
        fpa_int_enb.s.q2_und = 1;
        fpa_int_enb.s.q1_perr = 1;
        fpa_int_enb.s.q1_coff = 1;
        fpa_int_enb.s.q1_und = 1;
        fpa_int_enb.s.q0_perr = 1;
        fpa_int_enb.s.q0_coff = 1;
        fpa_int_enb.s.q0_und = 1;
        fpa_int_enb.s.fed1_dbe = 1;
        fpa_int_enb.s.fed1_sbe = 1;
        fpa_int_enb.s.fed0_dbe = 1;
        fpa_int_enb.s.fed0_sbe = 1;
    }
    if (OCTEON_IS_MODEL(OCTEON_CN38XX))
    {
        // Skipping fpa_int_enb.s.reserved_28_63
        fpa_int_enb.s.q7_perr = 1;
        fpa_int_enb.s.q7_coff = 1;
        fpa_int_enb.s.q7_und = 1;
        fpa_int_enb.s.q6_perr = 1;
        fpa_int_enb.s.q6_coff = 1;
        fpa_int_enb.s.q6_und = 1;
        fpa_int_enb.s.q5_perr = 1;
        fpa_int_enb.s.q5_coff = 1;
        fpa_int_enb.s.q5_und = 1;
        fpa_int_enb.s.q4_perr = 1;
        fpa_int_enb.s.q4_coff = 1;
        fpa_int_enb.s.q4_und = 1;
        fpa_int_enb.s.q3_perr = 1;
        fpa_int_enb.s.q3_coff = 1;
        fpa_int_enb.s.q3_und = 1;
        fpa_int_enb.s.q2_perr = 1;
        fpa_int_enb.s.q2_coff = 1;
        fpa_int_enb.s.q2_und = 1;
        fpa_int_enb.s.q1_perr = 1;
        fpa_int_enb.s.q1_coff = 1;
        fpa_int_enb.s.q1_und = 1;
        fpa_int_enb.s.q0_perr = 1;
        fpa_int_enb.s.q0_coff = 1;
        fpa_int_enb.s.q0_und = 1;
        fpa_int_enb.s.fed1_dbe = 1;
        fpa_int_enb.s.fed1_sbe = 1;
        fpa_int_enb.s.fed0_dbe = 1;
        fpa_int_enb.s.fed0_sbe = 1;
    }
    if (OCTEON_IS_MODEL(OCTEON_CN31XX))
    {
        // Skipping fpa_int_enb.s.reserved_28_63
        fpa_int_enb.s.q7_perr = 1;
        fpa_int_enb.s.q7_coff = 1;
        fpa_int_enb.s.q7_und = 1;
        fpa_int_enb.s.q6_perr = 1;
        fpa_int_enb.s.q6_coff = 1;
        fpa_int_enb.s.q6_und = 1;
        fpa_int_enb.s.q5_perr = 1;
        fpa_int_enb.s.q5_coff = 1;
        fpa_int_enb.s.q5_und = 1;
        fpa_int_enb.s.q4_perr = 1;
        fpa_int_enb.s.q4_coff = 1;
        fpa_int_enb.s.q4_und = 1;
        fpa_int_enb.s.q3_perr = 1;
        fpa_int_enb.s.q3_coff = 1;
        fpa_int_enb.s.q3_und = 1;
        fpa_int_enb.s.q2_perr = 1;
        fpa_int_enb.s.q2_coff = 1;
        fpa_int_enb.s.q2_und = 1;
        fpa_int_enb.s.q1_perr = 1;
        fpa_int_enb.s.q1_coff = 1;
        fpa_int_enb.s.q1_und = 1;
        fpa_int_enb.s.q0_perr = 1;
        fpa_int_enb.s.q0_coff = 1;
        fpa_int_enb.s.q0_und = 1;
        fpa_int_enb.s.fed1_dbe = 1;
        fpa_int_enb.s.fed1_sbe = 1;
        fpa_int_enb.s.fed0_dbe = 1;
        fpa_int_enb.s.fed0_sbe = 1;
    }
    if (OCTEON_IS_MODEL(OCTEON_CN58XX))
    {
        // Skipping fpa_int_enb.s.reserved_28_63
        fpa_int_enb.s.q7_perr = 1;
        fpa_int_enb.s.q7_coff = 1;
        fpa_int_enb.s.q7_und = 1;
        fpa_int_enb.s.q6_perr = 1;
        fpa_int_enb.s.q6_coff = 1;
        fpa_int_enb.s.q6_und = 1;
        fpa_int_enb.s.q5_perr = 1;
        fpa_int_enb.s.q5_coff = 1;
        fpa_int_enb.s.q5_und = 1;
        fpa_int_enb.s.q4_perr = 1;
        fpa_int_enb.s.q4_coff = 1;
        fpa_int_enb.s.q4_und = 1;
        fpa_int_enb.s.q3_perr = 1;
        fpa_int_enb.s.q3_coff = 1;
        fpa_int_enb.s.q3_und = 1;
        fpa_int_enb.s.q2_perr = 1;
        fpa_int_enb.s.q2_coff = 1;
        fpa_int_enb.s.q2_und = 1;
        fpa_int_enb.s.q1_perr = 1;
        fpa_int_enb.s.q1_coff = 1;
        fpa_int_enb.s.q1_und = 1;
        fpa_int_enb.s.q0_perr = 1;
        fpa_int_enb.s.q0_coff = 1;
        fpa_int_enb.s.q0_und = 1;
        fpa_int_enb.s.fed1_dbe = 1;
        fpa_int_enb.s.fed1_sbe = 1;
        fpa_int_enb.s.fed0_dbe = 1;
        fpa_int_enb.s.fed0_sbe = 1;
    }
    if (OCTEON_IS_MODEL(OCTEON_CN52XX))
    {
        // Skipping fpa_int_enb.s.reserved_28_63
        fpa_int_enb.s.q7_perr = 1;
        fpa_int_enb.s.q7_coff = 1;
        fpa_int_enb.s.q7_und = 1;
        fpa_int_enb.s.q6_perr = 1;
        fpa_int_enb.s.q6_coff = 1;
        fpa_int_enb.s.q6_und = 1;
        fpa_int_enb.s.q5_perr = 1;
        fpa_int_enb.s.q5_coff = 1;
        fpa_int_enb.s.q5_und = 1;
        fpa_int_enb.s.q4_perr = 1;
        fpa_int_enb.s.q4_coff = 1;
        fpa_int_enb.s.q4_und = 1;
        fpa_int_enb.s.q3_perr = 1;
        fpa_int_enb.s.q3_coff = 1;
        fpa_int_enb.s.q3_und = 1;
        fpa_int_enb.s.q2_perr = 1;
        fpa_int_enb.s.q2_coff = 1;
        fpa_int_enb.s.q2_und = 1;
        fpa_int_enb.s.q1_perr = 1;
        fpa_int_enb.s.q1_coff = 1;
        fpa_int_enb.s.q1_und = 1;
        fpa_int_enb.s.q0_perr = 1;
        fpa_int_enb.s.q0_coff = 1;
        fpa_int_enb.s.q0_und = 1;
        fpa_int_enb.s.fed1_dbe = 1;
        fpa_int_enb.s.fed1_sbe = 1;
        fpa_int_enb.s.fed0_dbe = 1;
        fpa_int_enb.s.fed0_sbe = 1;
    }
    cvmx_write_csr(CVMX_FPA_INT_ENB, fpa_int_enb.u64);
}


/**
 * __cvmx_interrupt_fpa_int_sum_decode decodes all interrupt bits in cvmx_fpa_int_sum_t
 */
void __cvmx_interrupt_fpa_int_sum_decode(void)
{
    cvmx_fpa_int_sum_t fpa_int_sum;
    fpa_int_sum.u64 = cvmx_read_csr(CVMX_FPA_INT_SUM);
    fpa_int_sum.u64 &= cvmx_read_csr(CVMX_FPA_INT_ENB);
    cvmx_write_csr(CVMX_FPA_INT_SUM, fpa_int_sum.u64);
    // Skipping fpa_int_sum.s.reserved_28_63
    if (fpa_int_sum.s.q7_perr)
        PRINT_ERROR("FPA_INT_SUM[Q7_PERR]: Set when a Queue0 pointer read from the stack in\n"
                    "    the L2C does not have the FPA owner ship bit set.\n");
    if (fpa_int_sum.s.q7_coff)
        PRINT_ERROR("FPA_INT_SUM[Q7_COFF]: Set when a Queue0 stack end tag is present and\n"
                    "    the count available is greater than than pointers\n"
                    "    present in the FPA.\n");
    if (fpa_int_sum.s.q7_und)
        PRINT_ERROR("FPA_INT_SUM[Q7_UND]: Set when a Queue0 page count available goes\n"
                    "    negative.\n");
    if (fpa_int_sum.s.q6_perr)
        PRINT_ERROR("FPA_INT_SUM[Q6_PERR]: Set when a Queue0 pointer read from the stack in\n"
                    "    the L2C does not have the FPA owner ship bit set.\n");
    if (fpa_int_sum.s.q6_coff)
        PRINT_ERROR("FPA_INT_SUM[Q6_COFF]: Set when a Queue0 stack end tag is present and\n"
                    "    the count available is greater than than pointers\n"
                    "    present in the FPA.\n");
    if (fpa_int_sum.s.q6_und)
        PRINT_ERROR("FPA_INT_SUM[Q6_UND]: Set when a Queue0 page count available goes\n"
                    "    negative.\n");
    if (fpa_int_sum.s.q5_perr)
        PRINT_ERROR("FPA_INT_SUM[Q5_PERR]: Set when a Queue0 pointer read from the stack in\n"
                    "    the L2C does not have the FPA owner ship bit set.\n");
    if (fpa_int_sum.s.q5_coff)
        PRINT_ERROR("FPA_INT_SUM[Q5_COFF]: Set when a Queue0 stack end tag is present and\n"
                    "    the count available is greater than than pointers\n"
                    "    present in the FPA.\n");
    if (fpa_int_sum.s.q5_und)
        PRINT_ERROR("FPA_INT_SUM[Q5_UND]: Set when a Queue0 page count available goes\n"
                    "    negative.\n");
    if (fpa_int_sum.s.q4_perr)
        PRINT_ERROR("FPA_INT_SUM[Q4_PERR]: Set when a Queue0 pointer read from the stack in\n"
                    "    the L2C does not have the FPA owner ship bit set.\n");
    if (fpa_int_sum.s.q4_coff)
        PRINT_ERROR("FPA_INT_SUM[Q4_COFF]: Set when a Queue0 stack end tag is present and\n"
                    "    the count available is greater than than pointers\n"
                    "    present in the FPA.\n");
    if (fpa_int_sum.s.q4_und)
        PRINT_ERROR("FPA_INT_SUM[Q4_UND]: Set when a Queue0 page count available goes\n"
                    "    negative.\n");
    if (fpa_int_sum.s.q3_perr)
        PRINT_ERROR("FPA_INT_SUM[Q3_PERR]: Set when a Queue0 pointer read from the stack in\n"
                    "    the L2C does not have the FPA owner ship bit set.\n");
    if (fpa_int_sum.s.q3_coff)
        PRINT_ERROR("FPA_INT_SUM[Q3_COFF]: Set when a Queue0 stack end tag is present and\n"
                    "    the count available is greater than than pointers\n"
                    "    present in the FPA.\n");
    if (fpa_int_sum.s.q3_und)
        PRINT_ERROR("FPA_INT_SUM[Q3_UND]: Set when a Queue0 page count available goes\n"
                    "    negative.\n");
    if (fpa_int_sum.s.q2_perr)
        PRINT_ERROR("FPA_INT_SUM[Q2_PERR]: Set when a Queue0 pointer read from the stack in\n"
                    "    the L2C does not have the FPA owner ship bit set.\n");
    if (fpa_int_sum.s.q2_coff)
        PRINT_ERROR("FPA_INT_SUM[Q2_COFF]: Set when a Queue0 stack end tag is present and\n"
                    "    the count available is greater than than pointers\n"
                    "    present in the FPA.\n");
    if (fpa_int_sum.s.q2_und)
        PRINT_ERROR("FPA_INT_SUM[Q2_UND]: Set when a Queue0 page count available goes\n"
                    "    negative.\n");
    if (fpa_int_sum.s.q1_perr)
        PRINT_ERROR("FPA_INT_SUM[Q1_PERR]: Set when a Queue0 pointer read from the stack in\n"
                    "    the L2C does not have the FPA owner ship bit set.\n");
    if (fpa_int_sum.s.q1_coff)
        PRINT_ERROR("FPA_INT_SUM[Q1_COFF]: Set when a Queue0 stack end tag is present and\n"
                    "    the count available is greater than pointers\n"
                    "    present in the FPA.\n");
    if (fpa_int_sum.s.q1_und)
        PRINT_ERROR("FPA_INT_SUM[Q1_UND]: Set when a Queue0 page count available goes\n"
                    "    negative.\n");
    if (fpa_int_sum.s.q0_perr)
        PRINT_ERROR("FPA_INT_SUM[Q0_PERR]: Set when a Queue0 pointer read from the stack in\n"
                    "    the L2C does not have the FPA owner ship bit set.\n");
    if (fpa_int_sum.s.q0_coff)
        PRINT_ERROR("FPA_INT_SUM[Q0_COFF]: Set when a Queue0 stack end tag is present and\n"
                    "    the count available is greater than pointers\n"
                    "    present in the FPA.\n");
    if (fpa_int_sum.s.q0_und)
        PRINT_ERROR("FPA_INT_SUM[Q0_UND]: Set when a Queue0 page count available goes\n"
                    "    negative.\n");
    if (fpa_int_sum.s.fed1_dbe)
        PRINT_ERROR("FPA_INT_SUM[FED1_DBE]: Set when a Double Bit Error is detected in FPF1.\n");
    if (fpa_int_sum.s.fed1_sbe)
        PRINT_ERROR("FPA_INT_SUM[FED1_SBE]: Set when a Single Bit Error is detected in FPF1.\n");
    if (fpa_int_sum.s.fed0_dbe)
        PRINT_ERROR("FPA_INT_SUM[FED0_DBE]: Set when a Double Bit Error is detected in FPF0.\n");
    if (fpa_int_sum.s.fed0_sbe)
        PRINT_ERROR("FPA_INT_SUM[FED0_SBE]: Set when a Single Bit Error is detected in FPF0.\n");
}


/**
 * __cvmx_interrupt_gmxx_rxx_int_en_enable enables all interrupt bits in cvmx_gmxx_rxx_int_en_t
 */
void __cvmx_interrupt_gmxx_rxx_int_en_enable(int index, int block)
{
    cvmx_gmxx_rxx_int_en_t gmx_rx_int_en;
    cvmx_write_csr(CVMX_GMXX_RXX_INT_REG(index, block), cvmx_read_csr(CVMX_GMXX_RXX_INT_REG(index, block)));
    gmx_rx_int_en.u64 = 0;
    if (OCTEON_IS_MODEL(OCTEON_CN56XX))
    {
        // Skipping gmx_rx_int_en.s.reserved_29_63
        gmx_rx_int_en.s.hg2cc = 1;
        gmx_rx_int_en.s.hg2fld = 1;
        gmx_rx_int_en.s.undat = 1;
        gmx_rx_int_en.s.uneop = 1;
        gmx_rx_int_en.s.unsop = 1;
        gmx_rx_int_en.s.bad_term = 1;
        gmx_rx_int_en.s.bad_seq = 1;
        gmx_rx_int_en.s.rem_fault = 1;
        gmx_rx_int_en.s.loc_fault = 1;
        gmx_rx_int_en.s.pause_drp = 1;
        // Skipping gmx_rx_int_en.s.reserved_16_18
        //gmx_rx_int_en.s.ifgerr = 1;
        //gmx_rx_int_en.s.coldet = 1; // Collsion detect
        //gmx_rx_int_en.s.falerr = 1; // False carrier error or extend error after slottime
        //gmx_rx_int_en.s.rsverr = 1; // RGMII reserved opcodes
        //gmx_rx_int_en.s.pcterr = 1; // Bad Preamble / Protocol
        gmx_rx_int_en.s.ovrerr = 1;
        // Skipping gmx_rx_int_en.s.reserved_9_9
        gmx_rx_int_en.s.skperr = 1;
        gmx_rx_int_en.s.rcverr = 1;
        // Skipping gmx_rx_int_en.s.reserved_5_6
        //gmx_rx_int_en.s.fcserr = 1; // FCS errors are handled when we get work
        gmx_rx_int_en.s.jabber = 1;
        // Skipping gmx_rx_int_en.s.reserved_2_2
        gmx_rx_int_en.s.carext = 1;
        // Skipping gmx_rx_int_en.s.reserved_0_0
    }
    if (OCTEON_IS_MODEL(OCTEON_CN30XX))
    {
        // Skipping gmx_rx_int_en.s.reserved_19_63
        //gmx_rx_int_en.s.phy_dupx = 1;
        //gmx_rx_int_en.s.phy_spd = 1;
        //gmx_rx_int_en.s.phy_link = 1;
        //gmx_rx_int_en.s.ifgerr = 1;
        //gmx_rx_int_en.s.coldet = 1; // Collsion detect
        //gmx_rx_int_en.s.falerr = 1; // False carrier error or extend error after slottime
        //gmx_rx_int_en.s.rsverr = 1; // RGMII reserved opcodes
        //gmx_rx_int_en.s.pcterr = 1; // Bad Preamble / Protocol
        gmx_rx_int_en.s.ovrerr = 1;
        gmx_rx_int_en.s.niberr = 1;
        gmx_rx_int_en.s.skperr = 1;
        gmx_rx_int_en.s.rcverr = 1;
        //gmx_rx_int_en.s.lenerr = 1; // Length errors are handled when we get work
        gmx_rx_int_en.s.alnerr = 1;
        //gmx_rx_int_en.s.fcserr = 1; // FCS errors are handled when we get work
        gmx_rx_int_en.s.jabber = 1;
        gmx_rx_int_en.s.maxerr = 1;
        gmx_rx_int_en.s.carext = 1;
        gmx_rx_int_en.s.minerr = 1;
    }
    if (OCTEON_IS_MODEL(OCTEON_CN50XX))
    {
        // Skipping gmx_rx_int_en.s.reserved_20_63
        gmx_rx_int_en.s.pause_drp = 1;
        //gmx_rx_int_en.s.phy_dupx = 1;
        //gmx_rx_int_en.s.phy_spd = 1;
        //gmx_rx_int_en.s.phy_link = 1;
        //gmx_rx_int_en.s.ifgerr = 1;
        //gmx_rx_int_en.s.coldet = 1; // Collsion detect
        //gmx_rx_int_en.s.falerr = 1; // False carrier error or extend error after slottime
        //gmx_rx_int_en.s.rsverr = 1; // RGMII reserved opcodes
        //gmx_rx_int_en.s.pcterr = 1; // Bad Preamble / Protocol
        gmx_rx_int_en.s.ovrerr = 1;
        gmx_rx_int_en.s.niberr = 1;
        gmx_rx_int_en.s.skperr = 1;
        gmx_rx_int_en.s.rcverr = 1;
        // Skipping gmx_rx_int_en.s.reserved_6_6
        gmx_rx_int_en.s.alnerr = 1;
        //gmx_rx_int_en.s.fcserr = 1; // FCS errors are handled when we get work
        gmx_rx_int_en.s.jabber = 1;
        // Skipping gmx_rx_int_en.s.reserved_2_2
        gmx_rx_int_en.s.carext = 1;
        // Skipping gmx_rx_int_en.s.reserved_0_0
    }
    if (OCTEON_IS_MODEL(OCTEON_CN38XX))
    {
        // Skipping gmx_rx_int_en.s.reserved_19_63
        //gmx_rx_int_en.s.phy_dupx = 1;
        //gmx_rx_int_en.s.phy_spd = 1;
        //gmx_rx_int_en.s.phy_link = 1;
        //gmx_rx_int_en.s.ifgerr = 1;
        //gmx_rx_int_en.s.coldet = 1; // Collsion detect
        //gmx_rx_int_en.s.falerr = 1; // False carrier error or extend error after slottime
        //gmx_rx_int_en.s.rsverr = 1; // RGMII reserved opcodes
        //gmx_rx_int_en.s.pcterr = 1; // Bad Preamble / Protocol
        gmx_rx_int_en.s.ovrerr = 1;
        gmx_rx_int_en.s.niberr = 1;
        gmx_rx_int_en.s.skperr = 1;
        gmx_rx_int_en.s.rcverr = 1;
        //gmx_rx_int_en.s.lenerr = 1; // Length errors are handled when we get work
        gmx_rx_int_en.s.alnerr = 1;
        //gmx_rx_int_en.s.fcserr = 1; // FCS errors are handled when we get work
        gmx_rx_int_en.s.jabber = 1;
        gmx_rx_int_en.s.maxerr = 1;
        gmx_rx_int_en.s.carext = 1;
        gmx_rx_int_en.s.minerr = 1;
    }
    if (OCTEON_IS_MODEL(OCTEON_CN31XX))
    {
        // Skipping gmx_rx_int_en.s.reserved_19_63
        //gmx_rx_int_en.s.phy_dupx = 1;
        //gmx_rx_int_en.s.phy_spd = 1;
        //gmx_rx_int_en.s.phy_link = 1;
        //gmx_rx_int_en.s.ifgerr = 1;
        //gmx_rx_int_en.s.coldet = 1; // Collsion detect
        //gmx_rx_int_en.s.falerr = 1; // False carrier error or extend error after slottime
        //gmx_rx_int_en.s.rsverr = 1; // RGMII reserved opcodes
        //gmx_rx_int_en.s.pcterr = 1; // Bad Preamble / Protocol
        gmx_rx_int_en.s.ovrerr = 1;
        gmx_rx_int_en.s.niberr = 1;
        gmx_rx_int_en.s.skperr = 1;
        gmx_rx_int_en.s.rcverr = 1;
        //gmx_rx_int_en.s.lenerr = 1; // Length errors are handled when we get work
        gmx_rx_int_en.s.alnerr = 1;
        //gmx_rx_int_en.s.fcserr = 1; // FCS errors are handled when we get work
        gmx_rx_int_en.s.jabber = 1;
        gmx_rx_int_en.s.maxerr = 1;
        gmx_rx_int_en.s.carext = 1;
        gmx_rx_int_en.s.minerr = 1;
    }
    if (OCTEON_IS_MODEL(OCTEON_CN58XX))
    {
        // Skipping gmx_rx_int_en.s.reserved_20_63
        gmx_rx_int_en.s.pause_drp = 1;
        //gmx_rx_int_en.s.phy_dupx = 1;
        //gmx_rx_int_en.s.phy_spd = 1;
        //gmx_rx_int_en.s.phy_link = 1;
        //gmx_rx_int_en.s.ifgerr = 1;
        //gmx_rx_int_en.s.coldet = 1; // Collsion detect
        //gmx_rx_int_en.s.falerr = 1; // False carrier error or extend error after slottime
        //gmx_rx_int_en.s.rsverr = 1; // RGMII reserved opcodes
        //gmx_rx_int_en.s.pcterr = 1; // Bad Preamble / Protocol
        gmx_rx_int_en.s.ovrerr = 1;
        gmx_rx_int_en.s.niberr = 1;
        gmx_rx_int_en.s.skperr = 1;
        gmx_rx_int_en.s.rcverr = 1;
        //gmx_rx_int_en.s.lenerr = 1; // Length errors are handled when we get work
        gmx_rx_int_en.s.alnerr = 1;
        //gmx_rx_int_en.s.fcserr = 1; // FCS errors are handled when we get work
        gmx_rx_int_en.s.jabber = 1;
        gmx_rx_int_en.s.maxerr = 1;
        gmx_rx_int_en.s.carext = 1;
        gmx_rx_int_en.s.minerr = 1;
    }
    if (OCTEON_IS_MODEL(OCTEON_CN52XX))
    {
        // Skipping gmx_rx_int_en.s.reserved_29_63
        gmx_rx_int_en.s.hg2cc = 1;
        gmx_rx_int_en.s.hg2fld = 1;
        gmx_rx_int_en.s.undat = 1;
        gmx_rx_int_en.s.uneop = 1;
        gmx_rx_int_en.s.unsop = 1;
        gmx_rx_int_en.s.bad_term = 1;
        gmx_rx_int_en.s.bad_seq = 0;
        gmx_rx_int_en.s.rem_fault = 1;
        gmx_rx_int_en.s.loc_fault = 0;
        gmx_rx_int_en.s.pause_drp = 1;
        // Skipping gmx_rx_int_en.s.reserved_16_18
        //gmx_rx_int_en.s.ifgerr = 1;
        //gmx_rx_int_en.s.coldet = 1; // Collsion detect
        //gmx_rx_int_en.s.falerr = 1; // False carrier error or extend error after slottime
        //gmx_rx_int_en.s.rsverr = 1; // RGMII reserved opcodes
        //gmx_rx_int_en.s.pcterr = 1; // Bad Preamble / Protocol
        gmx_rx_int_en.s.ovrerr = 1;
        // Skipping gmx_rx_int_en.s.reserved_9_9
        gmx_rx_int_en.s.skperr = 1;
        gmx_rx_int_en.s.rcverr = 1;
        // Skipping gmx_rx_int_en.s.reserved_5_6
        //gmx_rx_int_en.s.fcserr = 1; // FCS errors are handled when we get work
        gmx_rx_int_en.s.jabber = 1;
        // Skipping gmx_rx_int_en.s.reserved_2_2
        gmx_rx_int_en.s.carext = 1;
        // Skipping gmx_rx_int_en.s.reserved_0_0
    }
    cvmx_write_csr(CVMX_GMXX_RXX_INT_EN(index, block), gmx_rx_int_en.u64);
}


/**
 * __cvmx_interrupt_gmxx_rxx_int_reg_decode decodes all interrupt bits in cvmx_gmxx_rxx_int_reg_t
 */
void __cvmx_interrupt_gmxx_rxx_int_reg_decode(int index, int block)
{
    cvmx_gmxx_rxx_int_reg_t gmx_rx_int_reg;
    gmx_rx_int_reg.u64 = cvmx_read_csr(CVMX_GMXX_RXX_INT_REG(index, block));
    /* Don't clear inband status bits so someone else can use them */
    gmx_rx_int_reg.s.phy_dupx = 0;
    gmx_rx_int_reg.s.phy_spd = 0;
    gmx_rx_int_reg.s.phy_link = 0;
    gmx_rx_int_reg.u64 &= cvmx_read_csr(CVMX_GMXX_RXX_INT_EN(index, block));
    cvmx_write_csr(CVMX_GMXX_RXX_INT_REG(index, block), gmx_rx_int_reg.u64);
    // Skipping gmx_rx_int_reg.s.reserved_29_63
    if (gmx_rx_int_reg.s.hg2cc)
        PRINT_ERROR("GMX%d_RX%d_INT_REG[HG2CC]: HiGig2 received message CRC or Control char  error\n"
                    "    Set when either CRC8 error detected or when\n"
                    "    a Control Character is found in the message\n"
                    "    bytes after the K.SOM\n"
                    "    NOTE: HG2CC has higher priority than HG2FLD\n"
                    "          i.e. a HiGig2 message that results in HG2CC\n"
                    "          getting set, will never set HG2FLD.\n", block, index);
    if (gmx_rx_int_reg.s.hg2fld)
        PRINT_ERROR("GMX%d_RX%d_INT_REG[HG2FLD]: HiGig2 received message field error, as below\n"
                    "    1) MSG_TYPE field not 6'b00_0000\n"
                    "       i.e. it is not a FLOW CONTROL message, which\n"
                    "       is the only defined type for HiGig2\n"
                    "    2) FWD_TYPE field not 2'b00 i.e. Link Level msg\n"
                    "       which is the only defined type for HiGig2\n"
                    "    3) FC_OBJECT field is neither 4'b0000 for\n"
                    "       Physical Link nor 4'b0010 for Logical Link.\n"
                    "       Those are the only two defined types in HiGig2\n", block, index);
    if (gmx_rx_int_reg.s.undat)
        PRINT_ERROR("GMX%d_RX%d_INT_REG[UNDAT]: Unexpected Data\n"
                    "    (XAUI Mode only)\n", block, index);
    if (gmx_rx_int_reg.s.uneop)
        PRINT_ERROR("GMX%d_RX%d_INT_REG[UNEOP]: Unexpected EOP\n"
                    "    (XAUI Mode only)\n", block, index);
    if (gmx_rx_int_reg.s.unsop)
        PRINT_ERROR("GMX%d_RX%d_INT_REG[UNSOP]: Unexpected SOP\n"
                    "    (XAUI Mode only)\n", block, index);
    if (gmx_rx_int_reg.s.bad_term)
        PRINT_ERROR("GMX%d_RX%d_INT_REG[BAD_TERM]: Frame is terminated by control character other\n"
                    "    than /T/.  The error propagation control\n"
                    "    character /E/ will be included as part of the\n"
                    "    frame and does not cause a frame termination.\n"
                    "    (XAUI Mode only)\n", block, index);
    if (gmx_rx_int_reg.s.bad_seq)
        PRINT_ERROR("GMX%d_RX%d_INT_REG[BAD_SEQ]: Reserved Sequence Deteted\n"
                    "    (XAUI Mode only)\n", block, index);
    if (gmx_rx_int_reg.s.rem_fault)
        PRINT_ERROR("GMX%d_RX%d_INT_REG[REM_FAULT]: Remote Fault Sequence Deteted\n"
                    "    (XAUI Mode only)\n", block, index);
    if (gmx_rx_int_reg.s.loc_fault)
        PRINT_ERROR("GMX%d_RX%d_INT_REG[LOC_FAULT]: Local Fault Sequence Deteted\n"
                    "    (XAUI Mode only)\n", block, index);
    if (gmx_rx_int_reg.s.pause_drp)
        PRINT_ERROR("GMX%d_RX%d_INT_REG[PAUSE_DRP]: Pause packet was dropped due to full GMX RX FIFO\n", block, index);
#if 0
    if (gmx_rx_int_reg.s.phy_dupx)
        PRINT_ERROR("GMX%d_RX%d_INT_REG[PHY_DUPX]: Change in the RMGII inbound LinkDuplex\n", block, index);
    if (gmx_rx_int_reg.s.phy_spd)
        PRINT_ERROR("GMX%d_RX%d_INT_REG[PHY_SPD]: Change in the RMGII inbound LinkSpeed\n", block, index);
    if (gmx_rx_int_reg.s.phy_link)
        PRINT_ERROR("GMX%d_RX%d_INT_REG[PHY_LINK]: Change in the RMGII inbound LinkStatus\n", block, index);
#endif
    if (gmx_rx_int_reg.s.ifgerr)
        PRINT_ERROR("GMX%d_RX%d_INT_REG[IFGERR]: Interframe Gap Violation\n"
                    "    Does not necessarily indicate a failure\n", block, index);
    if (gmx_rx_int_reg.s.coldet)
        PRINT_ERROR("GMX%d_RX%d_INT_REG[COLDET]: Collision Detection\n", block, index);
    if (gmx_rx_int_reg.s.falerr)
        PRINT_ERROR("GMX%d_RX%d_INT_REG[FALERR]: False carrier error or extend error after slottime\n", block, index);
    if (gmx_rx_int_reg.s.rsverr)
        PRINT_ERROR("GMX%d_RX%d_INT_REG[RSVERR]: RGMII reserved opcodes\n", block, index);
    if (gmx_rx_int_reg.s.pcterr)
        PRINT_ERROR("GMX%d_RX%d_INT_REG[PCTERR]: Bad Preamble / Protocol\n", block, index);
    if (gmx_rx_int_reg.s.ovrerr)
        PRINT_ERROR("GMX%d_RX%d_INT_REG[OVRERR]: Internal Data Aggregation Overflow\n"
                    "    This interrupt should never assert\n", block, index);
    if (gmx_rx_int_reg.s.niberr)
        PRINT_ERROR("GMX%d_RX%d_INT_REG[NIBERR]: Nibble error (hi_nibble != lo_nibble)\n", block, index);
    if (gmx_rx_int_reg.s.skperr)
        PRINT_ERROR("GMX%d_RX%d_INT_REG[SKPERR]: Skipper error\n", block, index);
    if (gmx_rx_int_reg.s.rcverr)
        PRINT_ERROR("GMX%d_RX%d_INT_REG[RCVERR]: Frame was received with RMGII Data reception error\n", block, index);
    if (gmx_rx_int_reg.s.lenerr)
        PRINT_ERROR("GMX%d_RX%d_INT_REG[LENERR]: Frame was received with length error\n", block, index);
    if (gmx_rx_int_reg.s.alnerr)
        PRINT_ERROR("GMX%d_RX%d_INT_REG[ALNERR]: Frame was received with an alignment error\n", block, index);
    if (gmx_rx_int_reg.s.fcserr)
        PRINT_ERROR("GMX%d_RX%d_INT_REG[FCSERR]: Frame was received with FCS/CRC error\n", block, index);
    if (gmx_rx_int_reg.s.jabber)
        PRINT_ERROR("GMX%d_RX%d_INT_REG[JABBER]: Frame was received with length > sys_length\n", block, index);
    if (gmx_rx_int_reg.s.maxerr)
        PRINT_ERROR("GMX%d_RX%d_INT_REG[MAXERR]: Frame was received with length > max_length\n", block, index);
    if (gmx_rx_int_reg.s.carext)
        PRINT_ERROR("GMX%d_RX%d_INT_REG[CAREXT]: RGMII carrier extend error\n", block, index);
    if (gmx_rx_int_reg.s.minerr)
        PRINT_ERROR("GMX%d_RX%d_INT_REG[MINERR]: Frame was received with length < min_length\n", block, index);
}


/**
 * __cvmx_interrupt_iob_int_enb_enable enables all interrupt bits in cvmx_iob_int_enb_t
 */
void __cvmx_interrupt_iob_int_enb_enable(void)
{
    cvmx_iob_int_enb_t iob_int_enb;
    cvmx_write_csr(CVMX_IOB_INT_SUM, cvmx_read_csr(CVMX_IOB_INT_SUM));
    iob_int_enb.u64 = 0;
    if (OCTEON_IS_MODEL(OCTEON_CN56XX))
    {
        // Skipping iob_int_enb.s.reserved_6_63
        iob_int_enb.s.p_dat = 1;
        iob_int_enb.s.p_eop = 1;
        iob_int_enb.s.p_sop = 1;
        /* These interrupts are disabled on CN56XXp2.X due to errata IOB-800 */
        if (!OCTEON_IS_MODEL(OCTEON_CN56XX_PASS2_X))
        {
            iob_int_enb.s.np_dat = 1;
            iob_int_enb.s.np_eop = 1;
            iob_int_enb.s.np_sop = 1;
        }
    }
    if (OCTEON_IS_MODEL(OCTEON_CN30XX))
    {
        // Skipping iob_int_enb.s.reserved_4_63
        iob_int_enb.s.p_eop = 1;
        iob_int_enb.s.p_sop = 1;
        iob_int_enb.s.np_eop = 1;
        iob_int_enb.s.np_sop = 1;
    }
    if (OCTEON_IS_MODEL(OCTEON_CN50XX))
    {
        // Skipping iob_int_enb.s.reserved_6_63
        iob_int_enb.s.p_dat = 1;
        iob_int_enb.s.np_dat = 1;
        iob_int_enb.s.p_eop = 1;
        iob_int_enb.s.p_sop = 1;
        iob_int_enb.s.np_eop = 1;
        iob_int_enb.s.np_sop = 1;
    }
    if (OCTEON_IS_MODEL(OCTEON_CN38XX))
    {
        // Skipping iob_int_enb.s.reserved_4_63
        iob_int_enb.s.p_eop = 1;
        iob_int_enb.s.p_sop = 1;
        iob_int_enb.s.np_eop = 1;
        iob_int_enb.s.np_sop = 1;
    }
    if (OCTEON_IS_MODEL(OCTEON_CN31XX))
    {
        // Skipping iob_int_enb.s.reserved_4_63
        iob_int_enb.s.p_eop = 1;
        iob_int_enb.s.p_sop = 1;
        iob_int_enb.s.np_eop = 1;
        iob_int_enb.s.np_sop = 1;
    }
    if (OCTEON_IS_MODEL(OCTEON_CN58XX))
    {
        // Skipping iob_int_enb.s.reserved_6_63
        iob_int_enb.s.p_dat = 1;
        iob_int_enb.s.np_dat = 1;
        iob_int_enb.s.p_eop = 1;
        iob_int_enb.s.p_sop = 1;
        iob_int_enb.s.np_eop = 1;
        iob_int_enb.s.np_sop = 1;
    }
    if (OCTEON_IS_MODEL(OCTEON_CN52XX))
    {
        // Skipping iob_int_enb.s.reserved_6_63
        iob_int_enb.s.p_dat = 1;
        iob_int_enb.s.p_eop = 1;
        iob_int_enb.s.p_sop = 1;
        /* These interrupts are disabled on CN52XXp2.X due to errata IOB-800 */
        if (!OCTEON_IS_MODEL(OCTEON_CN52XX_PASS2_X))
        {
            iob_int_enb.s.np_dat = 1;
            iob_int_enb.s.np_eop = 1;
            iob_int_enb.s.np_sop = 1;
        }
    }
    cvmx_write_csr(CVMX_IOB_INT_ENB, iob_int_enb.u64);
}


/**
 * __cvmx_interrupt_iob_int_sum_decode decodes all interrupt bits in cvmx_iob_int_sum_t
 */
void __cvmx_interrupt_iob_int_sum_decode(void)
{
    cvmx_iob_int_sum_t iob_int_sum;
    iob_int_sum.u64 = cvmx_read_csr(CVMX_IOB_INT_SUM);
    iob_int_sum.u64 &= cvmx_read_csr(CVMX_IOB_INT_ENB);
    cvmx_write_csr(CVMX_IOB_INT_SUM, iob_int_sum.u64);
    // Skipping iob_int_sum.s.reserved_6_63
    if (iob_int_sum.s.p_dat)
        PRINT_ERROR("IOB_INT_SUM[P_DAT]: Set when a data arrives before a SOP for the same\n"
                    "    port for a passthrough packet.\n"
                    "    The first detected error associated with bits [5:0]\n"
                    "    of this register will only be set here. A new bit\n"
                    "    can be set when the previous reported bit is cleared.\n");
    if (iob_int_sum.s.np_dat)
        PRINT_ERROR("IOB_INT_SUM[NP_DAT]: Set when a data arrives before a SOP for the same\n"
                    "    port for a non-passthrough packet.\n"
                    "    The first detected error associated with bits [5:0]\n"
                    "    of this register will only be set here. A new bit\n"
                    "    can be set when the previous reported bit is cleared.\n");
    if (iob_int_sum.s.p_eop)
        PRINT_ERROR("IOB_INT_SUM[P_EOP]: Set when a EOP is followed by an EOP for the same\n"
                    "    port for a passthrough packet.\n"
                    "    The first detected error associated with bits [5:0]\n"
                    "    of this register will only be set here. A new bit\n"
                    "    can be set when the previous reported bit is cleared.\n");
    if (iob_int_sum.s.p_sop)
        PRINT_ERROR("IOB_INT_SUM[P_SOP]: Set when a SOP is followed by an SOP for the same\n"
                    "    port for a passthrough packet.\n"
                    "    The first detected error associated with bits [5:0]\n"
                    "    of this register will only be set here. A new bit\n"
                    "    can be set when the previous reported bit is cleared.\n");
    if (iob_int_sum.s.np_eop)
        PRINT_ERROR("IOB_INT_SUM[NP_EOP]: Set when a EOP is followed by an EOP for the same\n"
                    "    port for a non-passthrough packet.\n"
                    "    The first detected error associated with bits [5:0]\n"
                    "    of this register will only be set here. A new bit\n"
                    "    can be set when the previous reported bit is cleared.\n");
    if (iob_int_sum.s.np_sop)
        PRINT_ERROR("IOB_INT_SUM[NP_SOP]: Set when a SOP is followed by an SOP for the same\n"
                    "    port for a non-passthrough packet.\n"
                    "    The first detected error associated with bits [5:0]\n"
                    "    of this register will only be set here. A new bit\n"
                    "    can be set when the previous reported bit is cleared.\n");
}


/**
 * __cvmx_interrupt_ipd_int_enb_enable enables all interrupt bits in cvmx_ipd_int_enb_t
 */
void __cvmx_interrupt_ipd_int_enb_enable(void)
{
    cvmx_ipd_int_enb_t ipd_int_enb;
    cvmx_write_csr(CVMX_IPD_INT_SUM, cvmx_read_csr(CVMX_IPD_INT_SUM));
    ipd_int_enb.u64 = 0;
    if (OCTEON_IS_MODEL(OCTEON_CN56XX))
    {
        // Skipping ipd_int_enb.s.reserved_12_63
        //ipd_int_enb.s.pq_sub = 1; // Disable per port backpressure overflow checking since it happens when not in use
        //ipd_int_enb.s.pq_add = 1; // Disable per port backpressure overflow checking since it happens when not in use
        ipd_int_enb.s.bc_ovr = 1;
        ipd_int_enb.s.d_coll = 1;
        ipd_int_enb.s.c_coll = 1;
        ipd_int_enb.s.cc_ovr = 1;
        ipd_int_enb.s.dc_ovr = 1;
        ipd_int_enb.s.bp_sub = 1;
        ipd_int_enb.s.prc_par3 = 1;
        ipd_int_enb.s.prc_par2 = 1;
        ipd_int_enb.s.prc_par1 = 1;
        ipd_int_enb.s.prc_par0 = 1;
    }
    if (OCTEON_IS_MODEL(OCTEON_CN30XX))
    {
        // Skipping ipd_int_enb.s.reserved_5_63
        ipd_int_enb.s.bp_sub = 1;
        ipd_int_enb.s.prc_par3 = 1;
        ipd_int_enb.s.prc_par2 = 1;
        ipd_int_enb.s.prc_par1 = 1;
        ipd_int_enb.s.prc_par0 = 1;
    }
    if (OCTEON_IS_MODEL(OCTEON_CN50XX))
    {
        // Skipping ipd_int_enb.s.reserved_10_63
        ipd_int_enb.s.bc_ovr = 1;
        ipd_int_enb.s.d_coll = 1;
        ipd_int_enb.s.c_coll = 1;
        ipd_int_enb.s.cc_ovr = 1;
        ipd_int_enb.s.dc_ovr = 1;
        ipd_int_enb.s.bp_sub = 1;
        ipd_int_enb.s.prc_par3 = 1;
        ipd_int_enb.s.prc_par2 = 1;
        ipd_int_enb.s.prc_par1 = 1;
        ipd_int_enb.s.prc_par0 = 1;
    }
    if (OCTEON_IS_MODEL(OCTEON_CN38XX))
    {
        // Skipping ipd_int_enb.s.reserved_10_63
        if (!OCTEON_IS_MODEL(OCTEON_CN38XX_PASS2))
        {
            ipd_int_enb.s.bc_ovr = 1;
            ipd_int_enb.s.d_coll = 1;
            ipd_int_enb.s.c_coll = 1;
            ipd_int_enb.s.cc_ovr = 1;
            ipd_int_enb.s.dc_ovr = 1;
        }
        ipd_int_enb.s.bp_sub = 1;
        ipd_int_enb.s.prc_par3 = 1;
        ipd_int_enb.s.prc_par2 = 1;
        ipd_int_enb.s.prc_par1 = 1;
        ipd_int_enb.s.prc_par0 = 1;
    }
    if (OCTEON_IS_MODEL(OCTEON_CN31XX))
    {
        // Skipping ipd_int_enb.s.reserved_5_63
        ipd_int_enb.s.bp_sub = 1;
        ipd_int_enb.s.prc_par3 = 1;
        ipd_int_enb.s.prc_par2 = 1;
        ipd_int_enb.s.prc_par1 = 1;
        ipd_int_enb.s.prc_par0 = 1;
    }
    if (OCTEON_IS_MODEL(OCTEON_CN58XX))
    {
        // Skipping ipd_int_enb.s.reserved_10_63
        ipd_int_enb.s.bc_ovr = 1;
        ipd_int_enb.s.d_coll = 1;
        ipd_int_enb.s.c_coll = 1;
        ipd_int_enb.s.cc_ovr = 1;
        ipd_int_enb.s.dc_ovr = 1;
        ipd_int_enb.s.bp_sub = 1;
        ipd_int_enb.s.prc_par3 = 1;
        ipd_int_enb.s.prc_par2 = 1;
        ipd_int_enb.s.prc_par1 = 1;
        ipd_int_enb.s.prc_par0 = 1;
    }
    if (OCTEON_IS_MODEL(OCTEON_CN52XX))
    {
        // Skipping ipd_int_enb.s.reserved_12_63
        //ipd_int_enb.s.pq_sub = 1; // Disable per port backpressure overflow checking since it happens when not in use
        //ipd_int_enb.s.pq_add = 1; // Disable per port backpressure overflow checking since it happens when not in use
        ipd_int_enb.s.bc_ovr = 1;
        ipd_int_enb.s.d_coll = 1;
        ipd_int_enb.s.c_coll = 1;
        ipd_int_enb.s.cc_ovr = 1;
        ipd_int_enb.s.dc_ovr = 1;
        ipd_int_enb.s.bp_sub = 1;
        ipd_int_enb.s.prc_par3 = 1;
        ipd_int_enb.s.prc_par2 = 1;
        ipd_int_enb.s.prc_par1 = 1;
        ipd_int_enb.s.prc_par0 = 1;
    }
    cvmx_write_csr(CVMX_IPD_INT_ENB, ipd_int_enb.u64);
}


/**
 * __cvmx_interrupt_ipd_int_sum_decode decodes all interrupt bits in cvmx_ipd_int_sum_t
 */
void __cvmx_interrupt_ipd_int_sum_decode(void)
{
    cvmx_ipd_int_sum_t ipd_int_sum;
    ipd_int_sum.u64 = cvmx_read_csr(CVMX_IPD_INT_SUM);
    ipd_int_sum.u64 &= cvmx_read_csr(CVMX_IPD_INT_ENB);
    cvmx_write_csr(CVMX_IPD_INT_SUM, ipd_int_sum.u64);
    // Skipping ipd_int_sum.s.reserved_12_63
    if (ipd_int_sum.s.pq_sub)
        PRINT_ERROR("IPD_INT_SUM[PQ_SUB]: Set when a port-qos does an sub to the count\n"
                    "    that causes the counter to wrap.\n");
    if (ipd_int_sum.s.pq_add)
        PRINT_ERROR("IPD_INT_SUM[PQ_ADD]: Set when a port-qos does an add to the count\n"
                    "    that causes the counter to wrap.\n");
    if (ipd_int_sum.s.bc_ovr)
        PRINT_ERROR("IPD_INT_SUM[BC_OVR]: Set when the byte-count to send to IOB overflows.\n"
                    "    This is a PASS-3 Field.\n");
    if (ipd_int_sum.s.d_coll)
        PRINT_ERROR("IPD_INT_SUM[D_COLL]: Set when the packet/WQE data to be sent to IOB\n"
                    "    collides.\n"
                    "    This is a PASS-3 Field.\n");
    if (ipd_int_sum.s.c_coll)
        PRINT_ERROR("IPD_INT_SUM[C_COLL]: Set when the packet/WQE commands to be sent to IOB\n"
                    "    collides.\n"
                    "    This is a PASS-3 Field.\n");
    if (ipd_int_sum.s.cc_ovr)
        PRINT_ERROR("IPD_INT_SUM[CC_OVR]: Set when the command credits to the IOB overflow.\n"
                    "    This is a PASS-3 Field.\n");
    if (ipd_int_sum.s.dc_ovr)
        PRINT_ERROR("IPD_INT_SUM[DC_OVR]: Set when the data credits to the IOB overflow.\n"
                    "    This is a PASS-3 Field.\n");
    if (ipd_int_sum.s.bp_sub)
        PRINT_ERROR("IPD_INT_SUM[BP_SUB]: Set when a backpressure subtract is done with a\n"
                    "    supplied illegal value.\n");
    if (ipd_int_sum.s.prc_par3)
        PRINT_ERROR("IPD_INT_SUM[PRC_PAR3]: Set when a parity error is dected for bits\n"
                    "    [127:96] of the PBM memory.\n");
    if (ipd_int_sum.s.prc_par2)
        PRINT_ERROR("IPD_INT_SUM[PRC_PAR2]: Set when a parity error is dected for bits\n"
                    "    [95:64] of the PBM memory.\n");
    if (ipd_int_sum.s.prc_par1)
        PRINT_ERROR("IPD_INT_SUM[PRC_PAR1]: Set when a parity error is dected for bits\n"
                    "    [63:32] of the PBM memory.\n");
    if (ipd_int_sum.s.prc_par0)
        PRINT_ERROR("IPD_INT_SUM[PRC_PAR0]: Set when a parity error is dected for bits\n"
                    "    [31:0] of the PBM memory.\n");
}


/**
 * __cvmx_interrupt_key_int_enb_enable enables all interrupt bits in cvmx_key_int_enb_t
 */
void __cvmx_interrupt_key_int_enb_enable(void)
{
    cvmx_key_int_enb_t key_int_enb;
    cvmx_write_csr(CVMX_KEY_INT_SUM, cvmx_read_csr(CVMX_KEY_INT_SUM));
    key_int_enb.u64 = 0;
    if (OCTEON_IS_MODEL(OCTEON_CN56XX))
    {
        // Skipping key_int_enb.s.reserved_4_63
        key_int_enb.s.ked1_dbe = 1;
        key_int_enb.s.ked1_sbe = 1;
        key_int_enb.s.ked0_dbe = 1;
        key_int_enb.s.ked0_sbe = 1;
    }
    if (OCTEON_IS_MODEL(OCTEON_CN38XX))
    {
        // Skipping key_int_enb.s.reserved_4_63
        key_int_enb.s.ked1_dbe = 1;
        key_int_enb.s.ked1_sbe = 1;
        key_int_enb.s.ked0_dbe = 1;
        key_int_enb.s.ked0_sbe = 1;
    }
    if (OCTEON_IS_MODEL(OCTEON_CN58XX))
    {
        // Skipping key_int_enb.s.reserved_4_63
        key_int_enb.s.ked1_dbe = 1;
        key_int_enb.s.ked1_sbe = 1;
        key_int_enb.s.ked0_dbe = 1;
        key_int_enb.s.ked0_sbe = 1;
    }
    cvmx_write_csr(CVMX_KEY_INT_ENB, key_int_enb.u64);
}


/**
 * __cvmx_interrupt_key_int_sum_decode decodes all interrupt bits in cvmx_key_int_sum_t
 */
void __cvmx_interrupt_key_int_sum_decode(void)
{
    cvmx_key_int_sum_t key_int_sum;
    key_int_sum.u64 = cvmx_read_csr(CVMX_KEY_INT_SUM);
    key_int_sum.u64 &= cvmx_read_csr(CVMX_KEY_INT_ENB);
    cvmx_write_csr(CVMX_KEY_INT_SUM, key_int_sum.u64);
    // Skipping key_int_sum.s.reserved_4_63
    if (key_int_sum.s.ked1_dbe)
        PRINT_ERROR("KEY_INT_SUM[KED1_DBE]: Error bit\n");
    if (key_int_sum.s.ked1_sbe)
        PRINT_ERROR("KEY_INT_SUM[KED1_SBE]: Error bit\n");
    if (key_int_sum.s.ked0_dbe)
        PRINT_ERROR("KEY_INT_SUM[KED0_DBE]: Error bit\n");
    if (key_int_sum.s.ked0_sbe)
        PRINT_ERROR("KEY_INT_SUM[KED0_SBE]: Error bit\n");
}


/**
 * __cvmx_interrupt_mio_boot_int_enable enables all interrupt bits in cvmx_mio_boot_int_t
 */
void __cvmx_interrupt_mio_boot_int_enable(void)
{
    cvmx_mio_boot_int_t mio_boot_int;
    cvmx_write_csr(CVMX_MIO_BOOT_ERR, cvmx_read_csr(CVMX_MIO_BOOT_ERR));
    mio_boot_int.u64 = 0;
    if (OCTEON_IS_MODEL(OCTEON_CN56XX))
    {
        // Skipping mio_boot_int.s.reserved_2_63
        mio_boot_int.s.wait_int = 1;
        mio_boot_int.s.adr_int = 1;
    }
    if (OCTEON_IS_MODEL(OCTEON_CN30XX))
    {
        // Skipping mio_boot_int.s.reserved_2_63
        mio_boot_int.s.wait_int = 1;
        mio_boot_int.s.adr_int = 1;
    }
    if (OCTEON_IS_MODEL(OCTEON_CN50XX))
    {
        // Skipping mio_boot_int.s.reserved_2_63
        mio_boot_int.s.wait_int = 1;
        mio_boot_int.s.adr_int = 1;
    }
    if (OCTEON_IS_MODEL(OCTEON_CN38XX))
    {
        // Skipping mio_boot_int.s.reserved_2_63
        mio_boot_int.s.wait_int = 1;
        mio_boot_int.s.adr_int = 1;
    }
    if (OCTEON_IS_MODEL(OCTEON_CN31XX))
    {
        // Skipping mio_boot_int.s.reserved_2_63
        mio_boot_int.s.wait_int = 1;
        mio_boot_int.s.adr_int = 1;
    }
    if (OCTEON_IS_MODEL(OCTEON_CN58XX))
    {
        // Skipping mio_boot_int.s.reserved_2_63
        mio_boot_int.s.wait_int = 1;
        mio_boot_int.s.adr_int = 1;
    }
    if (OCTEON_IS_MODEL(OCTEON_CN52XX))
    {
        // Skipping mio_boot_int.s.reserved_2_63
        mio_boot_int.s.wait_int = 1;
        mio_boot_int.s.adr_int = 1;
    }
    cvmx_write_csr(CVMX_MIO_BOOT_INT, mio_boot_int.u64);
}


/**
 * __cvmx_interrupt_mio_boot_err_decode decodes all interrupt bits in cvmx_mio_boot_err_t
 */
void __cvmx_interrupt_mio_boot_err_decode(void)
{
    cvmx_mio_boot_err_t mio_boot_err;
    mio_boot_err.u64 = cvmx_read_csr(CVMX_MIO_BOOT_ERR);
    mio_boot_err.u64 &= cvmx_read_csr(CVMX_MIO_BOOT_INT);
    cvmx_write_csr(CVMX_MIO_BOOT_ERR, mio_boot_err.u64);
    // Skipping mio_boot_err.s.reserved_2_63
    if (mio_boot_err.s.wait_err)
        PRINT_ERROR("MIO_BOOT_ERR[WAIT_ERR]: Wait mode error\n");
    if (mio_boot_err.s.adr_err)
        PRINT_ERROR("MIO_BOOT_ERR[ADR_ERR]: Address decode error\n");
}


/**
 * __cvmx_interrupt_npei_int_sum_decode decodes all interrupt bits in cvmx_npei_int_sum_t
 */
void __cvmx_interrupt_npei_int_sum_decode(void)
{
    cvmx_npei_int_sum_t npei_int_sum;
    npei_int_sum.u64 = cvmx_read_csr(CVMX_PEXP_NPEI_INT_SUM);
    /* Note that NPEI_INT_ENB2 controls the internal RSL interrupts.
        NPEI_INT_ENB controls external forwarding which is not what we
        want. It is a little strange that we are using NPEI_INT_SUM with
        NPEI_INT_ENB2, but we need the R/W version of NPEI_INT_SUM2 and
        internal RSL interrupts */
    npei_int_sum.u64 &= cvmx_read_csr(CVMX_PEXP_NPEI_INT_ENB2);
    cvmx_write_csr(CVMX_PEXP_NPEI_INT_SUM, npei_int_sum.u64);
    if (npei_int_sum.s.mio_inta)
        PRINT_ERROR("NPEI_INT_SUM[MIO_INTA]: Interrupt from MIO.\n");
    // Skipping npei_int_sum.s.reserved_62_62
    if (npei_int_sum.s.int_a)
        PRINT_ERROR("NPEI_INT_SUM[INT_A]: Set when a bit in the NPEI_INT_A_SUM register and\n"
                    "    the cooresponding bit in the NPEI_INT_A_ENB\n"
                    "    register is set.\n");
    if (npei_int_sum.s.c1_ldwn)
    {
        cvmx_ciu_soft_prst_t ciu_soft_prst;
        PRINT_ERROR("NPEI_INT_SUM[C1_LDWN]: Reset request due to link1 down status.\n");
        ciu_soft_prst.u64 = cvmx_read_csr(CVMX_CIU_SOFT_PRST1);
        if (!ciu_soft_prst.s.soft_prst)
        {
            /* Attempt to automatically bring the link back up */
            cvmx_pcie_rc_shutdown(1);
            cvmx_pcie_rc_initialize(1);
        }
        cvmx_write_csr(CVMX_PEXP_NPEI_INT_SUM, cvmx_read_csr(CVMX_PEXP_NPEI_INT_SUM));
    }
    if (npei_int_sum.s.c0_ldwn)
    {
        cvmx_ciu_soft_prst_t ciu_soft_prst;
        PRINT_ERROR("NPEI_INT_SUM[C0_LDWN]: Reset request due to link0 down status.\n");
        ciu_soft_prst.u64 = cvmx_read_csr(CVMX_CIU_SOFT_PRST);
        if (!ciu_soft_prst.s.soft_prst)
        {
            /* Attempt to automatically bring the link back up */
            cvmx_pcie_rc_shutdown(0);
            cvmx_pcie_rc_initialize(0);
        }
        cvmx_write_csr(CVMX_PEXP_NPEI_INT_SUM, cvmx_read_csr(CVMX_PEXP_NPEI_INT_SUM));
    }
    if (npei_int_sum.s.c1_exc)
    {
#if 0
        PRINT_ERROR("NPEI_INT_SUM[C1_EXC]: Set when the PESC1_DBG_INFO register has a bit\n"
                    "    set and its cooresponding PESC1_DBG_INFO_EN bit\n"
                    "    is set.\n");
#endif
        __cvmx_interrupt_pescx_dbg_info_decode(1);
    }
    if (npei_int_sum.s.c0_exc)
    {
#if 0
        PRINT_ERROR("NPEI_INT_SUM[C0_EXC]: Set when the PESC0_DBG_INFO register has a bit\n"
                    "    set and its cooresponding PESC0_DBG_INFO_EN bit\n"
                    "    is set.\n");
#endif
        __cvmx_interrupt_pescx_dbg_info_decode(0);
    }
    if (npei_int_sum.s.c1_up_wf)
        PRINT_ERROR("NPEI_INT_SUM[C1_UP_WF]: Received Unsupported P-TLP for filtered window\n"
                    "    register. Core1.\n");
    if (npei_int_sum.s.c0_up_wf)
        PRINT_ERROR("NPEI_INT_SUM[C0_UP_WF]: Received Unsupported P-TLP for filtered window\n"
                    "    register. Core0.\n");
    if (npei_int_sum.s.c1_un_wf)
        PRINT_ERROR("NPEI_INT_SUM[C1_UN_WF]: Received Unsupported N-TLP for filtered window\n"
                    "    register. Core1.\n");
    if (npei_int_sum.s.c0_un_wf)
        PRINT_ERROR("NPEI_INT_SUM[C0_UN_WF]: Received Unsupported N-TLP for filtered window\n"
                    "    register. Core0.\n");
    if (npei_int_sum.s.c1_un_bx)
        PRINT_ERROR("NPEI_INT_SUM[C1_UN_BX]: Received Unsupported N-TLP for unknown Bar.\n"
                    "    Core 1.\n");
    if (npei_int_sum.s.c1_un_wi)
        PRINT_ERROR("NPEI_INT_SUM[C1_UN_WI]: Received Unsupported N-TLP for Window Register.\n"
                    "    Core 1.\n");
    if (npei_int_sum.s.c1_un_b2)
        PRINT_ERROR("NPEI_INT_SUM[C1_UN_B2]: Received Unsupported N-TLP for Bar2.\n"
                    "    Core 1.\n");
    if (npei_int_sum.s.c1_un_b1)
        PRINT_ERROR("NPEI_INT_SUM[C1_UN_B1]: Received Unsupported N-TLP for Bar1.\n"
                    "    Core 1.\n");
    if (npei_int_sum.s.c1_un_b0)
        PRINT_ERROR("NPEI_INT_SUM[C1_UN_B0]: Received Unsupported N-TLP for Bar0.\n"
                    "    Core 1.\n");
    if (npei_int_sum.s.c1_up_bx)
        PRINT_ERROR("NPEI_INT_SUM[C1_UP_BX]: Received Unsupported P-TLP for unknown Bar.\n"
                    "    Core 1.\n");
    if (npei_int_sum.s.c1_up_wi)
        PRINT_ERROR("NPEI_INT_SUM[C1_UP_WI]: Received Unsupported P-TLP for Window Register.\n"
                    "    Core 1.\n");
    if (npei_int_sum.s.c1_up_b2)
        PRINT_ERROR("NPEI_INT_SUM[C1_UP_B2]: Received Unsupported P-TLP for Bar2.\n"
                    "    Core 1.\n");
    if (npei_int_sum.s.c1_up_b1)
        PRINT_ERROR("NPEI_INT_SUM[C1_UP_B1]: Received Unsupported P-TLP for Bar1.\n"
                    "    Core 1.\n");
    if (npei_int_sum.s.c1_up_b0)
        PRINT_ERROR("NPEI_INT_SUM[C1_UP_B0]: Received Unsupported P-TLP for Bar0.\n"
                    "    Core 1.\n");
    if (npei_int_sum.s.c0_un_bx)
        PRINT_ERROR("NPEI_INT_SUM[C0_UN_BX]: Received Unsupported N-TLP for unknown Bar.\n"
                    "    Core 0.\n");
    if (npei_int_sum.s.c0_un_wi)
        PRINT_ERROR("NPEI_INT_SUM[C0_UN_WI]: Received Unsupported N-TLP for Window Register.\n"
                    "    Core 0.\n");
    if (npei_int_sum.s.c0_un_b2)
        PRINT_ERROR("NPEI_INT_SUM[C0_UN_B2]: Received Unsupported N-TLP for Bar2.\n"
                    "    Core 0.\n");
    if (npei_int_sum.s.c0_un_b1)
        PRINT_ERROR("NPEI_INT_SUM[C0_UN_B1]: Received Unsupported N-TLP for Bar1.\n"
                    "    Core 0.\n");
    if (npei_int_sum.s.c0_un_b0)
        PRINT_ERROR("NPEI_INT_SUM[C0_UN_B0]: Received Unsupported N-TLP for Bar0.\n"
                    "    Core 0.\n");
    if (npei_int_sum.s.c0_up_bx)
        PRINT_ERROR("NPEI_INT_SUM[C0_UP_BX]: Received Unsupported P-TLP for unknown Bar.\n"
                    "    Core 0.\n");
    if (npei_int_sum.s.c0_up_wi)
        PRINT_ERROR("NPEI_INT_SUM[C0_UP_WI]: Received Unsupported P-TLP for Window Register.\n"
                    "    Core 0.\n");
    if (npei_int_sum.s.c0_up_b2)
        PRINT_ERROR("NPEI_INT_SUM[C0_UP_B2]: Received Unsupported P-TLP for Bar2.\n"
                    "    Core 0.\n");
    if (npei_int_sum.s.c0_up_b1)
        PRINT_ERROR("NPEI_INT_SUM[C0_UP_B1]: Received Unsupported P-TLP for Bar1.\n"
                    "    Core 0.\n");
    if (npei_int_sum.s.c0_up_b0)
        PRINT_ERROR("NPEI_INT_SUM[C0_UP_B0]: Received Unsupported P-TLP for Bar0.\n"
                    "    Core 0.\n");
    if (npei_int_sum.s.c1_hpint)
        PRINT_ERROR("NPEI_INT_SUM[C1_HPINT]: Hot-Plug Interrupt.\n"
                    "    Pcie Core 1 (hp_int).\n"
                    "    This interrupt will only be generated when\n"
                    "    PCIERC1_CFG034[DLLS_C] is generated. Hot plug is\n"
                    "    not supported.\n");
    if (npei_int_sum.s.c1_pmei)
        PRINT_ERROR("NPEI_INT_SUM[C1_PMEI]: PME Interrupt.\n"
                    "    Pcie Core 1. (cfg_pme_int)\n");
    if (npei_int_sum.s.c1_wake)
        PRINT_ERROR("NPEI_INT_SUM[C1_WAKE]: Wake up from Power Management Unit.\n"
                    "    Pcie Core 1. (wake_n)\n"
                    "    Octeon will never generate this interrupt.\n");
    if (npei_int_sum.s.crs1_dr)
        PRINT_ERROR("NPEI_INT_SUM[CRS1_DR]: Had a CRS when Retries were disabled.\n");
    if (npei_int_sum.s.c1_se)
        PRINT_ERROR("NPEI_INT_SUM[C1_SE]: System Error, RC Mode Only.\n"
                    "    Pcie Core 1. (cfg_sys_err_rc)\n");
    if (npei_int_sum.s.crs1_er)
        PRINT_ERROR("NPEI_INT_SUM[CRS1_ER]: Had a CRS Timeout when Retries were enabled.\n");
    if (npei_int_sum.s.c1_aeri)
        PRINT_ERROR("NPEI_INT_SUM[C1_AERI]: Advanced Error Reporting Interrupt, RC Mode Only.\n"
                    "    Pcie Core 1.\n");
    if (npei_int_sum.s.c0_hpint)
        PRINT_ERROR("NPEI_INT_SUM[C0_HPINT]: Hot-Plug Interrupt.\n"
                    "    Pcie Core 0 (hp_int).\n"
                    "    This interrupt will only be generated when\n"
                    "    PCIERC0_CFG034[DLLS_C] is generated. Hot plug is\n"
                    "    not supported.\n");
    if (npei_int_sum.s.c0_pmei)
        PRINT_ERROR("NPEI_INT_SUM[C0_PMEI]: PME Interrupt.\n"
                    "    Pcie Core 0. (cfg_pme_int)\n");
    if (npei_int_sum.s.c0_wake)
        PRINT_ERROR("NPEI_INT_SUM[C0_WAKE]: Wake up from Power Management Unit.\n"
                    "    Pcie Core 0. (wake_n)\n"
                    "    Octeon will never generate this interrupt.\n");
    if (npei_int_sum.s.crs0_dr)
        PRINT_ERROR("NPEI_INT_SUM[CRS0_DR]: Had a CRS when Retries were disabled.\n");
    if (npei_int_sum.s.c0_se)
        PRINT_ERROR("NPEI_INT_SUM[C0_SE]: System Error, RC Mode Only.\n"
                    "    Pcie Core 0. (cfg_sys_err_rc)\n");
    if (npei_int_sum.s.crs0_er)
        PRINT_ERROR("NPEI_INT_SUM[CRS0_ER]: Had a CRS Timeout when Retries were enabled.\n");
    if (npei_int_sum.s.c0_aeri)
        PRINT_ERROR("NPEI_INT_SUM[C0_AERI]: Advanced Error Reporting Interrupt, RC Mode Only.\n"
                    "    Pcie Core 0 (cfg_aer_rc_err_int).\n");
    if (npei_int_sum.s.ptime)
        PRINT_ERROR("NPEI_INT_SUM[PTIME]: Packet Timer has an interrupt. Which rings can\n"
                    "    be found in NPEI_PKT_TIME_INT.\n");
    if (npei_int_sum.s.pcnt)
        PRINT_ERROR("NPEI_INT_SUM[PCNT]: Packet Counter has an interrupt. Which rings can\n"
                    "    be found in NPEI_PKT_CNT_INT.\n");
    if (npei_int_sum.s.pidbof)
        PRINT_ERROR("NPEI_INT_SUM[PIDBOF]: Packet Instruction Doorbell count overflowed. Which\n"
                    "    doorbell can be found in NPEI_INT_INFO[PIDBOF]\n");
    if (npei_int_sum.s.psldbof)
        PRINT_ERROR("NPEI_INT_SUM[PSLDBOF]: Packet Scatterlist Doorbell count overflowed. Which\n"
                    "    doorbell can be found in NPEI_INT_INFO[PSLDBOF]\n");
    if (npei_int_sum.s.dtime1)
        PRINT_ERROR("NPEI_INT_SUM[DTIME1]: Whenever NPEI_DMA_CNTS[DMA1] is not 0, the\n"
                    "    DMA_CNT1 timer increments every core clock. When\n"
                    "    DMA_CNT1 timer exceeds NPEI_DMA1_INT_LEVEL[TIME],\n"
                    "    this bit is set. Writing a '1' to this bit also\n"
                    "    clears the DMA_CNT1 timer.\n");
    if (npei_int_sum.s.dtime0)
        PRINT_ERROR("NPEI_INT_SUM[DTIME0]: Whenever NPEI_DMA_CNTS[DMA0] is not 0, the\n"
                    "    DMA_CNT0 timer increments every core clock. When\n"
                    "    DMA_CNT0 timer exceeds NPEI_DMA0_INT_LEVEL[TIME],\n"
                    "    this bit is set. Writing a '1' to this bit also\n"
                    "    clears the DMA_CNT0 timer.\n");
    if (npei_int_sum.s.dcnt1)
        PRINT_ERROR("NPEI_INT_SUM[DCNT1]: This bit indicates that NPEI_DMA_CNTS[DMA1] was/is\n"
                    "    greater than NPEI_DMA1_INT_LEVEL[CNT].\n");
    if (npei_int_sum.s.dcnt0)
        PRINT_ERROR("NPEI_INT_SUM[DCNT0]: This bit indicates that NPEI_DMA_CNTS[DMA0] was/is\n"
                    "    greater than NPEI_DMA0_INT_LEVEL[CNT].\n");
    if (npei_int_sum.s.dma1fi)
        PRINT_ERROR("NPEI_INT_SUM[DMA1FI]: DMA0 set Forced Interrupt.\n");
    if (npei_int_sum.s.dma0fi)
        PRINT_ERROR("NPEI_INT_SUM[DMA0FI]: DMA0 set Forced Interrupt.\n");
    if (npei_int_sum.s.dma4dbo)
        PRINT_ERROR("NPEI_INT_SUM[DMA4DBO]: DMA4 doorbell overflow.\n"
                    "    Bit[32] of the doorbell count was set.\n");
    if (npei_int_sum.s.dma3dbo)
        PRINT_ERROR("NPEI_INT_SUM[DMA3DBO]: DMA3 doorbell overflow.\n"
                    "    Bit[32] of the doorbell count was set.\n");
    if (npei_int_sum.s.dma2dbo)
        PRINT_ERROR("NPEI_INT_SUM[DMA2DBO]: DMA2 doorbell overflow.\n"
                    "    Bit[32] of the doorbell count was set.\n");
    if (npei_int_sum.s.dma1dbo)
        PRINT_ERROR("NPEI_INT_SUM[DMA1DBO]: DMA1 doorbell overflow.\n"
                    "    Bit[32] of the doorbell count was set.\n");
    if (npei_int_sum.s.dma0dbo)
        PRINT_ERROR("NPEI_INT_SUM[DMA0DBO]: DMA0 doorbell overflow.\n"
                    "    Bit[32] of the doorbell count was set.\n");
    if (npei_int_sum.s.iob2big)
        PRINT_ERROR("NPEI_INT_SUM[IOB2BIG]: A requested IOBDMA is to large.\n");
    if (npei_int_sum.s.bar0_to)
        PRINT_ERROR("NPEI_INT_SUM[BAR0_TO]: BAR0 R/W to a NCB device did not receive\n"
                    "    read-data/commit in 0xffff core clocks.\n");
    if (npei_int_sum.s.rml_wto)
        PRINT_ERROR("NPEI_INT_SUM[RML_WTO]: RML write did not get commit in 0xffff core clocks.\n");
    if (npei_int_sum.s.rml_rto)
        PRINT_ERROR("NPEI_INT_SUM[RML_RTO]: RML read did not return data in 0xffff core clocks.\n");
}


/**
 * __cvmx_interrupt_npei_int_enb2_enable enables all interrupt bits in cvmx_npei_int_enb2_t
 */
void __cvmx_interrupt_npei_int_enb2_enable(void)
{
    int enable_pcie0 = 0;
    int enable_pcie1 = 0;
    cvmx_npei_int_enb2_t npei_int_enb2;
    /* Reset NPEI_INT_SUM, as NPEI_INT_SUM2 is a read-only copy of NPEI_INT_SUM. */
    cvmx_write_csr(CVMX_PEXP_NPEI_INT_SUM, cvmx_read_csr(CVMX_PEXP_NPEI_INT_SUM));
    npei_int_enb2.u64 = 0;
    if (OCTEON_IS_MODEL(OCTEON_CN56XX))
    {
        cvmx_pescx_ctl_status2_t pescx_ctl_status2;
        pescx_ctl_status2.u64 = cvmx_read_csr(CVMX_PESCX_CTL_STATUS2(0));
        enable_pcie0 = !pescx_ctl_status2.s.pcierst;
        pescx_ctl_status2.u64 = cvmx_read_csr(CVMX_PESCX_CTL_STATUS2(1));
        enable_pcie1 = !pescx_ctl_status2.s.pcierst;

        // Skipping npei_int_enb2.s.reserved_62_63
        npei_int_enb2.s.int_a = 1;
        npei_int_enb2.s.c1_ldwn = enable_pcie1;
        npei_int_enb2.s.c0_ldwn = enable_pcie0;
        npei_int_enb2.s.c1_exc = enable_pcie1;
        npei_int_enb2.s.c0_exc = enable_pcie0;
        npei_int_enb2.s.c1_up_wf = enable_pcie1;
        npei_int_enb2.s.c0_up_wf = enable_pcie0;
        npei_int_enb2.s.c1_un_wf = enable_pcie1;
        npei_int_enb2.s.c0_un_wf = enable_pcie0;
        npei_int_enb2.s.c1_un_bx = enable_pcie1;
        npei_int_enb2.s.c1_un_wi = enable_pcie1;
        npei_int_enb2.s.c1_un_b2 = enable_pcie1;
        npei_int_enb2.s.c1_un_b1 = enable_pcie1;
        npei_int_enb2.s.c1_un_b0 = enable_pcie1;
        npei_int_enb2.s.c1_up_bx = enable_pcie1;
        npei_int_enb2.s.c1_up_wi = enable_pcie1;
        npei_int_enb2.s.c1_up_b2 = enable_pcie1;
        npei_int_enb2.s.c1_up_b1 = enable_pcie1;
        npei_int_enb2.s.c1_up_b0 = enable_pcie1;
        npei_int_enb2.s.c0_un_bx = enable_pcie0;
        npei_int_enb2.s.c0_un_wi = enable_pcie0;
        npei_int_enb2.s.c0_un_b2 = enable_pcie0;
        npei_int_enb2.s.c0_un_b1 = enable_pcie0;
        npei_int_enb2.s.c0_un_b0 = enable_pcie0;
        npei_int_enb2.s.c0_up_bx = enable_pcie0;
        npei_int_enb2.s.c0_up_wi = enable_pcie0;
        npei_int_enb2.s.c0_up_b2 = enable_pcie0;
        npei_int_enb2.s.c0_up_b1 = enable_pcie0;
        npei_int_enb2.s.c0_up_b0 = enable_pcie0;
        npei_int_enb2.s.c1_hpint = enable_pcie1;
        npei_int_enb2.s.c1_pmei = enable_pcie1;
        npei_int_enb2.s.c1_wake = enable_pcie1;
        npei_int_enb2.s.crs1_dr = enable_pcie1;
        npei_int_enb2.s.c1_se = enable_pcie1;
        npei_int_enb2.s.crs1_er = enable_pcie1;
        npei_int_enb2.s.c1_aeri = enable_pcie1;
        npei_int_enb2.s.c0_hpint = enable_pcie0;
        npei_int_enb2.s.c0_pmei = enable_pcie0;
        npei_int_enb2.s.c0_wake = enable_pcie0;
        npei_int_enb2.s.crs0_dr = enable_pcie0;
        npei_int_enb2.s.c0_se = enable_pcie0;
        npei_int_enb2.s.crs0_er = enable_pcie0;
        npei_int_enb2.s.c0_aeri = enable_pcie0;
        npei_int_enb2.s.ptime = 1;
        npei_int_enb2.s.pcnt = 1;
        npei_int_enb2.s.pidbof = 1;
        npei_int_enb2.s.psldbof = 1;
        npei_int_enb2.s.dtime1 = 1;
        npei_int_enb2.s.dtime0 = 1;
        npei_int_enb2.s.dcnt1 = 1;
        npei_int_enb2.s.dcnt0 = 1;
        npei_int_enb2.s.dma1fi = 1;
        npei_int_enb2.s.dma0fi = 1;
        npei_int_enb2.s.dma4dbo = 1;
        npei_int_enb2.s.dma3dbo = 1;
        npei_int_enb2.s.dma2dbo = 1;
        npei_int_enb2.s.dma1dbo = 1;
        npei_int_enb2.s.dma0dbo = 1;
        npei_int_enb2.s.iob2big = 1;
        npei_int_enb2.s.bar0_to = 1;
        npei_int_enb2.s.rml_wto = 1;
        npei_int_enb2.s.rml_rto = 1;
    }
    if (OCTEON_IS_MODEL(OCTEON_CN52XX))
    {
        cvmx_pescx_ctl_status2_t pescx_ctl_status2;
        cvmx_npei_dbg_data_t npei_dbg_data;
        pescx_ctl_status2.u64 = cvmx_read_csr(CVMX_PESCX_CTL_STATUS2(0));
        enable_pcie0 = !pescx_ctl_status2.s.pcierst;
        npei_dbg_data.u64 = cvmx_read_csr(CVMX_PEXP_NPEI_DBG_DATA);
        if (!npei_dbg_data.cn52xx.qlm0_link_width)
        {
            pescx_ctl_status2.u64 = cvmx_read_csr(CVMX_PESCX_CTL_STATUS2(1));
            enable_pcie1 = !pescx_ctl_status2.s.pcierst;
        }

        // Skipping npei_int_enb2.s.reserved_62_63
        npei_int_enb2.s.int_a = 1;
        npei_int_enb2.s.c1_ldwn = enable_pcie1;
        npei_int_enb2.s.c0_ldwn = enable_pcie0;
        npei_int_enb2.s.c1_exc = enable_pcie1;
        npei_int_enb2.s.c0_exc = enable_pcie0;
        npei_int_enb2.s.c1_up_wf = enable_pcie1;
        npei_int_enb2.s.c0_up_wf = enable_pcie0;
        npei_int_enb2.s.c1_un_wf = enable_pcie1;
        npei_int_enb2.s.c0_un_wf = enable_pcie0;
        npei_int_enb2.s.c1_un_bx = enable_pcie1;
        npei_int_enb2.s.c1_un_wi = enable_pcie1;
        npei_int_enb2.s.c1_un_b2 = enable_pcie1;
        npei_int_enb2.s.c1_un_b1 = enable_pcie1;
        npei_int_enb2.s.c1_un_b0 = enable_pcie1;
        npei_int_enb2.s.c1_up_bx = enable_pcie1;
        npei_int_enb2.s.c1_up_wi = enable_pcie1;
        npei_int_enb2.s.c1_up_b2 = enable_pcie1;
        npei_int_enb2.s.c1_up_b1 = enable_pcie1;
        npei_int_enb2.s.c1_up_b0 = enable_pcie1;
        npei_int_enb2.s.c0_un_bx = enable_pcie0;
        npei_int_enb2.s.c0_un_wi = enable_pcie0;
        npei_int_enb2.s.c0_un_b2 = enable_pcie0;
        npei_int_enb2.s.c0_un_b1 = enable_pcie0;
        npei_int_enb2.s.c0_un_b0 = enable_pcie0;
        npei_int_enb2.s.c0_up_bx = enable_pcie0;
        npei_int_enb2.s.c0_up_wi = enable_pcie0;
        npei_int_enb2.s.c0_up_b2 = enable_pcie0;
        npei_int_enb2.s.c0_up_b1 = enable_pcie0;
        npei_int_enb2.s.c0_up_b0 = enable_pcie0;
        npei_int_enb2.s.c1_hpint = enable_pcie1;
        npei_int_enb2.s.c1_pmei = enable_pcie1;
        npei_int_enb2.s.c1_wake = enable_pcie1;
        npei_int_enb2.s.crs1_dr = enable_pcie1;
        npei_int_enb2.s.c1_se = enable_pcie1;
        npei_int_enb2.s.crs1_er = enable_pcie1;
        npei_int_enb2.s.c1_aeri = enable_pcie1;
        npei_int_enb2.s.c0_hpint = enable_pcie0;
        npei_int_enb2.s.c0_pmei = enable_pcie0;
        npei_int_enb2.s.c0_wake = enable_pcie0;
        npei_int_enb2.s.crs0_dr = enable_pcie0;
        npei_int_enb2.s.c0_se = enable_pcie0;
        npei_int_enb2.s.crs0_er = enable_pcie0;
        npei_int_enb2.s.c0_aeri = enable_pcie0;
        npei_int_enb2.s.ptime = 1;
        npei_int_enb2.s.pcnt = 1;
        npei_int_enb2.s.pidbof = 1;
        npei_int_enb2.s.psldbof = 1;
        npei_int_enb2.s.dtime1 = 1;
        npei_int_enb2.s.dtime0 = 1;
        npei_int_enb2.s.dcnt1 = 1;
        npei_int_enb2.s.dcnt0 = 1;
        npei_int_enb2.s.dma1fi = 1;
        npei_int_enb2.s.dma0fi = 1;
        if (!OCTEON_IS_MODEL(OCTEON_CN52XX_PASS1_X))
            npei_int_enb2.s.dma4dbo = 1;
        npei_int_enb2.s.dma3dbo = 1;
        npei_int_enb2.s.dma2dbo = 1;
        npei_int_enb2.s.dma1dbo = 1;
        npei_int_enb2.s.dma0dbo = 1;
        npei_int_enb2.s.iob2big = 1;
        npei_int_enb2.s.bar0_to = 1;
        npei_int_enb2.s.rml_wto = 1;
        npei_int_enb2.s.rml_rto = 1;
    }
    cvmx_write_csr(CVMX_PEXP_NPEI_INT_ENB2, npei_int_enb2.u64);
    if (enable_pcie0)
        __cvmx_interrupt_pescx_dbg_info_en_enable(0);
    if (enable_pcie1)
        __cvmx_interrupt_pescx_dbg_info_en_enable(1);
}


/**
 * __cvmx_interrupt_npi_int_enb_enable enables all interrupt bits in cvmx_npi_int_enb_t
 */
void __cvmx_interrupt_npi_int_enb_enable(void)
{
    cvmx_npi_int_enb_t npi_int_enb;
    cvmx_write_csr(CVMX_NPI_INT_SUM, cvmx_read_csr(CVMX_NPI_INT_SUM));
    npi_int_enb.u64 = 0;
    if (OCTEON_IS_MODEL(OCTEON_CN30XX))
    {
        // Skipping npi_int_enb.s.reserved_62_63
        npi_int_enb.s.q1_a_f = 1;
        npi_int_enb.s.q1_s_e = 1;
        npi_int_enb.s.pdf_p_f = 1;
        npi_int_enb.s.pdf_p_e = 1;
        npi_int_enb.s.pcf_p_f = 1;
        npi_int_enb.s.pcf_p_e = 1;
        npi_int_enb.s.rdx_s_e = 1;
        npi_int_enb.s.rwx_s_e = 1;
        npi_int_enb.s.pnc_a_f = 1;
        npi_int_enb.s.pnc_s_e = 1;
        npi_int_enb.s.com_a_f = 1;
        npi_int_enb.s.com_s_e = 1;
        npi_int_enb.s.q3_a_f = 1;
        npi_int_enb.s.q3_s_e = 1;
        npi_int_enb.s.q2_a_f = 1;
        npi_int_enb.s.q2_s_e = 1;
        npi_int_enb.s.pcr_a_f = 1;
        npi_int_enb.s.pcr_s_e = 1;
        npi_int_enb.s.fcr_a_f = 1;
        npi_int_enb.s.fcr_s_e = 1;
        npi_int_enb.s.iobdma = 1;
        npi_int_enb.s.p_dperr = 1;
        npi_int_enb.s.win_rto = 1;
        // Skipping npi_int_enb.s.reserved_36_38
        npi_int_enb.s.i0_pperr = 1;
        // Skipping npi_int_enb.s.reserved_32_34
        npi_int_enb.s.p0_ptout = 1;
        // Skipping npi_int_enb.s.reserved_28_30
        npi_int_enb.s.p0_pperr = 1;
        // Skipping npi_int_enb.s.reserved_24_26
        npi_int_enb.s.g0_rtout = 1;
        // Skipping npi_int_enb.s.reserved_20_22
        npi_int_enb.s.p0_perr = 1;
        // Skipping npi_int_enb.s.reserved_16_18
        npi_int_enb.s.p0_rtout = 1;
        // Skipping npi_int_enb.s.reserved_12_14
        npi_int_enb.s.i0_overf = 1;
        // Skipping npi_int_enb.s.reserved_8_10
        npi_int_enb.s.i0_rtout = 1;
        // Skipping npi_int_enb.s.reserved_4_6
        npi_int_enb.s.po0_2sml = 1;
        npi_int_enb.s.pci_rsl = 1;
        npi_int_enb.s.rml_wto = 1;
        npi_int_enb.s.rml_rto = 1;
    }
    if (OCTEON_IS_MODEL(OCTEON_CN50XX))
    {
        // Skipping npi_int_enb.s.reserved_62_63
        npi_int_enb.s.q1_a_f = 1;
        npi_int_enb.s.q1_s_e = 1;
        npi_int_enb.s.pdf_p_f = 1;
        npi_int_enb.s.pdf_p_e = 1;
        npi_int_enb.s.pcf_p_f = 1;
        npi_int_enb.s.pcf_p_e = 1;
        npi_int_enb.s.rdx_s_e = 1;
        npi_int_enb.s.rwx_s_e = 1;
        npi_int_enb.s.pnc_a_f = 1;
        npi_int_enb.s.pnc_s_e = 1;
        npi_int_enb.s.com_a_f = 1;
        npi_int_enb.s.com_s_e = 1;
        npi_int_enb.s.q3_a_f = 1;
        npi_int_enb.s.q3_s_e = 1;
        npi_int_enb.s.q2_a_f = 1;
        npi_int_enb.s.q2_s_e = 1;
        npi_int_enb.s.pcr_a_f = 1;
        npi_int_enb.s.pcr_s_e = 1;
        npi_int_enb.s.fcr_a_f = 1;
        npi_int_enb.s.fcr_s_e = 1;
        npi_int_enb.s.iobdma = 1;
        npi_int_enb.s.p_dperr = 1;
        npi_int_enb.s.win_rto = 1;
        // Skipping npi_int_enb.s.reserved_37_38
        npi_int_enb.s.i1_pperr = 1;
        npi_int_enb.s.i0_pperr = 1;
        // Skipping npi_int_enb.s.reserved_33_34
        npi_int_enb.s.p1_ptout = 1;
        npi_int_enb.s.p0_ptout = 1;
        // Skipping npi_int_enb.s.reserved_29_30
        npi_int_enb.s.p1_pperr = 1;
        npi_int_enb.s.p0_pperr = 1;
        // Skipping npi_int_enb.s.reserved_25_26
        npi_int_enb.s.g1_rtout = 1;
        npi_int_enb.s.g0_rtout = 1;
        // Skipping npi_int_enb.s.reserved_21_22
        npi_int_enb.s.p1_perr = 1;
        npi_int_enb.s.p0_perr = 1;
        // Skipping npi_int_enb.s.reserved_17_18
        npi_int_enb.s.p1_rtout = 1;
        npi_int_enb.s.p0_rtout = 1;
        // Skipping npi_int_enb.s.reserved_13_14
        npi_int_enb.s.i1_overf = 1;
        npi_int_enb.s.i0_overf = 1;
        // Skipping npi_int_enb.s.reserved_9_10
        npi_int_enb.s.i1_rtout = 1;
        npi_int_enb.s.i0_rtout = 1;
        // Skipping npi_int_enb.s.reserved_5_6
        npi_int_enb.s.po1_2sml = 1;
        npi_int_enb.s.po0_2sml = 1;
        npi_int_enb.s.pci_rsl = 1;
        npi_int_enb.s.rml_wto = 1;
        npi_int_enb.s.rml_rto = 1;
    }
    if (OCTEON_IS_MODEL(OCTEON_CN38XX))
    {
        // Skipping npi_int_enb.s.reserved_62_63
        npi_int_enb.s.q1_a_f = 1;
        npi_int_enb.s.q1_s_e = 1;
        npi_int_enb.s.pdf_p_f = 1;
        npi_int_enb.s.pdf_p_e = 1;
        npi_int_enb.s.pcf_p_f = 1;
        npi_int_enb.s.pcf_p_e = 1;
        npi_int_enb.s.rdx_s_e = 1;
        npi_int_enb.s.rwx_s_e = 1;
        npi_int_enb.s.pnc_a_f = 1;
        npi_int_enb.s.pnc_s_e = 1;
        npi_int_enb.s.com_a_f = 1;
        npi_int_enb.s.com_s_e = 1;
        npi_int_enb.s.q3_a_f = 1;
        npi_int_enb.s.q3_s_e = 1;
        npi_int_enb.s.q2_a_f = 1;
        npi_int_enb.s.q2_s_e = 1;
        npi_int_enb.s.pcr_a_f = 1;
        npi_int_enb.s.pcr_s_e = 1;
        npi_int_enb.s.fcr_a_f = 1;
        npi_int_enb.s.fcr_s_e = 1;
        npi_int_enb.s.iobdma = 1;
        npi_int_enb.s.p_dperr = 1;
        npi_int_enb.s.win_rto = 1;
        npi_int_enb.s.i3_pperr = 1;
        npi_int_enb.s.i2_pperr = 1;
        npi_int_enb.s.i1_pperr = 1;
        npi_int_enb.s.i0_pperr = 1;
        npi_int_enb.s.p3_ptout = 1;
        npi_int_enb.s.p2_ptout = 1;
        npi_int_enb.s.p1_ptout = 1;
        npi_int_enb.s.p0_ptout = 1;
        npi_int_enb.s.p3_pperr = 1;
        npi_int_enb.s.p2_pperr = 1;
        npi_int_enb.s.p1_pperr = 1;
        npi_int_enb.s.p0_pperr = 1;
        npi_int_enb.s.g3_rtout = 1;
        npi_int_enb.s.g2_rtout = 1;
        npi_int_enb.s.g1_rtout = 1;
        npi_int_enb.s.g0_rtout = 1;
        npi_int_enb.s.p3_perr = 1;
        npi_int_enb.s.p2_perr = 1;
        npi_int_enb.s.p1_perr = 1;
        npi_int_enb.s.p0_perr = 1;
        npi_int_enb.s.p3_rtout = 1;
        npi_int_enb.s.p2_rtout = 1;
        npi_int_enb.s.p1_rtout = 1;
        npi_int_enb.s.p0_rtout = 1;
        npi_int_enb.s.i3_overf = 1;
        npi_int_enb.s.i2_overf = 1;
        npi_int_enb.s.i1_overf = 1;
        npi_int_enb.s.i0_overf = 1;
        npi_int_enb.s.i3_rtout = 1;
        npi_int_enb.s.i2_rtout = 1;
        npi_int_enb.s.i1_rtout = 1;
        npi_int_enb.s.i0_rtout = 1;
        npi_int_enb.s.po3_2sml = 1;
        npi_int_enb.s.po2_2sml = 1;
        npi_int_enb.s.po1_2sml = 1;
        npi_int_enb.s.po0_2sml = 1;
        npi_int_enb.s.pci_rsl = 1;
        npi_int_enb.s.rml_wto = 1;
        npi_int_enb.s.rml_rto = 1;
    }
    if (OCTEON_IS_MODEL(OCTEON_CN31XX))
    {
        // Skipping npi_int_enb.s.reserved_62_63
        npi_int_enb.s.q1_a_f = 1;
        npi_int_enb.s.q1_s_e = 1;
        npi_int_enb.s.pdf_p_f = 1;
        npi_int_enb.s.pdf_p_e = 1;
        npi_int_enb.s.pcf_p_f = 1;
        npi_int_enb.s.pcf_p_e = 1;
        npi_int_enb.s.rdx_s_e = 1;
        npi_int_enb.s.rwx_s_e = 1;
        npi_int_enb.s.pnc_a_f = 1;
        npi_int_enb.s.pnc_s_e = 1;
        npi_int_enb.s.com_a_f = 1;
        npi_int_enb.s.com_s_e = 1;
        npi_int_enb.s.q3_a_f = 1;
        npi_int_enb.s.q3_s_e = 1;
        npi_int_enb.s.q2_a_f = 1;
        npi_int_enb.s.q2_s_e = 1;
        npi_int_enb.s.pcr_a_f = 1;
        npi_int_enb.s.pcr_s_e = 1;
        npi_int_enb.s.fcr_a_f = 1;
        npi_int_enb.s.fcr_s_e = 1;
        npi_int_enb.s.iobdma = 1;
        npi_int_enb.s.p_dperr = 1;
        npi_int_enb.s.win_rto = 1;
        // Skipping npi_int_enb.s.reserved_37_38
        npi_int_enb.s.i1_pperr = 1;
        npi_int_enb.s.i0_pperr = 1;
        // Skipping npi_int_enb.s.reserved_33_34
        npi_int_enb.s.p1_ptout = 1;
        npi_int_enb.s.p0_ptout = 1;
        // Skipping npi_int_enb.s.reserved_29_30
        npi_int_enb.s.p1_pperr = 1;
        npi_int_enb.s.p0_pperr = 1;
        // Skipping npi_int_enb.s.reserved_25_26
        npi_int_enb.s.g1_rtout = 1;
        npi_int_enb.s.g0_rtout = 1;
        // Skipping npi_int_enb.s.reserved_21_22
        npi_int_enb.s.p1_perr = 1;
        npi_int_enb.s.p0_perr = 1;
        // Skipping npi_int_enb.s.reserved_17_18
        npi_int_enb.s.p1_rtout = 1;
        npi_int_enb.s.p0_rtout = 1;
        // Skipping npi_int_enb.s.reserved_13_14
        npi_int_enb.s.i1_overf = 1;
        npi_int_enb.s.i0_overf = 1;
        // Skipping npi_int_enb.s.reserved_9_10
        npi_int_enb.s.i1_rtout = 1;
        npi_int_enb.s.i0_rtout = 1;
        // Skipping npi_int_enb.s.reserved_5_6
        npi_int_enb.s.po1_2sml = 1;
        npi_int_enb.s.po0_2sml = 1;
        npi_int_enb.s.pci_rsl = 1;
        npi_int_enb.s.rml_wto = 1;
        npi_int_enb.s.rml_rto = 1;
    }
    if (OCTEON_IS_MODEL(OCTEON_CN58XX))
    {
        // Skipping npi_int_enb.s.reserved_62_63
        npi_int_enb.s.q1_a_f = 1;
        npi_int_enb.s.q1_s_e = 1;
        npi_int_enb.s.pdf_p_f = 1;
        npi_int_enb.s.pdf_p_e = 1;
        npi_int_enb.s.pcf_p_f = 1;
        npi_int_enb.s.pcf_p_e = 1;
        npi_int_enb.s.rdx_s_e = 1;
        npi_int_enb.s.rwx_s_e = 1;
        npi_int_enb.s.pnc_a_f = 1;
        npi_int_enb.s.pnc_s_e = 1;
        npi_int_enb.s.com_a_f = 1;
        npi_int_enb.s.com_s_e = 1;
        npi_int_enb.s.q3_a_f = 1;
        npi_int_enb.s.q3_s_e = 1;
        npi_int_enb.s.q2_a_f = 1;
        npi_int_enb.s.q2_s_e = 1;
        npi_int_enb.s.pcr_a_f = 1;
        npi_int_enb.s.pcr_s_e = 1;
        npi_int_enb.s.fcr_a_f = 1;
        npi_int_enb.s.fcr_s_e = 1;
        npi_int_enb.s.iobdma = 1;
        npi_int_enb.s.p_dperr = 1;
        npi_int_enb.s.win_rto = 1;
        npi_int_enb.s.i3_pperr = 1;
        npi_int_enb.s.i2_pperr = 1;
        npi_int_enb.s.i1_pperr = 1;
        npi_int_enb.s.i0_pperr = 1;
        npi_int_enb.s.p3_ptout = 1;
        npi_int_enb.s.p2_ptout = 1;
        npi_int_enb.s.p1_ptout = 1;
        npi_int_enb.s.p0_ptout = 1;
        npi_int_enb.s.p3_pperr = 1;
        npi_int_enb.s.p2_pperr = 1;
        npi_int_enb.s.p1_pperr = 1;
        npi_int_enb.s.p0_pperr = 1;
        npi_int_enb.s.g3_rtout = 1;
        npi_int_enb.s.g2_rtout = 1;
        npi_int_enb.s.g1_rtout = 1;
        npi_int_enb.s.g0_rtout = 1;
        npi_int_enb.s.p3_perr = 1;
        npi_int_enb.s.p2_perr = 1;
        npi_int_enb.s.p1_perr = 1;
        npi_int_enb.s.p0_perr = 1;
        npi_int_enb.s.p3_rtout = 1;
        npi_int_enb.s.p2_rtout = 1;
        npi_int_enb.s.p1_rtout = 1;
        npi_int_enb.s.p0_rtout = 1;
        npi_int_enb.s.i3_overf = 1;
        npi_int_enb.s.i2_overf = 1;
        npi_int_enb.s.i1_overf = 1;
        npi_int_enb.s.i0_overf = 1;
        npi_int_enb.s.i3_rtout = 1;
        npi_int_enb.s.i2_rtout = 1;
        npi_int_enb.s.i1_rtout = 1;
        npi_int_enb.s.i0_rtout = 1;
        npi_int_enb.s.po3_2sml = 1;
        npi_int_enb.s.po2_2sml = 1;
        npi_int_enb.s.po1_2sml = 1;
        npi_int_enb.s.po0_2sml = 1;
        npi_int_enb.s.pci_rsl = 1;
        npi_int_enb.s.rml_wto = 1;
        npi_int_enb.s.rml_rto = 1;
    }
    cvmx_write_csr(CVMX_NPI_INT_ENB, npi_int_enb.u64);
    __cvmx_interrupt_pci_int_enb2_enable();
}


/**
 * __cvmx_interrupt_npi_int_sum_decode decodes all interrupt bits in cvmx_npi_int_sum_t
 */
void __cvmx_interrupt_npi_int_sum_decode(void)
{
    cvmx_npi_int_sum_t npi_int_sum;
    npi_int_sum.u64 = cvmx_read_csr(CVMX_NPI_INT_SUM);
    npi_int_sum.u64 &= cvmx_read_csr(CVMX_NPI_INT_ENB);
    cvmx_write_csr(CVMX_NPI_INT_SUM, npi_int_sum.u64);
    // Skipping npi_int_sum.s.reserved_62_63
    if (npi_int_sum.s.q1_a_f)
        PRINT_ERROR("NPI_INT_SUM[Q1_A_F]: Attempted to add when Queue-1 FIFO is full.\n"
                    "    PASS3 Field.\n");
    if (npi_int_sum.s.q1_s_e)
        PRINT_ERROR("NPI_INT_SUM[Q1_S_E]: Attempted to subtract when Queue-1 FIFO is empty.\n"
                    "    PASS3 Field.\n");
    if (npi_int_sum.s.pdf_p_f)
        PRINT_ERROR("NPI_INT_SUM[PDF_P_F]: Attempted to push a full PCN-DATA-FIFO.\n"
                    "    PASS3 Field.\n");
    if (npi_int_sum.s.pdf_p_e)
        PRINT_ERROR("NPI_INT_SUM[PDF_P_E]: Attempted to pop an empty PCN-DATA-FIFO.\n"
                    "    PASS3 Field.\n");
    if (npi_int_sum.s.pcf_p_f)
        PRINT_ERROR("NPI_INT_SUM[PCF_P_F]: Attempted to push a full PCN-CNT-FIFO.\n"
                    "    PASS3 Field.\n");
    if (npi_int_sum.s.pcf_p_e)
        PRINT_ERROR("NPI_INT_SUM[PCF_P_E]: Attempted to pop an empty PCN-CNT-FIFO.\n"
                    "    PASS3 Field.\n");
    if (npi_int_sum.s.rdx_s_e)
        PRINT_ERROR("NPI_INT_SUM[RDX_S_E]: Attempted to subtract when DPI-XFR-Wait count is 0.\n"
                    "    PASS3 Field.\n");
    if (npi_int_sum.s.rwx_s_e)
        PRINT_ERROR("NPI_INT_SUM[RWX_S_E]: Attempted to subtract when RDN-XFR-Wait count is 0.\n"
                    "    PASS3 Field.\n");
    if (npi_int_sum.s.pnc_a_f)
        PRINT_ERROR("NPI_INT_SUM[PNC_A_F]: Attempted to add when PNI-NPI Credits are max.\n"
                    "    PASS3 Field.\n");
    if (npi_int_sum.s.pnc_s_e)
        PRINT_ERROR("NPI_INT_SUM[PNC_S_E]: Attempted to subtract when PNI-NPI Credits are 0.\n"
                    "    PASS3 Field.\n");
    if (npi_int_sum.s.com_a_f)
        PRINT_ERROR("NPI_INT_SUM[COM_A_F]: Attempted to add when PCN-Commit Counter is max.\n"
                    "    PASS3 Field.\n");
    if (npi_int_sum.s.com_s_e)
        PRINT_ERROR("NPI_INT_SUM[COM_S_E]: Attempted to subtract when PCN-Commit Counter is 0.\n"
                    "    PASS3 Field.\n");
    if (npi_int_sum.s.q3_a_f)
        PRINT_ERROR("NPI_INT_SUM[Q3_A_F]: Attempted to add when Queue-3 FIFO is full.\n"
                    "    PASS3 Field.\n");
    if (npi_int_sum.s.q3_s_e)
        PRINT_ERROR("NPI_INT_SUM[Q3_S_E]: Attempted to subtract when Queue-3 FIFO is empty.\n"
                    "    PASS3 Field.\n");
    if (npi_int_sum.s.q2_a_f)
        PRINT_ERROR("NPI_INT_SUM[Q2_A_F]: Attempted to add when Queue-2 FIFO is full.\n"
                    "    PASS3 Field.\n");
    if (npi_int_sum.s.q2_s_e)
        PRINT_ERROR("NPI_INT_SUM[Q2_S_E]: Attempted to subtract when Queue-2 FIFO is empty.\n"
                    "    PASS3 Field.\n");
    if (npi_int_sum.s.pcr_a_f)
        PRINT_ERROR("NPI_INT_SUM[PCR_A_F]: Attempted to add when POW Credits is full.\n"
                    "    PASS3 Field.\n");
    if (npi_int_sum.s.pcr_s_e)
        PRINT_ERROR("NPI_INT_SUM[PCR_S_E]: Attempted to subtract when POW Credits is empty.\n"
                    "    PASS3 Field.\n");
    if (npi_int_sum.s.fcr_a_f)
        PRINT_ERROR("NPI_INT_SUM[FCR_A_F]: Attempted to add when FPA Credits is full.\n"
                    "    PASS3 Field.\n");
    if (npi_int_sum.s.fcr_s_e)
        PRINT_ERROR("NPI_INT_SUM[FCR_S_E]: Attempted to subtract when FPA Credits is empty.\n"
                    "    PASS3 Field.\n");
    if (npi_int_sum.s.iobdma)
        PRINT_ERROR("NPI_INT_SUM[IOBDMA]: Requested IOBDMA read size exceeded 128 words.\n");
    if (npi_int_sum.s.p_dperr)
        PRINT_ERROR("NPI_INT_SUM[P_DPERR]: If a parity error occured on data written to L2C\n"
                    "    from the PCI this bit may be set.\n");
    if (npi_int_sum.s.win_rto)
        PRINT_ERROR("NPI_INT_SUM[WIN_RTO]: Windowed Load Timed Out.\n");
    if (npi_int_sum.s.i3_pperr)
        PRINT_ERROR("NPI_INT_SUM[I3_PPERR]: If a parity error occured on the port's instruction\n"
                    "    this bit may be set.\n");
    if (npi_int_sum.s.i2_pperr)
        PRINT_ERROR("NPI_INT_SUM[I2_PPERR]: If a parity error occured on the port's instruction\n"
                    "    this bit may be set.\n");
    if (npi_int_sum.s.i1_pperr)
        PRINT_ERROR("NPI_INT_SUM[I1_PPERR]: If a parity error occured on the port's instruction\n"
                    "    this bit may be set.\n");
    if (npi_int_sum.s.i0_pperr)
        PRINT_ERROR("NPI_INT_SUM[I0_PPERR]: If a parity error occured on the port's instruction\n"
                    "    this bit may be set.\n");
    if (npi_int_sum.s.p3_ptout)
        PRINT_ERROR("NPI_INT_SUM[P3_PTOUT]: Port-3 output had a read timeout on a DATA/INFO\n"
                    "    pair.\n");
    if (npi_int_sum.s.p2_ptout)
        PRINT_ERROR("NPI_INT_SUM[P2_PTOUT]: Port-2 output had a read timeout on a DATA/INFO\n"
                    "    pair.\n");
    if (npi_int_sum.s.p1_ptout)
        PRINT_ERROR("NPI_INT_SUM[P1_PTOUT]: Port-1 output had a read timeout on a DATA/INFO\n"
                    "    pair.\n");
    if (npi_int_sum.s.p0_ptout)
        PRINT_ERROR("NPI_INT_SUM[P0_PTOUT]: Port-0 output had a read timeout on a DATA/INFO\n"
                    "    pair.\n");
    if (npi_int_sum.s.p3_pperr)
        PRINT_ERROR("NPI_INT_SUM[P3_PPERR]: If a parity error occured on the port DATA/INFO\n"
                    "    pointer-pair, this bit may be set.\n");
    if (npi_int_sum.s.p2_pperr)
        PRINT_ERROR("NPI_INT_SUM[P2_PPERR]: If a parity error occured on the port DATA/INFO\n"
                    "    pointer-pair, this bit may be set.\n");
    if (npi_int_sum.s.p1_pperr)
        PRINT_ERROR("NPI_INT_SUM[P1_PPERR]: If a parity error occured on the port DATA/INFO\n"
                    "    pointer-pair, this bit may be set.\n");
    if (npi_int_sum.s.p0_pperr)
        PRINT_ERROR("NPI_INT_SUM[P0_PPERR]: If a parity error occured on the port DATA/INFO\n"
                    "    pointer-pair, this bit may be set.\n");
    if (npi_int_sum.s.g3_rtout)
        PRINT_ERROR("NPI_INT_SUM[G3_RTOUT]: Port-3 had a read timeout while attempting to\n"
                    "    read a gather list.\n");
    if (npi_int_sum.s.g2_rtout)
        PRINT_ERROR("NPI_INT_SUM[G2_RTOUT]: Port-2 had a read timeout while attempting to\n"
                    "    read a gather list.\n");
    if (npi_int_sum.s.g1_rtout)
        PRINT_ERROR("NPI_INT_SUM[G1_RTOUT]: Port-1 had a read timeout while attempting to\n"
                    "    read a gather list.\n");
    if (npi_int_sum.s.g0_rtout)
        PRINT_ERROR("NPI_INT_SUM[G0_RTOUT]: Port-0 had a read timeout while attempting to\n"
                    "    read a gather list.\n");
    if (npi_int_sum.s.p3_perr)
        PRINT_ERROR("NPI_INT_SUM[P3_PERR]: If a parity error occured on the port's packet\n"
                    "    data this bit may be set.\n");
    if (npi_int_sum.s.p2_perr)
        PRINT_ERROR("NPI_INT_SUM[P2_PERR]: If a parity error occured on the port's packet\n"
                    "    data this bit may be set.\n");
    if (npi_int_sum.s.p1_perr)
        PRINT_ERROR("NPI_INT_SUM[P1_PERR]: If a parity error occured on the port's packet\n"
                    "    data this bit may be set.\n");
    if (npi_int_sum.s.p0_perr)
        PRINT_ERROR("NPI_INT_SUM[P0_PERR]: If a parity error occured on the port's packet\n"
                    "    data this bit may be set.\n");
    if (npi_int_sum.s.p3_rtout)
        PRINT_ERROR("NPI_INT_SUM[P3_RTOUT]: Port-3 had a read timeout while attempting to\n"
                    "    read packet data.\n");
    if (npi_int_sum.s.p2_rtout)
        PRINT_ERROR("NPI_INT_SUM[P2_RTOUT]: Port-2 had a read timeout while attempting to\n"
                    "    read packet data.\n");
    if (npi_int_sum.s.p1_rtout)
        PRINT_ERROR("NPI_INT_SUM[P1_RTOUT]: Port-1 had a read timeout while attempting to\n"
                    "    read packet data.\n");
    if (npi_int_sum.s.p0_rtout)
        PRINT_ERROR("NPI_INT_SUM[P0_RTOUT]: Port-0 had a read timeout while attempting to\n"
                    "    read packet data.\n");
    if (npi_int_sum.s.i3_overf)
        PRINT_ERROR("NPI_INT_SUM[I3_OVERF]: Port-3 had a doorbell overflow. Bit[31] of the\n"
                    "    doorbell count was set.\n");
    if (npi_int_sum.s.i2_overf)
        PRINT_ERROR("NPI_INT_SUM[I2_OVERF]: Port-2 had a doorbell overflow. Bit[31] of the\n"
                    "    doorbell count was set.\n");
    if (npi_int_sum.s.i1_overf)
        PRINT_ERROR("NPI_INT_SUM[I1_OVERF]: Port-1 had a doorbell overflow. Bit[31] of the\n"
                    "    doorbell count was set.\n");
    if (npi_int_sum.s.i0_overf)
        PRINT_ERROR("NPI_INT_SUM[I0_OVERF]: Port-0 had a doorbell overflow. Bit[31] of the\n"
                    "    doorbell count was set.\n");
    if (npi_int_sum.s.i3_rtout)
        PRINT_ERROR("NPI_INT_SUM[I3_RTOUT]: Port-3 had a read timeout while attempting to\n"
                    "    read instructions.\n");
    if (npi_int_sum.s.i2_rtout)
        PRINT_ERROR("NPI_INT_SUM[I2_RTOUT]: Port-2 had a read timeout while attempting to\n"
                    "    read instructions.\n");
    if (npi_int_sum.s.i1_rtout)
        PRINT_ERROR("NPI_INT_SUM[I1_RTOUT]: Port-1 had a read timeout while attempting to\n"
                    "    read instructions.\n");
    if (npi_int_sum.s.i0_rtout)
        PRINT_ERROR("NPI_INT_SUM[I0_RTOUT]: Port-0 had a read timeout while attempting to\n"
                    "    read instructions.\n");
    if (npi_int_sum.s.po3_2sml)
        PRINT_ERROR("NPI_INT_SUM[PO3_2SML]: The packet being sent out on Port3 is smaller\n"
                    "    than the NPI_BUFF_SIZE_OUTPUT3[ISIZE] field.\n");
    if (npi_int_sum.s.po2_2sml)
        PRINT_ERROR("NPI_INT_SUM[PO2_2SML]: The packet being sent out on Port2 is smaller\n"
                    "    than the NPI_BUFF_SIZE_OUTPUT2[ISIZE] field.\n");
    if (npi_int_sum.s.po1_2sml)
        PRINT_ERROR("NPI_INT_SUM[PO1_2SML]: The packet being sent out on Port1 is smaller\n"
                    "    than the NPI_BUFF_SIZE_OUTPUT1[ISIZE] field.\n");
    if (npi_int_sum.s.po0_2sml)
        PRINT_ERROR("NPI_INT_SUM[PO0_2SML]: The packet being sent out on Port0 is smaller\n"
                    "    than the NPI_BUFF_SIZE_OUTPUT0[ISIZE] field.\n");
    if (npi_int_sum.s.pci_rsl)
    {
#if 0
        PRINT_ERROR("NPI_INT_SUM[PCI_RSL]: This '1' when a bit in PCI_INT_SUM2 is SET and the\n"
                    "    corresponding bit in the PCI_INT_ENB2 is SET.\n");
#endif
        __cvmx_interrupt_pci_int_sum2_decode();
    }
    if (npi_int_sum.s.rml_wto)
        PRINT_ERROR("NPI_INT_SUM[RML_WTO]: Set '1' when the RML does not receive a commit\n"
                    "    back from a RSL after sending a write command to\n"
                    "    a RSL.\n");
    if (npi_int_sum.s.rml_rto)
        PRINT_ERROR("NPI_INT_SUM[RML_RTO]: Set '1' when the RML does not receive read data\n"
                    "    back from a RSL after sending a read command to\n"
                    "    a RSL.\n");
}


/**
 * __cvmx_interrupt_pci_int_enb2_enable enables all interrupt bits in cvmx_pci_int_enb2_t
 */
void __cvmx_interrupt_pci_int_enb2_enable(void)
{
    cvmx_pci_int_enb2_t pci_int_enb2;
    cvmx_write_csr(CVMX_NPI_PCI_INT_SUM2, cvmx_read_csr(CVMX_NPI_PCI_INT_SUM2));
    pci_int_enb2.u64 = 0;
    if (OCTEON_IS_MODEL(OCTEON_CN30XX))
    {
        // Skipping pci_int_enb2.s.reserved_34_63
        pci_int_enb2.s.ill_rd = 1;
        pci_int_enb2.s.ill_wr = 1;
        pci_int_enb2.s.win_wr = 1;
        // pci_int_enb2.s.dma1_fi = 1; // Not an error condition
        // pci_int_enb2.s.dma0_fi = 1; // Not an error condition
        // pci_int_enb2.s.rdtime1 = 1; // Not an error condition
        // pci_int_enb2.s.rdtime0 = 1; // Not an error condition
        // pci_int_enb2.s.rdcnt1 = 1; // Not an error condition
        // pci_int_enb2.s.rdcnt0 = 1; // Not an error condition
        // Skipping pci_int_enb2.s.reserved_22_24
        // pci_int_enb2.s.rptime0 = 1; // Not an error condition
        // Skipping pci_int_enb2.s.reserved_18_20
        // pci_int_enb2.s.rpcnt0 = 1; // Not an error condition
        // pci_int_enb2.s.rrsl_int = 1; // Not an error condition
        pci_int_enb2.s.ill_rrd = 1;
        pci_int_enb2.s.ill_rwr = 1;
        pci_int_enb2.s.rdperr = 1;
        pci_int_enb2.s.raperr = 1;
        pci_int_enb2.s.rserr = 1;
        pci_int_enb2.s.rtsr_abt = 1;
        pci_int_enb2.s.rmsc_msg = 1;
        pci_int_enb2.s.rmsi_mabt = 1;
        pci_int_enb2.s.rmsi_tabt = 1;
        pci_int_enb2.s.rmsi_per = 1;
        pci_int_enb2.s.rmr_tto = 1;
        pci_int_enb2.s.rmr_abt = 1;
        pci_int_enb2.s.rtr_abt = 1;
        pci_int_enb2.s.rmr_wtto = 1;
        pci_int_enb2.s.rmr_wabt = 1;
        pci_int_enb2.s.rtr_wabt = 1;
    }
    if (OCTEON_IS_MODEL(OCTEON_CN50XX))
    {
        // Skipping pci_int_enb2.s.reserved_34_63
        pci_int_enb2.s.ill_rd = 1;
        pci_int_enb2.s.ill_wr = 1;
        pci_int_enb2.s.win_wr = 1;
        // pci_int_enb2.s.dma1_fi = 1; // Not an error condition
        // pci_int_enb2.s.dma0_fi = 1; // Not an error condition
        // pci_int_enb2.s.rdtime1 = 1; // Not an error condition
        // pci_int_enb2.s.rdtime0 = 1; // Not an error condition
        // pci_int_enb2.s.rdcnt1 = 1; // Not an error condition
        // pci_int_enb2.s.rdcnt0 = 1; // Not an error condition
        // Skipping pci_int_enb2.s.reserved_23_24
        // pci_int_enb2.s.rptime1 = 1; // Not an error condition
        // pci_int_enb2.s.rptime0 = 1; // Not an error condition
        // Skipping pci_int_enb2.s.reserved_19_20
        // pci_int_enb2.s.rpcnt1 = 1; // Not an error condition
        // pci_int_enb2.s.rpcnt0 = 1; // Not an error condition
        // pci_int_enb2.s.rrsl_int = 1; // Not an error condition
        pci_int_enb2.s.ill_rrd = 1;
        pci_int_enb2.s.ill_rwr = 1;
        pci_int_enb2.s.rdperr = 1;
        pci_int_enb2.s.raperr = 1;
        pci_int_enb2.s.rserr = 1;
        pci_int_enb2.s.rtsr_abt = 1;
        pci_int_enb2.s.rmsc_msg = 1;
        pci_int_enb2.s.rmsi_mabt = 1;
        pci_int_enb2.s.rmsi_tabt = 1;
        pci_int_enb2.s.rmsi_per = 1;
        pci_int_enb2.s.rmr_tto = 1;
        pci_int_enb2.s.rmr_abt = 1;
        pci_int_enb2.s.rtr_abt = 1;
        pci_int_enb2.s.rmr_wtto = 1;
        pci_int_enb2.s.rmr_wabt = 1;
        pci_int_enb2.s.rtr_wabt = 1;
    }
    if (OCTEON_IS_MODEL(OCTEON_CN38XX))
    {
        // Skipping pci_int_enb2.s.reserved_34_63
        pci_int_enb2.s.ill_rd = 1;
        pci_int_enb2.s.ill_wr = 1;
        pci_int_enb2.s.win_wr = 1;
        // pci_int_enb2.s.dma1_fi = 1; // Not an error condition
        // pci_int_enb2.s.dma0_fi = 1; // Not an error condition
        // pci_int_enb2.s.rdtime1 = 1; // Not an error condition
        // pci_int_enb2.s.rdtime0 = 1; // Not an error condition
        // pci_int_enb2.s.rdcnt1 = 1; // Not an error condition
        // pci_int_enb2.s.rdcnt0 = 1; // Not an error condition
        // pci_int_enb2.s.rptime3 = 1; // Not an error condition
        // pci_int_enb2.s.rptime2 = 1; // Not an error condition
        // pci_int_enb2.s.rptime1 = 1; // Not an error condition
        // pci_int_enb2.s.rptime0 = 1; // Not an error condition
        // pci_int_enb2.s.rpcnt3 = 1; // Not an error condition
        // pci_int_enb2.s.rpcnt2 = 1; // Not an error condition
        // pci_int_enb2.s.rpcnt1 = 1; // Not an error condition
        // pci_int_enb2.s.rpcnt0 = 1; // Not an error condition
        // pci_int_enb2.s.rrsl_int = 1; // Not an error condition
        pci_int_enb2.s.ill_rrd = 1;
        pci_int_enb2.s.ill_rwr = 1;
        pci_int_enb2.s.rdperr = 1;
        pci_int_enb2.s.raperr = 1;
        pci_int_enb2.s.rserr = 1;
        pci_int_enb2.s.rtsr_abt = 1;
        pci_int_enb2.s.rmsc_msg = 1;
        pci_int_enb2.s.rmsi_mabt = 1;
        pci_int_enb2.s.rmsi_tabt = 1;
        pci_int_enb2.s.rmsi_per = 1;
        pci_int_enb2.s.rmr_tto = 1;
        pci_int_enb2.s.rmr_abt = 1;
        pci_int_enb2.s.rtr_abt = 1;
        pci_int_enb2.s.rmr_wtto = 1;
        pci_int_enb2.s.rmr_wabt = 1;
        pci_int_enb2.s.rtr_wabt = 1;
    }
    if (OCTEON_IS_MODEL(OCTEON_CN31XX))
    {
        // Skipping pci_int_enb2.s.reserved_34_63
        pci_int_enb2.s.ill_rd = 1;
        pci_int_enb2.s.ill_wr = 1;
        pci_int_enb2.s.win_wr = 1;
        // pci_int_enb2.s.dma1_fi = 1; // Not an error condition
        // pci_int_enb2.s.dma0_fi = 1; // Not an error condition
        // pci_int_enb2.s.rdtime1 = 1; // Not an error condition
        // pci_int_enb2.s.rdtime0 = 1; // Not an error condition
        // pci_int_enb2.s.rdcnt1 = 1; // Not an error condition
        // pci_int_enb2.s.rdcnt0 = 1; // Not an error condition
        // Skipping pci_int_enb2.s.reserved_23_24
        // pci_int_enb2.s.rptime1 = 1; // Not an error condition
        // pci_int_enb2.s.rptime0 = 1; // Not an error condition
        // Skipping pci_int_enb2.s.reserved_19_20
        // pci_int_enb2.s.rpcnt1 = 1; // Not an error condition
        // pci_int_enb2.s.rpcnt0 = 1; // Not an error condition
        // pci_int_enb2.s.rrsl_int = 1; // Not an error condition
        pci_int_enb2.s.ill_rrd = 1;
        pci_int_enb2.s.ill_rwr = 1;
        pci_int_enb2.s.rdperr = 1;
        pci_int_enb2.s.raperr = 1;
        pci_int_enb2.s.rserr = 1;
        pci_int_enb2.s.rtsr_abt = 1;
        pci_int_enb2.s.rmsc_msg = 1;
        pci_int_enb2.s.rmsi_mabt = 1;
        pci_int_enb2.s.rmsi_tabt = 1;
        pci_int_enb2.s.rmsi_per = 1;
        pci_int_enb2.s.rmr_tto = 1;
        pci_int_enb2.s.rmr_abt = 1;
        pci_int_enb2.s.rtr_abt = 1;
        pci_int_enb2.s.rmr_wtto = 1;
        pci_int_enb2.s.rmr_wabt = 1;
        pci_int_enb2.s.rtr_wabt = 1;
    }
    if (OCTEON_IS_MODEL(OCTEON_CN58XX))
    {
        // Skipping pci_int_enb2.s.reserved_34_63
        pci_int_enb2.s.ill_rd = 1;
        pci_int_enb2.s.ill_wr = 1;
        pci_int_enb2.s.win_wr = 1;
        // pci_int_enb2.s.dma1_fi = 1; // Not an error condition
        // pci_int_enb2.s.dma0_fi = 1; // Not an error condition
        // pci_int_enb2.s.rdtime1 = 1; // Not an error condition
        // pci_int_enb2.s.rdtime0 = 1; // Not an error condition
        // pci_int_enb2.s.rdcnt1 = 1; // Not an error condition
        // pci_int_enb2.s.rdcnt0 = 1; // Not an error condition
        // pci_int_enb2.s.rptime3 = 1; // Not an error condition
        // pci_int_enb2.s.rptime2 = 1; // Not an error condition
        // pci_int_enb2.s.rptime1 = 1; // Not an error condition
        // pci_int_enb2.s.rptime0 = 1; // Not an error condition
        // pci_int_enb2.s.rpcnt3 = 1; // Not an error condition
        // pci_int_enb2.s.rpcnt2 = 1; // Not an error condition
        // pci_int_enb2.s.rpcnt1 = 1; // Not an error condition
        // pci_int_enb2.s.rpcnt0 = 1; // Not an error condition
        // pci_int_enb2.s.rrsl_int = 1; // Not an error condition
        pci_int_enb2.s.ill_rrd = 1;
        pci_int_enb2.s.ill_rwr = 1;
        pci_int_enb2.s.rdperr = 1;
        pci_int_enb2.s.raperr = 1;
        pci_int_enb2.s.rserr = 1;
        pci_int_enb2.s.rtsr_abt = 1;
        pci_int_enb2.s.rmsc_msg = 1;
        pci_int_enb2.s.rmsi_mabt = 1;
        pci_int_enb2.s.rmsi_tabt = 1;
        pci_int_enb2.s.rmsi_per = 1;
        pci_int_enb2.s.rmr_tto = 1;
        pci_int_enb2.s.rmr_abt = 1;
        pci_int_enb2.s.rtr_abt = 1;
        pci_int_enb2.s.rmr_wtto = 1;
        pci_int_enb2.s.rmr_wabt = 1;
        pci_int_enb2.s.rtr_wabt = 1;
    }
    cvmx_write_csr(CVMX_NPI_PCI_INT_ENB2, pci_int_enb2.u64);
}


/**
 * __cvmx_interrupt_pci_int_sum2_decode decodes all interrupt bits in cvmx_pci_int_sum2_t
 */
void __cvmx_interrupt_pci_int_sum2_decode(void)
{
    cvmx_pci_int_sum2_t pci_int_sum2;
    pci_int_sum2.u64 = cvmx_read_csr(CVMX_NPI_PCI_INT_SUM2);
    pci_int_sum2.u64 &= cvmx_read_csr(CVMX_NPI_PCI_INT_ENB2);
    cvmx_write_csr(CVMX_NPI_PCI_INT_SUM2, pci_int_sum2.u64);
    // Skipping pci_int_sum2.s.reserved_34_63
    if (pci_int_sum2.s.ill_rd)
        PRINT_ERROR("PCI_INT_SUM2[ILL_RD]: A read to a disabled area of bar1 or bar2,\n"
                    "    when the mem area is disabled.\n");
    if (pci_int_sum2.s.ill_wr)
        PRINT_ERROR("PCI_INT_SUM2[ILL_WR]: A write to a disabled area of bar1 or bar2,\n"
                    "    when the mem area is disabled.\n");
    if (pci_int_sum2.s.win_wr)
        PRINT_ERROR("PCI_INT_SUM2[WIN_WR]: A write to the disabled Window Write Data or\n"
                    "    Read-Address Register took place.\n");
    if (pci_int_sum2.s.dma1_fi)
        PRINT_ERROR("PCI_INT_SUM2[DMA1_FI]: A DMA operation operation finished that was\n"
                    "    required to set the FORCE-INT bit for counter 1.\n");
    if (pci_int_sum2.s.dma0_fi)
        PRINT_ERROR("PCI_INT_SUM2[DMA0_FI]: A DMA operation operation finished that was\n"
                    "    required to set the FORCE-INT bit for counter 0.\n");
    if (pci_int_sum2.s.dtime1)
        PRINT_ERROR("PCI_INT_SUM2[DTIME1]: When the value in the PCI_DMA_CNT1\n"
                    "    register is not 0 the DMA_CNT1 timer counts.\n"
                    "    When the DMA1_CNT timer has a value greater\n"
                    "    than the PCI_DMA_TIME1 register this\n"
                    "    bit is set. The timer is reset when bit is\n"
                    "    written with a one.\n");
    if (pci_int_sum2.s.dtime0)
        PRINT_ERROR("PCI_INT_SUM2[DTIME0]: When the value in the PCI_DMA_CNT0\n"
                    "    register is not 0 the DMA_CNT0 timer counts.\n"
                    "    When the DMA0_CNT timer has a value greater\n"
                    "    than the PCI_DMA_TIME0 register this\n"
                    "    bit is set. The timer is reset when bit is\n"
                    "    written with a one.\n");
    if (pci_int_sum2.s.dcnt1)
        PRINT_ERROR("PCI_INT_SUM2[DCNT1]: This bit indicates that PCI_DMA_CNT1\n"
                    "    value is greater than the value\n"
                    "    in the PCI_DMA_INT_LEV1 register.\n");
    if (pci_int_sum2.s.dcnt0)
        PRINT_ERROR("PCI_INT_SUM2[DCNT0]: This bit indicates that PCI_DMA_CNT0\n"
                    "    value is greater than the value\n"
                    "    in the PCI_DMA_INT_LEV0 register.\n");
    if (pci_int_sum2.s.ptime3)
        PRINT_ERROR("PCI_INT_SUM2[PTIME3]: When the value in the PCI_PKTS_SENT3\n"
                    "    register is not 0 the Sent-3 timer counts.\n"
                    "    When the Sent-3 timer has a value greater\n"
                    "    than the PCI_PKTS_SENT_TIME3 register this\n"
                    "    bit is set. The timer is reset when bit is\n"
                    "    written with a one.\n");
    if (pci_int_sum2.s.ptime2)
        PRINT_ERROR("PCI_INT_SUM2[PTIME2]: When the value in the PCI_PKTS_SENT2\n"
                    "    register is not 0 the Sent-2 timer counts.\n"
                    "    When the Sent-2 timer has a value greater\n"
                    "    than the PCI_PKTS_SENT_TIME2 register this\n"
                    "    bit is set. The timer is reset when bit is\n"
                    "    written with a one.\n");
    if (pci_int_sum2.s.ptime1)
        PRINT_ERROR("PCI_INT_SUM2[PTIME1]: When the value in the PCI_PKTS_SENT1\n"
                    "    register is not 0 the Sent-1 timer counts.\n"
                    "    When the Sent-1 timer has a value greater\n"
                    "    than the PCI_PKTS_SENT_TIME1 register this\n"
                    "    bit is set. The timer is reset when bit is\n"
                    "    written with a one.\n");
    if (pci_int_sum2.s.ptime0)
        PRINT_ERROR("PCI_INT_SUM2[PTIME0]: When the value in the PCI_PKTS_SENT0\n"
                    "    register is not 0 the Sent-0 timer counts.\n"
                    "    When the Sent-0 timer has a value greater\n"
                    "    than the PCI_PKTS_SENT_TIME0 register this\n"
                    "    bit is set. The timer is reset when bit is\n"
                    "    written with a one.\n");
    if (pci_int_sum2.s.pcnt3)
        PRINT_ERROR("PCI_INT_SUM2[PCNT3]: This bit indicates that PCI_PKTS_SENT3\n"
                    "    value is greater than the value\n"
                    "    in the PCI_PKTS_SENT_INT_LEV3 register.\n");
    if (pci_int_sum2.s.pcnt2)
        PRINT_ERROR("PCI_INT_SUM2[PCNT2]: This bit indicates that PCI_PKTS_SENT2\n"
                    "    value is greater than the value\n"
                    "    in the PCI_PKTS_SENT_INT_LEV2 register.\n");
    if (pci_int_sum2.s.pcnt1)
        PRINT_ERROR("PCI_INT_SUM2[PCNT1]: This bit indicates that PCI_PKTS_SENT1\n"
                    "    value is greater than the value\n"
                    "    in the PCI_PKTS_SENT_INT_LEV1 register.\n");
    if (pci_int_sum2.s.pcnt0)
        PRINT_ERROR("PCI_INT_SUM2[PCNT0]: This bit indicates that PCI_PKTS_SENT0\n"
                    "    value is greater than the value\n"
                    "    in the PCI_PKTS_SENT_INT_LEV0 register.\n");
    if (pci_int_sum2.s.rsl_int)
        PRINT_ERROR("PCI_INT_SUM2[RSL_INT]: This bit is set when the RSL Chain has\n"
                    "    generated an interrupt.\n");
    if (pci_int_sum2.s.ill_rrd)
        PRINT_ERROR("PCI_INT_SUM2[ILL_RRD]: A read  to the disabled PCI registers took place.\n");
    if (pci_int_sum2.s.ill_rwr)
        PRINT_ERROR("PCI_INT_SUM2[ILL_RWR]: A write to the disabled PCI registers took place.\n");
    if (pci_int_sum2.s.dperr)
        PRINT_ERROR("PCI_INT_SUM2[DPERR]: Data Parity Error detected by PCX Core\n");
    if (pci_int_sum2.s.aperr)
        PRINT_ERROR("PCI_INT_SUM2[APERR]: Address Parity Error detected by PCX Core\n");
    if (pci_int_sum2.s.serr)
        PRINT_ERROR("PCI_INT_SUM2[SERR]: SERR# detected by PCX Core\n");
    if (pci_int_sum2.s.tsr_abt)
        PRINT_ERROR("PCI_INT_SUM2[TSR_ABT]: Target Split-Read Abort Detected\n");
    if (pci_int_sum2.s.msc_msg)
        PRINT_ERROR("PCI_INT_SUM2[MSC_MSG]: Master Split Completion Message Detected\n");
    if (pci_int_sum2.s.msi_mabt)
        PRINT_ERROR("PCI_INT_SUM2[MSI_MABT]: PCI MSI Master Abort.\n");
    if (pci_int_sum2.s.msi_tabt)
        PRINT_ERROR("PCI_INT_SUM2[MSI_TABT]: PCI MSI Target Abort.\n");
    if (pci_int_sum2.s.msi_per)
        PRINT_ERROR("PCI_INT_SUM2[MSI_PER]: PCI MSI Parity Error.\n");
    if (pci_int_sum2.s.mr_tto)
        PRINT_ERROR("PCI_INT_SUM2[MR_TTO]: PCI Master Retry Timeout On Read.\n");
    if (pci_int_sum2.s.mr_abt)
        PRINT_ERROR("PCI_INT_SUM2[MR_ABT]: PCI Master Abort On Read.\n");
    if (pci_int_sum2.s.tr_abt)
        PRINT_ERROR("PCI_INT_SUM2[TR_ABT]: PCI Target Abort On Read.\n");
    if (pci_int_sum2.s.mr_wtto)
        PRINT_ERROR("PCI_INT_SUM2[MR_WTTO]: PCI Master Retry Timeout on write.\n");
    if (pci_int_sum2.s.mr_wabt)
        PRINT_ERROR("PCI_INT_SUM2[MR_WABT]: PCI Master Abort detected on write.\n");
    if (pci_int_sum2.s.tr_wabt)
        PRINT_ERROR("PCI_INT_SUM2[TR_WABT]: PCI Target Abort detected on write.\n");
}


/**
 * __cvmx_interrupt_pcsx_intx_en_reg_enable enables all interrupt bits in cvmx_pcsx_intx_en_reg_t
 */
void __cvmx_interrupt_pcsx_intx_en_reg_enable(int index, int block)
{
    cvmx_pcsx_intx_en_reg_t pcs_int_en_reg;
    cvmx_write_csr(CVMX_PCSX_INTX_REG(index, block), cvmx_read_csr(CVMX_PCSX_INTX_REG(index, block)));
    pcs_int_en_reg.u64 = 0;
    if (OCTEON_IS_MODEL(OCTEON_CN56XX))
    {
        // Skipping pcs_int_en_reg.s.reserved_12_63
        //pcs_int_en_reg.s.dup = 1; // This happens during normal operation
        pcs_int_en_reg.s.sync_bad_en = 1;
        pcs_int_en_reg.s.an_bad_en = 1;
        pcs_int_en_reg.s.rxlock_en = 1;
        pcs_int_en_reg.s.rxbad_en = 1;
        //pcs_int_en_reg.s.rxerr_en = 1; // This happens during normal operation
        pcs_int_en_reg.s.txbad_en = 1;
        pcs_int_en_reg.s.txfifo_en = 1;
        pcs_int_en_reg.s.txfifu_en = 1;
        pcs_int_en_reg.s.an_err_en = 1;
        //pcs_int_en_reg.s.xmit_en = 1; // This happens during normal operation
        //pcs_int_en_reg.s.lnkspd_en = 1; // This happens during normal operation
    }
    if (OCTEON_IS_MODEL(OCTEON_CN52XX))
    {
        // Skipping pcs_int_en_reg.s.reserved_12_63
        //pcs_int_en_reg.s.dup = 1; // This happens during normal operation
        pcs_int_en_reg.s.sync_bad_en = 1;
        pcs_int_en_reg.s.an_bad_en = 1;
        pcs_int_en_reg.s.rxlock_en = 1;
        pcs_int_en_reg.s.rxbad_en = 1;
        //pcs_int_en_reg.s.rxerr_en = 1; // This happens during normal operation
        pcs_int_en_reg.s.txbad_en = 1;
        pcs_int_en_reg.s.txfifo_en = 1;
        pcs_int_en_reg.s.txfifu_en = 1;
        pcs_int_en_reg.s.an_err_en = 1;
        //pcs_int_en_reg.s.xmit_en = 1; // This happens during normal operation
        //pcs_int_en_reg.s.lnkspd_en = 1; // This happens during normal operation
    }
    cvmx_write_csr(CVMX_PCSX_INTX_EN_REG(index, block), pcs_int_en_reg.u64);
}


/**
 * __cvmx_interrupt_pcsx_intx_reg_decode decodes all interrupt bits in cvmx_pcsx_intx_reg_t
 */
void __cvmx_interrupt_pcsx_intx_reg_decode(int index, int block)
{
    cvmx_pcsx_intx_reg_t pcs_int_reg;
    pcs_int_reg.u64 = cvmx_read_csr(CVMX_PCSX_INTX_REG(index, block));
    pcs_int_reg.u64 &= cvmx_read_csr(CVMX_PCSX_INTX_EN_REG(index, block));
    cvmx_write_csr(CVMX_PCSX_INTX_REG(index, block), pcs_int_reg.u64);
    // Skipping pcs_int_reg.s.reserved_12_63
    if (pcs_int_reg.s.dup)
        PRINT_ERROR("PCS%d_INT%d_REG[DUP]: Set whenever Duplex mode changes on the link\n", block, index);
    if (pcs_int_reg.s.sync_bad)
        PRINT_ERROR("PCS%d_INT%d_REG[SYNC_BAD]: Set by HW whenever rx sync st machine reaches a bad\n"
                    "    state. Should never be set during normal operation\n", block, index);
    if (pcs_int_reg.s.an_bad)
        PRINT_ERROR("PCS%d_INT%d_REG[AN_BAD]: Set by HW whenever AN st machine reaches a bad\n"
                    "    state. Should never be set during normal operation\n", block, index);
    if (pcs_int_reg.s.rxlock)
        PRINT_ERROR("PCS%d_INT%d_REG[RXLOCK]: Set by HW whenever code group Sync or bit lock\n"
                    "    failure occurs\n"
                    "    Cannot fire in loopback1 mode\n", block, index);
    if (pcs_int_reg.s.rxbad)
        PRINT_ERROR("PCS%d_INT%d_REG[RXBAD]: Set by HW whenever rx st machine reaches a  bad\n"
                    "    state. Should never be set during normal operation\n", block, index);
    if (pcs_int_reg.s.rxerr)
        PRINT_ERROR("PCS%d_INT%d_REG[RXERR]: Set whenever RX receives a code group error in\n"
                    "    10 bit to 8 bit decode logic\n"
                    "    Cannot fire in loopback1 mode\n", block, index);
    if (pcs_int_reg.s.txbad)
        PRINT_ERROR("PCS%d_INT%d_REG[TXBAD]: Set by HW whenever tx st machine reaches a bad\n"
                    "    state. Should never be set during normal operation\n", block, index);
    if (pcs_int_reg.s.txfifo)
        PRINT_ERROR("PCS%d_INT%d_REG[TXFIFO]: Set whenever HW detects a TX fifo overflow\n"
                    "    condition\n", block, index);
    if (pcs_int_reg.s.txfifu)
        PRINT_ERROR("PCS%d_INT%d_REG[TXFIFU]: Set whenever HW detects a TX fifo underflowflow\n"
                    "    condition\n", block, index);
    if (pcs_int_reg.s.an_err)
        PRINT_ERROR("PCS%d_INT%d_REG[AN_ERR]: AN Error, AN resolution function failed\n", block, index);
    if (pcs_int_reg.s.xmit)
        PRINT_ERROR("PCS%d_INT%d_REG[XMIT]: Set whenever HW detects a change in the XMIT\n"
                    "    variable. XMIT variable states are IDLE, CONFIG and\n"
                    "    DATA\n", block, index);
    if (pcs_int_reg.s.lnkspd)
        PRINT_ERROR("PCS%d_INT%d_REG[LNKSPD]: Set by HW whenever Link Speed has changed\n", block, index);
}


/**
 * __cvmx_interrupt_pcsxx_int_en_reg_enable enables all interrupt bits in cvmx_pcsxx_int_en_reg_t
 */
void __cvmx_interrupt_pcsxx_int_en_reg_enable(int index)
{
    cvmx_pcsxx_int_en_reg_t pcsx_int_en_reg;
    cvmx_write_csr(CVMX_PCSXX_INT_REG(index), cvmx_read_csr(CVMX_PCSXX_INT_REG(index)));
    pcsx_int_en_reg.u64 = 0;
    if (OCTEON_IS_MODEL(OCTEON_CN56XX))
    {
        // Skipping pcsx_int_en_reg.s.reserved_6_63
        pcsx_int_en_reg.s.algnlos_en = 1;
        pcsx_int_en_reg.s.synlos_en = 1;
        pcsx_int_en_reg.s.bitlckls_en = 1;
        pcsx_int_en_reg.s.rxsynbad_en = 1;
        pcsx_int_en_reg.s.rxbad_en = 1;
        pcsx_int_en_reg.s.txflt_en = 1;
    }
    if (OCTEON_IS_MODEL(OCTEON_CN52XX))
    {
        // Skipping pcsx_int_en_reg.s.reserved_6_63
        pcsx_int_en_reg.s.algnlos_en = 1;
        pcsx_int_en_reg.s.synlos_en = 1;
        pcsx_int_en_reg.s.bitlckls_en = 0;  // Happens if XAUI module is not installed
        pcsx_int_en_reg.s.rxsynbad_en = 1;
        pcsx_int_en_reg.s.rxbad_en = 1;
        pcsx_int_en_reg.s.txflt_en = 1;
    }
    cvmx_write_csr(CVMX_PCSXX_INT_EN_REG(index), pcsx_int_en_reg.u64);
}


/**
 * __cvmx_interrupt_pcsxx_int_reg_decode decodes all interrupt bits in cvmx_pcsxx_int_reg_t
 */
void __cvmx_interrupt_pcsxx_int_reg_decode(int index)
{
    cvmx_pcsxx_int_reg_t pcsx_int_reg;
    pcsx_int_reg.u64 = cvmx_read_csr(CVMX_PCSXX_INT_REG(index));
    pcsx_int_reg.u64 &= cvmx_read_csr(CVMX_PCSXX_INT_EN_REG(index));
    cvmx_write_csr(CVMX_PCSXX_INT_REG(index), pcsx_int_reg.u64);
    // Skipping pcsx_int_reg.s.reserved_6_63
    if (pcsx_int_reg.s.algnlos)
        PRINT_ERROR("PCSX%d_INT_REG[ALGNLOS]: Set when XAUI lanes lose alignment\n", index);
    if (pcsx_int_reg.s.synlos)
        PRINT_ERROR("PCSX%d_INT_REG[SYNLOS]: Set when Code group sync lost on 1 or more  lanes\n", index);
    if (pcsx_int_reg.s.bitlckls)
        PRINT_ERROR("PCSX%d_INT_REG[BITLCKLS]: Set when Bit lock lost on 1 or more xaui lanes\n", index);
    if (pcsx_int_reg.s.rxsynbad)
        PRINT_ERROR("PCSX%d_INT_REG[RXSYNBAD]: Set when RX code grp sync st machine in bad state\n"
                    "    in one of the 4 xaui lanes\n", index);
    if (pcsx_int_reg.s.rxbad)
        PRINT_ERROR("PCSX%d_INT_REG[RXBAD]: Set when RX state machine in bad state\n", index);
    if (pcsx_int_reg.s.txflt)
        PRINT_ERROR("PCSX%d_INT_REG[TXFLT]: None defined at this time, always 0x0\n", index);
}


/**
 * __cvmx_interrupt_pescx_dbg_info_en_enable enables all interrupt bits in cvmx_pescx_dbg_info_en_t
 */
void __cvmx_interrupt_pescx_dbg_info_en_enable(int index)
{
    cvmx_pescx_dbg_info_en_t pesc_dbg_info_en;
    cvmx_write_csr(CVMX_PESCX_DBG_INFO(index), cvmx_read_csr(CVMX_PESCX_DBG_INFO(index)));
    pesc_dbg_info_en.u64 = 0;
    if (OCTEON_IS_MODEL(OCTEON_CN56XX))
    {
        // Skipping pesc_dbg_info_en.s.reserved_31_63
        pesc_dbg_info_en.s.ecrc_e = 1;
        pesc_dbg_info_en.s.rawwpp = 1;
        pesc_dbg_info_en.s.racpp = 1;
        pesc_dbg_info_en.s.ramtlp = 1;
        pesc_dbg_info_en.s.rarwdns = 1;
        pesc_dbg_info_en.s.caar = 1;
        pesc_dbg_info_en.s.racca = 1;
        pesc_dbg_info_en.s.racur = 1;
        pesc_dbg_info_en.s.rauc = 1;
        pesc_dbg_info_en.s.rqo = 1;
        pesc_dbg_info_en.s.fcuv = 1;
        pesc_dbg_info_en.s.rpe = 1;
        pesc_dbg_info_en.s.fcpvwt = 1;
        pesc_dbg_info_en.s.dpeoosd = 1;
        pesc_dbg_info_en.s.rtwdle = 1;
        pesc_dbg_info_en.s.rdwdle = 1;
        pesc_dbg_info_en.s.mre = 1;
        pesc_dbg_info_en.s.rte = 1;
        pesc_dbg_info_en.s.acto = 1;
        pesc_dbg_info_en.s.rvdm = 1;
        pesc_dbg_info_en.s.rumep = 1;
        pesc_dbg_info_en.s.rptamrc = 1;
        pesc_dbg_info_en.s.rpmerc = 1;
        pesc_dbg_info_en.s.rfemrc = 1;
        pesc_dbg_info_en.s.rnfemrc = 1;
        pesc_dbg_info_en.s.rcemrc = 1;
        pesc_dbg_info_en.s.rpoison = 1;
        pesc_dbg_info_en.s.recrce = 1;
        pesc_dbg_info_en.s.rtlplle = 1;
#if 0
    /* RTLPMAL is disabled since it will be generated under normal conditions,
        like devices causing legacy PCI interrupts */
        pesc_dbg_info_en.s.rtlpmal = 1;
#endif
        pesc_dbg_info_en.s.spoison = 1;
    }
    if (OCTEON_IS_MODEL(OCTEON_CN52XX))
    {
        // Skipping pesc_dbg_info_en.s.reserved_31_63
        pesc_dbg_info_en.s.ecrc_e = 1;
        pesc_dbg_info_en.s.rawwpp = 1;
        pesc_dbg_info_en.s.racpp = 1;
        pesc_dbg_info_en.s.ramtlp = 1;
        pesc_dbg_info_en.s.rarwdns = 1;
        pesc_dbg_info_en.s.caar = 1;
        pesc_dbg_info_en.s.racca = 1;
        pesc_dbg_info_en.s.racur = 1;
        pesc_dbg_info_en.s.rauc = 1;
        pesc_dbg_info_en.s.rqo = 1;
        pesc_dbg_info_en.s.fcuv = 1;
        pesc_dbg_info_en.s.rpe = 1;
        pesc_dbg_info_en.s.fcpvwt = 1;
        pesc_dbg_info_en.s.dpeoosd = 1;
        pesc_dbg_info_en.s.rtwdle = 1;
        pesc_dbg_info_en.s.rdwdle = 1;
        pesc_dbg_info_en.s.mre = 1;
        pesc_dbg_info_en.s.rte = 1;
        pesc_dbg_info_en.s.acto = 1;
        pesc_dbg_info_en.s.rvdm = 1;
        pesc_dbg_info_en.s.rumep = 1;
        pesc_dbg_info_en.s.rptamrc = 1;
        pesc_dbg_info_en.s.rpmerc = 1;
        pesc_dbg_info_en.s.rfemrc = 1;
        pesc_dbg_info_en.s.rnfemrc = 1;
        pesc_dbg_info_en.s.rcemrc = 1;
        pesc_dbg_info_en.s.rpoison = 1;
        pesc_dbg_info_en.s.recrce = 1;
        pesc_dbg_info_en.s.rtlplle = 1;
#if 0
    /* RTLPMAL is disabled since it will be generated under normal conditions,
        like devices causing legacy PCI interrupts */
        pesc_dbg_info_en.s.rtlpmal = 1;
#endif
        pesc_dbg_info_en.s.spoison = 1;
    }
    cvmx_write_csr(CVMX_PESCX_DBG_INFO_EN(index), pesc_dbg_info_en.u64);
}


/**
 * __cvmx_interrupt_pescx_dbg_info_decode decodes all interrupt bits in cvmx_pescx_dbg_info_t
 */
void __cvmx_interrupt_pescx_dbg_info_decode(int index)
{
    cvmx_pescx_dbg_info_t pesc_dbg_info;
    pesc_dbg_info.u64 = cvmx_read_csr(CVMX_PESCX_DBG_INFO(index));
    pesc_dbg_info.u64 &= cvmx_read_csr(CVMX_PESCX_DBG_INFO_EN(index));
    cvmx_write_csr(CVMX_PESCX_DBG_INFO(index), pesc_dbg_info.u64);
    // Skipping pesc_dbg_info.s.reserved_31_63
    if (pesc_dbg_info.s.ecrc_e)
        PRINT_ERROR("PESC%d_DBG_INFO[ECRC_E]: Received a ECRC error.\n"
                    "    radm_ecrc_err\n", index);
    if (pesc_dbg_info.s.rawwpp)
        PRINT_ERROR("PESC%d_DBG_INFO[RAWWPP]: Received a write with poisoned payload\n"
                    "    radm_rcvd_wreq_poisoned\n", index);
    if (pesc_dbg_info.s.racpp)
        PRINT_ERROR("PESC%d_DBG_INFO[RACPP]: Received a completion with poisoned payload\n"
                    "    radm_rcvd_cpl_poisoned\n", index);
    if (pesc_dbg_info.s.ramtlp)
        PRINT_ERROR("PESC%d_DBG_INFO[RAMTLP]: Received a malformed TLP\n"
                    "    radm_mlf_tlp_err\n", index);
    if (pesc_dbg_info.s.rarwdns)
        PRINT_ERROR("PESC%d_DBG_INFO[RARWDNS]: Recieved a request which device does not support\n"
                    "    radm_rcvd_ur_req\n", index);
    if (pesc_dbg_info.s.caar)
        PRINT_ERROR("PESC%d_DBG_INFO[CAAR]: Completer aborted a request\n"
                    "    radm_rcvd_ca_req\n"
                    "    This bit will never be set because Octeon does\n"
                    "    not generate Completer Aborts.\n", index);
    if (pesc_dbg_info.s.racca)
        PRINT_ERROR("PESC%d_DBG_INFO[RACCA]: Received a completion with CA status\n"
                    "    radm_rcvd_cpl_ca\n", index);
    if (pesc_dbg_info.s.racur)
        PRINT_ERROR("PESC%d_DBG_INFO[RACUR]: Received a completion with UR status\n"
                    "    radm_rcvd_cpl_ur\n", index);
    if (pesc_dbg_info.s.rauc)
        PRINT_ERROR("PESC%d_DBG_INFO[RAUC]: Received an unexpected completion\n"
                    "    radm_unexp_cpl_err\n", index);
    if (pesc_dbg_info.s.rqo)
        PRINT_ERROR("PESC%d_DBG_INFO[RQO]: Receive queue overflow. Normally happens only when\n"
                    "    flow control advertisements are ignored\n"
                    "    radm_qoverflow\n", index);
    if (pesc_dbg_info.s.fcuv)
        PRINT_ERROR("PESC%d_DBG_INFO[FCUV]: Flow Control Update Violation (opt. checks)\n"
                    "    int_xadm_fc_prot_err\n", index);
    if (pesc_dbg_info.s.rpe)
        PRINT_ERROR("PESC%d_DBG_INFO[RPE]: When the PHY reports 8B/10B decode error\n"
                    "    (RxStatus = 3b100) or disparity error\n"
                    "    (RxStatus = 3b111), the signal rmlh_rcvd_err will\n"
                    "    be asserted.\n"
                    "    rmlh_rcvd_err\n", index);
    if (pesc_dbg_info.s.fcpvwt)
        PRINT_ERROR("PESC%d_DBG_INFO[FCPVWT]: Flow Control Protocol Violation (Watchdog Timer)\n"
                    "    rtlh_fc_prot_err\n", index);
    if (pesc_dbg_info.s.dpeoosd)
        PRINT_ERROR("PESC%d_DBG_INFO[DPEOOSD]: DLLP protocol error (out of sequence DLLP)\n"
                    "    rdlh_prot_err\n", index);
    if (pesc_dbg_info.s.rtwdle)
        PRINT_ERROR("PESC%d_DBG_INFO[RTWDLE]: Received TLP with DataLink Layer Error\n"
                    "    rdlh_bad_tlp_err\n", index);
    if (pesc_dbg_info.s.rdwdle)
        PRINT_ERROR("PESC%d_DBG_INFO[RDWDLE]: Received DLLP with DataLink Layer Error\n"
                    "    rdlh_bad_dllp_err\n", index);
    if (pesc_dbg_info.s.mre)
        PRINT_ERROR("PESC%d_DBG_INFO[MRE]: Max Retries Exceeded\n"
                    "    xdlh_replay_num_rlover_err\n", index);
    if (pesc_dbg_info.s.rte)
        PRINT_ERROR("PESC%d_DBG_INFO[RTE]: Replay Timer Expired\n"
                    "    xdlh_replay_timeout_err\n"
                    "    This bit is set when the REPLAY_TIMER expires in\n"
                    "    the PCIE core. The probability of this bit being\n"
                    "    set will increase with the traffic load.\n", index);
    if (pesc_dbg_info.s.acto)
        PRINT_ERROR("PESC%d_DBG_INFO[ACTO]: A Completion Timeout Occured\n"
                    "    pedc_radm_cpl_timeout\n", index);
    if (pesc_dbg_info.s.rvdm)
        PRINT_ERROR("PESC%d_DBG_INFO[RVDM]: Received Vendor-Defined Message\n"
                    "    pedc_radm_vendor_msg\n", index);
    if (pesc_dbg_info.s.rumep)
        PRINT_ERROR("PESC%d_DBG_INFO[RUMEP]: Received Unlock Message (EP Mode Only)\n"
                    "    pedc_radm_msg_unlock\n", index);
    if (pesc_dbg_info.s.rptamrc)
        PRINT_ERROR("PESC%d_DBG_INFO[RPTAMRC]: Received PME Turnoff Acknowledge Message\n"
                    "    (RC Mode only)\n"
                    "    pedc_radm_pm_to_ack\n", index);
    if (pesc_dbg_info.s.rpmerc)
        PRINT_ERROR("PESC%d_DBG_INFO[RPMERC]: Received PME Message (RC Mode only)\n"
                    "    pedc_radm_pm_pme\n", index);
    if (pesc_dbg_info.s.rfemrc)
        PRINT_ERROR("PESC%d_DBG_INFO[RFEMRC]: Received Fatal Error Message (RC Mode only)\n"
                    "    pedc_radm_fatal_err\n"
                    "    Bit set when a message with ERR_FATAL is set.\n", index);
    if (pesc_dbg_info.s.rnfemrc)
        PRINT_ERROR("PESC%d_DBG_INFO[RNFEMRC]: Received Non-Fatal Error Message (RC Mode only)\n"
                    "    pedc_radm_nonfatal_err\n", index);
    if (pesc_dbg_info.s.rcemrc)
        PRINT_ERROR("PESC%d_DBG_INFO[RCEMRC]: Received Correctable Error Message (RC Mode only)\n"
                    "    pedc_radm_correctable_err\n", index);
    if (pesc_dbg_info.s.rpoison)
        PRINT_ERROR("PESC%d_DBG_INFO[RPOISON]: Received Poisoned TLP\n"
                    "    pedc__radm_trgt1_poisoned & pedc__radm_trgt1_hv\n", index);
    if (pesc_dbg_info.s.recrce)
        PRINT_ERROR("PESC%d_DBG_INFO[RECRCE]: Received ECRC Error\n"
                    "    pedc_radm_trgt1_ecrc_err & pedc__radm_trgt1_eot\n", index);
    if (pesc_dbg_info.s.rtlplle)
        PRINT_ERROR("PESC%d_DBG_INFO[RTLPLLE]: Received TLP has link layer error\n"
                    "    pedc_radm_trgt1_dllp_abort & pedc__radm_trgt1_eot\n", index);
    if (pesc_dbg_info.s.rtlpmal)
        PRINT_ERROR("PESC%d_DBG_INFO[RTLPMAL]: Received TLP is malformed or a message.\n"
                    "    pedc_radm_trgt1_tlp_abort & pedc__radm_trgt1_eot\n"
                    "    If the core receives a MSG (or Vendor Message)\n"
                    "    this bit will be set.\n", index);
    if (pesc_dbg_info.s.spoison)
        PRINT_ERROR("PESC%d_DBG_INFO[SPOISON]: Poisoned TLP sent\n"
                    "    peai__client0_tlp_ep & peai__client0_tlp_hv\n", index);
}


/**
 * __cvmx_interrupt_pip_int_en_enable enables all interrupt bits in cvmx_pip_int_en_t
 */
void __cvmx_interrupt_pip_int_en_enable(void)
{
    cvmx_pip_int_en_t pip_int_en;
    cvmx_write_csr(CVMX_PIP_INT_REG, cvmx_read_csr(CVMX_PIP_INT_REG));
    pip_int_en.u64 = 0;
    if (OCTEON_IS_MODEL(OCTEON_CN56XX))
    {
        // Skipping pip_int_en.s.reserved_13_63
        pip_int_en.s.punyerr = 1;
        //pip_int_en.s.lenerr = 1; // Signalled in packet WQE
        //pip_int_en.s.maxerr = 1; // Signalled in packet WQE
        //pip_int_en.s.minerr = 1; // Signalled in packet WQE
        pip_int_en.s.beperr = 1;
        pip_int_en.s.feperr = 1;
        pip_int_en.s.todoovr = 1;
        pip_int_en.s.skprunt = 1;
        pip_int_en.s.badtag = 1;
        pip_int_en.s.prtnxa = 1;
        //pip_int_en.s.bckprs = 1; // Don't care
        //pip_int_en.s.crcerr = 1; // Signalled in packet WQE
        //pip_int_en.s.pktdrp = 1; // Don't care
    }
    if (OCTEON_IS_MODEL(OCTEON_CN30XX))
    {
        // Skipping pip_int_en.s.reserved_9_63
        pip_int_en.s.beperr = 1;
        pip_int_en.s.feperr = 1;
        pip_int_en.s.todoovr = 1;
        pip_int_en.s.skprunt = 1;
        pip_int_en.s.badtag = 1;
        pip_int_en.s.prtnxa = 1;
        //pip_int_en.s.bckprs = 1; // Don't care
        //pip_int_en.s.crcerr = 1; // Signalled in packet WQE
        //pip_int_en.s.pktdrp = 1; // Don't care
    }
    if (OCTEON_IS_MODEL(OCTEON_CN50XX))
    {
        // Skipping pip_int_en.s.reserved_12_63
        //pip_int_en.s.lenerr = 1; // Signalled in packet WQE
        //pip_int_en.s.maxerr = 1; // Signalled in packet WQE
        //pip_int_en.s.minerr = 1; // Signalled in packet WQE
        pip_int_en.s.beperr = 1;
        pip_int_en.s.feperr = 1;
        pip_int_en.s.todoovr = 1;
        pip_int_en.s.skprunt = 1;
        pip_int_en.s.badtag = 1;
        pip_int_en.s.prtnxa = 1;
        //pip_int_en.s.bckprs = 1; // Don't care
        // Skipping pip_int_en.s.reserved_1_1
        //pip_int_en.s.pktdrp = 1; // Don't care
    }
    if (OCTEON_IS_MODEL(OCTEON_CN38XX))
    {
        // Skipping pip_int_en.s.reserved_9_63
        pip_int_en.s.beperr = 1;
        pip_int_en.s.feperr = 1;
        pip_int_en.s.todoovr = 1;
        pip_int_en.s.skprunt = 1;
        pip_int_en.s.badtag = 1;
        pip_int_en.s.prtnxa = 1;
        //pip_int_en.s.bckprs = 1; // Don't care
        //pip_int_en.s.crcerr = 1; // Signalled in packet WQE
        //pip_int_en.s.pktdrp = 1; // Don't care
    }
    if (OCTEON_IS_MODEL(OCTEON_CN31XX))
    {
        // Skipping pip_int_en.s.reserved_9_63
        pip_int_en.s.beperr = 1;
        pip_int_en.s.feperr = 1;
        pip_int_en.s.todoovr = 1;
        pip_int_en.s.skprunt = 1;
        pip_int_en.s.badtag = 1;
        pip_int_en.s.prtnxa = 1;
        //pip_int_en.s.bckprs = 1; // Don't care
        //pip_int_en.s.crcerr = 1; // Signalled in packet WQE
        //pip_int_en.s.pktdrp = 1; // Don't care
    }
    if (OCTEON_IS_MODEL(OCTEON_CN58XX))
    {
        // Skipping pip_int_en.s.reserved_13_63
        pip_int_en.s.punyerr = 1;
        // Skipping pip_int_en.s.reserved_9_11
        pip_int_en.s.beperr = 1;
        pip_int_en.s.feperr = 1;
        pip_int_en.s.todoovr = 1;
        pip_int_en.s.skprunt = 1;
        pip_int_en.s.badtag = 1;
        pip_int_en.s.prtnxa = 1;
        //pip_int_en.s.bckprs = 1; // Don't care
        //pip_int_en.s.crcerr = 1; // Signalled in packet WQE
        //pip_int_en.s.pktdrp = 1; // Don't care
    }
    if (OCTEON_IS_MODEL(OCTEON_CN52XX))
    {
        // Skipping pip_int_en.s.reserved_13_63
        pip_int_en.s.punyerr = 1;
        //pip_int_en.s.lenerr = 1; // Signalled in packet WQE
        //pip_int_en.s.maxerr = 1; // Signalled in packet WQE
        //pip_int_en.s.minerr = 1; // Signalled in packet WQE
        pip_int_en.s.beperr = 1;
        pip_int_en.s.feperr = 1;
        pip_int_en.s.todoovr = 1;
        pip_int_en.s.skprunt = 1;
        pip_int_en.s.badtag = 1;
        pip_int_en.s.prtnxa = 1;
        //pip_int_en.s.bckprs = 1; // Don't care
        // Skipping pip_int_en.s.reserved_1_1
        //pip_int_en.s.pktdrp = 1; // Don't care
    }
    cvmx_write_csr(CVMX_PIP_INT_EN, pip_int_en.u64);
}


/**
 * __cvmx_interrupt_pip_int_reg_decode decodes all interrupt bits in cvmx_pip_int_reg_t
 */
void __cvmx_interrupt_pip_int_reg_decode(void)
{
    cvmx_pip_int_reg_t pip_int_reg;
    pip_int_reg.u64 = cvmx_read_csr(CVMX_PIP_INT_REG);
    pip_int_reg.u64 &= cvmx_read_csr(CVMX_PIP_INT_EN);
    cvmx_write_csr(CVMX_PIP_INT_REG, pip_int_reg.u64);
    // Skipping pip_int_reg.s.reserved_13_63
    if (pip_int_reg.s.punyerr)
        PRINT_ERROR("PIP_INT_REG[PUNYERR]: Frame was received with length <=4B when CRC\n"
                    "    stripping in IPD is enable\n");
    if (pip_int_reg.s.lenerr)
        PRINT_ERROR("PIP_INT_REG[LENERR]: Frame was received with length error\n");
    if (pip_int_reg.s.maxerr)
        PRINT_ERROR("PIP_INT_REG[MAXERR]: Frame was received with length > max_length\n");
    if (pip_int_reg.s.minerr)
        PRINT_ERROR("PIP_INT_REG[MINERR]: Frame was received with length < min_length\n");
    if (pip_int_reg.s.beperr)
        PRINT_ERROR("PIP_INT_REG[BEPERR]: Parity Error in back end memory\n");
    if (pip_int_reg.s.feperr)
        PRINT_ERROR("PIP_INT_REG[FEPERR]: Parity Error in front end memory\n");
    if (pip_int_reg.s.todoovr)
        PRINT_ERROR("PIP_INT_REG[TODOOVR]: Todo list overflow (see PIP_BCK_PRS[HIWATER])\n");
    if (pip_int_reg.s.skprunt)
        PRINT_ERROR("PIP_INT_REG[SKPRUNT]: Packet was engulfed by skipper\n"
                    "    This interrupt can occur with received PARTIAL\n"
                    "    packets that are truncated to SKIP bytes or\n"
                    "    smaller.\n");
    if (pip_int_reg.s.badtag)
        PRINT_ERROR("PIP_INT_REG[BADTAG]: A bad tag was sent from IPD\n");
    if (pip_int_reg.s.prtnxa)
        PRINT_ERROR("PIP_INT_REG[PRTNXA]: Non-existent port\n");
    if (pip_int_reg.s.bckprs)
        PRINT_ERROR("PIP_INT_REG[BCKPRS]: PIP asserted backpressure\n");
    if (pip_int_reg.s.crcerr)
        PRINT_ERROR("PIP_INT_REG[CRCERR]: PIP calculated bad CRC\n");
    if (pip_int_reg.s.pktdrp)
        PRINT_ERROR("PIP_INT_REG[PKTDRP]: Packet Dropped due to QOS\n");
}


/**
 * __cvmx_interrupt_pko_reg_int_mask_enable enables all interrupt bits in cvmx_pko_reg_int_mask_t
 */
void __cvmx_interrupt_pko_reg_int_mask_enable(void)
{
    cvmx_pko_reg_int_mask_t pko_reg_int_mask;
    cvmx_write_csr(CVMX_PKO_REG_ERROR, cvmx_read_csr(CVMX_PKO_REG_ERROR));
    pko_reg_int_mask.u64 = 0;
    if (OCTEON_IS_MODEL(OCTEON_CN56XX))
    {
        // Skipping pko_reg_int_mask.s.reserved_3_63
        pko_reg_int_mask.s.currzero = 1;
        pko_reg_int_mask.s.doorbell = 1;
        pko_reg_int_mask.s.parity = 1;
    }
    if (OCTEON_IS_MODEL(OCTEON_CN30XX))
    {
        // Skipping pko_reg_int_mask.s.reserved_2_63
        pko_reg_int_mask.s.doorbell = 1;
        pko_reg_int_mask.s.parity = 1;
    }
    if (OCTEON_IS_MODEL(OCTEON_CN50XX))
    {
        // Skipping pko_reg_int_mask.s.reserved_3_63
        pko_reg_int_mask.s.currzero = 1;
        pko_reg_int_mask.s.doorbell = 1;
        pko_reg_int_mask.s.parity = 1;
    }
    if (OCTEON_IS_MODEL(OCTEON_CN38XX))
    {
        // Skipping pko_reg_int_mask.s.reserved_2_63
        pko_reg_int_mask.s.doorbell = 1;
        pko_reg_int_mask.s.parity = 1;
    }
    if (OCTEON_IS_MODEL(OCTEON_CN31XX))
    {
        // Skipping pko_reg_int_mask.s.reserved_2_63
        pko_reg_int_mask.s.doorbell = 1;
        pko_reg_int_mask.s.parity = 1;
    }
    if (OCTEON_IS_MODEL(OCTEON_CN58XX))
    {
        // Skipping pko_reg_int_mask.s.reserved_3_63
        pko_reg_int_mask.s.currzero = 1;
        pko_reg_int_mask.s.doorbell = 1;
        pko_reg_int_mask.s.parity = 1;
    }
    if (OCTEON_IS_MODEL(OCTEON_CN52XX))
    {
        // Skipping pko_reg_int_mask.s.reserved_3_63
        pko_reg_int_mask.s.currzero = 1;
        pko_reg_int_mask.s.doorbell = 1;
        pko_reg_int_mask.s.parity = 1;
    }
    cvmx_write_csr(CVMX_PKO_REG_INT_MASK, pko_reg_int_mask.u64);
}


/**
 * __cvmx_interrupt_pko_reg_error_decode decodes all interrupt bits in cvmx_pko_reg_error_t
 */
void __cvmx_interrupt_pko_reg_error_decode(void)
{
    cvmx_pko_reg_error_t pko_reg_error;
    pko_reg_error.u64 = cvmx_read_csr(CVMX_PKO_REG_ERROR);
    pko_reg_error.u64 &= cvmx_read_csr(CVMX_PKO_REG_INT_MASK);
    cvmx_write_csr(CVMX_PKO_REG_ERROR, pko_reg_error.u64);
    // Skipping pko_reg_error.s.reserved_3_63
    if (pko_reg_error.s.currzero)
        PRINT_ERROR("PKO_REG_ERROR[CURRZERO]: A packet data pointer has size=0\n");
    if (pko_reg_error.s.doorbell)
        PRINT_ERROR("PKO_REG_ERROR[DOORBELL]: A doorbell count has overflowed\n");
    if (pko_reg_error.s.parity)
        PRINT_ERROR("PKO_REG_ERROR[PARITY]: Read parity error at port data buffer\n");
}


/**
 * __cvmx_interrupt_rad_reg_int_mask_enable enables all interrupt bits in cvmx_rad_reg_int_mask_t
 */
void __cvmx_interrupt_rad_reg_int_mask_enable(void)
{
    cvmx_rad_reg_int_mask_t rad_reg_int_mask;
    cvmx_write_csr(CVMX_RAD_REG_ERROR, cvmx_read_csr(CVMX_RAD_REG_ERROR));
    rad_reg_int_mask.u64 = 0;
    if (OCTEON_IS_MODEL(OCTEON_CN56XX))
    {
        // Skipping rad_reg_int_mask.s.reserved_1_63
        rad_reg_int_mask.s.doorbell = 1;
    }
    if (OCTEON_IS_MODEL(OCTEON_CN52XX))
    {
        // Skipping rad_reg_int_mask.s.reserved_1_63
        rad_reg_int_mask.s.doorbell = 1;
    }
    cvmx_write_csr(CVMX_RAD_REG_INT_MASK, rad_reg_int_mask.u64);
}


/**
 * __cvmx_interrupt_rad_reg_error_decode decodes all interrupt bits in cvmx_rad_reg_error_t
 */
void __cvmx_interrupt_rad_reg_error_decode(void)
{
    cvmx_rad_reg_error_t rad_reg_error;
    rad_reg_error.u64 = cvmx_read_csr(CVMX_RAD_REG_ERROR);
    rad_reg_error.u64 &= cvmx_read_csr(CVMX_RAD_REG_INT_MASK);
    cvmx_write_csr(CVMX_RAD_REG_ERROR, rad_reg_error.u64);
    // Skipping rad_reg_error.s.reserved_1_63
    if (rad_reg_error.s.doorbell)
        PRINT_ERROR("RAD_REG_ERROR[DOORBELL]: A doorbell count has overflowed\n");
}


/**
 * __cvmx_interrupt_spxx_int_msk_enable enables all interrupt bits in cvmx_spxx_int_msk_t
 */
void __cvmx_interrupt_spxx_int_msk_enable(int index)
{
    cvmx_spxx_int_msk_t spx_int_msk;
    cvmx_write_csr(CVMX_SPXX_INT_REG(index), cvmx_read_csr(CVMX_SPXX_INT_REG(index)));
    spx_int_msk.u64 = 0;
    if (OCTEON_IS_MODEL(OCTEON_CN38XX))
    {
        // Skipping spx_int_msk.s.reserved_12_63
        spx_int_msk.s.calerr = 1;
        spx_int_msk.s.syncerr = 1;
        spx_int_msk.s.diperr = 1;
        spx_int_msk.s.tpaovr = 1;
        spx_int_msk.s.rsverr = 1;
        spx_int_msk.s.drwnng = 1;
        spx_int_msk.s.clserr = 1;
        spx_int_msk.s.spiovr = 1;
        // Skipping spx_int_msk.s.reserved_2_3
        spx_int_msk.s.abnorm = 1;
        spx_int_msk.s.prtnxa = 1;
    }
    if (OCTEON_IS_MODEL(OCTEON_CN58XX))
    {
        // Skipping spx_int_msk.s.reserved_12_63
        spx_int_msk.s.calerr = 1;
        spx_int_msk.s.syncerr = 1;
        spx_int_msk.s.diperr = 1;
        spx_int_msk.s.tpaovr = 1;
        spx_int_msk.s.rsverr = 1;
        spx_int_msk.s.drwnng = 1;
        spx_int_msk.s.clserr = 1;
        spx_int_msk.s.spiovr = 1;
        // Skipping spx_int_msk.s.reserved_2_3
        spx_int_msk.s.abnorm = 1;
        spx_int_msk.s.prtnxa = 1;
    }
    cvmx_write_csr(CVMX_SPXX_INT_MSK(index), spx_int_msk.u64);
}


/**
 * __cvmx_interrupt_spxx_int_reg_decode decodes all interrupt bits in cvmx_spxx_int_reg_t
 */
void __cvmx_interrupt_spxx_int_reg_decode(int index)
{
    cvmx_spxx_int_reg_t spx_int_reg;
    spx_int_reg.u64 = cvmx_read_csr(CVMX_SPXX_INT_REG(index));
    spx_int_reg.u64 &= cvmx_read_csr(CVMX_SPXX_INT_MSK(index));
    cvmx_write_csr(CVMX_SPXX_INT_REG(index), spx_int_reg.u64);
    // Skipping spx_int_reg.s.reserved_32_63
    if (spx_int_reg.s.spf)
        PRINT_ERROR("SPX%d_INT_REG[SPF]: Spi interface down\n", index);
    // Skipping spx_int_reg.s.reserved_12_30
    if (spx_int_reg.s.calerr)
        PRINT_ERROR("SPX%d_INT_REG[CALERR]: Spi4 Calendar table parity error\n", index);
    if (spx_int_reg.s.syncerr)
        PRINT_ERROR("SPX%d_INT_REG[SYNCERR]: Consecutive Spi4 DIP4 errors have exceeded\n"
                    "    SPX_ERR_CTL[ERRCNT]\n", index);
    if (spx_int_reg.s.diperr)
        PRINT_ERROR("SPX%d_INT_REG[DIPERR]: Spi4 DIP4 error\n", index);
    if (spx_int_reg.s.tpaovr)
        PRINT_ERROR("SPX%d_INT_REG[TPAOVR]: Selected port has hit TPA overflow\n", index);
    if (spx_int_reg.s.rsverr)
        PRINT_ERROR("SPX%d_INT_REG[RSVERR]: Spi4 reserved control word detected\n", index);
    if (spx_int_reg.s.drwnng)
        PRINT_ERROR("SPX%d_INT_REG[DRWNNG]: Spi4 receive FIFO drowning/overflow\n", index);
    if (spx_int_reg.s.clserr)
        PRINT_ERROR("SPX%d_INT_REG[CLSERR]: Spi4 packet closed on non-16B alignment without EOP\n", index);
    if (spx_int_reg.s.spiovr)
        PRINT_ERROR("SPX%d_INT_REG[SPIOVR]: Spi async FIFO overflow\n", index);
    // Skipping spx_int_reg.s.reserved_2_3
    if (spx_int_reg.s.abnorm)
        PRINT_ERROR("SPX%d_INT_REG[ABNORM]: Abnormal packet termination (ERR bit)\n", index);
    if (spx_int_reg.s.prtnxa)
        PRINT_ERROR("SPX%d_INT_REG[PRTNXA]: Port out of range\n", index);
}


/**
 * __cvmx_interrupt_stxx_int_msk_enable enables all interrupt bits in cvmx_stxx_int_msk_t
 */
void __cvmx_interrupt_stxx_int_msk_enable(int index)
{
    cvmx_stxx_int_msk_t stx_int_msk;
    cvmx_write_csr(CVMX_STXX_INT_REG(index), cvmx_read_csr(CVMX_STXX_INT_REG(index)));
    stx_int_msk.u64 = 0;
    if (OCTEON_IS_MODEL(OCTEON_CN38XX))
    {
        // Skipping stx_int_msk.s.reserved_8_63
        stx_int_msk.s.frmerr = 1;
        stx_int_msk.s.unxfrm = 1;
        stx_int_msk.s.nosync = 1;
        stx_int_msk.s.diperr = 1;
        stx_int_msk.s.datovr = 1;
        stx_int_msk.s.ovrbst = 1;
        stx_int_msk.s.calpar1 = 1;
        stx_int_msk.s.calpar0 = 1;
    }
    if (OCTEON_IS_MODEL(OCTEON_CN58XX))
    {
        // Skipping stx_int_msk.s.reserved_8_63
        stx_int_msk.s.frmerr = 1;
        stx_int_msk.s.unxfrm = 1;
        stx_int_msk.s.nosync = 1;
        stx_int_msk.s.diperr = 1;
        stx_int_msk.s.datovr = 1;
        stx_int_msk.s.ovrbst = 1;
        stx_int_msk.s.calpar1 = 1;
        stx_int_msk.s.calpar0 = 1;
    }
    cvmx_write_csr(CVMX_STXX_INT_MSK(index), stx_int_msk.u64);
}


/**
 * __cvmx_interrupt_stxx_int_reg_decode decodes all interrupt bits in cvmx_stxx_int_reg_t
 */
void __cvmx_interrupt_stxx_int_reg_decode(int index)
{
    cvmx_stxx_int_reg_t stx_int_reg;
    stx_int_reg.u64 = cvmx_read_csr(CVMX_STXX_INT_REG(index));
    stx_int_reg.u64 &= cvmx_read_csr(CVMX_STXX_INT_MSK(index));
    cvmx_write_csr(CVMX_STXX_INT_REG(index), stx_int_reg.u64);
    // Skipping stx_int_reg.s.reserved_9_63
    if (stx_int_reg.s.syncerr)
        PRINT_ERROR("STX%d_INT_REG[SYNCERR]: Interface encountered a fatal error\n", index);
    if (stx_int_reg.s.frmerr)
        PRINT_ERROR("STX%d_INT_REG[FRMERR]: FRMCNT has exceeded STX_DIP_CNT[MAXFRM]\n", index);
    if (stx_int_reg.s.unxfrm)
        PRINT_ERROR("STX%d_INT_REG[UNXFRM]: Unexpected framing sequence\n", index);
    if (stx_int_reg.s.nosync)
        PRINT_ERROR("STX%d_INT_REG[NOSYNC]: ERRCNT has exceeded STX_DIP_CNT[MAXDIP]\n", index);
    if (stx_int_reg.s.diperr)
        PRINT_ERROR("STX%d_INT_REG[DIPERR]: DIP2 error on the Spi4 Status channel\n", index);
    if (stx_int_reg.s.datovr)
        PRINT_ERROR("STX%d_INT_REG[DATOVR]: Spi4 FIFO overflow error\n", index);
    if (stx_int_reg.s.ovrbst)
        PRINT_ERROR("STX%d_INT_REG[OVRBST]: Transmit packet burst too big\n", index);
    if (stx_int_reg.s.calpar1)
        PRINT_ERROR("STX%d_INT_REG[CALPAR1]: STX Calendar Table Parity Error Bank1\n", index);
    if (stx_int_reg.s.calpar0)
        PRINT_ERROR("STX%d_INT_REG[CALPAR0]: STX Calendar Table Parity Error Bank0\n", index);
}


/**
 * __cvmx_interrupt_usbnx_int_enb_enable enables all interrupt bits in cvmx_usbnx_int_enb_t
 */
void __cvmx_interrupt_usbnx_int_enb_enable(int index)
{
    cvmx_usbnx_int_enb_t usbn_int_enb;
    cvmx_write_csr(CVMX_USBNX_INT_SUM(index), cvmx_read_csr(CVMX_USBNX_INT_SUM(index)));
    usbn_int_enb.u64 = 0;
    if (OCTEON_IS_MODEL(OCTEON_CN30XX))
    {
        // Skipping usbn_int_enb.s.reserved_38_63
        usbn_int_enb.s.nd4o_dpf = 1;
        usbn_int_enb.s.nd4o_dpe = 1;
        usbn_int_enb.s.nd4o_rpf = 1;
        usbn_int_enb.s.nd4o_rpe = 1;
        usbn_int_enb.s.ltl_f_pf = 1;
        usbn_int_enb.s.ltl_f_pe = 1;
        usbn_int_enb.s.u2n_c_pe = 1;
        usbn_int_enb.s.u2n_c_pf = 1;
        usbn_int_enb.s.u2n_d_pf = 1;
        usbn_int_enb.s.u2n_d_pe = 1;
        usbn_int_enb.s.n2u_pe = 1;
        usbn_int_enb.s.n2u_pf = 1;
        usbn_int_enb.s.uod_pf = 1;
        usbn_int_enb.s.uod_pe = 1;
        usbn_int_enb.s.rq_q3_e = 1;
        usbn_int_enb.s.rq_q3_f = 1;
        usbn_int_enb.s.rq_q2_e = 1;
        usbn_int_enb.s.rq_q2_f = 1;
        usbn_int_enb.s.rg_fi_f = 1;
        usbn_int_enb.s.rg_fi_e = 1;
        usbn_int_enb.s.l2_fi_f = 1;
        usbn_int_enb.s.l2_fi_e = 1;
        usbn_int_enb.s.l2c_a_f = 1;
        usbn_int_enb.s.l2c_s_e = 1;
        usbn_int_enb.s.dcred_f = 1;
        usbn_int_enb.s.dcred_e = 1;
        usbn_int_enb.s.lt_pu_f = 1;
        usbn_int_enb.s.lt_po_e = 1;
        usbn_int_enb.s.nt_pu_f = 1;
        usbn_int_enb.s.nt_po_e = 1;
        usbn_int_enb.s.pt_pu_f = 1;
        usbn_int_enb.s.pt_po_e = 1;
        usbn_int_enb.s.lr_pu_f = 1;
        usbn_int_enb.s.lr_po_e = 1;
        usbn_int_enb.s.nr_pu_f = 1;
        usbn_int_enb.s.nr_po_e = 1;
        usbn_int_enb.s.pr_pu_f = 1;
        usbn_int_enb.s.pr_po_e = 1;
    }
    if (OCTEON_IS_MODEL(OCTEON_CN50XX))
    {
        // Skipping usbn_int_enb.s.reserved_38_63
        usbn_int_enb.s.nd4o_dpf = 1;
        usbn_int_enb.s.nd4o_dpe = 1;
        usbn_int_enb.s.nd4o_rpf = 1;
        usbn_int_enb.s.nd4o_rpe = 1;
        usbn_int_enb.s.ltl_f_pf = 1;
        usbn_int_enb.s.ltl_f_pe = 1;
        // Skipping usbn_int_enb.s.reserved_26_31
        usbn_int_enb.s.uod_pf = 1;
        usbn_int_enb.s.uod_pe = 1;
        usbn_int_enb.s.rq_q3_e = 1;
        usbn_int_enb.s.rq_q3_f = 1;
        usbn_int_enb.s.rq_q2_e = 1;
        usbn_int_enb.s.rq_q2_f = 1;
        usbn_int_enb.s.rg_fi_f = 1;
        usbn_int_enb.s.rg_fi_e = 1;
        usbn_int_enb.s.l2_fi_f = 1;
        usbn_int_enb.s.l2_fi_e = 1;
        usbn_int_enb.s.l2c_a_f = 1;
        usbn_int_enb.s.l2c_s_e = 1;
        usbn_int_enb.s.dcred_f = 1;
        usbn_int_enb.s.dcred_e = 1;
        usbn_int_enb.s.lt_pu_f = 1;
        usbn_int_enb.s.lt_po_e = 1;
        usbn_int_enb.s.nt_pu_f = 1;
        usbn_int_enb.s.nt_po_e = 1;
        usbn_int_enb.s.pt_pu_f = 1;
        usbn_int_enb.s.pt_po_e = 1;
        usbn_int_enb.s.lr_pu_f = 1;
        usbn_int_enb.s.lr_po_e = 1;
        usbn_int_enb.s.nr_pu_f = 1;
        usbn_int_enb.s.nr_po_e = 1;
        usbn_int_enb.s.pr_pu_f = 1;
        usbn_int_enb.s.pr_po_e = 1;
    }
    if (OCTEON_IS_MODEL(OCTEON_CN31XX))
    {
        // Skipping usbn_int_enb.s.reserved_38_63
        usbn_int_enb.s.nd4o_dpf = 1;
        usbn_int_enb.s.nd4o_dpe = 1;
        usbn_int_enb.s.nd4o_rpf = 1;
        usbn_int_enb.s.nd4o_rpe = 1;
        usbn_int_enb.s.ltl_f_pf = 1;
        usbn_int_enb.s.ltl_f_pe = 1;
        usbn_int_enb.s.u2n_c_pe = 1;
        usbn_int_enb.s.u2n_c_pf = 1;
        usbn_int_enb.s.u2n_d_pf = 1;
        usbn_int_enb.s.u2n_d_pe = 1;
        usbn_int_enb.s.n2u_pe = 1;
        usbn_int_enb.s.n2u_pf = 1;
        usbn_int_enb.s.uod_pf = 1;
        usbn_int_enb.s.uod_pe = 1;
        usbn_int_enb.s.rq_q3_e = 1;
        usbn_int_enb.s.rq_q3_f = 1;
        usbn_int_enb.s.rq_q2_e = 1;
        usbn_int_enb.s.rq_q2_f = 1;
        usbn_int_enb.s.rg_fi_f = 1;
        usbn_int_enb.s.rg_fi_e = 1;
        usbn_int_enb.s.l2_fi_f = 1;
        usbn_int_enb.s.l2_fi_e = 1;
        usbn_int_enb.s.l2c_a_f = 1;
        usbn_int_enb.s.l2c_s_e = 1;
        usbn_int_enb.s.dcred_f = 1;
        usbn_int_enb.s.dcred_e = 1;
        usbn_int_enb.s.lt_pu_f = 1;
        usbn_int_enb.s.lt_po_e = 1;
        usbn_int_enb.s.nt_pu_f = 1;
        usbn_int_enb.s.nt_po_e = 1;
        usbn_int_enb.s.pt_pu_f = 1;
        usbn_int_enb.s.pt_po_e = 1;
        usbn_int_enb.s.lr_pu_f = 1;
        usbn_int_enb.s.lr_po_e = 1;
        usbn_int_enb.s.nr_pu_f = 1;
        usbn_int_enb.s.nr_po_e = 1;
        usbn_int_enb.s.pr_pu_f = 1;
        usbn_int_enb.s.pr_po_e = 1;
    }
    if (OCTEON_IS_MODEL(OCTEON_CN56XX))
    {
        // Skipping usbn_int_enb.s.reserved_38_63
        usbn_int_enb.s.nd4o_dpf = 1;
        usbn_int_enb.s.nd4o_dpe = 1;
        usbn_int_enb.s.nd4o_rpf = 1;
        usbn_int_enb.s.nd4o_rpe = 1;
        usbn_int_enb.s.ltl_f_pf = 1;
        usbn_int_enb.s.ltl_f_pe = 1;
        // Skipping usbn_int_enb.s.reserved_26_31
        usbn_int_enb.s.uod_pf = 1;
        usbn_int_enb.s.uod_pe = 1;
        usbn_int_enb.s.rq_q3_e = 1;
        usbn_int_enb.s.rq_q3_f = 1;
        usbn_int_enb.s.rq_q2_e = 1;
        usbn_int_enb.s.rq_q2_f = 1;
        usbn_int_enb.s.rg_fi_f = 1;
        usbn_int_enb.s.rg_fi_e = 1;
        usbn_int_enb.s.l2_fi_f = 1;
        usbn_int_enb.s.l2_fi_e = 1;
        usbn_int_enb.s.l2c_a_f = 1;
        usbn_int_enb.s.l2c_s_e = 1;
        usbn_int_enb.s.dcred_f = 1;
        usbn_int_enb.s.dcred_e = 1;
        usbn_int_enb.s.lt_pu_f = 1;
        usbn_int_enb.s.lt_po_e = 1;
        usbn_int_enb.s.nt_pu_f = 1;
        usbn_int_enb.s.nt_po_e = 1;
        usbn_int_enb.s.pt_pu_f = 1;
        usbn_int_enb.s.pt_po_e = 1;
        usbn_int_enb.s.lr_pu_f = 1;
        usbn_int_enb.s.lr_po_e = 1;
        usbn_int_enb.s.nr_pu_f = 1;
        usbn_int_enb.s.nr_po_e = 1;
        usbn_int_enb.s.pr_pu_f = 1;
        usbn_int_enb.s.pr_po_e = 1;
    }
    if (OCTEON_IS_MODEL(OCTEON_CN52XX))
    {
        // Skipping usbn_int_enb.s.reserved_38_63
        usbn_int_enb.s.nd4o_dpf = 1;
        usbn_int_enb.s.nd4o_dpe = 1;
        usbn_int_enb.s.nd4o_rpf = 1;
        usbn_int_enb.s.nd4o_rpe = 1;
        usbn_int_enb.s.ltl_f_pf = 1;
        usbn_int_enb.s.ltl_f_pe = 1;
        // Skipping usbn_int_enb.s.reserved_26_31
        usbn_int_enb.s.uod_pf = 1;
        usbn_int_enb.s.uod_pe = 1;
        usbn_int_enb.s.rq_q3_e = 1;
        usbn_int_enb.s.rq_q3_f = 1;
        usbn_int_enb.s.rq_q2_e = 1;
        usbn_int_enb.s.rq_q2_f = 1;
        usbn_int_enb.s.rg_fi_f = 1;
        usbn_int_enb.s.rg_fi_e = 1;
        usbn_int_enb.s.l2_fi_f = 1;
        usbn_int_enb.s.l2_fi_e = 1;
        usbn_int_enb.s.l2c_a_f = 1;
        usbn_int_enb.s.l2c_s_e = 1;
        usbn_int_enb.s.dcred_f = 1;
        usbn_int_enb.s.dcred_e = 1;
        usbn_int_enb.s.lt_pu_f = 1;
        usbn_int_enb.s.lt_po_e = 1;
        usbn_int_enb.s.nt_pu_f = 1;
        usbn_int_enb.s.nt_po_e = 1;
        usbn_int_enb.s.pt_pu_f = 1;
        usbn_int_enb.s.pt_po_e = 1;
        usbn_int_enb.s.lr_pu_f = 1;
        usbn_int_enb.s.lr_po_e = 1;
        usbn_int_enb.s.nr_pu_f = 1;
        usbn_int_enb.s.nr_po_e = 1;
        usbn_int_enb.s.pr_pu_f = 1;
        usbn_int_enb.s.pr_po_e = 1;
    }
    cvmx_write_csr(CVMX_USBNX_INT_ENB(index), usbn_int_enb.u64);
}


/**
 * __cvmx_interrupt_usbnx_int_sum_decode decodes all interrupt bits in cvmx_usbnx_int_sum_t
 */
void __cvmx_interrupt_usbnx_int_sum_decode(int index)
{
    cvmx_usbnx_int_sum_t usbn_int_sum;
    usbn_int_sum.u64 = cvmx_read_csr(CVMX_USBNX_INT_SUM(index));
    usbn_int_sum.u64 &= cvmx_read_csr(CVMX_USBNX_INT_ENB(index));
    cvmx_write_csr(CVMX_USBNX_INT_SUM(index), usbn_int_sum.u64);
    // Skipping usbn_int_sum.s.reserved_38_63
    if (usbn_int_sum.s.nd4o_dpf)
        PRINT_ERROR("USBN%d_INT_SUM[ND4O_DPF]: NCB DMA Out Data Fifo Push Full.\n", index);
    if (usbn_int_sum.s.nd4o_dpe)
        PRINT_ERROR("USBN%d_INT_SUM[ND4O_DPE]: NCB DMA Out Data Fifo Pop Empty.\n", index);
    if (usbn_int_sum.s.nd4o_rpf)
        PRINT_ERROR("USBN%d_INT_SUM[ND4O_RPF]: NCB DMA Out Request Fifo Push Full.\n", index);
    if (usbn_int_sum.s.nd4o_rpe)
        PRINT_ERROR("USBN%d_INT_SUM[ND4O_RPE]: NCB DMA Out Request Fifo Pop Empty.\n", index);
    if (usbn_int_sum.s.ltl_f_pf)
        PRINT_ERROR("USBN%d_INT_SUM[LTL_F_PF]: L2C Transfer Length Fifo Push Full.\n", index);
    if (usbn_int_sum.s.ltl_f_pe)
        PRINT_ERROR("USBN%d_INT_SUM[LTL_F_PE]: L2C Transfer Length Fifo Pop Empty.\n", index);
    if (usbn_int_sum.s.u2n_c_pe)
        PRINT_ERROR("USBN%d_INT_SUM[U2N_C_PE]: U2N Control Fifo Pop Empty.\n", index);
    if (usbn_int_sum.s.u2n_c_pf)
        PRINT_ERROR("USBN%d_INT_SUM[U2N_C_PF]: U2N Control Fifo Push Full.\n", index);
    if (usbn_int_sum.s.u2n_d_pf)
        PRINT_ERROR("USBN%d_INT_SUM[U2N_D_PF]: U2N Data Fifo Push Full.\n", index);
    if (usbn_int_sum.s.u2n_d_pe)
        PRINT_ERROR("USBN%d_INT_SUM[U2N_D_PE]: U2N Data Fifo Pop Empty.\n", index);
    if (usbn_int_sum.s.n2u_pe)
        PRINT_ERROR("USBN%d_INT_SUM[N2U_PE]: N2U Fifo Pop Empty.\n", index);
    if (usbn_int_sum.s.n2u_pf)
        PRINT_ERROR("USBN%d_INT_SUM[N2U_PF]: N2U Fifo Push Full.\n", index);
    if (usbn_int_sum.s.uod_pf)
        PRINT_ERROR("USBN%d_INT_SUM[UOD_PF]: UOD Fifo Push Full.\n", index);
    if (usbn_int_sum.s.uod_pe)
        PRINT_ERROR("USBN%d_INT_SUM[UOD_PE]: UOD Fifo Pop Empty.\n", index);
    if (usbn_int_sum.s.rq_q3_e)
        PRINT_ERROR("USBN%d_INT_SUM[RQ_Q3_E]: Request Queue-3 Fifo Pushed When Full.\n", index);
    if (usbn_int_sum.s.rq_q3_f)
        PRINT_ERROR("USBN%d_INT_SUM[RQ_Q3_F]: Request Queue-3 Fifo Pushed When Full.\n", index);
    if (usbn_int_sum.s.rq_q2_e)
        PRINT_ERROR("USBN%d_INT_SUM[RQ_Q2_E]: Request Queue-2 Fifo Pushed When Full.\n", index);
    if (usbn_int_sum.s.rq_q2_f)
        PRINT_ERROR("USBN%d_INT_SUM[RQ_Q2_F]: Request Queue-2 Fifo Pushed When Full.\n", index);
    if (usbn_int_sum.s.rg_fi_f)
        PRINT_ERROR("USBN%d_INT_SUM[RG_FI_F]: Register Request Fifo Pushed When Full.\n", index);
    if (usbn_int_sum.s.rg_fi_e)
        PRINT_ERROR("USBN%d_INT_SUM[RG_FI_E]: Register Request Fifo Pushed When Full.\n", index);
    if (usbn_int_sum.s.lt_fi_f)
        PRINT_ERROR("USBN%d_INT_SUM[LT_FI_F]: L2C Request Fifo Pushed When Full.\n", index);
    if (usbn_int_sum.s.lt_fi_e)
        PRINT_ERROR("USBN%d_INT_SUM[LT_FI_E]: L2C Request Fifo Pushed When Full.\n", index);
    if (usbn_int_sum.s.l2c_a_f)
        PRINT_ERROR("USBN%d_INT_SUM[L2C_A_F]: L2C Credit Count Added When Full.\n", index);
    if (usbn_int_sum.s.l2c_s_e)
        PRINT_ERROR("USBN%d_INT_SUM[L2C_S_E]: L2C Credit Count Subtracted When Empty.\n", index);
    if (usbn_int_sum.s.dcred_f)
        PRINT_ERROR("USBN%d_INT_SUM[DCRED_F]: Data CreditFifo Pushed When Full.\n", index);
    if (usbn_int_sum.s.dcred_e)
        PRINT_ERROR("USBN%d_INT_SUM[DCRED_E]: Data Credit Fifo Pushed When Full.\n", index);
    if (usbn_int_sum.s.lt_pu_f)
        PRINT_ERROR("USBN%d_INT_SUM[LT_PU_F]: L2C Trasaction Fifo Pushed When Full.\n", index);
    if (usbn_int_sum.s.lt_po_e)
        PRINT_ERROR("USBN%d_INT_SUM[LT_PO_E]: L2C Trasaction Fifo Popped When Full.\n", index);
    if (usbn_int_sum.s.nt_pu_f)
        PRINT_ERROR("USBN%d_INT_SUM[NT_PU_F]: NPI Trasaction Fifo Pushed When Full.\n", index);
    if (usbn_int_sum.s.nt_po_e)
        PRINT_ERROR("USBN%d_INT_SUM[NT_PO_E]: NPI Trasaction Fifo Popped When Full.\n", index);
    if (usbn_int_sum.s.pt_pu_f)
        PRINT_ERROR("USBN%d_INT_SUM[PT_PU_F]: PP  Trasaction Fifo Pushed When Full.\n", index);
    if (usbn_int_sum.s.pt_po_e)
        PRINT_ERROR("USBN%d_INT_SUM[PT_PO_E]: PP  Trasaction Fifo Popped When Full.\n", index);
    if (usbn_int_sum.s.lr_pu_f)
        PRINT_ERROR("USBN%d_INT_SUM[LR_PU_F]: L2C Request Fifo Pushed When Full.\n", index);
    if (usbn_int_sum.s.lr_po_e)
        PRINT_ERROR("USBN%d_INT_SUM[LR_PO_E]: L2C Request Fifo Popped When Empty.\n", index);
    if (usbn_int_sum.s.nr_pu_f)
        PRINT_ERROR("USBN%d_INT_SUM[NR_PU_F]: NPI Request Fifo Pushed When Full.\n", index);
    if (usbn_int_sum.s.nr_po_e)
        PRINT_ERROR("USBN%d_INT_SUM[NR_PO_E]: NPI Request Fifo Popped When Empty.\n", index);
    if (usbn_int_sum.s.pr_pu_f)
        PRINT_ERROR("USBN%d_INT_SUM[PR_PU_F]: PP  Request Fifo Pushed When Full.\n", index);
    if (usbn_int_sum.s.pr_po_e)
        PRINT_ERROR("USBN%d_INT_SUM[PR_PO_E]: PP  Request Fifo Popped When Empty.\n", index);
}


/**
 * __cvmx_interrupt_zip_int_mask_enable enables all interrupt bits in cvmx_zip_int_mask_t
 */
void __cvmx_interrupt_zip_int_mask_enable(void)
{
    cvmx_zip_int_mask_t zip_int_mask;
    cvmx_write_csr(CVMX_ZIP_ERROR, cvmx_read_csr(CVMX_ZIP_ERROR));
    zip_int_mask.u64 = 0;
    if (OCTEON_IS_MODEL(OCTEON_CN56XX))
    {
        // Skipping zip_int_mask.s.reserved_1_63
        zip_int_mask.s.doorbell = 1;
    }
    if (OCTEON_IS_MODEL(OCTEON_CN38XX))
    {
        // Skipping zip_int_mask.s.reserved_1_63
        zip_int_mask.s.doorbell = 1;
    }
    if (OCTEON_IS_MODEL(OCTEON_CN31XX))
    {
        // Skipping zip_int_mask.s.reserved_1_63
        zip_int_mask.s.doorbell = 1;
    }
    if (OCTEON_IS_MODEL(OCTEON_CN58XX))
    {
        // Skipping zip_int_mask.s.reserved_1_63
        zip_int_mask.s.doorbell = 1;
    }
    cvmx_write_csr(CVMX_ZIP_INT_MASK, zip_int_mask.u64);
}


/**
 * __cvmx_interrupt_zip_error_decode decodes all interrupt bits in cvmx_zip_error_t
 */
void __cvmx_interrupt_zip_error_decode(void)
{
    cvmx_zip_error_t zip_error;
    zip_error.u64 = cvmx_read_csr(CVMX_ZIP_ERROR);
    zip_error.u64 &= cvmx_read_csr(CVMX_ZIP_INT_MASK);
    cvmx_write_csr(CVMX_ZIP_ERROR, zip_error.u64);
    // Skipping zip_error.s.reserved_1_63
    if (zip_error.s.doorbell)
        PRINT_ERROR("ZIP_ERROR[DOORBELL]: A doorbell count has overflowed\n");
}

OpenPOWER on IntegriCloud