coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
vbt.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #include <acpi/acpi.h>
4 #include <bootmode.h>
5 #include <console/console.h>
7 #include <fsp/ramstage.h>
8 #include <fsp/util.h>
9 #include <lib.h>
10 
11 /* Locate VBT and pass it to FSP GOP */
12 void load_vbt(SILICON_INIT_UPD *params)
13 {
14  const optionrom_vbt_t *vbt_data = NULL;
15  size_t vbt_len;
16 
17  /* Check boot mode - for S3 resume path VBT loading is not needed */
18  if (acpi_is_wakeup_s3()) {
19  printk(BIOS_DEBUG, "S3 resume do not pass VBT to GOP\n");
20  } else if (display_init_required()) {
21  /* Get VBT data */
22  vbt_data = locate_vbt(&vbt_len);
23  if (vbt_data != NULL) {
24  if (CONFIG(DISPLAY_VBT)) {
25  /* Display the vbt file contents */
26  printk(BIOS_DEBUG, "VBT Data:\n");
27  hexdump(vbt_data, vbt_len);
28  printk(BIOS_DEBUG, "\n");
29  }
30  printk(BIOS_DEBUG, "Passing VBT to GOP\n");
31  } else {
32  printk(BIOS_DEBUG, "VBT not found!\n");
33  }
34  } else {
35  printk(BIOS_DEBUG, "Not passing VBT to GOP\n");
36  }
37  params->GraphicsConfigPtr = (u32)vbt_data;
38 }
static int acpi_is_wakeup_s3(void)
Definition: acpi.h:9
static struct sdram_info params
Definition: sdram_configs.c:83
int display_init_required(void)
Definition: bootmode.c:22
#define printk(level,...)
Definition: stdlib.h:16
void load_vbt(SILICON_INIT_UPD *params)
Definition: vbt.c:12
@ CONFIG
Definition: dsi_common.h:201
void hexdump(const void *memory, size_t length)
Definition: hexdump.c:7
#define BIOS_DEBUG
BIOS_DEBUG - Verbose output.
Definition: loglevel.h:128
void * locate_vbt(size_t *vbt_size)
Definition: opregion.c:25
static char vbt_data[CONFIG_VBT_DATA_SIZE_KB *KiB]
Definition: opregion.c:22
#define NULL
Definition: stddef.h:19
uint32_t u32
Definition: stdint.h:51