chip_label.c revision 4557a2a1868181b517f5dfe61ba6eeba58edf4c0
/*
* 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 <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <strings.h>
#include <libnvpair.h>
#include <fm/topo_mod.h>
#define BUFSZ 128
static char *
{
char *fmtstr;
return (NULL);
}
return (NULL);
}
return (fmtstr);
}
static int
{
}
nvlist_free(*out);
}
!= 0) {
nvlist_free(*out);
}
nvlist_free(*out);
}
return (0);
}
/*
* This is a somewhat generic property method for labelling the dimm slots on
* correlation between the dimm topo node instance number and the dimm slot
* label number. It takes the following two arguments:
*
* format: a string containing a printf-like format with a single %d token
* which this method computes
*
* i.e.: DIMM %d
*
* offset: a numeric offset that we'll number the dimms from. This is to
* allow for the fact that some systems number the dimm slots
* from zero and others start from one (like the Ultra 20)
*/
/* ARGSUSED */
int
{
int err;
return (err);
}
return (err);
}
return (err);
}
/* LINTED: E_SEC_PRINTF_VAR_FMT */
return (err);
}
return (0);
}
/*
* This is a somewhat generic property method for labelling the dimm slots on
*
* format: a string containing a printf-like format with a two %d tokens
* for the cpu and dimm slot label numbers, which this method
* computes
*
* i.e.: CPU %d DIMM %d
*
* offset: a numeric offset that we'll number the dimms from. This is to
* allow for the fact that some systems number the dimm slots
* from zero while others may start from one
*
* order: "reverse" or "forward" - sets the direction of the correlation
* between dimm topo node instance number and DIMM slot number
*
* dimms_per_chip: the number of DIMM slots per chip
*/
/* ARGSUSED */
int
{
int err;
return (err);
}
return (err);
}
!= 0) {
return (err);
}
return (err);
}
return (err);
}
/* LINTED: E_SEC_PRINTF_VAR_FMT */
/* LINTED: E_SEC_PRINTF_VAR_FMT */
else {
return (err);
}
return (err);
}
return (0);
}
/*
* This method assumes a correspondence between the dimm topo node instance
* number and the dimm slot label number, but unlike simple_chip_label_mp, the
* slot numbers aren't reused between CPU's. This method assumes there
* are 4 DIMM slots per chip. It takes the following two arguments:
*
* format: a string containing a printf-like format with a single %d token
* which this method computes
*
* i.e.: DIMM %d
*
* offset: a numeric offset that we'll number the dimms from. This is to
* allow for the fact that some systems number the dimm slots
* from zero and others may start from one
*
* order: "reverse" or "forward" - sets the direction of the correlation
* between dimm topo node instance number and DIMM slot number
*/
/* ARGSUSED */
int
{
int err;
return (err);
}
return (err);
}
return (err);
}
return (err);
}
/* LINTED: E_SEC_PRINTF_VAR_FMT */
/* LINTED: E_SEC_PRINTF_VAR_FMT */
else {
return (err);
}
return (err);
}
return (0);
}
/*
* This is a somewhat generic property method for labelling the CPU sockets on
* the chip topo node instance number and the CPU socket label number. It takes
* the following two arguments:
*
* format: a string containing a printf-like format with a single %d token
* which this method computes
*
* i.e.: CPU %d
*
* offset: a numeric offset that we'll number the CPU's from. This is to
* allow for the fact that some systems number the CPU sockets
* from zero and others start from one (like the X4X00-M2 systems)
*/
/* ARGSUSED */
int
{
int err;
return (err);
}
return (err);
}
return (err);
}
/* LINTED: E_SEC_PRINTF_VAR_FMT */
return (err);
}
return (0);
}
/*
* This is a custom property method for generating the CPU slot label for the
* Galaxy 4E/4F platforms.
*
* format: a string containing a printf-like format with a single %c token
* which this method computes
*
* i.e.: CPU %c
*/
/* ARGSUSED */
int
{
/*
* G4 HT node ID to FRU label translation. The g4map array
* is indexed by (number of coherent nodes) / 2 - 1.
* The value for a given number of nodes is a char array
* indexed by node ID.
*/
const char *g4map[] = {
"AB", /* 2 nodes */
"ADEH", /* 4 nodes */
"ABDEFH", /* 6 nodes */
"ACBDEFGH" /* 8 nodes */
};
return (err);
}
"property\n");
return (err);
}
/* HT nodes must number 0 .. num_nodes - 1 */
}
switch (num_nodes) {
case (2):
case (4):
case (6):
case (8):
/* htid is already range-checked */
break;
default:
" %d\n", num_nodes);
}
/* LINTED: E_SEC_PRINTF_VAR_FMT */
return (err);
}
return (0);
}