coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
|
#include <assert.h>
#include <console/console.h>
#include <ctype.h>
#include <endian.h>
#include <bootmem.h>
#include <string.h>
#include <program_loading.h>
#include <memrange.h>
#include <fit.h>
#include <boardid.h>
#include <commonlib/stdlib.h>
#include <types.h>
Go to the source code of this file.
Data Structures | |
struct | compat_string_entry |
struct | entry_params |
struct | mem_map |
Functions | |
static char * | clean_compat_string (char *str) |
static void | fit_add_default_compat_strings (void) |
static struct fit_image_node * | find_image (const char *name) |
static struct fit_image_node * | find_image_with_overlays (const char *name, int bytes, struct list_node *prev) |
static void | image_node (struct device_tree_node *node) |
static void | config_node (struct device_tree_node *node) |
static void | fit_unpack (struct device_tree *tree, const char **default_config) |
static int | fdt_find_compat (const void *blob, uint32_t start_offset, struct fdt_property *prop) |
static int | fit_check_compat (struct fdt_property *compat_prop, const char *compat_name) |
void | fit_update_chosen (struct device_tree *tree, const char *cmd_line) |
void | fit_add_ramdisk (struct device_tree *tree, void *ramdisk_addr, size_t ramdisk_size) |
static void | update_reserve_map (uint64_t start, uint64_t end, struct device_tree *tree) |
static uint64_t | max_range (unsigned int size_cells) |
static void | update_mem_property (u64 start, u64 end, struct entry_params *params) |
static bool | walk_memory_table (const struct range_entry *r, void *arg) |
void | fit_add_compat_string (const char *str) |
void | fit_update_memory (struct device_tree *tree) |
static int | fit_update_compat (struct fit_config_node *config) |
struct fit_config_node * | fit_load (void *fit) |
Variables | |
static struct list_node | image_nodes |
static struct list_node | config_nodes |
static struct list_node | compat_strings |
|
static |
Definition at line 27 of file fit.c.
References strlen(), and tolower().
Referenced by fit_add_compat_string().
|
static |
Definition at line 136 of file fit.c.
References config, config_nodes, fdt_property::data, find_image(), find_image_with_overlays(), list_for_each, list_insert_after(), fdt_property::name, device_tree_node::name, device_tree_property::prop, device_tree_node::properties, fdt_property::size, strcmp(), and xzalloc.
Referenced by fit_unpack().
|
static |
Definition at line 175 of file fit.c.
References fdt_next_property(), fdt_node_name(), fdt_property::name, NULL, offset, and strcmp().
Referenced by fit_update_compat().
|
static |
Definition at line 73 of file fit.c.
References BIOS_ERR, image_nodes, list_for_each, name, fit_image_node::name, NULL, printk, and strcmp().
Referenced by config_node(), and find_image_with_overlays().
|
static |
Definition at line 84 of file fit.c.
References base, find_image(), list_insert_after(), fit_overlay_chain::list_node, name, NULL, fit_overlay_chain::overlay, strnlen(), and xzalloc.
Referenced by config_node().
void fit_add_compat_string | ( | const char * | str | ) |
Definition at line 322 of file fit.c.
References clean_compat_string(), compat_string_entry::compat_string, compat_strings, list_insert_after(), compat_string_entry::list_node, strdup(), and xzalloc.
Referenced by fit_add_default_compat_strings().
Definition at line 38 of file fit.c.
References board_id(), fit_add_compat_string(), sku_id(), snprintf(), and UNDEFINED_STRAPPING_ID.
Referenced by fit_load().
void fit_add_ramdisk | ( | struct device_tree * | tree, |
void * | ramdisk_addr, | ||
size_t | ramdisk_size | ||
) |
Definition at line 222 of file fit.c.
References dt_add_u64_prop(), dt_find_node(), NULL, and device_tree::root.
Referenced by fit_payload().
|
static |
Definition at line 197 of file fit.c.
References fdt_property::data, fdt_property::size, strlen(), and strncmp().
Referenced by fit_update_compat().
struct fit_config_node* fit_load | ( | void * | fit | ) |
Definition at line 455 of file fit.c.
References BIOS_DEBUG, BIOS_ERR, BIOS_INFO, BIOS_WARNING, fit_config_node::compat_rank, fit_config_node::compat_string, compat_string_entry::compat_string, compat_strings, config, config_nodes, fdt_unflatten(), fit_add_default_compat_strings(), fit_unpack(), fit_update_compat(), image_nodes, list_for_each, fit_image_node::name, fit_config_node::name, NULL, fit_overlay_chain::overlay, printk, fit_image_node::size, strcmp(), and strlen().
Referenced by fit_payload().
|
static |
Definition at line 157 of file fit.c.
References device_tree_node::children, config_node(), dt_find_node_by_path(), dt_find_string_prop(), image_node(), list_for_each, and NULL.
Referenced by fit_load().
void fit_update_chosen | ( | struct device_tree * | tree, |
const char * | cmd_line | ||
) |
Definition at line 213 of file fit.c.
References dt_add_string_prop(), dt_find_node(), NULL, and device_tree::root.
Referenced by fit_payload().
|
static |
Definition at line 405 of file fit.c.
References BIOS_ERR, CBFS_COMPRESS_NONE, compat_string_entry::compat_string, compat_strings, config, fdt_find_compat(), fit_check_compat(), list_for_each, printk, and fdt_header::structure_offset.
Referenced by fit_load().
void fit_update_memory | ( | struct device_tree * | tree | ) |
Definition at line 334 of file fit.c.
References entry_params::addr_cells, assert, BIOS_INFO, bootmem_walk_os_mem(), device_tree_node::children, count, entry_params::data, DIV_ROUND_UP, dt_add_bin_prop(), dt_add_string_prop(), dt_find_string_prop(), dt_read_cell_props(), length, list_for_each, list_insert_after(), device_tree_node::list_node, list_remove(), max_range(), mem_map::mem, memranges_each_entry, memranges_init_empty, memranges_teardown(), device_tree_node::name, NULL, printk, range_entry_base(), range_entry_end(), range_entry_size(), mem_map::reserved, device_tree::root, entry_params::size_cells, strcmp(), update_mem_property(), update_reserve_map(), walk_memory_table(), and xzalloc.
Referenced by fit_payload().
|
static |
Definition at line 109 of file fit.c.
References CBFS_COMPRESS_LZ4, CBFS_COMPRESS_LZMA, CBFS_COMPRESS_NONE, fit_image_node::compression, fdt_property::data, fit_image_node::data, image_nodes, list_for_each, list_insert_after(), fit_image_node::list_node, fdt_property::name, device_tree_node::name, fit_image_node::name, device_tree_property::prop, device_tree_node::properties, fdt_property::size, fit_image_node::size, strcmp(), and xzalloc.
Referenced by fit_unpack(), and unpack_fdt().
Definition at line 253 of file fit.c.
Referenced by fit_update_memory(), and update_mem_property().
|
static |
Definition at line 263 of file fit.c.
References dt_write_int(), max_range(), MIN, and params.
Referenced by fit_update_memory().
|
static |
Definition at line 236 of file fit.c.
References list_insert_after(), device_tree_reserve_map_entry::list_node, device_tree::reserve_map, device_tree_reserve_map_entry::size, device_tree_reserve_map_entry::start, and xzalloc.
Referenced by fit_update_memory().
|
static |
Definition at line 287 of file fit.c.
References ALIGN_DOWN, ALIGN_UP, arg, BM_MEM_RAM, BM_MEM_RESERVED, mem_map::mem, memranges_insert(), MiB, range_entry_base(), range_entry_end(), range_entry_size(), range_entry_tag(), and mem_map::reserved.
Referenced by fit_update_memory().
|
static |
Definition at line 1 of file fit.c.
Referenced by fit_add_compat_string(), fit_load(), and fit_update_compat().
|
static |
Definition at line 1 of file fit.c.
Referenced by config_node(), and fit_load().
|
static |
Definition at line 1 of file fit.c.
Referenced by find_image(), fit_load(), and image_node().