mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-05-12 11:37:23 +00:00
Integrated Andy Wray's DDR3 SPD parser patch
This commit is contained in:
parent
72d66edc6c
commit
c30f036391
@ -60,6 +60,37 @@ const struct valstr spd_memtype_vals[] = {
|
|||||||
{ 0x06, "DDR SGRAM" },
|
{ 0x06, "DDR SGRAM" },
|
||||||
{ 0x07, "DDR SDRAM" },
|
{ 0x07, "DDR SDRAM" },
|
||||||
{ 0x08, "DDR2 SDRAM" },
|
{ 0x08, "DDR2 SDRAM" },
|
||||||
|
{ 0x09, "DDR2 SDRAM FB-DIMM" },
|
||||||
|
{ 0x0A, "DDR2 SDRAM FB-DIMM Probe" },
|
||||||
|
{ 0x0B, "DDR3 SDRAM" },
|
||||||
|
{ 0x00, NULL },
|
||||||
|
};
|
||||||
|
|
||||||
|
const struct valstr ddr3_density_vals[] =
|
||||||
|
{
|
||||||
|
{ 0, "256 Mb" },
|
||||||
|
{ 1, "512 Mb" },
|
||||||
|
{ 2, "1 Gb" },
|
||||||
|
{ 3, "2 Gb" },
|
||||||
|
{ 4, "4 Gb" },
|
||||||
|
{ 5, "8 Gb" },
|
||||||
|
{ 6, "16 Gb" },
|
||||||
|
{ 0x00, NULL },
|
||||||
|
};
|
||||||
|
|
||||||
|
const struct valstr ddr3_banks_vals[] =
|
||||||
|
{
|
||||||
|
{ 0, "3 (8 Banks)" },
|
||||||
|
{ 1, "4 (16 Banks)" },
|
||||||
|
{ 2, "5 (32 Banks)" },
|
||||||
|
{ 3, "6 (64 Banks)" },
|
||||||
|
{ 0x00, NULL },
|
||||||
|
};
|
||||||
|
|
||||||
|
const struct valstr ddr3_ecc_vals[] =
|
||||||
|
{
|
||||||
|
{ 0, "0 bits" },
|
||||||
|
{ 1, "8 bits" },
|
||||||
{ 0x00, NULL },
|
{ 0x00, NULL },
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -693,10 +724,86 @@ ipmi_spd_print(uint8_t *spd_data, int len)
|
|||||||
if (len < 92)
|
if (len < 92)
|
||||||
return -1; /* we need first 91 bytes to do our thing */
|
return -1; /* we need first 91 bytes to do our thing */
|
||||||
|
|
||||||
size = spd_data[5] * (spd_data[31] << 2);
|
|
||||||
printf(" Memory Size : %d MB\n", size);
|
|
||||||
printf(" Memory Type : %s\n",
|
printf(" Memory Type : %s\n",
|
||||||
val2str(spd_data[2], spd_memtype_vals));
|
val2str(spd_data[2], spd_memtype_vals));
|
||||||
|
|
||||||
|
if (spd_data[2] == 0x0B) /* DDR3 SDRAM */
|
||||||
|
{
|
||||||
|
int iPN;
|
||||||
|
char *pchPN = spd_data+128;
|
||||||
|
int sdram_cap = 0;
|
||||||
|
int pri_bus_width = 0;
|
||||||
|
int sdram_width = 0;
|
||||||
|
int ranks = 0;
|
||||||
|
int mem_size = 0;
|
||||||
|
|
||||||
|
if (len < 148)
|
||||||
|
return -1; /* we need first 91 bytes to do our thing */
|
||||||
|
|
||||||
|
|
||||||
|
sdram_cap = ldexp(256,(spd_data[4]&15));
|
||||||
|
pri_bus_width = ldexp(8,(spd_data[8]&7));
|
||||||
|
sdram_width = ldexp(4,(spd_data[7]&7));
|
||||||
|
ranks = ldexp(1,((spd_data[7]&0x3F)>>3));
|
||||||
|
mem_size = (sdram_cap/8) * (pri_bus_width/sdram_width) * ranks;
|
||||||
|
printf(" SDRAM Capacity : %d MB\n", sdram_cap );
|
||||||
|
printf(" Memory Banks : %s\n", val2str(spd_data[4]>>4, ddr3_banks_vals));
|
||||||
|
printf(" Primary Bus Width : %d bits\n", pri_bus_width );
|
||||||
|
printf(" SDRAM Device Width : %d bits\n", sdram_width );
|
||||||
|
printf(" Number of Ranks : %d\n", ranks );
|
||||||
|
printf(" Memory size : %d MB\n", mem_size );
|
||||||
|
|
||||||
|
/* printf(" Memory Density : %s\n", val2str(spd_data[4]&15, ddr3_density_vals)); */
|
||||||
|
printf(" 1.5 V Nominal Op : %s\n", (((spd_data[6]&1) != 0) ? "No":"Yes" ) );
|
||||||
|
printf(" 1.35 V Nominal Op : %s\n", (((spd_data[6]&2) != 0) ? "No":"Yes" ) );
|
||||||
|
printf(" 1.2X V Nominal Op : %s\n", (((spd_data[6]&4) != 0) ? "No":"Yes" ) );
|
||||||
|
printf(" Error Detect/Cor : %s\n", val2str(spd_data[8]>>3, ddr3_ecc_vals));
|
||||||
|
|
||||||
|
printf(" Manufacturer : ");
|
||||||
|
switch (spd_data[117]&127)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
printf("%s\n", val2str(spd_data[118], jedec_id1_vals));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 1:
|
||||||
|
printf("%s\n", val2str(spd_data[118], jedec_id2_vals));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 2:
|
||||||
|
printf("%s\n", val2str(spd_data[118], jedec_id3_vals));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 3:
|
||||||
|
printf("%s\n", val2str(spd_data[118], jedec_id4_vals));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 4:
|
||||||
|
printf("%s\n", val2str(spd_data[118], jedec_id5_vals));
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
printf("%s\n", "JEDEC JEP106 update required" );
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
printf(" Manufacture Date : year %c%c week %c%c\n",
|
||||||
|
'0'+(spd_data[120]>>4), '0'+(spd_data[120]&15), '0'+(spd_data[121]>>4), '0'+(spd_data[121]&15) );
|
||||||
|
|
||||||
|
printf(" Serial Number : %02x%02x%02x%02x\n",
|
||||||
|
spd_data[122], spd_data[123], spd_data[124], spd_data[125]);
|
||||||
|
|
||||||
|
printf(" Part Number : ");
|
||||||
|
for (iPN=0; iPN < 19; iPN++)
|
||||||
|
{
|
||||||
|
printf( "%c", *pchPN++ );
|
||||||
|
}
|
||||||
|
printf("\n");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
size = spd_data[5] * (spd_data[31] << 2);
|
||||||
|
printf(" Memory Size : %d MB\n", size);
|
||||||
printf(" Voltage Intf : %s\n",
|
printf(" Voltage Intf : %s\n",
|
||||||
val2str(spd_data[8], spd_voltage_vals));
|
val2str(spd_data[8], spd_voltage_vals));
|
||||||
printf(" Error Detect/Cor : %s\n",
|
printf(" Error Detect/Cor : %s\n",
|
||||||
@ -737,6 +844,7 @@ ipmi_spd_print(uint8_t *spd_data, int len)
|
|||||||
|
|
||||||
printf(" Serial Number : %02x%02x%02x%02x\n",
|
printf(" Serial Number : %02x%02x%02x%02x\n",
|
||||||
spd_data[95], spd_data[96], spd_data[97], spd_data[98]);
|
spd_data[95], spd_data[96], spd_data[97], spd_data[98]);
|
||||||
|
}
|
||||||
|
|
||||||
if (verbose) {
|
if (verbose) {
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user