coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
temp_ram_exit.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 #include <arch/romstage.h>
4 #include <console/console.h>
5 #include <fsp/api.h>
6 #include <fsp/util.h>
7 #include <cbfs.h>
8 #include <types.h>
9 
10 static void fsp_temp_ram_exit(void)
11 {
12  struct fsp_header hdr;
13  uint32_t status;
14  temp_ram_exit_fn temp_ram_exit;
15  void *mapping;
16  size_t size;
17  const char *name = CONFIG_FSP_M_CBFS;
18 
19  mapping = cbfs_map(name, &size);
20  if (!mapping) {
21  printk(BIOS_CRIT, "Could not map %s from CBFS\n", name);
22  die("FSPM not available for CAR Exit!\n");
23  }
24 
25  if (fsp_validate_component(&hdr, mapping, size) != CB_SUCCESS)
26  die("Invalid FSPM header!\n");
27 
28  temp_ram_exit = (void *)(hdr.image_base + hdr.temp_ram_exit_entry_offset);
29  printk(BIOS_DEBUG, "Calling TempRamExit: %p\n", temp_ram_exit);
30  status = temp_ram_exit(NULL);
31 
32  if (status != FSP_SUCCESS)
33  die("TempRamExit returned with error 0x%08x!\n", status);
34 
35  cbfs_unmap(mapping);
36 }
37 
39 {
41 }
const char * name
Definition: mmu.c:92
@ CB_SUCCESS
Call completed successfully.
Definition: cb_err.h:16
void cbfs_unmap(void *mapping)
Definition: cbfs.c:86
static void * cbfs_map(const char *name, size_t *size_out)
Definition: cbfs.h:246
#define printk(level,...)
Definition: stdlib.h:16
void __noreturn die(const char *fmt,...)
Definition: die.c:17
asmlinkage uint32_t(* temp_ram_exit_fn)(void *param)
Definition: util.h:158
enum cb_err fsp_validate_component(struct fsp_header *hdr, void *fsp_blob, size_t size)
Definition: util.c:57
#define FSP_SUCCESS
Definition: api.h:11
void late_car_teardown(void)
Definition: temp_ram_exit.c:38
static void fsp_temp_ram_exit(void)
Definition: temp_ram_exit.c:10
#define BIOS_DEBUG
BIOS_DEBUG - Verbose output.
Definition: loglevel.h:128
#define BIOS_CRIT
BIOS_CRIT - Recovery unlikely.
Definition: loglevel.h:56
#define NULL
Definition: stddef.h:19
unsigned int uint32_t
Definition: stdint.h:14