summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWai-Hong Tam <waihong@google.com>2020-09-15 16:16:59 -0700
committerCommit Bot <commit-bot@chromium.org>2020-09-17 01:47:19 +0000
commit5c752c2eec0a1ba2c3e801c3d91c274cfcc4d728 (patch)
tree8d4f03b86a1413690bd159d354f1e4a1cd436b9d
parent6e31d6a118d877ea53bef6d15016608bfee26583 (diff)
downloadchrome-ec-5c752c2eec0a1ba2c3e801c3d91c274cfcc4d728.tar.gz
Trogdor: Move the I2C config to the board level
Move the I2C config to the board level such that they can have different configs. Also add the extra I2C bus for WLC on Coachz. The device on this I2C bus supports fast-mode plus, 1Mbit/s. BRANCH=None BUG=b:167884598 TEST=Built all Trogdor variants. Change-Id: Ibcb0e110e1b2c67f8ba843c2dc08efabeb5fe9ba Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2412821 Reviewed-by: Stephen Boyd <swboyd@chromium.org>
-rw-r--r--baseboard/trogdor/baseboard.c18
-rw-r--r--board/coachz/board.c18
-rw-r--r--board/lazor/board.c16
-rw-r--r--board/pompom/board.c14
-rw-r--r--board/trogdor/board.c16
5 files changed, 64 insertions, 18 deletions
diff --git a/baseboard/trogdor/baseboard.c b/baseboard/trogdor/baseboard.c
index abe6ff72e7..ecc8dc59f7 100644
--- a/baseboard/trogdor/baseboard.c
+++ b/baseboard/trogdor/baseboard.c
@@ -52,24 +52,6 @@ const struct power_signal_info power_signal_list[] = {
};
BUILD_ASSERT(ARRAY_SIZE(power_signal_list) == POWER_SIGNAL_COUNT);
-/* I2C port map */
-const struct i2c_port_t i2c_ports[] = {
- {"power", I2C_PORT_POWER, 100, GPIO_EC_I2C_POWER_SCL,
- GPIO_EC_I2C_POWER_SDA},
- {"tcpc0", I2C_PORT_TCPC0, 1000, GPIO_EC_I2C_USB_C0_PD_SCL,
- GPIO_EC_I2C_USB_C0_PD_SDA},
-#if CONFIG_USB_PD_PORT_MAX_COUNT > 1
- {"tcpc1", I2C_PORT_TCPC1, 1000, GPIO_EC_I2C_USB_C1_PD_SCL,
- GPIO_EC_I2C_USB_C1_PD_SDA},
-#endif
- {"eeprom", I2C_PORT_EEPROM, 400, GPIO_EC_I2C_EEPROM_SCL,
- GPIO_EC_I2C_EEPROM_SDA},
- {"sensor", I2C_PORT_SENSOR, 400, GPIO_EC_I2C_SENSOR_SCL,
- GPIO_EC_I2C_SENSOR_SDA},
-};
-
-const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports);
-
const struct charger_config_t chg_chips[] = {
{
.i2c_port = I2C_PORT_CHARGER,
diff --git a/board/coachz/board.c b/board/coachz/board.c
index 9b7bbb6c48..6790138526 100644
--- a/board/coachz/board.c
+++ b/board/coachz/board.c
@@ -101,6 +101,24 @@ static void board_connect_c0_sbu(enum gpio_signal s)
hook_call_deferred(&board_connect_c0_sbu_deferred_data, 0);
}
+/* I2C port map */
+const struct i2c_port_t i2c_ports[] = {
+ {"power", I2C_PORT_POWER, 100, GPIO_EC_I2C_POWER_SCL,
+ GPIO_EC_I2C_POWER_SDA},
+ {"tcpc0", I2C_PORT_TCPC0, 1000, GPIO_EC_I2C_USB_C0_PD_SCL,
+ GPIO_EC_I2C_USB_C0_PD_SDA},
+ {"tcpc1", I2C_PORT_TCPC1, 1000, GPIO_EC_I2C_USB_C1_PD_SCL,
+ GPIO_EC_I2C_USB_C1_PD_SDA},
+ {"wlc", I2C_PORT_WLC, 1000, GPIO_EC_I2C_WLC_SCL,
+ GPIO_EC_I2C_WLC_SDA},
+ {"eeprom", I2C_PORT_EEPROM, 400, GPIO_EC_I2C_EEPROM_SCL,
+ GPIO_EC_I2C_EEPROM_SDA},
+ {"sensor", I2C_PORT_SENSOR, 400, GPIO_EC_I2C_SENSOR_SCL,
+ GPIO_EC_I2C_SENSOR_SDA},
+};
+
+const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports);
+
/* ADC channels */
const struct adc_t adc_channels[] = {
/* Measure VBUS through a 1/10 voltage divider */
diff --git a/board/lazor/board.c b/board/lazor/board.c
index 3f1c166c30..e9d5831147 100644
--- a/board/lazor/board.c
+++ b/board/lazor/board.c
@@ -110,6 +110,22 @@ static void switchcap_interrupt(enum gpio_signal signal)
ln9310_interrupt(signal);
}
+/* I2C port map */
+const struct i2c_port_t i2c_ports[] = {
+ {"power", I2C_PORT_POWER, 100, GPIO_EC_I2C_POWER_SCL,
+ GPIO_EC_I2C_POWER_SDA},
+ {"tcpc0", I2C_PORT_TCPC0, 1000, GPIO_EC_I2C_USB_C0_PD_SCL,
+ GPIO_EC_I2C_USB_C0_PD_SDA},
+ {"tcpc1", I2C_PORT_TCPC1, 1000, GPIO_EC_I2C_USB_C1_PD_SCL,
+ GPIO_EC_I2C_USB_C1_PD_SDA},
+ {"eeprom", I2C_PORT_EEPROM, 400, GPIO_EC_I2C_EEPROM_SCL,
+ GPIO_EC_I2C_EEPROM_SDA},
+ {"sensor", I2C_PORT_SENSOR, 400, GPIO_EC_I2C_SENSOR_SCL,
+ GPIO_EC_I2C_SENSOR_SDA},
+};
+
+const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports);
+
/* ADC channels */
const struct adc_t adc_channels[] = {
/* Measure VBUS through a 1/10 voltage divider */
diff --git a/board/pompom/board.c b/board/pompom/board.c
index 271784e898..f159b9fa83 100644
--- a/board/pompom/board.c
+++ b/board/pompom/board.c
@@ -89,6 +89,20 @@ static void board_connect_c0_sbu(enum gpio_signal s)
hook_call_deferred(&board_connect_c0_sbu_deferred_data, 0);
}
+/* I2C port map */
+const struct i2c_port_t i2c_ports[] = {
+ {"power", I2C_PORT_POWER, 100, GPIO_EC_I2C_POWER_SCL,
+ GPIO_EC_I2C_POWER_SDA},
+ {"tcpc0", I2C_PORT_TCPC0, 1000, GPIO_EC_I2C_USB_C0_PD_SCL,
+ GPIO_EC_I2C_USB_C0_PD_SDA},
+ {"eeprom", I2C_PORT_EEPROM, 400, GPIO_EC_I2C_EEPROM_SCL,
+ GPIO_EC_I2C_EEPROM_SDA},
+ {"sensor", I2C_PORT_SENSOR, 400, GPIO_EC_I2C_SENSOR_SCL,
+ GPIO_EC_I2C_SENSOR_SDA},
+};
+
+const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports);
+
/* ADC channels */
const struct adc_t adc_channels[] = {
/* Measure VBUS through a 1/10 voltage divider */
diff --git a/board/trogdor/board.c b/board/trogdor/board.c
index b011364078..36e4e4452a 100644
--- a/board/trogdor/board.c
+++ b/board/trogdor/board.c
@@ -102,6 +102,22 @@ static void board_connect_c0_sbu(enum gpio_signal s)
hook_call_deferred(&board_connect_c0_sbu_deferred_data, 0);
}
+/* I2C port map */
+const struct i2c_port_t i2c_ports[] = {
+ {"power", I2C_PORT_POWER, 100, GPIO_EC_I2C_POWER_SCL,
+ GPIO_EC_I2C_POWER_SDA},
+ {"tcpc0", I2C_PORT_TCPC0, 1000, GPIO_EC_I2C_USB_C0_PD_SCL,
+ GPIO_EC_I2C_USB_C0_PD_SDA},
+ {"tcpc1", I2C_PORT_TCPC1, 1000, GPIO_EC_I2C_USB_C1_PD_SCL,
+ GPIO_EC_I2C_USB_C1_PD_SDA},
+ {"eeprom", I2C_PORT_EEPROM, 400, GPIO_EC_I2C_EEPROM_SCL,
+ GPIO_EC_I2C_EEPROM_SDA},
+ {"sensor", I2C_PORT_SENSOR, 400, GPIO_EC_I2C_SENSOR_SCL,
+ GPIO_EC_I2C_SENSOR_SDA},
+};
+
+const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports);
+
/* ADC channels */
const struct adc_t adc_channels[] = {
/* Measure VBUS through a 1/10 voltage divider */