xref: /illumos-gate/usr/src/uts/sun4v/io/n2piupc/n2piupc_tables.c (revision ea1a228c80597366447774aa1988868492330eb5)
1*ea1a228cSschwartz /*
2*ea1a228cSschwartz  * CDDL HEADER START
3*ea1a228cSschwartz  *
4*ea1a228cSschwartz  * The contents of this file are subject to the terms of the
5*ea1a228cSschwartz  * Common Development and Distribution License (the "License").
6*ea1a228cSschwartz  * You may not use this file except in compliance with the License.
7*ea1a228cSschwartz  *
8*ea1a228cSschwartz  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*ea1a228cSschwartz  * or http://www.opensolaris.org/os/licensing.
10*ea1a228cSschwartz  * See the License for the specific language governing permissions
11*ea1a228cSschwartz  * and limitations under the License.
12*ea1a228cSschwartz  *
13*ea1a228cSschwartz  * When distributing Covered Code, include this CDDL HEADER in each
14*ea1a228cSschwartz  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*ea1a228cSschwartz  * If applicable, add the following below this CDDL HEADER, with the
16*ea1a228cSschwartz  * fields enclosed by brackets "[]" replaced with your own identifying
17*ea1a228cSschwartz  * information: Portions Copyright [yyyy] [name of copyright owner]
18*ea1a228cSschwartz  *
19*ea1a228cSschwartz  * CDDL HEADER END
20*ea1a228cSschwartz  */
21*ea1a228cSschwartz 
22*ea1a228cSschwartz /*
23*ea1a228cSschwartz  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
24*ea1a228cSschwartz  * Use is subject to license terms.
25*ea1a228cSschwartz  */
26*ea1a228cSschwartz 
27*ea1a228cSschwartz #pragma ident	"%Z%%M%	%I%	%E% SMI"
28*ea1a228cSschwartz 
29*ea1a228cSschwartz /*
30*ea1a228cSschwartz  * Tables to drive the N2 PIU performance counter driver.
31*ea1a228cSschwartz  *
32*ea1a228cSschwartz  * Please see n2piupc-tables.h for an explanation of how the table is put
33*ea1a228cSschwartz  * together.
34*ea1a228cSschwartz  */
35*ea1a228cSschwartz 
36*ea1a228cSschwartz #include <sys/types.h>
37*ea1a228cSschwartz #include <sys/kstat.h>
38*ea1a228cSschwartz #include "n2piupc_tables.h"
39*ea1a228cSschwartz #include "n2piupc.h"
40*ea1a228cSschwartz #include "n2piupc_biterr.h"
41*ea1a228cSschwartz 
42*ea1a228cSschwartz static n2piu_event_t imu_ctr_1_evts[] = {
43*ea1a228cSschwartz 	{ IMU01_S_EVT_NONE,			IMU01_EVT_NONE },
44*ea1a228cSschwartz 	{ IMU01_S_EVT_CLK,			IMU01_EVT_CLK },
45*ea1a228cSschwartz 	{ IMU01_S_EVT_TOTAL_MONDO,		IMU01_EVT_TOTAL_MONDO },
46*ea1a228cSschwartz 	{ IMU01_S_EVT_TOTAL_MSI,		IMU01_EVT_TOTAL_MSI },
47*ea1a228cSschwartz 	{ IMU01_S_EVT_NAK_MONDO,		IMU01_EVT_NAK_MONDO },
48*ea1a228cSschwartz 	{ IMU01_S_EVT_EQ_WR,			IMU01_EVT_EQ_WR },
49*ea1a228cSschwartz 	{ IMU01_S_EVT_EQ_MONDO,			IMU01_EVT_EQ_MONDO },
50*ea1a228cSschwartz 	{ COMMON_S_CLEAR_PIC,			IMU_CTR_EVT_MASK }
51*ea1a228cSschwartz };
52*ea1a228cSschwartz 
53*ea1a228cSschwartz static n2piu_event_t imu_ctr_0_evts[] = {
54*ea1a228cSschwartz 	{ IMU01_S_EVT_NONE,			IMU01_EVT_NONE },
55*ea1a228cSschwartz 	{ IMU01_S_EVT_CLK,			IMU01_EVT_CLK },
56*ea1a228cSschwartz 	{ IMU01_S_EVT_TOTAL_MONDO,		IMU01_EVT_TOTAL_MONDO },
57*ea1a228cSschwartz 	{ IMU01_S_EVT_TOTAL_MSI,		IMU01_EVT_TOTAL_MSI },
58*ea1a228cSschwartz 	{ IMU01_S_EVT_NAK_MONDO,		IMU01_EVT_NAK_MONDO },
59*ea1a228cSschwartz 	{ IMU01_S_EVT_EQ_WR,			IMU01_EVT_EQ_WR },
60*ea1a228cSschwartz 	{ IMU01_S_EVT_EQ_MONDO,			IMU01_EVT_EQ_MONDO },
61*ea1a228cSschwartz 	{ COMMON_S_CLEAR_PIC,			IMU_CTR_EVT_MASK }
62*ea1a228cSschwartz };
63*ea1a228cSschwartz 
64*ea1a228cSschwartz static n2piu_event_t mmu_ctr_1_evts[] = {
65*ea1a228cSschwartz 	{ MMU01_S_EVT_NONE,			MMU01_EVT_NONE },
66*ea1a228cSschwartz 	{ MMU01_S_EVT_CLK,			MMU01_EVT_CLK },
67*ea1a228cSschwartz 	{ MMU01_S_EVT_TRANS,			MMU01_EVT_TRANS },
68*ea1a228cSschwartz 	{ MMU01_S_EVT_STALL,			MMU01_EVT_STALL },
69*ea1a228cSschwartz 	{ MMU01_S_EVT_TRANS_MISS,		MMU01_EVT_TRANS_MISS },
70*ea1a228cSschwartz 	{ MMU01_S_EVT_TBLWLK_STALL,		MMU01_EVT_TBLWLK_STALL },
71*ea1a228cSschwartz 	{ MMU01_S_EVT_BYPASS_TRANSL,		MMU01_EVT_BYPASS_TRANSL },
72*ea1a228cSschwartz 	{ MMU01_S_EVT_TRANSL_TRANSL,		MMU01_EVT_TRANSL_TRANSL },
73*ea1a228cSschwartz 	{ MMU01_S_EVT_FLOW_CNTL_STALL,		MMU01_EVT_FLOW_CNTL_STALL },
74*ea1a228cSschwartz 	{ MMU01_S_EVT_FLUSH_CACHE_ENT,		MMU01_EVT_FLUSH_CACHE_ENT },
75*ea1a228cSschwartz 	{ COMMON_S_CLEAR_PIC,			MMU_CTR_EVT_MASK }
76*ea1a228cSschwartz };
77*ea1a228cSschwartz 
78*ea1a228cSschwartz static n2piu_event_t mmu_ctr_0_evts[] = {
79*ea1a228cSschwartz 	{ MMU01_S_EVT_NONE,			MMU01_EVT_NONE },
80*ea1a228cSschwartz 	{ MMU01_S_EVT_CLK,			MMU01_EVT_CLK },
81*ea1a228cSschwartz 	{ MMU01_S_EVT_TRANS,			MMU01_EVT_TRANS },
82*ea1a228cSschwartz 	{ MMU01_S_EVT_STALL,			MMU01_EVT_STALL },
83*ea1a228cSschwartz 	{ MMU01_S_EVT_TRANS_MISS,		MMU01_EVT_TRANS_MISS },
84*ea1a228cSschwartz 	{ MMU01_S_EVT_TBLWLK_STALL,		MMU01_EVT_TBLWLK_STALL },
85*ea1a228cSschwartz 	{ MMU01_S_EVT_BYPASS_TRANSL,		MMU01_EVT_BYPASS_TRANSL },
86*ea1a228cSschwartz 	{ MMU01_S_EVT_TRANSL_TRANSL,		MMU01_EVT_TRANSL_TRANSL },
87*ea1a228cSschwartz 	{ MMU01_S_EVT_FLOW_CNTL_STALL,		MMU01_EVT_FLOW_CNTL_STALL },
88*ea1a228cSschwartz 	{ MMU01_S_EVT_FLUSH_CACHE_ENT,		MMU01_EVT_FLUSH_CACHE_ENT },
89*ea1a228cSschwartz 	{ COMMON_S_CLEAR_PIC,			MMU_CTR_EVT_MASK }
90*ea1a228cSschwartz };
91*ea1a228cSschwartz 
92*ea1a228cSschwartz static n2piu_event_t peu_ctr_2_evts[] = {
93*ea1a228cSschwartz 	{ PEU2_S_EVT_NONE,			PEU2_EVT_NONE },
94*ea1a228cSschwartz 	{ PEU2_S_EVT_NONPST_CMPL_TIME,		PEU2_EVT_NONPST_CMPL_TIME },
95*ea1a228cSschwartz 	{ PEU2_S_EVT_XMIT_DATA,			PEU2_EVT_XMIT_DATA },
96*ea1a228cSschwartz 	{ PEU2_S_EVT_RCVD_DATA,			PEU2_EVT_RCVD_DATA },
97*ea1a228cSschwartz 	{ COMMON_S_CLEAR_PIC,			PEU_CTR_2_EVT_MASK }
98*ea1a228cSschwartz };
99*ea1a228cSschwartz 
100*ea1a228cSschwartz static n2piu_event_t peu_ctr_1_evts[] = {
101*ea1a228cSschwartz 	{ PEU01_S_EVT_NONE,			PEU01_EVT_NONE },
102*ea1a228cSschwartz 	{ PEU01_S_EVT_CLK,			PEU01_EVT_CLK },
103*ea1a228cSschwartz 	{ PEU01_S_EVT_COMPL,			PEU01_EVT_COMPL },
104*ea1a228cSschwartz 	{ PEU01_S_EVT_XMT_POST_CR_UNAV,		PEU01_EVT_XMT_POST_CR_UNAV },
105*ea1a228cSschwartz 	{ PEU01_S_EVT_XMT_NPOST_CR_UNAV,	PEU01_EVT_XMT_NPOST_CR_UNAV },
106*ea1a228cSschwartz 	{ PEU01_S_EVT_XMT_CMPL_CR_UNAV,		PEU01_EVT_XMT_CMPL_CR_UNAV },
107*ea1a228cSschwartz 	{ PEU01_S_EVT_XMT_ANY_CR_UNAV,		PEU01_EVT_XMT_ANY_CR_UNAV },
108*ea1a228cSschwartz 	{ PEU01_S_EVT_RETRY_CR_UNAV,		PEU01_EVT_RETRY_CR_UNAV },
109*ea1a228cSschwartz 	{ PEU01_S_EVT_MEMRD_PKT_RCVD,		PEU01_EVT_MEMRD_PKT_RCVD },
110*ea1a228cSschwartz 	{ PEU01_S_EVT_MEMWR_PKT_RCVD,		PEU01_EVT_MEMWR_PKT_RCVD },
111*ea1a228cSschwartz 	{ PEU01_S_EVT_RCV_CR_THRESH,		PEU01_EVT_RCV_CR_THRESH },
112*ea1a228cSschwartz 	{ PEU01_S_EVT_RCV_PST_HDR_CR_EXH,	PEU01_EVT_RCV_PST_HDR_CR_EXH },
113*ea1a228cSschwartz 	{ PEU01_S_EVT_RCV_PST_DA_CR_MPS,	PEU01_EVT_RCV_PST_DA_CR_MPS },
114*ea1a228cSschwartz 	{ PEU01_S_EVT_RCV_NPST_HDR_CR_EXH,	PEU01_EVT_RCV_NPST_HDR_CR_EXH },
115*ea1a228cSschwartz 	{ PEU01_S_EVT_RCVR_L0S,			PEU01_EVT_RCVR_L0S },
116*ea1a228cSschwartz 	{ PEU01_S_EVT_RCVR_L0S_TRANS,		PEU01_EVT_RCVR_L0S_TRANS },
117*ea1a228cSschwartz 	{ PEU01_S_EVT_XMTR_L0S,			PEU01_EVT_XMTR_L0S },
118*ea1a228cSschwartz 	{ PEU01_S_EVT_XMTR_L0S_TRANS,		PEU01_EVT_XMTR_L0S_TRANS },
119*ea1a228cSschwartz 	{ PEU01_S_EVT_RCVR_ERR,			PEU01_EVT_RCVR_ERR },
120*ea1a228cSschwartz 	{ PEU01_S_EVT_BAD_TLP,			PEU01_EVT_BAD_TLP },
121*ea1a228cSschwartz 	{ PEU01_S_EVT_BAD_DLLP,			PEU01_EVT_BAD_DLLP },
122*ea1a228cSschwartz 	{ PEU01_S_EVT_REPLAY_ROLLOVER,		PEU01_EVT_REPLAY_ROLLOVER },
123*ea1a228cSschwartz 	{ PEU01_S_EVT_REPLAY_TMO,		PEU01_EVT_REPLAY_TMO },
124*ea1a228cSschwartz 	{ COMMON_S_CLEAR_PIC,			PEU_CTR_01_EVT_MASK }
125*ea1a228cSschwartz };
126*ea1a228cSschwartz 
127*ea1a228cSschwartz static n2piu_event_t peu_ctr_0_evts[] = {
128*ea1a228cSschwartz 	{ PEU01_S_EVT_NONE,			PEU01_EVT_NONE },
129*ea1a228cSschwartz 	{ PEU01_S_EVT_CLK,			PEU01_EVT_CLK },
130*ea1a228cSschwartz 	{ PEU01_S_EVT_COMPL,			PEU01_EVT_COMPL },
131*ea1a228cSschwartz 	{ PEU01_S_EVT_XMT_POST_CR_UNAV,		PEU01_EVT_XMT_POST_CR_UNAV },
132*ea1a228cSschwartz 	{ PEU01_S_EVT_XMT_NPOST_CR_UNAV,	PEU01_EVT_XMT_NPOST_CR_UNAV },
133*ea1a228cSschwartz 	{ PEU01_S_EVT_XMT_CMPL_CR_UNAV,		PEU01_EVT_XMT_CMPL_CR_UNAV },
134*ea1a228cSschwartz 	{ PEU01_S_EVT_XMT_ANY_CR_UNAV,		PEU01_EVT_XMT_ANY_CR_UNAV },
135*ea1a228cSschwartz 	{ PEU01_S_EVT_RETRY_CR_UNAV,		PEU01_EVT_RETRY_CR_UNAV },
136*ea1a228cSschwartz 	{ PEU01_S_EVT_MEMRD_PKT_RCVD,		PEU01_EVT_MEMRD_PKT_RCVD },
137*ea1a228cSschwartz 	{ PEU01_S_EVT_MEMWR_PKT_RCVD,		PEU01_EVT_MEMWR_PKT_RCVD },
138*ea1a228cSschwartz 	{ PEU01_S_EVT_RCV_CR_THRESH,		PEU01_EVT_RCV_CR_THRESH },
139*ea1a228cSschwartz 	{ PEU01_S_EVT_RCV_PST_HDR_CR_EXH,	PEU01_EVT_RCV_PST_HDR_CR_EXH },
140*ea1a228cSschwartz 	{ PEU01_S_EVT_RCV_PST_DA_CR_MPS,	PEU01_EVT_RCV_PST_DA_CR_MPS },
141*ea1a228cSschwartz 	{ PEU01_S_EVT_RCV_NPST_HDR_CR_EXH,	PEU01_EVT_RCV_NPST_HDR_CR_EXH },
142*ea1a228cSschwartz 	{ PEU01_S_EVT_RCVR_L0S,			PEU01_EVT_RCVR_L0S },
143*ea1a228cSschwartz 	{ PEU01_S_EVT_RCVR_L0S_TRANS,		PEU01_EVT_RCVR_L0S_TRANS },
144*ea1a228cSschwartz 	{ PEU01_S_EVT_XMTR_L0S,			PEU01_EVT_XMTR_L0S },
145*ea1a228cSschwartz 	{ PEU01_S_EVT_XMTR_L0S_TRANS,		PEU01_EVT_XMTR_L0S_TRANS },
146*ea1a228cSschwartz 	{ PEU01_S_EVT_RCVR_ERR,			PEU01_EVT_RCVR_ERR },
147*ea1a228cSschwartz 	{ PEU01_S_EVT_BAD_TLP,			PEU01_EVT_BAD_TLP },
148*ea1a228cSschwartz 	{ PEU01_S_EVT_BAD_DLLP,			PEU01_EVT_BAD_DLLP },
149*ea1a228cSschwartz 	{ PEU01_S_EVT_REPLAY_ROLLOVER,		PEU01_EVT_REPLAY_ROLLOVER },
150*ea1a228cSschwartz 	{ PEU01_S_EVT_REPLAY_TMO,		PEU01_EVT_REPLAY_TMO },
151*ea1a228cSschwartz 	{ COMMON_S_CLEAR_PIC,			PEU_CTR_01_EVT_MASK }
152*ea1a228cSschwartz };
153*ea1a228cSschwartz 
154*ea1a228cSschwartz static n2piu_event_t bterr_ctr_3_evts[] = {
155*ea1a228cSschwartz 	{ BTERR3_S_EVT_NONE,			BTERR3_EVT_ENC_NONE },
156*ea1a228cSschwartz 	{ BTERR3_S_EVT_ENC_ALL,			BTERR3_EVT_ENC_ALL },
157*ea1a228cSschwartz 	{ BTERR3_S_EVT_ENC_LANE_0,		BTERR3_EVT_ENC_LANE_0 },
158*ea1a228cSschwartz 	{ BTERR3_S_EVT_ENC_LANE_1,		BTERR3_EVT_ENC_LANE_1 },
159*ea1a228cSschwartz 	{ BTERR3_S_EVT_ENC_LANE_2,		BTERR3_EVT_ENC_LANE_2 },
160*ea1a228cSschwartz 	{ BTERR3_S_EVT_ENC_LANE_3,		BTERR3_EVT_ENC_LANE_3 },
161*ea1a228cSschwartz 	{ BTERR3_S_EVT_ENC_LANE_4,		BTERR3_EVT_ENC_LANE_4 },
162*ea1a228cSschwartz 	{ BTERR3_S_EVT_ENC_LANE_5,		BTERR3_EVT_ENC_LANE_5 },
163*ea1a228cSschwartz 	{ BTERR3_S_EVT_ENC_LANE_6,		BTERR3_EVT_ENC_LANE_6 },
164*ea1a228cSschwartz 	{ BTERR3_S_EVT_ENC_LANE_7,		BTERR3_EVT_ENC_LANE_7 },
165*ea1a228cSschwartz 	{ COMMON_S_CLEAR_PIC,			BTERR_CTR_3_EVT_MASK }
166*ea1a228cSschwartz };
167*ea1a228cSschwartz 
168*ea1a228cSschwartz static n2piu_event_t bterr_ctr_2_evts[] = {
169*ea1a228cSschwartz 	{ BTERR2_S_EVT_PRE,			BTERR2_EVT_PRE },
170*ea1a228cSschwartz 	{ COMMON_S_CLEAR_PIC,			NONPROG_DUMMY_MASK }
171*ea1a228cSschwartz };
172*ea1a228cSschwartz 
173*ea1a228cSschwartz static n2piu_event_t bterr_ctr_1_evts[] = {
174*ea1a228cSschwartz 	{ BTERR1_S_EVT_BTLP,			BTERR1_EVT_BTLP },
175*ea1a228cSschwartz 	{ COMMON_S_CLEAR_PIC,			NONPROG_DUMMY_MASK }
176*ea1a228cSschwartz };
177*ea1a228cSschwartz 
178*ea1a228cSschwartz static n2piu_event_t bterr_ctr_0_evts[] = {
179*ea1a228cSschwartz 	{ BTERR0_S_EVT_RESET,			BTERR0_EVT_RESET },
180*ea1a228cSschwartz 	{ BTERR0_S_EVT_BDLLP,			BTERR0_EVT_BDLLP },
181*ea1a228cSschwartz 	{ COMMON_S_CLEAR_PIC,			BTERR_CTR_0_EVT_MASK }
182*ea1a228cSschwartz };
183*ea1a228cSschwartz 
184*ea1a228cSschwartz static n2piu_regsel_fld_t imu_regsel_flds[] = {
185*ea1a228cSschwartz 	{ imu_ctr_0_evts, NUM_EVTS(imu_ctr_0_evts),
186*ea1a228cSschwartz 				IMU_CTR_EVT_MASK, IMU_CTR_0_EVT_OFF },
187*ea1a228cSschwartz 	{ imu_ctr_1_evts, NUM_EVTS(imu_ctr_1_evts),
188*ea1a228cSschwartz 				IMU_CTR_EVT_MASK, IMU_CTR_1_EVT_OFF }
189*ea1a228cSschwartz };
190*ea1a228cSschwartz 
191*ea1a228cSschwartz static n2piu_regsel_fld_t mmu_regsel_flds[] = {
192*ea1a228cSschwartz 	{ mmu_ctr_0_evts, NUM_EVTS(mmu_ctr_0_evts),
193*ea1a228cSschwartz 				MMU_CTR_EVT_MASK, MMU_CTR_0_EVT_OFF },
194*ea1a228cSschwartz 	{ mmu_ctr_1_evts, NUM_EVTS(mmu_ctr_1_evts),
195*ea1a228cSschwartz 				MMU_CTR_EVT_MASK, MMU_CTR_1_EVT_OFF }
196*ea1a228cSschwartz };
197*ea1a228cSschwartz 
198*ea1a228cSschwartz static n2piu_regsel_fld_t peu_regsel_flds[] = {
199*ea1a228cSschwartz 	{ peu_ctr_0_evts, NUM_EVTS(peu_ctr_0_evts),
200*ea1a228cSschwartz 				PEU_CTR_01_EVT_MASK, PEU_CTR_0_EVT_OFF },
201*ea1a228cSschwartz 	{ peu_ctr_1_evts, NUM_EVTS(peu_ctr_1_evts),
202*ea1a228cSschwartz 				PEU_CTR_01_EVT_MASK, PEU_CTR_1_EVT_OFF },
203*ea1a228cSschwartz 	{ peu_ctr_2_evts, NUM_EVTS(peu_ctr_2_evts),
204*ea1a228cSschwartz 				PEU_CTR_2_EVT_MASK, PEU_CTR_2_EVT_OFF }
205*ea1a228cSschwartz };
206*ea1a228cSschwartz 
207*ea1a228cSschwartz static n2piu_regsel_fld_t bterr_regsel_flds[] = {
208*ea1a228cSschwartz 	{ bterr_ctr_0_evts, NUM_EVTS(bterr_ctr_0_evts),
209*ea1a228cSschwartz 				BTERR_CTR_ENABLE_MASK, BTERR_CTR_ENABLE_OFF },
210*ea1a228cSschwartz 	{ bterr_ctr_1_evts, NUM_EVTS(bterr_ctr_1_evts),
211*ea1a228cSschwartz 				NONPROG_DUMMY_MASK, NONPROG_DUMMY_OFF },
212*ea1a228cSschwartz 	{ bterr_ctr_2_evts, NUM_EVTS(bterr_ctr_2_evts),
213*ea1a228cSschwartz 				NONPROG_DUMMY_MASK, NONPROG_DUMMY_OFF },
214*ea1a228cSschwartz 	{ bterr_ctr_3_evts, NUM_EVTS(bterr_ctr_3_evts),
215*ea1a228cSschwartz 				BTERR_CTR_3_EVT_MASK, BTERR_CTR_3_EVT_OFF }
216*ea1a228cSschwartz };
217*ea1a228cSschwartz 
218*ea1a228cSschwartz static n2piu_regsel_t imu_regsel = {
219*ea1a228cSschwartz 	HVIO_N2PIU_PERFREG_IMU_SEL,
220*ea1a228cSschwartz 	imu_regsel_flds,
221*ea1a228cSschwartz 	NUM_FLDS(imu_regsel_flds)
222*ea1a228cSschwartz };
223*ea1a228cSschwartz 
224*ea1a228cSschwartz static n2piu_regsel_t mmu_regsel = {
225*ea1a228cSschwartz 	HVIO_N2PIU_PERFREG_MMU_SEL,
226*ea1a228cSschwartz 	mmu_regsel_flds,
227*ea1a228cSschwartz 	NUM_FLDS(mmu_regsel_flds)
228*ea1a228cSschwartz };
229*ea1a228cSschwartz 
230*ea1a228cSschwartz static n2piu_regsel_t peu_regsel = {
231*ea1a228cSschwartz 	HVIO_N2PIU_PERFREG_PEU_SEL,
232*ea1a228cSschwartz 	peu_regsel_flds,
233*ea1a228cSschwartz 	NUM_FLDS(peu_regsel_flds)
234*ea1a228cSschwartz };
235*ea1a228cSschwartz 
236*ea1a228cSschwartz static n2piu_regsel_t bit_err_regsel = {
237*ea1a228cSschwartz 	SW_N2PIU_BITERR_SEL,
238*ea1a228cSschwartz 	bterr_regsel_flds,
239*ea1a228cSschwartz 	NUM_FLDS(bterr_regsel_flds)
240*ea1a228cSschwartz };
241*ea1a228cSschwartz 
242*ea1a228cSschwartz /* reg off, reg size, field mask */
243*ea1a228cSschwartz static n2piu_cntr_t imu_cntrs[] = {
244*ea1a228cSschwartz 	{ HVIO_N2PIU_PERFREG_IMU_CNT0, FULL64BIT,
245*ea1a228cSschwartz 		HVIO_N2PIU_PERFREG_IMU_CNT0, 0ULL},
246*ea1a228cSschwartz 	{ HVIO_N2PIU_PERFREG_IMU_CNT1, FULL64BIT,
247*ea1a228cSschwartz 		HVIO_N2PIU_PERFREG_IMU_CNT1, 0ULL}
248*ea1a228cSschwartz };
249*ea1a228cSschwartz 
250*ea1a228cSschwartz static n2piu_cntr_t mmu_cntrs[] = {
251*ea1a228cSschwartz 	{ HVIO_N2PIU_PERFREG_MMU_CNT0, FULL64BIT,
252*ea1a228cSschwartz 		HVIO_N2PIU_PERFREG_MMU_CNT0, 0ULL},
253*ea1a228cSschwartz 	{ HVIO_N2PIU_PERFREG_MMU_CNT1, FULL64BIT,
254*ea1a228cSschwartz 		HVIO_N2PIU_PERFREG_MMU_CNT1, 0ULL}
255*ea1a228cSschwartz };
256*ea1a228cSschwartz 
257*ea1a228cSschwartz static n2piu_cntr_t peu_cntrs[] = {
258*ea1a228cSschwartz 	{ HVIO_N2PIU_PERFREG_PEU_CNT0, FULL64BIT,
259*ea1a228cSschwartz 		HVIO_N2PIU_PERFREG_PEU_CNT0, 0ULL},
260*ea1a228cSschwartz 	{ HVIO_N2PIU_PERFREG_PEU_CNT1, FULL64BIT,
261*ea1a228cSschwartz 		HVIO_N2PIU_PERFREG_PEU_CNT1, 0ULL},
262*ea1a228cSschwartz 	{ HVIO_N2PIU_PERFREG_PEU_CNT2, FULL64BIT,
263*ea1a228cSschwartz 		HVIO_N2PIU_PERFREG_PEU_CNT2, 0ULL}
264*ea1a228cSschwartz };
265*ea1a228cSschwartz 
266*ea1a228cSschwartz static n2piu_cntr_t bit_err_cntrs[] = {
267*ea1a228cSschwartz 	{ SW_N2PIU_BITERR_CNT1_DATA, BE1_BAD_DLLP_MASK,
268*ea1a228cSschwartz 		SW_N2PIU_BITERR_CLR, BTERR_CTR_CLR},
269*ea1a228cSschwartz 	{ SW_N2PIU_BITERR_CNT1_DATA, BE1_BAD_TLP_MASK, NO_REGISTER, 0},
270*ea1a228cSschwartz 	{ SW_N2PIU_BITERR_CNT1_DATA, BE1_BAD_PRE_MASK, NO_REGISTER, 0},
271*ea1a228cSschwartz 
272*ea1a228cSschwartz 	/* Note: this register is a layered SW-implemented register. */
273*ea1a228cSschwartz 	{ SW_N2PIU_BITERR_CNT2_DATA, BE2_8_10_MASK, NO_REGISTER, 0},
274*ea1a228cSschwartz };
275*ea1a228cSschwartz 
276*ea1a228cSschwartz static n2piu_grp_t imu_grp = {
277*ea1a228cSschwartz 	"imu",
278*ea1a228cSschwartz 	&imu_regsel,
279*ea1a228cSschwartz 	imu_cntrs,
280*ea1a228cSschwartz 	NUM_CTRS(imu_cntrs),
281*ea1a228cSschwartz 	NULL		/* Name kstats pointer, filled in at runtime. */
282*ea1a228cSschwartz };
283*ea1a228cSschwartz 
284*ea1a228cSschwartz static n2piu_grp_t mmu_grp = {
285*ea1a228cSschwartz 	"mmu",
286*ea1a228cSschwartz 	&mmu_regsel,
287*ea1a228cSschwartz 	mmu_cntrs,
288*ea1a228cSschwartz 	NUM_CTRS(mmu_cntrs),
289*ea1a228cSschwartz 	NULL		/* Name kstats pointer, filled in at runtime. */
290*ea1a228cSschwartz };
291*ea1a228cSschwartz 
292*ea1a228cSschwartz static n2piu_grp_t peu_grp = {
293*ea1a228cSschwartz 	"peu",
294*ea1a228cSschwartz 	&peu_regsel,
295*ea1a228cSschwartz 	peu_cntrs,
296*ea1a228cSschwartz 	NUM_CTRS(peu_cntrs),
297*ea1a228cSschwartz 	NULL		/* Name kstats pointer, filled in at runtime. */
298*ea1a228cSschwartz };
299*ea1a228cSschwartz 
300*ea1a228cSschwartz static n2piu_grp_t bit_err_grp = {
301*ea1a228cSschwartz 	"bterr",
302*ea1a228cSschwartz 	&bit_err_regsel,
303*ea1a228cSschwartz 	bit_err_cntrs,
304*ea1a228cSschwartz 	NUM_CTRS(bit_err_cntrs),
305*ea1a228cSschwartz 	NULL		/* Name kstats pointer, filled in at runtime. */
306*ea1a228cSschwartz };
307*ea1a228cSschwartz 
308*ea1a228cSschwartz n2piu_grp_t *leaf_grps[] = {
309*ea1a228cSschwartz 	&imu_grp,
310*ea1a228cSschwartz 	&mmu_grp,
311*ea1a228cSschwartz 	&peu_grp,
312*ea1a228cSschwartz 	&bit_err_grp,
313*ea1a228cSschwartz 	NULL
314*ea1a228cSschwartz };
315