Debian Codegraph @

src/soc/amd/phoenix/fsp_s_params.c

raw symbols SCIP
1 /* SPDX-License-Identifier: GPL-2.0-only */
2
3 /* TODO: Update for Phoenix */
4
5 #include <acpi/acpi.h>
6 #include <amdblocks/apob_cache.h>
7 #include <amdblocks/vbt.h>
8 #include <device/pci.h>
9 #include <fsp/api.h>
10 #include <program_loading.h>
11
12 static void fsp_assign_vbios_upds(FSP_S_CONFIG *scfg)
13 {
14 /*
15 * The VBIOS contains the ATOMBIOS tables that will be modified as
16 * part of FSP GOP init. We can delay loading of the VBIOS until
17 * before FSP notify AFTER_PCI_ENUM.
18 */
19 scfg->vbios_buffer = (uintptr_t)vbt_get();
20 }
21
22 void platform_fsp_silicon_init_params_cb(FSPS_UPD *supd)
23 {
24 FSP_S_CONFIG *scfg = &supd->FspsConfig;
25
26 fsp_assign_vbios_upds(scfg);
27
28 /*
29 * At this point FSP-S has been loaded into RAM. If we were to start loading the APOB
30 * before FSP-S was loaded, we would introduce contention onto the SPI bus and
31 * slow down the FSP-S read from SPI. Since FSP-S takes a while to execute and performs
32 * no SPI operations, we can read the APOB while FSP-S executes.
33 */
34 start_apob_cache_read();
35 /*
36 * We enqueue the payload to be loaded after the APOB. This might cause a bit of
37 * bus contention when loading uCode and OPROMs, but since those calls happen at
38 * different points in the boot state machine it's a little harder to sequence all the
39 * async loading correctly. So in order to keep the complexity down, we enqueue the
40 * payload preload here. The end goal will be to add uCode and OPROM preloading
41 * before the payload so that the sequencing is correct.
42 *
43 * While FSP-S is executing, it's not currently possible to enqueue other transactions
44 * because FSP-S doesn't call `thread_yield()`. So the payload will start loading
45 * right after FSP-S completes.
46 */
47 if (!acpi_is_wakeup_s3())
48 payload_preload();
49 }