4 #include <arch/cbconfig.h>
27 #if CONFIG(USE_OPTION_TABLE)
28 #include <option_table.h>
30 #if CONFIG(PLATFORM_USES_FSP2_0)
43 header->signature[0] =
'L';
44 header->signature[1] =
'B';
45 header->signature[2] =
'I';
46 header->signature[3] =
'O';
47 header->header_bytes =
sizeof(*header);
48 header->header_checksum = 0;
50 header->table_checksum = 0;
58 rec = (
void *)(((
char *)
header) +
sizeof(*header));
65 rec = (
void *)(((
char *)
header) +
sizeof(*header)
79 rec->
size =
sizeof(*rec);
90 mem->
size =
sizeof(*mem);
101 serial->size =
sizeof(*serial);
117 console->
size =
sizeof(*console);
118 console->
type = consoletype;
130 memcpy(framebuffer, &fb,
sizeof(*framebuffer));
132 framebuffer->
size =
sizeof(*framebuffer);
150 gpios->
size += table_size;
160 gpios->size =
sizeof(*gpios);
165 " NAME | PORT | POLARITY | VALUE\n",
210 bmp->
size =
sizeof(*bmp);
231 rec->
size =
sizeof(*rec);
241 const struct section_id {
258 for (i = 0; i <
ARRAY_SIZE(section_ids); i++) {
259 const struct section_id *sid = section_ids + i;
271 cbmem_ref->
tag = sid->table_tag;
272 cbmem_ref->
size =
sizeof(*cbmem_ref);
308 config->size =
sizeof(*config);
328 #if CONFIG(USE_OPTION_TABLE)
350 static const struct {
364 len =
strlen(strings[i].
string);
365 rec->
tag = strings[i].tag;
377 rec->
size =
sizeof(*rec);
399 forward->size =
sizeof(*forward);
417 "Wrote coreboot table at: %p, 0x%x bytes, checksum %x\n",
419 return (
unsigned long)rec + rec->
size;
450 (
long)rom_table_end);
454 #if CONFIG(USE_OPTION_TABLE)
463 memcpy(rec_dest, option_table, option_table->
size);
465 lb_cmos_checksum(head);
468 "cmos_layout.bin could not be found!\n");
480 if (
CONFIG(CONSOLE_SERIAL))
488 if (
CONFIG(PLATFORM_USES_FSP2_0))
499 if (
CONFIG(VBOOT_VBNV_CMOS))
506 if (
CONFIG(BOOT_DEVICE_SPI_FLASH))
518 if (
CONFIG(CHROMEOS_RAMOOPS))
535 if (
CONFIG(HAVE_ACPI_TABLES))
551 if (!cbtable_start) {
561 cbtable_size = cbtable_end - cbtable_start;
563 if (cbtable_size > max_table_size) {
565 __func__, cbtable_size, max_table_size);
572 return (
void *)cbtable_start;
uintptr_t get_coreboot_rsdp(void)
struct arm64_kernel_header header
void arch_write_tables(uintptr_t coreboot_table)
void lb_arch_add_records(struct lb_header *header)
void * memcpy(void *dest, const void *src, size_t n)
#define COREBOOT_TABLE_SIZE
#define UNDEFINED_STRAPPING_ID
void bootmem_write_memory_table(struct lb_memory *mem)
Write memory coreboot table.
void set_bootsplash(unsigned char *framebuffer, unsigned int x_resolution, unsigned int y_resolution, unsigned int fb_resolution)
Sets up the framebuffer with the bootsplash.jpg from cbfs.
static void * cbfs_map(const char *name, size_t *size_out)
const struct cbfs_boot_device * cbfs_get_boot_device(bool force_ro)
void cbmem_add_records_to_cbtable(struct lb_header *header)
void * cbmem_add(u32 id, u64 size)
void * cbmem_find(u32 id)
#define CBMEM_ID_TCPA_LOG
#define CBMEM_ID_MMC_STATUS
#define CBMEM_ID_WIFI_CALIBRATION
#define CBMEM_ID_VBOOT_WORKBUF
#define CBMEM_ID_ACPI_CNVS
#define CBMEM_ID_ACPI_GNVS
#define CBMEM_ID_TIMESTAMP
#define CBMEM_ID_TYPE_C_INFO
@ LB_TAG_VERSION_TIMESTAMP
@ LB_TAG_BOOT_MEDIA_PARAMS
@ LB_TAG_WIFI_CALIBRATION
#define LB_TAG_CONSOLE_EHCI
void lb_ramoops(struct lb_header *header)
#define printk(level,...)
void __weak lb_spi_flash(struct lb_header *header)
__weak uint32_t ram_code(void)
struct lb_record * lb_new_record(struct lb_header *header)
static void lb_mmc_info(struct lb_header *header)
void lb_add_serial(struct lb_serial *new_serial, void *data)
void lb_string_platform_blob_version(struct lb_header *header)
void lb_add_console(uint16_t consoletype, void *data)
static void lb_strings(struct lb_header *header)
static void lb_record_version_timestamp(struct lb_header *header)
__weak uint64_t fw_config_get(void)
fw_config_get() - Provide firmware configuration value.
static void lb_boot_media_params(struct lb_header *header)
static struct lb_forward * lb_forward(struct lb_header *header, struct lb_header *next_header)
void lb_add_gpios(struct lb_gpios *gpios, const struct lb_gpio *gpio_table, size_t count)
static struct lb_memory * lb_memory(struct lb_header *header)
static struct lb_mainboard * lb_mainboard(struct lb_header *header)
__weak uint32_t board_id(void)
board_id() - Get the board version
static uintptr_t write_coreboot_table(uintptr_t rom_table_end)
static void lb_framebuffer(struct lb_header *header)
void * write_tables(void)
static void add_cbmem_pointers(struct lb_header *header)
static unsigned long lb_table_fini(struct lb_header *head)
static struct lb_header * lb_table_init(unsigned long addr)
__weak uint32_t sku_id(void)
static void lb_add_acpi_rsdp(struct lb_header *head)
size_t write_coreboot_forwarding_table(uintptr_t entry, uintptr_t target)
static struct lb_board_config * lb_board_config(struct lb_header *header)
void __weak lb_board(struct lb_header *header)
static void lb_gpios(struct lb_header *header)
static struct lb_record * lb_first_record(struct lb_header *header)
static struct lb_record * lb_last_record(struct lb_header *header)
void lb_smmstorev2(struct lb_header *header)
uint64_t get_fmap_flash_offset(void)
#define UNDEFINED_FW_CONFIG
int fill_lb_framebuffer(struct lb_framebuffer *framebuffer)
void lb_table_add_vbnv_cmos(struct lb_header *header)
void fill_lb_gpios(struct lb_gpios *gpios)
unsigned long compute_ip_checksum(const void *addr, unsigned long length)
#define BIOS_INFO
BIOS_INFO - Expected events.
#define BIOS_DEBUG
BIOS_DEBUG - Verbose output.
#define BIOS_ERR
BIOS_ERR - System in incomplete state.
static const struct pad_config gpio_table[]
void uart_fill_lb(void *data)
void lb_tpm_ppi(struct lb_header *header)
static size_t region_device_sz(const struct region_device *rdev)
static size_t region_device_offset(const struct region_device *rdev)
const struct smm_save_state_ops *legacy_ops __weak
unsigned long long uint64_t
size_t strlen(const char *src)
struct region_device rdev
struct fw_config - Firmware configuration field and option.
lb_uint64_t physical_address
uint8_t name[GPIO_MAX_NAME_LENGTH]
int32_t early_cmd1_status
const char mainboard_vendor[]
const char coreboot_version[]
const char mainboard_part_number[]
const unsigned int coreboot_version_timestamp
const char coreboot_extra_version[]
const char coreboot_compile_time[]
const char coreboot_build[]