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

Go to the source code of this file.

Data Structures

union  spi_reg_sckmode
 
union  spi_reg_csmode
 
union  spi_reg_delay0
 
union  spi_reg_delay1
 
union  spi_reg_fmt
 
union  spi_reg_txdata
 
union  spi_reg_rxdata
 
union  spi_reg_txmark
 
union  spi_reg_rxmark
 
union  spi_reg_fctrl
 
union  spi_reg_ffmt
 
union  spi_reg_ie
 
struct  spi_ctrl
 SPI control register memory map. More...
 

Macros

#define _ASSERT_SIZEOF(type, size)
 
#define FU540_SPI_CSMODE_AUTO   0
 
#define FU540_SPI_CSMODE_HOLD   2
 
#define FU540_SPI_CSMODE_OFF   3
 

Typedefs

typedef spi_reg_ie spi_reg_ip
 

Functions

 _ASSERT_SIZEOF (spi_reg_sckmode, 4)
 
 _ASSERT_SIZEOF (spi_reg_csmode, 4)
 
 _ASSERT_SIZEOF (spi_reg_delay0, 4)
 
 _ASSERT_SIZEOF (spi_reg_delay1, 4)
 
 _ASSERT_SIZEOF (spi_reg_fmt, 4)
 
 _ASSERT_SIZEOF (spi_reg_txdata, 4)
 
 _ASSERT_SIZEOF (spi_reg_rxdata, 4)
 
 _ASSERT_SIZEOF (spi_reg_txmark, 4)
 
 _ASSERT_SIZEOF (spi_reg_rxmark, 4)
 
 _ASSERT_SIZEOF (spi_reg_fctrl, 4)
 
 _ASSERT_SIZEOF (spi_reg_ffmt, 4)
 
 _ASSERT_SIZEOF (spi_reg_ie, 4)
 
static unsigned int spi_min_clk_divisor (unsigned int input_khz, unsigned int max_target_khz)
 Get smallest clock divisor that divides input_khz to a quotient less than or equal to max_target_khz;. More...
 

Macro Definition Documentation

◆ _ASSERT_SIZEOF

#define _ASSERT_SIZEOF (   type,
  size 
)
Value:
sizeof(type) == (size), \
#type " must be " #size " bytes wide")
unsigned int type
Definition: edid.c:57
_Static_assert(sizeof(hls_t)==HLS_SIZE, "HLS_SIZE must equal to sizeof(hls_t)")

Definition at line 7 of file spi_internal.h.

◆ FU540_SPI_CSMODE_AUTO

#define FU540_SPI_CSMODE_AUTO   0

Definition at line 11 of file spi_internal.h.

◆ FU540_SPI_CSMODE_HOLD

#define FU540_SPI_CSMODE_HOLD   2

Definition at line 12 of file spi_internal.h.

◆ FU540_SPI_CSMODE_OFF

#define FU540_SPI_CSMODE_OFF   3

Definition at line 13 of file spi_internal.h.

Typedef Documentation

◆ spi_reg_ip

Definition at line 140 of file spi_internal.h.

Function Documentation

◆ _ASSERT_SIZEOF() [1/12]

_ASSERT_SIZEOF ( spi_reg_csmode  ,
 
)

◆ _ASSERT_SIZEOF() [2/12]

_ASSERT_SIZEOF ( spi_reg_delay0  ,
 
)

◆ _ASSERT_SIZEOF() [3/12]

_ASSERT_SIZEOF ( spi_reg_delay1  ,
 
)

◆ _ASSERT_SIZEOF() [4/12]

_ASSERT_SIZEOF ( spi_reg_fctrl  ,
 
)

◆ _ASSERT_SIZEOF() [5/12]

_ASSERT_SIZEOF ( spi_reg_ffmt  ,
 
)

◆ _ASSERT_SIZEOF() [6/12]

_ASSERT_SIZEOF ( spi_reg_fmt  ,
 
)

◆ _ASSERT_SIZEOF() [7/12]

_ASSERT_SIZEOF ( spi_reg_ie  ,
 
)

◆ _ASSERT_SIZEOF() [8/12]

_ASSERT_SIZEOF ( spi_reg_rxdata  ,
 
)

◆ _ASSERT_SIZEOF() [9/12]

_ASSERT_SIZEOF ( spi_reg_rxmark  ,
 
)

◆ _ASSERT_SIZEOF() [10/12]

_ASSERT_SIZEOF ( spi_reg_sckmode  ,
 
)

◆ _ASSERT_SIZEOF() [11/12]

_ASSERT_SIZEOF ( spi_reg_txdata  ,
 
)

◆ _ASSERT_SIZEOF() [12/12]

_ASSERT_SIZEOF ( spi_reg_txmark  ,
 
)

◆ spi_min_clk_divisor()

static unsigned int spi_min_clk_divisor ( unsigned int  input_khz,
unsigned int  max_target_khz 
)
inlinestatic

Get smallest clock divisor that divides input_khz to a quotient less than or equal to max_target_khz;.

Definition at line 196 of file spi_internal.h.

Referenced by fu540_spi_setup().

Here is the caller graph for this function: