Debian Codegraph @

src/drivers/intel/fsp1_1/temp_ram_exit.c

raw symbols SCIP
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2
3 #include <cbmem.h>
4 #include <cbfs.h>
5 #include <console/console.h>
6 #include <fsp/util.h>
7
8 asmlinkage void chipset_teardown_car_main(void)
9 {
10 FSP_INFO_HEADER *fih;
11 uint32_t status;
12 FSP_TEMP_RAM_EXIT temp_ram_exit;
13
14 /* CBMEM_ID_VBOOT_WORKBUF is used as vboot workbuffer.
15 * Init CBMEM before loading fsp, to have buffer available */
16 cbmem_initialize();
17
18 void *fsp = cbfs_map("fsp.bin", NULL);
19 if (!fsp) {
20 die("Unable to locate fsp.bin\n");
21 } else {
22 /* This leaks a mapping which this code assumes is benign as
23 * the flash is memory mapped CPU's address space. */
24
25 /* FIXME: the implementation of find_fsp is utter garbage
26 as it casts error values to FSP_INFO_HEADER pointers.
27 Checking for return values can only be done sanely once
28 that is fixed. */
29 fih = find_fsp((uintptr_t)fsp);
30 }
31
32 temp_ram_exit = (FSP_TEMP_RAM_EXIT)(fih->TempRamExitEntryOffset +
33 fih->ImageBase);
34 printk(BIOS_DEBUG, "Calling TempRamExit: %p\n", temp_ram_exit);
35 status = temp_ram_exit(NULL);
36
37 if (status != FSP_SUCCESS) {
38 printk(BIOS_CRIT, "TempRamExit returned 0x%08x\n", status);
39 die("TempRamExit returned an error!\n");
40 }
41 }