diff options
author | Nick Sanders <nsanders@chromium.org> | 2016-08-11 16:28:03 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-08-21 04:11:10 -0700 |
commit | cc68693cda0d520229971b73c116d434c48bdd65 (patch) | |
tree | 29978c73b634ae6ebd505a361c96de9c697db083 /board/stm32f446e-eval/board.c | |
parent | 153c2cf49c6c225508e09a942eb90611c9d3cef9 (diff) | |
download | chrome-ec-cc68693cda0d520229971b73c116d434c48bdd65.tar.gz |
sweetberry: add i2c support
stm32f446 has two types of i2c blocks, the traditional
stm i2c, and "fast mode plus" i2c, which need different drivers.
This commit adds both, muxed in i2c-stm32f4, as the ec
codebase doesn't really support multiple types of the same interface.
BUG=chromium:608039
TEST=i2c works on all 4 channels
BRANCH=None
Change-Id: I6a9ac632f44142bd809ffee5782a192ae47af1f0
Signed-off-by: Nick Sanders <nsanders@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/368358
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'board/stm32f446e-eval/board.c')
-rw-r--r-- | board/stm32f446e-eval/board.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/board/stm32f446e-eval/board.c b/board/stm32f446e-eval/board.c index 0b8691278c..e7af5dad6c 100644 --- a/board/stm32f446e-eval/board.c +++ b/board/stm32f446e-eval/board.c @@ -9,9 +9,21 @@ #include "gpio.h" #include "gpio_list.h" #include "hooks.h" +#include "i2c.h" #include "registers.h" #include "stm32-dma.h" + +/* I2C ports */ +const struct i2c_port_t i2c_ports[] = { + {"i2c1", I2C_PORT_0, 100, + GPIO_I2C1_SCL, GPIO_I2C1_SDA}, + {"fmpi2c4", FMPI2C_PORT_3, 100, + GPIO_FMPI2C_SCL, GPIO_FMPI2C_SDA}, +}; +const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports); + + #define GPIO_SET_HS(bank, number) \ (STM32_GPIO_OSPEEDR(GPIO_##bank) |= (0x3 << (number * 2))) |