diff options
author | Scott Collyer <scollyer@google.com> | 2020-05-22 11:46:27 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-09-29 01:54:05 +0000 |
commit | 62b6c2777c9915723368c0c31df17f7ce30cc7a6 (patch) | |
tree | 854a034cf97e83a3bfe9c2980a654d2890e01a1f /baseboard/honeybuns | |
parent | 673975cfadc4dad13901418d5908dff6e987cfd2 (diff) | |
download | chrome-ec-62b6c2777c9915723368c0c31df17f7ce30cc7a6.tar.gz |
honeybuns: Enable I2C feature and CBI support
This CL adds config options and tables required to pull in i2c support
for honeybuns. In addition, config options for CBI were added to
facilitate i2c testing.
BUG=b:148493929
BRANCH=None
TEST=ran i2cscan on quiche
> i2cscan
Scanning 0 usbc.................
0x18.
0x19.
0x1a.
0x1b.
0x1c.
0x1d.
0x1e.
0x1f.
0x20.
0x21.
0x22.
0x23.
0x24.
0x25.
0x26.
0x27...........................
0x42..............................
0x60.......................
Scanning 1 usb_mst.
0x08.
0x09.
0x0a.
0x0b.
0x0c.
0x0d.
0x0e.
0x0f.
0x10.
0x11.
0x12.
0x13.
0x14.
0x15.
0x16.
0x17..........................................
0x41................................
0x61.........
0x6a.............
Scanning 2 eeprom.........................................
0x30................................
0x50.......................................
Signed-off-by: Scott Collyer <scollyer@google.com>
Change-Id: Ib1b8b795a2a07a5b1cbe167b17c3f70a8d9703b2
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2213943
Commit-Queue: Scott Collyer <scollyer@chromium.org>
Tested-by: Scott Collyer <scollyer@chromium.org>
Reviewed-by: Diana Z <dzigterman@chromium.org>
Diffstat (limited to 'baseboard/honeybuns')
-rw-r--r-- | baseboard/honeybuns/baseboard.c | 10 | ||||
-rw-r--r-- | baseboard/honeybuns/baseboard.h | 13 |
2 files changed, 23 insertions, 0 deletions
diff --git a/baseboard/honeybuns/baseboard.c b/baseboard/honeybuns/baseboard.c index e423d5fa16..bb0a1c832d 100644 --- a/baseboard/honeybuns/baseboard.c +++ b/baseboard/honeybuns/baseboard.c @@ -7,6 +7,7 @@ #include "console.h" #include "gpio.h" #include "hooks.h" +#include "i2c.h" #include "timer.h" #define CPRINTS(format, args...) cprints(CC_SYSTEM, format, ## args) @@ -29,6 +30,15 @@ static void board_power_sequence(void) } } +/******************************************************************************/ +/* I2C port map configuration */ +const struct i2c_port_t i2c_ports[] = { + {"usbc", I2C_PORT_USBC, 400, GPIO_EC_I2C1_SCL, GPIO_EC_I2C1_SDA}, + {"usb_mst", I2C_PORT_MST, 400, GPIO_EC_I2C2_SCL, GPIO_EC_I2C2_SDA}, + {"eeprom", I2C_PORT_EEPROM, 400, GPIO_EC_I2C3_SCL, GPIO_EC_I2C3_SDA}, +}; +const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports); + static void baseboard_init(void) { /* Turn on power rails */ diff --git a/baseboard/honeybuns/baseboard.h b/baseboard/honeybuns/baseboard.h index 392539489c..0703ea0b33 100644 --- a/baseboard/honeybuns/baseboard.h +++ b/baseboard/honeybuns/baseboard.h @@ -34,11 +34,24 @@ #define CONFIG_UART_TX_DMA_CH STM32_DMAC_USART3_TX #define CONFIG_UART_TX_DMA_PH DMAMUX_REQ_USART3_TX +/* CBI Configs */ +#define I2C_ADDR_EEPROM_FLAGS 0x50 +#define CONFIG_CROS_BOARD_INFO +#define CONFIG_BOARD_VERSION_CBI +#define CONFIG_CMD_CBI + + /* USB Type C and USB PD defines */ /* BC 1.2 */ /* I2C Bus Configuration */ +#define CONFIG_I2C +#define CONFIG_I2C_MASTER +#define I2C_PORT_USBC 0 +#define I2C_PORT_MST 1 +#define I2C_PORT_EEPROM 2 + /* * Macros for GPIO signals used in common code that don't match the |