coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
boot_dev.c File Reference
#include "psp_verstage.h"
#include <bl_uapp/bl_errorcodes_public.h>
#include <bl_uapp/bl_syscall_public.h>
#include <boot_device.h>
#include <commonlib/region.h>
#include <console/console.h>
#include <string.h>
Include dependency graph for boot_dev.c:

Go to the source code of this file.

Macros

#define DEST_BUF_ALIGNMENT   16
 

Functions

static voidboot_dev_mmap (const struct region_device *rd, size_t offset, size_t size __unused)
 
static int boot_dev_munmap (const struct region_device *rd __unused, void *mapping __unused)
 
static ssize_t boot_dev_dma_readat (const struct region_device *rd, void *dest, size_t offset, size_t size)
 
static ssize_t boot_dev_readat (const struct region_device *rd, void *dest, size_t offset, size_t size)
 
const struct region_deviceboot_device_ro (void)
 

Variables

const struct region_device_ops boot_dev_rdev_ro_ops
 
static struct mem_region_device boot_dev
 

Macro Definition Documentation

◆ DEST_BUF_ALIGNMENT

#define DEST_BUF_ALIGNMENT   16

Definition at line 12 of file boot_dev.c.

Function Documentation

◆ boot_dev_dma_readat()

static ssize_t boot_dev_dma_readat ( const struct region_device rd,
void dest,
size_t  offset,
size_t  size 
)
static

Definition at line 28 of file boot_dev.c.

References ALIGN_UP, BIOS_ERR, container_of, DEST_BUF_ALIGNMENT, mdev, memcpy(), offset, printk, rdev, and svc_ccp_dma().

Here is the call graph for this function:

◆ boot_dev_mmap()

static void* boot_dev_mmap ( const struct region_device rd,
size_t  offset,
size_t size  __unused 
)
static

Definition at line 14 of file boot_dev.c.

References container_of, mdev, offset, and rdev.

◆ boot_dev_munmap()

static int boot_dev_munmap ( const struct region_device *rd  __unused,
void *mapping  __unused 
)
static

Definition at line 23 of file boot_dev.c.

◆ boot_dev_readat()

static ssize_t boot_dev_readat ( const struct region_device rd,
void dest,
size_t  offset,
size_t  size 
)
static

Definition at line 58 of file boot_dev.c.

◆ boot_device_ro()

const struct region_device* boot_device_ro ( void  )

Definition at line 80 of file boot_dev.c.

References mem_region_device::base, boot_dev, map_spi_rom(), and mem_region_device::rdev.

Here is the call graph for this function:

Variable Documentation

◆ boot_dev

struct mem_region_device boot_dev
static
Initial value:
= {
.rdev = REGION_DEV_INIT(&boot_dev_rdev_ro_ops, 0, CONFIG_ROM_SIZE),
}
const struct region_device_ops boot_dev_rdev_ro_ops
Definition: boot_dev.c:70
#define REGION_DEV_INIT(ops_, offset_, size_)
Definition: region.h:87

Definition at line 58 of file boot_dev.c.

Referenced by boot_device_ro().

◆ boot_dev_rdev_ro_ops

const struct region_device_ops boot_dev_rdev_ro_ops
Initial value:
= {
.mmap = boot_dev_mmap,
.munmap = boot_dev_munmap,
.readat = boot_dev_readat,
}
static void * boot_dev_mmap(const struct region_device *rd, size_t offset, size_t size __unused)
Definition: boot_dev.c:14
static ssize_t boot_dev_readat(const struct region_device *rd, void *dest, size_t offset, size_t size)
Definition: boot_dev.c:58
static int boot_dev_munmap(const struct region_device *rd __unused, void *mapping __unused)
Definition: boot_dev.c:23

Definition at line 58 of file boot_dev.c.