coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
spi_flash_internal.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  spi_flash_part_id
 
struct  spi_flash_ops_descriptor
 
struct  spi_flash_vendor_info
 

Macros

#define CMD_READ_ID   0x9f
 
#define CMD_READ_ARRAY_SLOW   0x03
 
#define CMD_READ_ARRAY_FAST   0x0b
 
#define CMD_READ_ARRAY_LEGACY   0xe8
 
#define CMD_READ_FAST_DUAL_OUTPUT   0x3b
 
#define CMD_READ_FAST_DUAL_IO   0xbb
 
#define CMD_READ_STATUS   0x05
 
#define CMD_WRITE_ENABLE   0x06
 
#define CMD_BLOCK_ERASE   0xD8
 
#define CMD_EXIT_4BYTE_ADDR_MODE   0xe9
 
#define STATUS_WIP   0x01
 

Functions

int spi_flash_cmd (const struct spi_slave *spi, u8 cmd, void *response, size_t len)
 
int spi_flash_cmd_write (const struct spi_slave *spi, const u8 *cmd, size_t cmd_len, const void *data, size_t data_len)
 
int spi_flash_cmd_poll_bit (const struct spi_flash *flash, unsigned long timeout, u8 cmd, u8 poll_bit)
 
int spi_flash_cmd_wait_ready (const struct spi_flash *flash, unsigned long timeout)
 
int spi_flash_cmd_erase (const struct spi_flash *flash, u32 offset, size_t len)
 
int spi_flash_cmd_status (const struct spi_flash *flash, u8 *reg)
 
int spi_flash_cmd_write_page_program (const struct spi_flash *flash, u32 offset, size_t len, const void *buf)
 
int spi_flash_cmd_read (const struct spi_flash *flash, u32 offset, size_t len, void *buf)
 
int stmicro_release_deep_sleep_identify (const struct spi_slave *spi, u8 *idcode)
 

Variables

const struct spi_flash_vendor_info spi_flash_adesto_vi
 
const struct spi_flash_vendor_info spi_flash_amic_vi
 
const struct spi_flash_vendor_info spi_flash_atmel_vi
 
const struct spi_flash_vendor_info spi_flash_eon_vi
 
const struct spi_flash_vendor_info spi_flash_gigadevice_vi
 
const struct spi_flash_vendor_info spi_flash_macronix_vi
 
const struct spi_flash_vendor_info spi_flash_spansion_ext1_vi
 
const struct spi_flash_vendor_info spi_flash_spansion_ext2_vi
 
const struct spi_flash_vendor_info spi_flash_spansion_vi
 
const struct spi_flash_vendor_info spi_flash_sst_ai_vi
 
const struct spi_flash_vendor_info spi_flash_sst_vi
 
const struct spi_flash_vendor_info spi_flash_stmicro1_vi
 
const struct spi_flash_vendor_info spi_flash_stmicro2_vi
 
const struct spi_flash_vendor_info spi_flash_stmicro3_vi
 
const struct spi_flash_vendor_info spi_flash_stmicro4_vi
 
const struct spi_flash_vendor_info spi_flash_winbond_vi
 
const struct spi_flash_ops_descriptor spi_flash_pp_0x20_sector_desc
 
const struct spi_flash_ops_descriptor spi_flash_pp_0xd8_sector_desc
 

Macro Definition Documentation

◆ CMD_BLOCK_ERASE

#define CMD_BLOCK_ERASE   0xD8

Definition at line 23 of file spi_flash_internal.h.

◆ CMD_EXIT_4BYTE_ADDR_MODE

#define CMD_EXIT_4BYTE_ADDR_MODE   0xe9

Definition at line 25 of file spi_flash_internal.h.

◆ CMD_READ_ARRAY_FAST

#define CMD_READ_ARRAY_FAST   0x0b

Definition at line 14 of file spi_flash_internal.h.

◆ CMD_READ_ARRAY_LEGACY

#define CMD_READ_ARRAY_LEGACY   0xe8

Definition at line 15 of file spi_flash_internal.h.

◆ CMD_READ_ARRAY_SLOW

#define CMD_READ_ARRAY_SLOW   0x03

Definition at line 13 of file spi_flash_internal.h.

◆ CMD_READ_FAST_DUAL_IO

#define CMD_READ_FAST_DUAL_IO   0xbb

Definition at line 18 of file spi_flash_internal.h.

◆ CMD_READ_FAST_DUAL_OUTPUT

#define CMD_READ_FAST_DUAL_OUTPUT   0x3b

Definition at line 17 of file spi_flash_internal.h.

◆ CMD_READ_ID

#define CMD_READ_ID   0x9f

Definition at line 11 of file spi_flash_internal.h.

◆ CMD_READ_STATUS

#define CMD_READ_STATUS   0x05

Definition at line 20 of file spi_flash_internal.h.

◆ CMD_WRITE_ENABLE

#define CMD_WRITE_ENABLE   0x06

Definition at line 21 of file spi_flash_internal.h.

◆ STATUS_WIP

#define STATUS_WIP   0x01

Definition at line 28 of file spi_flash_internal.h.

Function Documentation

◆ spi_flash_cmd()

int spi_flash_cmd ( const struct spi_slave spi,
u8  cmd,
void response,
size_t  len 
)

◆ spi_flash_cmd_erase()

int spi_flash_cmd_erase ( const struct spi_flash flash,
u32  offset,
size_t  len 
)

◆ spi_flash_cmd_poll_bit()

int spi_flash_cmd_poll_bit ( const struct spi_flash flash,
unsigned long  timeout,
u8  cmd,
u8  poll_bit 
)

Definition at line 190 of file spi_flash.c.

References BIOS_WARNING, do_spi_flash_cmd(), printk, spi_flash::spi, stopwatch_duration_msecs(), stopwatch_expired(), and stopwatch_init_msecs_expire().

Referenced by spi_flash_cmd_wait_ready().

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

◆ spi_flash_cmd_read()

◆ spi_flash_cmd_status()

int spi_flash_cmd_status ( const struct spi_flash flash,
u8 reg 
)

Definition at line 276 of file spi_flash.c.

References spi_flash::spi, spi_flash_cmd(), and spi_flash::status_cmd.

Here is the call graph for this function:

◆ spi_flash_cmd_wait_ready()

int spi_flash_cmd_wait_ready ( const struct spi_flash flash,
unsigned long  timeout 
)

Definition at line 221 of file spi_flash.c.

References CMD_READ_STATUS, spi_flash_cmd_poll_bit(), and STATUS_WIP.

Referenced by spi_flash_cmd_erase(), spi_flash_cmd_write_page_program(), sst_byte_write(), sst_write_ai(), and winbond_flash_cmd_status().

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

◆ spi_flash_cmd_write()

int spi_flash_cmd_write ( const struct spi_slave spi,
const u8 cmd,
size_t  cmd_len,
const void data,
size_t  data_len 
)

Definition at line 122 of file spi_flash.c.

References BIOS_WARNING, do_spi_flash_cmd(), memcpy(), NULL, and printk.

Referenced by spi_flash_cmd_erase(), spi_flash_cmd_write_page_program(), sst_byte_write(), sst_write_ai(), and winbond_flash_cmd_status().

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

◆ spi_flash_cmd_write_page_program()

int spi_flash_cmd_write_page_program ( const struct spi_flash flash,
u32  offset,
size_t  len,
const void buf 
)

◆ stmicro_release_deep_sleep_identify()

int stmicro_release_deep_sleep_identify ( const struct spi_slave spi,
u8 idcode 
)

Definition at line 195 of file stmicro.c.

Referenced by spi_flash_generic_probe().

Here is the caller graph for this function:

Variable Documentation

◆ spi_flash_adesto_vi

const struct spi_flash_vendor_info spi_flash_adesto_vi
extern

Definition at line 1 of file adesto.c.

◆ spi_flash_amic_vi

const struct spi_flash_vendor_info spi_flash_amic_vi
extern

Definition at line 1 of file amic.c.

◆ spi_flash_atmel_vi

const struct spi_flash_vendor_info spi_flash_atmel_vi
extern

Definition at line 1 of file atmel.c.

◆ spi_flash_eon_vi

const struct spi_flash_vendor_info spi_flash_eon_vi
extern

Definition at line 1 of file eon.c.

◆ spi_flash_gigadevice_vi

const struct spi_flash_vendor_info spi_flash_gigadevice_vi
extern

Definition at line 1 of file gigadevice.c.

◆ spi_flash_macronix_vi

const struct spi_flash_vendor_info spi_flash_macronix_vi
extern

Definition at line 1 of file macronix.c.

◆ spi_flash_pp_0x20_sector_desc

const struct spi_flash_ops_descriptor spi_flash_pp_0x20_sector_desc
extern

Definition at line 745 of file spi_flash.c.

◆ spi_flash_pp_0xd8_sector_desc

const struct spi_flash_ops_descriptor spi_flash_pp_0xd8_sector_desc
extern

Definition at line 745 of file spi_flash.c.

◆ spi_flash_spansion_ext1_vi

const struct spi_flash_vendor_info spi_flash_spansion_ext1_vi
extern

Definition at line 1 of file spansion.c.

◆ spi_flash_spansion_ext2_vi

const struct spi_flash_vendor_info spi_flash_spansion_ext2_vi
extern

Definition at line 1 of file spansion.c.

◆ spi_flash_spansion_vi

const struct spi_flash_vendor_info spi_flash_spansion_vi
extern

Definition at line 1 of file spansion.c.

◆ spi_flash_sst_ai_vi

const struct spi_flash_vendor_info spi_flash_sst_ai_vi
extern

Definition at line 209 of file sst.c.

◆ spi_flash_sst_vi

const struct spi_flash_vendor_info spi_flash_sst_vi
extern

Definition at line 209 of file sst.c.

◆ spi_flash_stmicro1_vi

const struct spi_flash_vendor_info spi_flash_stmicro1_vi
extern

Definition at line 195 of file stmicro.c.

◆ spi_flash_stmicro2_vi

const struct spi_flash_vendor_info spi_flash_stmicro2_vi
extern

Definition at line 195 of file stmicro.c.

◆ spi_flash_stmicro3_vi

const struct spi_flash_vendor_info spi_flash_stmicro3_vi
extern

Definition at line 195 of file stmicro.c.

◆ spi_flash_stmicro4_vi

const struct spi_flash_vendor_info spi_flash_stmicro4_vi
extern

Definition at line 195 of file stmicro.c.

◆ spi_flash_winbond_vi

const struct spi_flash_vendor_info spi_flash_winbond_vi
extern

Definition at line 438 of file winbond.c.