Patrick Rudolph | 30e743e | 2022-05-02 09:55:20 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Patrick Rudolph | 7a593ab | 2024-01-25 15:15:00 +0100 | [diff] [blame^] | 2 | #include <cpu/x86/smm.h> |
Patrick Rudolph | 30e743e | 2022-05-02 09:55:20 +0200 | [diff] [blame] | 3 | #include <soc/ramstage.h> |
Patrick Rudolph | 7a593ab | 2024-01-25 15:15:00 +0100 | [diff] [blame^] | 4 | #include <soc/smmrelocate.h> |
Patrick Rudolph | 30e743e | 2022-05-02 09:55:20 +0200 | [diff] [blame] | 5 | |
| 6 | #include "include/spr_sbp1_gpio.h" |
Naresh Solanki | ce3c77c | 2023-05-23 18:52:24 +0200 | [diff] [blame] | 7 | #include <bootstate.h> |
Patrick Rudolph | 30e743e | 2022-05-02 09:55:20 +0200 | [diff] [blame] | 8 | |
| 9 | void 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 Solanki | ce3c77c | 2023-05-23 18:52:24 +0200 | [diff] [blame] | 14 | |
Patrick Rudolph | 5ca756f | 2023-07-20 08:59:03 +0200 | [diff] [blame] | 15 | void 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 Solanki | ce3c77c | 2023-05-23 18:52:24 +0200 | [diff] [blame] | 30 | static 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 Rudolph | 7a593ab | 2024-01-25 15:15:00 +0100 | [diff] [blame^] | 37 | void 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 Solanki | ce3c77c | 2023-05-23 18:52:24 +0200 | [diff] [blame] | 42 | BOOT_STATE_INIT_ENTRY(BS_PAYLOAD_BOOT, BS_ON_ENTRY, finalize_boot, NULL); |