intel_nb5000.c revision 0ad0f0b2adb964c7bd56bbf5a831721e1a67beaf
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (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 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <sys/controlregs.h>
#include <sys/sysevent.h>
#include <sys/pci_cfgspace.h>
#include <sys/mc_intel.h>
#include "nb5000.h"
#include "nb_log.h"
#include "dimm_phys.h"
static nb_logout_t nb_log;
struct mch_error_code {
int intel_error_list; /* error number in Chipset Error List */
};
static struct mch_error_code fat_fbd_error_code[] = {
};
static int
{
int rt = -1;
int nerr = 0;
int i;
int sz;
for (i = 0; i < sz; i++) {
nerr++;
}
}
if (emask_fbd)
if (nerr > 1)
rt = -1;
return (rt);
}
static char *
{
int channel;
char *intr = "nb.unknown";
if ((ferr_fat_fbd & ERR_FAT_FBD_MASK) == 0) {
return (intr);
}
if ((ferr_fat_fbd & ERR_FAT_FBD_M1) != 0)
else
} else {
if ((ferr_fat_fbd & ERR_FAT_FBD_M3) != 0)
else if ((ferr_fat_fbd & ERR_FAT_FBD_M23) != 0) {
intr = "nb.fbd.reset_timeout";
}
}
return (intr);
}
static struct mch_error_code nf_fbd_error_code[] = {
};
static int
{
int rt = -1;
int nerr = 0;
int i;
int sz;
for (i = 0; i < sz; i++) {
nerr++;
}
}
if (emask_fbd)
if (nerr > 1)
rt = -1;
return (rt);
}
static char *
{
char *intr = "nb.unknown";
if ((ferr_nf_fbd & ERR_NF_FBD_MASK) == 0) {
return (intr);
}
if (ferr_nf_fbd & ERR_NF_FBD_MASK) {
if (ferr_nf_fbd & ERR_NF_FBD_ECC_UE) {
/*
* uncorrectable ECC M4 - M12
* we can only isolate to pair of dimms
* for single dimm configuration let eversholt
* sort it out with out needing a special rule
*/
intr = "nb.mem_ue";
} else if (ferr_nf_fbd & ERR_NF_FBD_M13) {
/*
* write error M13
* we can only isolate to pair of dimms
*/
if (nb_mode != NB_MEMORY_MIRROR) {
}
} else if ((ferr_nf_fbd & ERR_NF_FBD_ECC_CE) != 0) {
/* correctable ECC M17-M20 */
if (ecc_locator & 0x1ff)
else if (ecc_locator & 0x3fe00)
intr = "nb.mem_ce";
} else if ((ferr_nf_fbd & ERR_NF_FBD_SPARE) != 0) {
/* spare dimm M27, M28 */
intr = "nb.mem_ds";
}
} else if ((ferr_nf_fbd & ERR_NF_FBD_M22) != 0) {
}
}
}
return (intr);
}
static struct mch_error_code fat_int_error_code[] = {
};
static struct mch_error_code nf_int_error_code[] = {
{ 27, 0, ERR_NF_INT_B27 },
{ 24, 0, ERR_NF_INT_B24 },
{ 18, 0, ERR_NF_INT_B18 },
{ 17, 0, ERR_NF_INT_B17 },
{ 16, 0, ERR_NF_INT_B16 },
};
static int
{
int rt = -1;
int nerr = 0;
int i;
int sz;
for (i = 0; i < sz; i++) {
nerr++;
}
}
if (nb_chipset == INTEL_NB_5400 &&
(err_nf_int & NERR_NF_5400_INT_B26) != 0) {
rt = 26;
nerr++;
}
if (rt)
err_nf_int &= ~ERR_NF_INT_B18;
for (i = 0; i < sz; i++) {
nerr++;
}
}
if (emask_int)
if (nerr > 1)
rt = -1;
return (rt);
}
static int
{
int t = 0;
int rt = 0;
*interpose |= t;
*interpose |= t;
*interpose |= t;
if (!willpanic) {
/*
* if interpose write read-only registers to clear from pcii
* cache
*/
if (*interpose) {
NRECINT_WR();
RECINT_WR();
NRECSF_WR();
RECSF_WR();
}
}
rt = 1;
}
return (rt);
}
static void
{
int t = 0;
*interpose |= t;
*interpose |= t;
*interpose |= t;
if (!willpanic) {
if (*interpose) {
}
}
}
static void
{
}
static struct mch_error_code fat_fsb_error_code[] = {
};
static struct mch_error_code nf_fsb_error_code[] = {
};
static int
{
int rt = -1;
int nerr = 0;
int i;
int sz;
for (i = 0; i < sz; i++) {
nerr++;
}
}
for (i = 0; i < sz; i++) {
nerr++;
}
}
if (emask_fsb)
if (nerr > 1)
rt = -1;
return (rt);
}
static void
{
int t = 0;
*interpose |= t;
*interpose |= t;
*interpose |= t;
if (!willpanic) {
/*
* if interpose write read-only registers to clear from pcii
* cache
*/
if (*interpose) {
}
}
}
static struct mch_error_code fat_pex_error_code[] = {
{ 0, EMASK_UNCOR_PEX_IO0, PEX_FAT_IO0 }
};
static struct mch_error_code fat_unit_pex_5400_error_code[] = {
};
static struct mch_error_code fat_pex_5400_error_code[] = {
{ 0, EMASK_UNCOR_PEX_IO0, PEX_5400_FAT_IO0 }
};
static struct mch_error_code fat_rp_5400_error_code[] = {
};
static struct mch_error_code fat_rp_error_code[] = {
};
static struct mch_error_code uncor_pex_error_code[] = {
{ 0, EMASK_UNCOR_PEX_IO0, PEX_NF_IO0 }
};
static struct mch_error_code uncor_pex_5400_error_code[] = {
};
static struct mch_error_code cor_pex_error_code[] = {
{ 10, 0, PEX_NF_IO10 },
{ 2, 0, PEX_NF_IO2 }
};
static struct mch_error_code rp_pex_5400_error_code[] = {
};
static struct mch_error_code cor_pex_5400_error_code1[] = {
{ 0, EMASK_UNCOR_PEX_IO0, PEX_5400_NF_IO0 }
};
static struct mch_error_code cor_pex_5400_error_code2[] = {
};
static struct mch_error_code cor_pex_5400_error_code3[] = {
};
static struct mch_error_code rp_pex_error_code[] = {
};
static int
{
int rt = -1;
int nerr = 0;
int i;
int sz;
for (i = 0; i < sz; i++) {
nerr++;
}
}
for (i = 0; i < sz; i++) {
nerr++;
}
}
for (i = 0; i < sz; i++) {
nerr++;
}
}
for (i = 0; i < sz; i++) {
nerr++;
}
}
for (i = 0; i < sz; i++) {
nerr++;
}
}
if (nerr > 1)
rt = -1;
return (rt);
}
static struct mch_error_code fat_thr_error_code[] = {
};
static struct mch_error_code nf_thr_error_code[] = {
};
static int
{
int rt = -1;
int nerr = 0;
int i;
int sz;
for (i = 0; i < sz; i++) {
nerr++;
}
}
for (i = 0; i < sz; i++) {
nerr++;
}
}
if (emask_thr)
if (nerr > 1)
rt = -1;
return (rt);
}
static int
{
int rt = -1;
int nerr = 0;
int i;
int sz;
for (i = 0; i < sz; i++) {
nerr++;
}
}
for (i = 0; i < sz; i++) {
nerr++;
}
}
sz = sizeof (fat_unit_pex_5400_error_code) /
sizeof (struct mch_error_code);
for (i = 0; i < sz; i++) {
if (pex_fat &
nerr++;
}
}
sz = sizeof (uncor_pex_5400_error_code) /
sizeof (struct mch_error_code);
for (i = 0; i < sz; i++) {
nerr++;
}
}
for (i = 0; i < sz; i++) {
nerr++;
}
}
for (i = 0; i < sz; i++) {
nerr++;
}
}
for (i = 0; i < sz; i++) {
nerr++;
}
}
for (i = 0; i < sz; i++) {
nerr++;
}
}
if (nerr > 1)
rt = -1;
return (rt);
}
static void
{
int t = 0;
*interpose |= t;
*interpose |= t;
*interpose |= t;
else
if (!willpanic) {
if (*interpose)
if (*interpose)
if (*interpose)
PEXDEVSTS_WR(pex, 0);
}
}
static void
{
int t = 0;
*interpose |= t;
if (!willpanic) {
/*
* if interpose write read-only registers to clear from pcii
* cache
*/
if (*interpose) {
}
}
}
static void
{
int t = 0;
*interpose |= t;
} else {
}
if (!willpanic) {
/*
* if interpose write read-only registers to clear from pcii
* cache
*/
if (*interpose) {
}
}
}
static void
{
int interpose = 0;
int spurious = 0;
} else if ((ferr & GE_FBD_FATAL) != 0) {
} else if (nb_chipset == INTEL_NB_5400 &&
}
if (interpose)
else
if (!spurious) {
}
}
static void
{
int interpose = 0;
int spurious = 0;
} else if ((err & GE_NERR_FBD_FATAL) != 0) {
} else if ((err & GE_NERR_FBD_NF) != 0) {
&interpose);
}
if (interpose)
else
if (!spurious) {
}
}
/*ARGSUSED*/
void
{
int nmc = 0;
int i;
if (mutex_tryenter(&nb_mutex) == 0)
return;
nerr = NERR_GLOBAL_RD();
for (i = 0; i < NB_MAX_ERRORS; i++) {
ferr = FERR_GLOBAL_RD();
if (ferr) {
nmc++;
} else if (err) {
nmc++;
}
}
if (nerr) {
}
if (nmc == 0 && nb_mask_mc_set)
}
static void
{
int intel_error_list;
char buf[32];
if (intel_error_list >= 0)
else
}
static void
{
int intel_error_list;
char buf[32];
if (intel_error_list >= 0)
else
}
static void
{
int intel_error_list;
char buf[32];
if (intel_error_list >= 0)
else
}
static void
{
char buf[32];
}
}
}
if (sp->intel_error_list >= 0)
else
}
static void
{
char buf[32];
}
}
}
}
if (nb_chipset == INTEL_NB_7300) {
NULL);
NULL);
}
NULL);
NULL);
if (nb_chipset == INTEL_NB_7300) {
}
} else {
NULL);
}
if (sp->intel_error_list >= 0)
else
}
static void
{
}
static void
{
char buf[32];
if (data->intel_error_list >= 0) {
} else {
}
}
static void
{
case NB_REG_LOG_FSB:
break;
case NB_REG_LOG_PEX:
break;
case NB_REG_LOG_INT:
break;
case NB_REG_LOG_FAT_FBD:
break;
case NB_REG_LOG_NF_FBD:
break;
case NB_REG_LOG_DMA:
break;
case NB_REG_LOG_THR:
break;
default:
break;
}
}
void
{
int chip;
if (nb_chipset == INTEL_NB_7300)
else
} else {
}
}
void
{
int hostbridge;
"motherboard", 0);
} else {
"motherboard", 0,
"hostbridge", hostbridge);
}
if (nb_chipset == INTEL_NB_5400) {
} else {
}
} else {
if (nb_chipset == INTEL_NB_5400) {
} else {
}
}
} else {
}
}
void
void *data)
{
"motherboard", 0);
} else {
}
}
void
void *data)
{
char *intr;
"motherboard", 0,
"motherboard", 0,
"motherboard", 0,
} else {
"motherboard", 0);
}
}
void
void *data)
{
char *intr;
"motherboard", 0,
"motherboard", 0,
"motherboard", 0,
} else {
"motherboard", 0);
}
}
void
{
"motherboard", 0);
}
void
void *data)
{
"motherboard", 0);
}
nvlist_t *
{
case NB_REG_LOG_FSB:
break;
case NB_REG_LOG_PEX:
break;
case NB_REG_LOG_INT:
break;
case NB_REG_LOG_FAT_FBD:
break;
case NB_REG_LOG_NF_FBD:
break;
case NB_REG_LOG_DMA:
break;
case NB_REG_LOG_THR:
break;
default:
"motherboard", 0);
}
return (detector);
}
/*ARGSUSED*/
void
{
char buf[FM_MAX_CLASS];
if (panicstr) {
return;
/*
* Now try to allocate another element for scratch space and
* use that for further scratch space (eg for constructing
* nvlists to add the main ereport). If we can't reserve
* a scratch element just fallback to working within the
* element we already have, and hope for the best. All this
* is necessary because the fixed buffer nv allocator does
* not reclaim freed space and nvlist construction is
* expensive.
*/
else
} else {
}
return;
/*
* We're done with 'detector' so reclaim the scratch space.
*/
if (panicstr) {
} else {
}
/*
* Encode the error-specific data that was saved in the logout area.
*/
if (panicstr) {
if (scr_eqep)
} else {
}
}