COIL: Rename CONFIG_BOARD_I2C_ADDR_FLAGS
Rename CONFIG_BOARD_I2C_ADDR_FLAGS and related comments. BRANCH=None BUG=None TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I45d4945b5c1fa26c72d233fb9def4d9bdee1c9c9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2518657 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
This commit is contained in:
parent
213dd9e5a9
commit
23150c06ba
|
@ -184,12 +184,12 @@ static mxc_i2c_regs_t *i2c_bus_ports[] = {MXC_I2C0, MXC_I2C1};
|
|||
|
||||
#ifdef CONFIG_HOSTCMD_I2C_ADDR_FLAGS
|
||||
|
||||
#ifdef CONFIG_BOARD_I2C_SLAVE_ADDR_FLAGS
|
||||
#ifdef CONFIG_BOARD_I2C_ADDR_FLAGS
|
||||
static void i2c_send_board_response(int len);
|
||||
static void i2c_process_board_command(int read, int addr, int len);
|
||||
void board_i2c_process(int read, uint8_t addr, int len, char *buffer,
|
||||
void (*send_response)(int len));
|
||||
#endif /* CONFIG_BOARD_I2C_SLAVE_ADDR_FLAGS */
|
||||
#endif /* CONFIG_BOARD_I2C_ADDR_FLAGS */
|
||||
#endif /* CONFIG_HOSTCMD_I2C_ADDR_FLAGS */
|
||||
|
||||
/**
|
||||
|
@ -283,7 +283,7 @@ void i2c_init(void)
|
|||
#ifdef CONFIG_HOSTCMD_I2C_ADDR_FLAGS
|
||||
/* Initialize the I2C Slave */
|
||||
init_i2cs(I2C_PORT_EC);
|
||||
#ifdef CONFIG_BOARD_I2C_SLAVE_ADDR_FLAGS
|
||||
#ifdef CONFIG_BOARD_I2C_ADDR_FLAGS
|
||||
/*
|
||||
* Set the secondary I2C slave address for the board.
|
||||
*/
|
||||
|
@ -296,8 +296,8 @@ void i2c_init(void)
|
|||
/* Set the secondary slave address. */
|
||||
i2c_bus_ports[I2C_PORT_EC]->slave_addr =
|
||||
(1 << MXC_F_I2C_SLAVE_ADDR_SLAVE_ADDR_IDX_POS) |
|
||||
CONFIG_BOARD_I2C_SLAVE_ADDR_FLAGS;
|
||||
#endif /* CONFIG_BOARD_I2C_SLAVE_ADDR_FLAGS */
|
||||
CONFIG_BOARD_I2C_ADDR_FLAGS;
|
||||
#endif /* CONFIG_BOARD_I2C_ADDR_FLAGS */
|
||||
#endif /* CONFIG_HOSTCMD_I2C_ADDR_FLAGS */
|
||||
|
||||
}
|
||||
|
@ -394,13 +394,13 @@ void i2c_slave_service(i2c_req_t *req)
|
|||
/* A response to this write is pending. */
|
||||
/* Assume that there is nothing to send back to the HOST. */
|
||||
req->tx_remain = -1;
|
||||
#ifdef CONFIG_BOARD_I2C_SLAVE_ADDR_FLAGS
|
||||
#ifdef CONFIG_BOARD_I2C_ADDR_FLAGS
|
||||
if (req->addr_match_flag != 0x1) {
|
||||
i2c_process_board_command(
|
||||
0, CONFIG_BOARD_I2C_SLAVE_ADDR_FLAGS,
|
||||
0, CONFIG_BOARD_I2C_ADDR_FLAGS,
|
||||
req->received_count);
|
||||
} else
|
||||
#endif /* CONFIG_BOARD_I2C_SLAVE_ADDR_FLAGS */
|
||||
#endif /* CONFIG_BOARD_I2C_ADDR_FLAGS */
|
||||
{
|
||||
i2c_process_command();
|
||||
}
|
||||
|
@ -565,7 +565,7 @@ static void i2c_slave_handler(mxc_i2c_regs_t *i2c)
|
|||
/* Set the threshold for TX, the threshold is a four bit field. */
|
||||
i2c->tx_ctrl0 = ((i2c->tx_ctrl0 & ~(MXC_F_I2C_TX_CTRL0_TX_THRESH)) |
|
||||
(2 << MXC_F_I2C_TX_CTRL0_TX_THRESH_POS));
|
||||
#ifdef CONFIG_BOARD_I2C_SLAVE_ADDR_FLAGS
|
||||
#ifdef CONFIG_BOARD_I2C_ADDR_FLAGS
|
||||
/*
|
||||
* If this is a board address match and there is not
|
||||
* already a pending response to the I2C Master then
|
||||
|
@ -574,9 +574,9 @@ static void i2c_slave_handler(mxc_i2c_regs_t *i2c)
|
|||
if ((req->response_pending == 0) &&
|
||||
(req->addr_match_flag != 0x1)) {
|
||||
i2c_process_board_command(
|
||||
1, CONFIG_BOARD_I2C_SLAVE_ADDR_FLAGS, 0);
|
||||
1, CONFIG_BOARD_I2C_ADDR_FLAGS, 0);
|
||||
}
|
||||
#endif /* CONFIG_BOARD_I2C_SLAVE_ADDR_FLAGS */
|
||||
#endif /* CONFIG_BOARD_I2C_ADDR_FLAGS */
|
||||
}
|
||||
/* Only enable done, error and address match interrupts. */
|
||||
i2c->int_en0 = MXC_F_I2C_INT_EN0_DONE |
|
||||
|
@ -710,7 +710,7 @@ static int i2c_slave_async(mxc_i2c_regs_t *i2c, i2c_req_t *req)
|
|||
return EC_SUCCESS;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_BOARD_I2C_SLAVE_ADDR_FLAGS
|
||||
#ifdef CONFIG_BOARD_I2C_ADDR_FLAGS
|
||||
|
||||
static void i2c_send_board_response(int len)
|
||||
{
|
||||
|
@ -726,7 +726,7 @@ static void i2c_process_board_command(int read, int addr, int len)
|
|||
board_i2c_process(read, addr, len, &host_buffer[0],
|
||||
i2c_send_board_response);
|
||||
}
|
||||
#endif /* CONFIG_BOARD_I2C_SLAVE_ADDR_FLAGS */
|
||||
#endif /* CONFIG_BOARD_I2C_ADDR_FLAGS */
|
||||
#endif /* CONFIG_HOSTCMD_I2C_ADDR_FLAGS */
|
||||
|
||||
/**
|
||||
|
|
|
@ -834,7 +834,7 @@ static void i2c_process_command(void)
|
|||
host_packet_receive(&i2c_packet);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_BOARD_I2C_SLAVE_ADDR_FLAGS
|
||||
#ifdef CONFIG_BOARD_I2C_ADDR_FLAGS
|
||||
static void i2c_send_board_response(int len)
|
||||
{
|
||||
/* host_buffer data range, beyond this length, will return 0xec */
|
||||
|
@ -888,7 +888,7 @@ static void i2c_event_handler(int port)
|
|||
if (i2c_sr2 & STM32_I2C_SR2_TRA) {
|
||||
/* Transmitter slave */
|
||||
i2c_sr1 |= STM32_I2C_SR1_TXE;
|
||||
#ifdef CONFIG_BOARD_I2C_SLAVE_ADDR_FLAGS
|
||||
#ifdef CONFIG_BOARD_I2C_ADDR_FLAGS
|
||||
if (!rx_pending && !tx_pending) {
|
||||
tx_pending = 1;
|
||||
i2c_process_board_command(1, addr_8bit, 0);
|
||||
|
@ -926,10 +926,10 @@ static void i2c_event_handler(int port)
|
|||
host_i2c_resp_port = port;
|
||||
/* Disable buffer interrupt */
|
||||
STM32_I2C_CR2(port) &= ~STM32_I2C_CR2_ITBUFEN;
|
||||
#ifdef CONFIG_BOARD_I2C_SLAVE_ADDR_FLAGS
|
||||
#ifdef CONFIG_BOARD_I2C_ADDR_FLAGS
|
||||
if ((addr_8bit >> 1) ==
|
||||
I2C_STRIP_FLAGS(
|
||||
CONFIG_BOARD_I2C_SLAVE_ADDR_FLAGS))
|
||||
CONFIG_BOARD_I2C_ADDR_FLAGS))
|
||||
i2c_process_board_command(1, addr_8bit,
|
||||
buf_idx);
|
||||
else
|
||||
|
@ -952,10 +952,10 @@ static void i2c_event_handler(int port)
|
|||
/* Disable buffer interrupt */
|
||||
STM32_I2C_CR2(port) &= ~STM32_I2C_CR2_ITBUFEN;
|
||||
|
||||
#ifdef CONFIG_BOARD_I2C_SLAVE_ADDR_FLAGS
|
||||
#ifdef CONFIG_BOARD_I2C_ADDR_FLAGS
|
||||
if (rx_pending &&
|
||||
(addr_8b >> 1) ==
|
||||
I2C_STRIP_FLAGS(CONFIG_BOARD_I2C_SLAVE_ADDR_FLAGS))
|
||||
I2C_STRIP_FLAGS(CONFIG_BOARD_I2C_ADDR_FLAGS))
|
||||
i2c_process_board_command(0, addr_8bit, buf_idx);
|
||||
#endif
|
||||
rx_pending = 0;
|
||||
|
@ -1000,9 +1000,9 @@ void i2c_init(void)
|
|||
/* Setup host command slave */
|
||||
STM32_I2C_OAR1(I2C_PORT_EC) = STM32_I2C_OAR1_B14
|
||||
| (I2C_STRIP_ADDR(CONFIG_HOSTCMD_I2C_ADDR_FLAGS) << 1);
|
||||
#ifdef CONFIG_BOARD_I2C_SLAVE_ADDR_FLAGS
|
||||
#ifdef CONFIG_BOARD_I2C_ADDR_FLAGS
|
||||
STM32_I2C_OAR2(I2C_PORT_EC) = STM32_I2C_OAR2_ENDUAL
|
||||
| (I2C_STRIP_FLAGS(CONFIG_BOARD_I2C_SLAVE_ADDR_FLAGS) << 1);
|
||||
| (I2C_STRIP_FLAGS(CONFIG_BOARD_I2C_ADDR_FLAGS) << 1);
|
||||
#endif
|
||||
task_enable_irq(IRQ_SLAVE_EV);
|
||||
task_enable_irq(IRQ_SLAVE_ER);
|
||||
|
|
|
@ -703,8 +703,8 @@
|
|||
*/
|
||||
#undef CONFIG_BOARD_VERSION_GPIO
|
||||
|
||||
/* EC responses to a board defined I2C slave address */
|
||||
#undef CONFIG_BOARD_I2C_SLAVE_ADDR_FLAGS
|
||||
/* EC responses to a board defined I2C address */
|
||||
#undef CONFIG_BOARD_I2C_ADDR_FLAGS
|
||||
|
||||
/*
|
||||
* The board is unable to distinguish EC reset from power-on so it should treat
|
||||
|
|
Loading…
Reference in New Issue