![]() |
coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
|
#include <arch/io.h>
#include <console/console.h>
#include <device/smbus_def.h>
#include <device/smbus_host.h>
#include <types.h>
Go to the source code of this file.
Macros | |
#define | dprintk(args...) do {} while (0) |
#define | SMBHSTSTAT 0x0 |
#define | SMBHSTCTL 0x2 |
#define | SMBHSTCMD 0x3 |
#define | SMBXMITADD 0x4 |
#define | SMBHSTDAT0 0x5 |
#define | SMBHSTDAT1 0x6 |
#define | SMBBLKDAT 0x7 |
#define | SMBTRNSADD 0x9 |
#define | SMBSLVDATA 0xa |
#define | SMLINK_PIN_CTL 0xe |
#define | SMBUS_PIN_CTL 0xf |
#define | SMBSLVCMD 0x11 |
#define | SMB_RCV_SLVA SMBTRNSADD |
#define | I801_QUICK (0 << 2) |
#define | I801_BYTE (1 << 2) |
#define | I801_BYTE_DATA (2 << 2) |
#define | I801_WORD_DATA (3 << 2) |
#define | I801_PROCESS_CALL (4 << 2) |
#define | I801_BLOCK_DATA (5 << 2) |
#define | I801_I2C_BLOCK_DATA (6 << 2) /* ICH5 and later */ |
#define | SMBHSTCNT_INTREN (1 << 0) |
#define | SMBHSTCNT_KILL (1 << 1) |
#define | SMBHSTCNT_LAST_BYTE (1 << 5) |
#define | SMBHSTCNT_START (1 << 6) |
#define | SMBHSTCNT_PEC_EN (1 << 7) /* ICH3 and later */ |
#define | SMBHSTSTS_BYTE_DONE (1 << 7) |
#define | SMBHSTSTS_INUSE_STS (1 << 6) |
#define | SMBHSTSTS_SMBALERT_STS (1 << 5) |
#define | SMBHSTSTS_FAILED (1 << 4) |
#define | SMBHSTSTS_BUS_ERR (1 << 3) |
#define | SMBHSTSTS_DEV_ERR (1 << 2) |
#define | SMBHSTSTS_INTR (1 << 1) |
#define | SMBHSTSTS_HOST_BUSY (1 << 0) |
#define | XMIT_WRITE(dev) (((dev) << 1) | 0) |
#define | XMIT_READ(dev) (((dev) << 1) | 1) |
#define | SMBUS_TIMEOUT (10 * 1000 * 100) |
#define | SMBUS_BLOCK_MAXLEN 32 |
#define | BLOCK_READ 0 |
#define | BLOCK_WRITE (1 << 0) |
#define | BLOCK_I2C (1 << 1) |
#define SMB_RCV_SLVA SMBTRNSADD |
Definition at line 269 of file smbus.c.
References base, BLOCK_I2C, BLOCK_WRITE, buf, cb_err_from_stat(), dprintk, execute_command(), host_and_or(), host_completed(), host_inb(), host_outb(), recover_master(), SMBBLKDAT, SMBHSTCNT_LAST_BYTE, SMBHSTCTL, SMBHSTDAT0, SMBHSTSTAT, SMBHSTSTS_BYTE_DONE, SMBUS_ERROR, SMBUS_TIMEOUT, and SMBUS_WAIT_UNTIL_DONE_TIMEOUT.
Referenced by do_i2c_block_write(), do_i2c_eeprom_read(), do_smbus_block_read(), and do_smbus_block_write().
|
static |
Definition at line 127 of file smbus.c.
References SMBHSTSTS_BYTE_DONE, SMBHSTSTS_INTR, SMBHSTSTS_INUSE_STS, SMBHSTSTS_SMBALERT_STS, and SMBUS_ERROR.
Referenced by block_cmd_loop(), and complete_command().
|
static |
Definition at line 191 of file smbus.c.
References base, cb_err_from_stat(), host_completed(), host_inb(), recover_master(), SMBHSTSTAT, smbus_delay(), SMBUS_TIMEOUT, and SMBUS_WAIT_UNTIL_DONE_TIMEOUT.
Referenced by do_smbus_process_call(), smbus_read_cmd(), and smbus_write_cmd().
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().
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.
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.
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().
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().
Definition at line 348 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().
Definition at line 353 of file smbus.c.
References address, base, I801_WORD_DATA, and smbus_read_cmd().
Definition at line 358 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().
Definition at line 363 of file smbus.c.
References address, base, I801_WORD_DATA, and smbus_write_cmd().
|
static |
Definition at line 165 of file smbus.c.
References base, host_and_or(), host_inb(), recover_master(), SMBHSTCNT_START, SMBHSTCTL, SMBHSTSTAT, SMBHSTSTS_INUSE_STS, SMBHSTSTS_SMBALERT_STS, smbus_delay(), SMBUS_TIMEOUT, and SMBUS_WAIT_UNTIL_ACTIVE_TIMEOUT.
Referenced by block_cmd_loop(), do_smbus_process_call(), smbus_read_cmd(), and smbus_write_cmd().
|
static |
Definition at line 458 of file smbus.c.
References CONFIG.
Referenced by do_i2c_eeprom_read().
Definition at line 84 of file smbus.c.
References base, host_inb(), host_outb(), mask, and value.
Referenced by block_cmd_loop(), execute_command(), setup_command(), and smbus_host_reset().
|
static |
Definition at line 107 of file smbus.c.
References SMBHSTSTS_BYTE_DONE, SMBHSTSTS_HOST_BUSY, SMBHSTSTS_INUSE_STS, and SMBHSTSTS_SMBALERT_STS.
Referenced by block_cmd_loop(), and complete_command().
Definition at line 79 of file smbus.c.
Referenced by block_cmd_loop(), complete_command(), do_smbus_block_read(), do_smbus_process_call(), execute_command(), host_and_or(), setup_command(), and smbus_read_cmd().
Definition at line 74 of file smbus.c.
References base, outb(), and value.
Referenced by block_cmd_loop(), do_i2c_block_write(), do_i2c_eeprom_read(), do_smbus_block_read(), do_smbus_block_write(), do_smbus_process_call(), host_and_or(), setup_command(), smbus_host_reset(), smbus_read_cmd(), smbus_set_slave_addr(), and smbus_write_cmd().
|
static |
Definition at line 118 of file smbus.c.
References BIOS_ERR, and printk.
Referenced by block_cmd_loop(), complete_command(), execute_command(), and setup_command().
Definition at line 139 of file smbus.c.
References base, host_and_or(), host_inb(), host_outb(), recover_master(), SMBHSTCTL, SMBHSTSTAT, SMBHSTSTS_HOST_BUSY, smbus_delay(), SMBUS_TIMEOUT, SMBUS_WAIT_UNTIL_READY_TIMEOUT, and SMBXMITADD.
Referenced by do_i2c_block_write(), do_i2c_eeprom_read(), do_smbus_block_read(), do_smbus_block_write(), do_smbus_process_call(), smbus_read_cmd(), and smbus_write_cmd().
Definition at line 69 of file smbus.c.
References inb().
Referenced by complete_command(), execute_command(), and setup_command().
Definition at line 93 of file smbus.c.
References base, host_and_or(), host_outb(), SMBHSTCTL, and SMBHSTSTAT.
Referenced by enable_smbus().
Definition at line 208 of file smbus.c.
References address, base, complete_command(), execute_command(), host_inb(), host_outb(), I801_WORD_DATA, setup_command(), SMBHSTCMD, SMBHSTDAT0, SMBHSTDAT1, word, and XMIT_READ.
Referenced by do_smbus_read_byte(), and do_smbus_read_word().
Definition at line 102 of file smbus.c.
References base, host_outb(), and SMB_RCV_SLVA.
Referenced by pch_smbus_init().
Definition at line 243 of file smbus.c.
References address, base, complete_command(), execute_command(), host_outb(), I801_WORD_DATA, setup_command(), SMBHSTCMD, SMBHSTDAT0, SMBHSTDAT1, and XMIT_WRITE.
Referenced by do_smbus_write_byte(), and do_smbus_write_word().