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 #ifndef _N2PIUPC_TABLES_H 28*ea1a228cSschwartz #define _N2PIUPC_TABLES_H 29*ea1a228cSschwartz 30*ea1a228cSschwartz #pragma ident "%Z%%M% %I% %E% SMI" 31*ea1a228cSschwartz 32*ea1a228cSschwartz /* 33*ea1a228cSschwartz * Table definitions for the N2 PIU performance counter driver. 34*ea1a228cSschwartz * 35*ea1a228cSschwartz * Each table consists of one or more groups of counters. 36*ea1a228cSschwartz * 37*ea1a228cSschwartz * A counter group will a name (used by busstat as the kstat "module" name), 38*ea1a228cSschwartz * have its own set of kstats, and a common event select register. A group is 39*ea1a228cSschwartz * represented as an n2piu_grp_t. 40*ea1a228cSschwartz * 41*ea1a228cSschwartz * Each counter is represented by an n2piu_cntr_t. Each has its own register 42*ea1a228cSschwartz * offset (or address), bits for the data it represents, plus an associated 43*ea1a228cSschwartz * register for zeroing it. 44*ea1a228cSschwartz * 45*ea1a228cSschwartz * All registers for n2piu are 64 bit, but a size field can be entered into this 46*ea1a228cSschwartz * structure if registers sizes vary for other implementations (as if this code 47*ea1a228cSschwartz * is leveraged for a future driver). 48*ea1a228cSschwartz * 49*ea1a228cSschwartz * A select register is represented by an n2piu_regsel_t. This defines the 50*ea1a228cSschwartz * offset or address, and an array of fields which define the events for each 51*ea1a228cSschwartz * counter it services. All counters need to have an entry in the fields array 52*ea1a228cSschwartz * even if they don't have any representation in a select register. Please see 53*ea1a228cSschwartz * the explanation of the events array (below) for more information. Counters 54*ea1a228cSschwartz * without representation in a select register can specify their (non-existant) 55*ea1a228cSschwartz * select register field with mask NONPROG_DUMMY_MASK and offset 56*ea1a228cSschwartz * NONPROG_DUMMY_OFF. 57*ea1a228cSschwartz * 58*ea1a228cSschwartz * This implementation supports only one select register per group. If more 59*ea1a228cSschwartz * are needed (e.g. if this implementation is used as a template for another 60*ea1a228cSschwartz * device which has multiple select registers per group) the data structures can 61*ea1a228cSschwartz * easily be changed to support an array of them. Add an array index in the 62*ea1a228cSschwartz * counter structure to associate that counter with a particular select 63*ea1a228cSschwartz * register, and add a field for the number of select registers in the group 64*ea1a228cSschwartz * structure. 65*ea1a228cSschwartz * 66*ea1a228cSschwartz * Each counter has an array of programmable events associated with it, even if 67*ea1a228cSschwartz * it is not programmable. This array is a series of name/value pairs defined 68*ea1a228cSschwartz * by n2piu_event_t. The value is the event value loaded into the select 69*ea1a228cSschwartz * register to select that event for that counter. The last entry in the array 70*ea1a228cSschwartz * is always an entry with a bitmask of LSB-aligned bits of that counter's 71*ea1a228cSschwartz * select register's field's width; it is usually called the CLEAR_PIC entry. 72*ea1a228cSschwartz * CLEAR_PIC entries are not shown to the user. 73*ea1a228cSschwartz * 74*ea1a228cSschwartz * Note that counters without programmable events still need to define a 75*ea1a228cSschwartz * (small) events array with at least CLEAR_PIC and a single event, so that 76*ea1a228cSschwartz * event's name can display in busstat output. The CLEAR_PIC entry of 77*ea1a228cSschwartz * nonprogrammable counters can have a value of NONPROG_DUMMY_MASK. 78*ea1a228cSschwartz */ 79*ea1a228cSschwartz 80*ea1a228cSschwartz #ifdef __cplusplus 81*ea1a228cSschwartz extern "C" { 82*ea1a228cSschwartz #endif 83*ea1a228cSschwartz 84*ea1a228cSschwartz #include <sys/types.h> 85*ea1a228cSschwartz #include <sys/kstat.h> 86*ea1a228cSschwartz #include "n2piupc_acc.h" 87*ea1a228cSschwartz 88*ea1a228cSschwartz /* 89*ea1a228cSschwartz * Description of a counter's events. Each counter will have an array of these, 90*ea1a228cSschwartz * to define the events it can be programmed to report. Nonprogrammable 91*ea1a228cSschwartz * counters still need an array of these, to contain the name busstat will 92*ea1a228cSschwartz * display for it, and a CLEAR_PIC entry. 93*ea1a228cSschwartz */ 94*ea1a228cSschwartz typedef struct n2piu_event { 95*ea1a228cSschwartz char *name; 96*ea1a228cSschwartz uint64_t value; 97*ea1a228cSschwartz } n2piu_event_t; 98*ea1a228cSschwartz 99*ea1a228cSschwartz /* 100*ea1a228cSschwartz * Description of a counter's event selection. There will be one entry for 101*ea1a228cSschwartz * each counter in the group. 102*ea1a228cSschwartz */ 103*ea1a228cSschwartz typedef struct n2piu_regsel_fld { 104*ea1a228cSschwartz n2piu_event_t *events_p; 105*ea1a228cSschwartz int num_events; /* Size of events array. */ 106*ea1a228cSschwartz uint64_t event_mask; /* Width of the event field. */ 107*ea1a228cSschwartz int event_offset; /* Offset of the event field. */ 108*ea1a228cSschwartz } n2piu_regsel_fld_t; 109*ea1a228cSschwartz 110*ea1a228cSschwartz #define NUM_EVTS(x) (sizeof (x) / sizeof (n2piu_event_t)) 111*ea1a228cSschwartz 112*ea1a228cSschwartz /* 113*ea1a228cSschwartz * Description of a group's select register. 114*ea1a228cSschwartz */ 115*ea1a228cSschwartz typedef struct n2piu_regsel { 116*ea1a228cSschwartz off_t regoff; /* Register offset or address. */ 117*ea1a228cSschwartz n2piu_regsel_fld_t *fields_p; /* select reg subfield descriptions. */ 118*ea1a228cSschwartz int num_fields; /* Size of the fields array. */ 119*ea1a228cSschwartz } n2piu_regsel_t; 120*ea1a228cSschwartz 121*ea1a228cSschwartz #define NUM_FLDS(x) (sizeof (x) / sizeof (n2piu_regsel_fld_t)) 122*ea1a228cSschwartz 123*ea1a228cSschwartz /* 124*ea1a228cSschwartz * Counter description, including its access logistics and how to zero it. 125*ea1a228cSschwartz */ 126*ea1a228cSschwartz typedef struct n2piu_cntr { 127*ea1a228cSschwartz off_t regoff; /* Register offset or address. */ 128*ea1a228cSschwartz uint64_t fld_mask; /* Width of the active part of the register */ 129*ea1a228cSschwartz off_t zero_regoff; /* Offset of register used to zero counter. */ 130*ea1a228cSschwartz uint64_t zero_value; /* Value to write to zero_regoff, to clr cntr */ 131*ea1a228cSschwartz } n2piu_cntr_t; 132*ea1a228cSschwartz 133*ea1a228cSschwartz #define FULL64BIT -1ULL /* Can use this for fld_mask. */ 134*ea1a228cSschwartz 135*ea1a228cSschwartz /* 136*ea1a228cSschwartz * Group description. 137*ea1a228cSschwartz */ 138*ea1a228cSschwartz typedef struct n2piu_grp { 139*ea1a228cSschwartz char *grp_name; /* Name, shows up as busstat "module" name. */ 140*ea1a228cSschwartz n2piu_regsel_t *regsel_p; /* Select register. */ 141*ea1a228cSschwartz n2piu_cntr_t *counters_p; /* Counter definitions. */ 142*ea1a228cSschwartz int num_counters; /* Size of the counters array. */ 143*ea1a228cSschwartz kstat_t **name_kstats_pp; /* Named kstats. One for all instances. */ 144*ea1a228cSschwartz } n2piu_grp_t; 145*ea1a228cSschwartz 146*ea1a228cSschwartz #define NUM_CTRS(x) (sizeof (x) / sizeof (n2piu_cntr_t)) 147*ea1a228cSschwartz 148*ea1a228cSschwartz /* N2PIU-specific definitions. */ 149*ea1a228cSschwartz 150*ea1a228cSschwartz /* Where groups are in the leaf_grps array. */ 151*ea1a228cSschwartz 152*ea1a228cSschwartz #define NUM_GRPS 4 153*ea1a228cSschwartz #define IMU_GRP 0 154*ea1a228cSschwartz #define MMU_GRP 1 155*ea1a228cSschwartz #define PEU_GRP 2 156*ea1a228cSschwartz #define BIT_ERR_GRP 3 157*ea1a228cSschwartz 158*ea1a228cSschwartz /* The table itself. */ 159*ea1a228cSschwartz extern n2piu_grp_t *leaf_grps[]; 160*ea1a228cSschwartz 161*ea1a228cSschwartz /* Standin symbol for when there is no register. */ 162*ea1a228cSschwartz #define NO_REGISTER (off_t)-1ULL 163*ea1a228cSschwartz 164*ea1a228cSschwartz /* 165*ea1a228cSschwartz * Default event values used in n2piu_event_t structures for non-programmable 166*ea1a228cSschwartz * registers. 167*ea1a228cSschwartz */ 168*ea1a228cSschwartz #define NONPROG_DUMMY_MASK 0 169*ea1a228cSschwartz #define NONPROG_DUMMY_OFF 0 170*ea1a228cSschwartz 171*ea1a228cSschwartz /* 172*ea1a228cSschwartz * Event bitmask definitions for all groups. 173*ea1a228cSschwartz */ 174*ea1a228cSschwartz #define IMU_CTR_EVT_MASK 0xffull 175*ea1a228cSschwartz #define IMU_CTR_0_EVT_OFF 0 176*ea1a228cSschwartz #define IMU_CTR_1_EVT_OFF 8 177*ea1a228cSschwartz 178*ea1a228cSschwartz #define MMU_CTR_EVT_MASK 0xffull 179*ea1a228cSschwartz #define MMU_CTR_0_EVT_OFF 0 180*ea1a228cSschwartz #define MMU_CTR_1_EVT_OFF 8 181*ea1a228cSschwartz 182*ea1a228cSschwartz #define PEU_CTR_01_EVT_MASK 0xffull 183*ea1a228cSschwartz #define PEU_CTR_2_EVT_MASK 0x3ull 184*ea1a228cSschwartz #define PEU_CTR_0_EVT_OFF 0 185*ea1a228cSschwartz #define PEU_CTR_1_EVT_OFF 8 186*ea1a228cSschwartz #define PEU_CTR_2_EVT_OFF 16 187*ea1a228cSschwartz 188*ea1a228cSschwartz #define BTERR_CTR_0_EVT_MASK 0x1ull 189*ea1a228cSschwartz #define BTERR_CTR_0_EVT_OFF 0 190*ea1a228cSschwartz 191*ea1a228cSschwartz /* 192*ea1a228cSschwartz * Fake the biterr event register to be one with two fields, to store the 193*ea1a228cSschwartz * overall enable/disable event (looks like pic0 reset) and the bterr3 events. 194*ea1a228cSschwartz */ 195*ea1a228cSschwartz 196*ea1a228cSschwartz #define BTERR_CTR_3_EVT_MASK 0xfull 197*ea1a228cSschwartz #define BTERR_CTR_3_EVT_OFF 0 198*ea1a228cSschwartz 199*ea1a228cSschwartz /* 200*ea1a228cSschwartz * Note: this "event" is really an enable, and it serves all 4 PICs. 201*ea1a228cSschwartz * 202*ea1a228cSschwartz * PICs 0,1,2 are from the first counter, PIC3 is from the second counter. 203*ea1a228cSschwartz */ 204*ea1a228cSschwartz #define BTERR_CTR_ENABLE_MASK 0x1ull 205*ea1a228cSschwartz #define BTERR_CTR_ENABLE_OFF 63 206*ea1a228cSschwartz 207*ea1a228cSschwartz #define BTERR_CTR_ENABLE (BTERR_CTR_ENABLE_MASK << BTERR_CTR_ENABLE_OFF) 208*ea1a228cSschwartz 209*ea1a228cSschwartz /* 210*ea1a228cSschwartz * This register also has a bit to zero the counters. 211*ea1a228cSschwartz */ 212*ea1a228cSschwartz #define BTERR_CTR_CLR_MASK 0x1ull 213*ea1a228cSschwartz #define BTERR_CTR_CLR_OFF 62 214*ea1a228cSschwartz 215*ea1a228cSschwartz #define BTERR_CTR_CLR (BTERR_CTR_CLR_MASK << BTERR_CTR_CLR_OFF) 216*ea1a228cSschwartz 217*ea1a228cSschwartz #define BTERR_CTR_ENABLE_AND_CLR (BTERR_CTR_ENABLE | BTERR_CTR_CLR) 218*ea1a228cSschwartz 219*ea1a228cSschwartz /* 220*ea1a228cSschwartz * Definitions of the different types of events. 221*ea1a228cSschwartz * 222*ea1a228cSschwartz * The first part says which registers these events are for. 223*ea1a228cSschwartz * For example, IMU01 means the IMU performance counters 0 and 1 224*ea1a228cSschwartz */ 225*ea1a228cSschwartz 226*ea1a228cSschwartz /* String sought by busstat to locate the event field width "event" entry. */ 227*ea1a228cSschwartz #define COMMON_S_CLEAR_PIC "clear_pic" 228*ea1a228cSschwartz 229*ea1a228cSschwartz 230*ea1a228cSschwartz #define IMU01_S_EVT_NONE "event_none" 231*ea1a228cSschwartz #define IMU01_S_EVT_CLK "clock_cyc" 232*ea1a228cSschwartz #define IMU01_S_EVT_TOTAL_MONDO "total_mondo" 233*ea1a228cSschwartz #define IMU01_S_EVT_TOTAL_MSI "total_msi" 234*ea1a228cSschwartz #define IMU01_S_EVT_NAK_MONDO "mondo_nak" 235*ea1a228cSschwartz #define IMU01_S_EVT_EQ_WR "eq_write" 236*ea1a228cSschwartz #define IMU01_S_EVT_EQ_MONDO "eq_mondo" 237*ea1a228cSschwartz 238*ea1a228cSschwartz #define IMU01_EVT_NONE 0 239*ea1a228cSschwartz #define IMU01_EVT_CLK 1 240*ea1a228cSschwartz #define IMU01_EVT_TOTAL_MONDO 2 241*ea1a228cSschwartz #define IMU01_EVT_TOTAL_MSI 3 242*ea1a228cSschwartz #define IMU01_EVT_NAK_MONDO 4 243*ea1a228cSschwartz #define IMU01_EVT_EQ_WR 5 244*ea1a228cSschwartz #define IMU01_EVT_EQ_MONDO 6 245*ea1a228cSschwartz 246*ea1a228cSschwartz 247*ea1a228cSschwartz #define MMU01_S_EVT_NONE "event_none" 248*ea1a228cSschwartz #define MMU01_S_EVT_CLK "clock_cyc" 249*ea1a228cSschwartz #define MMU01_S_EVT_TRANS "total_transl" 250*ea1a228cSschwartz #define MMU01_S_EVT_STALL "total_stall_cyc" 251*ea1a228cSschwartz #define MMU01_S_EVT_TRANS_MISS "total_transl_miss" 252*ea1a228cSschwartz #define MMU01_S_EVT_TBLWLK_STALL "tblwlk_stall_cyc" 253*ea1a228cSschwartz #define MMU01_S_EVT_BYPASS_TRANSL "bypass_transl" 254*ea1a228cSschwartz #define MMU01_S_EVT_TRANSL_TRANSL "transl_transl" 255*ea1a228cSschwartz #define MMU01_S_EVT_FLOW_CNTL_STALL "flow_stall_cyc" 256*ea1a228cSschwartz #define MMU01_S_EVT_FLUSH_CACHE_ENT "cache_entr_flush" 257*ea1a228cSschwartz 258*ea1a228cSschwartz #define MMU01_EVT_NONE 0 259*ea1a228cSschwartz #define MMU01_EVT_CLK 1 260*ea1a228cSschwartz #define MMU01_EVT_TRANS 2 261*ea1a228cSschwartz #define MMU01_EVT_STALL 3 262*ea1a228cSschwartz #define MMU01_EVT_TRANS_MISS 4 263*ea1a228cSschwartz #define MMU01_EVT_TBLWLK_STALL 5 264*ea1a228cSschwartz #define MMU01_EVT_BYPASS_TRANSL 6 265*ea1a228cSschwartz #define MMU01_EVT_TRANSL_TRANSL 7 266*ea1a228cSschwartz #define MMU01_EVT_FLOW_CNTL_STALL 8 267*ea1a228cSschwartz #define MMU01_EVT_FLUSH_CACHE_ENT 9 268*ea1a228cSschwartz 269*ea1a228cSschwartz 270*ea1a228cSschwartz #define PEU2_S_EVT_NONE "event_none" 271*ea1a228cSschwartz #define PEU2_S_EVT_NONPST_CMPL_TIME "npost_compl_time" 272*ea1a228cSschwartz #define PEU2_S_EVT_XMIT_DATA "xmit_data" 273*ea1a228cSschwartz #define PEU2_S_EVT_RCVD_DATA "rcvd_data" 274*ea1a228cSschwartz 275*ea1a228cSschwartz #define PEU2_EVT_NONE 0 276*ea1a228cSschwartz #define PEU2_EVT_NONPST_CMPL_TIME 1 277*ea1a228cSschwartz #define PEU2_EVT_XMIT_DATA 2 278*ea1a228cSschwartz #define PEU2_EVT_RCVD_DATA 3 279*ea1a228cSschwartz 280*ea1a228cSschwartz 281*ea1a228cSschwartz #define PEU01_S_EVT_NONE "event_none" 282*ea1a228cSschwartz #define PEU01_S_EVT_CLK "clock_cyc" 283*ea1a228cSschwartz #define PEU01_S_EVT_COMPL "compl_recvd" 284*ea1a228cSschwartz #define PEU01_S_EVT_XMT_POST_CR_UNAV "post_cr_unav_cyc" 285*ea1a228cSschwartz #define PEU01_S_EVT_XMT_NPOST_CR_UNAV "npost_cr_unav_cyc" 286*ea1a228cSschwartz #define PEU01_S_EVT_XMT_CMPL_CR_UNAV "compl_cr_unav_cyc" 287*ea1a228cSschwartz #define PEU01_S_EVT_XMT_ANY_CR_UNAV "trans_cr_any_unav" 288*ea1a228cSschwartz #define PEU01_S_EVT_RETRY_CR_UNAV "retry_cr_unav" 289*ea1a228cSschwartz #define PEU01_S_EVT_MEMRD_PKT_RCVD "recvd_mem_rd_pkt" 290*ea1a228cSschwartz #define PEU01_S_EVT_MEMWR_PKT_RCVD "recvd_mem_wr_pkt" 291*ea1a228cSschwartz #define PEU01_S_EVT_RCV_CR_THRESH "recv_cr_thresh" 292*ea1a228cSschwartz #define PEU01_S_EVT_RCV_PST_HDR_CR_EXH "recv_hdr_cr_exh_cyc" 293*ea1a228cSschwartz #define PEU01_S_EVT_RCV_PST_DA_CR_MPS "recv_post_da_cr_mps" 294*ea1a228cSschwartz #define PEU01_S_EVT_RCV_NPST_HDR_CR_EXH "recv_npost_hdr_cr_exh" 295*ea1a228cSschwartz #define PEU01_S_EVT_RCVR_L0S "recvr_l0s_cyc" 296*ea1a228cSschwartz #define PEU01_S_EVT_RCVR_L0S_TRANS "recvr_l0s_trans" 297*ea1a228cSschwartz #define PEU01_S_EVT_XMTR_L0S "trans_l0s_cyc" 298*ea1a228cSschwartz #define PEU01_S_EVT_XMTR_L0S_TRANS "trans_l0s_trans" 299*ea1a228cSschwartz #define PEU01_S_EVT_RCVR_ERR "recvr_err" 300*ea1a228cSschwartz #define PEU01_S_EVT_BAD_TLP "bad_tlp" 301*ea1a228cSschwartz #define PEU01_S_EVT_BAD_DLLP "bad_dllp" 302*ea1a228cSschwartz #define PEU01_S_EVT_REPLAY_ROLLOVER "replay_rollover" 303*ea1a228cSschwartz #define PEU01_S_EVT_REPLAY_TMO "replay_to" 304*ea1a228cSschwartz 305*ea1a228cSschwartz #define PEU01_EVT_NONE 0x0 306*ea1a228cSschwartz #define PEU01_EVT_CLK 0x1 307*ea1a228cSschwartz #define PEU01_EVT_COMPL 0x2 308*ea1a228cSschwartz #define PEU01_EVT_XMT_POST_CR_UNAV 0x10 309*ea1a228cSschwartz #define PEU01_EVT_XMT_NPOST_CR_UNAV 0x11 310*ea1a228cSschwartz #define PEU01_EVT_XMT_CMPL_CR_UNAV 0x12 311*ea1a228cSschwartz #define PEU01_EVT_XMT_ANY_CR_UNAV 0x13 312*ea1a228cSschwartz #define PEU01_EVT_RETRY_CR_UNAV 0x14 313*ea1a228cSschwartz #define PEU01_EVT_MEMRD_PKT_RCVD 0x20 314*ea1a228cSschwartz #define PEU01_EVT_MEMWR_PKT_RCVD 0x21 315*ea1a228cSschwartz #define PEU01_EVT_RCV_CR_THRESH 0x22 316*ea1a228cSschwartz #define PEU01_EVT_RCV_PST_HDR_CR_EXH 0x23 317*ea1a228cSschwartz #define PEU01_EVT_RCV_PST_DA_CR_MPS 0x24 318*ea1a228cSschwartz #define PEU01_EVT_RCV_NPST_HDR_CR_EXH 0x25 319*ea1a228cSschwartz #define PEU01_EVT_RCVR_L0S 0x30 320*ea1a228cSschwartz #define PEU01_EVT_RCVR_L0S_TRANS 0x31 321*ea1a228cSschwartz #define PEU01_EVT_XMTR_L0S 0x32 322*ea1a228cSschwartz #define PEU01_EVT_XMTR_L0S_TRANS 0x33 323*ea1a228cSschwartz #define PEU01_EVT_RCVR_ERR 0x40 324*ea1a228cSschwartz #define PEU01_EVT_BAD_TLP 0x42 325*ea1a228cSschwartz #define PEU01_EVT_BAD_DLLP 0x43 326*ea1a228cSschwartz #define PEU01_EVT_REPLAY_ROLLOVER 0x44 327*ea1a228cSschwartz #define PEU01_EVT_REPLAY_TMO 0x47 328*ea1a228cSschwartz 329*ea1a228cSschwartz /* 330*ea1a228cSschwartz * BTERR counter 3 is presented by the device as one register with 8 different 331*ea1a228cSschwartz * counters. Since busstat displays in decimal and not in hex, display of the 332*ea1a228cSschwartz * raw data is impractical except to make a non-zero test. Fake that this 333*ea1a228cSschwartz * register has multiple modes, so that each lane can be shown separately. 334*ea1a228cSschwartz * Then one can use Busstat capabilities to display alternating events of a 335*ea1a228cSschwartz * register. 336*ea1a228cSschwartz */ 337*ea1a228cSschwartz 338*ea1a228cSschwartz #define BTERR3_S_EVT_NONE "event_none" 339*ea1a228cSschwartz #define BTERR3_S_EVT_ENC_ALL "encd_err_ln_all" 340*ea1a228cSschwartz #define BTERR3_S_EVT_ENC_LANE_0 "encd_err_ln_0" 341*ea1a228cSschwartz #define BTERR3_S_EVT_ENC_LANE_1 "encd_err_ln_1" 342*ea1a228cSschwartz #define BTERR3_S_EVT_ENC_LANE_2 "encd_err_ln_2" 343*ea1a228cSschwartz #define BTERR3_S_EVT_ENC_LANE_3 "encd_err_ln_3" 344*ea1a228cSschwartz #define BTERR3_S_EVT_ENC_LANE_4 "encd_err_ln_4" 345*ea1a228cSschwartz #define BTERR3_S_EVT_ENC_LANE_5 "encd_err_ln_5" 346*ea1a228cSschwartz #define BTERR3_S_EVT_ENC_LANE_6 "encd_err_ln_6" 347*ea1a228cSschwartz #define BTERR3_S_EVT_ENC_LANE_7 "encd_err_ln_7" 348*ea1a228cSschwartz 349*ea1a228cSschwartz #define BTERR3_EVT_ENC_NONE 0 350*ea1a228cSschwartz #define BTERR3_EVT_ENC_ALL 1 351*ea1a228cSschwartz #define BTERR3_EVT_ENC_LANE_0 2 352*ea1a228cSschwartz #define BTERR3_EVT_ENC_LANE_1 3 353*ea1a228cSschwartz #define BTERR3_EVT_ENC_LANE_2 4 354*ea1a228cSschwartz #define BTERR3_EVT_ENC_LANE_3 5 355*ea1a228cSschwartz #define BTERR3_EVT_ENC_LANE_4 6 356*ea1a228cSschwartz #define BTERR3_EVT_ENC_LANE_5 7 357*ea1a228cSschwartz #define BTERR3_EVT_ENC_LANE_6 8 358*ea1a228cSschwartz #define BTERR3_EVT_ENC_LANE_7 9 359*ea1a228cSschwartz 360*ea1a228cSschwartz /* 361*ea1a228cSschwartz * For non-programmable registers, include an n2piu_event_t which has two 362*ea1a228cSschwartz * fields, a default field (which gives the field a name even though it 363*ea1a228cSschwartz * can't be programmed, and clear_pic which busstat needs. 364*ea1a228cSschwartz */ 365*ea1a228cSschwartz #define BTERR2_S_EVT_PRE "phys_rcvr_errs" 366*ea1a228cSschwartz 367*ea1a228cSschwartz #define BTERR2_EVT_PRE 0 368*ea1a228cSschwartz 369*ea1a228cSschwartz #define BTERR1_S_EVT_BTLP "bad_tlps" 370*ea1a228cSschwartz 371*ea1a228cSschwartz #define BTERR1_EVT_BTLP 0 372*ea1a228cSschwartz 373*ea1a228cSschwartz /* 374*ea1a228cSschwartz * Note: All 4 biterr counter fields (split among two counter registers) are 375*ea1a228cSschwartz * tied together with a single enable. Treat the first field as programmable 376*ea1a228cSschwartz * to provide a way to reset the counter set. 377*ea1a228cSschwartz */ 378*ea1a228cSschwartz #define BTERR0_S_EVT_RESET "reset_bterr" /* All biterr counter zero */ 379*ea1a228cSschwartz #define BTERR0_S_EVT_BDLLP "bad_dllps" 380*ea1a228cSschwartz 381*ea1a228cSschwartz #define BTERR0_EVT_RESET 0 382*ea1a228cSschwartz #define BTERR0_EVT_BDLLP 1 383*ea1a228cSschwartz 384*ea1a228cSschwartz /* 385*ea1a228cSschwartz * First bit error counter register has three counters. Here are the 386*ea1a228cSschwartz * placements of these counters within the (virtual) registers. 387*ea1a228cSschwartz */ 388*ea1a228cSschwartz #define BE1_BAD_DLLP_MASK 0xff000000ULL 389*ea1a228cSschwartz #define BE1_BAD_TLP_MASK 0xff0000ULL 390*ea1a228cSschwartz #define BE1_BAD_PRE_MASK 0x3ffULL 391*ea1a228cSschwartz #define BE2_8_10_MASK FULL64BIT 392*ea1a228cSschwartz 393*ea1a228cSschwartz #ifdef __cplusplus 394*ea1a228cSschwartz } 395*ea1a228cSschwartz #endif 396*ea1a228cSschwartz 397*ea1a228cSschwartz #endif /* _N2PIUPC_TABLES_H */ 398