Revert "arch/x86/smbios: Correct manufacturer ID"

This reverts commit c86da67436.

Alas, I have to disagree with this in every single line. The comment
added to the top of the file only applies to a single function therein
which sits over a hundred lines below. That's not much helpful. More-
over, the link in the comment is already down ofc.

The comment is also irritating as it doesn't state in which way (enco-
ding!) it applies to the code, which presumably led to the wrong in-
terpretation of the IDs.

At last, if anything should have changed it is the strings, the IDs
are resolved to. `smbios_fill_dimm_manufacturer_from_id()` has to
resolve the IDs it gets actually fed and not a random selection from
any spec.

Since I digged into it, here's why the numbers are correct: The func-
tion started with the SPD encoding of DDR3 in mind. There, the lower
byte is the number of a "bank" of IDs with an odd-parity in the upper
most bit. The upper byte is the ID within the bank. The "correction"
was to clear the parity bit for naught. The function was later exten-
ded with IDs in the DDR2-SPD encoding (which is actually 64-bit not
16). There, a byte, starting from the lowest, is either an ID below
127 plus odd-parity, or 127 which means look in the next byte/bank.
Unused bytes seem to be filled with 0xff, I guess from the 0xff2c.

Change-Id: Icdb48e4f2c102f619fbdca856e938e85135cfb18
Reviewed-on: https://review.coreboot.org/17873
Tested-by: build bot (Jenkins)
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Martin Roth <martinroth@google.com>
This commit is contained in:
Nico Huber 2016-12-14 23:48:09 +01:00
parent 9e70ce0c3e
commit a01695bf9a
1 changed files with 9 additions and 12 deletions

View File

@ -15,13 +15,6 @@
* GNU General Public License for more details. * GNU General Public License for more details.
*/ */
/*
* Standard Manufacturer's Identification Code
* JEP106AS (Revision of JEP106AR, October 2015)
* MAY 2016
* http://www.jedec.org/standards-documents/results/JEP106AS
*/
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <smbios.h> #include <smbios.h>
@ -134,7 +127,7 @@ static int smbios_processor_name(char *start)
void smbios_fill_dimm_manufacturer_from_id(uint16_t mod_id, struct smbios_type17 *t) void smbios_fill_dimm_manufacturer_from_id(uint16_t mod_id, struct smbios_type17 *t)
{ {
switch (mod_id) { switch (mod_id) {
case 0x9b05: case 0x2c80:
t->manufacturer = smbios_add_string(t->eos, t->manufacturer = smbios_add_string(t->eos,
"Crucial"); "Crucial");
break; break;
@ -150,7 +143,7 @@ void smbios_fill_dimm_manufacturer_from_id(uint16_t mod_id, struct smbios_type17
t->manufacturer = smbios_add_string(t->eos, t->manufacturer = smbios_add_string(t->eos,
"Kingston"); "Kingston");
break; break;
case 0xad00: case 0x987f:
t->manufacturer = smbios_add_string(t->eos, t->manufacturer = smbios_add_string(t->eos,
"Hynix"); "Hynix");
break; break;
@ -162,7 +155,11 @@ void smbios_fill_dimm_manufacturer_from_id(uint16_t mod_id, struct smbios_type17
t->manufacturer = smbios_add_string(t->eos, t->manufacturer = smbios_add_string(t->eos,
"OCZ"); "OCZ");
break; break;
case 0x3406: case 0xad80:
t->manufacturer = smbios_add_string(t->eos,
"Hynix/Hyundai");
break;
case 0xb502:
t->manufacturer = smbios_add_string(t->eos, t->manufacturer = smbios_add_string(t->eos,
"SuperTalent"); "SuperTalent");
break; break;
@ -170,7 +167,7 @@ void smbios_fill_dimm_manufacturer_from_id(uint16_t mod_id, struct smbios_type17
t->manufacturer = smbios_add_string(t->eos, t->manufacturer = smbios_add_string(t->eos,
"GSkill"); "GSkill");
break; break;
case 0xce00: case 0xce80:
t->manufacturer = smbios_add_string(t->eos, t->manufacturer = smbios_add_string(t->eos,
"Samsung"); "Samsung");
break; break;
@ -178,7 +175,7 @@ void smbios_fill_dimm_manufacturer_from_id(uint16_t mod_id, struct smbios_type17
t->manufacturer = smbios_add_string(t->eos, t->manufacturer = smbios_add_string(t->eos,
"Elpida"); "Elpida");
break; break;
case 0x2c00: case 0xff2c:
t->manufacturer = smbios_add_string(t->eos, t->manufacturer = smbios_add_string(t->eos,
"Micron"); "Micron");
break; break;