plat_ecc_unum.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_PLAT_ECC_NUM_H
#define _SYS_PLAT_ECC_NUM_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
#include <sys/int_types.h>
#include <sys/cheetahregs.h>
#include <sys/dditypes.h>
#include <sys/ddipropdefs.h>
#include <sys/ddi_impldefs.h>
#include <sys/platform_module.h>
#include <sys/sysmacros.h>
/*
* This file contains the common definitions used by the platform
* unum ecc logging.
*/
typedef enum {
/* Platform-specific function for sending mailbox message */
extern int plat_send_ecc_mailbox_msg(plat_ecc_message_type_t, void *);
/* For figuring out unique CPU id */
extern int plat_make_fru_cpuid(int, int, int);
/* For figuring out board number for given CPU id */
extern int plat_make_fru_boardnum(int);
/* For initializing the taskqs */
extern void plat_ecc_init(void);
/* For setting the capability value */
/* For sending a capability message to the SC */
extern int plat_ecc_capability_send(void);
/*
* The following variables enable and disable the fruid message logging on SC.
* of 1 is default, and indicates the messages are sent. A value of 0
* indicates that the messages are not sent.
*/
extern int ecc_log_fruid_enable;
#define ECC_FRUID_ENABLE_DEFAULT 1
#define PLAT_ECC_JNUMBER_LENGTH 60
typedef struct plat_ecc_error_data {
/* CPU in error */
/* or multiple bit error status */
/* MTAG, ECC, MTAGECC or Data */
#define PLAT_ECC_VERSION 2
/*
* Based on "UltraSPARC-III Programmer's Reference Manual", these values are
* obtained when you use the syndrom bits from the AFSR to index into the
* ECC syndroms table. See cheetah.c for more details on the definitions
* of C0, C1, C2, ... C8, MT0, MT1, ... M3, M4 ... etc.
*/
#define ECC_SYND_DATA_BEGIN 0
#define ECC_SYND_M2 144
#define ECC_SYND_M3 145
#define ECC_SYND_M4 146
#define ECC_SYND_M 147
typedef struct plat_ecc_msg_hdr {
extern uint16_t ecc_error2_mailbox_flags;
#define PLAT_ECC_ERROR2_SEND_L2_XXC 0x0001
#define PLAT_ECC_ERROR2_SEND_L2_XXU 0x0002
#define PLAT_ECC_ERROR2_SEND_L3_XXC 0x0004
#define PLAT_ECC_ERROR2_SEND_L3_XXU 0x0008
#define PLAT_ECC_ERROR2_SEND_MEM_ERRS 0x0010
#define PLAT_ECC_ERROR2_SEND_BUS_ERRS 0x0020
#define PLAT_ECC_ERROR2_SEND_L2_TAG_ERRS 0x0040
#define PLAT_ECC_ERROR2_SEND_L3_TAG_ERRS 0x0080
#define PLAT_ECC_ERROR2_SEND_L1_PARITY 0x0100
#define PLAT_ECC_ERROR2_SEND_TLB_PARITY 0x0200
#define PLAT_ECC_ERROR2_SEND_IV_ERRS 0x0400
#define PLAT_ECC_ERROR2_SEND_MTAG_XXC 0x0800
#define PLAT_ECC_ERROR2_SEND_IV_MTAG_XXC 0x1000
#define PLAT_ECC_ERROR2_SEND_PCACHE 0x2000
/* default value for ecc_error2_mailbox_flags */
#define PLAT_ECC_ERROR2_SEND_DEFAULT 0x3fff
typedef struct plat_ecc_error2_data {
#define PLAT_ECC_ERROR2_VERSION_MAJOR 1
#define PLAT_ECC_ERROR2_VERSION_MINOR 1
/* Values for ee2d_type */
#define PLAT_ECC_ERROR2_NONE 0x00
#define PLAT_ECC_ERROR2_L2_CE 0x01
#define PLAT_ECC_ERROR2_L2_UE 0x02
#define PLAT_ECC_ERROR2_L3_CE 0x03
#define PLAT_ECC_ERROR2_L3_UE 0x04
#define PLAT_ECC_ERROR2_CE 0x05
#define PLAT_ECC_ERROR2_UE 0x06
#define PLAT_ECC_ERROR2_DUE 0x07
#define PLAT_ECC_ERROR2_TO 0x08
#define PLAT_ECC_ERROR2_BERR 0x09
#define PLAT_ECC_ERROR2_DTO 0x0a
#define PLAT_ECC_ERROR2_DBERR 0x0b
#define PLAT_ECC_ERROR2_L2_TSCE 0x0c
#define PLAT_ECC_ERROR2_L2_THCE 0x0d
#define PLAT_ECC_ERROR2_L3_THCE 0x0f
#define PLAT_ECC_ERROR2_DPE 0x10
#define PLAT_ECC_ERROR2_IPE 0x11
#define PLAT_ECC_ERROR2_ITLB 0x12
#define PLAT_ECC_ERROR2_DTLB 0x13
#define PLAT_ECC_ERROR2_IVU 0x14
#define PLAT_ECC_ERROR2_IVC 0x15
#define PLAT_ECC_ERROR2_EMC 0x16
#define PLAT_ECC_ERROR2_IMC 0x17
#define PLAT_ECC_ERROR2_L3_MECC 0x18
#define PLAT_ECC_ERROR2_PCACHE 0x19
#define PLAT_ECC_ERROR2_NUMVALS 0x1a
typedef struct plat_ecc_ch_async_flt {
int ecaf_synd_status; /* AFLT_STAT_* (see async.h) */
int ecaf_afar_status; /* AFLT_STAT_* (see async.h) */
/*
* The following structures/#defines are used to notify the SC
* of DIMMs that fail the leaky bucket algorithm, E$ that experience
* multiple correctable errors and fail the serd algorithm, and
* E$ that experience any non-fatal uncorrectable error.
*/
/* The message is OK */
#define PLAT_ECC_INDICTMENT_OK 0x00
/* Send the message, but don't trust it */
#define PLAT_ECC_INDICTMENT_SUSPECT 0x01
/* Don't send message */
#define PLAT_ECC_INDICTMENT_NO_SEND 0x02
extern uint8_t ecc_indictment_mailbox_flags;
/* DIMM indictments for CEs */
#define PLAT_ECC_SEND_DIMM_INDICT 0x01
/* E$ indictments for UCC, WDC, CPC, EDC */
#define PLAT_ECC_SEND_ECACHE_XXC_INDICT 0x02
/* E$ indictments for UCU, WDU, CPU, EDU */
#define PLAT_ECC_SEND_ECACHE_XXU_INDICT 0x04
/* Default value for ecc_indictment_mailbox_flags */
/*
* WARNING: The plat_ecc_indictment_data_t struct size can be no bigger than
* 128 bytes. The union will fill out the structure to the correct size -
* the string space used in solaris_version will fill out the rest of the
* structure.
*
* Any changes made to this structure in the future should ensure that the
* structure does not go over 128 bytes.
*/
#define PLAT_ECC_INDICT_SIZE 128
typedef struct {
/* Value of ecc_indictment_mailbox_disable */
/* reporting error */
char solaris_version[1];
/* Solaris version string */
typedef union {
#define PLAT_ECC_VERSION_LENGTH (PLAT_ECC_INDICT_SIZE - \
#define PLAT_ECC_INDICTMENT_VERSION 1
/*
* Values for indictment_type. For Panther, E$ refers to
* the L3$. For previous procs, E$ refers to the L2$.
*/
#define PLAT_ECC_INDICT_NONE 0x00
#define PLAT_ECC_INDICT_DIMM 0x01
#define PLAT_ECC_INDICT_ECACHE_CORRECTABLES 0x02
#define PLAT_ECC_INDICT_ECACHE_UNCORRECTABLE 0x03
/*
* These values are used to set the state of msg_status
*
* 0 - No message in transit
* 1 - taskq thread dispatched, dispatching thread waiting for signal
* 2 - dispatched thread completed sending message
* 3 - dispatching thread received interrupt, not waiting for signal
*/
#define PLAT_ECC_NO_MSG_ACTIVE 0
#define PLAT_ECC_TASK_DISPATCHED 1
#define PLAT_ECC_MSG_SENT 2
#define PLAT_ECC_INTERRUPT_RECEIVED 3
/*
* Min and max sizes of plat_ecc_taskq
*/
#define PLAT_ECC_TASKQ_MIN 2
#define PLAT_ECC_TASKQ_MAX 8
#define PLAT_ECC_SEND_INDICT2_L2_XXU 0x0001
#define PLAT_ECC_SEND_INDICT2_L2_XXC_SERD 0x0002
#define PLAT_ECC_SEND_INDICT2_L2_TAG_SERD 0x0004
#define PLAT_ECC_SEND_INDICT2_L3_XXU 0x0008
#define PLAT_ECC_SEND_INDICT2_L3_XXC_SERD 0x0010
#define PLAT_ECC_SEND_INDICT2_L3_TAG_SERD 0x0020
#define PLAT_ECC_SEND_INDICT2_L1_SERD 0x0040
#define PLAT_ECC_SEND_INDICT2_TLB_SERD 0x0080
#define PLAT_ECC_SEND_INDICT2_FPU 0x0100
#define PLAT_ECC_SEND_INDICT2_PCACHE_SERD 0x0200
#define PLAT_ECC_SEND_INDICT2_DEFAULT 0x03ff
typedef struct plat_ecc_indictment2_data {
#define PLAT_ECC_INDICT2_MAJOR_VERSION 1
#define PLAT_ECC_INDICT2_MINOR_VERSION 1
/*
* Values for ei2d_type
*/
#define PLAT_ECC_INDICT2_NONE 0x00
#define PLAT_ECC_INDICT2_L2_UE 0x01
#define PLAT_ECC_INDICT2_L2_SERD 0x02
#define PLAT_ECC_INDICT2_L2_TAG_SERD 0x03
#define PLAT_ECC_INDICT2_L3_UE 0x04
#define PLAT_ECC_INDICT2_L3_SERD 0x05
#define PLAT_ECC_INDICT2_L3_TAG_SERD 0x06
#define PLAT_ECC_INDICT2_DCACHE_SERD 0x07
#define PLAT_ECC_INDICT2_ICACHE_SERD 0x08
#define PLAT_ECC_INDICT2_ITLB_SERD 0x09
#define PLAT_ECC_INDICT2_DTLB_SERD 0x0a
#define PLAT_ECC_INDICT2_FPU 0x0b
#define PLAT_ECC_INDICT2_PCACHE_SERD 0x0c
#define PLAT_ECC_INDICT2_NUMVALS 0x0d
/*
* The following structure maps the indictment reason to its
* corresponding type.
*/
typedef struct plat_ecc_bl_map {
char *ebm_reason; /* Indictment reason */
int ebm_type; /* Indictment type */
/*
* This message is used to exchange the capability of the SC and Domain
* so that both entities can adjust their behavior as appropriate.
* Also the Solaris version is sent from the Domain along with the
* capability bitmap.
*/
typedef struct plat_capability_data {
char capd_solaris_version[1];
/* Solaris version string ptr */
#define PLAT_ECC_CAP_VERSION_MAJOR 1
#define PLAT_ECC_CAP_VERSION_MINOR 1
#define PLAT_ECC_CAPABILITY_ERROR 0x01
#define PLAT_ECC_CAPABILITY_INDICT 0x02
#define PLAT_ECC_CAPABILITY_ERROR2 0x04
#define PLAT_ECC_CAPABILITY_INDICT2 0x08
#define PLAT_ECC_CAPABILITY_FMA 0x10
#define PLAT_ECC_CAPABILITY_EREPORTS 0x20
#define PLAT_ECC_CAPABILITY_DOMAIN_DEFAULT 0x1f
#define PLAT_ECC_CAPABILITY_SC_DEFAULT 0x03
extern uint32_t plat_ecc_capability_map_sc;
/*
* The following structure is a wrapper around the all messages. The
* extra members are used for communicating between two threads.
*/
typedef struct plat_ecc_message {
void * ecc_msg_data;
#ifdef __cplusplus
}
#endif
#endif /* _SYS_PLAT_ECC_NUM_H */