summaryrefslogtreecommitdiff
path: root/lib/dimm_spd.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/dimm_spd.c')
-rw-r--r--lib/dimm_spd.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/lib/dimm_spd.c b/lib/dimm_spd.c
index 8b6927c..41e30db 100644
--- a/lib/dimm_spd.c
+++ b/lib/dimm_spd.c
@@ -1340,11 +1340,10 @@ ipmi_spd_print(uint8_t *spd_data, int len)
printf(" Memory Type : %s\n",
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;
@@ -1353,7 +1352,7 @@ ipmi_spd_print(uint8_t *spd_data, int len)
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));
@@ -1366,7 +1365,7 @@ ipmi_spd_print(uint8_t *spd_data, int len)
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" ) );
@@ -1417,16 +1416,15 @@ ipmi_spd_print(uint8_t *spd_data, int len)
}
- printf(" Manufacture Date : year %c%c week %c%c\n",
+ 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++ );
+ for (iPN = 128; iPN < 146; iPN++) {
+ printf("%c", spd_data[iPN]);
}
printf("\n");
} else if (spd_data[2] == 0x0C) /* DDR4 SDRAM */
@@ -1552,7 +1550,7 @@ ipmi_spd_print(uint8_t *spd_data, int len)
val2str(spd_data[8], spd_voltage_vals));
printf(" Error Detect/Cor : %s\n",
val2str(spd_data[11], spd_config_vals));
-
+
/* handle jedec table bank continuation values */
printf(" Manufacturer : ");
if (spd_data[64] != 0x7f)
@@ -1603,7 +1601,7 @@ ipmi_spd_print(uint8_t *spd_data, int len)
part[18] = 0;
printf(" Part Number : %s\n", part);
}
-
+
printf(" Serial Number : %02x%02x%02x%02x\n",
spd_data[95], spd_data[96], spd_data[97], spd_data[98]);
}