Patrick Georgi | ac95903 | 2020-05-05 22:49:26 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
Andrey Petrov | 42c4e88 | 2016-02-25 14:17:45 -0800 | [diff] [blame] | 2 | |
Arthur Heymans | fdf6d12 | 2022-05-17 13:07:30 +0200 | [diff] [blame] | 3 | #include <arch/null_breakpoint.h> |
Kyösti Mälkki | 4949a3d | 2021-01-09 20:38:43 +0200 | [diff] [blame] | 4 | #include <bootsplash.h> |
Andrey Petrov | 42c4e88 | 2016-02-25 14:17:45 -0800 | [diff] [blame] | 5 | #include <cbfs.h> |
Aaron Durbin | 32ac018 | 2016-07-18 00:35:42 -0500 | [diff] [blame] | 6 | #include <cbmem.h> |
| 7 | #include <commonlib/fsp.h> |
Subrata Banik | 44ffb5d | 2018-05-24 10:51:29 +0530 | [diff] [blame] | 8 | #include <commonlib/stdlib.h> |
Andrey Petrov | 42c4e88 | 2016-02-25 14:17:45 -0800 | [diff] [blame] | 9 | #include <console/console.h> |
| 10 | #include <fsp/api.h> |
| 11 | #include <fsp/util.h> |
Aaron Durbin | 32ac018 | 2016-07-18 00:35:42 -0500 | [diff] [blame] | 12 | #include <program_loading.h> |
Subrata Banik | 25d1002 | 2023-04-26 16:32:29 +0530 | [diff] [blame] | 13 | #include <soc/intel/common/reset.h> |
Keith Short | c58e3bd | 2019-05-10 11:14:31 -0600 | [diff] [blame] | 14 | #include <soc/intel/common/vbt.h> |
Brandon Breitenstein | c6ec8dd | 2016-11-17 12:23:04 -0800 | [diff] [blame] | 15 | #include <stage_cache.h> |
Andrey Petrov | 42c4e88 | 2016-02-25 14:17:45 -0800 | [diff] [blame] | 16 | #include <string.h> |
Alexandru Gagniuc | 010225c | 2016-05-06 08:22:45 -0700 | [diff] [blame] | 17 | #include <timestamp.h> |
Elyes HAOUAS | bd1683d | 2019-05-15 21:05:37 +0200 | [diff] [blame] | 18 | #include <types.h> |
Patrick Rudolph | 40beb36 | 2020-12-01 10:08:38 +0100 | [diff] [blame] | 19 | #include <mode_switch.h> |
Andrey Petrov | 42c4e88 | 2016-02-25 14:17:45 -0800 | [diff] [blame] | 20 | |
| 21 | struct fsp_header fsps_hdr; |
| 22 | |
Subrata Banik | 33d9c4a | 2020-05-26 18:26:54 +0530 | [diff] [blame] | 23 | struct fsp_multi_phase_get_number_of_phases_params { |
| 24 | uint32_t number_of_phases; |
| 25 | uint32_t phases_executed; |
| 26 | }; |
| 27 | |
| 28 | /* Callbacks for SoC/Mainboard specific overrides */ |
| 29 | void __weak platform_fsp_multi_phase_init_cb(uint32_t phase_index) |
| 30 | { |
| 31 | /* Leave for the SoC/Mainboard to implement if necessary. */ |
| 32 | } |
| 33 | |
Subrata Banik | 33d9c4a | 2020-05-26 18:26:54 +0530 | [diff] [blame] | 34 | /* FSP Specification < 2.2 has only 1 stage like FspSiliconInit. FSP specification >= 2.2 |
| 35 | * has multiple stages as below. |
| 36 | */ |
| 37 | enum fsp_silicon_init_phases { |
| 38 | FSP_SILICON_INIT_API, |
| 39 | FSP_MULTI_PHASE_SI_INIT_GET_NUMBER_OF_PHASES_API, |
| 40 | FSP_MULTI_PHASE_SI_INIT_EXECUTE_PHASE_API |
| 41 | }; |
| 42 | |
| 43 | static void fsps_return_value_handler(enum fsp_silicon_init_phases phases, uint32_t status) |
| 44 | { |
| 45 | uint8_t postcode; |
| 46 | |
| 47 | /* Handle any reset request returned by FSP-S APIs */ |
| 48 | fsp_handle_reset(status); |
| 49 | |
| 50 | if (status == FSP_SUCCESS) |
| 51 | return; |
| 52 | /* Handle all other errors returned by FSP-S APIs */ |
| 53 | /* Assume video failure if attempted to initialize graphics */ |
| 54 | if (CONFIG(RUN_FSP_GOP) && vbt_get()) |
lilacious | 40cb3fe | 2023-06-21 23:24:14 +0200 | [diff] [blame^] | 55 | postcode = POSTCODE_VIDEO_FAILURE; |
Subrata Banik | 33d9c4a | 2020-05-26 18:26:54 +0530 | [diff] [blame] | 56 | else |
lilacious | 40cb3fe | 2023-06-21 23:24:14 +0200 | [diff] [blame^] | 57 | postcode = POSTCODE_HW_INIT_FAILURE; /* else generic */ |
Subrata Banik | 33d9c4a | 2020-05-26 18:26:54 +0530 | [diff] [blame] | 58 | |
| 59 | switch (phases) { |
| 60 | case FSP_SILICON_INIT_API: |
| 61 | die_with_post_code(postcode, "FspSiliconInit returned with error 0x%08x\n", |
| 62 | status); |
| 63 | break; |
| 64 | case FSP_MULTI_PHASE_SI_INIT_GET_NUMBER_OF_PHASES_API: |
| 65 | printk(BIOS_SPEW, "FspMultiPhaseSiInit NumberOfPhases returned 0x%08x\n", |
| 66 | status); |
| 67 | break; |
| 68 | case FSP_MULTI_PHASE_SI_INIT_EXECUTE_PHASE_API: |
| 69 | printk(BIOS_SPEW, "FspMultiPhaseSiInit ExecutePhase returned 0x%08x\n", |
| 70 | status); |
| 71 | break; |
| 72 | default: |
| 73 | break; |
| 74 | } |
| 75 | } |
| 76 | |
Subrata Banik | 298b359 | 2021-09-14 12:38:08 +0530 | [diff] [blame] | 77 | bool fsp_is_multi_phase_init_enabled(void) |
| 78 | { |
| 79 | return CONFIG(FSPS_USE_MULTI_PHASE_INIT) && |
Julian Schroeder | 8a576f6 | 2021-11-02 16:32:28 -0500 | [diff] [blame] | 80 | (fsps_hdr.fsp_multi_phase_si_init_entry_offset != 0); |
Subrata Banik | 298b359 | 2021-09-14 12:38:08 +0530 | [diff] [blame] | 81 | } |
| 82 | |
| 83 | static void fsp_fill_common_arch_params(FSPS_UPD *supd) |
| 84 | { |
| 85 | #if CONFIG(FSPS_HAS_ARCH_UPD) |
| 86 | FSPS_ARCH_UPD *s_arch_cfg = &supd->FspsArchUpd; |
| 87 | s_arch_cfg->EnableMultiPhaseSiliconInit = fsp_is_multi_phase_init_enabled(); |
| 88 | #endif |
| 89 | } |
| 90 | |
Lee Leahy | 9671faa | 2016-07-24 18:18:52 -0700 | [diff] [blame] | 91 | static void do_silicon_init(struct fsp_header *hdr) |
Andrey Petrov | 42c4e88 | 2016-02-25 14:17:45 -0800 | [diff] [blame] | 92 | { |
Subrata Banik | 44ffb5d | 2018-05-24 10:51:29 +0530 | [diff] [blame] | 93 | FSPS_UPD *upd, *supd; |
Andrey Petrov | 42c4e88 | 2016-02-25 14:17:45 -0800 | [diff] [blame] | 94 | fsp_silicon_init_fn silicon_init; |
Brandon Breitenstein | c31ba0e | 2016-07-27 17:34:45 -0700 | [diff] [blame] | 95 | uint32_t status; |
Subrata Banik | 33d9c4a | 2020-05-26 18:26:54 +0530 | [diff] [blame] | 96 | fsp_multi_phase_si_init_fn multi_phase_si_init; |
| 97 | struct fsp_multi_phase_params multi_phase_params; |
| 98 | struct fsp_multi_phase_get_number_of_phases_params multi_phase_get_number; |
Andrey Petrov | 42c4e88 | 2016-02-25 14:17:45 -0800 | [diff] [blame] | 99 | |
Elyes Haouas | 1ef547e | 2022-11-18 15:05:39 +0100 | [diff] [blame] | 100 | supd = (FSPS_UPD *)(uintptr_t)(hdr->cfg_region_offset + hdr->image_base); |
Andrey Petrov | 42c4e88 | 2016-02-25 14:17:45 -0800 | [diff] [blame] | 101 | |
Felix Held | 8899598 | 2021-01-28 22:43:52 +0100 | [diff] [blame] | 102 | fsp_verify_upd_header_signature(supd->FspUpdHeader.Signature, FSPS_UPD_SIGNATURE); |
Andrey Petrov | 42c4e88 | 2016-02-25 14:17:45 -0800 | [diff] [blame] | 103 | |
Nikolai Vyssotski | 175e4c5 | 2021-02-11 18:25:43 -0600 | [diff] [blame] | 104 | /* FSPS UPD and coreboot structure sizes should match. However, enforcing the exact |
| 105 | * match mandates simultaneous updates to coreboot and FSP repos. Allow coreboot |
| 106 | * to proceed if its UPD structure is smaller than FSP one to enable staggered UPD |
| 107 | * update process on both sides. The mismatch indicates a temporary build problem, |
| 108 | * don't leave it like this as FSP default settings can be bad choices for coreboot. |
Marshall Dawson | 71dbcf1 | 2019-09-11 14:02:34 -0600 | [diff] [blame] | 109 | */ |
Nikolai Vyssotski | 175e4c5 | 2021-02-11 18:25:43 -0600 | [diff] [blame] | 110 | if (!hdr->cfg_region_size || hdr->cfg_region_size < sizeof(FSPS_UPD)) |
lilacious | 40cb3fe | 2023-06-21 23:24:14 +0200 | [diff] [blame^] | 111 | die_with_post_code(POSTCODE_INVALID_VENDOR_BINARY, |
Marshall Dawson | 71dbcf1 | 2019-09-11 14:02:34 -0600 | [diff] [blame] | 112 | "Invalid FSPS UPD region\n"); |
Nikolai Vyssotski | 175e4c5 | 2021-02-11 18:25:43 -0600 | [diff] [blame] | 113 | else if (hdr->cfg_region_size > sizeof(FSPS_UPD)) |
| 114 | printk(BIOS_ERR, "FSP and coreboot are out of sync! FSPS UPD size > coreboot\n"); |
Subrata Banik | 44ffb5d | 2018-05-24 10:51:29 +0530 | [diff] [blame] | 115 | |
Marshall Dawson | 71dbcf1 | 2019-09-11 14:02:34 -0600 | [diff] [blame] | 116 | upd = xmalloc(hdr->cfg_region_size); |
| 117 | |
| 118 | memcpy(upd, supd, hdr->cfg_region_size); |
Andrey Petrov | 42c4e88 | 2016-02-25 14:17:45 -0800 | [diff] [blame] | 119 | |
Subrata Banik | 298b359 | 2021-09-14 12:38:08 +0530 | [diff] [blame] | 120 | /* Fill common settings on behalf of chipset. */ |
| 121 | if (CONFIG(FSPS_HAS_ARCH_UPD)) |
| 122 | fsp_fill_common_arch_params(upd); |
Andrey Petrov | 42c4e88 | 2016-02-25 14:17:45 -0800 | [diff] [blame] | 123 | /* Give SoC/mainboard a chance to populate entries */ |
Subrata Banik | 44ffb5d | 2018-05-24 10:51:29 +0530 | [diff] [blame] | 124 | platform_fsp_silicon_init_params_cb(upd); |
Andrey Petrov | 42c4e88 | 2016-02-25 14:17:45 -0800 | [diff] [blame] | 125 | |
Wim Vervoorn | d137150 | 2019-12-17 14:10:16 +0100 | [diff] [blame] | 126 | /* Populate logo related entries */ |
Kyösti Mälkki | 4949a3d | 2021-01-09 20:38:43 +0200 | [diff] [blame] | 127 | if (CONFIG(BMP_LOGO)) |
| 128 | soc_load_logo(upd); |
Wim Vervoorn | cbc878d2 | 2019-11-28 14:45:12 +0100 | [diff] [blame] | 129 | |
Lee Leahy | 672df16 | 2016-07-24 18:21:13 -0700 | [diff] [blame] | 130 | /* Call SiliconInit */ |
Elyes Haouas | 1ef547e | 2022-11-18 15:05:39 +0100 | [diff] [blame] | 131 | silicon_init = (void *)(uintptr_t)(hdr->image_base + |
Julian Schroeder | 8a576f6 | 2021-11-02 16:32:28 -0500 | [diff] [blame] | 132 | hdr->fsp_silicon_init_entry_offset); |
Subrata Banik | 44ffb5d | 2018-05-24 10:51:29 +0530 | [diff] [blame] | 133 | fsp_debug_before_silicon_init(silicon_init, supd, upd); |
Lee Leahy | 672df16 | 2016-07-24 18:21:13 -0700 | [diff] [blame] | 134 | |
| 135 | timestamp_add_now(TS_FSP_SILICON_INIT_START); |
lilacious | 40cb3fe | 2023-06-21 23:24:14 +0200 | [diff] [blame^] | 136 | post_code(POSTCODE_FSP_SILICON_INIT); |
Patrick Rudolph | 40beb36 | 2020-12-01 10:08:38 +0100 | [diff] [blame] | 137 | |
Arthur Heymans | fdf6d12 | 2022-05-17 13:07:30 +0200 | [diff] [blame] | 138 | /* FSP disables the interrupt handler so remove debug exceptions temporarily */ |
| 139 | null_breakpoint_disable(); |
Patrick Rudolph | 31218a4 | 2020-11-30 15:50:06 +0100 | [diff] [blame] | 140 | if (ENV_X86_64 && CONFIG(PLATFORM_USES_FSP2_X86_32)) |
Patrick Rudolph | 40beb36 | 2020-12-01 10:08:38 +0100 | [diff] [blame] | 141 | status = protected_mode_call_1arg(silicon_init, (uintptr_t)upd); |
| 142 | else |
| 143 | status = silicon_init(upd); |
Arthur Heymans | fdf6d12 | 2022-05-17 13:07:30 +0200 | [diff] [blame] | 144 | null_breakpoint_init(); |
Patrick Rudolph | 40beb36 | 2020-12-01 10:08:38 +0100 | [diff] [blame] | 145 | |
Raul E Rangel | 43e993b | 2021-06-29 13:09:55 -0600 | [diff] [blame] | 146 | printk(BIOS_INFO, "FSPS returned %x\n", status); |
Patrick Rudolph | 40beb36 | 2020-12-01 10:08:38 +0100 | [diff] [blame] | 147 | |
Alexandru Gagniuc | 010225c | 2016-05-06 08:22:45 -0700 | [diff] [blame] | 148 | timestamp_add_now(TS_FSP_SILICON_INIT_END); |
lilacious | 40cb3fe | 2023-06-21 23:24:14 +0200 | [diff] [blame^] | 149 | post_code(POSTCODE_FSP_SILICON_EXIT); |
Alexandru Gagniuc | 010225c | 2016-05-06 08:22:45 -0700 | [diff] [blame] | 150 | |
Kyösti Mälkki | 4949a3d | 2021-01-09 20:38:43 +0200 | [diff] [blame] | 151 | if (CONFIG(BMP_LOGO)) |
| 152 | bmp_release_logo(); |
Wim Vervoorn | cbc878d2 | 2019-11-28 14:45:12 +0100 | [diff] [blame] | 153 | |
Lee Leahy | 672df16 | 2016-07-24 18:21:13 -0700 | [diff] [blame] | 154 | fsp_debug_after_silicon_init(status); |
Subrata Banik | 33d9c4a | 2020-05-26 18:26:54 +0530 | [diff] [blame] | 155 | fsps_return_value_handler(FSP_SILICON_INIT_API, status); |
Aaron Durbin | 35d42c7 | 2016-07-18 12:41:09 -0500 | [diff] [blame] | 156 | |
Subrata Banik | 96b32f1 | 2020-07-31 12:09:11 +0530 | [diff] [blame] | 157 | /* Reinitialize CPUs if FSP-S has done MP Init */ |
| 158 | if (CONFIG(USE_INTEL_FSP_MP_INIT)) |
| 159 | do_mpinit_after_fsp(); |
| 160 | |
Subrata Banik | 33d9c4a | 2020-05-26 18:26:54 +0530 | [diff] [blame] | 161 | if (!CONFIG(PLATFORM_USES_FSP2_2)) |
| 162 | return; |
Marshall Dawson | 7a9e894 | 2019-10-17 07:58:27 -0600 | [diff] [blame] | 163 | |
Subrata Banik | 33d9c4a | 2020-05-26 18:26:54 +0530 | [diff] [blame] | 164 | /* Check if SoC user would like to call Multi Phase Init */ |
Subrata Banik | 298b359 | 2021-09-14 12:38:08 +0530 | [diff] [blame] | 165 | if (!fsp_is_multi_phase_init_enabled()) |
Subrata Banik | 33d9c4a | 2020-05-26 18:26:54 +0530 | [diff] [blame] | 166 | return; |
| 167 | |
| 168 | /* Call MultiPhaseSiInit */ |
Elyes Haouas | 1ef547e | 2022-11-18 15:05:39 +0100 | [diff] [blame] | 169 | multi_phase_si_init = (void *)(uintptr_t)(hdr->image_base + |
Julian Schroeder | 8a576f6 | 2021-11-02 16:32:28 -0500 | [diff] [blame] | 170 | hdr->fsp_multi_phase_si_init_entry_offset); |
Subrata Banik | 33d9c4a | 2020-05-26 18:26:54 +0530 | [diff] [blame] | 171 | |
| 172 | /* Implementing multi_phase_si_init() is optional as per FSP 2.2 spec */ |
| 173 | if (multi_phase_si_init == NULL) |
| 174 | return; |
| 175 | |
lilacious | 40cb3fe | 2023-06-21 23:24:14 +0200 | [diff] [blame^] | 176 | post_code(POSTCODE_FSP_MULTI_PHASE_SI_INIT_ENTRY); |
Subrata Banik | 33d9c4a | 2020-05-26 18:26:54 +0530 | [diff] [blame] | 177 | timestamp_add_now(TS_FSP_MULTI_PHASE_SI_INIT_START); |
| 178 | /* Get NumberOfPhases Value */ |
| 179 | multi_phase_params.multi_phase_action = GET_NUMBER_OF_PHASES; |
| 180 | multi_phase_params.phase_index = 0; |
| 181 | multi_phase_params.multi_phase_param_ptr = &multi_phase_get_number; |
| 182 | status = multi_phase_si_init(&multi_phase_params); |
| 183 | fsps_return_value_handler(FSP_MULTI_PHASE_SI_INIT_GET_NUMBER_OF_PHASES_API, status); |
| 184 | |
| 185 | /* Execute Multi Phase Execution */ |
Angel Pons | fd63e11 | 2021-09-08 11:52:09 +0200 | [diff] [blame] | 186 | for (uint32_t i = 1; i <= multi_phase_get_number.number_of_phases; i++) { |
| 187 | printk(BIOS_SPEW, "Executing Phase %u of FspMultiPhaseSiInit\n", i); |
Subrata Banik | 33d9c4a | 2020-05-26 18:26:54 +0530 | [diff] [blame] | 188 | /* |
| 189 | * Give SoC/mainboard a chance to perform any operation before |
| 190 | * Multi Phase Execution |
| 191 | */ |
| 192 | platform_fsp_multi_phase_init_cb(i); |
| 193 | |
| 194 | multi_phase_params.multi_phase_action = EXECUTE_PHASE; |
| 195 | multi_phase_params.phase_index = i; |
| 196 | multi_phase_params.multi_phase_param_ptr = NULL; |
| 197 | status = multi_phase_si_init(&multi_phase_params); |
Subrata Banik | 25d1002 | 2023-04-26 16:32:29 +0530 | [diff] [blame] | 198 | if (CONFIG(FSP_MULTIPHASE_SI_INIT_RETURN_BROKEN)) |
| 199 | status = fsp_get_pch_reset_status(); |
Subrata Banik | 33d9c4a | 2020-05-26 18:26:54 +0530 | [diff] [blame] | 200 | fsps_return_value_handler(FSP_MULTI_PHASE_SI_INIT_EXECUTE_PHASE_API, status); |
Lee Leahy | 9671faa | 2016-07-24 18:18:52 -0700 | [diff] [blame] | 201 | } |
Subrata Banik | 33d9c4a | 2020-05-26 18:26:54 +0530 | [diff] [blame] | 202 | timestamp_add_now(TS_FSP_MULTI_PHASE_SI_INIT_END); |
lilacious | 40cb3fe | 2023-06-21 23:24:14 +0200 | [diff] [blame^] | 203 | post_code(POSTCODE_FSP_MULTI_PHASE_SI_INIT_EXIT); |
Andrey Petrov | 42c4e88 | 2016-02-25 14:17:45 -0800 | [diff] [blame] | 204 | } |
| 205 | |
Julius Werner | 8205ce6 | 2021-03-10 17:25:01 -0800 | [diff] [blame] | 206 | static void *fsps_allocator(void *arg_unused, size_t size, const union cbfs_mdata *mdata_unused) |
Aaron Durbin | a85febc | 2020-05-15 15:09:10 -0600 | [diff] [blame] | 207 | { |
Julius Werner | 8205ce6 | 2021-03-10 17:25:01 -0800 | [diff] [blame] | 208 | return cbmem_add(CBMEM_ID_REFCODE, size); |
Aaron Durbin | a85febc | 2020-05-15 15:09:10 -0600 | [diff] [blame] | 209 | } |
| 210 | |
Kyösti Mälkki | cc93c6e | 2021-01-09 22:53:52 +0200 | [diff] [blame] | 211 | void fsps_load(void) |
Andrey Petrov | 42c4e88 | 2016-02-25 14:17:45 -0800 | [diff] [blame] | 212 | { |
Aaron Durbin | a85febc | 2020-05-15 15:09:10 -0600 | [diff] [blame] | 213 | struct fsp_load_descriptor fspld = { |
| 214 | .fsp_prog = PROG_INIT(PROG_REFCODE, CONFIG_FSP_S_CBFS), |
Julius Werner | 8205ce6 | 2021-03-10 17:25:01 -0800 | [diff] [blame] | 215 | .alloc = fsps_allocator, |
Aaron Durbin | a85febc | 2020-05-15 15:09:10 -0600 | [diff] [blame] | 216 | }; |
| 217 | struct prog *fsps = &fspld.fsp_prog; |
Furquan Shaikh | f4b20af | 2017-02-20 13:33:32 -0800 | [diff] [blame] | 218 | static int load_done; |
| 219 | |
| 220 | if (load_done) |
| 221 | return; |
Brandon Breitenstein | c6ec8dd | 2016-11-17 12:23:04 -0800 | [diff] [blame] | 222 | |
Reka Norman | 8baa371 | 2022-09-05 15:33:39 +1000 | [diff] [blame] | 223 | timestamp_add_now(TS_FSP_SILICON_INIT_LOAD); |
| 224 | |
Kyösti Mälkki | e0165fb | 2021-01-09 13:30:57 +0200 | [diff] [blame] | 225 | if (resume_from_stage_cache()) { |
Brandon Breitenstein | c6ec8dd | 2016-11-17 12:23:04 -0800 | [diff] [blame] | 226 | printk(BIOS_DEBUG, "Loading FSPS from stage_cache\n"); |
Aaron Durbin | a85febc | 2020-05-15 15:09:10 -0600 | [diff] [blame] | 227 | stage_cache_load_stage(STAGE_REFCODE, fsps); |
Julius Werner | 43c9d70 | 2021-04-12 17:00:16 -0700 | [diff] [blame] | 228 | if (fsp_validate_component(&fsps_hdr, prog_start(fsps), prog_size(fsps))) |
Brandon Breitenstein | c6ec8dd | 2016-11-17 12:23:04 -0800 | [diff] [blame] | 229 | die("On resume fsps header is invalid\n"); |
Furquan Shaikh | f4b20af | 2017-02-20 13:33:32 -0800 | [diff] [blame] | 230 | load_done = 1; |
Brandon Breitenstein | c6ec8dd | 2016-11-17 12:23:04 -0800 | [diff] [blame] | 231 | return; |
| 232 | } |
| 233 | |
Aaron Durbin | a85febc | 2020-05-15 15:09:10 -0600 | [diff] [blame] | 234 | if (fsp_load_component(&fspld, &fsps_hdr) != CB_SUCCESS) |
| 235 | die("FSP-S failed to load\n"); |
Aaron Durbin | 32ac018 | 2016-07-18 00:35:42 -0500 | [diff] [blame] | 236 | |
Aaron Durbin | a85febc | 2020-05-15 15:09:10 -0600 | [diff] [blame] | 237 | stage_cache_add(STAGE_REFCODE, fsps); |
Aaron Durbin | 32ac018 | 2016-07-18 00:35:42 -0500 | [diff] [blame] | 238 | |
Furquan Shaikh | f4b20af | 2017-02-20 13:33:32 -0800 | [diff] [blame] | 239 | load_done = 1; |
| 240 | } |
Aaron Durbin | 32ac018 | 2016-07-18 00:35:42 -0500 | [diff] [blame] | 241 | |
Raul E Rangel | 1592846 | 2021-11-05 10:29:24 -0600 | [diff] [blame] | 242 | void preload_fsps(void) |
| 243 | { |
| 244 | if (!CONFIG(CBFS_PRELOAD)) |
| 245 | return; |
| 246 | |
| 247 | printk(BIOS_DEBUG, "Preloading %s\n", CONFIG_FSP_S_CBFS); |
| 248 | cbfs_preload(CONFIG_FSP_S_CBFS); |
| 249 | } |
| 250 | |
Kyösti Mälkki | cc93c6e | 2021-01-09 22:53:52 +0200 | [diff] [blame] | 251 | void fsp_silicon_init(void) |
Furquan Shaikh | f4b20af | 2017-02-20 13:33:32 -0800 | [diff] [blame] | 252 | { |
Kyösti Mälkki | cc93c6e | 2021-01-09 22:53:52 +0200 | [diff] [blame] | 253 | fsps_load(); |
Furquan Shaikh | f4b20af | 2017-02-20 13:33:32 -0800 | [diff] [blame] | 254 | do_silicon_init(&fsps_hdr); |
Subrata Banik | 6de1d9f | 2022-03-20 19:50:38 +0530 | [diff] [blame] | 255 | |
| 256 | if (CONFIG(DISPLAY_FSP_TIMESTAMPS)) |
| 257 | fsp_display_timestamp(); |
Andrey Petrov | 42c4e88 | 2016-02-25 14:17:45 -0800 | [diff] [blame] | 258 | } |
Wim Vervoorn | d137150 | 2019-12-17 14:10:16 +0100 | [diff] [blame] | 259 | |
Kyösti Mälkki | 4949a3d | 2021-01-09 20:38:43 +0200 | [diff] [blame] | 260 | __weak void soc_load_logo(FSPS_UPD *supd) { } |