Skip to content

Commit

Permalink
gpllib: Updating dmi code
Browse files Browse the repository at this point in the history
This is a simple rebase of the current code against current dmidecode
version. This is pretty lame copy/paste but as we don't have a
libification of dmidecode, that does the job.

This patch does improve mostly the cpu & ram reporting.
  • Loading branch information
ErwanAliasr1 committed Sep 4, 2015
1 parent 87472a3 commit bd8ccab
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 30 deletions.
2 changes: 1 addition & 1 deletion com32/gpllib/dmi/dmi.c
Expand Up @@ -231,7 +231,7 @@ void dmi_bios_characteristics_x2(uint8_t code, s_dmi * dmi)
{
int i;

for (i = 0; i <= 2; i++)
for (i = 0; i <= 4; i++)
if (code & (1 << i))
((bool *) (&dmi->bios.characteristics_x2))[i] = true;
}
Expand Down
4 changes: 3 additions & 1 deletion com32/gpllib/dmi/dmi_bios.c
Expand Up @@ -75,5 +75,7 @@ const char *bios_charac_x1_strings[] = {
const char *bios_charac_x2_strings[] = {
"BIOS boot specification is supported", /* 0 */
"Function key-initiated network boot is supported",
"Targeted content distribution is supported" /* 2 */
"Targeted content distribution is supported",
"UEFI is supported",
"System is a virtual machine" /* 4 */
};
5 changes: 3 additions & 2 deletions com32/gpllib/dmi/dmi_cache.c
Expand Up @@ -130,10 +130,11 @@ const char *dmi_cache_associativity(uint8_t code)
"24-way Set-associative",
"32-way Set-associative",
"48-way Set-associative",
"64-way Set-associative" /* 0x0D */
"64-way Set-associative",
"20-way Set-associative" /* 0x0E */
};

if (code >= 0x01 && code <= 0x0D)
if (code >= 0x01 && code <= 0x0E)
return type[code - 0x01];
return out_of_spec;
}
9 changes: 6 additions & 3 deletions com32/gpllib/dmi/dmi_chassis.c
Expand Up @@ -57,14 +57,17 @@ const char *dmi_chassis_type(uint8_t code)
"RAID Chassis",
"Rack Mount Chassis",
"Sealed-case PC",
"Multi-system", /* 0x19 */
"Multi-system",
"CompactPCI",
"AdvancedTCA",
"Blade",
"Blade Enclosing" /* 0x1D */
"Blade Enclosing",
"Tablet",
"Convertible",
"Detachable" /* 0x20 */
};

if (code >= 0x01 && code <= 0x1D)
if (code >= 0x01 && code <= 0x20)
return type[code - 0x01];
return out_of_spec;
}
Expand Down
26 changes: 17 additions & 9 deletions com32/gpllib/dmi/dmi_memory.c
Expand Up @@ -124,15 +124,20 @@ const char *dmi_memory_device_type(uint8_t code)
"RDRAM",
"DDR",
"DDR2",
"DDR2 FB-DIMM", /* 0x14 */
NULL,
NULL,
NULL,
"DDR3", /* 0x18 */
"FBD2" /* 0x19 */
"DDR2 FB-DIMM",
"Reserved",
"Reserved",
"Reserved",
"DDR3",
"FBD2",
"DDR4",
"LPDDR",
"LPDDR2",
"LPDDR3",
"LPDDR4" /* 0x1E */
};

if (code >= 0x01 && code <= 0x19)
if (code >= 0x01 && code <= 0x1E)
return type[code - 0x01];
return out_of_spec;
}
Expand All @@ -152,15 +157,18 @@ void dmi_memory_device_type_detail(uint16_t code, char *type_detail, int sizeof_
"EDO",
"Window DRAM",
"Cache DRAM",
"Non-Volatile" /* 12 */
"Non-Volatile",
"Registered (Buffered)",
"Unbuffered (Unregistered)",
"LRDIMM" /* 15 */
};

if ((code & 0x1FFE) == 0)
sprintf(type_detail, "%s", "None");
else {
int i;

for (i = 1; i <= 12; i++)
for (i = 1; i <= 15; i++)
if (code & (1 << i))
snprintf(type_detail, sizeof_type_detail, "%s", detail[i - 1]);
}
Expand Down
51 changes: 37 additions & 14 deletions com32/gpllib/dmi/dmi_processor.c
Expand Up @@ -256,8 +256,8 @@ const char *dmi_processor_family(uint8_t code, char *manufacturer)
"G5",
"ESA/390 G6", /* 0xCB */
"z/Architectur",
NULL,
NULL,
"Core i5",
"Core i3",
NULL,
NULL, /*0xD0 */
NULL,
Expand All @@ -268,29 +268,29 @@ const char *dmi_processor_family(uint8_t code, char *manufacturer)
"Multi-Core Xeon", /*0xD6 */
"Dual-Core Xeon 3xxx",
"Quad-Core Xeon 3xxx", /*0xD8 */
NULL,
"Nano",
"Dual-Core Xeon 5xxx", /*0xDA */
"Quad-Core Xeon 5xxx",
NULL,
"Dual-Core Xeon 7xxx", /*0xDD */
"Quad-Core Xeon 7xxx",
"Multi-Core Xeon 7xxx",
NULL, /*0xE0 */
NULL,
NULL,
"Multi-Core Xeon 3400", /*0xE0 */
NULL,
NULL,
NULL,
"Opteron 3000",
"Sempron II",
"Embedded Opteron Quad-Core", /* 0xE6 */
"Phenom Triple-Core",
"Turion Ultra Dual-Core Mobile",
"Turion Dual-Core Mobile",
"Athlon Dual-Core",
"Sempron SI", /*0xEB */
NULL,
NULL,
NULL,
NULL,
"Phenom II",
"Athlon II",
"Six-Core Opteron",
"Sempron M",
NULL,
NULL,
NULL,
Expand Down Expand Up @@ -367,17 +367,40 @@ const char *dmi_processor_upgrade(uint8_t code)
"Socket 478",
"Socket 754",
"Socket 940",
"Socket 939" /* 0x12 */
"Socket 939",
"Socket mPGA604",
"Socket LGA771",
"Socket LGA775",
"Socket S1",
"Socket AM2",
"Socket F (1207)"
"Socket LGA1366" /* 0x19 */
"Socket F (1207)",
"Socket LGA1366",
"Socket G34",
"Socket AM3",
"Socket C32",
"Socket LGA1156",
"Socket LGA1567",
"Socket PGA988A",
"Socket BGA1288",
"Socket rPGA988B",
"Socket BGA1023",
"Socket BGA1224",
"Socket BGA1155",
"Socket LGA1356",
"Socket LGA2011",
"Socket FS1",
"Socket FS2",
"Socket FM1",
"Socket FM2",
"Socket LGA2011-3",
"Socket LGA1356-3",
"Socket LGA1150",
"Socket BGA1168",
"Socket BGA1234",
"Socket BGA1364" /* 0x30 */
};

if (code >= 0x01 && code <= 0x19)
if (code >= 0x01 && code <= 0x30)
return upgrade[code - 0x01];
return out_of_spec;
}
Expand Down

0 comments on commit bd8ccab

Please sign in to comment.