summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPatrick Rudolph <patrick.rudolph@9elements.com>2021-02-11 15:09:22 +0100
committerAngel Pons <th3fanbus@gmail.com>2021-02-16 10:43:11 +0000
commitff251d21d0de23228b1c10e5b78d49294171c92b (patch)
treedc397b1419cd0b92b8a833bf08046d8faff3ab49 /src
parent20eb3506ca3d29ef59de81fb0070628582682751 (diff)
device/dram: Move SPD manufacturer names out of arch/x86
Move SPD manufacturer ID decoding to device/dram. Will be used by the following patch outside of SMBIOS scope as well. Change-Id: Iec175cd6ab1d20761da955785e4bc0e87ae02dbb Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/50544 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/arch/x86/smbios.c37
-rw-r--r--src/device/dram/Makefile.inc2
-rw-r--r--src/device/dram/spd.c37
-rw-r--r--src/include/device/dram/spd.h10
4 files changed, 50 insertions, 36 deletions
diff --git a/src/arch/x86/smbios.c b/src/arch/x86/smbios.c
index 8bc49b18ad..1bf62c9993 100644
--- a/src/arch/x86/smbios.c
+++ b/src/arch/x86/smbios.c
@@ -5,6 +5,7 @@
#include <console/console.h>
#include <version.h>
#include <device/device.h>
+#include <device/dram/spd.h>
#include <arch/cpu.h>
#include <cpu/x86/name.h>
#include <elog.h>
@@ -154,44 +155,10 @@ static int smbios_processor_name(u8 *start)
return smbios_add_string(start, str);
}
-static const char *get_dimm_manufacturer_name(const uint16_t mod_id)
-{
- switch (mod_id) {
- case 0x9b85:
- return "Crucial";
- case 0x4304:
- return "Ramaxel";
- case 0x4f01:
- return "Transcend";
- case 0x9801:
- return "Kingston";
- case 0x987f:
- return "Hynix";
- case 0x9e02:
- return "Corsair";
- case 0xb004:
- return "OCZ";
- case 0xad80:
- return "Hynix/Hyundai";
- case 0x3486:
- return "Super Talent";
- case 0xcd04:
- return "GSkill";
- case 0xce80:
- return "Samsung";
- case 0xfe02:
- return "Elpida";
- case 0x2c80:
- return "Micron";
- default:
- return NULL;
- }
-}
-
/* this function will fill the corresponding manufacturer */
void smbios_fill_dimm_manufacturer_from_id(uint16_t mod_id, struct smbios_type17 *t)
{
- const char *const manufacturer = get_dimm_manufacturer_name(mod_id);
+ const char *const manufacturer = spd_manufacturer_name(mod_id);
if (manufacturer) {
t->manufacturer = smbios_add_string(t->eos, manufacturer);
diff --git a/src/device/dram/Makefile.inc b/src/device/dram/Makefile.inc
index f7118dbbc2..69fcfa8844 100644
--- a/src/device/dram/Makefile.inc
+++ b/src/device/dram/Makefile.inc
@@ -1,3 +1,3 @@
romstage-y += ddr4.c ddr3.c ddr2.c ddr_common.c
-ramstage-y += ddr4.c ddr3.c ddr2.c ddr_common.c
+ramstage-y += ddr4.c ddr3.c ddr2.c ddr_common.c spd.c
diff --git a/src/device/dram/spd.c b/src/device/dram/spd.c
new file mode 100644
index 0000000000..9a9a767fc2
--- /dev/null
+++ b/src/device/dram/spd.c
@@ -0,0 +1,37 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#include <device/dram/spd.h>
+
+const char *spd_manufacturer_name(const uint16_t mod_id)
+{
+ switch (mod_id) {
+ case 0x9b85:
+ return "Crucial";
+ case 0x4304:
+ return "Ramaxel";
+ case 0x4f01:
+ return "Transcend";
+ case 0x9801:
+ return "Kingston";
+ case 0x987f:
+ return "Hynix";
+ case 0x9e02:
+ return "Corsair";
+ case 0xb004:
+ return "OCZ";
+ case 0xad80:
+ return "Hynix/Hyundai";
+ case 0x3486:
+ return "Super Talent";
+ case 0xcd04:
+ return "GSkill";
+ case 0xce80:
+ return "Samsung";
+ case 0xfe02:
+ return "Elpida";
+ case 0x2c80:
+ return "Micron";
+ default:
+ return NULL;
+ }
+}
diff --git a/src/include/device/dram/spd.h b/src/include/device/dram/spd.h
new file mode 100644
index 0000000000..c677f4ce9b
--- /dev/null
+++ b/src/include/device/dram/spd.h
@@ -0,0 +1,10 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#ifndef DEVICE_DRAM_SPD_H
+#define DEVICE_DRAM_SPD_H
+
+#include <types.h>
+
+const char *spd_manufacturer_name(const uint16_t mod_id);
+
+#endif /* DEVICE_DRAM_SPD_H */