blob: 98aa999827ef60e8a412f0dd28bb9b1f7fa1c03b [file] [log] [blame]
Patrick Rudolph30e743e2022-05-02 09:55:20 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Patrick Rudolph7a593ab2024-01-25 15:15:00 +01002#include <cpu/x86/smm.h>
Patrick Rudolph30e743e2022-05-02 09:55:20 +02003#include <soc/ramstage.h>
Patrick Rudolph7a593ab2024-01-25 15:15:00 +01004#include <soc/smmrelocate.h>
Elyes Haouasbdd03c22024-05-27 11:20:07 +02005#include <stdio.h>
Patrick Rudolph30e743e2022-05-02 09:55:20 +02006
7#include "include/spr_sbp1_gpio.h"
Naresh Solankice3c77c2023-05-23 18:52:24 +02008#include <bootstate.h>
Patrick Rudolph30e743e2022-05-02 09:55:20 +02009
10void mainboard_silicon_init_params(FSPS_UPD *params)
11{
12 /* configure Emmitsburg PCH GPIO controller after FSP-M */
13 gpio_configure_pads(gpio_table, ARRAY_SIZE(gpio_table));
14}
Naresh Solankice3c77c2023-05-23 18:52:24 +020015
Patrick Rudolph5ca756f2023-07-20 08:59:03 +020016void smbios_fill_dimm_locator(const struct dimm_info *dimm, struct smbios_type17 *t)
17{
18 const u8 so = dimm->soc_num;
19 const u8 ch = dimm->channel_num;
20 const u8 mm = dimm->dimm_num;
21
22 char dev_loc[10] = { "\x00" };
23 snprintf(dev_loc, sizeof(dev_loc), "DIMM C%u%c%u", so, 'A' + ch, mm);
24 t->device_locator = smbios_add_string(t->eos, dev_loc);
25
26 char bnk_loc[10] = { "\x00" };
27 snprintf(bnk_loc, sizeof(bnk_loc), "BANK C%u%c%u", so, 'A' + ch, mm);
28 t->bank_locator = smbios_add_string(t->eos, bnk_loc);
29}
30
Naresh Solankice3c77c2023-05-23 18:52:24 +020031static void finalize_boot(void *unused)
32{
33 printk(BIOS_DEBUG, "FM_BIOS_POST_CMPLT_N cleared.\n");
34 /* Clear FM_BIOS_POST_CMPLT_N */
35 gpio_output(GPPC_C17, 0);
36}
37
Patrick Rudolph7a593ab2024-01-25 15:15:00 +010038void smm_mainboard_pci_resource_store_init(struct smm_pci_resource_info *slots, size_t size)
39{
40 soc_ubox_store_resources(slots, size);
41}
42
Naresh Solankice3c77c2023-05-23 18:52:24 +020043BOOT_STATE_INIT_ENTRY(BS_PAYLOAD_BOOT, BS_ON_ENTRY, finalize_boot, NULL);