coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
spi-generic.c File Reference
#include <assert.h>
#include <commonlib/helpers.h>
#include <spi-generic.h>
#include <stddef.h>
#include <string.h>
Include dependency graph for spi-generic.c:

Go to the source code of this file.

Functions

int spi_claim_bus (const struct spi_slave *slave)
 
void spi_release_bus (const struct spi_slave *slave)
 
static int spi_xfer_single_op (const struct spi_slave *slave, struct spi_op *op)
 
static int spi_xfer_vector_default (const struct spi_slave *slave, struct spi_op vectors[], size_t count)
 
int spi_xfer_vector (const struct spi_slave *slave, struct spi_op vectors[], size_t count)
 
int spi_xfer (const struct spi_slave *slave, const void *dout, size_t bytesout, void *din, size_t bytesin)
 
unsigned int spi_crop_chunk (const struct spi_slave *slave, unsigned int cmd_len, unsigned int buf_len)
 
void __weak spi_init (void)
 
int spi_setup_slave (unsigned int bus, unsigned int cs, struct spi_slave *slave)
 

Function Documentation

◆ spi_claim_bus()

int spi_claim_bus ( const struct spi_slave slave)

Definition at line 9 of file spi-generic.c.

References spi_ctrlr::claim_bus, spi_slave::ctrlr, and slave.

Referenced by crosec_spi_io(), do_dual_io_cmd(), do_dual_output_cmd(), do_spi_flash_cmd(), exynos_spi_read(), ich_hwseq_erase(), and spi_sdcard_enable_cs().

Here is the caller graph for this function:

◆ spi_crop_chunk()

unsigned int spi_crop_chunk ( const struct spi_slave slave,
unsigned int  cmd_len,
unsigned int  buf_len 
)

◆ spi_init()

void __weak spi_init ( void  )

Definition at line 117 of file spi-generic.c.

Referenced by boot_device_rw_init(), intel_pch_finalize_smm(), smi_handler(), smm_handler_start(), and spiconsole_init().

Here is the caller graph for this function:

◆ spi_release_bus()

void spi_release_bus ( const struct spi_slave slave)

Definition at line 17 of file spi-generic.c.

References spi_slave::ctrlr, spi_ctrlr::release_bus, and slave.

Referenced by crosec_spi_io(), do_dual_io_cmd(), do_dual_output_cmd(), do_spi_flash_cmd(), exynos_spi_read(), ich_hwseq_erase(), and spi_sdcard_disable_cs().

Here is the caller graph for this function:

◆ spi_setup_slave()

int spi_setup_slave ( unsigned int  bus,
unsigned int  cs,
struct spi_slave slave 
)

◆ spi_xfer()

int spi_xfer ( const struct spi_slave slave,
const void dout,
size_t  bytesout,
void din,
size_t  bytesin 
)

Definition at line 68 of file spi-generic.c.

References spi_slave::ctrlr, slave, and spi_ctrlr::xfer.

Referenced by crosec_spi_io(), read_bytes(), spi_sdcard_recvbyte(), spi_sdcard_sendbyte(), spi_w8r8(), spiconsole_tx_byte(), and write_bytes().

Here is the caller graph for this function:

◆ spi_xfer_single_op()

static int spi_xfer_single_op ( const struct spi_slave slave,
struct spi_op op 
)
static

Definition at line 24 of file spi-generic.c.

References spi_op::bytesin, spi_op::bytesout, spi_slave::ctrlr, spi_op::din, spi_op::dout, slave, SPI_OP_FAILURE, SPI_OP_SUCCESS, spi_op::status, and spi_ctrlr::xfer.

Referenced by spi_xfer_vector_default().

Here is the caller graph for this function:

◆ spi_xfer_vector()

int spi_xfer_vector ( const struct spi_slave slave,
struct spi_op  vectors[],
size_t  count 
)

Definition at line 57 of file spi-generic.c.

References count, spi_slave::ctrlr, slave, spi_xfer_vector_default(), and spi_ctrlr::xfer_vector.

Referenced by do_dual_io_cmd(), do_dual_output_cmd(), and do_spi_flash_cmd().

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

◆ spi_xfer_vector_default()

static int spi_xfer_vector_default ( const struct spi_slave slave,
struct spi_op  vectors[],
size_t  count 
)
static

Definition at line 42 of file spi-generic.c.

References count, slave, and spi_xfer_single_op().

Referenced by spi_xfer_vector().

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