coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
mmap_boot.c File Reference
#include <boot_device.h>
#include <commonlib/region.h>
#include <console/console.h>
#include <fmap.h>
#include <intelblocks/fast_spi.h>
#include <spi_flash.h>
Include dependency graph for mmap_boot.c:

Go to the source code of this file.

Enumerations

enum  window_type { FIXED_DECODE_WINDOW , EXT_BIOS_DECODE_WINDOW , TOTAL_DECODE_WINDOWS }
 

Functions

static void initialize_window (enum window_type type, uintptr_t host_base, uintptr_t flash_base, size_t size)
 
static void bios_mmap_init (void)
 
const struct region_deviceboot_device_ro (void)
 
void fast_spi_get_ext_bios_window (uintptr_t *base, size_t *size)
 
uint32_t spi_flash_get_mmap_windows (struct flash_mmap_window *table)
 

Variables

static struct xlate_region_device real_dev
 
static struct mem_region_device shadow_devs [TOTAL_DECODE_WINDOWS]
 
static struct xlate_window real_dev_windows [TOTAL_DECODE_WINDOWS]
 

Enumeration Type Documentation

◆ window_type

Enumerator
FIXED_DECODE_WINDOW 
EXT_BIOS_DECODE_WINDOW 
TOTAL_DECODE_WINDOWS 

Definition at line 16 of file mmap_boot.c.

Function Documentation

◆ bios_mmap_init()

static void bios_mmap_init ( void  )
static

Definition at line 82 of file mmap_boot.c.

References _Static_assert(), bios_size, EXT_BIOS_DECODE_WINDOW, fast_spi_get_bios_region(), FIXED_DECODE_WINDOW, GiB, init_done, initialize_window(), MiB, MIN, real_dev, real_dev_windows, and xlate_region_device_ro_init().

Referenced by boot_device_ro(), fast_spi_get_ext_bios_window(), and spi_flash_get_mmap_windows().

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

◆ boot_device_ro()

const struct region_device* boot_device_ro ( void  )

Definition at line 139 of file mmap_boot.c.

References bios_mmap_init(), xlate_region_device::rdev, and real_dev.

Here is the call graph for this function:

◆ fast_spi_get_ext_bios_window()

void fast_spi_get_ext_bios_window ( uintptr_t base,
size_t size 
)

Definition at line 146 of file mmap_boot.c.

References base, bios_mmap_init(), EXT_BIOS_DECODE_WINDOW, mem_region_device::rdev, rdev_mmap_full(), region_device_sz(), and shadow_devs.

Referenced by fast_spi_ext_bios_cache_range().

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

◆ initialize_window()

static void initialize_window ( enum window_type  type,
uintptr_t  host_base,
uintptr_t  flash_base,
size_t  size 
)
static

Definition at line 28 of file mmap_boot.c.

References BIOS_INFO, mem_region_device_ro_init(), printk, rdev, real_dev_windows, shadow_devs, type, and xlate_window_init().

Referenced by bios_mmap_init().

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

◆ spi_flash_get_mmap_windows()

uint32_t spi_flash_get_mmap_windows ( struct flash_mmap_window table)

Variable Documentation

◆ real_dev

struct xlate_region_device real_dev
static

Definition at line 1 of file mmap_boot.c.

Referenced by bios_mmap_init(), and boot_device_ro().

◆ real_dev_windows

struct xlate_window real_dev_windows[TOTAL_DECODE_WINDOWS]
static

Definition at line 1 of file mmap_boot.c.

Referenced by bios_mmap_init(), initialize_window(), and spi_flash_get_mmap_windows().

◆ shadow_devs

struct mem_region_device shadow_devs[TOTAL_DECODE_WINDOWS]
static