mb/ocp/deltalake: Populate SMBIOS data and set the read PPIN to BMC
[coreboot.git] / src / mainboard / ocp / deltalake / ramstage.c
bloba8f92ad04a19551ff984475ce714c03b5cb6e588
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <console/console.h>
4 #include <drivers/ipmi/ipmi_ops.h>
5 #include <drivers/ocp/dmi/ocp_dmi.h>
6 #include <soc/ramstage.h>
8 #include "ipmi.h"
10 extern struct fru_info_str fru_strings;
12 static void dl_oem_smbios_strings(struct device *dev, struct smbios_type11 *t)
14 uint8_t pcie_config = 0;
16 /* OEM string 1 to 6 */
17 ocp_oem_smbios_strings(dev, t);
19 /* TODO: Add real OEM string 7, add TBF for now */
20 t->count = smbios_add_oem_string(t->eos, TBF);
22 /* Add OEM string 8 */
23 if (ipmi_get_pcie_config(&pcie_config) == CB_SUCCESS) {
24 switch (pcie_config) {
25 case PCIE_CONFIG_UNKNOWN:
26 t->count = smbios_add_oem_string(t->eos, "0x0: Unknown");
27 break;
28 case PCIE_CONFIG_A:
29 t->count = smbios_add_oem_string(t->eos, "0x1: YV3 Config-A");
30 break;
31 case PCIE_CONFIG_B:
32 t->count = smbios_add_oem_string(t->eos, "0x2: YV3 Config-B");
33 break;
34 case PCIE_CONFIG_C:
35 t->count = smbios_add_oem_string(t->eos, "0x3: YV3 Config-C");
36 break;
37 case PCIE_CONFIG_D:
38 t->count = smbios_add_oem_string(t->eos, "0x4: YV3 Config-D");
39 break;
40 default:
41 t->count = smbios_add_oem_string(t->eos, "Check BMC return data");
43 } else {
44 printk(BIOS_ERR, "Failed to get IPMI PCIe config\n");
48 static void mainboard_enable(struct device *dev)
50 dev->ops->get_smbios_strings = dl_oem_smbios_strings,
51 read_fru_areas(CONFIG_BMC_KCS_BASE, CONFIG_FRU_DEVICE_ID, 0, &fru_strings);
54 void mainboard_silicon_init_params(FSPS_UPD *params)
58 static void mainboard_final(void *chip_info)
60 struct ppin_req req = {0};
62 req.cpu0_lo = xeon_sp_ppin[0].lo;
63 req.cpu0_hi = xeon_sp_ppin[0].hi;
64 /* Set PPIN to BMC */
65 if (ipmi_set_ppin(&req) != CB_SUCCESS)
66 printk(BIOS_ERR, "ipmi_set_ppin failed\n");
69 struct chip_operations mainboard_ops = {
70 .enable_dev = mainboard_enable,
71 .final = mainboard_final,