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

Go to the source code of this file.

Functions

void show_spi_speeds_and_modes (void)
 
void __weak mainboard_spi_fast_speed_override (uint8_t *fast_speed)
 
static uint8_t lower_speed (uint8_t speed1, uint8_t speed2)
 
static void fch_spi_set_spi100 (uint8_t norm, uint8_t fast, uint8_t alt, uint8_t tpm)
 
static void fch_spi_configure_4dw_burst (void)
 
static void fch_spi_set_read_mode (u32 mode)
 
void fch_spi_config_modes (void)
 
void fch_spi_early_init (void)
 

Variables

static const char * spi_speed_str [8]
 
static const char * read_mode_str [8]
 

Function Documentation

◆ fch_spi_config_modes()

void fch_spi_config_modes ( void  )

Definition at line 99 of file fch_spi.c.

References fch_spi_set_read_mode(), fch_spi_set_spi100(), lower_speed(), mainboard_spi_fast_speed_override(), and read_efs_spi_settings().

Referenced by fch_spi_early_init(), and verstage_soc_spi_init().

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

◆ fch_spi_configure_4dw_burst()

static void fch_spi_configure_4dw_burst ( void  )
static

Definition at line 80 of file fch_spi.c.

References CONFIG, SPI100_HOST_PREF_CONFIG, SPI_RD4DW_EN_HOST, spi_read16(), spi_write16(), and val.

Referenced by fch_spi_early_init().

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

◆ fch_spi_early_init()

void fch_spi_early_init ( void  )

Definition at line 122 of file fch_spi.c.

References fch_spi_config_modes(), fch_spi_configure_4dw_burst(), lpc_enable_spi_prefetch(), lpc_enable_spi_rom(), and SPI_ROM_ENABLE.

Referenced by bootblock_fch_early_init(), and fch_pre_init().

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

◆ fch_spi_set_read_mode()

static void fch_spi_set_read_mode ( u32  mode)
static

Definition at line 92 of file fch_spi.c.

References SPI_CNTRL0, spi_read32(), SPI_READ_MODE, SPI_READ_MODE_MASK, spi_write32(), and val.

Referenced by fch_spi_config_modes().

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

◆ fch_spi_set_spi100()

static void fch_spi_set_spi100 ( uint8_t  norm,
uint8_t  fast,
uint8_t  alt,
uint8_t  tpm 
)
static

Definition at line 74 of file fch_spi.c.

References SPI100_ENABLE, SPI100_SPEED_CONFIG, spi_read16(), SPI_SPEED_CFG, SPI_USE_SPI100, and spi_write16().

Referenced by fch_spi_config_modes().

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

◆ lower_speed()

static uint8_t lower_speed ( uint8_t  speed1,
uint8_t  speed2 
)
static

Definition at line 58 of file fch_spi.c.

References ARRAY_SIZE, SPI_SPEED_100M, SPI_SPEED_16M, SPI_SPEED_22M, SPI_SPEED_33M, SPI_SPEED_66M, and SPI_SPEED_800K.

Referenced by fch_spi_config_modes().

Here is the caller graph for this function:

◆ mainboard_spi_fast_speed_override()

void __weak mainboard_spi_fast_speed_override ( uint8_t fast_speed)

Definition at line 53 of file fch_spi.c.

Referenced by fch_spi_config_modes().

Here is the caller graph for this function:

◆ show_spi_speeds_and_modes()

void show_spi_speeds_and_modes ( void  )

Variable Documentation

◆ read_mode_str

const char* read_mode_str[8]
static
Initial value:
= {
"Normal Read (up to 33M)",
"Reserved",
"Dual IO (1-1-2)",
"Quad IO (1-1-4)",
"Dual IO (1-2-2)",
"Quad IO (1-4-4)",
"Normal Read (up to 66M)",
"Fast Read"
}

Definition at line 24 of file fch_spi.c.

Referenced by show_spi_speeds_and_modes().

◆ spi_speed_str

const char* spi_speed_str[8]
static
Initial value:
= {
"66.66 Mhz",
"33.33 MHz",
"22.22 MHz",
"16.66 MHz",
"100 MHz",
"800 KHz",
"Invalid",
"Invalid"
}

Definition at line 13 of file fch_spi.c.

Referenced by show_spi_speeds_and_modes().