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

Go to the source code of this file.

Functions

int do_smbus_recv_byte (uintptr_t base, u8 device)
 
int do_smbus_send_byte (uintptr_t base, u8 device, u8 val)
 
int do_smbus_read_byte (uintptr_t base, u8 device, u8 address)
 
int do_smbus_write_byte (uintptr_t base, u8 device, u8 address, u8 data)
 
int do_smbus_read_word (uintptr_t base, u8 device, u8 address)
 
int do_smbus_write_word (uintptr_t base, u8 device, u8 address, u16 data)
 
int do_smbus_block_read (uintptr_t base, u8 device, u8 cmd, size_t max_bytes, u8 *buf)
 
int do_smbus_block_write (uintptr_t base, u8 device, u8 cmd, size_t bytes, const u8 *buf)
 
int do_smbus_process_call (uintptr_t base, u8 device, u8 cmd, u16 data, u16 *buf)
 
int do_i2c_eeprom_read (uintptr_t base, u8 device, u8 offset, size_t bytes, u8 *buf)
 
int do_i2c_block_write (uintptr_t base, u8 device, size_t bytes, u8 *buf)
 
uintptr_t smbus_base (void)
 
int smbus_enable_iobar (uintptr_t base)
 
void smbus_host_reset (uintptr_t base)
 
void smbus_set_slave_addr (uintptr_t base, u8 slave_address)
 
static void enable_smbus (void)
 

Function Documentation

◆ do_i2c_block_write()

int do_i2c_block_write ( uintptr_t  base,
u8  device,
size_t  bytes,
u8 buf 
)

Definition at line 503 of file smbus.c.

References base, block_cmd_loop(), BLOCK_WRITE, buf, CONFIG, host_outb(), I801_BLOCK_DATA, setup_command(), SMBHSTCMD, SMBHSTDAT1, SMBUS_BLOCK_MAXLEN, SMBUS_ERROR, and XMIT_WRITE.

Referenced by smbus_i2c_block_write().

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

◆ do_i2c_eeprom_read()

int do_i2c_eeprom_read ( uintptr_t  base,
u8  device,
u8  offset,
size_t  bytes,
u8 buf 
)

Definition at line 466 of file smbus.c.

References base, block_cmd_loop(), BLOCK_I2C, BLOCK_READ, buf, has_i2c_read_command(), host_outb(), I801_I2C_BLOCK_DATA, offset, setup_command(), SMBHSTDAT1, SMBUS_ERROR, and XMIT_WRITE.

Here is the call graph for this function:

◆ do_smbus_block_read()

int do_smbus_block_read ( uintptr_t  base,
u8  device,
u8  cmd,
size_t  max_bytes,
u8 buf 
)

Definition at line 368 of file smbus.c.

References base, block_cmd_loop(), BLOCK_READ, buf, host_inb(), host_outb(), I801_BLOCK_DATA, MIN, setup_command(), SMBHSTCMD, SMBHSTDAT0, SMBUS_BLOCK_MAXLEN, SMBUS_ERROR, and XMIT_READ.

Here is the call graph for this function:

◆ do_smbus_block_write()

int do_smbus_block_write ( uintptr_t  base,
u8  device,
u8  cmd,
size_t  bytes,
const u8 buf 
)

Definition at line 431 of file smbus.c.

References base, block_cmd_loop(), BLOCK_WRITE, buf, host_outb(), I801_BLOCK_DATA, setup_command(), SMBHSTCMD, SMBUS_BLOCK_MAXLEN, SMBUS_ERROR, and XMIT_WRITE.

Referenced by eeprom_write_byte(), and lsmbus_block_write().

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

◆ do_smbus_process_call()

int do_smbus_process_call ( uintptr_t  base,
u8  device,
u8  cmd,
u16  data,
u16 buf 
)

Definition at line 399 of file smbus.c.

References base, buf, complete_command(), execute_command(), host_inb(), host_outb(), I801_PROCESS_CALL, setup_command(), SMBHSTCMD, SMBHSTDAT0, SMBHSTDAT1, and XMIT_WRITE.

Referenced by eeprom_read_buffer().

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

◆ do_smbus_read_byte()

int do_smbus_read_byte ( uintptr_t  base,
u8  device,
u8  address 
)

Definition at line 121 of file smbus.c.

References address, base, controller_read8(), controller_write8(), I801_BYTE_DATA, SMBHST_CTRL_BDT_RW, SMBHST_CTRL_MODE_BITS, SMBHST_CTRL_STRT, SMBHSTADDR, SMBHSTCMD, SMBHSTCTRL, SMBHSTDAT0, smbus_read_cmd(), smbus_wait_until_done(), and smbus_wait_until_ready().

Referenced by lsmbus_read_byte(), and readspd().

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

◆ do_smbus_read_word()

int do_smbus_read_word ( uintptr_t  base,
u8  device,
u8  address 
)

Definition at line 353 of file smbus.c.

References address, base, I801_WORD_DATA, and smbus_read_cmd().

Here is the call graph for this function:

◆ do_smbus_recv_byte()

int do_smbus_recv_byte ( uintptr_t  base,
u8  device 
)

Definition at line 71 of file smbus.c.

References controller_read8(), controller_write8(), SMBHST_CTRL_BTE_RW, SMBHST_CTRL_MODE_BITS, SMBHST_CTRL_STRT, SMBHSTADDR, SMBHSTCTRL, SMBHSTDAT0, smbus_wait_until_done(), and smbus_wait_until_ready().

Referenced by lsmbus_recv_byte(), and readspd().

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

◆ do_smbus_send_byte()

int do_smbus_send_byte ( uintptr_t  base,
u8  device,
u8  val 
)

Definition at line 96 of file smbus.c.

References controller_read8(), controller_write8(), SMBHST_CTRL_BTE_RW, SMBHST_CTRL_MODE_BITS, SMBHST_CTRL_STRT, SMBHSTADDR, SMBHSTCTRL, SMBHSTDAT0, smbus_wait_until_done(), smbus_wait_until_ready(), and val.

Referenced by lsmbus_send_byte().

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

◆ do_smbus_write_byte()

int do_smbus_write_byte ( uintptr_t  base,
u8  device,
u8  address,
u8  data 
)

Definition at line 149 of file smbus.c.

References address, base, controller_read8(), controller_write8(), I801_BYTE_DATA, SMBHST_CTRL_BDT_RW, SMBHST_CTRL_MODE_BITS, SMBHST_CTRL_STRT, SMBHSTADDR, SMBHSTCMD, SMBHSTCTRL, SMBHSTDAT0, smbus_wait_until_done(), smbus_wait_until_ready(), smbus_write_cmd(), and val.

Referenced by board_BeforeAgesa(), and lsmbus_write_byte().

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

◆ do_smbus_write_word()

int do_smbus_write_word ( uintptr_t  base,
u8  device,
u8  address,
u16  data 
)

Definition at line 363 of file smbus.c.

References address, base, I801_WORD_DATA, and smbus_write_cmd().

Here is the call graph for this function:

◆ enable_smbus()

static void enable_smbus ( void  )
inlinestatic

Definition at line 34 of file smbus_host.h.

References base, BIOS_DEBUG, die(), printk, smbus_base(), smbus_enable_iobar(), and smbus_host_reset().

Referenced by early_pch_init(), i82371eb_early_init(), i82801dx_early_init(), i82801ix_early_init(), i82801jx_early_init(), pch_early_init(), and raminit().

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

◆ smbus_base()

uintptr_t smbus_base ( void  )

Definition at line 22 of file raminit.c.

References SMBUS_BASE_ADDRESS, and SMBUS_IO_BASE.

Referenced by enable_smbus().

Here is the caller graph for this function:

◆ smbus_enable_iobar()

◆ smbus_host_reset()

void smbus_host_reset ( uintptr_t  base)

Definition at line 93 of file smbus.c.

References base, host_and_or(), host_outb(), SMBHSTCTL, and SMBHSTSTAT.

Referenced by enable_smbus().

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

◆ smbus_set_slave_addr()

void smbus_set_slave_addr ( uintptr_t  base,
u8  slave_address 
)

Definition at line 102 of file smbus.c.

References base, host_outb(), and SMB_RCV_SLVA.

Referenced by pch_smbus_init().

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