Debian Codegraph @

src/soc/amd/mendocino/fsp_s_params.c

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