17c478bd9Sstevel@tonic-gate /* 27c478bd9Sstevel@tonic-gate * CDDL HEADER START 37c478bd9Sstevel@tonic-gate * 47c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 57c478bd9Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 67c478bd9Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 77c478bd9Sstevel@tonic-gate * with the License. 87c478bd9Sstevel@tonic-gate * 97c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 107c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 117c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 127c478bd9Sstevel@tonic-gate * and limitations under the License. 137c478bd9Sstevel@tonic-gate * 147c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 157c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 167c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 177c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 187c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 197c478bd9Sstevel@tonic-gate * 207c478bd9Sstevel@tonic-gate * CDDL HEADER END 217c478bd9Sstevel@tonic-gate */ 227c478bd9Sstevel@tonic-gate /* 23*af3c157aSrscott * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 247c478bd9Sstevel@tonic-gate * Use is subject to license terms. 257c478bd9Sstevel@tonic-gate */ 267c478bd9Sstevel@tonic-gate 277c478bd9Sstevel@tonic-gate #ifndef _SYS_CHEETAHREGS_H 287c478bd9Sstevel@tonic-gate #define _SYS_CHEETAHREGS_H 297c478bd9Sstevel@tonic-gate 307c478bd9Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 317c478bd9Sstevel@tonic-gate 327c478bd9Sstevel@tonic-gate #include <sys/machasi.h> 337c478bd9Sstevel@tonic-gate #ifdef _KERNEL 347c478bd9Sstevel@tonic-gate #include <sys/fpras.h> 357c478bd9Sstevel@tonic-gate #endif /* _KERNEL */ 367c478bd9Sstevel@tonic-gate 377c478bd9Sstevel@tonic-gate /* 387c478bd9Sstevel@tonic-gate * This file is cpu dependent. 397c478bd9Sstevel@tonic-gate */ 407c478bd9Sstevel@tonic-gate 417c478bd9Sstevel@tonic-gate #ifdef __cplusplus 427c478bd9Sstevel@tonic-gate extern "C" { 437c478bd9Sstevel@tonic-gate #endif 447c478bd9Sstevel@tonic-gate 457c478bd9Sstevel@tonic-gate /* 467c478bd9Sstevel@tonic-gate * Definitions of UltraSparc III cpu implementations as specified 477c478bd9Sstevel@tonic-gate * in version register 487c478bd9Sstevel@tonic-gate */ 497c478bd9Sstevel@tonic-gate #define CHEETAH_IMPL 0x14 507c478bd9Sstevel@tonic-gate #define IS_CHEETAH(impl) ((impl) == CHEETAH_IMPL) 517c478bd9Sstevel@tonic-gate #define CHEETAH_MAJOR_VERSION(rev) (((rev) >> 4) & 0xf) 527c478bd9Sstevel@tonic-gate #define CHEETAH_MINOR_VERSION(rev) ((rev) & 0xf) 537c478bd9Sstevel@tonic-gate 547c478bd9Sstevel@tonic-gate /* 557c478bd9Sstevel@tonic-gate * Definitions of UltraSPARC III+ cpu implementation as specified 567c478bd9Sstevel@tonic-gate * in version register 577c478bd9Sstevel@tonic-gate */ 587c478bd9Sstevel@tonic-gate #define CHEETAH_PLUS_IMPL 0x15 597c478bd9Sstevel@tonic-gate #define IS_CHEETAH_PLUS(impl) ((impl) == CHEETAH_PLUS_IMPL) 607c478bd9Sstevel@tonic-gate #define CHEETAH_PLUS_MAJOR_VERSION(rev) CHEETAH_MAJOR_VERSION(rev) 617c478bd9Sstevel@tonic-gate #define CHEETAH_PLUS_MINOR_VERSION(rev) CHEETAH_MINOR_VERSION(rev) 627c478bd9Sstevel@tonic-gate 637c478bd9Sstevel@tonic-gate /* 647c478bd9Sstevel@tonic-gate * Definitions of UltraSPARC IIIi cpu implementation as specified 657c478bd9Sstevel@tonic-gate * in version register. Jalapeno major and minor rev's are in 667c478bd9Sstevel@tonic-gate * the same location and are the same size as Cheetah/Cheetah+. 677c478bd9Sstevel@tonic-gate */ 687c478bd9Sstevel@tonic-gate #define JALAPENO_IMPL 0x16 697c478bd9Sstevel@tonic-gate #define IS_JALAPENO(impl) ((impl) == JALAPENO_IMPL) 707c478bd9Sstevel@tonic-gate #define JALAPENO_MAJOR_VERSION(rev) CHEETAH_MAJOR_VERSION(rev) 717c478bd9Sstevel@tonic-gate #define JALAPENO_MINOR_VERSION(rev) CHEETAH_MINOR_VERSION(rev) 727c478bd9Sstevel@tonic-gate 737c478bd9Sstevel@tonic-gate /* 747c478bd9Sstevel@tonic-gate * Definitions of UltraSPARC IV cpu implementation as specified 757c478bd9Sstevel@tonic-gate * in version register. Jaguar major and minor rev's are in 767c478bd9Sstevel@tonic-gate * the same location and are the same size as Cheetah/Cheetah+. 777c478bd9Sstevel@tonic-gate */ 787c478bd9Sstevel@tonic-gate #define JAGUAR_IMPL 0x18 797c478bd9Sstevel@tonic-gate #define IS_JAGUAR(impl) ((impl) == JAGUAR_IMPL) 807c478bd9Sstevel@tonic-gate #define JAGUAR_MAJOR_VERSION(rev) CHEETAH_MAJOR_VERSION(rev) 817c478bd9Sstevel@tonic-gate #define JAGUAR_MINOR_VERSION(rev) CHEETAH_MINOR_VERSION(rev) 827c478bd9Sstevel@tonic-gate 837c478bd9Sstevel@tonic-gate /* 847c478bd9Sstevel@tonic-gate * Definitions of UltraSPARC IIIi+ cpu implementation as specified 857c478bd9Sstevel@tonic-gate * in version register. Serrano major and minor rev's are in 867c478bd9Sstevel@tonic-gate * the same location and are the same size as Cheetah/Cheetah+. 877c478bd9Sstevel@tonic-gate */ 887c478bd9Sstevel@tonic-gate #define SERRANO_IMPL 0x22 897c478bd9Sstevel@tonic-gate #define IS_SERRANO(impl) ((impl) == SERRANO_IMPL) 907c478bd9Sstevel@tonic-gate #define SERRANO_MAJOR_VERSION(rev) CHEETAH_MAJOR_VERSION(rev) 917c478bd9Sstevel@tonic-gate #define SERRANO_MINOR_VERSION(rev) CHEETAH_MINOR_VERSION(rev) 927c478bd9Sstevel@tonic-gate 937c478bd9Sstevel@tonic-gate /* 947c478bd9Sstevel@tonic-gate * Definitions of UltraSPARC IV+ cpu implementation as specified 957c478bd9Sstevel@tonic-gate * in version register. Panther major and minor rev's are in 967c478bd9Sstevel@tonic-gate * the same location and are the same size as Cheetah/Cheetah+. 977c478bd9Sstevel@tonic-gate */ 987c478bd9Sstevel@tonic-gate #define PANTHER_IMPL 0x19 997c478bd9Sstevel@tonic-gate #define IS_PANTHER(impl) ((impl) == PANTHER_IMPL) 1007c478bd9Sstevel@tonic-gate #define PANTHER_MAJOR_VERSION(rev) CHEETAH_MAJOR_VERSION(rev) 1017c478bd9Sstevel@tonic-gate #define PANTHER_MINOR_VERSION(rev) CHEETAH_MINOR_VERSION(rev) 1027c478bd9Sstevel@tonic-gate 1037c478bd9Sstevel@tonic-gate #define CPU_IMPL_IS_CMP(impl) (IS_JAGUAR(impl) || IS_PANTHER(impl)) 1047c478bd9Sstevel@tonic-gate 1057c478bd9Sstevel@tonic-gate /* 1067c478bd9Sstevel@tonic-gate * Cheetah includes the process info in its mask to make things 1077c478bd9Sstevel@tonic-gate * more difficult. The process is the low bit of the major mask, 1087c478bd9Sstevel@tonic-gate * so to convert to the netlist major: 1097c478bd9Sstevel@tonic-gate * netlist_major = ((mask_major >> 1) + 1) 1107c478bd9Sstevel@tonic-gate */ 1117c478bd9Sstevel@tonic-gate #define REMAP_CHEETAH_MASK(x) (((((x) >> 1) + 0x10) & 0xf0) | ((x) & 0xf)) 1127c478bd9Sstevel@tonic-gate 1137c478bd9Sstevel@tonic-gate #ifdef _ASM 1147c478bd9Sstevel@tonic-gate /* 1157c478bd9Sstevel@tonic-gate * assembler doesn't understand the 'ull' suffix for C constants so 1167c478bd9Sstevel@tonic-gate * use the inttypes.h macros and undefine them here for assembly code 1177c478bd9Sstevel@tonic-gate */ 1187c478bd9Sstevel@tonic-gate #undef INT64_C 1197c478bd9Sstevel@tonic-gate #undef UINT64_C 1207c478bd9Sstevel@tonic-gate #define INT64_C(x) (x) 1217c478bd9Sstevel@tonic-gate #define UINT64_C(x) (x) 1227c478bd9Sstevel@tonic-gate #endif /* _ASM */ 1237c478bd9Sstevel@tonic-gate 1247c478bd9Sstevel@tonic-gate /* 1257c478bd9Sstevel@tonic-gate * DCU Control Register 1267c478bd9Sstevel@tonic-gate * 1277c478bd9Sstevel@tonic-gate * +------+----+----+----+----+----+-----+-----+----+----+----+ 1287c478bd9Sstevel@tonic-gate * | Resv | CP | CV | ME | RE | PE | HPE | SPE | SL | WE | PM | 1297c478bd9Sstevel@tonic-gate * +------+----+----+----+----+----+-----+-----+----+----+----+ 1307c478bd9Sstevel@tonic-gate * 63:50 49 48 47 46 45 44 43 42 41 40:33 1317c478bd9Sstevel@tonic-gate * 1327c478bd9Sstevel@tonic-gate * +----+----+----+----+----+----------+-----+----+----+----+---+ 1337c478bd9Sstevel@tonic-gate * | VM | PR | PW | VR | VW | Reserved | WIH | DM | IM | DC | IC| 1347c478bd9Sstevel@tonic-gate * +----+----+----+----+----+----------+-----+----+----+----+---+ 1357c478bd9Sstevel@tonic-gate * 32:25 24 23 22 21 20:5 4 3 2 1 0 1367c478bd9Sstevel@tonic-gate */ 1377c478bd9Sstevel@tonic-gate 1387c478bd9Sstevel@tonic-gate #define ASI_DCU ASI_LSU /* same as spitfire ASI_LSU 0x45 */ 1397c478bd9Sstevel@tonic-gate #define DCU_IC INT64_C(0x0000000000000001) /* icache enable */ 1407c478bd9Sstevel@tonic-gate #define DCU_DC INT64_C(0x0000000000000002) /* dcache enable */ 1417c478bd9Sstevel@tonic-gate #define DCU_IM INT64_C(0x0000000000000004) /* immu enable */ 1427c478bd9Sstevel@tonic-gate #define DCU_DM INT64_C(0x0000000000000008) /* dmmu enable */ 1437c478bd9Sstevel@tonic-gate #define DCU_WIH INT64_C(0x0000000000000010) /* Jaguar only - W$ hash index */ 1447c478bd9Sstevel@tonic-gate #define DCU_VW INT64_C(0x0000000000200000) /* virt watchpoint write enable */ 1457c478bd9Sstevel@tonic-gate #define DCU_VR INT64_C(0x0000000000400000) /* virt watchpoint read enable */ 1467c478bd9Sstevel@tonic-gate #define DCU_PW INT64_C(0x0000000000800000) /* phys watchpoint write enable */ 1477c478bd9Sstevel@tonic-gate #define DCU_PR INT64_C(0x0000000001000000) /* phys watchpoint read enable */ 1487c478bd9Sstevel@tonic-gate #define DCU_VM INT64_C(0x00000001FE000000) /* virtual watchpoint write mask */ 1497c478bd9Sstevel@tonic-gate #define DCU_PM INT64_C(0x000001FE00000000) /* phys watchpoint write mask */ 1507c478bd9Sstevel@tonic-gate #define DCU_WE INT64_C(0x0000020000000000) /* write cache enable */ 1517c478bd9Sstevel@tonic-gate #define DCU_SL INT64_C(0x0000040000000000) /* second load control */ 1527c478bd9Sstevel@tonic-gate #define DCU_SPE INT64_C(0x0000080000000000) /* software prefetch enable */ 1537c478bd9Sstevel@tonic-gate #define DCU_HPE INT64_C(0x0000100000000000) /* hardware prefetch enable */ 1547c478bd9Sstevel@tonic-gate #define DCU_PE INT64_C(0x0000200000000000) /* prefetch enable */ 1557c478bd9Sstevel@tonic-gate #define DCU_RE INT64_C(0x0000400000000000) /* RAW bypass enable */ 1567c478bd9Sstevel@tonic-gate #define DCU_ME INT64_C(0x0000800000000000) /* noncache store merging enable */ 1577c478bd9Sstevel@tonic-gate #define DCU_CV INT64_C(0x0001000000000000) /* virt cacheability when DM=0 */ 1587c478bd9Sstevel@tonic-gate #define DCU_CP INT64_C(0x0002000000000000) /* phys cacheable when DM,IM=0 */ 1597c478bd9Sstevel@tonic-gate #define DCU_CACHE (DCU_IC|DCU_DC|DCU_WE|DCU_SPE|DCU_HPE|DCU_PE) 1607c478bd9Sstevel@tonic-gate 1617c478bd9Sstevel@tonic-gate /* 1627c478bd9Sstevel@tonic-gate * bit shifts for the prefetch enable bit 1637c478bd9Sstevel@tonic-gate */ 1647c478bd9Sstevel@tonic-gate #define DCU_PE_SHIFT 45 1657c478bd9Sstevel@tonic-gate 1667c478bd9Sstevel@tonic-gate /* 1677c478bd9Sstevel@tonic-gate * Safari Configuration Register 1687c478bd9Sstevel@tonic-gate */ 1697c478bd9Sstevel@tonic-gate #define ASI_SAFARI_CONFIG ASI_UPA_CONFIG /* Safari Config Reg, 0x4A */ 1707c478bd9Sstevel@tonic-gate #define SAFARI_CONFIG_ECLK_1 INT64_C(0x0000000000000000) /* 1/1 clock */ 1717c478bd9Sstevel@tonic-gate #define SAFARI_CONFIG_ECLK_1_DIV 1 /* clock divisor: 1 */ 1727c478bd9Sstevel@tonic-gate #define SAFARI_CONFIG_ECLK_2 INT64_C(0x0000000040000000) /* 1/2 clock */ 1737c478bd9Sstevel@tonic-gate #define SAFARI_CONFIG_ECLK_2_DIV 2 /* clock divisor: 2 */ 1747c478bd9Sstevel@tonic-gate #define SAFARI_CONFIG_ECLK_32 INT64_C(0x0000000080000000) /* 1/32 clock */ 1757c478bd9Sstevel@tonic-gate #define SAFARI_CONFIG_ECLK_32_DIV 32 /* clock divisor: 32 */ 1767c478bd9Sstevel@tonic-gate #define SAFARI_CONFIG_ECLK_MASK (SAFARI_CONFIG_ECLK_32 | SAFARI_CONFIG_ECLK_2) 1777c478bd9Sstevel@tonic-gate 1787c478bd9Sstevel@tonic-gate #if defined(JALAPENO) || defined(SERRANO) 1797c478bd9Sstevel@tonic-gate /* 1807c478bd9Sstevel@tonic-gate * JBUS Configuration Register 1817c478bd9Sstevel@tonic-gate */ 1827c478bd9Sstevel@tonic-gate #define ASI_JBUS_CONFIG ASI_UPA_CONFIG /* JBUS Config Reg, 0x4A */ 1837c478bd9Sstevel@tonic-gate #define JBUS_CONFIG_ECLK_1 INT64_C(0x0000000000000000) /* 1/1 clock */ 1847c478bd9Sstevel@tonic-gate #define JBUS_CONFIG_ECLK_1_DIV 1 /* clock divisor: 1 */ 1857c478bd9Sstevel@tonic-gate #define JBUS_CONFIG_ECLK_2 INT64_C(0x0000000000002000) /* 1/2 clock */ 1867c478bd9Sstevel@tonic-gate #define JBUS_CONFIG_ECLK_2_DIV 2 /* clock divisor: 2 */ 1877c478bd9Sstevel@tonic-gate #define JBUS_CONFIG_ECLK_32 INT64_C(0x0000000000004000) /* 1/32 clock */ 1887c478bd9Sstevel@tonic-gate #define JBUS_CONFIG_ECLK_32_DIV 32 /* clock divisor: 32 */ 1897c478bd9Sstevel@tonic-gate #define JBUS_CONFIG_ECLK_MASK (JBUS_CONFIG_ECLK_32 | JBUS_CONFIG_ECLK_2) 1907c478bd9Sstevel@tonic-gate #define JBUS_CONFIG_ECLK_SHIFT 13 1917c478bd9Sstevel@tonic-gate 1927c478bd9Sstevel@tonic-gate /* 1937c478bd9Sstevel@tonic-gate * Jalapeno/Serrano MCU control registers and ASI 1947c478bd9Sstevel@tonic-gate */ 1957c478bd9Sstevel@tonic-gate #define ASI_MCU_CTRL 0x72 /* MCU Control Reg ASI */ 1967c478bd9Sstevel@tonic-gate #define JP_MCU_FSM_MASK INT64_C(0x0000000006000000) /* 26..25 */ 1977c478bd9Sstevel@tonic-gate #define JP_MCU_FSM_SHIFT 25 1987c478bd9Sstevel@tonic-gate #endif /* JALAPENO || SERRANO */ 1997c478bd9Sstevel@tonic-gate 2007c478bd9Sstevel@tonic-gate #if defined(SERRANO) 2017c478bd9Sstevel@tonic-gate #define ASI_MCU_AFAR2_VA 0x18 /* captures FRC/FRU addr */ 2027c478bd9Sstevel@tonic-gate #endif /* SERRANO */ 2037c478bd9Sstevel@tonic-gate 2047c478bd9Sstevel@tonic-gate #if defined(JALAPENO) && defined(JALAPENO_ERRATA_85) 2057c478bd9Sstevel@tonic-gate /* 2067c478bd9Sstevel@tonic-gate * Tomatillo Estar control registers (for JP Errataum 85) 2077c478bd9Sstevel@tonic-gate */ 2087c478bd9Sstevel@tonic-gate #define JBUS_SLAVE_T_PORT_BIT 48 2097c478bd9Sstevel@tonic-gate #define TOM_HIGH_PA 0x400 /* Hi 32 bit of Tom reg PA */ 2107c478bd9Sstevel@tonic-gate #define M_T_ESTAR_CTRL_PA 0x0f410050 /* M T estar PA */ 2117c478bd9Sstevel@tonic-gate #define S_T_ESTAR_CTRL_PA 0x0e410050 /* S T estar PA */ 2127c478bd9Sstevel@tonic-gate #define M_T_J_CHNG_INIT_PA 0x0f410058 /* Master T estar PA */ 2137c478bd9Sstevel@tonic-gate #define TOM_ESTAR_ELCK_MASK 0x23 /* bit 5,1,0 */ 2147c478bd9Sstevel@tonic-gate #define TOM_FULL_SPEED 0x1 2157c478bd9Sstevel@tonic-gate #define TOM_HALF_SPEED 0x2 2167c478bd9Sstevel@tonic-gate #define TOM_SLOW_SPEED 0x20 2177c478bd9Sstevel@tonic-gate #define TOM_TRIGGER_MASK 0x18 2187c478bd9Sstevel@tonic-gate #define TOM_TRIGGER 0x10 2197c478bd9Sstevel@tonic-gate 2207c478bd9Sstevel@tonic-gate #endif /* JALAPENO && JALAPENO_ERRATA_85 */ 2217c478bd9Sstevel@tonic-gate 2227c478bd9Sstevel@tonic-gate 2237c478bd9Sstevel@tonic-gate /* 2247c478bd9Sstevel@tonic-gate * Miscellaneous ASI definitions not in machasi.h 2257c478bd9Sstevel@tonic-gate */ 2267c478bd9Sstevel@tonic-gate #define ASI_DC_UTAG 0x43 /* Dcache Microtag Fields */ 2277c478bd9Sstevel@tonic-gate #define ASI_DC_SNP_TAG 0x44 /* Dcache Snoop Tag Fields */ 2287c478bd9Sstevel@tonic-gate #define ASI_IC_SNP_TAG 0x68 /* Icache Snoop Tag Fields */ 2297c478bd9Sstevel@tonic-gate #define ASI_IPB_DATA 0x69 /* Instruction Prefetch Buffer Data */ 2307c478bd9Sstevel@tonic-gate #define ASI_IPB_TAG 0x6A /* Instruction Prefetch Buffer Tag */ 2317c478bd9Sstevel@tonic-gate #define ASI_MC_DECODE 0x72 /* Memory Address Decoding Registers */ 2327c478bd9Sstevel@tonic-gate #define ASI_EC_CFG_TIMING 0x73 /* Jaguar shared Ecache Control Reg */ 2337c478bd9Sstevel@tonic-gate #define ASI_EC_DATA 0x74 /* Ecache Data Staging Registers */ 2347c478bd9Sstevel@tonic-gate #define ASI_EC_CTRL 0x75 /* Ecache Control Register */ 2357c478bd9Sstevel@tonic-gate #define ASI_PC_STATUS_DATA 0x30 /* Pcache Status Data Access */ 2367c478bd9Sstevel@tonic-gate #define ASI_PC_DATA 0x31 /* Pcache Diagnostic Data Register */ 2377c478bd9Sstevel@tonic-gate #define ASI_PC_TAG 0x32 /* Pcache Virtual Tag/Valid Field */ 2387c478bd9Sstevel@tonic-gate #define ASI_PC_SNP_TAG 0x33 /* Pcache Snoop Tag Register */ 2397c478bd9Sstevel@tonic-gate #define ASI_L2_DATA 0x6B /* L2 cache Data Diagnostic Access */ 2407c478bd9Sstevel@tonic-gate #define ASI_L2_TAG 0x6C /* L2 cache Tag Diagnostic Access */ 2417c478bd9Sstevel@tonic-gate 2427c478bd9Sstevel@tonic-gate /* 2437c478bd9Sstevel@tonic-gate * Bits of Cheetah Asynchronous Fault Status Register 2447c478bd9Sstevel@tonic-gate * 2457c478bd9Sstevel@tonic-gate * +---+--+----+----+----+----+---+---+---+---+--+---- 2467c478bd9Sstevel@tonic-gate * |rsv|ME|PRIV|PERR|IERR|ISAP|EMC|EMU|IVC|IVU|TO|BERR 2477c478bd9Sstevel@tonic-gate * +---+--+----+----+----+----+---+---+---+---+--+---- 2487c478bd9Sstevel@tonic-gate * 63:54 53 52 51 50 49 48 47 46 45 44 43 2497c478bd9Sstevel@tonic-gate * +---+---+---+---+---+---+---+---+--+--+---+------+---+-------+ 2507c478bd9Sstevel@tonic-gate * |UCC|UCU|CPC|CPU|WDC|WDU|EDC|EDU|UE|CE|rsv|M_SYND|rsv||E_SYND| 2517c478bd9Sstevel@tonic-gate * +---+---+---+---+---+---+---+---+--+--+---+------+---+-------+ 2527c478bd9Sstevel@tonic-gate * 42 41 40 39 38 37 36 35 34 33 32:20 19:16 15:9 8:0 2537c478bd9Sstevel@tonic-gate * 2547c478bd9Sstevel@tonic-gate */ 2557c478bd9Sstevel@tonic-gate #if defined(CHEETAH_PLUS) 2567c478bd9Sstevel@tonic-gate /* 2577c478bd9Sstevel@tonic-gate * Bits of Cheetah+ Asynchronous Fault Status Register 2587c478bd9Sstevel@tonic-gate * 2597c478bd9Sstevel@tonic-gate * +------------------+---------------------------- 2607c478bd9Sstevel@tonic-gate * |rsv|TUE_SH|IMC|IMU|DTO|DBERR|THCE|TSCE|TUE|DUE| 2617c478bd9Sstevel@tonic-gate * +------------------+---------------------------- . . . 2627c478bd9Sstevel@tonic-gate * 63 62 61 60 59 58 57 56 55 54 2637c478bd9Sstevel@tonic-gate * 2647c478bd9Sstevel@tonic-gate * Note that bits 60-62 are only implemented in Panther (reserved 2657c478bd9Sstevel@tonic-gate * in Cheetah+ and Jaguar. Also, bit 56 is reserved in Panther instead 2667c478bd9Sstevel@tonic-gate * of TSCE since those errors are HW corrected in Panther. 2677c478bd9Sstevel@tonic-gate */ 2687c478bd9Sstevel@tonic-gate #define C_AFSR_TUE_SH INT64_C(0x4000000000000000) /* uncorrectable tag UE */ 2697c478bd9Sstevel@tonic-gate #define C_AFSR_IMC INT64_C(0x2000000000000000) /* intr vector MTAG ECC */ 2707c478bd9Sstevel@tonic-gate #define C_AFSR_IMU INT64_C(0x1000000000000000) /* intr vector MTAG ECC */ 2717c478bd9Sstevel@tonic-gate #define C_AFSR_DTO INT64_C(0x0800000000000000) /* disrupting TO error */ 2727c478bd9Sstevel@tonic-gate #define C_AFSR_DBERR INT64_C(0x0400000000000000) /* disrupting BERR error */ 2737c478bd9Sstevel@tonic-gate #define C_AFSR_THCE INT64_C(0x0200000000000000) /* h/w correctable E$ tag err */ 2747c478bd9Sstevel@tonic-gate #define C_AFSR_TSCE INT64_C(0x0100000000000000) /* s/w correctable E$ tag err */ 2757c478bd9Sstevel@tonic-gate #define C_AFSR_TUE INT64_C(0x0080000000000000) /* uncorrectable E$ tag error */ 2767c478bd9Sstevel@tonic-gate #define C_AFSR_DUE INT64_C(0x0040000000000000) /* disrupting UE error */ 2777c478bd9Sstevel@tonic-gate #endif /* CHEETAH_PLUS */ 2787c478bd9Sstevel@tonic-gate #define C_AFSR_ME INT64_C(0x0020000000000000) /* errors > 1, same type!=CE */ 2797c478bd9Sstevel@tonic-gate #define C_AFSR_PRIV INT64_C(0x0010000000000000) /* priv code access error */ 2807c478bd9Sstevel@tonic-gate #define C_AFSR_PERR INT64_C(0x0008000000000000) /* system interface protocol */ 2817c478bd9Sstevel@tonic-gate #define C_AFSR_IERR INT64_C(0x0004000000000000) /* internal system interface */ 2827c478bd9Sstevel@tonic-gate #define C_AFSR_ISAP INT64_C(0x0002000000000000) /* system request parity err */ 2837c478bd9Sstevel@tonic-gate #define C_AFSR_EMC INT64_C(0x0001000000000000) /* mtag with CE error */ 2847c478bd9Sstevel@tonic-gate #define C_AFSR_EMU INT64_C(0x0000800000000000) /* mtag with UE error */ 2857c478bd9Sstevel@tonic-gate #define C_AFSR_IVC INT64_C(0x0000400000000000) /* intr vector with CE error */ 2867c478bd9Sstevel@tonic-gate #define C_AFSR_IVU INT64_C(0x0000200000000000) /* intr vector with UE error */ 2877c478bd9Sstevel@tonic-gate #define C_AFSR_TO INT64_C(0x0000100000000000) /* bus timeout from sys bus */ 2887c478bd9Sstevel@tonic-gate #define C_AFSR_BERR INT64_C(0x0000080000000000) /* bus error from system bus */ 2897c478bd9Sstevel@tonic-gate #define C_AFSR_UCC INT64_C(0x0000040000000000) /* E$ with software CE error */ 2907c478bd9Sstevel@tonic-gate #define C_AFSR_UCU INT64_C(0x0000020000000000) /* E$ with software UE error */ 2917c478bd9Sstevel@tonic-gate #define C_AFSR_CPC INT64_C(0x0000010000000000) /* copyout with CE error */ 2927c478bd9Sstevel@tonic-gate #define C_AFSR_CPU INT64_C(0x0000008000000000) /* copyout with UE error */ 2937c478bd9Sstevel@tonic-gate #define C_AFSR_WDC INT64_C(0x0000004000000000) /* writeback ecache CE error */ 2947c478bd9Sstevel@tonic-gate #define C_AFSR_WDU INT64_C(0x0000002000000000) /* writeback ecache UE error */ 2957c478bd9Sstevel@tonic-gate #define C_AFSR_EDC INT64_C(0x0000001000000000) /* ecache CE ECC error */ 2967c478bd9Sstevel@tonic-gate #define C_AFSR_EDU INT64_C(0x0000000800000000) /* ecache UE ECC error */ 2977c478bd9Sstevel@tonic-gate #define C_AFSR_UE INT64_C(0x0000000400000000) /* uncorrectable ECC error */ 2987c478bd9Sstevel@tonic-gate #define C_AFSR_CE INT64_C(0x0000000200000000) /* correctable ECC error */ 2997c478bd9Sstevel@tonic-gate #define C_AFSR_M_SYND INT64_C(0x00000000000f0000) /* mtag ECC syndrome */ 3007c478bd9Sstevel@tonic-gate #define C_AFSR_E_SYND INT64_C(0x00000000000001ff) /* data ECC syndrome */ 3017c478bd9Sstevel@tonic-gate 3027c478bd9Sstevel@tonic-gate /* AFSR bits that could result in CPU removal due to E$ error */ 3037c478bd9Sstevel@tonic-gate #define C_AFSR_L2_SERD_FAIL_UE (C_AFSR_UCU | C_AFSR_CPU | C_AFSR_WDU | \ 3047c478bd9Sstevel@tonic-gate C_AFSR_EDU) 3057c478bd9Sstevel@tonic-gate #define C_AFSR_L2_SERD_FAIL_CE (C_AFSR_UCC | C_AFSR_CPC | C_AFSR_WDC | \ 3067c478bd9Sstevel@tonic-gate C_AFSR_EDC) 3077c478bd9Sstevel@tonic-gate /* 3087c478bd9Sstevel@tonic-gate * Bits of the Panther Extended Asynchronous Fault Status Register (AFSR_EXT) 3097c478bd9Sstevel@tonic-gate * 3107c478bd9Sstevel@tonic-gate * +-----+-------+-----------+-------+-------+---------+------+------+------+ 3117c478bd9Sstevel@tonic-gate * | rsv |RED_ERR|EFA_PAR_ERR|L3_MECC|L3_THCE|L3_TUE_SH|L3_TUE|L3_EDC|L3_EDU| 3127c478bd9Sstevel@tonic-gate * +-----+-------+-----------+-------+-------+---------+------+------+------+ 3137c478bd9Sstevel@tonic-gate * 63:14 13 12 11 10 9 8 7 6 3147c478bd9Sstevel@tonic-gate * 3157c478bd9Sstevel@tonic-gate * +------+------+------+------+------+------+ 3167c478bd9Sstevel@tonic-gate * |L3_UCC|L3_UCU|L3_CPC|L3_CPU|L3_WDC|L3_WDU| 3177c478bd9Sstevel@tonic-gate * +------+------+------+------+------+------+ 3187c478bd9Sstevel@tonic-gate * 5 4 3 2 1 0 3197c478bd9Sstevel@tonic-gate * 3207c478bd9Sstevel@tonic-gate * If the L3_MECC bit is set along with any of the L3 cache errors (bits 0-7) 3217c478bd9Sstevel@tonic-gate * above, it indicates that an address parity error has occured. 3227c478bd9Sstevel@tonic-gate */ 3237c478bd9Sstevel@tonic-gate #define C_AFSR_RED_ERR INT64_C(0x0000000000002000) /* redunancy Efuse error */ 3247c478bd9Sstevel@tonic-gate #define C_AFSR_EFA_PAR_ERR INT64_C(0x0000000000001000) /* Efuse parity error */ 3257c478bd9Sstevel@tonic-gate #define C_AFSR_L3_MECC INT64_C(0x0000000000000800) /* L3 address parity */ 3267c478bd9Sstevel@tonic-gate #define C_AFSR_L3_THCE INT64_C(0x0000000000000400) /* tag CE */ 3277c478bd9Sstevel@tonic-gate #define C_AFSR_L3_TUE_SH INT64_C(0x0000000000000200) /* tag UE from snp/cpy */ 3287c478bd9Sstevel@tonic-gate #define C_AFSR_L3_TUE INT64_C(0x0000000000000100) /* tag UE */ 3297c478bd9Sstevel@tonic-gate #define C_AFSR_L3_EDC INT64_C(0x0000000000000080) /* L3 cache CE */ 3307c478bd9Sstevel@tonic-gate #define C_AFSR_L3_EDU INT64_C(0x0000000000000040) /* L3 cache UE */ 3317c478bd9Sstevel@tonic-gate #define C_AFSR_L3_UCC INT64_C(0x0000000000000020) /* software recover CE */ 3327c478bd9Sstevel@tonic-gate #define C_AFSR_L3_UCU INT64_C(0x0000000000000010) /* software recover UE */ 3337c478bd9Sstevel@tonic-gate #define C_AFSR_L3_CPC INT64_C(0x0000000000000008) /* copyout with CE */ 3347c478bd9Sstevel@tonic-gate #define C_AFSR_L3_CPU INT64_C(0x0000000000000004) /* copyout with UE */ 3357c478bd9Sstevel@tonic-gate #define C_AFSR_L3_WDC INT64_C(0x0000000000000002) /* writeback CE */ 3367c478bd9Sstevel@tonic-gate #define C_AFSR_L3_WDU INT64_C(0x0000000000000001) /* writeback UE */ 3377c478bd9Sstevel@tonic-gate 3387c478bd9Sstevel@tonic-gate #if defined(JALAPENO) || defined(SERRANO) 3397c478bd9Sstevel@tonic-gate /* 3407c478bd9Sstevel@tonic-gate * Bits of Jalapeno Asynchronous Fault Status Register 3417c478bd9Sstevel@tonic-gate * 3427c478bd9Sstevel@tonic-gate * +-----+------------------------------------------------------------------ 3437c478bd9Sstevel@tonic-gate * | rsv |JETO|SCE|JEIC|JEIT|ME|PRIV|JEIS|IERR|ISAP|ETP|OM|UMS|IVPE|TO|BERR| 3447c478bd9Sstevel@tonic-gate * +-----+------------------------------------------------------------------ 3457c478bd9Sstevel@tonic-gate * 63:58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 3467c478bd9Sstevel@tonic-gate * 3477c478bd9Sstevel@tonic-gate * +---+---+---+---+---+---+---+---+--+--+---+---+--+---+-------+ 3487c478bd9Sstevel@tonic-gate * |UCC|UCU|CPC|CPU|WDC|WDU|EDC|EDU|UE|CE|RUE|RCE|BP|WBP|FRC|FRU| 3497c478bd9Sstevel@tonic-gate * +---+---+---+---+---+---+---+---+--+--+---+---+--+---+-------+ 3507c478bd9Sstevel@tonic-gate * 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 3517c478bd9Sstevel@tonic-gate * 3527c478bd9Sstevel@tonic-gate * +-----+-----+-----+------+-----------+-------+ 3537c478bd9Sstevel@tonic-gate * | JREQ| ETW | rsv |B_SYND| rsv | AID | E_SYND| 3547c478bd9Sstevel@tonic-gate * +-----+-----+-----+------+-----+-----+-------+ 3557c478bd9Sstevel@tonic-gate * 26:24 23:22 21:20 19:16 15:14 13:9 8:0 3567c478bd9Sstevel@tonic-gate * 3577c478bd9Sstevel@tonic-gate */ 3587c478bd9Sstevel@tonic-gate 3597c478bd9Sstevel@tonic-gate /* 3607c478bd9Sstevel@tonic-gate * Bits of Serrano Asynchronous Fault Status Register 3617c478bd9Sstevel@tonic-gate * 3627c478bd9Sstevel@tonic-gate * +-----+------------------------------------------------------------------ 3637c478bd9Sstevel@tonic-gate * | rsv |JETO|SCE|JEIC|JEIT|ME|PRIV|JEIS|IERR|ISAP|ETU|OM|UMS|IVPE|TO|BERR| 3647c478bd9Sstevel@tonic-gate * +-----+------------------------------------------------------------------ 3657c478bd9Sstevel@tonic-gate * 63:58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 3667c478bd9Sstevel@tonic-gate * 3677c478bd9Sstevel@tonic-gate * +---+---+---+---+---+---+---+---+--+--+---+---+--+---+-------+ 3687c478bd9Sstevel@tonic-gate * |UCC|UCU|CPC|CPU|WDC|WDU|EDC|EDU|UE|CE|RUE|RCE|BP|WBP|FRC|FRU| 3697c478bd9Sstevel@tonic-gate * +---+---+---+---+---+---+---+---+--+--+---+---+--+---+-------+ 3707c478bd9Sstevel@tonic-gate * 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 3717c478bd9Sstevel@tonic-gate * 3727c478bd9Sstevel@tonic-gate * +-----+-----+------+---+------+---+---+-----+-------+ 3737c478bd9Sstevel@tonic-gate * | JREQ| ETW | EFES |ETS|B_SYND|ETI|ETC| AID | E_SYND| 3747c478bd9Sstevel@tonic-gate * +-----+-----+------+---+------+---+---+-----+-------+ 3757c478bd9Sstevel@tonic-gate * 26:24 23:22 21 20 19:16 15 14 13:9 8:0 3767c478bd9Sstevel@tonic-gate * 3777c478bd9Sstevel@tonic-gate */ 3787c478bd9Sstevel@tonic-gate 3797c478bd9Sstevel@tonic-gate #define C_AFSR_JETO INT64_C(0x0200000000000000) /* JBus Timeout */ 3807c478bd9Sstevel@tonic-gate #define C_AFSR_SCE INT64_C(0x0100000000000000) /* Snoop parity error */ 3817c478bd9Sstevel@tonic-gate #define C_AFSR_JEIC INT64_C(0x0080000000000000) /* JBus Illegal Cmd */ 3827c478bd9Sstevel@tonic-gate #define C_AFSR_JEIT INT64_C(0x0040000000000000) /* Illegal ADTYPE */ 3837c478bd9Sstevel@tonic-gate #define C_AFSR_JEIS INT64_C(0x0008000000000000) /* Illegal Install State */ 3847c478bd9Sstevel@tonic-gate #if defined(SERRANO) 3857c478bd9Sstevel@tonic-gate #define C_AFSR_ETU INT64_C(0x0001000000000000) /* L2$ tag CE error */ 3867c478bd9Sstevel@tonic-gate #elif defined(JALAPENO) 3877c478bd9Sstevel@tonic-gate #define C_AFSR_ETP INT64_C(0x0001000000000000) /* L2$ tag parity error */ 3887c478bd9Sstevel@tonic-gate #endif /* JALAPENO */ 3897c478bd9Sstevel@tonic-gate #define C_AFSR_OM INT64_C(0x0000800000000000) /* out of range mem error */ 3907c478bd9Sstevel@tonic-gate #define C_AFSR_UMS INT64_C(0x0000400000000000) /* Unsupported store */ 3917c478bd9Sstevel@tonic-gate #define C_AFSR_IVPE INT64_C(0x0000200000000000) /* intr vector parity err */ 3927c478bd9Sstevel@tonic-gate #define C_AFSR_RUE INT64_C(0x0000000100000000) /* remote mem UE error */ 3937c478bd9Sstevel@tonic-gate #define C_AFSR_RCE INT64_C(0x0000000080000000) /* remote mem CE error */ 3947c478bd9Sstevel@tonic-gate #define C_AFSR_BP INT64_C(0x0000000040000000) /* read data parity err */ 3957c478bd9Sstevel@tonic-gate #define C_AFSR_WBP INT64_C(0x0000000020000000) /* wb/bs data parity err */ 3967c478bd9Sstevel@tonic-gate #define C_AFSR_FRC INT64_C(0x0000000010000000) /* foregin mem CE error */ 3977c478bd9Sstevel@tonic-gate #define C_AFSR_FRU INT64_C(0x0000000008000000) /* foregin mem UE error */ 3987c478bd9Sstevel@tonic-gate #define C_AFSR_JREQ INT64_C(0x0000000007000000) /* Active JBus req at err */ 3997c478bd9Sstevel@tonic-gate #define C_AFSR_ETW INT64_C(0x0000000000c00000) /* AID causing UE/CE */ 4007c478bd9Sstevel@tonic-gate 4017c478bd9Sstevel@tonic-gate #if defined(SERRANO) 4027c478bd9Sstevel@tonic-gate #define C_AFSR_EFES INT64_C(0x0000000000200000) /* E-fuse error summary */ 4037c478bd9Sstevel@tonic-gate #define C_AFSR_ETS INT64_C(0x0000000000100000) /* L2$ tag SRAM stuck-at */ 4047c478bd9Sstevel@tonic-gate #endif /* SERRANO */ 4057c478bd9Sstevel@tonic-gate 4067c478bd9Sstevel@tonic-gate #define C_AFSR_B_SYND INT64_C(0x00000000000f0000) /* jbus parity syndrome */ 4077c478bd9Sstevel@tonic-gate 4087c478bd9Sstevel@tonic-gate #if defined(SERRANO) 4097c478bd9Sstevel@tonic-gate #define C_AFSR_ETI INT64_C(0x0000000000008000) /* L2$ tag intermittent */ 4107c478bd9Sstevel@tonic-gate #define C_AFSR_ETC INT64_C(0x0000000000004000) /* L2$ tag CE */ 4117c478bd9Sstevel@tonic-gate #endif /* SERRANO */ 4127c478bd9Sstevel@tonic-gate 4137c478bd9Sstevel@tonic-gate #define C_AFSR_AID INT64_C(0x0000000000003e00) /* AID causing UE/CE */ 4147c478bd9Sstevel@tonic-gate 4157c478bd9Sstevel@tonic-gate /* bit shifts for selected errors */ 4167c478bd9Sstevel@tonic-gate #define C_AFSR_WDU_SHIFT 37 4177c478bd9Sstevel@tonic-gate #define C_AFSR_UCU_SHIFT 41 4187c478bd9Sstevel@tonic-gate #define C_AFSR_UCC_SHIFT 42 4197c478bd9Sstevel@tonic-gate #define C_AFSR_JREQ_SHIFT 24 4207c478bd9Sstevel@tonic-gate #define C_AFSR_AID_SHIFT 9 4217c478bd9Sstevel@tonic-gate 4227c478bd9Sstevel@tonic-gate /* 4237c478bd9Sstevel@tonic-gate * Overloaded AFSR fields. During error processing, some of the reserved 4247c478bd9Sstevel@tonic-gate * fields within the saved AFSR are overwritten with extra information. 4257c478bd9Sstevel@tonic-gate */ 4267c478bd9Sstevel@tonic-gate #define C_AFSR_PANIC_SHIFT 62 4277c478bd9Sstevel@tonic-gate #define C_AFSR_IPE_SHIFT 59 4287c478bd9Sstevel@tonic-gate #define C_AFSR_DPE_SHIFT 58 4297c478bd9Sstevel@tonic-gate 4307c478bd9Sstevel@tonic-gate #else /* JALAPENO || SERRANO */ 4317c478bd9Sstevel@tonic-gate 4327c478bd9Sstevel@tonic-gate /* bit shifts for selected errors */ 4337c478bd9Sstevel@tonic-gate #define C_AFSR_WDU_SHIFT 37 4347c478bd9Sstevel@tonic-gate #define C_AFSR_UCU_SHIFT 41 4357c478bd9Sstevel@tonic-gate #define C_AFSR_UCC_SHIFT 42 4367c478bd9Sstevel@tonic-gate #define C_AFSR_L3_UCU_SHIFT 4 4377c478bd9Sstevel@tonic-gate 4387c478bd9Sstevel@tonic-gate /* 4397c478bd9Sstevel@tonic-gate * Overloaded AFSR fields. During error processing, some of the reserved fields 4407c478bd9Sstevel@tonic-gate * within the saved AFSR are overwritten with extra information. 4417c478bd9Sstevel@tonic-gate */ 4427c478bd9Sstevel@tonic-gate #define C_AFSR_FIRSTFLT_SHIFT 63 4437c478bd9Sstevel@tonic-gate #define C_AFSR_PANIC_SHIFT 30 4447c478bd9Sstevel@tonic-gate #define C_AFSR_DPE_SHIFT 20 4457c478bd9Sstevel@tonic-gate #define C_AFSR_IPE_SHIFT 21 4467c478bd9Sstevel@tonic-gate 4477c478bd9Sstevel@tonic-gate #endif /* JALAPENO || SERRANO */ 4487c478bd9Sstevel@tonic-gate 4497c478bd9Sstevel@tonic-gate #if defined(JALAPENO) || defined(SERRANO) 4507c478bd9Sstevel@tonic-gate /* 4517c478bd9Sstevel@tonic-gate * Jalapeno L2 Cache Control Register Bits. 4527c478bd9Sstevel@tonic-gate * 4537c478bd9Sstevel@tonic-gate * Bit# Name Description 4547c478bd9Sstevel@tonic-gate * 63-24 - reserved 4557c478bd9Sstevel@tonic-gate * 23:20 EC_ACT_WAY (read only) indicates which sets are present 4567c478bd9Sstevel@tonic-gate * 19:16 EC_BLK_WAY Bit mask indicating which sets are blocked 4577c478bd9Sstevel@tonic-gate * from replacement 4587c478bd9Sstevel@tonic-gate * 15:14 EC_SIZE L2 cache size 4597c478bd9Sstevel@tonic-gate * 13:12 - reserved 4607c478bd9Sstevel@tonic-gate * 11 EC_PAR_EN Enables parity checking on L2 cache tags 4617c478bd9Sstevel@tonic-gate * 10 EC_ECC_EN Enables ECC checking on L2 cache data 4627c478bd9Sstevel@tonic-gate * 9 EC_ECC_FORCE Enables EC_CHECK[8:0] onto L2 cache ECC bits 4637c478bd9Sstevel@tonic-gate * 8:0 EC_CHECK ECC check vector to force onto ECC bits 4647c478bd9Sstevel@tonic-gate */ 4657c478bd9Sstevel@tonic-gate 4667c478bd9Sstevel@tonic-gate #define JP_ECCTRL_ECSIZE_MASK 0xc000 4677c478bd9Sstevel@tonic-gate #define JP_ECCTRL_ECSIZE_SHIFT 14 4687c478bd9Sstevel@tonic-gate #define JP_ECCTRL_ECSIZE_MIN 0x80000 4697c478bd9Sstevel@tonic-gate 4707c478bd9Sstevel@tonic-gate /* 4717c478bd9Sstevel@tonic-gate * Jalapeno L2 Cache Error Enable Register Bits 4727c478bd9Sstevel@tonic-gate * 4737c478bd9Sstevel@tonic-gate * Bit# Name Description 4747c478bd9Sstevel@tonic-gate * 63-33 - reserved 4757c478bd9Sstevel@tonic-gate * 32 SCDE Enable detection of JBUS control parity error 4767c478bd9Sstevel@tonic-gate * 31:24 - reserved 4777c478bd9Sstevel@tonic-gate * 23 IAEN Enable trap on illegal physical address 4787c478bd9Sstevel@tonic-gate * 22 IERREN Enable FERR system reset on CPU internal errors 4797c478bd9Sstevel@tonic-gate * 21 PERREN Enable FERR system reset on JBUS protocol errors 4807c478bd9Sstevel@tonic-gate * 20 SCEN Enable FERR system reset on JBUS control parity error 4817c478bd9Sstevel@tonic-gate * 19:11 FMED Forced error on the memory ECC 4827c478bd9Sstevel@tonic-gate * 10 FME Force error on memory ECC 4837c478bd9Sstevel@tonic-gate * 9:6 FPD Bits to use when FSP forces JBUS addr/data parity error 4847c478bd9Sstevel@tonic-gate * 5 FSP Force error on outgoing JBUS addr/data parity 4857c478bd9Sstevel@tonic-gate * 4 ETPEN Enable FERR system reset on L2 tags parity error 4867c478bd9Sstevel@tonic-gate * 3 UCEEN Enable trap on SW handled external cache error 4877c478bd9Sstevel@tonic-gate * 2 ISAPEN Enable FERR system reset on request parity error 4887c478bd9Sstevel@tonic-gate * 1 NCEEN Enable trap on uncorrectable ECC error and system err 4897c478bd9Sstevel@tonic-gate * 0 CEEN Enable trap on correctable ECC errors 4907c478bd9Sstevel@tonic-gate */ 4917c478bd9Sstevel@tonic-gate 4927c478bd9Sstevel@tonic-gate #define EN_REG_UCEEN INT64_C(0x0000000000000008) /* enable UCC,UCU */ 4937c478bd9Sstevel@tonic-gate #define EN_REG_ISAPEN INT64_C(0x0000000000000004) /* enable ISAP */ 4947c478bd9Sstevel@tonic-gate #define EN_REG_NCEEN INT64_C(0x0000000000000002) /* UE,EDU,WDU,BERR,IVU,EMU */ 4957c478bd9Sstevel@tonic-gate #define EN_REG_CEEN INT64_C(0x0000000000000001) /* enable CE,EDC,WDC,IVC,EMC */ 4967c478bd9Sstevel@tonic-gate 4977c478bd9Sstevel@tonic-gate #define EN_REG_DISABLE INT64_C(0x0000000000000000) /* no errors enabled */ 4987c478bd9Sstevel@tonic-gate #define EN_REG_ECC_DISABLE (EN_REG_UCEEN | EN_REG_ISAPEN) 4997c478bd9Sstevel@tonic-gate #define EN_REG_CE_DISABLE (EN_REG_UCEEN | EN_REG_ISAPEN | EN_REG_NCEEN) 5007c478bd9Sstevel@tonic-gate #define EN_REG_ENABLE \ 5017c478bd9Sstevel@tonic-gate (EN_REG_UCEEN | EN_REG_ISAPEN | EN_REG_NCEEN | EN_REG_CEEN) 5027c478bd9Sstevel@tonic-gate 5037c478bd9Sstevel@tonic-gate #else /* JALAPENO || SERRANO */ 5047c478bd9Sstevel@tonic-gate #if defined(CHEETAH_PLUS) 5057c478bd9Sstevel@tonic-gate /* 5067c478bd9Sstevel@tonic-gate * Cheetah+ External Cache Control Register Bits. 5077c478bd9Sstevel@tonic-gate */ 5087c478bd9Sstevel@tonic-gate #define ECCR_ASSOC INT64_C(0x0000000001000000) /* Ecache Assoc. */ 5097c478bd9Sstevel@tonic-gate #define ECCR_ASSOC_SHIFT 24 5107c478bd9Sstevel@tonic-gate #endif /* CHEETAH_PLUS */ 5117c478bd9Sstevel@tonic-gate 5127c478bd9Sstevel@tonic-gate /* 5137c478bd9Sstevel@tonic-gate * Bits of Cheetah External Cache Error Enable Register 5147c478bd9Sstevel@tonic-gate * 5157c478bd9Sstevel@tonic-gate * +-----+-----+-------+-----+-------+-------+--------+-------+------+ 5167c478bd9Sstevel@tonic-gate * | rsv | FMT | FMECC | FMD | FDECC | UCEEN | ISAPEN | NCEEN | CEEN | 5177c478bd9Sstevel@tonic-gate * +-----+-----+-------+-----+-------+-------+--------+-------+------+ 5187c478bd9Sstevel@tonic-gate * 63:19 18 17 14 13 12:4 3 2 1 0 5197c478bd9Sstevel@tonic-gate * 5207c478bd9Sstevel@tonic-gate */ 5217c478bd9Sstevel@tonic-gate #define EN_REG_FMT INT64_C(0x0000000000040000) /* force system mtag ECC */ 5227c478bd9Sstevel@tonic-gate #define EN_REG_FMECC INT64_C(0x000000000003C000) /* forced mtag ECC vector */ 5237c478bd9Sstevel@tonic-gate #define EN_REG_FMD INT64_C(0x0000000000002000) /* force system data ECC */ 5247c478bd9Sstevel@tonic-gate #define EN_REG_FDECC INT64_C(0x0000000000001ff0) /* forced data ECC vector */ 5257c478bd9Sstevel@tonic-gate #define EN_REG_UCEEN INT64_C(0x0000000000000008) /* enable UCC,UCU */ 5267c478bd9Sstevel@tonic-gate #define EN_REG_ISAPEN INT64_C(0x0000000000000004) /* enable ISAP */ 5277c478bd9Sstevel@tonic-gate #define EN_REG_NCEEN INT64_C(0x0000000000000002) /* UE,EDU,WDU,BERR,IVU,EMU */ 5287c478bd9Sstevel@tonic-gate #define EN_REG_CEEN INT64_C(0x0000000000000001) /* enable CE,EDC,WDC,IVC,EMC */ 5297c478bd9Sstevel@tonic-gate #define EN_REG_DISABLE INT64_C(0x0000000000000000) /* no errors enabled */ 5307c478bd9Sstevel@tonic-gate #define EN_REG_ECC_DISABLE (EN_REG_UCEEN | EN_REG_ISAPEN) 5317c478bd9Sstevel@tonic-gate #define EN_REG_CE_DISABLE (EN_REG_UCEEN | EN_REG_ISAPEN | EN_REG_NCEEN) 5327c478bd9Sstevel@tonic-gate #define EN_REG_ENABLE \ 5337c478bd9Sstevel@tonic-gate (EN_REG_UCEEN | EN_REG_ISAPEN | EN_REG_NCEEN | EN_REG_CEEN) 5347c478bd9Sstevel@tonic-gate #endif /* JALAPENO || SERRANO */ 5357c478bd9Sstevel@tonic-gate 5367c478bd9Sstevel@tonic-gate /* 5377c478bd9Sstevel@tonic-gate * bit shifts for selected bits 5387c478bd9Sstevel@tonic-gate */ 5397c478bd9Sstevel@tonic-gate #define EN_REG_CEEN_SHIFT 0 5407c478bd9Sstevel@tonic-gate 5417c478bd9Sstevel@tonic-gate /* Cheetah/Cheetah+ Dcache size */ 5427c478bd9Sstevel@tonic-gate #define CH_DCACHE_SIZE 0x10000 5437c478bd9Sstevel@tonic-gate 5447c478bd9Sstevel@tonic-gate /* Cheetah/Cheetah+ Dcache linesize */ 5457c478bd9Sstevel@tonic-gate #define CH_DCACHE_LSIZE 0x20 5467c478bd9Sstevel@tonic-gate 5477c478bd9Sstevel@tonic-gate /* Cheetah/Cheetah+/Jaguar Icache size */ 5487c478bd9Sstevel@tonic-gate #define CH_ICACHE_SIZE 0x8000 5497c478bd9Sstevel@tonic-gate 5507c478bd9Sstevel@tonic-gate /* Cheetah/Cheetah+/Jaguar Icache linesize */ 5517c478bd9Sstevel@tonic-gate #define CH_ICACHE_LSIZE 0x20 5527c478bd9Sstevel@tonic-gate 5537c478bd9Sstevel@tonic-gate /* Panther Icache size */ 5547c478bd9Sstevel@tonic-gate #define PN_ICACHE_SIZE 0x10000 5557c478bd9Sstevel@tonic-gate 5567c478bd9Sstevel@tonic-gate /* Panther Icache linesize */ 5577c478bd9Sstevel@tonic-gate #define PN_ICACHE_LSIZE 0x40 5587c478bd9Sstevel@tonic-gate 5597c478bd9Sstevel@tonic-gate /* Pcache size for the cheetah family of CPUs */ 5607c478bd9Sstevel@tonic-gate #define CH_PCACHE_SIZE 0x800 5617c478bd9Sstevel@tonic-gate 5627c478bd9Sstevel@tonic-gate /* Pcache linesize for the cheetah family of CPUs */ 5637c478bd9Sstevel@tonic-gate #define CH_PCACHE_LSIZE 0x40 5647c478bd9Sstevel@tonic-gate 5657c478bd9Sstevel@tonic-gate /* 5667c478bd9Sstevel@tonic-gate * The cheetah+ CPU module handles Cheetah+, Jaguar, and Panther so 5677c478bd9Sstevel@tonic-gate * we have to pick max size and min linesize values for the Icache 5687c478bd9Sstevel@tonic-gate * accordingly. 5697c478bd9Sstevel@tonic-gate */ 5707c478bd9Sstevel@tonic-gate #define CHP_ICACHE_MAX_SIZE PN_ICACHE_SIZE 5717c478bd9Sstevel@tonic-gate #define CHP_ICACHE_MIN_LSIZE CH_ICACHE_LSIZE 5727c478bd9Sstevel@tonic-gate 5737c478bd9Sstevel@tonic-gate /* 5747c478bd9Sstevel@tonic-gate * The minimum size needed to ensure consistency on a virtually address 5757c478bd9Sstevel@tonic-gate * cache. Computed by taking the largest virtually indexed cache and dividing 5767c478bd9Sstevel@tonic-gate * by its associativity. 5777c478bd9Sstevel@tonic-gate */ 5787c478bd9Sstevel@tonic-gate #define CH_VAC_SIZE 0x4000 5797c478bd9Sstevel@tonic-gate 5807c478bd9Sstevel@tonic-gate /* 5817c478bd9Sstevel@tonic-gate * The following definitions give the syndromes that will be seen when attempts 5827c478bd9Sstevel@tonic-gate * are made to read data that has been intentionally poisoned. Intentional 5837c478bd9Sstevel@tonic-gate * poisoning is performed when an error has been detected, and is designed to 5847c478bd9Sstevel@tonic-gate * allow software to effectively distinguish between root problems and secondary 5857c478bd9Sstevel@tonic-gate * effects. The following syndromes and their descriptions are taken from the 5867c478bd9Sstevel@tonic-gate * UltraSPARC-III Cu Error Manual, Section 5.4.3.1. 5877c478bd9Sstevel@tonic-gate */ 5887c478bd9Sstevel@tonic-gate 5897c478bd9Sstevel@tonic-gate /* 5907c478bd9Sstevel@tonic-gate * For a DSTAT = 2 or 3 event (see Sec 5.3.4.4) from the system bus for a 5917c478bd9Sstevel@tonic-gate * cacheable load, data bits [1:0] are inverted in the data stored in the 5927c478bd9Sstevel@tonic-gate * L2-cache. The syndrome seen when one of these signalling words is read will 5937c478bd9Sstevel@tonic-gate * be 0x11c. 5947c478bd9Sstevel@tonic-gate */ 5957c478bd9Sstevel@tonic-gate #define CH_POISON_SYND_FROM_DSTAT23 0x11c 5967c478bd9Sstevel@tonic-gate 5977c478bd9Sstevel@tonic-gate /* 5987c478bd9Sstevel@tonic-gate * For an uncorrectable data ECC error from the L2-cache, data bits [127:126] 5997c478bd9Sstevel@tonic-gate * are inverted in data sent to the system bus as part of a writeback or 6007c478bd9Sstevel@tonic-gate * copyout. The syndrome seen when one of these signalling words is read will 6017c478bd9Sstevel@tonic-gate * be 0x071. 6027c478bd9Sstevel@tonic-gate */ 6037c478bd9Sstevel@tonic-gate #define CH_POISON_SYND_FROM_XXU_WRITE 0x71 6047c478bd9Sstevel@tonic-gate 6057c478bd9Sstevel@tonic-gate /* 6067c478bd9Sstevel@tonic-gate * For uncorrectable data ECC error on the L2-cache read done to complete a 6077c478bd9Sstevel@tonic-gate * store merge event, where bytes written by the processor are merged with 6087c478bd9Sstevel@tonic-gate * bytes from an L2-cache line, ECC check bits [1:0] are inverted in the data 6097c478bd9Sstevel@tonic-gate * scrubbed back to the L2-cache. The syndrome seen when one of these 6107c478bd9Sstevel@tonic-gate * signalling words is read will be 0x003. 6117c478bd9Sstevel@tonic-gate */ 6127c478bd9Sstevel@tonic-gate #define CH_POISON_SYND_FROM_XXU_WRMERGE 0x3 6137c478bd9Sstevel@tonic-gate 6147c478bd9Sstevel@tonic-gate /* 6157c478bd9Sstevel@tonic-gate * To help understand the following definitions, this block of comments 6167c478bd9Sstevel@tonic-gate * provides information on Cheetah's E$. 6177c478bd9Sstevel@tonic-gate * 6187c478bd9Sstevel@tonic-gate * Cheetah supports three different E$ sizes (1MB, 4MB, and 8MB). The 6197c478bd9Sstevel@tonic-gate * number of E$ lines remains constant regardless of the size of the E$ 6207c478bd9Sstevel@tonic-gate * as does the subblock size, however the number of 64-byte subblocks per 6217c478bd9Sstevel@tonic-gate * line varies depending on the E$ size. 6227c478bd9Sstevel@tonic-gate * 6237c478bd9Sstevel@tonic-gate * An E$ tag (for an E$ line) contains an EC_tag field, corresponding to the 6247c478bd9Sstevel@tonic-gate * high order physical address bits of that E$ line's contents, and 1 to 8 6257c478bd9Sstevel@tonic-gate * EC_state fields, indicating the state of each subblock. Due to the E$ line 6267c478bd9Sstevel@tonic-gate * size variance depending on the total size of the E$, the number of bits in 6277c478bd9Sstevel@tonic-gate * the EC_tag field varies as does the number of subblocks (and EC_state 6287c478bd9Sstevel@tonic-gate * fields) per E$ line. 6297c478bd9Sstevel@tonic-gate * 6307c478bd9Sstevel@tonic-gate * A 1MB E$ has a line size of 64 bytes, containing 1 subblock per line. 6317c478bd9Sstevel@tonic-gate * A 4MB E$ has a line size of 256 bytes, containing 4 subblocks per line. 6327c478bd9Sstevel@tonic-gate * An 8MB E$ has a line size of 512 bytes, containing 8 subblocks per line. 6337c478bd9Sstevel@tonic-gate * 6347c478bd9Sstevel@tonic-gate * An E$ tag for a particular E$ line can be read via a diagnostic ASI 6357c478bd9Sstevel@tonic-gate * as a 64-bit value. 6367c478bd9Sstevel@tonic-gate * Within the E$ tag 64-bit value, the EC_tag field is interpreted as follows: 6377c478bd9Sstevel@tonic-gate * - for a 1MB E$, the EC_tag is in bits <43:21> and corresponds 6387c478bd9Sstevel@tonic-gate * to physical address bits <42:20> (bits <41:19> for Cheetah+) 6397c478bd9Sstevel@tonic-gate * - for a 4MB E$, the EC_tag is in bits <43:23> and corresponds 6407c478bd9Sstevel@tonic-gate * to physical address bits <42:22> (bits <41:21> for Cheetah+) 6417c478bd9Sstevel@tonic-gate * - for an 8MB E$, the EC_tag is in bits <43:24> and corresponds 6427c478bd9Sstevel@tonic-gate * to physical address bits <42:23> (bits <41:22> for Cheetah+) 6437c478bd9Sstevel@tonic-gate * Within the E$ tag 64-bit value, the EC_state field(s) is(are) interpreted 6447c478bd9Sstevel@tonic-gate * as follows: 6457c478bd9Sstevel@tonic-gate * - for a 1MB E$, EC_state0 is in bits <2:0> 6467c478bd9Sstevel@tonic-gate * - for a 4MB E$, EC_state0 is in bits <2:0>, EC_state1 is in 6477c478bd9Sstevel@tonic-gate * bits <5:3>, EC_state2 is in bits <8:6>, EC_state3 is 6487c478bd9Sstevel@tonic-gate * in bits <11:9> 6497c478bd9Sstevel@tonic-gate * - for an 8MB E$, EC_state0 is in bits <2:0>, EC_state1 is in 6507c478bd9Sstevel@tonic-gate * bits <5:3>, EC_state2 is in bits <8:6>, EC_state3 is 6517c478bd9Sstevel@tonic-gate * in bits <11:9>, EC_state4 is in bits <14:12>, EC_state5 6527c478bd9Sstevel@tonic-gate * is in bits <17:15>, EC_state6 is in bits <20:18>, 6537c478bd9Sstevel@tonic-gate * EC_state7 is in bits <23:21> 6547c478bd9Sstevel@tonic-gate * Note that each EC_state field contains a value representing the state 6557c478bd9Sstevel@tonic-gate * of its corresponding subblock. 6567c478bd9Sstevel@tonic-gate * 6577c478bd9Sstevel@tonic-gate */ 6587c478bd9Sstevel@tonic-gate /* 6597c478bd9Sstevel@tonic-gate * Jaguar changes from Cheetah/Cheetah+ Ecache: 6607c478bd9Sstevel@tonic-gate * 6617c478bd9Sstevel@tonic-gate * The Jaguar Ecache is similiar to that used for Cheetah/Cheetah+ with a 6627c478bd9Sstevel@tonic-gate * couple of differences : 6637c478bd9Sstevel@tonic-gate * - Jaguar Ecache only comes in 4MB and 8MB versions. 6647c478bd9Sstevel@tonic-gate * - 8MB E$ has 2 64 byte subblocks per line. 6657c478bd9Sstevel@tonic-gate * - 4MB E$ has 1 64 byte subblock per line. 6667c478bd9Sstevel@tonic-gate * 6677c478bd9Sstevel@tonic-gate * An E$ tag for a particular E$ line can be read via a diagnostic ASI 6687c478bd9Sstevel@tonic-gate * as a 64-bit value. 6697c478bd9Sstevel@tonic-gate * Within the E$ tag 64-bit value, the EC_tag field is interpreted as follows: 6707c478bd9Sstevel@tonic-gate * - for a 4MB E$, the EC_tag is in bits <41:21> and corresponds 6717c478bd9Sstevel@tonic-gate * to physical address bits <41:21> 6727c478bd9Sstevel@tonic-gate * - for a 8MB E$, the EC_tag is in bits <41:22> and corresponds 6737c478bd9Sstevel@tonic-gate * to physical address bits <41:22> 6747c478bd9Sstevel@tonic-gate * 6757c478bd9Sstevel@tonic-gate * The Jaguar E$ tag also contains LRU field in bit <42> which must be 6767c478bd9Sstevel@tonic-gate * masked off when the tag value is being compared to a PA. 6777c478bd9Sstevel@tonic-gate * 6787c478bd9Sstevel@tonic-gate * Within the E$ tag 64-bit value, the EC_state field(s) is(are) interpreted 6797c478bd9Sstevel@tonic-gate * as follows: 6807c478bd9Sstevel@tonic-gate * - for 4MB E$, EC_state0 is in bits <2:0> 6817c478bd9Sstevel@tonic-gate * - for 8MB E$, EC_state0 is in bits <2:0>, EC_state1 is in bits <5:3>. 6827c478bd9Sstevel@tonic-gate * Each EC_state field contains a value representing the state of its 6837c478bd9Sstevel@tonic-gate * corresponding subblock. 6847c478bd9Sstevel@tonic-gate * 6857c478bd9Sstevel@tonic-gate * Note that the subblock size and state values are the same for both 6867c478bd9Sstevel@tonic-gate * Cheetah/Cheetah+ and Jaguar. 6877c478bd9Sstevel@tonic-gate */ 6887c478bd9Sstevel@tonic-gate 6897c478bd9Sstevel@tonic-gate /* Ecache sizes */ 6907c478bd9Sstevel@tonic-gate #define CH_ECACHE_8M_SIZE 0x800000 6917c478bd9Sstevel@tonic-gate #define CH_ECACHE_4M_SIZE 0x400000 6927c478bd9Sstevel@tonic-gate #define CH_ECACHE_1M_SIZE 0x100000 6937c478bd9Sstevel@tonic-gate 6947c478bd9Sstevel@tonic-gate #define PN_L2_SIZE 0x200000 6957c478bd9Sstevel@tonic-gate #define PN_L2_LINESIZE 64 6967c478bd9Sstevel@tonic-gate #define PN_L2_ECC_WORDS 2 6977c478bd9Sstevel@tonic-gate #define PN_L2_NWAYS 4 6987c478bd9Sstevel@tonic-gate #define PN_L2_SET_SIZE (PN_L2_SIZE / PN_L2_NWAYS) 6997c478bd9Sstevel@tonic-gate #define PN_L2_MAX_SET (PN_L2_SIZE - PN_L2_SET_SIZE) 7007c478bd9Sstevel@tonic-gate #define PN_L2_DATA_ECC_SEL 0x200000 /* bit 21 selects ECC */ 7017c478bd9Sstevel@tonic-gate #define PN_L2_ECC_LO_REG 0x20 /* bit 5 set for L2 tag access */ 7027c478bd9Sstevel@tonic-gate #define PN_L2_INDEX_MASK 0x7ffc0 /* bits 18:6 */ 7037c478bd9Sstevel@tonic-gate #define PN_L2_WAY_INCR 0x80000 /* l2-ec-way = <20:19> */ 7047c478bd9Sstevel@tonic-gate #define PN_L2_WAY_LIM INT64_C(0x200000) 7057c478bd9Sstevel@tonic-gate #define PN_L2_WAY_SHIFT 19 7067c478bd9Sstevel@tonic-gate 7077c478bd9Sstevel@tonic-gate #define PN_L3_SIZE 0x2000000 7087c478bd9Sstevel@tonic-gate #define PN_L3_LINESIZE 64 7097c478bd9Sstevel@tonic-gate #define PN_L3_NWAYS 4 7107c478bd9Sstevel@tonic-gate #define PN_L3_SET_SIZE (PN_L3_SIZE / PN_L3_NWAYS) 7117c478bd9Sstevel@tonic-gate #define PN_L3_MAX_SET (PN_L3_SIZE - PN_L3_SET_SIZE) 7127c478bd9Sstevel@tonic-gate #define PN_L3_WAY_SHIFT 23 7137c478bd9Sstevel@tonic-gate #define PN_L3_TAG_RD_MASK 0x7fffc0 /* ec_tag = PA<22:6> */ 7147c478bd9Sstevel@tonic-gate #define PN_L3_WAY_INCR 0x800000 /* ec_way = <24:23> */ 7157c478bd9Sstevel@tonic-gate #define PN_L3_WAY_LIM INT64_C(0x2000000) 7167c478bd9Sstevel@tonic-gate 7177c478bd9Sstevel@tonic-gate /* Pcache Defines */ 7187c478bd9Sstevel@tonic-gate #define PN_PCACHE_ADDR_MASK 0x1c0 /* PC_addr = <8:6> */ 7197c478bd9Sstevel@tonic-gate #define PN_PCACHE_WAY_INCR 0x200 /* PC_way = <10:9> */ 7207c478bd9Sstevel@tonic-gate #define PN_PCACHE_WORD_SHIFT 3 /* PC_dbl_word = <5:3> */ 7217c478bd9Sstevel@tonic-gate #define PN_PCACHE_NWAYS 4 7227c478bd9Sstevel@tonic-gate 7237c478bd9Sstevel@tonic-gate /* Cheetah Ecache is direct-mapped, Cheetah+ can be 2-way or direct-mapped */ 7247c478bd9Sstevel@tonic-gate #define CH_ECACHE_NWAY 1 7257c478bd9Sstevel@tonic-gate #if defined(CHEETAH_PLUS) 7267c478bd9Sstevel@tonic-gate #define CHP_ECACHE_NWAY 2 7277c478bd9Sstevel@tonic-gate #define PN_ECACHE_NWAY 4 7287c478bd9Sstevel@tonic-gate #endif /* CHEETAH_PLUS */ 7297c478bd9Sstevel@tonic-gate #if defined(JALAPENO) || defined(SERRANO) 7307c478bd9Sstevel@tonic-gate #define JP_ECACHE_NWAY 4 7317c478bd9Sstevel@tonic-gate #define JP_ECACHE_NWAY_SHIFT 2 7327c478bd9Sstevel@tonic-gate #endif /* JALAPENO || SERRANO */ 7337c478bd9Sstevel@tonic-gate 7347c478bd9Sstevel@tonic-gate /* Maximum Ecache size */ 7357c478bd9Sstevel@tonic-gate #define CH_ECACHE_MAX_SIZE CH_ECACHE_8M_SIZE 7367c478bd9Sstevel@tonic-gate 7377c478bd9Sstevel@tonic-gate /* Minimum Ecache line size */ 7387c478bd9Sstevel@tonic-gate #define CH_ECACHE_MIN_LSIZE 64 7397c478bd9Sstevel@tonic-gate 7407c478bd9Sstevel@tonic-gate /* Maximum Ecache line size - 8Mb Ecache has 512 byte linesize */ 7417c478bd9Sstevel@tonic-gate #define CH_ECACHE_MAX_LSIZE 512 7427c478bd9Sstevel@tonic-gate 7437c478bd9Sstevel@tonic-gate /* Size of Ecache data staging register size (see Cheetah PRM 10.7.2) */ 7447c478bd9Sstevel@tonic-gate #define CH_ECACHE_STGREG_SIZE 32 7457c478bd9Sstevel@tonic-gate #define CH_ECACHE_STGREG_TOTALSIZE 40 /* data regs + ecc */ 7467c478bd9Sstevel@tonic-gate 7477c478bd9Sstevel@tonic-gate /* The number of staging registers containing data, for ASI_EC_DATA */ 7487c478bd9Sstevel@tonic-gate #define CH_ECACHE_STGREG_NUM (CH_ECACHE_STGREG_SIZE / sizeof (uint64_t)) 7497c478bd9Sstevel@tonic-gate 7507c478bd9Sstevel@tonic-gate /* Size of Ecache data subblock which has state field in Ecache tag */ 7517c478bd9Sstevel@tonic-gate #define CH_ECACHE_SUBBLK_SIZE 64 7527c478bd9Sstevel@tonic-gate #define CH_ECACHE_SUBBLK_SHIFT 6 7537c478bd9Sstevel@tonic-gate 7547c478bd9Sstevel@tonic-gate #if defined(JALAPENO) || defined(SERRANO) 7557c478bd9Sstevel@tonic-gate #define JP_ECACHE_MAX_LSIZE CH_ECACHE_SUBBLK_SIZE 7567c478bd9Sstevel@tonic-gate #define JP_ECACHE_MAX_SIZE 0x400000 7577c478bd9Sstevel@tonic-gate #endif /* JALAPENO || SERRANO */ 7587c478bd9Sstevel@tonic-gate 7597c478bd9Sstevel@tonic-gate /* 7607c478bd9Sstevel@tonic-gate * Maximum ecache setsize to support page coloring of heterogenous 7617c478bd9Sstevel@tonic-gate * cheetah+ cpus. Max ecache setsize is calculated to be the max ecache size 7627c478bd9Sstevel@tonic-gate * divided by the minimum associativity of the max ecache. 7637c478bd9Sstevel@tonic-gate * 7647c478bd9Sstevel@tonic-gate * NOTE: CHP_ECACHE_MAX_SIZE and CHP_ECACHE_MIN_NWAY need to be updated with 7657c478bd9Sstevel@tonic-gate * new cheetah+ cpus. The maximum setsize may not necessarily be associated with 7667c478bd9Sstevel@tonic-gate * the max ecache size if the cache associativity is large. If so, MAX_SETSIZE 7677c478bd9Sstevel@tonic-gate * needs to be updated accordingly. 7687c478bd9Sstevel@tonic-gate */ 7697c478bd9Sstevel@tonic-gate #if defined(CHEETAH_PLUS) 7707c478bd9Sstevel@tonic-gate #define CHP_ECACHE_MIN_NWAY 1 /* direct-mapped */ 7717c478bd9Sstevel@tonic-gate #define CHP_ECACHE_MAX_SIZE CH_ECACHE_MAX_SIZE 7727c478bd9Sstevel@tonic-gate #define CHP_ECACHE_MAX_SETSIZE (CHP_ECACHE_MAX_SIZE / CHP_ECACHE_MIN_NWAY) 7737c478bd9Sstevel@tonic-gate #endif /* CHEETAH_PLUS */ 7747c478bd9Sstevel@tonic-gate 7757c478bd9Sstevel@tonic-gate /* 7767c478bd9Sstevel@tonic-gate * Bits to shift EC_tag field of E$ tag to form PA 7777c478bd9Sstevel@tonic-gate * (See Cheetah PRM 10.7.4, Cheetah+ Delta PRM 10.7) 7787c478bd9Sstevel@tonic-gate */ 7797c478bd9Sstevel@tonic-gate #if defined(JALAPENO) || defined(SERRANO) 7807c478bd9Sstevel@tonic-gate #define CH_ECTAG_PA_SHIFT 18 7817c478bd9Sstevel@tonic-gate #elif defined(CHEETAH_PLUS) 7827c478bd9Sstevel@tonic-gate #define CH_ECTAG_PA_SHIFT 2 7837c478bd9Sstevel@tonic-gate #else /* CHEETAH_PLUS */ 7847c478bd9Sstevel@tonic-gate #define CH_ECTAG_PA_SHIFT 1 7857c478bd9Sstevel@tonic-gate #endif /* CHEETAH_PLUS */ 7867c478bd9Sstevel@tonic-gate #define PN_L3TAG_PA_SHIFT 1 7877c478bd9Sstevel@tonic-gate #define PN_L3TAG_PA_MASK 0xfffff000000 /* tag bits[43:24] */ 7887c478bd9Sstevel@tonic-gate #define PN_L2TAG_PA_MASK 0x7fffff80000 /* tag bits[42:19] */ 7897c478bd9Sstevel@tonic-gate 7907c478bd9Sstevel@tonic-gate #if defined(JALAPENO) || defined(SERRANO) 7917c478bd9Sstevel@tonic-gate /* 7927c478bd9Sstevel@tonic-gate * Macros for Jalapeno L2 Cache Tag/State/Parity 7937c478bd9Sstevel@tonic-gate * 7947c478bd9Sstevel@tonic-gate * +-----------+--------+--------+----------------------+ 7957c478bd9Sstevel@tonic-gate * | - | EC_par |EC_state| EC_tag = PA[42:18] | 7967c478bd9Sstevel@tonic-gate * +-----------+--------+--------+----------------------+ 7977c478bd9Sstevel@tonic-gate * 63:29 28 27:25 24:0 7987c478bd9Sstevel@tonic-gate */ 7997c478bd9Sstevel@tonic-gate /* 8007c478bd9Sstevel@tonic-gate * Constants representing the complete Jalapeno Ecache tag state: 8017c478bd9Sstevel@tonic-gate */ 8027c478bd9Sstevel@tonic-gate #define JP_ECSTATE_SIZE 3 /* three bits */ 8037c478bd9Sstevel@tonic-gate #define JP_ECSTATE_MASK 0x7 /* three bit field */ 8047c478bd9Sstevel@tonic-gate #define JP_ECSTATE_INV 0x0 /* invalid */ 8057c478bd9Sstevel@tonic-gate #define JP_ECSTATE_SHR 0x1 /* shared */ 8067c478bd9Sstevel@tonic-gate #define JP_ECSTATE_RES1 0x2 /* reserved */ 8077c478bd9Sstevel@tonic-gate #define JP_ECSTATE_EXL 0x3 /* exclusive */ 8087c478bd9Sstevel@tonic-gate #define JP_ECSTATE_RES2 0x4 /* reserved */ 8097c478bd9Sstevel@tonic-gate #define JP_ECSTATE_OWN 0x5 /* owner */ 8107c478bd9Sstevel@tonic-gate #define JP_ECSTATE_MOD 0x7 /* modified */ 8117c478bd9Sstevel@tonic-gate #define JP_ECSTATE_RES3 0x6 /* reserved */ 8127c478bd9Sstevel@tonic-gate #define JP_ECTAG_STATE_SHIFT 25 8137c478bd9Sstevel@tonic-gate 8147c478bd9Sstevel@tonic-gate #define CH_ECSTATE_SIZE JP_ECSTATE_SIZE 8157c478bd9Sstevel@tonic-gate #define CH_ECSTATE_MASK JP_ECSTATE_MASK 8167c478bd9Sstevel@tonic-gate #define CH_ECSTATE_INV JP_ECSTATE_INV 8177c478bd9Sstevel@tonic-gate #define CH_ECSTATE_SHR JP_ECSTATE_SHR 8187c478bd9Sstevel@tonic-gate #define CH_ECSTATE_EXL JP_ECSTATE_EXL 8197c478bd9Sstevel@tonic-gate #define CH_ECSTATE_OWN JP_ECSTATE_OWN 8207c478bd9Sstevel@tonic-gate #define CH_ECSTATE_MOD JP_ECSTATE_MOD 8217c478bd9Sstevel@tonic-gate #define CH_ECSTATE_RES1 JP_ECSTATE_RES1 8227c478bd9Sstevel@tonic-gate #define CH_ECSTATE_OWS JP_ECSTATE_RES3 8237c478bd9Sstevel@tonic-gate #define CH_ECSTATE_RES2 JP_ECSTATE_RES2 8247c478bd9Sstevel@tonic-gate 8257c478bd9Sstevel@tonic-gate /* Number of subblock states per Ecache line. */ 8267c478bd9Sstevel@tonic-gate #define CH_ECTAG_NSUBBLKS(totalsize) 1 8277c478bd9Sstevel@tonic-gate 8287c478bd9Sstevel@tonic-gate /* Mask for Tag state(s) field, 3 bits per subblock state. */ 8297c478bd9Sstevel@tonic-gate #define CH_ECTAG_STATE_SHIFT(subblk) JP_ECTAG_STATE_SHIFT 8307c478bd9Sstevel@tonic-gate #define CH_ECTAG_STATE_MASK(totalsize) \ 8317c478bd9Sstevel@tonic-gate ((uint64_t)(JP_ECSTATE_MASK<<JP_ECTAG_STATE_SHIFT)) 8327c478bd9Sstevel@tonic-gate 8337c478bd9Sstevel@tonic-gate /* For a line to be invalid, all of its subblock states must be invalid. */ 8347c478bd9Sstevel@tonic-gate #define CH_ECTAG_LINE_INVALID(totalsize, tag) \ 8357c478bd9Sstevel@tonic-gate (((tag) & CH_ECTAG_STATE_MASK(totalsize)) == 0) 8367c478bd9Sstevel@tonic-gate 8377c478bd9Sstevel@tonic-gate /* Build address mask for tag physical address bits. */ 8387c478bd9Sstevel@tonic-gate #define CH_ECTAG_PA_MASK(setsize) P2ALIGN(C_AFAR_PA, (int)(setsize)) 8397c478bd9Sstevel@tonic-gate 8407c478bd9Sstevel@tonic-gate /* Get physical address bits from the EC_tag field of an E$ tag */ 8417c478bd9Sstevel@tonic-gate #define CH_ECTAG_TO_PA(setsize, tag) (((tag) << CH_ECTAG_PA_SHIFT) & \ 8427c478bd9Sstevel@tonic-gate CH_ECTAG_PA_MASK(setsize)) 8437c478bd9Sstevel@tonic-gate 8447c478bd9Sstevel@tonic-gate /* Given a physical address, compute index for subblock tag state. */ 8457c478bd9Sstevel@tonic-gate #define CH_ECTAG_PA_TO_SUBBLK(totalsize, pa) 1 8467c478bd9Sstevel@tonic-gate 8477c478bd9Sstevel@tonic-gate /* Given a physical address and assoc. tag, get the subblock state. */ 8487c478bd9Sstevel@tonic-gate #define CH_ECTAG_PA_TO_SUBBLK_STATE(totalsize, pa, tag) \ 8497c478bd9Sstevel@tonic-gate (((tag) >> JP_ECTAG_STATE_SHIFT) & JP_ECSTATE_MASK) 8507c478bd9Sstevel@tonic-gate 8517c478bd9Sstevel@tonic-gate #else /* JALAPENO || SERRANO */ 8527c478bd9Sstevel@tonic-gate 8537c478bd9Sstevel@tonic-gate /* 8547c478bd9Sstevel@tonic-gate * Constants representing the complete Cheetah Ecache tag state: 8557c478bd9Sstevel@tonic-gate */ 8567c478bd9Sstevel@tonic-gate #define CH_ECSTATE_SIZE 3 /* three bits per subblock */ 8577c478bd9Sstevel@tonic-gate #define CH_ECSTATE_MASK 0x7 /* three bit field */ 8587c478bd9Sstevel@tonic-gate #define CH_ECSTATE_INV 0x0 /* invalid */ 8597c478bd9Sstevel@tonic-gate #define CH_ECSTATE_SHR 0x1 /* shared */ 8607c478bd9Sstevel@tonic-gate #define CH_ECSTATE_EXL 0x2 /* exclusive */ 8617c478bd9Sstevel@tonic-gate #define CH_ECSTATE_OWN 0x3 /* owner */ 8627c478bd9Sstevel@tonic-gate #define CH_ECSTATE_MOD 0x4 /* modified */ 8637c478bd9Sstevel@tonic-gate #define CH_ECSTATE_RES1 0x5 /* reserved */ 8647c478bd9Sstevel@tonic-gate #define CH_ECSTATE_OWS 0x6 /* owner/shared */ 8657c478bd9Sstevel@tonic-gate #define CH_ECSTATE_RES2 0x7 /* reserved */ 8667c478bd9Sstevel@tonic-gate 8677c478bd9Sstevel@tonic-gate /* 8687c478bd9Sstevel@tonic-gate * Macros for Cheetah Ecache tags 8697c478bd9Sstevel@tonic-gate */ 8707c478bd9Sstevel@tonic-gate 8717c478bd9Sstevel@tonic-gate /* Number of subblock states per Ecache line. */ 8727c478bd9Sstevel@tonic-gate #define CH_ECTAG_NSUBBLKS(totalsize) ((totalsize) / CH_ECACHE_1M_SIZE) 8737c478bd9Sstevel@tonic-gate 8747c478bd9Sstevel@tonic-gate /* Mask for Tag state(s) field, 3 bits per subblock state. */ 8757c478bd9Sstevel@tonic-gate #define CH_ECTAG_STATE_SHIFT(subblk) (subblk * CH_ECSTATE_SIZE) 8767c478bd9Sstevel@tonic-gate #define CH_ECTAG_STATE_MASK(totalsize) \ 8777c478bd9Sstevel@tonic-gate ((uint64_t) \ 8787c478bd9Sstevel@tonic-gate ((1 << (CH_ECTAG_NSUBBLKS(totalsize) * CH_ECSTATE_SIZE)) - 1)) 8797c478bd9Sstevel@tonic-gate 8807c478bd9Sstevel@tonic-gate /* For a line to be invalid, all of its subblock states must be invalid. */ 8817c478bd9Sstevel@tonic-gate #define CH_ECTAG_LINE_INVALID(totalsize, tag) \ 8827c478bd9Sstevel@tonic-gate (((tag) & CH_ECTAG_STATE_MASK(totalsize)) == 0) 8837c478bd9Sstevel@tonic-gate 8847c478bd9Sstevel@tonic-gate /* Build address mask for tag physical address bits. */ 8857c478bd9Sstevel@tonic-gate #define CH_ECTAG_PA_MASK(setsize) P2ALIGN(C_AFAR_PA, (int)(setsize)) 8867c478bd9Sstevel@tonic-gate 8877c478bd9Sstevel@tonic-gate /* Get physical address bits from the EC_tag field of an E$ tag */ 8887c478bd9Sstevel@tonic-gate #define CH_ECTAG_TO_PA(setsize, tag) (((tag) >> CH_ECTAG_PA_SHIFT) & \ 8897c478bd9Sstevel@tonic-gate CH_ECTAG_PA_MASK(setsize)) 8907c478bd9Sstevel@tonic-gate 8917c478bd9Sstevel@tonic-gate /* Given a physical address, compute index for subblock tag state. */ 8927c478bd9Sstevel@tonic-gate #define CH_ECTAG_PA_TO_SUBBLK(totalsize, pa) \ 8937c478bd9Sstevel@tonic-gate (((pa) >> CH_ECACHE_SUBBLK_SHIFT) & (CH_ECTAG_NSUBBLKS(totalsize) - 1)) 8947c478bd9Sstevel@tonic-gate 8957c478bd9Sstevel@tonic-gate /* Given a physical address and assoc. tag, get the subblock state. */ 8967c478bd9Sstevel@tonic-gate #define CH_ECTAG_PA_TO_SUBBLK_STATE(totalsize, pa, tag) \ 8977c478bd9Sstevel@tonic-gate (((tag) >> \ 8987c478bd9Sstevel@tonic-gate (CH_ECTAG_PA_TO_SUBBLK(totalsize, pa) * CH_ECSTATE_SIZE)) & \ 8997c478bd9Sstevel@tonic-gate CH_ECSTATE_MASK) 9007c478bd9Sstevel@tonic-gate #endif /* JALAPENO || SERRANO */ 9017c478bd9Sstevel@tonic-gate 9027c478bd9Sstevel@tonic-gate /* Panther only has one EC_State field in the L3 tag */ 9037c478bd9Sstevel@tonic-gate #define PN_L3_LINE_INVALID(tag) (((tag) & CH_ECSTATE_MASK) == 0) 9047c478bd9Sstevel@tonic-gate 9057c478bd9Sstevel@tonic-gate /* Panther only has one State field in the L2 tag */ 9067c478bd9Sstevel@tonic-gate #define PN_L2_LINE_INVALID(tag) (((tag) & CH_ECSTATE_MASK) == 0) 9077c478bd9Sstevel@tonic-gate 9087c478bd9Sstevel@tonic-gate /* Get physical address bits from the EC_tag field of an L3$ tag */ 9097c478bd9Sstevel@tonic-gate #define PN_L3TAG_TO_PA(tag) (((tag) & PN_L3TAG_PA_MASK) >> \ 9107c478bd9Sstevel@tonic-gate PN_L3TAG_PA_SHIFT) 9117c478bd9Sstevel@tonic-gate 9127c478bd9Sstevel@tonic-gate /* Get physical address bits from the tag field of an L2$ tag */ 9137c478bd9Sstevel@tonic-gate #define PN_L2TAG_TO_PA(tag) ((tag) & PN_L2TAG_PA_MASK) 9147c478bd9Sstevel@tonic-gate 9157c478bd9Sstevel@tonic-gate #if defined(JALAPENO) || defined(SERRANO) 9167c478bd9Sstevel@tonic-gate /* 9177c478bd9Sstevel@tonic-gate * Jalapeno L2 Cache ASI_ECACHE_FLUSH: 9187c478bd9Sstevel@tonic-gate * +-------+-----------------+--------+---+-----+-------------+------+ 9197c478bd9Sstevel@tonic-gate * | - | Port_ID | - | EC_Way | 1 | - | EC_Tag_Addr | - | 9207c478bd9Sstevel@tonic-gate * +-------+-----------------+--------+---+-----+-------------+------+ 9217c478bd9Sstevel@tonic-gate * 63:41 40:36 35:34 33:32 31 30:18 17:6 5:0 9227c478bd9Sstevel@tonic-gate */ 9237c478bd9Sstevel@tonic-gate 9247c478bd9Sstevel@tonic-gate #define JP_EC_TO_SET_SIZE_SHIFT 2 9257c478bd9Sstevel@tonic-gate #define JP_ECACHE_IDX_DISP_FLUSH INT64_C(0x0000000080000000) 9267c478bd9Sstevel@tonic-gate #define JP_ECFLUSH_PORTID_SHIFT 36 9277c478bd9Sstevel@tonic-gate #define JP_ECFLUSH_EC_WAY_SHIFT 32 9287c478bd9Sstevel@tonic-gate #define JP_EC_TAG_DATA_WAY_SHIFT JP_ECFLUSH_EC_WAY_SHIFT 9297c478bd9Sstevel@tonic-gate #endif /* JALAPENO || SERRANO */ 9307c478bd9Sstevel@tonic-gate 9317c478bd9Sstevel@tonic-gate /* 9327c478bd9Sstevel@tonic-gate * Macros for Jaguar Ecache tags 9337c478bd9Sstevel@tonic-gate */ 9347c478bd9Sstevel@tonic-gate 9357c478bd9Sstevel@tonic-gate /* Ecache sizes */ 9367c478bd9Sstevel@tonic-gate #define JG_ECACHE_8M_SIZE 0x800000 9377c478bd9Sstevel@tonic-gate #define JG_ECACHE_4M_SIZE 0x400000 9387c478bd9Sstevel@tonic-gate 9397c478bd9Sstevel@tonic-gate /* Jaguar E$ tag LRU mask */ 9407c478bd9Sstevel@tonic-gate #define JG_LRU_MASK UINT64_C(0x0000040000000000) /* PA<42> LRU bit */ 9417c478bd9Sstevel@tonic-gate 9427c478bd9Sstevel@tonic-gate /* 9437c478bd9Sstevel@tonic-gate * Note that Jaguar and Cheetah/Cheetah+ have the same subblock state size 9447c478bd9Sstevel@tonic-gate * so rather than duplicating existing defn's we can use the Cheetah+ versions 9457c478bd9Sstevel@tonic-gate * in the Jaguar defn's below. 9467c478bd9Sstevel@tonic-gate */ 9477c478bd9Sstevel@tonic-gate /* Number of subblock states per Ecache line. */ 9487c478bd9Sstevel@tonic-gate #define JG_ECTAG_NSUBBLKS(cachesize) ((cachesize) / JG_ECACHE_4M_SIZE) 9497c478bd9Sstevel@tonic-gate 9507c478bd9Sstevel@tonic-gate /* Mask for Tag state(s) field, 3 bits per subblock state. */ 9517c478bd9Sstevel@tonic-gate #define JG_ECTAG_STATE_MASK(totalsize) \ 9527c478bd9Sstevel@tonic-gate ((uint64_t) \ 9537c478bd9Sstevel@tonic-gate ((1 << (JG_ECTAG_NSUBBLKS(totalsize) * CH_ECSTATE_SIZE)) - 1)) 9547c478bd9Sstevel@tonic-gate 9557c478bd9Sstevel@tonic-gate /* For a line to be invalid, all of its subblock states must be invalid. */ 9567c478bd9Sstevel@tonic-gate #define JG_ECTAG_LINE_INVALID(totalsize, tag) \ 9577c478bd9Sstevel@tonic-gate (((tag) & JG_ECTAG_STATE_MASK(totalsize)) == 0) 9587c478bd9Sstevel@tonic-gate 9597c478bd9Sstevel@tonic-gate /* Build address mask for tag physical address bits. */ 9607c478bd9Sstevel@tonic-gate #define JG_ECTAG_PA_MASK(setsize) P2ALIGN(((~JG_LRU_MASK) & C_AFAR_PA), \ 9617c478bd9Sstevel@tonic-gate (int)(setsize)) 9627c478bd9Sstevel@tonic-gate 9637c478bd9Sstevel@tonic-gate /* Get physical address bits from the EC_tag field of an E$ tag */ 9647c478bd9Sstevel@tonic-gate #define JG_ECTAG_TO_PA(setsize, tag) ((tag & JG_ECTAG_PA_MASK(setsize))) 9657c478bd9Sstevel@tonic-gate 9667c478bd9Sstevel@tonic-gate /* Given a physical address, compute index for subblock tag state. */ 9677c478bd9Sstevel@tonic-gate #define JG_ECTAG_PA_TO_SUBBLK(totalsize, pa) \ 9687c478bd9Sstevel@tonic-gate (((pa) >> CH_ECACHE_SUBBLK_SHIFT) & (JG_ECTAG_NSUBBLKS(totalsize) - 1)) 9697c478bd9Sstevel@tonic-gate 9707c478bd9Sstevel@tonic-gate /* Given a physical address and assoc. tag, get the subblock state. */ 9717c478bd9Sstevel@tonic-gate #define JG_ECTAG_PA_TO_SUBBLK_STATE(totalsize, pa, tag) \ 9727c478bd9Sstevel@tonic-gate (((tag) >> \ 9737c478bd9Sstevel@tonic-gate (JG_ECTAG_PA_TO_SUBBLK(totalsize, pa) * CH_ECSTATE_SIZE)) & \ 9747c478bd9Sstevel@tonic-gate CH_ECSTATE_MASK) 9757c478bd9Sstevel@tonic-gate 9767c478bd9Sstevel@tonic-gate 9777c478bd9Sstevel@tonic-gate #if defined(CHEETAH_PLUS) 9787c478bd9Sstevel@tonic-gate /* 9797c478bd9Sstevel@tonic-gate * Cheetah+ Tag ECC Bit and Displacement Flush Bit in Ecache Tag Access. 9807c478bd9Sstevel@tonic-gate * See Cheetah+ Delta PRM 10.7 9817c478bd9Sstevel@tonic-gate */ 9827c478bd9Sstevel@tonic-gate #define CHP_ECACHE_IDX_TAG_ECC INT64_C(0x0000000000800000) 9837c478bd9Sstevel@tonic-gate #define CHP_ECACHE_IDX_DISP_FLUSH INT64_C(0x0000000001000000) 9847c478bd9Sstevel@tonic-gate #define PN_L2_IDX_DISP_FLUSH INT64_C(0x0000000000800000) 9857c478bd9Sstevel@tonic-gate #define PN_L3_IDX_DISP_FLUSH INT64_C(0x0000000004000000) 9867c478bd9Sstevel@tonic-gate #endif /* CHEETAH_PLUS */ 9877c478bd9Sstevel@tonic-gate 9887c478bd9Sstevel@tonic-gate /* 9897c478bd9Sstevel@tonic-gate * Macros for Cheetah Dcache diagnostic accesses. 9907c478bd9Sstevel@tonic-gate */ 9917c478bd9Sstevel@tonic-gate 9927c478bd9Sstevel@tonic-gate /* 9937c478bd9Sstevel@tonic-gate * Dcache Index Mask for bits from *AFAR*. Note that Dcache is virtually 9947c478bd9Sstevel@tonic-gate * indexed, so only bits [12:5] are valid from the AFAR. This 9957c478bd9Sstevel@tonic-gate * means we have to search through the 4 ways + bit 13 (i.e. we have 9967c478bd9Sstevel@tonic-gate * to try 8 indexes). 9977c478bd9Sstevel@tonic-gate */ 9987c478bd9Sstevel@tonic-gate #define CH_DCACHE_IDX_MASK 0x01fe0 9997c478bd9Sstevel@tonic-gate #define CH_DCACHE_IDX_INCR 0x02000 10007c478bd9Sstevel@tonic-gate #define CH_DCACHE_IDX_LIMIT 0x10000 10017c478bd9Sstevel@tonic-gate #define CH_DCACHE_NWAY 4 10027c478bd9Sstevel@tonic-gate #define CH_DCACHE_WAY_MASK 0x0c000 10037c478bd9Sstevel@tonic-gate #define CH_DCACHE_WAY_SHIFT 14 10047c478bd9Sstevel@tonic-gate #define CH_DCIDX_TO_WAY(idx) (((idx) & CH_DCACHE_WAY_MASK) >> \ 10057c478bd9Sstevel@tonic-gate CH_DCACHE_WAY_SHIFT) 10067c478bd9Sstevel@tonic-gate #define CH_DCTAG_PA_MASK INT64_C(0x000007ffffffe000) 10077c478bd9Sstevel@tonic-gate #define CH_DCTAG_PA_SHIFT 12 10087c478bd9Sstevel@tonic-gate #define CH_DCTAG_VALID_BIT INT64_C(0x0000000000000001) 10097c478bd9Sstevel@tonic-gate #define CH_DCTAG_LINE_INVALID(tag) (((tag) & CH_DCTAG_VALID_BIT) == 0) 10107c478bd9Sstevel@tonic-gate #define CH_DCIDX_TO_ADDR(idx) ((idx) & CH_DCACHE_IDX_MASK) 10117c478bd9Sstevel@tonic-gate #define CH_DCTAG_TO_PA(tag) (((tag) << CH_DCTAG_PA_SHIFT) & \ 10127c478bd9Sstevel@tonic-gate CH_DCTAG_PA_MASK) 10137c478bd9Sstevel@tonic-gate #define CH_DCTAG_MATCH(tag, pa) (!CH_DCTAG_LINE_INVALID(tag) && \ 10147c478bd9Sstevel@tonic-gate ((pa) & CH_DCTAG_PA_MASK) == CH_DCTAG_TO_PA(tag)) 10157c478bd9Sstevel@tonic-gate #define CH_DCSNTAG_MASK INT64_C(0x000007ffffffe000) 10167c478bd9Sstevel@tonic-gate #define CH_DCSNTAG_TO_PA(tag) ((tag << CH_DCTAG_PA_SHIFT) \ 10177c478bd9Sstevel@tonic-gate & CH_DCSNTAG_MASK) 10187c478bd9Sstevel@tonic-gate #define CH_DCUTAG_TO_UTAG(tag) ((tag) & 0xff) 10197c478bd9Sstevel@tonic-gate #define CH_DCUTAG_TO_VA(tag) ((tag & 0xff) << 14) 10207c478bd9Sstevel@tonic-gate #define CH_DCUTAG_IDX_MASK 0x03fe0 10217c478bd9Sstevel@tonic-gate #define CH_DC_DATA_REG_SIZE 32 10227c478bd9Sstevel@tonic-gate #define CH_DC_UTAG_MASK 0xff 10237c478bd9Sstevel@tonic-gate #if defined(CHEETAH_PLUS) || defined(JALAPENO) || defined(SERRANO) 10247c478bd9Sstevel@tonic-gate #define CHP_DCTAG_PARMASK INT64_C(0x000000007ffffffe) 10257c478bd9Sstevel@tonic-gate #define CHP_DCSNTAG_PARMASK INT64_C(0x000000007ffffffe) 10267c478bd9Sstevel@tonic-gate #define CHP_DCTAG_MASK INT64_C(0x000003ffffffe000) 10277c478bd9Sstevel@tonic-gate #define CHP_DCSNTAG_MASK INT64_C(0x000003ffffffe000) 10287c478bd9Sstevel@tonic-gate #define CHP_DCWAY_MASK INT64_C(0x0000000000003fe0) 10297c478bd9Sstevel@tonic-gate #define CHP_DCUTAG_TO_UTAG(tag) ((tag) & 0xffff) 10307c478bd9Sstevel@tonic-gate #define CHP_DCPATAG_TO_PA(tag) ((tag << CH_DCTAG_PA_SHIFT) \ 10317c478bd9Sstevel@tonic-gate & CHP_DCTAG_MASK) 10327c478bd9Sstevel@tonic-gate #define CHP_DCSNTAG_TO_PA(tag) ((tag << CH_DCTAG_PA_SHIFT) \ 10337c478bd9Sstevel@tonic-gate & CHP_DCSNTAG_MASK) 10347c478bd9Sstevel@tonic-gate #define CHP_DC_IDX(dcp) ((dcp->dc_idx & 0x1fc0) >> 5) 10357c478bd9Sstevel@tonic-gate #define CHP_DCTAG_PARITY(tag) (tag & CHP_DC_TAG) 10367c478bd9Sstevel@tonic-gate #define CHP_DCSNTAG_PARITY(tag) (tag & CHP_DC_SNTAG) 10377c478bd9Sstevel@tonic-gate #define CHP_DC_TAG 0x1 10387c478bd9Sstevel@tonic-gate #define CHP_DC_SNTAG 0x2 10397c478bd9Sstevel@tonic-gate #define PN_DC_DATA_PARITY_SHIFT 8 10407c478bd9Sstevel@tonic-gate #define PN_DC_DATA_PARITY_MASK 0xff 10417c478bd9Sstevel@tonic-gate #define PN_DC_DATA_ALL_PARITY_MASK 0xffffffff 10427c478bd9Sstevel@tonic-gate #endif /* CHEETAH_PLUS || JALAPENO || SERRANO */ 10437c478bd9Sstevel@tonic-gate #define PN_DC_DATA_PARITY_BIT_SHIFT 16 10447c478bd9Sstevel@tonic-gate 10457c478bd9Sstevel@tonic-gate /* 10467c478bd9Sstevel@tonic-gate * Macros for Cheetah Icache diagnostic accesses. 10477c478bd9Sstevel@tonic-gate */ 10487c478bd9Sstevel@tonic-gate 10497c478bd9Sstevel@tonic-gate /* 10507c478bd9Sstevel@tonic-gate * Icache Index Mask for bits from *AFAR*. Note that the Icache is virtually 10517c478bd9Sstevel@tonic-gate * indexed for Panther and physically indexed for other CPUs. For Panther, 10527c478bd9Sstevel@tonic-gate * we obtain an index by looking at bits[12:6] of the AFAR PA and we check 10537c478bd9Sstevel@tonic-gate * both lines associated with bit 13 = 0 or 1 (total of 8 entries to check). 10547c478bd9Sstevel@tonic-gate * For non-Panther CPUs we get our index by just looking at bits[12:5] of 10557c478bd9Sstevel@tonic-gate * the AFAR PA (total of 4 entries to check). The Icache index is also 10567c478bd9Sstevel@tonic-gate * confusing because we need to shift the virtual address bits left by one 10577c478bd9Sstevel@tonic-gate * for the index. 10587c478bd9Sstevel@tonic-gate */ 10597c478bd9Sstevel@tonic-gate #define CH_ICACHE_IDX_MASK 0x01fe0 10607c478bd9Sstevel@tonic-gate #define PN_ICACHE_IDX_MASK 0x03fc0 10617c478bd9Sstevel@tonic-gate #define PN_ICACHE_VA_IDX_MASK 0x01fc0 10627c478bd9Sstevel@tonic-gate #define CH_ICACHE_IDX_SHIFT 1 10637c478bd9Sstevel@tonic-gate #define CH_ICACHE_IDX_INCR 0x04000 10647c478bd9Sstevel@tonic-gate #define PN_ICACHE_IDX_INCR 0x08000 10657c478bd9Sstevel@tonic-gate #define CH_ICACHE_IDX_LIMIT 0x10000 10667c478bd9Sstevel@tonic-gate #define PN_ICACHE_IDX_LIMIT 0x20000 10677c478bd9Sstevel@tonic-gate #define CH_ICACHE_NWAY 4 10687c478bd9Sstevel@tonic-gate #define CH_ICACHE_WAY_MASK 0x0c000 10697c478bd9Sstevel@tonic-gate #define CH_ICACHE_WAY_SHIFT 14 10707c478bd9Sstevel@tonic-gate #define PN_ICACHE_WAY_MASK 0x18000 10717c478bd9Sstevel@tonic-gate #define PN_ICACHE_WAY_SHIFT 15 10727c478bd9Sstevel@tonic-gate #define CH_ICTAG_PA 0x00 10737c478bd9Sstevel@tonic-gate #define CH_ICTAG_UTAG 0x08 10747c478bd9Sstevel@tonic-gate #define CH_ICTAG_UPPER 0x10 10757c478bd9Sstevel@tonic-gate #define CH_ICTAG_LOWER 0x30 10767c478bd9Sstevel@tonic-gate #define CH_ICTAG_TMASK 0x3f 10777c478bd9Sstevel@tonic-gate #define CH_ICPATAG_MASK INT64_C(0x000007ffffffe000) 10787c478bd9Sstevel@tonic-gate #define CH_ICPATAG_LBITS 0xff /* lower 8 bits undefined */ 10797c478bd9Sstevel@tonic-gate #define CH_ICPATAG_SHIFT 5 10807c478bd9Sstevel@tonic-gate #define CH_ICIDX_TO_WAY(idx) (((idx) & CH_ICACHE_WAY_MASK) >> \ 10817c478bd9Sstevel@tonic-gate CH_ICACHE_WAY_SHIFT) 10827c478bd9Sstevel@tonic-gate #define PN_ICIDX_TO_WAY(idx) (((idx) & PN_ICACHE_WAY_MASK) >> \ 10837c478bd9Sstevel@tonic-gate PN_ICACHE_WAY_SHIFT) 10847c478bd9Sstevel@tonic-gate #define CH_ICIDX_TO_ADDR(idx) (((idx) >> CH_ICACHE_IDX_SHIFT) & \ 10857c478bd9Sstevel@tonic-gate CH_ICACHE_IDX_MASK) 10867c478bd9Sstevel@tonic-gate #define PN_ICIDX_TO_ADDR(idx) (((idx) >> CH_ICACHE_IDX_SHIFT) & \ 10877c478bd9Sstevel@tonic-gate PN_ICACHE_IDX_MASK) 10887c478bd9Sstevel@tonic-gate #define CH_ICPATAG_TO_PA(tag) (((tag) << CH_ICPATAG_SHIFT) & \ 10897c478bd9Sstevel@tonic-gate CH_ICPATAG_MASK) 10907c478bd9Sstevel@tonic-gate #define CH_ICPATAG_MATCH(tag, pa) (CH_ICPATAG_TO_PA(tag) == \ 10917c478bd9Sstevel@tonic-gate ((pa) & CH_ICPATAG_MASK)) 10927c478bd9Sstevel@tonic-gate #define CH_ICUTAG_MASK INT64_C(0x00000000001fe000) 10937c478bd9Sstevel@tonic-gate #define CH_ICUTAG_TO_UTAG(tag) (((tag) >> 38) & 0xff) 10947c478bd9Sstevel@tonic-gate #define CH_ICUTAG_TO_VA(tag) (((tag) >> 25) & CH_ICUTAG_MASK) 10957c478bd9Sstevel@tonic-gate #define CH_ICSNTAG_MASK INT64_C(0x000007ffffffe000) 10967c478bd9Sstevel@tonic-gate #define CH_ICSNTAG_TO_PA(tag) (((tag) << 5) & CH_ICSNTAG_MASK) 10977c478bd9Sstevel@tonic-gate #define CH_ICLOWER_VALID INT64_C(0x0004000000000000) 10987c478bd9Sstevel@tonic-gate #define CH_ICUPPER_VALID INT64_C(0x0004000000000000) 10997c478bd9Sstevel@tonic-gate #define CH_ICLOWER_TO_VPRED(lower) (((lower) >> 46) & 0xf) 11007c478bd9Sstevel@tonic-gate #define CH_ICUPPER_TO_VPRED(upper) (((upper) >> 46) & 0xf) 11017c478bd9Sstevel@tonic-gate #if defined(CHEETAH_PLUS) 11027c478bd9Sstevel@tonic-gate #define CH_ICTAG_MATCH(icp, pa) (((icp->ic_lower | icp->ic_upper) & \ 11037c478bd9Sstevel@tonic-gate CH_ICLOWER_VALID) && \ 11047c478bd9Sstevel@tonic-gate CH_ICPATAG_MATCH(icp->ic_patag, pa)) 11057c478bd9Sstevel@tonic-gate #define PN_ICUTAG_TO_VA(tag) ((tag >> 24) & PN_ICUTAG_MASK) 11067c478bd9Sstevel@tonic-gate #else /* CHEETAH_PLUS */ 11077c478bd9Sstevel@tonic-gate #define CH_ICTAG_MATCH(icp, pa) ((icp->ic_lower & CH_ICLOWER_VALID) &&\ 11087c478bd9Sstevel@tonic-gate CH_ICPATAG_MATCH(icp->ic_patag, pa)) 11097c478bd9Sstevel@tonic-gate #define PN_ICUTAG_TO_VA(tag) 0 11107c478bd9Sstevel@tonic-gate #endif /* CHEETAH_PLUS */ 11117c478bd9Sstevel@tonic-gate 11127c478bd9Sstevel@tonic-gate #define CH_IC_DATA_REG_SIZE 64 11137c478bd9Sstevel@tonic-gate #define PN_IC_DATA_REG_SIZE 128 11147c478bd9Sstevel@tonic-gate #if defined(CHEETAH_PLUS) || defined(JALAPENO) || defined(SERRANO) 11157c478bd9Sstevel@tonic-gate #define CHP_IC_IDX(icp) ((icp->ic_idx & 0x3fc0) >> 6) 11167c478bd9Sstevel@tonic-gate #define PN_IC_IDX(icp) ((icp->ic_idx & 0x7f80) >> 7) 11177c478bd9Sstevel@tonic-gate #define CHP_ICPATAG_MASK INT64_C(0x000003ffffffe000) 11187c478bd9Sstevel@tonic-gate #define CHP_ICSNTAG_MASK INT64_C(0x000003ffffffe000) 11197c478bd9Sstevel@tonic-gate #define CHP_ICUTAG_MASK INT64_C(0x00000000001fe000) 11207c478bd9Sstevel@tonic-gate #define PN_ICUTAG_MASK INT64_C(0x00000000003fc000) 11217c478bd9Sstevel@tonic-gate #define CHP_ICWAY_MASK INT64_C(0x0000000000003fe0) 11227c478bd9Sstevel@tonic-gate #define CHP_ICPATAG_TO_PA(tag) ((tag << 5) & CHP_ICPATAG_MASK) 11237c478bd9Sstevel@tonic-gate #define CHP_ICSNTAG_TO_PA(tag) ((tag << 5) & CHP_ICSNTAG_MASK) 11247c478bd9Sstevel@tonic-gate #define CHP_ICUTAG_TO_VA(tag) ((tag >> 25) & CHP_ICUTAG_MASK) 11257c478bd9Sstevel@tonic-gate #define CHP_ICPATAG_PARMASK INT64_C(0x0000003fffffff00) 11267c478bd9Sstevel@tonic-gate #define CHP_ICSNTAG_PARMASK INT64_C(0x0000003fffffff00) 11277c478bd9Sstevel@tonic-gate 11287c478bd9Sstevel@tonic-gate /* 11297c478bd9Sstevel@tonic-gate * Cheetah+ Icache data parity masks, see Cheetah+ Delta PRM 7.3 11307c478bd9Sstevel@tonic-gate * PC-relative instructions have different bits protected by parity. 11317c478bd9Sstevel@tonic-gate * Predecode bit 7 is not parity protected and indicates if the instruction 11327c478bd9Sstevel@tonic-gate * is PC-relative or not. 11337c478bd9Sstevel@tonic-gate */ 11347c478bd9Sstevel@tonic-gate #define CH_ICDATA_PRED_ISPCREL INT64_C(0x0000008000000000) 11357c478bd9Sstevel@tonic-gate #define CHP_ICDATA_PCREL_PARMASK INT64_C(0x0000039ffffff800) 11367c478bd9Sstevel@tonic-gate #define CHP_ICDATA_NPCREL_PARMASK INT64_C(0x000003bfffffffff) 11377c478bd9Sstevel@tonic-gate #define PN_ICDATA_PARITY_BIT_MASK INT64_C(0x40000000000) 11387c478bd9Sstevel@tonic-gate #define CHP_ICTAG_PARITY(tag) (tag & CHP_IC_TAG) 11397c478bd9Sstevel@tonic-gate #define CHP_ICSNTAG_PARITY(tag) (tag & CHP_IC_SNTAG) 11407c478bd9Sstevel@tonic-gate #define CHP_IC_TAG 0x1 11417c478bd9Sstevel@tonic-gate #define CHP_IC_SNTAG 0x2 11427c478bd9Sstevel@tonic-gate #endif /* CHEETAH_PLUS || JALAPENO || SERRANO */ 11437c478bd9Sstevel@tonic-gate #if defined(CHEETAH_PLUS) 11447c478bd9Sstevel@tonic-gate #define PN_IPB_TAG_ADDR_LINESIZE 0x40 11457c478bd9Sstevel@tonic-gate #define PN_IPB_TAG_ADDR_MAX 0x3c0 11467c478bd9Sstevel@tonic-gate #endif /* CHEETAH_PLUS */ 11477c478bd9Sstevel@tonic-gate 11487c478bd9Sstevel@tonic-gate /* 11497c478bd9Sstevel@tonic-gate * Macros for Pcache diagnostic accesses. 11507c478bd9Sstevel@tonic-gate */ 11517c478bd9Sstevel@tonic-gate #define CH_PC_WAY_MASK 0x600 11527c478bd9Sstevel@tonic-gate #define CH_PC_WAY_SHIFT 9 11537c478bd9Sstevel@tonic-gate #define CH_PCIDX_TO_WAY(idx) (((idx) & CH_PC_WAY_MASK) >> \ 11547c478bd9Sstevel@tonic-gate CH_PC_WAY_SHIFT) 11557c478bd9Sstevel@tonic-gate #define CH_PC_DATA_REG_SIZE 64 11567c478bd9Sstevel@tonic-gate #define CH_PCACHE_NWAY 4 11577c478bd9Sstevel@tonic-gate #define PN_PC_PARITY_SHIFT 50 11587c478bd9Sstevel@tonic-gate #define PN_PC_PARITY_MASK 0xff 11597c478bd9Sstevel@tonic-gate #define PN_PC_PARITY_BITS(status) \ 11607c478bd9Sstevel@tonic-gate (((status) >> PN_PC_PARITY_SHIFT) & PN_PC_PARITY_MASK) 11617c478bd9Sstevel@tonic-gate #define CH_PC_IDX_ADR(pcp) ((pcp->pc_idx & 0x1c0) >> 6) 11627c478bd9Sstevel@tonic-gate #define CH_PCTAG_ADDR_SHIFT 6 11637c478bd9Sstevel@tonic-gate #define CH_PC_PA_MASK 0x7ffffffffc0 11647c478bd9Sstevel@tonic-gate #define CH_PCTAG_TO_VA(tag) ((tag) << CH_PCTAG_ADDR_SHIFT) 11657c478bd9Sstevel@tonic-gate #define CH_PCSTAG_TO_PA(tag) (((tag) << CH_PCTAG_ADDR_SHIFT) & \ 11667c478bd9Sstevel@tonic-gate CH_PC_PA_MASK) 11677c478bd9Sstevel@tonic-gate #define CH_PCTAG_BNK0_VALID_MASK 0x2000000000000000 11687c478bd9Sstevel@tonic-gate #define CH_PCTAG_BNK1_VALID_MASK 0x1000000000000000 11697c478bd9Sstevel@tonic-gate #define CH_PCTAG_BNK0_INVALID(tag) (((tag) & CH_PCTAG_BNK0_VALID_MASK) == \ 11707c478bd9Sstevel@tonic-gate 0) 11717c478bd9Sstevel@tonic-gate #define CH_PCTAG_BNK1_INVALID(tag) (((tag) & CH_PCTAG_BNK1_VALID_MASK) == \ 11727c478bd9Sstevel@tonic-gate 0) 11737c478bd9Sstevel@tonic-gate 11747c478bd9Sstevel@tonic-gate /* 11757c478bd9Sstevel@tonic-gate * CPU Log Out Structure parameters. 11767c478bd9Sstevel@tonic-gate * This structure is filled in by the Error Trap handlers and captures the 11777c478bd9Sstevel@tonic-gate * Ecache/Dcache/Icache line(s) associated with the AFAR. 11787c478bd9Sstevel@tonic-gate * For Cheetah Phase II, this structure is filled in at the TL=0 code. For 11797c478bd9Sstevel@tonic-gate * Cheetah Phase III, this will be filled in at the trap handlers. 11807c478bd9Sstevel@tonic-gate */ 11817c478bd9Sstevel@tonic-gate 11827c478bd9Sstevel@tonic-gate /* 11837c478bd9Sstevel@tonic-gate * We use this to mark the LOGOUT structure as invalid. Note that 11847c478bd9Sstevel@tonic-gate * this cannot be a valid AFAR, as AFAR bits outside of [41:5] should always 11857c478bd9Sstevel@tonic-gate * be zero. 11867c478bd9Sstevel@tonic-gate */ 11877c478bd9Sstevel@tonic-gate #define LOGOUT_INVALID_U32 0xecc1ecc1 11887c478bd9Sstevel@tonic-gate #define LOGOUT_INVALID_L32 0xecc1ecc1 11897c478bd9Sstevel@tonic-gate #define LOGOUT_INVALID UINT64_C(0xecc1ecc1ecc1ecc1) 11907c478bd9Sstevel@tonic-gate 11917c478bd9Sstevel@tonic-gate /* 11927c478bd9Sstevel@tonic-gate * Max number of TLs to support for Fast ECC or Cache Parity Errors 11937c478bd9Sstevel@tonic-gate * at TL>0. Traps are OK from TL=1-2, at TL>=3, we will Red Mode. 11947c478bd9Sstevel@tonic-gate */ 11957c478bd9Sstevel@tonic-gate #define CH_ERR_TL1_TLMAX 2 11967c478bd9Sstevel@tonic-gate 11977c478bd9Sstevel@tonic-gate /* 11987c478bd9Sstevel@tonic-gate * Software traps used by TL>0 handlers. 11997c478bd9Sstevel@tonic-gate */ 12007c478bd9Sstevel@tonic-gate #define SWTRAP_0 0 /* Used by Fast ECC */ 12017c478bd9Sstevel@tonic-gate #define SWTRAP_1 1 /* Used by Dcache Parity */ 12027c478bd9Sstevel@tonic-gate #define SWTRAP_2 2 /* Used by Icache Parity */ 12037c478bd9Sstevel@tonic-gate 12047c478bd9Sstevel@tonic-gate /* 12057c478bd9Sstevel@tonic-gate * Bit mask defines for various Cheetah Error conditions. 12067c478bd9Sstevel@tonic-gate */ 12077c478bd9Sstevel@tonic-gate #define CH_ERR_FECC 0x01 /* Data/Event is Fast ECC */ 12087c478bd9Sstevel@tonic-gate #define CH_ERR_IPE 0x02 /* Data/Event is Icache Parity Error */ 12097c478bd9Sstevel@tonic-gate #define CH_ERR_DPE 0x04 /* Data/Event is Dcache Parity Error */ 12107c478bd9Sstevel@tonic-gate #define CH_ERR_PANIC 0x08 /* Fatal error in TL>0 handler */ 12117c478bd9Sstevel@tonic-gate #define CH_ERR_TL 0x10 /* Error occured at TL>0 */ 12127c478bd9Sstevel@tonic-gate #define CH_ERR_ME_SHIFT 8 /* If multiple errors, shift left newest */ 12137c478bd9Sstevel@tonic-gate #define CH_ERR_ME_FLAGS(x) ((x) >> CH_ERR_ME_SHIFT) 12147c478bd9Sstevel@tonic-gate 12157c478bd9Sstevel@tonic-gate /* 12167c478bd9Sstevel@tonic-gate * Defines for Bit8 (CH_ERR_TSTATE_IC_ON) and Bit9 (CH_ERR_TSTATE_DC_ON) 12177c478bd9Sstevel@tonic-gate * in %tstate, which is used to remember D$/I$ state on Fast ECC handler 12187c478bd9Sstevel@tonic-gate * at TL>0. Note that DCU_IC=0x1, DCU_DC=0x2. 12197c478bd9Sstevel@tonic-gate */ 12207c478bd9Sstevel@tonic-gate #define CH_ERR_G2_TO_TSTATE_SHFT 10 12217c478bd9Sstevel@tonic-gate #define CH_ERR_DCU_TO_TSTATE_SHFT 8 12227c478bd9Sstevel@tonic-gate #define CH_ERR_TSTATE_IC_ON (DCU_IC << CH_ERR_DCU_TO_TSTATE_SHFT) 12237c478bd9Sstevel@tonic-gate #define CH_ERR_TSTATE_DC_ON (DCU_DC << CH_ERR_DCU_TO_TSTATE_SHFT) 12247c478bd9Sstevel@tonic-gate 12257c478bd9Sstevel@tonic-gate /* 12267c478bd9Sstevel@tonic-gate * Multiple offset TL>0 handler structure elements 12277c478bd9Sstevel@tonic-gate */ 12287c478bd9Sstevel@tonic-gate #define CH_ERR_TL1_DATA (CH_ERR_TL1_LOGOUT + CH_CLO_DATA) 12297c478bd9Sstevel@tonic-gate #define CH_ERR_TL1_SDW_DATA (CH_ERR_TL1_LOGOUT + CH_CLO_SDW_DATA) 12307c478bd9Sstevel@tonic-gate #define CH_ERR_TL1_NEST_CNT (CH_ERR_TL1_LOGOUT + CH_CLO_NEST_CNT) 1231*af3c157aSrscott #define CH_ERR_TL1_AFAR (CH_ERR_TL1_DATA + CH_CHD_AFAR) 12327c478bd9Sstevel@tonic-gate #define CH_ERR_TL1_AFSR (CH_ERR_TL1_DATA + CH_CHD_AFSR) 1233*af3c157aSrscott #define CH_ERR_TL1_SDW_AFAR (CH_ERR_TL1_SDW_DATA + CH_CHD_AFAR) 12347c478bd9Sstevel@tonic-gate #define CH_ERR_TL1_SDW_AFSR (CH_ERR_TL1_SDW_DATA + CH_CHD_AFSR) 12357c478bd9Sstevel@tonic-gate #define CH_ERR_TL1_SDW_AFSR_EXT (CH_ERR_TL1_SDW_DATA + CH_CHD_AFSR_EXT) 12367c478bd9Sstevel@tonic-gate 12377c478bd9Sstevel@tonic-gate /* 12387c478bd9Sstevel@tonic-gate * Interval for deferred CEEN reenable 12397c478bd9Sstevel@tonic-gate */ 12407c478bd9Sstevel@tonic-gate #define CPU_CEEN_DELAY_SECS 6 12417c478bd9Sstevel@tonic-gate 12427c478bd9Sstevel@tonic-gate /* 12437c478bd9Sstevel@tonic-gate * flags for flt_trapped_ce variable 12447c478bd9Sstevel@tonic-gate */ 12457c478bd9Sstevel@tonic-gate #define CE_CEEN_DEFER 0x1 /* no CEEN reenable in trap handler */ 12467c478bd9Sstevel@tonic-gate #define CE_CEEN_NODEFER 0x2 /* reenable CEEN in handler */ 12477c478bd9Sstevel@tonic-gate #define CE_CEEN_TIMEOUT 0x4 /* CE caught by timeout */ 12487c478bd9Sstevel@tonic-gate #define CE_CEEN_TRAPPED 0x8 /* CE caught by trap */ 12497c478bd9Sstevel@tonic-gate 12507c478bd9Sstevel@tonic-gate /* 12517c478bd9Sstevel@tonic-gate * default value for cpu_ce_not_deferred 12527c478bd9Sstevel@tonic-gate */ 12537c478bd9Sstevel@tonic-gate #if defined(JALAPENO) || defined(SERRANO) 12547c478bd9Sstevel@tonic-gate #define CPU_CE_NOT_DEFERRED (C_AFSR_CECC_ERRS & \ 12557c478bd9Sstevel@tonic-gate ~(C_AFSR_CE | C_AFSR_FRC | C_AFSR_RCE | C_AFSR_EMC)) 12567c478bd9Sstevel@tonic-gate #else /* JALAPENO || SERRANO */ 12577c478bd9Sstevel@tonic-gate #define CPU_CE_NOT_DEFERRED C_AFSR_CECC_ERRS & \ 12587c478bd9Sstevel@tonic-gate ~(C_AFSR_CE | C_AFSR_EMC) 12597c478bd9Sstevel@tonic-gate #endif /* JALAPENO || SERRANO */ 12607c478bd9Sstevel@tonic-gate 12617c478bd9Sstevel@tonic-gate #define CPU_CE_NOT_DEFERRED_EXT C_AFSR_EXT_CECC_ERRS 12627c478bd9Sstevel@tonic-gate 12637c478bd9Sstevel@tonic-gate #if defined(CHEETAH_PLUS) 12647c478bd9Sstevel@tonic-gate 12657c478bd9Sstevel@tonic-gate /* 12667c478bd9Sstevel@tonic-gate * VA for primary and shadow AFSR/AFAR/AFSR_EXT registers 12677c478bd9Sstevel@tonic-gate */ 12687c478bd9Sstevel@tonic-gate #define ASI_SHADOW_REG_VA 0x8 12697c478bd9Sstevel@tonic-gate #define ASI_AFSR_EXT_VA 0x10 12707c478bd9Sstevel@tonic-gate #define ASI_SHADOW_AFSR_EXT_VA 0x18 12717c478bd9Sstevel@tonic-gate 12727c478bd9Sstevel@tonic-gate /* 12737c478bd9Sstevel@tonic-gate * Bitmask for keeping track of core parking in ECC error handlers. 12747c478bd9Sstevel@tonic-gate * We share a register that also saves the DCUCR value so we use 12757c478bd9Sstevel@tonic-gate * one of the reserved bit positions of the DCUCR register to keep 12767c478bd9Sstevel@tonic-gate * track of whether or not we have parked our sibling core. 12777c478bd9Sstevel@tonic-gate */ 12787c478bd9Sstevel@tonic-gate #define PN_PARKED_OTHER_CORE 0x20 12797c478bd9Sstevel@tonic-gate #define PN_BOTH_CORES_RUNNING 0x3 12807c478bd9Sstevel@tonic-gate 12817c478bd9Sstevel@tonic-gate /* 12827c478bd9Sstevel@tonic-gate * Panther EMU Activity Status Register Bits. 12837c478bd9Sstevel@tonic-gate */ 12847c478bd9Sstevel@tonic-gate #define ASI_EMU_ACT_STATUS_VA 0x18 12857c478bd9Sstevel@tonic-gate #define MCU_ACT_STATUS INT64_C(0x0000000000000001) 12867c478bd9Sstevel@tonic-gate #define SIU_ACT_STATUS INT64_C(0x0000000000000002) 12877c478bd9Sstevel@tonic-gate #endif /* CHEETAH_PLUS */ 12887c478bd9Sstevel@tonic-gate 12897c478bd9Sstevel@tonic-gate #define ASI_CESR_ID_VA 0x40 /* ASI_CESRD_ID per-core registers */ 12907c478bd9Sstevel@tonic-gate 12917c478bd9Sstevel@tonic-gate #define ASR_DISPATCH_CONTROL %asr18 12927c478bd9Sstevel@tonic-gate #define ASR_DISPATCH_CONTROL_BPE 0x20 12937c478bd9Sstevel@tonic-gate 12947c478bd9Sstevel@tonic-gate /* 12957c478bd9Sstevel@tonic-gate * Max number of E$ sets logged in ch_diag_data structure 12967c478bd9Sstevel@tonic-gate */ 12977c478bd9Sstevel@tonic-gate #define CHD_EC_DATA_SETS 4 /* max 4 sets of E$ data */ 12987c478bd9Sstevel@tonic-gate 12997c478bd9Sstevel@tonic-gate /* 13007c478bd9Sstevel@tonic-gate * Definitions for Panther TLB parity handling. 13017c478bd9Sstevel@tonic-gate */ 13027c478bd9Sstevel@tonic-gate #define PN_ITLB_NWAYS 2 13037c478bd9Sstevel@tonic-gate #define PN_NUM_512_ITLBS 1 13047c478bd9Sstevel@tonic-gate #define PN_DTLB_NWAYS 2 13057c478bd9Sstevel@tonic-gate #define PN_NUM_512_DTLBS 2 13067c478bd9Sstevel@tonic-gate #define PN_SFSR_PARITY_SHIFT 12 13077c478bd9Sstevel@tonic-gate #define PN_ITLB_PGSZ_SHIFT 22 13087c478bd9Sstevel@tonic-gate #define PN_ITLB_PGSZ_MASK (7 << PN_ITLB_PGSZ_SHIFT) 13097c478bd9Sstevel@tonic-gate #define PN_DTLB_PGSZ0_SHIFT 16 13107c478bd9Sstevel@tonic-gate #define PN_DTLB_PGSZ0_MASK (7 << PN_DTLB_PGSZ0_SHIFT) 13117c478bd9Sstevel@tonic-gate #define PN_DTLB_PGSZ1_SHIFT 19 13127c478bd9Sstevel@tonic-gate #define PN_DTLB_PGSZ1_MASK (7 << PN_DTLB_PGSZ1_SHIFT) 13137c478bd9Sstevel@tonic-gate #define PN_DTLB_PGSZ_MASK (PN_DTLB_PGSZ1_MASK | PN_DTLB_PGSZ0_MASK) 13147c478bd9Sstevel@tonic-gate #define PN_DTLB_T512_0 (2 << 16) 13157c478bd9Sstevel@tonic-gate #define PN_DTLB_T512_1 (3 << 16) 13167c478bd9Sstevel@tonic-gate #define PN_TLO_INFO_IMMU_SHIFT 14 13177c478bd9Sstevel@tonic-gate #define PN_TLO_INFO_IMMU (1 << PN_TLO_INFO_IMMU_SHIFT) 13187c478bd9Sstevel@tonic-gate #define PN_TLO_INFO_TL1_SHIFT 13 13197c478bd9Sstevel@tonic-gate #define PN_TLO_INFO_TL1 (1 << PN_TLO_INFO_TL1_SHIFT) 13207c478bd9Sstevel@tonic-gate #define PN_ITLB_T512 (2 << 16) 13217c478bd9Sstevel@tonic-gate #define PN_TLB_ACC_IDX_SHIFT 3 13227c478bd9Sstevel@tonic-gate #define PN_TLB_ACC_WAY_BIT (1 << 11) 13237c478bd9Sstevel@tonic-gate #define PN_TLB_DIAGACC_OFFSET 0x40000 /* Diag Acc ASI VA offset */ 13247c478bd9Sstevel@tonic-gate /* 13257c478bd9Sstevel@tonic-gate * tag parity = XOR(Size[2:0],Global,VA[63:21],Context[12:0]) 13267c478bd9Sstevel@tonic-gate * which requires looking at both the tag and the data. 13277c478bd9Sstevel@tonic-gate */ 13287c478bd9Sstevel@tonic-gate #define PN_TLB_TAG_PARITY_TAG_MASK 0xffffffffffe01fff 13297c478bd9Sstevel@tonic-gate #define PN_TLB_TAG_PARITY_DATA_MASK 0x6001400000000001 13307c478bd9Sstevel@tonic-gate /* data parity = XOR(NFO,IE,PA[42:13],CP,CV,E,P,W) */ 13317c478bd9Sstevel@tonic-gate #define PN_TLB_DATA_PARITY_DATA_MASK 0x180087ffffffe03e 13327c478bd9Sstevel@tonic-gate 13337c478bd9Sstevel@tonic-gate #ifdef _KERNEL 13347c478bd9Sstevel@tonic-gate 13357c478bd9Sstevel@tonic-gate #ifndef _ASM 13367c478bd9Sstevel@tonic-gate 13377c478bd9Sstevel@tonic-gate #include <sys/kstat.h> 13387c478bd9Sstevel@tonic-gate 13397c478bd9Sstevel@tonic-gate /* 13407c478bd9Sstevel@tonic-gate * One Ecache data element, 32 bytes of data, 8 bytes of ECC. 13417c478bd9Sstevel@tonic-gate * See Cheetah PRM 10.7.2. 13427c478bd9Sstevel@tonic-gate */ 13437c478bd9Sstevel@tonic-gate typedef struct ec_data_elm { 13447c478bd9Sstevel@tonic-gate uint64_t ec_d8[CH_ECACHE_STGREG_NUM]; 13457c478bd9Sstevel@tonic-gate uint64_t ec_eccd; /* EC_data_ECC field */ 13467c478bd9Sstevel@tonic-gate } ec_data_elm_t; 13477c478bd9Sstevel@tonic-gate 13487c478bd9Sstevel@tonic-gate /* 13497c478bd9Sstevel@tonic-gate * L2 and L3 cache data captured by cpu log out code. 13507c478bd9Sstevel@tonic-gate * See Cheetah PRM 10.7.4. 13517c478bd9Sstevel@tonic-gate */ 13527c478bd9Sstevel@tonic-gate typedef struct ch_ec_data { 13537c478bd9Sstevel@tonic-gate uint64_t ec_logflag; /* Flag indicates if data was logged */ 13547c478bd9Sstevel@tonic-gate uint64_t ec_idx; /* Ecache index */ 13557c478bd9Sstevel@tonic-gate uint64_t ec_way; /* Ecache way */ 13567c478bd9Sstevel@tonic-gate uint64_t ec_tag; /* Ecache Tag */ 13577c478bd9Sstevel@tonic-gate uint64_t ec_tag_ecc; /* Ecache Tag ECC (Cheetah+ only) */ 13587c478bd9Sstevel@tonic-gate ec_data_elm_t ec_data[CH_ECACHE_SUBBLK_SIZE/CH_ECACHE_STGREG_SIZE]; 13597c478bd9Sstevel@tonic-gate } ch_ec_data_t; 13607c478bd9Sstevel@tonic-gate 13617c478bd9Sstevel@tonic-gate /* 13627c478bd9Sstevel@tonic-gate * Dcache data captured by cpu log out code and get_dcache_dtag. 13637c478bd9Sstevel@tonic-gate * See Cheetah PRM 10.6.[1-4]. 13647c478bd9Sstevel@tonic-gate */ 13657c478bd9Sstevel@tonic-gate typedef struct ch_dc_data { 13667c478bd9Sstevel@tonic-gate uint64_t dc_logflag; /* Flag indicates if data was logged */ 13677c478bd9Sstevel@tonic-gate uint64_t dc_idx; /* Dcache index */ 13687c478bd9Sstevel@tonic-gate uint64_t dc_way; /* Dcache way */ 13697c478bd9Sstevel@tonic-gate uint64_t dc_tag; /* Tag/Valid Fields */ 13707c478bd9Sstevel@tonic-gate uint64_t dc_utag; /* Microtag */ 13717c478bd9Sstevel@tonic-gate uint64_t dc_sntag; /* Snoop Tag */ 13727c478bd9Sstevel@tonic-gate uint64_t dc_data[CH_DC_DATA_REG_SIZE/sizeof (uint64_t)]; /* Data */ 13737c478bd9Sstevel@tonic-gate uint64_t dc_pn_data_parity; /* Data parity bits for Panther */ 13747c478bd9Sstevel@tonic-gate } ch_dc_data_t; 13757c478bd9Sstevel@tonic-gate 13767c478bd9Sstevel@tonic-gate /* 13777c478bd9Sstevel@tonic-gate * Icache data captured by cpu log out code and get_icache_dtag. 13787c478bd9Sstevel@tonic-gate * See Cheetah PRM 10.4.[1-3]. 13797c478bd9Sstevel@tonic-gate */ 13807c478bd9Sstevel@tonic-gate typedef struct ch_ic_data { 13817c478bd9Sstevel@tonic-gate uint64_t ic_logflag; /* Flag indicates if data was logged */ 13827c478bd9Sstevel@tonic-gate uint64_t ic_idx; /* Icache index */ 13837c478bd9Sstevel@tonic-gate uint64_t ic_way; /* Icache way */ 13847c478bd9Sstevel@tonic-gate uint64_t ic_patag; /* Physical address tag */ 13857c478bd9Sstevel@tonic-gate uint64_t ic_utag; /* Microtag */ 13867c478bd9Sstevel@tonic-gate uint64_t ic_upper; /* Upper valid/predict tag */ 13877c478bd9Sstevel@tonic-gate uint64_t ic_lower; /* Lower valid/predict tag */ 13887c478bd9Sstevel@tonic-gate uint64_t ic_sntag; /* Snoop Tag */ 13897c478bd9Sstevel@tonic-gate uint64_t ic_data[PN_IC_DATA_REG_SIZE/sizeof (uint64_t)]; /* Data */ 13907c478bd9Sstevel@tonic-gate } ch_ic_data_t; 13917c478bd9Sstevel@tonic-gate 13927c478bd9Sstevel@tonic-gate /* 13937c478bd9Sstevel@tonic-gate * Pcache data captured by get_pcache_dtag 13947c478bd9Sstevel@tonic-gate */ 13957c478bd9Sstevel@tonic-gate typedef struct ch_pc_data { 13967c478bd9Sstevel@tonic-gate uint64_t pc_logflag; /* Flag indicates if data was logged */ 13977c478bd9Sstevel@tonic-gate uint64_t pc_idx; /* Pcache index */ 13987c478bd9Sstevel@tonic-gate uint64_t pc_way; /* Pcache way */ 13997c478bd9Sstevel@tonic-gate uint64_t pc_status; /* Pcache status data */ 14007c478bd9Sstevel@tonic-gate uint64_t pc_tag; /* Tag/Valid Fields */ 14017c478bd9Sstevel@tonic-gate uint64_t pc_sntag; /* Snoop Tag */ 14027c478bd9Sstevel@tonic-gate uint64_t pc_data[CH_PC_DATA_REG_SIZE/sizeof (uint64_t)]; /* Data */ 14037c478bd9Sstevel@tonic-gate } ch_pc_data_t; 14047c478bd9Sstevel@tonic-gate 14057c478bd9Sstevel@tonic-gate /* 14067c478bd9Sstevel@tonic-gate * CPU Error State 14077c478bd9Sstevel@tonic-gate */ 14087c478bd9Sstevel@tonic-gate typedef struct ch_cpu_errors { 14097c478bd9Sstevel@tonic-gate uint64_t afsr; /* AFSR */ 14107c478bd9Sstevel@tonic-gate uint64_t afar; /* AFAR */ 14117c478bd9Sstevel@tonic-gate /* 14127c478bd9Sstevel@tonic-gate * The following registers don't exist on cheetah 14137c478bd9Sstevel@tonic-gate */ 14147c478bd9Sstevel@tonic-gate uint64_t shadow_afsr; /* Shadow AFSR */ 14157c478bd9Sstevel@tonic-gate uint64_t shadow_afar; /* Shadow AFAR */ 14167c478bd9Sstevel@tonic-gate uint64_t afsr_ext; /* AFSR1_EXT */ 14177c478bd9Sstevel@tonic-gate uint64_t shadow_afsr_ext; /* AFSR2_EXT */ 14187c478bd9Sstevel@tonic-gate uint64_t afar2; /* AFAR2 - Serrano only */ 14197c478bd9Sstevel@tonic-gate } ch_cpu_errors_t; 14207c478bd9Sstevel@tonic-gate 14217c478bd9Sstevel@tonic-gate /* 14227c478bd9Sstevel@tonic-gate * CPU logout structures. 14237c478bd9Sstevel@tonic-gate * NOTE: These structures should be the same for Cheetah, Cheetah+, 14247c478bd9Sstevel@tonic-gate * Jaguar, Panther, and Jalapeno since the assembler code relies 14257c478bd9Sstevel@tonic-gate * on one set of offsets. Panther is the only processor that 14267c478bd9Sstevel@tonic-gate * uses the chd_l2_data field since it has both L3 and L2 caches. 14277c478bd9Sstevel@tonic-gate */ 14287c478bd9Sstevel@tonic-gate typedef struct ch_diag_data { 14297c478bd9Sstevel@tonic-gate uint64_t chd_afar; /* AFAR */ 14307c478bd9Sstevel@tonic-gate uint64_t chd_afsr; /* AFSR */ 14317c478bd9Sstevel@tonic-gate uint64_t chd_afsr_ext; /* AFSR_EXT */ 14327c478bd9Sstevel@tonic-gate uint64_t chd_afar2; /* AFAR2 - Serrano only */ 14337c478bd9Sstevel@tonic-gate ch_ec_data_t chd_ec_data[CHD_EC_DATA_SETS]; /* Ecache data */ 14347c478bd9Sstevel@tonic-gate ch_ec_data_t chd_l2_data[PN_L2_NWAYS]; /* L2 cache data */ 14357c478bd9Sstevel@tonic-gate ch_dc_data_t chd_dc_data; /* Dcache data */ 14367c478bd9Sstevel@tonic-gate ch_ic_data_t chd_ic_data; /* Icache data */ 14377c478bd9Sstevel@tonic-gate } ch_diag_data_t; 14387c478bd9Sstevel@tonic-gate 14397c478bd9Sstevel@tonic-gate 14407c478bd9Sstevel@tonic-gate /* 14417c478bd9Sstevel@tonic-gate * Top level CPU logout structure. 14427c478bd9Sstevel@tonic-gate * clo_flags is used to hold information such as trap type, trap level, 14437c478bd9Sstevel@tonic-gate * CEEN value, etc that is needed by the individual trap handlers. Not 14447c478bd9Sstevel@tonic-gate * all fields in this flag are used by all trap handlers but when they 14457c478bd9Sstevel@tonic-gate * are used, here's how they are laid out: 14467c478bd9Sstevel@tonic-gate * 14477c478bd9Sstevel@tonic-gate * |-------------------------------------------------------| 14487c478bd9Sstevel@tonic-gate * | | trap type | trap level | |UCEEN| |NCEEN|CEEN| 14497c478bd9Sstevel@tonic-gate * |-------------------------------------------------------| 14507c478bd9Sstevel@tonic-gate * 63 19 12 11 8 3 2 1 0 14517c478bd9Sstevel@tonic-gate * 14527c478bd9Sstevel@tonic-gate * Note that the *CEEN bits correspond exactly to the same bit positions 14537c478bd9Sstevel@tonic-gate * that are used in the error enable register. 14547c478bd9Sstevel@tonic-gate */ 14557c478bd9Sstevel@tonic-gate typedef struct ch_cpu_logout { 14567c478bd9Sstevel@tonic-gate uint64_t clo_flags; /* Information about this trap */ 14577c478bd9Sstevel@tonic-gate uint64_t clo_nest_cnt; /* To force an upper bound */ 14587c478bd9Sstevel@tonic-gate ch_diag_data_t clo_data; /* Diag data for primary AFAR */ 14597c478bd9Sstevel@tonic-gate ch_diag_data_t clo_sdw_data; /* Diag data for shadow AFAR */ 14607c478bd9Sstevel@tonic-gate } ch_cpu_logout_t; 14617c478bd9Sstevel@tonic-gate 14627c478bd9Sstevel@tonic-gate typedef struct ch_tte_entry { 14637c478bd9Sstevel@tonic-gate uint64_t ch_tte_tag; 14647c478bd9Sstevel@tonic-gate uint64_t ch_tte_data; 14657c478bd9Sstevel@tonic-gate } ch_tte_entry_t; 14667c478bd9Sstevel@tonic-gate 14677c478bd9Sstevel@tonic-gate /* 14687c478bd9Sstevel@tonic-gate * Top level CPU logout structure for TLB parity errors. 14697c478bd9Sstevel@tonic-gate * 14707c478bd9Sstevel@tonic-gate * tlo_logflag - Flag indicates if data was logged 14717c478bd9Sstevel@tonic-gate * tlo_info - Used to keep track of a number of values: 14727c478bd9Sstevel@tonic-gate * itlb pgsz - Page size of the VA whose lookup in the ITLB caused 14737c478bd9Sstevel@tonic-gate * the exception (from ASI_IMMU_TAG_ACCESS_EXT.) 14747c478bd9Sstevel@tonic-gate * dtlb pgsz1 - Page size of the VA whose lookup in the DTLB T512_1 14757c478bd9Sstevel@tonic-gate * caused the exception (from ASI_DMMU_TAG_ACCESS_EXT.). 14767c478bd9Sstevel@tonic-gate * dtlb pgsz0 - Page size of the VA whose lookup in the DTLB T512_0 14777c478bd9Sstevel@tonic-gate * caused the exception (from ASI_DMMU_TAG_ACCESS_EXT.). 14787c478bd9Sstevel@tonic-gate * immu - Trap is the result of an ITLB exception if immu == 1. 14797c478bd9Sstevel@tonic-gate * Otherwise, for DTLB exceptions immu == 0. 14807c478bd9Sstevel@tonic-gate * tl1 - Set to 1 if the exception occured at TL>0. 14817c478bd9Sstevel@tonic-gate * context - Context of the VA whose lookup in the TLB caused the 14827c478bd9Sstevel@tonic-gate * exception (from ASI_[I|D]MMU_TAG_ACCESS.) 14837c478bd9Sstevel@tonic-gate * |---------------------------------------------------------------------| 14847c478bd9Sstevel@tonic-gate * |...| itlb pgsz | dtlb pgsz1 | dtlb pgsz0 |...| immu | tl1 | context | 14857c478bd9Sstevel@tonic-gate * |---------------------------------------------------------------------| 14867c478bd9Sstevel@tonic-gate * 24 22 21 19 18 16 14 13 12 0 14877c478bd9Sstevel@tonic-gate * 14887c478bd9Sstevel@tonic-gate * tlo_addr - VA that cause the MMU exception trap. 14897c478bd9Sstevel@tonic-gate * tlo_pc - PC where the exception occured. 14907c478bd9Sstevel@tonic-gate * tlo_itlb_tte - TTEs that were in the ITLB after the trap at the index 14917c478bd9Sstevel@tonic-gate * specific to the VA and page size in question. 14927c478bd9Sstevel@tonic-gate * tlo_dtlb_tte - TTEs that were in the DTLB after the trap at the index 14937c478bd9Sstevel@tonic-gate * specific to the VA and page size in question. 14947c478bd9Sstevel@tonic-gate */ 14957c478bd9Sstevel@tonic-gate typedef struct pn_tlb_logout { 14967c478bd9Sstevel@tonic-gate uint64_t tlo_logflag; 14977c478bd9Sstevel@tonic-gate uint64_t tlo_info; 14987c478bd9Sstevel@tonic-gate uint64_t tlo_addr; 14997c478bd9Sstevel@tonic-gate uint64_t tlo_pc; 15007c478bd9Sstevel@tonic-gate ch_tte_entry_t tlo_itlb_tte[PN_ITLB_NWAYS * PN_NUM_512_ITLBS]; 15017c478bd9Sstevel@tonic-gate ch_tte_entry_t tlo_dtlb_tte[PN_DTLB_NWAYS * PN_NUM_512_DTLBS]; 15027c478bd9Sstevel@tonic-gate } pn_tlb_logout_t; 15037c478bd9Sstevel@tonic-gate 15047c478bd9Sstevel@tonic-gate #if defined(CPU_IMP_L1_CACHE_PARITY) 15057c478bd9Sstevel@tonic-gate /* 15067c478bd9Sstevel@tonic-gate * Parity error logging structure. 15077c478bd9Sstevel@tonic-gate */ 15087c478bd9Sstevel@tonic-gate typedef union ch_l1_parity_log { 15097c478bd9Sstevel@tonic-gate struct { 15107c478bd9Sstevel@tonic-gate int cpl_way; /* Faulty line way */ 15117c478bd9Sstevel@tonic-gate int cpl_off; /* Faulty line offset */ 15127c478bd9Sstevel@tonic-gate int cpl_tag; /* Faulty tags list */ 15137c478bd9Sstevel@tonic-gate int cpl_lcnt; /* Faulty cache lines */ 15147c478bd9Sstevel@tonic-gate ch_dc_data_t cpl_dc[CH_DCACHE_NWAY]; /* D$ data nWays */ 15157c478bd9Sstevel@tonic-gate ch_pc_data_t cpl_pc[CH_PCACHE_NWAY]; /* P$ data nWays */ 15167c478bd9Sstevel@tonic-gate int cpl_cache; /* error in D$ or P$? */ 15177c478bd9Sstevel@tonic-gate } dpe; /* D$ parity error */ 15187c478bd9Sstevel@tonic-gate struct { 15197c478bd9Sstevel@tonic-gate int cpl_way; /* Faulty line way */ 15207c478bd9Sstevel@tonic-gate int cpl_off; /* Faulty line offset */ 15217c478bd9Sstevel@tonic-gate int cpl_tag; /* Faulty tags list */ 15227c478bd9Sstevel@tonic-gate int cpl_lcnt; /* Faulty cache lines */ 15237c478bd9Sstevel@tonic-gate ch_ic_data_t cpl_ic[CH_ICACHE_NWAY]; /* I$ data nWays */ 15247c478bd9Sstevel@tonic-gate } ipe; /* I$ parity error */ 15257c478bd9Sstevel@tonic-gate } ch_l1_parity_log_t; 15267c478bd9Sstevel@tonic-gate 15277c478bd9Sstevel@tonic-gate #endif /* CPU_IMP_L1_CACHE_PARITY */ 15287c478bd9Sstevel@tonic-gate 15297c478bd9Sstevel@tonic-gate /* 15307c478bd9Sstevel@tonic-gate * Error at TL>0 CPU logout data. 15317c478bd9Sstevel@tonic-gate * Needs some extra space to save %g registers and miscellaneous info. 15327c478bd9Sstevel@tonic-gate */ 15337c478bd9Sstevel@tonic-gate typedef struct ch_err_tl1_data { 15347c478bd9Sstevel@tonic-gate uint64_t ch_err_tl1_g1; /* Saved %g1 */ 15357c478bd9Sstevel@tonic-gate uint64_t ch_err_tl1_g2; /* Saved %g2 */ 15367c478bd9Sstevel@tonic-gate uint64_t ch_err_tl1_g3; /* Saved %g3 */ 15377c478bd9Sstevel@tonic-gate uint64_t ch_err_tl1_g4; /* Saved %g4 */ 15387c478bd9Sstevel@tonic-gate uint64_t ch_err_tl1_g5; /* Saved %g5 */ 15397c478bd9Sstevel@tonic-gate uint64_t ch_err_tl1_g6; /* Saved %g6 */ 15407c478bd9Sstevel@tonic-gate uint64_t ch_err_tl1_g7; /* Saved %g7 */ 15417c478bd9Sstevel@tonic-gate uint64_t ch_err_tl1_tpc; /* Trap PC */ 15427c478bd9Sstevel@tonic-gate uint64_t ch_err_tl1_flags; /* miscellaneous flags */ 15437c478bd9Sstevel@tonic-gate uint64_t ch_err_tl1_tmp; /* some handlers may use as tmp */ 15447c478bd9Sstevel@tonic-gate ch_cpu_logout_t ch_err_tl1_logout; /* logout */ 15457c478bd9Sstevel@tonic-gate } ch_err_tl1_data_t; 15467c478bd9Sstevel@tonic-gate 15477c478bd9Sstevel@tonic-gate /* Indices into chsm_outstanding and friends */ 15487c478bd9Sstevel@tonic-gate #define CACHE_SCRUBBER_INFO_E 0 15497c478bd9Sstevel@tonic-gate #define CACHE_SCRUBBER_INFO_D 1 15507c478bd9Sstevel@tonic-gate #define CACHE_SCRUBBER_INFO_I 2 15517c478bd9Sstevel@tonic-gate 15527c478bd9Sstevel@tonic-gate /* We define 3 scrubbers: E$, D$, and I$ */ 15537c478bd9Sstevel@tonic-gate #define CACHE_SCRUBBER_COUNT 3 15547c478bd9Sstevel@tonic-gate 15557c478bd9Sstevel@tonic-gate /* 15567c478bd9Sstevel@tonic-gate * The ch_scrub_misc structure contains miscellaneous bookkeeping 15577c478bd9Sstevel@tonic-gate * items for scrubbing the I$, D$, and E$. 15587c478bd9Sstevel@tonic-gate * 15597c478bd9Sstevel@tonic-gate * For a description of the use of chsm_core_state and why it's not needed 15607c478bd9Sstevel@tonic-gate * on Jaguar, see the comment above cpu_scrub_cpu_setup() in us3_cheetahplus.c. 15617c478bd9Sstevel@tonic-gate */ 15627c478bd9Sstevel@tonic-gate typedef struct ch_scrub_misc { 15637c478bd9Sstevel@tonic-gate uint32_t chsm_outstanding[CACHE_SCRUBBER_COUNT]; 15647c478bd9Sstevel@tonic-gate /* outstanding requests */ 15657c478bd9Sstevel@tonic-gate int chsm_flush_index[CACHE_SCRUBBER_COUNT]; 15667c478bd9Sstevel@tonic-gate /* next line to flush */ 15677c478bd9Sstevel@tonic-gate int chsm_enable[CACHE_SCRUBBER_COUNT]; 15687c478bd9Sstevel@tonic-gate /* is this scrubber enabled on this core? */ 15697c478bd9Sstevel@tonic-gate int chsm_ecache_nlines; /* no. of E$ lines */ 15707c478bd9Sstevel@tonic-gate int chsm_ecache_busy; /* keeps track if cpu busy */ 15717c478bd9Sstevel@tonic-gate int chsm_icache_nlines; /* no. of I$ lines */ 15727c478bd9Sstevel@tonic-gate int chsm_core_state; /* which core the scrubber is */ 15737c478bd9Sstevel@tonic-gate /* running on (Panther only) */ 15747c478bd9Sstevel@tonic-gate } ch_scrub_misc_t; 15757c478bd9Sstevel@tonic-gate 15767c478bd9Sstevel@tonic-gate /* 15777c478bd9Sstevel@tonic-gate * Cheetah module private data structure. One of these is allocated for 15787c478bd9Sstevel@tonic-gate * each valid cpu at setup time and is pointed to by the machcpu 15797c478bd9Sstevel@tonic-gate * "cpu_private" pointer. For Cheetah, we have the miscellaneous scrubber 15807c478bd9Sstevel@tonic-gate * variables and cpu log out structures for Fast ECC traps at TL=0, 15817c478bd9Sstevel@tonic-gate * Disrupting (correctable) traps and Deferred (asynchronous) traps. For 15827c478bd9Sstevel@tonic-gate * Disrupting traps only one log out structure is needed because we cannot 15837c478bd9Sstevel@tonic-gate * get a TL>0 disrupting trap since it obeys IE. For Deferred traps we 15847c478bd9Sstevel@tonic-gate * cannot get a TL>0 because we turn off NCEEN during log out capture. E$ 15857c478bd9Sstevel@tonic-gate * set size (E$ size / nways) is saved here to avoid repeated calculations. 15867c478bd9Sstevel@tonic-gate * NB: The ch_err_tl1_data_t structures cannot cross a page boundary 15877c478bd9Sstevel@tonic-gate * because we use physical addresses to access them. We ensure this 15887c478bd9Sstevel@tonic-gate * by allocating them near the front of cheetah_private_t, which is 15897c478bd9Sstevel@tonic-gate * aligned on PAGESIZE (8192) via kmem_cache_create, and by ASSERTing 15907c478bd9Sstevel@tonic-gate * sizeof (chpr_tl1_err_data) <= CH_ECACHE_MAX_LSIZE in the 15917c478bd9Sstevel@tonic-gate * cpu_init_private routines. 15927c478bd9Sstevel@tonic-gate * NB: chpr_icache_size and chpr_icache_linesize need to be at the front 15937c478bd9Sstevel@tonic-gate * of cheetah_private_t because putting them after chpr_tl1_err_data 15947c478bd9Sstevel@tonic-gate * would make their offsets > 4195. 15957c478bd9Sstevel@tonic-gate */ 15967c478bd9Sstevel@tonic-gate typedef struct cheetah_private { 15977c478bd9Sstevel@tonic-gate int chpr_icache_size; 15987c478bd9Sstevel@tonic-gate int chpr_icache_linesize; 15997c478bd9Sstevel@tonic-gate ch_err_tl1_data_t chpr_tl1_err_data[CH_ERR_TL1_TLMAX]; 16007c478bd9Sstevel@tonic-gate ch_scrub_misc_t chpr_scrub_misc; 16017c478bd9Sstevel@tonic-gate int chpr_ec_set_size; 16027c478bd9Sstevel@tonic-gate ch_cpu_logout_t chpr_fecctl0_logout; 16037c478bd9Sstevel@tonic-gate ch_cpu_logout_t chpr_cecc_logout; 16047c478bd9Sstevel@tonic-gate ch_cpu_logout_t chpr_async_logout; 16057c478bd9Sstevel@tonic-gate pn_tlb_logout_t chpr_tlb_logout; 16067c478bd9Sstevel@tonic-gate uint64_t chpr_fpras_timestamp[FPRAS_NCOPYOPS]; 16077c478bd9Sstevel@tonic-gate hrtime_t chpr_ceptnr_seltime; 16087c478bd9Sstevel@tonic-gate int chpr_ceptnr_id; 16097c478bd9Sstevel@tonic-gate } cheetah_private_t; 16107c478bd9Sstevel@tonic-gate 16117c478bd9Sstevel@tonic-gate #endif /* _ASM */ 16127c478bd9Sstevel@tonic-gate 16137c478bd9Sstevel@tonic-gate #endif /* _KERNEL */ 16147c478bd9Sstevel@tonic-gate 16157c478bd9Sstevel@tonic-gate #ifdef __cplusplus 16167c478bd9Sstevel@tonic-gate } 16177c478bd9Sstevel@tonic-gate #endif 16187c478bd9Sstevel@tonic-gate 16197c478bd9Sstevel@tonic-gate #endif /* _SYS_CHEETAHREGS_H */ 1620