coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
fast_spi.h File Reference
#include <types.h>
Include dependency graph for fast_spi.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void fast_spi_clear_outstanding_status (void)
 
int fast_spi_cycle_in_progress (void)
 
void fast_spi_init (void)
 
void fast_spi_set_bios_interface_lock_down (void)
 
void fast_spi_set_lock_enable (void)
 
void fast_spi_set_ext_bios_lock_enable (void)
 
void fast_spi_set_eiss (void)
 
void fast_spi_set_opcode_menu (void)
 
void fast_spi_lock_bar (void)
 
void fast_spi_pr_dlock (void)
 
void fast_spi_vscc0_lock (void)
 
void fast_spi_set_strap_msg_data (uint32_t soft_reset_data)
 
size_t fast_spi_get_bios_region (size_t *bios_size)
 
void fast_spi_cache_bios_region (void)
 
void fast_spi_early_init (uintptr_t spi_base_address)
 
bool fast_spi_clear_sync_smi_status (void)
 
bool fast_spi_wpd_status (void)
 
void fast_spi_enable_wp (void)
 
void fast_spi_disable_wp (void)
 
void fast_spi_get_ext_bios_window (uintptr_t *base, size_t *size)
 
uint32_t soc_get_spi_psf_destination_id (void)
 
void fast_spi_cache_ext_bios_postcar (struct postcar_frame *pcf)
 

Variables

const struct spi_ctrlr fast_spi_flash_ctrlr
 

Function Documentation

◆ fast_spi_cache_bios_region()

void fast_spi_cache_bios_region ( void  )

Definition at line 292 of file fast_spi.c.

References ALIGN_UP, base, bios_size, fast_spi_cache_ext_bios_window(), fast_spi_enable_cache_range(), fast_spi_get_bios_region(), GiB, log2_ceil(), MiB, and MIN.

Referenced by apollolake_init_cpus(), bootblock_c_entry(), bootblock_soc_early_init(), and post_cpus_add_romcache().

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

◆ fast_spi_cache_ext_bios_postcar()

void fast_spi_cache_ext_bios_postcar ( struct postcar_frame pcf)

Definition at line 280 of file fast_spi.c.

References fast_spi_ext_bios_cache_range(), MTRR_TYPE_WRPROT, postcar_frame_add_mtrr(), and type.

Referenced by fill_postcar_frame().

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

◆ fast_spi_clear_outstanding_status()

void fast_spi_clear_outstanding_status ( void  )

Definition at line 449 of file fast_spi.c.

References fast_spi_get_bar(), spibar, SPIBAR_HSFSTS_CTL, SPIBAR_HSFSTS_W1C_BITS, and write32().

Referenced by fast_spi_lockdown_cfg().

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

◆ fast_spi_clear_sync_smi_status()

bool fast_spi_clear_sync_smi_status ( void  )

Definition at line 407 of file fast_spi.c.

References PCH_DEV_SPI, pci_read_config32(), pci_write_config32(), SPI_BIOS_CONTROL, and SPI_BIOS_CONTROL_SYNC_SS.

Referenced by smihandler_southbridge_tco(), and southbridge_smi_store().

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

◆ fast_spi_cycle_in_progress()

int fast_spi_cycle_in_progress ( void  )

Definition at line 164 of file fast_spi_flash.c.

References BIOS_ERR, BOILERPLATE_CREATE_CTX, printk, SPIBAR_HWSEQ_XFER_TIMEOUT_MS, SUCCESS, and wait_for_hwseq_spi_cycle_complete().

Referenced by fast_spi_lockdown_cfg().

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

◆ fast_spi_disable_wp()

void fast_spi_disable_wp ( void  )

Definition at line 439 of file fast_spi.c.

References PCH_DEV_SPI, pci_read_config8(), pci_write_config8(), SPI_BIOS_CONTROL, and SPI_BIOS_CONTROL_WPD.

Referenced by southbridge_smi_store().

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

◆ fast_spi_early_init()

void fast_spi_early_init ( uintptr_t  spi_base_address)

◆ fast_spi_enable_wp()

void fast_spi_enable_wp ( void  )

Definition at line 428 of file fast_spi.c.

References PCH_DEV_SPI, pci_read_config8(), pci_write_config8(), SPI_BIOS_CONTROL, and SPI_BIOS_CONTROL_WPD.

Referenced by fast_spi_lockdown_cfg(), finalize(), smihandler_southbridge_tco(), and southbridge_smi_store().

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

◆ fast_spi_get_bios_region()

size_t fast_spi_get_bios_region ( size_t bios_size)

Definition at line 232 of file fast_spi.c.

References bios_size, fast_spi_get_bar(), KiB, read32(), SPIBAR_BFPREG, SPIBAR_BFPREG_PRB_MASK, SPIBAR_BFPREG_PRL_MASK, SPIBAR_BFPREG_PRL_SHIFT, and val.

Referenced by bios_mmap_init(), and fast_spi_cache_bios_region().

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

◆ fast_spi_get_ext_bios_window()

void fast_spi_get_ext_bios_window ( uintptr_t base,
size_t size 
)

Definition at line 146 of file mmap_boot.c.

References base, bios_mmap_init(), EXT_BIOS_DECODE_WINDOW, mem_region_device::rdev, rdev_mmap_full(), region_device_sz(), and shadow_devs.

Referenced by fast_spi_ext_bios_cache_range().

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

◆ fast_spi_init()

void fast_spi_init ( void  )

Definition at line 41 of file fast_spi.c.

References PCH_DEV_SPI, pci_read_config8(), pci_write_config8(), SPI_BIOS_CONTROL, SPI_BIOS_CONTROL_CACHE_DISABLE, SPI_BIOS_CONTROL_EISS, SPI_BIOS_CONTROL_PREFETCH_ENABLE, and SPI_BIOS_CONTROL_WPD.

Referenced by fast_spi_early_init(), finalize(), and spi_flash_init_cb().

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

◆ fast_spi_lock_bar()

void fast_spi_lock_bar ( void  )

Definition at line 145 of file fast_spi.c.

References CONFIG, fast_spi_get_bar(), spibar, SPIBAR_HSFSTS_CTL, SPIBAR_HSFSTS_FLOCKDN, SPIBAR_HSFSTS_PRR34_LOCKDN, SPIBAR_HSFSTS_WRSDIS, and write16().

Referenced by fast_spi_lockdown_cfg().

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

◆ fast_spi_pr_dlock()

void fast_spi_pr_dlock ( void  )

Definition at line 160 of file fast_spi.c.

References fast_spi_get_bar(), read32(), spibar, SPIBAR_DLOCK, SPIBAR_DLOCK_PR0LOCKDN, SPIBAR_DLOCK_PR1LOCKDN, SPIBAR_DLOCK_PR2LOCKDN, SPIBAR_DLOCK_PR3LOCKDN, SPIBAR_DLOCK_PR4LOCKDN, and write32().

Referenced by fast_spi_lockdown_cfg().

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

◆ fast_spi_set_bios_interface_lock_down()

void fast_spi_set_bios_interface_lock_down ( void  )

Definition at line 83 of file fast_spi.c.

References fast_spi_read_post_write(), fast_spi_set_bios_control_reg(), SPI_BIOS_CONTROL, and SPI_BIOS_CONTROL_BILD.

Referenced by fast_spi_lockdown_cfg().

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

◆ fast_spi_set_eiss()

void fast_spi_set_eiss ( void  )

Definition at line 116 of file fast_spi.c.

References fast_spi_read_post_write(), fast_spi_set_bios_control_reg(), SPI_BIOS_CONTROL, and SPI_BIOS_CONTROL_EISS.

Referenced by fast_spi_lockdown_cfg().

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

◆ fast_spi_set_ext_bios_lock_enable()

void fast_spi_set_ext_bios_lock_enable ( void  )

Definition at line 103 of file fast_spi.c.

References CONFIG, fast_spi_read_post_write(), fast_spi_set_bios_control_reg(), SPI_BIOS_CONTROL, and SPI_BIOS_CONTROL_EXT_BIOS_LOCK_ENABLE.

Referenced by fast_spi_lockdown_cfg().

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

◆ fast_spi_set_lock_enable()

void fast_spi_set_lock_enable ( void  )

Definition at line 93 of file fast_spi.c.

References fast_spi_read_post_write(), fast_spi_set_bios_control_reg(), SPI_BIOS_CONTROL, and SPI_BIOS_CONTROL_LOCK_ENABLE.

Referenced by fast_spi_lockdown_cfg().

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

◆ fast_spi_set_opcode_menu()

void fast_spi_set_opcode_menu ( void  )

Definition at line 126 of file fast_spi.c.

References fast_spi_get_bar(), SPI_OPMENU_LOWER, SPI_OPMENU_UPPER, SPI_OPPREFIX, SPI_OPTYPE, spibar, SPIBAR_OPMENU_LOWER, SPIBAR_OPMENU_UPPER, SPIBAR_OPTYPE, SPIBAR_PREOP, write16(), and write32().

Referenced by fast_spi_lockdown_cfg(), and mainboard_final().

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

◆ fast_spi_set_strap_msg_data()

void fast_spi_set_strap_msg_data ( uint32_t  soft_reset_data)

Definition at line 193 of file fast_spi.c.

References fast_spi_get_bar(), read32(), spibar, SPIBAR_RESET_CTRL, SPIBAR_RESET_CTRL_SSMC, SPIBAR_RESET_DATA, SPIBAR_RESET_LOCK, SPIBAR_RESET_LOCK_ENABLE, and write32().

Here is the call graph for this function:

◆ fast_spi_vscc0_lock()

void fast_spi_vscc0_lock ( void  )

Definition at line 176 of file fast_spi.c.

References fast_spi_get_bar(), setbits32, spibar, SPIBAR_SFDP0_VSCC0, and SPIBAR_VSCC0_VCL.

Referenced by fast_spi_lockdown_cfg().

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

◆ fast_spi_wpd_status()

bool fast_spi_wpd_status ( void  )

Definition at line 421 of file fast_spi.c.

References PCH_DEV_SPI, pci_read_config16(), SPI_BIOS_CONTROL, and SPI_BIOS_CONTROL_WPD.

Referenced by smihandler_southbridge_tco(), and southbridge_smi_store().

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

◆ soc_get_spi_psf_destination_id()

uint32_t soc_get_spi_psf_destination_id ( void  )

Definition at line 32 of file spi.c.

References CONFIG, PSF_SPI_DESTINATION_ID, and PSF_SPI_DESTINATION_ID_H.

Referenced by fast_spi_enable_ext_bios().

Here is the caller graph for this function:

Variable Documentation

◆ fast_spi_flash_ctrlr

const struct spi_ctrlr fast_spi_flash_ctrlr
extern

Definition at line 365 of file fast_spi_flash.c.