summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mainboard/intel/avenuecity_crb/Makefile.mk2
-rw-r--r--src/mainboard/intel/avenuecity_crb/config/dimm_slot.c18
-rw-r--r--src/mainboard/intel/avenuecity_crb/ramstage.c31
-rw-r--r--src/mainboard/intel/avenuecity_crb/romstage.c10
-rw-r--r--src/mainboard/intel/beechnutcity_crb/Makefile.mk2
-rw-r--r--src/mainboard/intel/beechnutcity_crb/config/dimm_slot.c18
-rw-r--r--src/mainboard/intel/beechnutcity_crb/ramstage.c31
-rw-r--r--src/mainboard/intel/beechnutcity_crb/romstage.c10
-rw-r--r--src/soc/intel/xeon_sp/gnr/include/soc/dimm_slot.h28
9 files changed, 148 insertions, 2 deletions
diff --git a/src/mainboard/intel/avenuecity_crb/Makefile.mk b/src/mainboard/intel/avenuecity_crb/Makefile.mk
index 2e1a74a45a..cfff6d3851 100644
--- a/src/mainboard/intel/avenuecity_crb/Makefile.mk
+++ b/src/mainboard/intel/avenuecity_crb/Makefile.mk
@@ -2,5 +2,7 @@
bootblock-y += bootblock.c
romstage-y += romstage.c
+romstage-y += config/dimm_slot.c
romstage-y += config/iio.c
+ramstage-y += config/dimm_slot.c
ramstage-y += ramstage.c
diff --git a/src/mainboard/intel/avenuecity_crb/config/dimm_slot.c b/src/mainboard/intel/avenuecity_crb/config/dimm_slot.c
new file mode 100644
index 0000000000..00d5e13df4
--- /dev/null
+++ b/src/mainboard/intel/avenuecity_crb/config/dimm_slot.c
@@ -0,0 +1,18 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <commonlib/helpers.h>
+#include <soc/dimm_slot.h>
+
+/*
+ * TODO: add the rest of DIMM slots
+ */
+static const struct dimm_slot_config dimm_slot_config_table[] = {
+ /* socket, channel, dimm, dev_locator, bank_locator, asset_tag */
+ {0, 0, 0, "CPU0_DIMM_A1", "BANK 0", "CPU0_DIMM_A1_AssetTag"},
+};
+
+const struct dimm_slot_config *get_dimm_slot_config_table(int *size)
+{
+ *size = ARRAY_SIZE(dimm_slot_config_table);
+ return dimm_slot_config_table;
+}
diff --git a/src/mainboard/intel/avenuecity_crb/ramstage.c b/src/mainboard/intel/avenuecity_crb/ramstage.c
index a09016d461..37d7d731dd 100644
--- a/src/mainboard/intel/avenuecity_crb/ramstage.c
+++ b/src/mainboard/intel/avenuecity_crb/ramstage.c
@@ -1,8 +1,39 @@
/* SPDX-License-Identifier: GPL-2.0-only */
+#include <soc/dimm_slot.h>
#include <soc/ramstage.h>
void mainboard_silicon_init_params(FSPS_UPD *params)
{
}
+
+void smbios_fill_dimm_locator(const struct dimm_info *dimm, struct smbios_type17 *t)
+{
+ int size;
+ const struct dimm_slot_config *dimm_slot_config_table = get_dimm_slot_config_table(&size);
+
+ for (int i = 0; i < size; i++) {
+ if (DIMM_SLOT_EQUAL(dimm_slot_config_table[i],
+ dimm->soc_num, dimm->channel_num, dimm->dimm_num)) {
+ const char *locator = dimm_slot_config_table[i].dev_locator;
+ t->device_locator = smbios_add_string(t->eos, locator);
+ locator = dimm_slot_config_table[i].bank_locator;
+ t->bank_locator = smbios_add_string(t->eos, locator);
+ }
+ }
+}
+
+void smbios_fill_dimm_asset_tag(const struct dimm_info *dimm, struct smbios_type17 *t)
+{
+ int size;
+ const struct dimm_slot_config *dimm_slot_config_table = get_dimm_slot_config_table(&size);
+
+ for (int i = 0; i < size; i++) {
+ if (DIMM_SLOT_EQUAL(dimm_slot_config_table[i],
+ dimm->soc_num, dimm->channel_num, dimm->dimm_num)) {
+ const char *asset_tag = dimm_slot_config_table[i].asset_tag;
+ t->asset_tag = smbios_add_string(t->eos, asset_tag);
+ }
+ }
+}
diff --git a/src/mainboard/intel/avenuecity_crb/romstage.c b/src/mainboard/intel/avenuecity_crb/romstage.c
index f0e67af21e..446d4e2be7 100644
--- a/src/mainboard/intel/avenuecity_crb/romstage.c
+++ b/src/mainboard/intel/avenuecity_crb/romstage.c
@@ -7,6 +7,7 @@
#include <fmap_config.h>
#include <device/device.h>
#include <soc/ddr.h>
+#include <soc/dimm_slot.h>
#include <soc/iio.h>
#include <soc/romstage.h>
@@ -43,6 +44,13 @@ void mainboard_memory_init_params(FSPM_UPD *mupd)
bool mainboard_dimm_slot_exists(uint8_t socket, uint8_t channel, uint8_t dimm)
{
- //TODO: not implemented yet
+ int size;
+ const struct dimm_slot_config *dimm_slot_config_table = get_dimm_slot_config_table(&size);
+
+ for (int i = 0; i < size; i++) {
+ if (DIMM_SLOT_EQUAL(dimm_slot_config_table[i], socket, channel, dimm))
+ return true;
+ }
+
return false;
}
diff --git a/src/mainboard/intel/beechnutcity_crb/Makefile.mk b/src/mainboard/intel/beechnutcity_crb/Makefile.mk
index 2e1a74a45a..cfff6d3851 100644
--- a/src/mainboard/intel/beechnutcity_crb/Makefile.mk
+++ b/src/mainboard/intel/beechnutcity_crb/Makefile.mk
@@ -2,5 +2,7 @@
bootblock-y += bootblock.c
romstage-y += romstage.c
+romstage-y += config/dimm_slot.c
romstage-y += config/iio.c
+ramstage-y += config/dimm_slot.c
ramstage-y += ramstage.c
diff --git a/src/mainboard/intel/beechnutcity_crb/config/dimm_slot.c b/src/mainboard/intel/beechnutcity_crb/config/dimm_slot.c
new file mode 100644
index 0000000000..00d5e13df4
--- /dev/null
+++ b/src/mainboard/intel/beechnutcity_crb/config/dimm_slot.c
@@ -0,0 +1,18 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <commonlib/helpers.h>
+#include <soc/dimm_slot.h>
+
+/*
+ * TODO: add the rest of DIMM slots
+ */
+static const struct dimm_slot_config dimm_slot_config_table[] = {
+ /* socket, channel, dimm, dev_locator, bank_locator, asset_tag */
+ {0, 0, 0, "CPU0_DIMM_A1", "BANK 0", "CPU0_DIMM_A1_AssetTag"},
+};
+
+const struct dimm_slot_config *get_dimm_slot_config_table(int *size)
+{
+ *size = ARRAY_SIZE(dimm_slot_config_table);
+ return dimm_slot_config_table;
+}
diff --git a/src/mainboard/intel/beechnutcity_crb/ramstage.c b/src/mainboard/intel/beechnutcity_crb/ramstage.c
index a09016d461..37d7d731dd 100644
--- a/src/mainboard/intel/beechnutcity_crb/ramstage.c
+++ b/src/mainboard/intel/beechnutcity_crb/ramstage.c
@@ -1,8 +1,39 @@
/* SPDX-License-Identifier: GPL-2.0-only */
+#include <soc/dimm_slot.h>
#include <soc/ramstage.h>
void mainboard_silicon_init_params(FSPS_UPD *params)
{
}
+
+void smbios_fill_dimm_locator(const struct dimm_info *dimm, struct smbios_type17 *t)
+{
+ int size;
+ const struct dimm_slot_config *dimm_slot_config_table = get_dimm_slot_config_table(&size);
+
+ for (int i = 0; i < size; i++) {
+ if (DIMM_SLOT_EQUAL(dimm_slot_config_table[i],
+ dimm->soc_num, dimm->channel_num, dimm->dimm_num)) {
+ const char *locator = dimm_slot_config_table[i].dev_locator;
+ t->device_locator = smbios_add_string(t->eos, locator);
+ locator = dimm_slot_config_table[i].bank_locator;
+ t->bank_locator = smbios_add_string(t->eos, locator);
+ }
+ }
+}
+
+void smbios_fill_dimm_asset_tag(const struct dimm_info *dimm, struct smbios_type17 *t)
+{
+ int size;
+ const struct dimm_slot_config *dimm_slot_config_table = get_dimm_slot_config_table(&size);
+
+ for (int i = 0; i < size; i++) {
+ if (DIMM_SLOT_EQUAL(dimm_slot_config_table[i],
+ dimm->soc_num, dimm->channel_num, dimm->dimm_num)) {
+ const char *asset_tag = dimm_slot_config_table[i].asset_tag;
+ t->asset_tag = smbios_add_string(t->eos, asset_tag);
+ }
+ }
+}
diff --git a/src/mainboard/intel/beechnutcity_crb/romstage.c b/src/mainboard/intel/beechnutcity_crb/romstage.c
index f0e67af21e..446d4e2be7 100644
--- a/src/mainboard/intel/beechnutcity_crb/romstage.c
+++ b/src/mainboard/intel/beechnutcity_crb/romstage.c
@@ -7,6 +7,7 @@
#include <fmap_config.h>
#include <device/device.h>
#include <soc/ddr.h>
+#include <soc/dimm_slot.h>
#include <soc/iio.h>
#include <soc/romstage.h>
@@ -43,6 +44,13 @@ void mainboard_memory_init_params(FSPM_UPD *mupd)
bool mainboard_dimm_slot_exists(uint8_t socket, uint8_t channel, uint8_t dimm)
{
- //TODO: not implemented yet
+ int size;
+ const struct dimm_slot_config *dimm_slot_config_table = get_dimm_slot_config_table(&size);
+
+ for (int i = 0; i < size; i++) {
+ if (DIMM_SLOT_EQUAL(dimm_slot_config_table[i], socket, channel, dimm))
+ return true;
+ }
+
return false;
}
diff --git a/src/soc/intel/xeon_sp/gnr/include/soc/dimm_slot.h b/src/soc/intel/xeon_sp/gnr/include/soc/dimm_slot.h
new file mode 100644
index 0000000000..41e9efb997
--- /dev/null
+++ b/src/soc/intel/xeon_sp/gnr/include/soc/dimm_slot.h
@@ -0,0 +1,28 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#ifndef _SOC_DIMM_SLOT_H_
+#define _SOC_DIMM_SLOT_H_
+
+#include <stdint.h>
+
+struct dimm_slot_config {
+ uint8_t socket;
+ uint8_t channel;
+ uint8_t dimm;
+ /*
+ * Refer to DSP0134_3.6.0.pdf
+ * page 103 'Device Locator', 'Bank Locator' and 'Asset Tag'.
+ */
+ const char *dev_locator;
+ const char *bank_locator;
+ const char *asset_tag;
+};
+
+#define DIMM_SLOT_EQUAL(dimm_slot, s, c, d) (\
+ (dimm_slot.socket == s) &&\
+ (dimm_slot.channel == c) &&\
+ (dimm_slot.dimm == d))
+
+const struct dimm_slot_config *get_dimm_slot_config_table(int *size);
+
+#endif /* _SOC_DIMM_SLOT_H_ */