/*
* 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
*/
/*
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <strings.h>
#include <libnvpair.h>
#include <libipmi.h>
#include <fm/topo_mod.h>
#include <ctype.h>
#include "chip.h"
/*
* The following table maps DIMM manufacturer names to a JEDEC ID as sourced
* from JEDEC publication JEP106W. This is (obviously) a sparse table which
* only contains entries for manufacturers whose DIMM's have been qualified
* for use on Sun platforms.
*/
{
{ "HYUNDAI ELECTRONICS", "00AD" },
{ "INFINEON", "00C1" },
{ "MICRON TECHNOLOGY", "002C" },
{ "QIMONDA", "7F51" },
{ "SAMSUNG", "00CE" },
};
static int
{
char *fru_data;
}
== NULL) {
ipmi_errmsg(hdl));
}
ipmi_errmsg(hdl));
}
ipmi_errmsg(hdl));
}
/*
* Newer ILOM software that has the fix for CR 6607996 will have
* an 18-character serial number that has been synthesized using
* the recipe from the Sun SPD JEDEC DIMM specification. If we
* find an 18-character then we'll simply use it, as-is, and
* return.
*/
if (serial_len == 18) {
return (0);
}
/*
* Older ILOM software that DOESN'T have the fix for CR 6607996 will
* only provide the 8 character manufacturer serial number.
*
* However, if for some reason the product info area doesn't have the
* serial information or if the serial isn't 8 characters (we may
* encounter SP's that don't populate the serial field or are buggy and
* populate it with garbage), then we'll stop right now and just set the
* buf to an empty string.
*/
if (serial_len != 8) {
*buf = '\0';
return (0);
}
/*
* What follows is a very crude adaptation of the recipe from the
* Sun SPD JEDEC DIMM specification for synthesizing globally unique
* serial numbers from the 8 character manufacturer serial number.
*
* The Sun serial number takes the following form:
*
* jjjjllyywwssssssss
*
* The components are:
*
* yyyy: JEDEC ID in hex (2 byte manufacture ID, 2 byte continuation
* code).
*
* ll: The memory module's manufacturing location.
*
* yyww: The module's manufacturing date (2-digit year/2-digit week)
*
* ssssssss: The 8 character maufacturer serial number
*/
/*
* First we need to normalize the manufacturer name we pulled out of
* the FRU product info area. Our normalization algorithm is fairly
* simple:
* - convert all alpha chars to uppercase
* - convert non-alphanumeric characters to a single space
*
* We use the normalized name to lookup the JEDEC ID from a static
* table. If the FRU area didn't have a manufacturer name or if the ID
* lookup fails we'll set jjjj to 0000.
*/
for (i = 0; prod_info.ifpi_manuf_name[i]; i++) {
prod_info.ifpi_manuf_name[i] =
}
for (i = 0; i < JEDEC_TBL_SZ; i++)
found_id = 1;
break;
}
if (found_id)
else
/*
* The manufacturing location and date is not available via IPMI on
* Sun platforms, so we simply set these six digits to zeros.
*/
/*
* Finally, we just copy the 8 character product serial straight over
* and then NULL terminate the string.
*/
return (0);
}
/* ARGSUSED */
int
{
}
for (i = 0; i < nelems; i++) {
break;
} else
"%s\n", entity_refs[i]);
}
if (! found_serial)
/* topo errno already set */
rv = -1;
}
for (i = 0; i < nelems; i++)
return (rv);
}