diff options
author | Josh Tsai <josh_tsai@compal.corp-partner.google.com> | 2020-04-14 13:44:29 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-04-15 03:59:41 +0000 |
commit | 3976d0336d74a78f70562fa4506a2c3a360d7de8 (patch) | |
tree | 9cd285df0f779f74515ef89894041770a7c19615 /board/malefor | |
parent | 2daf48c4146649729e6a369608a52168e0849764 (diff) | |
download | chrome-ec-3976d0336d74a78f70562fa4506a2c3a360d7de8.tar.gz |
Volteer/baseboard: Move I2C bus configuration to variant
Because the Halvor I2C bus setup is different than other Volteer boards
Use this change to move I2c configure from baseboard to variant.
BUG=none
BRANCH=none
TEST=make buildall
Change-Id: I3a5e0c885f2e0c609a2456c6b493af9e6ecee4f9
Signed-off-by: Josh Tsai <josh_tsai@compal.corp-partner.google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2147760
Reviewed-by: Ruby Lee <ruby_lee@compal.corp-partner.google.com>
Reviewed-by: Keith Short <keithshort@chromium.org>
Commit-Queue: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'board/malefor')
-rw-r--r-- | board/malefor/board.c | 48 | ||||
-rw-r--r-- | board/malefor/board.h | 16 |
2 files changed, 64 insertions, 0 deletions
diff --git a/board/malefor/board.c b/board/malefor/board.c index 82ade2013b..3748286868 100644 --- a/board/malefor/board.c +++ b/board/malefor/board.c @@ -221,3 +221,51 @@ const struct mft_t mft_channels[] = { }, }; BUILD_ASSERT(ARRAY_SIZE(mft_channels) == MFT_CH_COUNT); + +/******************************************************************************/ +/* I2C port map configuration */ +const struct i2c_port_t i2c_ports[] = { + { + .name = "sensor", + .port = I2C_PORT_SENSOR, + .kbps = 400, + .scl = GPIO_EC_I2C0_SENSOR_SCL, + .sda = GPIO_EC_I2C0_SENSOR_SDA, + }, + { + .name = "usb_c0", + .port = I2C_PORT_USB_C0, + .kbps = 1000, + .scl = GPIO_EC_I2C1_USB_C0_SCL, + .sda = GPIO_EC_I2C1_USB_C0_SDA, + }, + { + .name = "usb_c1", + .port = I2C_PORT_USB_C1, + .kbps = 1000, + .scl = GPIO_EC_I2C2_USB_C1_SCL, + .sda = GPIO_EC_I2C2_USB_C1_SDA, + }, + { + .name = "usb_1_mix", + .port = I2C_PORT_USB_1_MIX, + .kbps = 100, + .scl = GPIO_EC_I2C3_USB_1_MIX_SCL, + .sda = GPIO_EC_I2C3_USB_1_MIX_SDA, + }, + { + .name = "power", + .port = I2C_PORT_POWER, + .kbps = 100, + .scl = GPIO_EC_I2C5_POWER_SCL, + .sda = GPIO_EC_I2C5_POWER_SDA, + }, + { + .name = "eeprom", + .port = I2C_PORT_EEPROM, + .kbps = 400, + .scl = GPIO_EC_I2C7_EEPROM_SCL, + .sda = GPIO_EC_I2C7_EEPROM_SDA, + }, +}; +const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports); diff --git a/board/malefor/board.h b/board/malefor/board.h index 49082742ab..83c3283bfa 100644 --- a/board/malefor/board.h +++ b/board/malefor/board.h @@ -93,6 +93,22 @@ #define GPIO_VOLUME_DOWN_L GPIO_EC_VOLDN_BTN_ODL #define GMR_TABLET_MODE_GPIO_L GPIO_TABLET_MODE_L +/* I2C Bus Configuration */ +#define CONFIG_I2C +#define I2C_PORT_SENSOR NPCX_I2C_PORT0_0 +#define I2C_PORT_USB_C0 NPCX_I2C_PORT1_0 +#define I2C_PORT_USB_C1 NPCX_I2C_PORT2_0 +#define I2C_PORT_USB_1_MIX NPCX_I2C_PORT3_0 +#define I2C_PORT_POWER NPCX_I2C_PORT5_0 +#define I2C_PORT_EEPROM NPCX_I2C_PORT7_0 + +#define I2C_PORT_BATTERY I2C_PORT_POWER +#define I2C_PORT_CHARGER I2C_PORT_EEPROM + +#define I2C_ADDR_EEPROM_FLAGS 0x50 +#define CONFIG_I2C_MASTER + + #ifndef __ASSEMBLER__ #include "gpio_signal.h" |