blob: d748b1b176fee1e2f4f9e65073c86722c93d6140 [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>
Patrick Rudolph30e743e2022-05-02 09:55:20 +02005
6#include "include/spr_sbp1_gpio.h"
Naresh Solankice3c77c2023-05-23 18:52:24 +02007#include <bootstate.h>
Patrick Rudolph30e743e2022-05-02 09:55:20 +02008
9void mainboard_silicon_init_params(FSPS_UPD *params)
10{
11 /* configure Emmitsburg PCH GPIO controller after FSP-M */
12 gpio_configure_pads(gpio_table, ARRAY_SIZE(gpio_table));
13}
Naresh Solankice3c77c2023-05-23 18:52:24 +020014
Patrick Rudolph5ca756f2023-07-20 08:59:03 +020015void smbios_fill_dimm_locator(const struct dimm_info *dimm, struct smbios_type17 *t)
16{
17 const u8 so = dimm->soc_num;
18 const u8 ch = dimm->channel_num;
19 const u8 mm = dimm->dimm_num;
20
21 char dev_loc[10] = { "\x00" };
22 snprintf(dev_loc, sizeof(dev_loc), "DIMM C%u%c%u", so, 'A' + ch, mm);
23 t->device_locator = smbios_add_string(t->eos, dev_loc);
24
25 char bnk_loc[10] = { "\x00" };
26 snprintf(bnk_loc, sizeof(bnk_loc), "BANK C%u%c%u", so, 'A' + ch, mm);
27 t->bank_locator = smbios_add_string(t->eos, bnk_loc);
28}
29
Naresh Solankice3c77c2023-05-23 18:52:24 +020030static void finalize_boot(void *unused)
31{
32 printk(BIOS_DEBUG, "FM_BIOS_POST_CMPLT_N cleared.\n");
33 /* Clear FM_BIOS_POST_CMPLT_N */
34 gpio_output(GPPC_C17, 0);
35}
36
Patrick Rudolph7a593ab2024-01-25 15:15:00 +010037void smm_mainboard_pci_resource_store_init(struct smm_pci_resource_info *slots, size_t size)
38{
39 soc_ubox_store_resources(slots, size);
40}
41
Naresh Solankice3c77c2023-05-23 18:52:24 +020042BOOT_STATE_INIT_ENTRY(BS_PAYLOAD_BOOT, BS_ON_ENTRY, finalize_boot, NULL);