summaryrefslogtreecommitdiff
path: root/baseboard
diff options
context:
space:
mode:
authorScott Collyer <scollyer@google.com>2018-06-27 11:08:05 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-07-03 22:31:02 -0700
commit797146cb4c63a00a9535ad92fcbb75e65d98d688 (patch)
treecdeb0742001643bf5cbc76d67159170fd91f0d72 /baseboard
parentd915b701cae9cd6aca74effbec2b99907d7a06c7 (diff)
downloadchrome-ec-797146cb4c63a00a9535ad92fcbb75e65d98d688.tar.gz
DragonEgg: Add I2C pins/alt functions and config table
This CL adds the gpio definitions for I2C pins and the I2C configuration table. BRANCH=none BUG=b:110880394 TEST=make buildall Change-Id: I9d239573257dbd6a3a3110875b1c970721f73677 Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/1117361 Commit-Ready: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Rachel Nancollas <rachelsn@google.com> Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'baseboard')
-rw-r--r--baseboard/dragonegg/baseboard.c16
-rw-r--r--baseboard/dragonegg/baseboard.h11
2 files changed, 26 insertions, 1 deletions
diff --git a/baseboard/dragonegg/baseboard.c b/baseboard/dragonegg/baseboard.c
index a38c724559..629da06e42 100644
--- a/baseboard/dragonegg/baseboard.c
+++ b/baseboard/dragonegg/baseboard.c
@@ -4,3 +4,19 @@
*/
/* DragonEgg family-specific configuration */
+
+#include "gpio.h"
+#include "i2c.h"
+#include "util.h"
+
+/******************************************************************************/
+/* I2C port map configuration */
+/* TODO(b/111125177): Increase these speeds to 400 kHz and verify operation */
+const struct i2c_port_t i2c_ports[] = {
+ {"eeprom", IT83XX_I2C_CH_A, 100, GPIO_I2C0_SCL, GPIO_I2C0_SDA},
+ {"sensor", IT83XX_I2C_CH_B, 100, GPIO_I2C1_SCL, GPIO_I2C1_SDA},
+ {"usbc12", IT83XX_I2C_CH_C, 100, GPIO_I2C2_SCL, GPIO_I2C2_SDA},
+ {"usbc0", IT83XX_I2C_CH_E, 100, GPIO_I2C4_SCL, GPIO_I2C4_SDA},
+ {"power", IT83XX_I2C_CH_F, 100, GPIO_I2C5_SCL, GPIO_I2C5_SDA}
+};
+const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports);
diff --git a/baseboard/dragonegg/baseboard.h b/baseboard/dragonegg/baseboard.h
index 3335d38f1a..142f363f0e 100644
--- a/baseboard/dragonegg/baseboard.h
+++ b/baseboard/dragonegg/baseboard.h
@@ -3,9 +3,18 @@
* found in the LICENSE file.
*/
-/* Octopus board configuration */
+/* DragonEgg board configuration */
#ifndef __CROS_EC_BASEBOARD_H
#define __CROS_EC_BASEBOARD_H
+/* I2C Bus Configuration */
+#define I2C_PORT_BATTERY IT83XX_I2C_CH_F /* Shared bus */
+#define I2C_PORT_CHARGER IT83XX_I2C_CH_F /* Shared bus */
+#define I2C_PORT_SENSOR IT83XX_I2C_CH_B
+#define I2C_PORT_USBC0 IT83XX_I2C_CH_E
+#define I2C_PORT_USBC1C2 IT83XX_I2C_CH_C
+#define I2C_PORT_EEPROM IT83XX_I2C_CH_A
+#define I2C_ADDR_EEPROM 0xA0
+
#endif /* __CROS_EC_BASEBOARD_H */