coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
boot_device_rw_nommap.c File Reference
#include <boot_device.h>
#include <spi_flash.h>
#include <spi-generic.h>
#include <stdint.h>
Include dependency graph for boot_device_rw_nommap.c:

Go to the source code of this file.

Functions

static ssize_t spi_readat (const struct region_device *rd, void *b, size_t offset, size_t size)
 
static ssize_t spi_writeat (const struct region_device *rd, const void *b, size_t offset, size_t size)
 
static ssize_t spi_eraseat (const struct region_device *rd, size_t offset, size_t size)
 
static void boot_device_rw_init (void)
 
const struct region_deviceboot_device_rw (void)
 
const struct spi_flashboot_device_spi_flash (void)
 
int boot_device_wp_region (const struct region_device *rd, const enum bootdev_prot_type type)
 

Variables

static struct spi_flash sfg
 
static bool sfg_init_done
 
static const struct region_device_ops spi_ops
 
static const struct region_device spi_rw
 

Function Documentation

◆ boot_device_rw()

const struct region_device* boot_device_rw ( void  )

Definition at line 62 of file boot_device_rw_nommap.c.

References boot_device_rw_init(), NULL, sfg_init_done, and spi_rw.

Referenced by boot_device_rw_subregion().

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

◆ boot_device_rw_init()

static void boot_device_rw_init ( void  )
static

Definition at line 47 of file boot_device_rw_nommap.c.

References sfg, sfg_init_done, spi_flash_probe(), and spi_init().

Referenced by boot_device_rw(), and boot_device_spi_flash().

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

◆ boot_device_spi_flash()

const struct spi_flash* boot_device_spi_flash ( void  )

Definition at line 73 of file boot_device_rw_nommap.c.

References boot_device_rw_init(), NULL, sfg, and sfg_init_done.

Referenced by boot_device_wp_region(), lb_spi_flash(), mainboard_config_cbi_wp(), mainboard_print_info(), nvm_is_write_protected(), nvm_protect(), pre_mem_debug_init(), protect_ro_rgn_spi_flash(), and spi_finalize_ops().

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

◆ boot_device_wp_region()

◆ spi_eraseat()

static ssize_t spi_eraseat ( const struct region_device rd,
size_t  offset,
size_t  size 
)
static

Definition at line 29 of file boot_device_rw_nommap.c.

References offset, sfg, spi_flash::size, and spi_flash_erase().

Here is the call graph for this function:

◆ spi_readat()

static ssize_t spi_readat ( const struct region_device rd,
void b,
size_t  offset,
size_t  size 
)
static

Definition at line 11 of file boot_device_rw_nommap.c.

References offset, sfg, spi_flash::size, and spi_flash_read().

Here is the call graph for this function:

◆ spi_writeat()

static ssize_t spi_writeat ( const struct region_device rd,
const void b,
size_t  offset,
size_t  size 
)
static

Definition at line 20 of file boot_device_rw_nommap.c.

References offset, sfg, spi_flash::size, and spi_flash_write().

Here is the call graph for this function:

Variable Documentation

◆ sfg

struct spi_flash sfg
static

◆ sfg_init_done

bool sfg_init_done
static

◆ spi_ops

const struct region_device_ops spi_ops
static
Initial value:
= {
.readat = spi_readat,
.writeat = spi_writeat,
.eraseat = spi_eraseat,
}
static ssize_t spi_readat(const struct region_device *rd, void *b, size_t offset, size_t size)
static ssize_t spi_writeat(const struct region_device *rd, const void *b, size_t offset, size_t size)
static ssize_t spi_eraseat(const struct region_device *rd, size_t offset, size_t size)

Definition at line 29 of file boot_device_rw_nommap.c.

◆ spi_rw

const struct region_device spi_rw
static
Initial value:
=
REGION_DEV_INIT(&spi_ops, 0, CONFIG_ROM_SIZE)
static const struct region_device_ops spi_ops
#define REGION_DEV_INIT(ops_, offset_, size_)
Definition: region.h:87

Definition at line 29 of file boot_device_rw_nommap.c.

Referenced by boot_device_rw().