coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
fch_spi_util.c File Reference
#include <amdblocks/lpc.h>
#include <amdblocks/spi.h>
#include <arch/mmio.h>
#include <assert.h>
#include <stdint.h>
Include dependency graph for fch_spi_util.c:

Go to the source code of this file.

Functions

void spi_set_base (void *base)
 
uintptr_t spi_get_bar (void)
 
uint8_t spi_read8 (uint8_t reg)
 
uint16_t spi_read16 (uint8_t reg)
 
uint32_t spi_read32 (uint8_t reg)
 
void spi_write8 (uint8_t reg, uint8_t val)
 
void spi_write16 (uint8_t reg, uint16_t val)
 
void spi_write32 (uint8_t reg, uint32_t val)
 

Variables

struct thread_mutex spi_hw_mutex
 
static uintptr_t spi_base
 

Function Documentation

◆ spi_get_bar()

uintptr_t spi_get_bar ( void  )

Definition at line 19 of file fch_spi_util.c.

References ASSERT, ENV_X86, lpc_get_spibase(), spi_base, and spi_set_base().

Referenced by dump_state(), spi_init(), spi_read16(), spi_read32(), spi_read8(), spi_write16(), spi_write32(), and spi_write8().

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

◆ spi_read16()

uint16_t spi_read16 ( uint8_t  reg)

Definition at line 33 of file fch_spi_util.c.

References read16(), and spi_get_bar().

Referenced by fch_spi_configure_4dw_burst(), fch_spi_set_spi100(), and show_spi_speeds_and_modes().

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

◆ spi_read32()

uint32_t spi_read32 ( uint8_t  reg)

Definition at line 38 of file fch_spi_util.c.

References read32(), and spi_get_bar().

Referenced by dump_state(), fch_spi_set_read_mode(), show_spi_speeds_and_modes(), and wait_for_ready().

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

◆ spi_read8()

uint8_t spi_read8 ( uint8_t  reg)

Definition at line 28 of file fch_spi_util.c.

References read8(), and spi_get_bar().

Referenced by dump_state(), espi_switch_to_spi1_pads(), spi_ctrlr_xfer(), and spi_dma_fix().

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

◆ spi_set_base()

void spi_set_base ( void base)

Definition at line 14 of file fch_spi_util.c.

References base, and spi_base.

Referenced by spi_get_bar().

Here is the caller graph for this function:

◆ spi_write16()

void spi_write16 ( uint8_t  reg,
uint16_t  val 
)

Definition at line 48 of file fch_spi_util.c.

References spi_get_bar(), val, and write16().

Referenced by fch_spi_configure_4dw_burst(), and fch_spi_set_spi100().

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

◆ spi_write32()

void spi_write32 ( uint8_t  reg,
uint32_t  val 
)

Definition at line 53 of file fch_spi_util.c.

References spi_get_bar(), val, and write32().

Referenced by fch_spi_set_read_mode().

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

◆ spi_write8()

void spi_write8 ( uint8_t  reg,
uint8_t  val 
)

Definition at line 43 of file fch_spi_util.c.

References spi_get_bar(), val, and write8().

Referenced by espi_switch_to_spi1_pads(), execute_command(), spi_ctrlr_xfer(), and spi_dma_fix().

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

Variable Documentation

◆ spi_base

uintptr_t spi_base
static

Definition at line 12 of file fch_spi_util.c.

Referenced by enable_spi_fast_mode(), init(), spi_get_bar(), and spi_set_base().

◆ spi_hw_mutex

struct thread_mutex spi_hw_mutex