ao.c revision 20c794b39650d115e17a15983b6b82e46238cf45
/*
* 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 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <mdb/mdb_modapi.h>
#include <amd_opteron/ao.h>
static const mdb_bitmask_t ao_nbcfg_bits[] = {
/* LdtLinkSel handled separately */
/* WdogTmrBaseSel handled separately */
/* WdogTmrCntSel handled separately */
/* WdogTmrDis handled separately */
};
/*ARGSUSED*/
static int
{
const mdb_bitmask_t *bm;
int nbits, i;
return (DCMD_USAGE);
continue;
nbits++;
}
}
if (val & AMD_NB_CFG_WDOGTMRDIS) {
"WdogTmrDis");
} else {
static const uint_t wdogcounts[] = {
4095, 2047, 1023, 511, 255, 127, 63, 31
};
int valid = 1;
const char *units;
else
valid = 0;
switch (basefld) {
units = "ms";
break;
units = "us";
break;
count *= 5;
units = "ns";
break;
default:
units = " (unknown units)";
break;
}
if (valid) {
units);
} else {
mdb_printf("\tInvalid Watchdog: Count %u, Base %u\n",
}
}
return (DCMD_OK);
}
static const char *ao_scrub_rate[] = {
"Do not scrub", /* 0b00000 */
"40.0 nanosec", /* 0b00001 */
"80.0 nanosec", /* 0b00010 */
"160.0 nanosec", /* 0b00011 */
"320.0 nanosec", /* 0b00100 */
"640.0 nanosec", /* 0b00101 */
"1.28 microsec", /* 0b00110 */
"2.56 microsec", /* 0b00111 */
"5.12 microsec", /* 0b01000 */
"10.2 microsec", /* 0b01001 */
"20.5 microsec", /* 0b01010 */
"41.0 microsec", /* 0b01011 */
"81.9 microsec", /* 0b01100 */
"163.8 microsec", /* 0b01101 */
"327.7 microsec", /* 0b01110 */
"655.4 microsec", /* 0b01111 */
"1.31 millsec", /* 0b10000 */
"2.62 millsec", /* 0b10001 */
"5.24 millsec", /* 0b10010 */
"10.49 millsec", /* 0b10011 */
"20.97 millsec", /* 0b10100 */
"42.00 millsec", /* 0b10101 */
"84.00 millsec", /* 0b10110 */
};
/*ARGSUSED*/
static int
{
return (DCMD_USAGE);
mdb_printf("\tDcacheScrub: %s\n\t L2Scrub: %s\n\t DramScrub: %s\n",
return (DCMD_OK);
}
/*ARGSUSED*/
static int
{
const char *itypes[] = {
"No Interrupt", /* 0b00 */
"Reserved", /* 0b01 */
"SMI", /* 0b10 */
"Reserved", /* 0b11 */
};
return (DCMD_USAGE);
"\t EccErrInt: %s\n"
"\tSwapDoneInt: %s\n"
"\t BadDramCs: %d\n"
"\t SwapDone: %s\n"
"\t SwapEn: %s\n",
return (DCMD_OK);
}
static const char *ao_mcactl_dc[] = {
"ECCI (Single-bit ECC Data Errors)",
"ECCM (Multi-bit ECC Data Errors)",
"DECC (Data Array ECC Errors)",
"DMTP (Main Tag Array Parity Errors)",
"DSTP (Snoop Tag Array Parity Errors)",
"L1TP (L1 TLB Parity Errors)",
"L2TP (L2 TLB Parity Errors)",
};
static const char *ao_mcactl_ic[] = {
"ECCI (Single-bit ECC data errors)",
"ECCM (Multi-bit ECC data errors)",
"IDP (Data array parity errors)",
"IMTP (Main tag array parity errors)",
"ISTP (Snoop tag array parity errors)",
"L1TP (L1 TLB Parity Errors)",
"L2TP (L2 TLB Parity Errors)",
NULL, /* reserved */
NULL, /* reserved */
"RDDE (Read Data Errors)",
};
static const char *ao_mcactl_bu[] = {
"S_RDE_HP (System read data hardware prefetch)",
"S_RDE_TLB (System read data TLB reload)",
"S_RDE_ALL (All system read data)",
"S_ECC1_TLB (System data 1-bit ECC TLB reload)",
"S_ECC1_HP (System data 1-bit ECC hardware prefetch)",
"S_ECCM_TLB (System data multi-bit ECC TLB reload)",
"S_ECCM_HP (System data multi-bit ECC hardware prefetch)",
"L2T_PAR_ICDC (L2 tag array parity IC or DC fetch)",
"L2T_PAR_TLB (L2 tag array parity TLB reload)",
"L2T_PAR_SNP (L2 tag array parity snoop)",
"L2T_PAR_CPB (L2 tag array parity copyback)",
"L2T_PAR_SCR (L2 tag array parity scrub)",
"L2D_ECC1_TLB (L2 data array 1-bit ECC TLB reload)",
"L2D_ECC1_SNP (L2 data array 1-bit ECC snoop)",
"L2D_ECC1_CPB (L2 data array 1-bit ECC copyback)",
"L2D_ECCM_TLB (L2 data array multi-bit ECC TLB reload)",
"L2D_ECCM_SNP (L2 data array multi-bit ECC snoop)",
"L2D_ECCM_CPB (L2 data array multi-bit ECC copyback)",
"L2T_ECC1_SCR (L2 tag array 1-bit ECC Scrub)",
"L2T_ECCM_SCR (L2 tag array multi-bit ECC Scrub)",
};
static const char *ao_mcactl_ls[] = {
"S_RDE_L (Read Data Errors on Load)",
"S_RDE_S (Read Data Errors on Store)",
};
static const char *ao_mcactl_nb[] = {
"CorrEccEn (Correctable ECC Error Reporting Enable)",
"UnCorrEccEn (Uncorrectable ECC Error Reporting Enable)",
"CrcErr0En (HT Link 0 CRC Error Reporting Enable)",
"CrcErr1En (HT Link 1 CRC Error Reporting Enable)",
"CrcErr2En (HT Link 2 CRC Error Reporting Enable)",
"SyncPkt0En (HT Link 0 Sync Packet Error Reporting Enable)",
"SyncPkt1En (HT Link 1 Sync Packet Error Reporting Enable)",
"SyncPkt2En (HT Link 2 Sync Packet Error Reporting Enable)",
"MstrAbrtEn (Master Abort Error Reporting Enable)",
"TgtAbrtEn (Target Abort Error Reporting Enable)",
"GartTblWkEn (GART Table Walk Error Reporting Enable)",
"AtomicRMWEn (Atomic Read-Modify-Write Error Reporting Enable)",
"WchDogTmrEn (Watchdog Timer Error Reporting Enable)",
NULL, /* reserved */
NULL, /* reserved */
NULL, /* reserved */
NULL, /* reserved */
NULL, /* reserved */
"DramParEn (DRAM Parity Error Reporting enable)",
};
static const struct ao_mcactl {
const char *bank_name;
const char **bank_ctlbits;
int bank_tblsz;
} ao_mcactls[] = {
};
#define AO_MCI_CTL 0x0
#define AO_MCI_MASK 0x1
static int
{
int i;
return (DCMD_USAGE);
return (DCMD_USAGE);
for (i = 0; i < AMD_MCA_BANK_COUNT; i++) {
2) == 0) {
bank = i;
break;
}
}
if (i == AMD_MCA_BANK_COUNT) {
mdb_warn("Valid bank names: dc, ic, bu, ls, nb\n");
return (DCMD_ERR);
}
for (i = 0; i < 63; i++) {
if (inrange) {
if (known)
else
mdb_printf("reserved%s\n",
} else if (set) {
mdb_printf("%2d %4s Reserved - but set!\n",
i, "Yes");
}
}
return (DCMD_OK);
}
/*ARGSUSED3*/
static int
{
}
/*ARGSUSED3*/
static int
{
}
static const mdb_dcmd_t dcmds[] = {
{ "ao_nbcfg", ":", "decode Northbridge config bits",
{ "ao_scrubctl", ":", "decode Scrub Control Register",
{ "ao_sparectl", ":", "decode Online Spare Control Register",
{ "ao_mci_ctl", ": -t <dc|ic|bu|ls|nb>",
"decode MCi_CTL", ao_mci_ctl },
{ "ao_mci_mask", ": -t <dc|ic|bu|ls|nb>",
"decode MCi_MASK", ao_mci_mask },
{ NULL }
};
static const mdb_walker_t walkers[] = {
{ NULL }
};
const mdb_modinfo_t *
_mdb_init(void)
{
return (&modinfo);
}