Skip to content

Commit 656b536

Browse files
committed
mb/{clevo,novacustom}: Add SMBIOS DIMM locators
Change-Id: Ie3aaa65b272f097c7fa0805dd254e8999a776561 Signed-off-by: Michał Kopeć <michal.kopec@3mdeb.com>
1 parent de85fb2 commit 656b536

4 files changed

Lines changed: 66 additions & 6 deletions

File tree

src/mainboard/clevo/adl-p/ramstage.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,3 +281,19 @@ void mainboard_update_soc_chip_config(struct soc_intel_alderlake_config *config)
281281
else
282282
config->s0ix_enable = 1;
283283
}
284+
285+
void smbios_fill_dimm_locator(const struct dimm_info *dimm,
286+
struct smbios_type17 *t)
287+
{
288+
switch (dimm->ctrlr_num) {
289+
case 0:
290+
t->device_locator = smbios_add_string(t->eos, "RAM1");
291+
break;
292+
case 1:
293+
t->device_locator = smbios_add_string(t->eos, "RAM2");
294+
break;
295+
default:
296+
t->device_locator = smbios_add_string(t->eos, "UNKNOWN");
297+
break;
298+
}
299+
}

src/mainboard/clevo/tgl-u/ramstage.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,3 +226,19 @@ struct chip_operations mainboard_ops = {
226226
.enable_dev = mainboard_enable,
227227
.init = init_mainboard,
228228
};
229+
230+
void smbios_fill_dimm_locator(const struct dimm_info *dimm,
231+
struct smbios_type17 *t)
232+
{
233+
switch (dimm->ctrlr_num) {
234+
case 0:
235+
t->device_locator = smbios_add_string(t->eos, "RAM1");
236+
break;
237+
case 1:
238+
t->device_locator = smbios_add_string(t->eos, "RAM2");
239+
break;
240+
default:
241+
t->device_locator = smbios_add_string(t->eos, "UNKNOWN");
242+
break;
243+
}
244+
}

src/mainboard/novacustom/mtl-h/variants/dgpu/ramstage.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <device/pci_ids.h>
1010
#include <device/pci_ops.h>
1111
#include <device/pci_def.h>
12+
#include <smbios.h>
1213
#include <soc/intel/common/reset.h>
1314

1415
void variant_devtree_update(void)
@@ -88,3 +89,19 @@ void variant_final(void)
8889
set_dgpu_only();
8990

9091
}
92+
93+
void smbios_fill_dimm_locator(const struct dimm_info *dimm,
94+
struct smbios_type17 *t)
95+
{
96+
switch (dimm->ctrlr_num) {
97+
case 0:
98+
t->device_locator = smbios_add_string(t->eos, "RAM1");
99+
break;
100+
case 1:
101+
t->device_locator = smbios_add_string(t->eos, "RAM2");
102+
break;
103+
default:
104+
t->device_locator = smbios_add_string(t->eos, "UNKNOWN");
105+
break;
106+
}
107+
}
Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
1-
/* SPDX-License-Identifier: CC-PDDC */
1+
/* SPDX-License-Identifier: GPL-2.0-only */
22

3-
/* Please update the license if adding licensable material. */
3+
#include <smbios.h>
44

5-
/*
6-
* This is a placeholder, if there ever is something variant specific to
7-
* add to ramstage, do it here.
8-
*/
5+
void smbios_fill_dimm_locator(const struct dimm_info *dimm,
6+
struct smbios_type17 *t)
7+
{
8+
switch (dimm->ctrlr_num) {
9+
case 0:
10+
t->device_locator = smbios_add_string(t->eos, "RAM2");
11+
break;
12+
case 1:
13+
t->device_locator = smbios_add_string(t->eos, "RAM1");
14+
break;
15+
default:
16+
t->device_locator = smbios_add_string(t->eos, "UNKNOWN");
17+
break;
18+
}
19+
}

0 commit comments

Comments
 (0)