1*0Sstevel@tonic-gate /* 2*0Sstevel@tonic-gate * CDDL HEADER START 3*0Sstevel@tonic-gate * 4*0Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*0Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 6*0Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 7*0Sstevel@tonic-gate * with the License. 8*0Sstevel@tonic-gate * 9*0Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10*0Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 11*0Sstevel@tonic-gate * See the License for the specific language governing permissions 12*0Sstevel@tonic-gate * and limitations under the License. 13*0Sstevel@tonic-gate * 14*0Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 15*0Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16*0Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 17*0Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 18*0Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 19*0Sstevel@tonic-gate * 20*0Sstevel@tonic-gate * CDDL HEADER END 21*0Sstevel@tonic-gate */ 22*0Sstevel@tonic-gate /* 23*0Sstevel@tonic-gate * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 24*0Sstevel@tonic-gate * Use is subject to license terms. 25*0Sstevel@tonic-gate */ 26*0Sstevel@tonic-gate 27*0Sstevel@tonic-gate #ifndef _SYS_SPITREGS_H 28*0Sstevel@tonic-gate #define _SYS_SPITREGS_H 29*0Sstevel@tonic-gate 30*0Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 31*0Sstevel@tonic-gate 32*0Sstevel@tonic-gate #ifdef __cplusplus 33*0Sstevel@tonic-gate extern "C" { 34*0Sstevel@tonic-gate #endif 35*0Sstevel@tonic-gate 36*0Sstevel@tonic-gate /* 37*0Sstevel@tonic-gate * This file is cpu dependent. 38*0Sstevel@tonic-gate */ 39*0Sstevel@tonic-gate 40*0Sstevel@tonic-gate #ifdef _STARFIRE 41*0Sstevel@tonic-gate /* 42*0Sstevel@tonic-gate * Starfire's cpu upaids are not the same 43*0Sstevel@tonic-gate * as cpuids. 44*0Sstevel@tonic-gate * XXX - our obp took the liberty of 45*0Sstevel@tonic-gate * converting cpu upaids into cpuids when 46*0Sstevel@tonic-gate * presenting it as upa-portid property. 47*0Sstevel@tonic-gate */ 48*0Sstevel@tonic-gate #define CPUID_TO_UPAID(upaid) (((upaid & 0x3C) << 1) | \ 49*0Sstevel@tonic-gate ((upaid & 0x40) >> 4) | \ 50*0Sstevel@tonic-gate (upaid &0x3)) 51*0Sstevel@tonic-gate #else 52*0Sstevel@tonic-gate /* 53*0Sstevel@tonic-gate * The mid is the same as the cpu id. 54*0Sstevel@tonic-gate * We might want to change this later 55*0Sstevel@tonic-gate */ 56*0Sstevel@tonic-gate #define CPUID_TO_UPAID(cpuid) (cpuid) 57*0Sstevel@tonic-gate #endif /* _STARFIRE */ 58*0Sstevel@tonic-gate 59*0Sstevel@tonic-gate /* 60*0Sstevel@tonic-gate * LSU Control Register 61*0Sstevel@tonic-gate * 62*0Sstevel@tonic-gate * +------+----+----+----+----+----+----+-----+------+----+----+----+---+ 63*0Sstevel@tonic-gate * | Resv | PM | VM | PR | PW | VR | VW | Rsv | FM | DM | IM | DC | IC| 64*0Sstevel@tonic-gate * +------+----+----+----+----+----+----+-----+------+----+----+----+---+ 65*0Sstevel@tonic-gate * 63 41 33 25 24 23 22 21 20 19 4 3 2 1 0 66*0Sstevel@tonic-gate * 67*0Sstevel@tonic-gate */ 68*0Sstevel@tonic-gate 69*0Sstevel@tonic-gate #define LSU_IC 0x00000000001 /* icache enable */ 70*0Sstevel@tonic-gate #define LSU_DC 0x00000000002 /* dcache enable */ 71*0Sstevel@tonic-gate #define LSU_IM 0x00000000004 /* immu enable */ 72*0Sstevel@tonic-gate #define LSU_DM 0x00000000008 /* dmmu enable */ 73*0Sstevel@tonic-gate #define LSU_FM 0x000000FFFF0 /* parity mask */ 74*0Sstevel@tonic-gate #define LSU_VW 0x00000200000 /* virtual watchpoint write enable */ 75*0Sstevel@tonic-gate #define LSU_VR 0x00000400000 /* virtual watchpoint read enable */ 76*0Sstevel@tonic-gate #define LSU_PW 0x00000800000 /* physical watchpoint write enable */ 77*0Sstevel@tonic-gate #define LSU_PR 0x00001000000 /* physical watchpoint read enable */ 78*0Sstevel@tonic-gate #define LSU_VM 0x001fe000000 /* virtual watchpoint byte mask */ 79*0Sstevel@tonic-gate #define LSU_PM 0x1fe00000000 /* physical watch point byte mask */ 80*0Sstevel@tonic-gate 81*0Sstevel@tonic-gate #define LSU_VM_SHIFT 25 82*0Sstevel@tonic-gate #define LSU_PM_SHIFT 33 83*0Sstevel@tonic-gate 84*0Sstevel@tonic-gate /* 85*0Sstevel@tonic-gate * Defines for the different types of dcache_flush 86*0Sstevel@tonic-gate * it is stored in dflush_type 87*0Sstevel@tonic-gate */ 88*0Sstevel@tonic-gate #define FLUSHALL_TYPE 0x0 /* blasts all cache lines */ 89*0Sstevel@tonic-gate #define FLUSHMATCH_TYPE 0x1 /* flush entire cache but check each */ 90*0Sstevel@tonic-gate /* each line for a match */ 91*0Sstevel@tonic-gate #define FLUSHPAGE_TYPE 0x2 /* flush only one page and check */ 92*0Sstevel@tonic-gate /* each line for a match */ 93*0Sstevel@tonic-gate 94*0Sstevel@tonic-gate /* 95*0Sstevel@tonic-gate * D-Cache Tag Data Register 96*0Sstevel@tonic-gate * 97*0Sstevel@tonic-gate * +----------+--------+----------+ 98*0Sstevel@tonic-gate * | Reserved | DC_Tag | DC_Valid | 99*0Sstevel@tonic-gate * +----------+--------+----------+ 100*0Sstevel@tonic-gate * 63 30 29 2 1 0 101*0Sstevel@tonic-gate * 102*0Sstevel@tonic-gate */ 103*0Sstevel@tonic-gate #define ICACHE_FLUSHSZ 0x20 /* one line in i$ */ 104*0Sstevel@tonic-gate #define DC_PTAG_SHIFT 34 105*0Sstevel@tonic-gate #define DC_LINE_SHIFT 30 106*0Sstevel@tonic-gate #define SF_DC_VBIT_SHIFT 2 107*0Sstevel@tonic-gate #define SF_DC_VBIT_MASK 0x3 108*0Sstevel@tonic-gate #define IC_LINE_SHIFT 3 109*0Sstevel@tonic-gate #define IC_LINE 512 110*0Sstevel@tonic-gate #define INDEX_BIT_SHIFT 13 111*0Sstevel@tonic-gate 112*0Sstevel@tonic-gate /* 113*0Sstevel@tonic-gate * Definitions of sun4u cpu implementations as specified in version register 114*0Sstevel@tonic-gate */ 115*0Sstevel@tonic-gate #define SPITFIRE_IMPL 0x10 116*0Sstevel@tonic-gate #define IS_SPITFIRE(impl) ((impl) == SPITFIRE_IMPL) 117*0Sstevel@tonic-gate #define SPITFIRE_MAJOR_VERSION(rev) (((rev) >> 4) & 0xf) 118*0Sstevel@tonic-gate #define SPITFIRE_MINOR_VERSION(rev) ((rev) & 0xf) 119*0Sstevel@tonic-gate 120*0Sstevel@tonic-gate #define BLACKBIRD_IMPL 0x11 121*0Sstevel@tonic-gate #define IS_BLACKBIRD(impl) ((impl) == BLACKBIRD_IMPL) 122*0Sstevel@tonic-gate #define BLACKBIRD_MAJOR_VERSION(rev) (((rev) >> 4) & 0xf) 123*0Sstevel@tonic-gate #define BLACKBIRD_MINOR_VERSION(rev) ((rev) & 0xf) 124*0Sstevel@tonic-gate 125*0Sstevel@tonic-gate #define SABRE_IMPL 0x12 126*0Sstevel@tonic-gate #define HUMMBRD_IMPL 0x13 127*0Sstevel@tonic-gate 128*0Sstevel@tonic-gate /* 129*0Sstevel@tonic-gate * Bits of Spitfire Asynchronous Fault Status Register 130*0Sstevel@tonic-gate */ 131*0Sstevel@tonic-gate #define P_AFSR_STICKY 0x00000001FFF00000ULL /* mask for all sticky bits */ 132*0Sstevel@tonic-gate #define P_AFSR_ERRS 0x000000001EE00000ULL /* mask for remaining errors */ 133*0Sstevel@tonic-gate #define P_AFSR_ME 0x0000000100000000ULL /* errors > 1, same type!=CE */ 134*0Sstevel@tonic-gate #define P_AFSR_PRIV 0x0000000080000000ULL /* priv/supervisor access */ 135*0Sstevel@tonic-gate #define P_AFSR_ISAP 0x0000000040000000ULL /* incoming system addr. parity */ 136*0Sstevel@tonic-gate #define P_AFSR_ETP 0x0000000020000000ULL /* ecache tag parity */ 137*0Sstevel@tonic-gate #define P_AFSR_IVUE 0x0000000010000000ULL /* interrupt vector with UE */ 138*0Sstevel@tonic-gate #define P_AFSR_TO 0x0000000008000000ULL /* bus timeout */ 139*0Sstevel@tonic-gate #define P_AFSR_BERR 0x0000000004000000ULL /* bus error */ 140*0Sstevel@tonic-gate #define P_AFSR_LDP 0x0000000002000000ULL /* data parity error from SDB */ 141*0Sstevel@tonic-gate #define P_AFSR_CP 0x0000000001000000ULL /* copyout parity error */ 142*0Sstevel@tonic-gate #define P_AFSR_WP 0x0000000000800000ULL /* writeback ecache data parity */ 143*0Sstevel@tonic-gate #define P_AFSR_EDP 0x0000000000400000ULL /* ecache data parity */ 144*0Sstevel@tonic-gate #define P_AFSR_UE 0x0000000000200000ULL /* uncorrectable ECC error */ 145*0Sstevel@tonic-gate #define P_AFSR_CE 0x0000000000100000ULL /* correctable ECC error */ 146*0Sstevel@tonic-gate #define P_AFSR_ETS 0x00000000000F0000ULL /* cache tag parity syndrome */ 147*0Sstevel@tonic-gate #define P_AFSR_P_SYND 0x000000000000FFFFULL /* data parity syndrome */ 148*0Sstevel@tonic-gate 149*0Sstevel@tonic-gate /* 150*0Sstevel@tonic-gate * All error types 151*0Sstevel@tonic-gate */ 152*0Sstevel@tonic-gate #define S_AFSR_ALL_ERRS (P_AFSR_STICKY & ~P_AFSR_PRIV) 153*0Sstevel@tonic-gate 154*0Sstevel@tonic-gate /* 155*0Sstevel@tonic-gate * Shifts for Spitfire Asynchronous Fault Status Register 156*0Sstevel@tonic-gate */ 157*0Sstevel@tonic-gate #define P_AFSR_D_SIZE_SHIFT (57) 158*0Sstevel@tonic-gate #define P_AFSR_CP_SHIFT (24) 159*0Sstevel@tonic-gate #define P_AFSR_ETS_SHIFT (16) 160*0Sstevel@tonic-gate 161*0Sstevel@tonic-gate /* 162*0Sstevel@tonic-gate * AFSR error bits for AFT Level 1 messages (uncorrected + parity + BERR + TO) 163*0Sstevel@tonic-gate */ 164*0Sstevel@tonic-gate #define P_AFSR_LEVEL1 (P_AFSR_UE | P_AFSR_EDP | P_AFSR_WP | P_AFSR_CP |\ 165*0Sstevel@tonic-gate P_AFSR_LDP | P_AFSR_BERR | P_AFSR_TO) 166*0Sstevel@tonic-gate 167*0Sstevel@tonic-gate /* 168*0Sstevel@tonic-gate * Bits of Spitfire Asynchronous Fault Status Register 169*0Sstevel@tonic-gate */ 170*0Sstevel@tonic-gate #define S_AFSR_MASK 0x00000001FFFFFFFFULL /* <33:0>: valid AFSR bits */ 171*0Sstevel@tonic-gate 172*0Sstevel@tonic-gate /* 173*0Sstevel@tonic-gate * Bits of Spitfire Asynchronous Fault Address Register 174*0Sstevel@tonic-gate * The Sabre AFAR includes more bits since it only has a UDBH, no UDBL 175*0Sstevel@tonic-gate */ 176*0Sstevel@tonic-gate #define S_AFAR_PA 0x000001FFFFFFFFF0ULL /* PA<40:4>: physical address */ 177*0Sstevel@tonic-gate #define SABRE_AFAR_PA 0x000001FFFFFFFFF8ULL /* PA<40:3>: physical address */ 178*0Sstevel@tonic-gate 179*0Sstevel@tonic-gate /* 180*0Sstevel@tonic-gate * Bits of Spitfire/Sabre/Hummingbird Error Enable Registers 181*0Sstevel@tonic-gate */ 182*0Sstevel@tonic-gate #define EER_EPEN 0x00000000000000010ULL /* enable ETP, EDP, WP, CP */ 183*0Sstevel@tonic-gate #define EER_UEEN 0x00000000000000008ULL /* enable UE */ 184*0Sstevel@tonic-gate #define EER_ISAPEN 0x00000000000000004ULL /* enable ISAP */ 185*0Sstevel@tonic-gate #define EER_NCEEN 0x00000000000000002ULL /* enable the other errors */ 186*0Sstevel@tonic-gate #define EER_CEEN 0x00000000000000001ULL /* enable CE */ 187*0Sstevel@tonic-gate #define EER_DISABLE 0x00000000000000000ULL /* no errors enabled */ 188*0Sstevel@tonic-gate #define EER_ECC_DISABLE (EER_EPEN|EER_UEEN|EER_ISAPEN) 189*0Sstevel@tonic-gate #define EER_CE_DISABLE (EER_EPEN|EER_UEEN|EER_ISAPEN|EER_NCEEN) 190*0Sstevel@tonic-gate #define EER_ENABLE (EER_EPEN|EER_UEEN|EER_ISAPEN|EER_NCEEN|EER_CEEN) 191*0Sstevel@tonic-gate 192*0Sstevel@tonic-gate /* 193*0Sstevel@tonic-gate * Bits and vaddrs of Spitfire Datapath Error Registers 194*0Sstevel@tonic-gate */ 195*0Sstevel@tonic-gate #define P_DER_UE 0x00000000000000200ULL /* UE has occurred */ 196*0Sstevel@tonic-gate #define P_DER_CE 0x00000000000000100ULL /* CE has occurred */ 197*0Sstevel@tonic-gate #define P_DER_E_SYND 0x000000000000000FFULL /* SYND<7:0>: ECC syndrome */ 198*0Sstevel@tonic-gate #define P_DER_H 0x0 /* datapath error reg upper */ 199*0Sstevel@tonic-gate #define P_DER_L 0x18 /* datapath error reg upper */ 200*0Sstevel@tonic-gate 201*0Sstevel@tonic-gate /* 202*0Sstevel@tonic-gate * Bits of Spitfire Datapath Control Register 203*0Sstevel@tonic-gate */ 204*0Sstevel@tonic-gate #define P_DCR_VER 0x000001E00 /* datapath version */ 205*0Sstevel@tonic-gate #define P_DCR_F_MODE 0x000000100 /* send FCB<7:0> */ 206*0Sstevel@tonic-gate #define P_DCR_FCB 0x0000000FF /* ECC check bits to force */ 207*0Sstevel@tonic-gate #define P_DCR_H 0x20 /* datapath control reg upper */ 208*0Sstevel@tonic-gate #define P_DCR_L 0x38 /* datapath control reg lower */ 209*0Sstevel@tonic-gate 210*0Sstevel@tonic-gate /* 211*0Sstevel@tonic-gate * Bits and shifts for the Spitfire (S), Sabre (SB) and Hummingbird (HB) 212*0Sstevel@tonic-gate * Ecache tag data 213*0Sstevel@tonic-gate */ 214*0Sstevel@tonic-gate #define S_ECTAG_MASK 0x000000000003FFFFFULL /* spitfire ecache tag mask */ 215*0Sstevel@tonic-gate #define SB_ECTAG_MASK 0x00000000000000FFFULL /* sabre ecache tag mask */ 216*0Sstevel@tonic-gate #define HB_ECTAG_MASK 0x0000000000000FFFFULL /* hbird ecache tag mask */ 217*0Sstevel@tonic-gate #define S_ECSTATE_MASK 0x00000000001C00000ULL /* spitfire tag state mask */ 218*0Sstevel@tonic-gate #define SB_ECSTATE_MASK 0x0000000000000C000ULL /* sabre tag state mask */ 219*0Sstevel@tonic-gate #define HB_ECSTATE_MASK 0x00000000000030000ULL /* hbird tag state mask */ 220*0Sstevel@tonic-gate #define S_ECPAR_MASK 0x0000000001E000000ULL /* spitfire tag parity mask */ 221*0Sstevel@tonic-gate #define SB_ECPAR_MASK 0x00000000000030000ULL /* sabre tag parity mask */ 222*0Sstevel@tonic-gate #define HB_ECPAR_MASK 0x00000000000300000ULL /* hbird tag parity mask */ 223*0Sstevel@tonic-gate #define S_ECTAG_SHIFT 19 /* spitfire ecache tag shift */ 224*0Sstevel@tonic-gate #define SB_ECTAG_SHIFT 18 /* sabre ecache tag shift */ 225*0Sstevel@tonic-gate #define HB_ECTAG_SHIFT 16 /* hbird ecache tag shift */ 226*0Sstevel@tonic-gate #define S_ECSTATE_SHIFT 22 /* spitfire tag state shift */ 227*0Sstevel@tonic-gate #define SB_ECSTATE_SHIFT 14 /* sabre tag state shift */ 228*0Sstevel@tonic-gate #define HB_ECSTATE_SHIFT 16 /* hbird tag state shift */ 229*0Sstevel@tonic-gate #define S_ECPAR_SHIFT 25 /* spitfire tag parity shift */ 230*0Sstevel@tonic-gate #define SB_ECPAR_SHIFT 16 /* sabre tag parity shift */ 231*0Sstevel@tonic-gate #define HB_ECPAR_SHIFT 20 /* hbird tag parity shift */ 232*0Sstevel@tonic-gate #define S_ECACHE_MAX_LSIZE 64 /* E$ line size */ 233*0Sstevel@tonic-gate 234*0Sstevel@tonic-gate /* 235*0Sstevel@tonic-gate * Constants representing the complete Spitfire (S), Sabre (SB) and Hummingbird 236*0Sstevel@tonic-gate * (HB) tag state: 237*0Sstevel@tonic-gate */ 238*0Sstevel@tonic-gate #define S_ECSTATE_SHR 0x1 /* shared */ 239*0Sstevel@tonic-gate #define S_ECSTATE_EXL 0x3 /* exclusive */ 240*0Sstevel@tonic-gate #define S_ECSTATE_OWN 0x5 /* owner */ 241*0Sstevel@tonic-gate #define S_ECSTATE_MOD 0x7 /* modified */ 242*0Sstevel@tonic-gate #define SB_ECSTATE_EXL 0x2 /* exclusive */ 243*0Sstevel@tonic-gate #define SB_ECSTATE_MOD 0x3 /* modified */ 244*0Sstevel@tonic-gate #define HB_ECSTATE_EXL 0x2 /* exclusive */ 245*0Sstevel@tonic-gate #define HB_ECSTATE_MOD 0x3 /* modified */ 246*0Sstevel@tonic-gate 247*0Sstevel@tonic-gate /* 248*0Sstevel@tonic-gate * Constants representing the individual Spitfire (S), Sabre (SB) and 249*0Sstevel@tonic-gate * Hummingbird (HB) state bits: 250*0Sstevel@tonic-gate */ 251*0Sstevel@tonic-gate #define S_ECSTATE_VALID 0x1 /* line is valid */ 252*0Sstevel@tonic-gate #define S_ECSTATE_DIRTY 0x4 /* line is dirty */ 253*0Sstevel@tonic-gate #define SB_ECSTATE_VALID 0x2 /* line is valid */ 254*0Sstevel@tonic-gate #define SB_ECSTATE_DIRTY 0x1 /* line is dirty */ 255*0Sstevel@tonic-gate #define HB_ECSTATE_VALID 0x2 /* line is valid */ 256*0Sstevel@tonic-gate #define HB_ECSTATE_DIRTY 0x1 /* line is dirty */ 257*0Sstevel@tonic-gate 258*0Sstevel@tonic-gate /* 259*0Sstevel@tonic-gate * Constants representing the individual Spitfire (S), Sabre (SB) and 260*0Sstevel@tonic-gate * Hummingbird (HB) state parity and address parity bits: 261*0Sstevel@tonic-gate */ 262*0Sstevel@tonic-gate #define S_ECSTATE_PARITY 0x8 /* tag state parity bit */ 263*0Sstevel@tonic-gate #define S_EC_PARITY 0xF /* all parity bits */ 264*0Sstevel@tonic-gate #define SB_ECSTATE_PARITY 0x2 /* tag state parity bit */ 265*0Sstevel@tonic-gate #define SB_EC_PARITY 0x3 /* all parity bits */ 266*0Sstevel@tonic-gate #define HB_ECSTATE_PARITY 0x2 /* tag state parity bit */ 267*0Sstevel@tonic-gate #define HB_EC_PARITY 0x3 /* all parity bits */ 268*0Sstevel@tonic-gate 269*0Sstevel@tonic-gate #ifdef HUMMINGBIRD 270*0Sstevel@tonic-gate 271*0Sstevel@tonic-gate #define HB_ESTAR_MODE INT64_C(0x1FE0000F080) /* estar mode reg */ 272*0Sstevel@tonic-gate #define HB_MEM_CNTRL0 INT64_C(0x1FE0000F010) /* mem control0 reg */ 273*0Sstevel@tonic-gate #define HB_REFRESH_COUNT_MASK 0x7F00 /* mc0<14:8>: ref cnt */ 274*0Sstevel@tonic-gate #define HB_REFRESH_COUNT_SHIFT 8 /* bits to shift */ 275*0Sstevel@tonic-gate #define HB_REFRESH_INTERVAL INT64_C(7800) /* 7800 nsecs memory */ 276*0Sstevel@tonic-gate /* refresh interval */ 277*0Sstevel@tonic-gate /* works for all DIMM */ 278*0Sstevel@tonic-gate /* same value as OBP */ 279*0Sstevel@tonic-gate #define HB_REFRESH_CLOCKS_PER_COUNT INT64_C(64) /* cpu clks per count */ 280*0Sstevel@tonic-gate #define HB_SELF_REFRESH_MASK 0x10000 /* mc0<16>: self ref */ 281*0Sstevel@tonic-gate #define HB_SELF_REFRESH_SHIFT 16 /* bits to shift */ 282*0Sstevel@tonic-gate #define HB_SELF_REFRESH_DISABLE 0 /* disable self ref */ 283*0Sstevel@tonic-gate #define HB_SELF_REFRESH_ENABLE 1 /* enable self ref */ 284*0Sstevel@tonic-gate 285*0Sstevel@tonic-gate #define HB_ECLK_1 INT64_C(0x0000000000000000) /* 1/1 clock */ 286*0Sstevel@tonic-gate #define HB_ECLK_2 INT64_C(0x0000000000000001) /* 1/2 clock */ 287*0Sstevel@tonic-gate #define HB_ECLK_4 INT64_C(0x0000000000000003) /* 1/4 clock */ 288*0Sstevel@tonic-gate #define HB_ECLK_6 INT64_C(0x0000000000000002) /* 1/6 clock */ 289*0Sstevel@tonic-gate #define HB_ECLK_8 INT64_C(0x0000000000000004) /* 1/8 clock */ 290*0Sstevel@tonic-gate #define HB_ECLK_MASK (HB_ECLK_1|HB_ECLK_2|HB_ECLK_4|HB_ECLK_6|HB_ECLK_8) 291*0Sstevel@tonic-gate 292*0Sstevel@tonic-gate 293*0Sstevel@tonic-gate /* 294*0Sstevel@tonic-gate * UPA Configuration Register 295*0Sstevel@tonic-gate * 296*0Sstevel@tonic-gate * +--------------+----+------+------+----------+------+-------------+ 297*0Sstevel@tonic-gate * | Resv | RR | DM | ELIM | PCON | MID | PCAP | 298*0Sstevel@tonic-gate * +--------------+----+------+------+----------+------+-------------+ 299*0Sstevel@tonic-gate * 63 39 38 37..36 35..33 32......22 21..17 16..........0 300*0Sstevel@tonic-gate * 301*0Sstevel@tonic-gate */ 302*0Sstevel@tonic-gate 303*0Sstevel@tonic-gate #define HB_UPA_DMAP_DATA_BIT 36 /* loads and stores direct mapped */ 304*0Sstevel@tonic-gate #define HB_UPA_DMAP_INSTR_BIT 37 /* instruction misses direct mapped */ 305*0Sstevel@tonic-gate #define HB_UPA_RR_BIT 38 /* reset rand generator */ 306*0Sstevel@tonic-gate 307*0Sstevel@tonic-gate #endif /* HUMMINGBIRD */ 308*0Sstevel@tonic-gate 309*0Sstevel@tonic-gate /* 310*0Sstevel@tonic-gate * The minimum size needed to ensure consistency on a virtually address 311*0Sstevel@tonic-gate * cache. Computed by taking the largest virtually indexed cache and dividing 312*0Sstevel@tonic-gate * by its associativity. 313*0Sstevel@tonic-gate */ 314*0Sstevel@tonic-gate #define S_VAC_SIZE 0x4000 315*0Sstevel@tonic-gate 316*0Sstevel@tonic-gate #ifdef _KERNEL 317*0Sstevel@tonic-gate 318*0Sstevel@tonic-gate #ifndef _ASM 319*0Sstevel@tonic-gate #include <sys/kstat.h> 320*0Sstevel@tonic-gate 321*0Sstevel@tonic-gate void get_udb_errors(uint64_t *udbh, uint64_t *udbl); 322*0Sstevel@tonic-gate 323*0Sstevel@tonic-gate /* 324*0Sstevel@tonic-gate * The scrub_misc structure contains miscellaneous bookeepping items for 325*0Sstevel@tonic-gate * scrubbing the E$. 326*0Sstevel@tonic-gate * 327*0Sstevel@tonic-gate * Counter of outstanding E$ scrub requests. The counter for a given CPU id 328*0Sstevel@tonic-gate * is atomically incremented and decremented _only_ on that CPU, 329*0Sstevel@tonic-gate * to avoid cacheline ownership bouncing. 330*0Sstevel@tonic-gate */ 331*0Sstevel@tonic-gate 332*0Sstevel@tonic-gate typedef struct spitfire_scrub_misc { 333*0Sstevel@tonic-gate uint32_t ec_scrub_outstanding; /* outstanding reqs */ 334*0Sstevel@tonic-gate int ecache_flush_index; /* offset into E$ for flush */ 335*0Sstevel@tonic-gate int ecache_busy; /* keeps track if cpu busy */ 336*0Sstevel@tonic-gate int ecache_nlines; /* no. of E$ lines */ 337*0Sstevel@tonic-gate int ecache_mirror; /* E$ is mirrored */ 338*0Sstevel@tonic-gate kstat_t *ecache_ksp; /* ptr to the kstat */ 339*0Sstevel@tonic-gate } spitfire_scrub_misc_t; 340*0Sstevel@tonic-gate 341*0Sstevel@tonic-gate /* 342*0Sstevel@tonic-gate * Spitfire module private data structure. One of these is allocated for each 343*0Sstevel@tonic-gate * valid cpu at setup time and is pointed to by the machcpu "cpu_private" 344*0Sstevel@tonic-gate * pointer. 345*0Sstevel@tonic-gate */ 346*0Sstevel@tonic-gate typedef struct spitfire_private { 347*0Sstevel@tonic-gate spitfire_scrub_misc_t sfpr_scrub_misc; 348*0Sstevel@tonic-gate uint64_t sfpr_scrub_afsr; 349*0Sstevel@tonic-gate } spitfire_private_t; 350*0Sstevel@tonic-gate 351*0Sstevel@tonic-gate #endif /* !_ASM */ 352*0Sstevel@tonic-gate 353*0Sstevel@tonic-gate #endif /* _KERNEL */ 354*0Sstevel@tonic-gate 355*0Sstevel@tonic-gate #ifdef __cplusplus 356*0Sstevel@tonic-gate } 357*0Sstevel@tonic-gate #endif 358*0Sstevel@tonic-gate 359*0Sstevel@tonic-gate #endif /* _SYS_SPITREGS_H */ 360