1*13b1a670Smiod /* $OpenBSD: logout.h,v 1.3 2009/09/25 04:38:40 miod Exp $ */ 2b07c838bSmiod /* $NetBSD: logout.h,v 1.6 2005/12/11 12:16:16 christos Exp $ */ 3b07c838bSmiod 4b07c838bSmiod /* 5b3248505Smiod * Copyright (c) 2009 Miodrag Vallat. 6b3248505Smiod * 7b3248505Smiod * Permission to use, copy, modify, and distribute this software for any 8b3248505Smiod * purpose with or without fee is hereby granted, provided that the above 9b3248505Smiod * copyright notice and this permission notice appear in all copies. 10b3248505Smiod * 11b3248505Smiod * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 12b3248505Smiod * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 13b3248505Smiod * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 14b3248505Smiod * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 15b3248505Smiod * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 16b3248505Smiod * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 17b3248505Smiod * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 18b3248505Smiod */ 19b3248505Smiod /* 20b07c838bSmiod * Copyright (c) 1998 by Matthew Jacob 21b07c838bSmiod * NASA AMES Research Center. 22b07c838bSmiod * All rights reserved. 23b07c838bSmiod * 24b07c838bSmiod * Redistribution and use in source and binary forms, with or without 25b07c838bSmiod * modification, are permitted provided that the following conditions 26b07c838bSmiod * are met: 27b07c838bSmiod * 1. Redistributions of source code must retain the above copyright 28b07c838bSmiod * notice immediately at the beginning of the file, without modification, 29b07c838bSmiod * this list of conditions, and the following disclaimer. 30b07c838bSmiod * 2. Redistributions in binary form must reproduce the above copyright 31b07c838bSmiod * notice, this list of conditions and the following disclaimer in the 32b07c838bSmiod * documentation and/or other materials provided with the distribution. 33b07c838bSmiod * 3. The name of the author may not be used to endorse or promote products 34b07c838bSmiod * derived from this software without specific prior written permission. 35b07c838bSmiod * 36b07c838bSmiod * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 37b07c838bSmiod * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 38b07c838bSmiod * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 39b07c838bSmiod * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR 40b07c838bSmiod * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 41b07c838bSmiod * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 42b07c838bSmiod * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 43b07c838bSmiod * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 44b07c838bSmiod * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 45b07c838bSmiod * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 46b07c838bSmiod * SUCH DAMAGE. 47b07c838bSmiod */ 48b07c838bSmiod 49b07c838bSmiod /* 50b07c838bSmiod * Various Alpha OSF/1 PAL Logout error definitions. 51b07c838bSmiod */ 52b07c838bSmiod 53b07c838bSmiod /* 54b07c838bSmiod * Information gathered from: DEC documentation 55b07c838bSmiod */ 56b07c838bSmiod 57b07c838bSmiod /* 58b07c838bSmiod * Avanti (AlphaStation 200 and 400) Specific PALcode Exception Logout 59b07c838bSmiod * Area Definitions 60b07c838bSmiod */ 61b07c838bSmiod 62b07c838bSmiod /* 63b07c838bSmiod * Avanti Specific common logout frame header. 64b07c838bSmiod * *Almost* identical to the generic logout header listed in alpha_cpu.h. 65b07c838bSmiod */ 66b07c838bSmiod 67b07c838bSmiod typedef struct { 68b07c838bSmiod unsigned int la_frame_size; /* frame size */ 69b07c838bSmiod unsigned int la_flags; /* flags; see alpha_cpu.h */ 70b07c838bSmiod unsigned int la_cpu_offset; /* offset to CPU area */ 71b07c838bSmiod unsigned int la_system_offset; /* offset to system area */ 72b07c838bSmiod unsigned int mcheck_code; /* machine check code */ 73b07c838bSmiod unsigned int :32; 74b07c838bSmiod } mc_hdr_avanti; 75b07c838bSmiod 76b07c838bSmiod /* Machine Check Codes */ 77b07c838bSmiod 78b07c838bSmiod /* SCB 660 Fatal Machine Checks */ 79b07c838bSmiod #define AVANTI_RETRY_TIMEOUT 0x201L 80b07c838bSmiod #define AVANTI_DMA_DATA_PARITY 0x202L 81b07c838bSmiod #define AVANTI_IO_PARITY 0x203L 82b07c838bSmiod #define AVANTI_TARGET_ABORT 0x204L 83b07c838bSmiod #define AVANTI_NO_DEVICE 0x205L 84b07c838bSmiod #define AVANTI_CORRRECTABLE_MEMORY 0x206L /* Should never occur */ 85b07c838bSmiod #define AVANTI_UNCORRECTABLE_PCI_MEMORY 0x207L 86b07c838bSmiod #define AVANTI_INVALID_PT_LOOKUP 0x208L 87b07c838bSmiod #define AVANTI_MEMORY 0x209L 88b07c838bSmiod #define AVANTI_BCACHE_TAG_ADDR_PARITY 0x20AL 89b07c838bSmiod #define AVANTI_BCACHE_TAG_CTRL_PARITY 0x20BL 90b07c838bSmiod #define AVANTI_NONEXISTENT_MEMORY 0x20CL 91b07c838bSmiod #define AVANTI_IO_BUS 0x20DL 92b07c838bSmiod #define AVANTI_BCACHE_TAG_PARITY 0x80L 93b07c838bSmiod #define AVANTI_BCACHE_TAG_CTRL_PARITY2 0x82L 94b07c838bSmiod 95b07c838bSmiod /* SCB 670 Processor Fatal Machine Checks */ 96b07c838bSmiod #define AVANTI_HARD_ERROR 0x84L 97b07c838bSmiod #define AVANTI_CORRECTABLE_ECC 0x86L 98b07c838bSmiod #define AVANTI_NONCORRECTABLE_ECC 0x88L 99b07c838bSmiod #define AVANTI_UNKNOWN_ERROR 0x8AL 100b07c838bSmiod #define AVANTI_SOFT_ERROR 0x8CL 101b07c838bSmiod #define AVANTI_BUGCHECK 0x8EL 102b07c838bSmiod #define AVANTI_OS_BUGCHECK 0x90L 103b07c838bSmiod #define AVANTI_DCACHE_FILL_PARITY 0x92L 104b07c838bSmiod #define AVANTI_ICACHE_FILL_PARITY 0x94L 105b07c838bSmiod 106b07c838bSmiod typedef struct { 107b07c838bSmiod /* Registers from the CPU */ 108b07c838bSmiod u_int64_t paltemp[32]; /* PAL TEMP REGS. */ 109b07c838bSmiod u_int64_t exc_addr; /* Address of excepting ins. */ 110b07c838bSmiod u_int64_t exc_sum; /* Summary of arithmetic traps. */ 111b07c838bSmiod u_int64_t exc_mask; /* Exception mask. */ 112b07c838bSmiod u_int64_t iccsr; 113b07c838bSmiod u_int64_t pal_base; /* Base address for PALcode. */ 114b07c838bSmiod u_int64_t hier; 115b07c838bSmiod u_int64_t hirr; 116b07c838bSmiod u_int64_t mm_csr; 117b07c838bSmiod u_int64_t dc_stat; 118b07c838bSmiod u_int64_t dc_addr; 119b07c838bSmiod u_int64_t abox_ctl; 120b07c838bSmiod u_int64_t biu_stat; /* Bus Interface Unit Status. */ 121b07c838bSmiod u_int64_t biu_addr; 122b07c838bSmiod u_int64_t biu_ctl; 123b07c838bSmiod u_int64_t fill_syndrome; 124b07c838bSmiod u_int64_t fill_addr; 125b07c838bSmiod u_int64_t va; 126b07c838bSmiod u_int64_t bc_tag; 127b07c838bSmiod 128b07c838bSmiod /* Registers from the cache and memory controller (21071-CA) */ 129b07c838bSmiod u_int64_t coma_gcr; /* Error and Diag. Status. */ 130b07c838bSmiod u_int64_t coma_edsr; 131b07c838bSmiod u_int64_t coma_ter; 132b07c838bSmiod u_int64_t coma_elar; 133b07c838bSmiod u_int64_t coma_ehar; 134b07c838bSmiod u_int64_t coma_ldlr; 135b07c838bSmiod u_int64_t coma_ldhr; 136b07c838bSmiod u_int64_t coma_base0; 137b07c838bSmiod u_int64_t coma_base1; 138b07c838bSmiod u_int64_t coma_base2; 139b07c838bSmiod u_int64_t coma_cnfg0; 140b07c838bSmiod u_int64_t coma_cnfg1; 141b07c838bSmiod u_int64_t coma_cnfg2; 142b07c838bSmiod 143b07c838bSmiod /* Registers from the PCI bridge (21071-DA) */ 144b07c838bSmiod u_int64_t epic_dcsr; /* Diag. Control and Status. */ 145b07c838bSmiod u_int64_t epic_pear; 146b07c838bSmiod u_int64_t epic_sear; 147b07c838bSmiod u_int64_t epic_tbr1; 148b07c838bSmiod u_int64_t epic_tbr2; 149b07c838bSmiod u_int64_t epic_pbr1; 150b07c838bSmiod u_int64_t epic_pbr2; 151b07c838bSmiod u_int64_t epic_pmr1; 152b07c838bSmiod u_int64_t epic_pmr2; 153b07c838bSmiod u_int64_t epic_harx1; 154b07c838bSmiod u_int64_t epic_harx2; 155b07c838bSmiod u_int64_t epic_pmlt; 156b07c838bSmiod u_int64_t epic_tag0; 157b07c838bSmiod u_int64_t epic_tag1; 158b07c838bSmiod u_int64_t epic_tag2; 159b07c838bSmiod u_int64_t epic_tag3; 160b07c838bSmiod u_int64_t epic_tag4; 161b07c838bSmiod u_int64_t epic_tag5; 162b07c838bSmiod u_int64_t epic_tag6; 163b07c838bSmiod u_int64_t epic_tag7; 164b07c838bSmiod u_int64_t epic_data0; 165b07c838bSmiod u_int64_t epic_data1; 166b07c838bSmiod u_int64_t epic_data2; 167b07c838bSmiod u_int64_t epic_data3; 168b07c838bSmiod u_int64_t epic_data4; 169b07c838bSmiod u_int64_t epic_data5; 170b07c838bSmiod u_int64_t epic_data6; 171b07c838bSmiod u_int64_t epic_data7; 172b07c838bSmiod } mc_uc_avanti; 173b07c838bSmiod 174b07c838bSmiod /* 175b07c838bSmiod * Information gathered from: OSF/1 header files. 176b07c838bSmiod */ 177b07c838bSmiod 178b07c838bSmiod 179b07c838bSmiod /* 180b07c838bSmiod * EV5 Specific OSF/1 Pal Code Exception Logout Area Definitions 181b07c838bSmiod * (inspired from OSF/1 Header files). 182b07c838bSmiod */ 183b07c838bSmiod 184b07c838bSmiod /* 185b07c838bSmiod * EV5 Specific common logout frame header. 186b07c838bSmiod * *Almost* identical to the generic logout header listed in alpha_cpu.h. 187b07c838bSmiod */ 188b07c838bSmiod 189b07c838bSmiod typedef struct { 190b07c838bSmiod unsigned int la_frame_size; /* frame size */ 191b07c838bSmiod unsigned int la_flags; /* flags; see alpha_cpu.h */ 192b07c838bSmiod unsigned int la_cpu_offset; /* offset to CPU area */ 193b07c838bSmiod unsigned int la_system_offset; /* offset to system area */ 194b07c838bSmiod unsigned long mcheck_code; /* machine check code */ 195b07c838bSmiod } mc_hdr_ev5; 196b07c838bSmiod 197b07c838bSmiod /* Machine Check Codes */ 198b07c838bSmiod #define EV5_CORRECTED 0x86L 199b07c838bSmiod #define SYSTEM_CORRECTED 0x201L 200b07c838bSmiod 201b07c838bSmiod /* 202b07c838bSmiod * EV5 Specific Machine Check logout frame for uncorrectable errors. 203b07c838bSmiod * This is used to log uncorrectable errors such as double bit ECC errors. 204b07c838bSmiod * 205b07c838bSmiod * This typically resides in the CPU offset area of the logout frame. 206b07c838bSmiod */ 207b07c838bSmiod 208b07c838bSmiod typedef struct { 209b07c838bSmiod u_int64_t shadow[8]; /* Shadow reg. 8-14, 25 */ 210b07c838bSmiod u_int64_t paltemp[24]; /* PAL TEMP REGS. */ 211b07c838bSmiod u_int64_t exc_addr; /* Address of excepting ins. */ 212b07c838bSmiod u_int64_t exc_sum; /* Summary of arithmetic traps. */ 213b07c838bSmiod u_int64_t exc_mask; /* Exception mask. */ 214b07c838bSmiod u_int64_t pal_base; /* Base address for PALcode. */ 215b07c838bSmiod u_int64_t isr; /* Interrupt Status Reg. */ 216b07c838bSmiod u_int64_t icsr; /* CURRENT SETUP OF EV5 IBOX */ 217b07c838bSmiod u_int64_t ic_perr_stat; /* 218b07c838bSmiod * I-CACHE Reg: 219b07c838bSmiod * <13> IBOX Timeout 220b07c838bSmiod * <12> TAG parity 221b07c838bSmiod * <11> Data parity 222b07c838bSmiod */ 223b07c838bSmiod u_int64_t dc_perr_stat; /* D-CACHE error Reg: 224b07c838bSmiod * Bits set to 1: 225b07c838bSmiod * <2> Data error in bank 0 226b07c838bSmiod * <3> Data error in bank 1 227b07c838bSmiod * <4> Tag error in bank 0 228b07c838bSmiod * <5> Tag error in bank 1 229b07c838bSmiod */ 230b07c838bSmiod u_int64_t va; /* Effective VA of fault or miss. */ 231b07c838bSmiod u_int64_t mm_stat; /* 232b07c838bSmiod * Holds the reason for D-stream 233b07c838bSmiod * fault or D-cache parity errors 234b07c838bSmiod */ 235b07c838bSmiod u_int64_t sc_addr; /* 236b07c838bSmiod * Address that was being accessed 237b07c838bSmiod * when EV5 detected Secondary cache 238b07c838bSmiod * failure. 239b07c838bSmiod */ 240b07c838bSmiod u_int64_t sc_stat; /* 241b07c838bSmiod * Helps determine if the error was 242b07c838bSmiod * TAG/Data parity(Secondary Cache) 243b07c838bSmiod */ 244b07c838bSmiod u_int64_t bc_tag_addr; /* Contents of EV5 BC_TAG_ADDR */ 245b07c838bSmiod u_int64_t ei_addr; /* 246b07c838bSmiod * Physical address of any transfer 247b07c838bSmiod * that is logged in the EV5 EI_STAT 248b07c838bSmiod */ 249b07c838bSmiod u_int64_t fill_syndrome; /* For correcting ECC errors. */ 250b07c838bSmiod u_int64_t ei_stat; /* 251b07c838bSmiod * Helps identify reason of any 252b07c838bSmiod * processor uncorrectable error 253b07c838bSmiod * at its external interface. 254b07c838bSmiod */ 255b07c838bSmiod u_int64_t ld_lock; /* Contents of EV5 LD_LOCK register*/ 256b07c838bSmiod } mc_uc_ev5; 257b07c838bSmiod #define EV5_IC_PERR_IBOXTMO 0x2000 258b07c838bSmiod 259b07c838bSmiod /* 260b07c838bSmiod * EV5 Specific Machine Check logout frame for correctable errors. 261b07c838bSmiod * 262b07c838bSmiod * This is used to log correctable errors such as Single bit ECC errors. 263b07c838bSmiod */ 264b07c838bSmiod typedef struct { 265b07c838bSmiod u_int64_t ei_addr; /* 266b07c838bSmiod * Physical address of any transfer 267b07c838bSmiod * that is logged in the EV5 EI_STAT 268b07c838bSmiod */ 269b07c838bSmiod u_int64_t fill_syndrome; /* For correcting ECC errors. */ 270b07c838bSmiod u_int64_t ei_stat; /* 271b07c838bSmiod * Helps identify reason of any 272b07c838bSmiod * processor uncorrectable error 273b07c838bSmiod * at its external interface. 274b07c838bSmiod */ 275b07c838bSmiod u_int64_t isr; /* Interrupt Status Reg. */ 276b07c838bSmiod } mc_cc_ev5; 277b07c838bSmiod 278b3248505Smiod /* 279b3248505Smiod * Information gathered from: AlphaServer ES40 Service Guide 280b3248505Smiod */ 281b07c838bSmiod 282b3248505Smiod /* 283b3248505Smiod * EV6 Specific OSF/1 Pal Code Exception Logout Area Definitions 284b3248505Smiod */ 285b3248505Smiod 286b3248505Smiod /* 287b3248505Smiod * EV6 Specific common logout frame header. 288b3248505Smiod * *Almost* identical to the generic logout header listed in alpha_cpu.h. 289b3248505Smiod */ 290b3248505Smiod 291b3248505Smiod typedef struct { 292b3248505Smiod unsigned int la_frame_size; /* frame size */ 293b3248505Smiod unsigned int la_flags; /* flags; see alpha_cpu.h */ 294b3248505Smiod unsigned int la_cpu_offset; /* offset to CPU area */ 295b3248505Smiod unsigned int la_system_offset; /* offset to system area */ 296b3248505Smiod unsigned int mcheck_code; /* machine check code */ 297b3248505Smiod unsigned int mcheck_rev; /* frame revision */ 298b3248505Smiod #define MC_EV6_FRAME_REVISION 1 299b3248505Smiod } mc_hdr_ev6; 300b3248505Smiod 301b3248505Smiod /* 302b3248505Smiod * EV6 Specific Machine Check processor area. 303b3248505Smiod */ 304b3248505Smiod 305b3248505Smiod typedef struct { 306b3248505Smiod uint64_t i_stat; 307b3248505Smiod uint64_t dc_stat; 308b3248505Smiod uint64_t c_addr; 309b3248505Smiod uint64_t c_syndrome_0; 310b3248505Smiod uint64_t c_syndrome_1; 311b3248505Smiod uint64_t c_stat; 312b3248505Smiod uint64_t c_sts; 313b3248505Smiod uint64_t mm_stat; 314b3248505Smiod /* the following fields only exist for uncorrectable errors */ 315b3248505Smiod uint64_t exc_addr; 316b3248505Smiod uint64_t ier_cm; 317b3248505Smiod uint64_t isum; 318b3248505Smiod uint64_t reserved0; 319b3248505Smiod uint64_t pal_base; 320b3248505Smiod uint64_t i_ctl; 321b3248505Smiod uint64_t pctx; 322b3248505Smiod uint64_t reserved1; 323b3248505Smiod uint64_t reserved2; 324b3248505Smiod } mc_cpu_ev6; 325b3248505Smiod 326b3248505Smiod /* C_STAT bits */ 327b3248505Smiod #define EV6_C_STAT_MASK 0x1f 328b3248505Smiod #define EV6_C_STAT_NO_ERROR 0x00 329b3248505Smiod #define EV6_C_STAT_SNGL_BC_TAG_PERR 0x01 330b3248505Smiod #define EV6_C_STAT_SNGL_DC_DUPLICATE_TAG_PERR 0x02 331b3248505Smiod #define EV6_C_STAT_SNGL_DSTREAM_MEM_ECC_ERR 0x03 332b3248505Smiod #define EV6_C_STAT_SNGL_DSTREAM_BC_ECC_ERR 0x04 333b3248505Smiod #define EV6_C_STAT_SNGL_DSTREAM_DC_ECC_ERR 0x05 334b3248505Smiod #define EV6_C_STAT_SNGL_BC_PROBE_HIT_ERR 0x06 335b3248505Smiod #define EV6_C_STAT_SNGL_BC_PROBE_HIT_ERR2 0x07 336b3248505Smiod #define EV6_C_STAT_SNGL_ISTREAM_MEM_ECC_ERR 0x0b 337b3248505Smiod #define EV6_C_STAT_SNGL_ISTREAM_BC_ECC_ERR 0x0c 338b3248505Smiod #define EV6_C_STAT_DBL_DSTREAM_MEM_ECC_ERR 0x13 339b3248505Smiod #define EV6_C_STAT_DBL_DSTREAM_BC_ECC_ERR 0x14 340b3248505Smiod #define EV6_C_STAT_DBL_ISTREAM_MEM_ECC_ERR 0x1b 341b3248505Smiod #define EV6_C_STAT_DBL_ISTREAM_BC_ECC_ERR 0x1c 342b3248505Smiod 343b3248505Smiod /* C_STS bits */ 344b3248505Smiod #define EV6_C_STS_MASK 0x0f 345b3248505Smiod #define EV6_C_STS_PARITY 0x08 346b3248505Smiod #define EV6_C_STS_VALID 0x04 347b3248505Smiod #define EV6_C_STS_DIRTY 0x02 348b3248505Smiod #define EV6_C_STS_SHARED 0x01 349b3248505Smiod 350b3248505Smiod /* DC_STAT */ 351b3248505Smiod #define EV6_DC_STAT_MASK 0x1f 352b3248505Smiod #define EV6_DC_STAT_PIPELINE_0_ERROR 0x01 353b3248505Smiod #define EV6_DC_STAT_PIPELINE_1_ERROR 0x02 354b3248505Smiod #define EV6_DC_STAT_STORE_DATA_ECC_ERROR 0x04 355b3248505Smiod #define EV6_DC_STAT_LOAD_DATA_ECC_ERROR 0x08 356b3248505Smiod #define EV6_DC_STAT_STORE_DATA_ECC_ERROR_REPEATED 0x10 357b3248505Smiod 358b3248505Smiod /* MM_STAT */ 359b3248505Smiod #define EV6_MM_STAT_MASK 0x03ff 360b3248505Smiod #define EV6_MM_STAT_WRITE 0x0001 361b3248505Smiod #define EV6_MM_STAT_ACCESS_VIOLATION 0x0002 362b3248505Smiod #define EV6_MM_STAT_FOR_SET 0x0004 363b3248505Smiod #define EV6_MM_STAT_FOW_SET 0x0008 364b3248505Smiod #define EV6_MM_STAT_OPCODE_MASK 0x02f0 365b3248505Smiod #define EV6_MM_STAT_DCACHE_CORRECTABLE_ERROR 0x0300 366b3248505Smiod 367b3248505Smiod /* 368b3248505Smiod * EV6 Specific Machine Check system area. 369b3248505Smiod */ 370b3248505Smiod 371b3248505Smiod typedef struct { 372b3248505Smiod uint64_t flags; 373b3248505Smiod uint64_t c_dir; 374b3248505Smiod uint64_t c_misc; 375b3248505Smiod uint64_t p0_perror; 376b3248505Smiod uint64_t p1_perror; 377b3248505Smiod } mc_sys_ev6; 378b3248505Smiod 379b3248505Smiod /* 380b3248505Smiod * EV6 Environmental Error logout frame. 381b3248505Smiod */ 382b3248505Smiod 383b3248505Smiod typedef struct { 384b3248505Smiod uint64_t flags; 385b3248505Smiod uint64_t c_dir; 386b3248505Smiod uint64_t smir; 387b3248505Smiod uint64_t cpuir; 388b3248505Smiod uint64_t psir; 389b3248505Smiod uint64_t lm78_isr; 390b3248505Smiod uint64_t doors; 391b3248505Smiod uint64_t temp_warning; 392b3248505Smiod uint64_t fan_control; 393b3248505Smiod uint64_t fatal_power_down; 394b3248505Smiod uint64_t reserved; 395b3248505Smiod } mc_env_ev6; 396b3248505Smiod 397b3248505Smiod /* SMIR */ 398b3248505Smiod #define EV6_ENV_SMIR_RESET 0x80 399b3248505Smiod #define EV6_ENV_SMIR_PCI1_RESET 0x40 400b3248505Smiod #define EV6_ENV_SMIR_PCI0_RESET 0x20 401b3248505Smiod #define EV6_ENV_SMIR_OVERTEMP 0x10 402b3248505Smiod #define EV6_ENV_SMIR_DC_FAILURE 0x04 403b3248505Smiod #define EV6_ENV_SMIR_RMC_HALT 0x02 404b3248505Smiod #define EV6_ENV_SMIR_PSU_FAILURE 0x01 405b3248505Smiod 406b3248505Smiod /* CPUIR */ 407b3248505Smiod #define EV6_ENV_CPUIR_CPU_FAIL(cpuno) ((cpuno) << 4) 408b3248505Smiod #define EV6_ENV_CPUIR_CPU_ENABLE(cpuno) ((cpuno) << 0) 409b3248505Smiod 410b3248505Smiod /* PSIR */ 411b3248505Smiod #define EV6_ENV_PSIR_PSU_FAIL(psuno) ((psuno) << 4) 412b3248505Smiod #define EV6_ENV_PSIR_PSU_ENABLE(psuno) ((psuno) << 0) 413b3248505Smiod 414b3248505Smiod /* LM78_ISR */ 415b3248505Smiod #define EV6_ENV_LM78_PSU_AC_HIGH_LIMIT 0x0000800000000000 416b3248505Smiod #define EV6_ENV_LM78_PSU_AC_LOW_LIMIT 0x0000400000000000 417b3248505Smiod #define EV6_ENV_LM78_PSU_OVERTEMP 0x0000200000000000 418b3248505Smiod #define EV6_ENV_LM78_PSU_12V_OVERAMP 0x0000100000000000 419b3248505Smiod #define EV6_ENV_LM78_PSU_5V_OVERAMP 0x0000080000000000 420b3248505Smiod #define EV6_ENV_LM78_PSU_3_3V_OVERAMP 0x0000040000000000 421b3248505Smiod #define EV6_ENV_LM78_PSU_NUMBER_MASK 0x0000030000000000 422b3248505Smiod #define EV6_ENV_LM78_PSU_NUMBER_SHIFT 40 423b3248505Smiod #define EV6_ENV_LM78_FAN6_FAILURE 0x0000008000000000 424b3248505Smiod #define EV6_ENV_LM78_FAN3_FAILURE 0x0000004000000000 425b3248505Smiod #define EV6_ENV_LM78_ZONE2_OVERTEMP 0x0000001000000000 426b3248505Smiod #define EV6_ENV_LM78_CPU3_VIO_OOT 0x0000000800000000 427b3248505Smiod #define EV6_ENV_LM78_CPU3_VCORE_OOT 0x0000000400000000 428b3248505Smiod #define EV6_ENV_LM78_CPU2_VIO_OOT 0x0000000200000000 429b3248505Smiod #define EV6_ENV_LM78_CPU2_VCORE_OOT 0x0000000100000000 430b3248505Smiod #define EV6_ENV_LM78_FAN5_FAILURE 0x0000000000800000 431b3248505Smiod #define EV6_ENV_LM78_FAN4_FAILURE 0x0000000000400000 432b3248505Smiod #define EV6_ENV_LM78_ZONE1_OVERTEMP 0x0000000000100000 433b3248505Smiod #define EV6_ENV_LM78_CPU1_VIO_OOT 0x0000000000080000 434b3248505Smiod #define EV6_ENV_LM78_CPU1_VCORE_OOT 0x0000000000040000 435b3248505Smiod #define EV6_ENV_LM78_CPU0_VIO_OOT 0x0000000000020000 436b3248505Smiod #define EV6_ENV_LM78_CPU0_VCORE_OOT 0x0000000000010000 437*13b1a670Smiod #define EV6_ENV_LM78_PSU_MINUS12V_OOT 0x0000000000000400 438b3248505Smiod #define EV6_ENV_LM78_CTERM_OOT 0x0000000000000100 439b3248505Smiod #define EV6_ENV_LM78_FAN2_FAILURE 0x0000000000000080 440b3248505Smiod #define EV6_ENV_LM78_FAN1_FAILURE 0x0000000000000040 441b3248505Smiod #define EV6_ENV_LM78_CPU_OVERTEMP 0x0000000000000020 442b3248505Smiod #define EV6_ENV_LM78_ZONA0_OVERTEMP 0x0000000000000010 443b3248505Smiod #define EV6_ENV_LM78_VTERM_OOT 0x0000000000000008 444b3248505Smiod #define EV6_ENV_LM78_PSU_12V_OOT 0x0000000000000004 445b3248505Smiod #define EV6_ENV_LM78_PSU_5V_OOT 0x0000000000000002 446b3248505Smiod #define EV6_ENV_LM78_PSU_3_3V_OOT 0x0000000000000001 447b3248505Smiod 448b3248505Smiod /* Doors */ 449b3248505Smiod #define EV6_ENV_DOORS_PCI_CLOSED 0x80 450b3248505Smiod #define EV6_ENV_DOORS_FAN_CLOSED 0x40 451b3248505Smiod #define EV6_ENV_DOORS_CPU_CLOSED 0x20 452b3248505Smiod #define EV6_ENV_DOORS_PCI_OPEN 0x08 453b3248505Smiod #define EV6_ENV_DOORS_FAN_OPEN 0x04 454b3248505Smiod #define EV6_ENV_DOORS_CPU_OPEN 0x02 455b3248505Smiod 456b3248505Smiod /* System Temperature Warning (sticky?) */ 457b3248505Smiod #define EV6_ENV_STW_ZONE2 0x40 458b3248505Smiod #define EV6_ENV_STW_ZONE1 0x20 459b3248505Smiod #define EV6_ENV_STW_ZONE0 0x10 460b3248505Smiod #define EV6_ENV_STW_CPU3 0x08 461b3248505Smiod #define EV6_ENV_STW_CPU2 0x04 462b3248505Smiod #define EV6_ENV_STW_CPU1 0x02 463b3248505Smiod #define EV6_ENV_STW_CPU0 0x01 464b3248505Smiod 465b3248505Smiod /* System Fan Control Fault */ 466b3248505Smiod #define EV6_ENV_SFCF_FAN1234_LOW_SPEED 0x0800 467b3248505Smiod #define EV6_ENV_SFCF_FAN1234_HIGH_SPEED 0x0400 468b3248505Smiod #define EV6_ENV_SFCF_FAN56_LOW_SPEED 0x0200 469b3248505Smiod #define EV6_ENV_SFCF_FAN56_HIGH_SPEED 0x0100 470b3248505Smiod #define EV6_ENV_SFCF_FAN6_NONRESPONSIVE 0x0020 471b3248505Smiod #define EV6_ENV_SFCF_FAN5_NONRESPONSIVE 0x0010 472b3248505Smiod #define EV6_ENV_SFCF_FAN4_NONRESPONSIVE 0x0008 473b3248505Smiod #define EV6_ENV_SFCF_FAN3_NONRESPONSIVE 0x0004 474b3248505Smiod #define EV6_ENV_SFCF_FAN2_NONRESPONSIVE 0x0002 475b3248505Smiod #define EV6_ENV_SFCF_FAN1_NONRESPONSIVE 0x0001 476