coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
coreboot_table.c File Reference
#include <acpi/acpi.h>
#include <arch/cbconfig.h>
#include <console/console.h>
#include <console/uart.h>
#include <ip_checksum.h>
#include <boot/coreboot_tables.h>
#include <boot/tables.h>
#include <boot_device.h>
#include <string.h>
#include <version.h>
#include <boardid.h>
#include <device/device.h>
#include <drivers/tpm/tpm_ppi.h>
#include <fmap.h>
#include <fw_config.h>
#include <cbfs.h>
#include <cbmem.h>
#include <bootmem.h>
#include <bootsplash.h>
#include <inttypes.h>
#include <spi_flash.h>
#include <smmstore.h>
#include <types.h>
Include dependency graph for coreboot_table.c:

Go to the source code of this file.

Functions

void lb_string_platform_blob_version (struct lb_header *header)
 
static struct lb_headerlb_table_init (unsigned long addr)
 
static struct lb_recordlb_first_record (struct lb_header *header)
 
static struct lb_recordlb_last_record (struct lb_header *header)
 
struct lb_recordlb_new_record (struct lb_header *header)
 
static struct lb_memorylb_memory (struct lb_header *header)
 
void lb_add_serial (struct lb_serial *new_serial, void *data)
 
void lb_add_console (uint16_t consoletype, void *data)
 
static void lb_framebuffer (struct lb_header *header)
 
void lb_add_gpios (struct lb_gpios *gpios, const struct lb_gpio *gpio_table, size_t count)
 
static void lb_gpios (struct lb_header *header)
 
__weak uint32_t board_id (void)
 board_id() - Get the board version More...
 
__weak uint32_t ram_code (void)
 
__weak uint32_t sku_id (void)
 
__weak uint64_t fw_config_get (void)
 fw_config_get() - Provide firmware configuration value. More...
 
static void lb_boot_media_params (struct lb_header *header)
 
static void lb_mmc_info (struct lb_header *header)
 
static void add_cbmem_pointers (struct lb_header *header)
 
static struct lb_mainboardlb_mainboard (struct lb_header *header)
 
static struct lb_board_configlb_board_config (struct lb_header *header)
 
static void lb_strings (struct lb_header *header)
 
static void lb_record_version_timestamp (struct lb_header *header)
 
void __weak lb_board (struct lb_header *header)
 
void __weak lb_spi_flash (struct lb_header *header)
 
static struct lb_forwardlb_forward (struct lb_header *header, struct lb_header *next_header)
 
static unsigned long lb_table_fini (struct lb_header *head)
 
static void lb_add_acpi_rsdp (struct lb_header *head)
 
size_t write_coreboot_forwarding_table (uintptr_t entry, uintptr_t target)
 
static uintptr_t write_coreboot_table (uintptr_t rom_table_end)
 
voidwrite_tables (void)
 

Function Documentation

◆ add_cbmem_pointers()

◆ board_id()

__weak uint32_t board_id ( void  )

board_id() - Get the board version

Return: board version on success, BOARD_ID_UNKNOWN on failure/error.

This function is used to get the mainboard version.

Definition at line 191 of file coreboot_table.c.

References UNDEFINED_STRAPPING_ID.

Referenced by lb_board_config().

Here is the caller graph for this function:

◆ fw_config_get()

__weak uint64_t fw_config_get ( void  )

fw_config_get() - Provide firmware configuration value.

Return 64bit firmware configuration value determined for the system.

Definition at line 194 of file coreboot_table.c.

Referenced by lb_board_config().

Here is the caller graph for this function:

◆ lb_add_acpi_rsdp()

static void lb_add_acpi_rsdp ( struct lb_header head)
static

Definition at line 422 of file coreboot_table.c.

References get_coreboot_rsdp(), lb_new_record(), and LB_TAG_ACPI_RSDP.

Referenced by write_coreboot_table().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lb_add_console()

void lb_add_console ( uint16_t  consoletype,
void data 
)

Definition at line 110 of file coreboot_table.c.

References header, lb_new_record(), LB_TAG_CONSOLE, lb_console::size, lb_console::tag, and lb_console::type.

Referenced by uart_fill_lb(), and write_coreboot_table().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lb_add_gpios()

void lb_add_gpios ( struct lb_gpios gpios,
const struct lb_gpio gpio_table,
size_t  count 
)

Definition at line 143 of file coreboot_table.c.

References lb_gpios::count, count, gpio_table, lb_gpios::gpios, memcpy(), and lb_gpios::size.

Referenced by fill_lb_gpios().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lb_add_serial()

void lb_add_serial ( struct lb_serial new_serial,
void data 
)

Definition at line 94 of file coreboot_table.c.

References lb_serial::baseaddr, lb_serial::baud, header, lb_serial::input_hertz, lb_new_record(), LB_TAG_SERIAL, lb_serial::regwidth, serial, lb_serial::type, and lb_serial::uart_pci_addr.

Referenced by uart_fill_lb().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lb_board()

void __weak lb_board ( struct lb_header header)

Definition at line 381 of file coreboot_table.c.

Referenced by write_coreboot_table().

Here is the caller graph for this function:

◆ lb_board_config()

static struct lb_board_config* lb_board_config ( struct lb_header header)
static

Definition at line 300 of file coreboot_table.c.

References BIOS_INFO, board_id(), config, lb_board_config::fw_config, fw_config_get(), header, lb_new_record(), LB_TAG_BOARD_CONFIG, printk, PRIx64, ram_code(), sku_id(), UNDEFINED_FW_CONFIG, and UNDEFINED_STRAPPING_ID.

Referenced by write_coreboot_table().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lb_boot_media_params()

◆ lb_first_record()

static struct lb_record* lb_first_record ( struct lb_header header)
static

Definition at line 55 of file coreboot_table.c.

References header.

Referenced by lb_table_fini().

Here is the caller graph for this function:

◆ lb_forward()

static struct lb_forward* lb_forward ( struct lb_header header,
struct lb_header next_header 
)
static

Definition at line 391 of file coreboot_table.c.

References lb_forward::forward, header, lb_new_record(), and LB_TAG_FORWARD.

Referenced by write_coreboot_forwarding_table().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lb_framebuffer()

◆ lb_gpios()

static void lb_gpios ( struct lb_header header)
static

Definition at line 153 of file coreboot_table.c.

References ACTIVE_HIGH, BIOS_INFO, fill_lb_gpios(), lb_gpios::gpios, header, lb_new_record(), LB_TAG_GPIO, lb_gpio::name, lb_gpio::polarity, lb_gpio::port, printk, and lb_gpio::value.

Referenced by write_coreboot_table().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lb_last_record()

static struct lb_record* lb_last_record ( struct lb_header header)
static

Definition at line 62 of file coreboot_table.c.

References header.

Referenced by lb_new_record(), and lb_table_fini().

Here is the caller graph for this function:

◆ lb_mainboard()

static struct lb_mainboard* lb_mainboard ( struct lb_header header)
static

Definition at line 277 of file coreboot_table.c.

References ALIGN_UP, header, lb_new_record(), LB_TAG_MAINBOARD, mainboard_part_number, mainboard_vendor, memcpy(), lb_mainboard::part_number_idx, lb_mainboard::size, lb_mainboard::strings, strlen(), lb_mainboard::tag, and lb_mainboard::vendor_idx.

Referenced by write_coreboot_table().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lb_memory()

static struct lb_memory* lb_memory ( struct lb_header header)
static

Definition at line 83 of file coreboot_table.c.

References header, lb_new_record(), LB_TAG_MEMORY, lb_memory::size, and lb_memory::tag.

Referenced by write_coreboot_table().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lb_mmc_info()

static void lb_mmc_info ( struct lb_header header)
static

Definition at line 219 of file coreboot_table.c.

References cbmem_find(), CBMEM_ID_MMC_STATUS, lb_mmc_info::early_cmd1_status, header, lb_new_record(), LB_TAG_MMC_INFO, lb_mmc_info::size, and lb_mmc_info::tag.

Referenced by write_coreboot_table().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lb_new_record()

◆ lb_record_version_timestamp()

static void lb_record_version_timestamp ( struct lb_header header)
static

Definition at line 372 of file coreboot_table.c.

References coreboot_version_timestamp, header, lb_new_record(), LB_TAG_VERSION_TIMESTAMP, lb_timestamp::size, lb_timestamp::tag, and lb_timestamp::timestamp.

Referenced by write_coreboot_table().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lb_spi_flash()

void __weak lb_spi_flash ( struct lb_header header)

Definition at line 389 of file coreboot_table.c.

Referenced by write_coreboot_table().

Here is the caller graph for this function:

◆ lb_string_platform_blob_version()

void lb_string_platform_blob_version ( struct lb_header header)

Definition at line 193 of file util.c.

Referenced by write_coreboot_table().

Here is the caller graph for this function:

◆ lb_strings()

static void lb_strings ( struct lb_header header)
static

◆ lb_table_fini()

static unsigned long lb_table_fini ( struct lb_header head)
static

Definition at line 404 of file coreboot_table.c.

References BIOS_DEBUG, compute_ip_checksum(), lb_header::header_checksum, lb_first_record(), lb_last_record(), printk, lb_record::size, lb_header::table_bytes, lb_header::table_checksum, and lb_header::table_entries.

Referenced by write_coreboot_forwarding_table(), and write_coreboot_table().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lb_table_init()

static struct lb_header* lb_table_init ( unsigned long  addr)
static

Definition at line 36 of file coreboot_table.c.

References addr, ALIGN_UP, and header.

Referenced by write_coreboot_forwarding_table(), and write_coreboot_table().

Here is the caller graph for this function:

◆ ram_code()

__weak uint32_t ram_code ( void  )

Definition at line 192 of file coreboot_table.c.

Referenced by lb_board_config().

Here is the caller graph for this function:

◆ sku_id()

__weak uint32_t sku_id ( void  )

Definition at line 193 of file coreboot_table.c.

Referenced by lb_board_config().

Here is the caller graph for this function:

◆ write_coreboot_forwarding_table()

size_t write_coreboot_forwarding_table ( uintptr_t  entry,
uintptr_t  target 
)

Definition at line 432 of file coreboot_table.c.

References BIOS_DEBUG, lb_forward(), lb_table_fini(), lb_table_init(), and printk.

Referenced by arch_write_tables().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ write_coreboot_table()

◆ write_tables()

void* write_tables ( void  )

Definition at line 542 of file coreboot_table.c.

References arch_write_tables(), BIOS_DEBUG, BIOS_ERR, cbmem_add(), CBMEM_ID_CBTABLE, cbmem_list(), COREBOOT_TABLE_SIZE, NULL, printk, and write_coreboot_table().

Referenced by bs_write_tables().

Here is the call graph for this function:
Here is the caller graph for this function: