![]() |
coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
|
#include <device/mmio.h>
#include <console/console.h>
#include <delay.h>
#include <timer.h>
#include <soc/iomap.h>
#include <soc/qup.h>
Go to the source code of this file.
Macros | |
#define | TIMEOUT_CNT 100000 |
#define | QUP_ADDR(gsbi_num, reg) ((void *)((gsbi_qup_base[gsbi_num-1]) + (reg))) |
Variables | |
static unsigned int | gsbi_qup_base [] |
#define QUP_ADDR | ( | gsbi_num, | |
reg | |||
) | ((void *)((gsbi_qup_base[gsbi_num-1]) + (reg))) |
|
static |
Definition at line 49 of file qup.c.
References count, QUP_ERR_TIMEOUT, QUP_STATE_MASK, QUP_STATE_VALID, QUP_STATE_VALID_MASK, QUP_SUCCESS, read32(), TIMEOUT_CNT, and udelay().
Referenced by qup_wait_for_state().
|
static |
Definition at line 91 of file qup.c.
References QUP_ADDR, QUP_ERR_TIMEOUT, QUP_ERR_UNDEFINED, qup_i2c_master_status(), QUP_OPERATIONAL, QUP_SUCCESS, read32(), and stopwatch_expired().
Referenced by qup_i2c_read_fifo().
|
static |
Definition at line 107 of file qup.c.
References QUP_ADDR, QUP_ERR_TIMEOUT, QUP_ERR_UNDEFINED, qup_i2c_master_status(), QUP_OPERATIONAL, QUP_SUCCESS, read32(), and stopwatch_expired().
Referenced by qup_i2c_read_fifo(), and qup_i2c_write_fifo().
|
static |
Definition at line 25 of file qup.c.
References QUP_ADDR, QUP_ERR_I2C_ARB_LOST, QUP_ERR_I2C_BUS_ERROR, QUP_ERR_I2C_FAILED, QUP_ERR_I2C_INVALID_SLAVE_ADDR, QUP_ERR_I2C_INVALID_TAG, QUP_ERR_I2C_INVALID_WRITE, QUP_ERR_I2C_NACK, QUP_ERR_XFER_FAIL, QUP_ERROR_FLAGS, QUP_I2C_ARB_LOST, QUP_I2C_BUS_ERROR, QUP_I2C_FAILED_MASK, QUP_I2C_INVALID_READ_ADDR, QUP_I2C_INVALID_TAG, QUP_I2C_INVALID_WRITE, QUP_I2C_MASTER_STATUS, QUP_I2C_PACKET_NACK, QUP_SUCCESS, and read32().
Referenced by qup_fifo_wait_for(), qup_fifo_wait_while(), and qup_i2c_write_fifo().
|
static |
Definition at line 268 of file qup.c.
References BIOS_ERR, printk, QUP_ERR_UNDEFINED, QUP_ERR_UNSUPPORTED, qup_i2c_read_fifo(), QUP_MODE_FIFO, qup_set_state(), and QUP_STATE_RESET.
Referenced by qup_i2c_recv_data().
|
static |
Definition at line 200 of file qup.c.
References addr, qup_data_t::iic, INPUT_SERVICE_FLAG, OUTPUT_FIFO_NOT_EMPTY, OUTPUT_SERVICE_FLAG, qup_data_t::p, QUP_ADDR, QUP_ERR_UNDEFINED, qup_fifo_wait_for(), qup_fifo_wait_while(), QUP_I2C_ADDR, QUP_I2C_DATA, QUP_I2C_MI_TAG, QUP_I2C_MIDATA_SEQ, QUP_I2C_MISTOP_SEQ, QUP_I2C_RECV_SEQ, QUP_I2C_SLAVE_READ, QUP_I2C_START_SEQ, QUP_INPUT_FIFO, QUP_OPERATIONAL, QUP_OUTPUT_FIFO, qup_reset_master_status(), qup_set_state(), QUP_STATE_PAUSE, QUP_STATE_RUN, QUP_SUCCESS, read32(), stopwatch_init_usecs_expire(), and write32().
Referenced by qup_i2c_read().
|
static |
Definition at line 415 of file qup.c.
References BIOS_DEBUG, qup_data_t::iic, qup_data_t::p, printk, QUP_ADDR, QUP_ERR_UNDEFINED, qup_i2c_read(), QUP_INPUT_MODE_SHFT, QUP_IO_MODES, QUP_MODE_MASK, and read32().
Referenced by qup_recv_data().
|
static |
Definition at line 376 of file qup.c.
References BIOS_DEBUG, qup_data_t::iic, qup_data_t::p, printk, QUP_ADDR, QUP_ERR_UNDEFINED, qup_i2c_write(), QUP_IO_MODES, QUP_MODE_MASK, QUP_OUTPUT_MODE_SHFT, and read32().
Referenced by qup_send_data().
|
static |
Definition at line 179 of file qup.c.
References BIOS_ERR, printk, QUP_ERR_UNDEFINED, QUP_ERR_UNSUPPORTED, qup_i2c_write_fifo(), QUP_MODE_FIFO, qup_set_state(), and QUP_STATE_RESET.
Referenced by qup_i2c_send_data().
|
static |
Definition at line 123 of file qup.c.
References addr, qup_data_t::iic, OUTPUT_FIFO_FULL, OUTPUT_FIFO_NOT_EMPTY, OUTPUT_SERVICE_FLAG, qup_data_t::p, QUP_ADDR, QUP_ERR_UNDEFINED, qup_fifo_wait_while(), QUP_I2C_ADDR, QUP_I2C_DATA, QUP_I2C_DATA_SEQ, qup_i2c_master_status(), QUP_I2C_START_SEQ, QUP_I2C_STOP_SEQ, QUP_OPERATIONAL, QUP_OUTPUT_FIFO, qup_reset_master_status(), qup_set_state(), QUP_STATE_PAUSE, QUP_STATE_RUN, read32(), stopwatch_init_usecs_expire(), and write32().
Referenced by qup_i2c_write().
qup_return_t qup_init | ( | gsbi_id_t | gsbi_id, |
const qup_config_t * | config_ptr | ||
) |
Definition at line 289 of file qup.c.
References BIOS_ERR, qup_config_t::clk_frequency, qup_config_t::mode, printk, qup_config_t::protocol, QUP_ADDR, QUP_CONFIG, QUP_DIVIDER_MIN_VAL, QUP_ERR_UNDEFINED, QUP_ERR_UNSUPPORTED, QUP_FS_DIVIDER_MASK, QUP_HS_DIVIDER_SHFT, QUP_I2C_MASTER_CLK_CTL, QUP_INPUT_MODE_SHFT, QUP_IO_MODES, QUP_MINI_CORE_PROTO_MASK, QUP_MINI_CORE_PROTO_SHFT, QUP_MINICORE_I2C_MASTER, QUP_MODE_FIFO, QUP_MODE_MASK, QUP_OUTPUT_BIT_SHIFT_EN, QUP_OUTPUT_MODE_SHFT, QUP_STATE_RESET, QUP_SW_RESET, qup_wait_for_state(), qup_config_t::src_frequency, and write32().
qup_return_t qup_recv_data | ( | gsbi_id_t | gsbi_id, |
qup_data_t * | p_rx_obj | ||
) |
Definition at line 434 of file qup.c.
References qup_data_t::protocol, QUP_ADDR, QUP_CONFIG, QUP_ERR_UNDEFINED, QUP_ERR_UNSUPPORTED, qup_i2c_recv_data(), QUP_MINI_CORE_PROTO_MASK, QUP_MINI_CORE_PROTO_SHFT, QUP_MINICORE_I2C_MASTER, and read32().
qup_return_t qup_reset_i2c_master_status | ( | gsbi_id_t | gsbi_id | ) |
Definition at line 72 of file qup.c.
References QUP_ADDR, QUP_I2C_MASTER_STATUS, QUP_SUCCESS, and write32().
|
static |
Definition at line 83 of file qup.c.
References QUP_ADDR, QUP_ERROR_FLAGS, QUP_ERROR_FLAGS_EN, qup_reset_i2c_master_status(), QUP_SUCCESS, and write32().
Referenced by qup_i2c_read_fifo(), and qup_i2c_write_fifo().
qup_return_t qup_send_data | ( | gsbi_id_t | gsbi_id, |
qup_data_t * | p_tx_obj, | ||
uint8_t | stop_seq | ||
) |
Definition at line 396 of file qup.c.
References qup_data_t::protocol, QUP_ADDR, QUP_CONFIG, QUP_ERR_UNDEFINED, QUP_ERR_UNSUPPORTED, qup_i2c_send_data(), QUP_MINI_CORE_PROTO_MASK, QUP_MINI_CORE_PROTO_SHFT, QUP_MINICORE_I2C_MASTER, and read32().
qup_return_t qup_set_state | ( | gsbi_id_t | gsbi_id, |
uint32_t | state | ||
) |
Definition at line 353 of file qup.c.
References QUP_ADDR, QUP_ERR_UNDEFINED, QUP_STATE, QUP_STATE_PAUSE, QUP_STATE_RESET, QUP_STATE_VALID_MASK, qup_wait_for_state(), read32(), and write32().
|
static |
Definition at line 67 of file qup.c.
References check_bit_state(), QUP_ADDR, and QUP_STATE.
Referenced by qup_init(), and qup_set_state().
|
static |