summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Chen <philipchen@google.com>2019-06-12 18:14:28 -0700
committerCommit Bot <commit-bot@chromium.org>2019-06-14 01:26:48 +0000
commitb30ae71143782737f739690ea200ddd1516a14c4 (patch)
tree1b70889230b9448e9ca82f8d8aaddaf577cefaca
parent6231bcc61127a4bc75d2fa2ec2e4ea58fb164207 (diff)
downloadchrome-ec-b30ae71143782737f739690ea200ddd1516a14c4.tar.gz
hatch: Make MST support optional for subboards
This CL cleans up the dependence on the MST support in hatch baseboard. Subboards can optionally define USB_PD_PORT_TCPC_MST when MST support is needed. BUG=b:133788856 BRANCH=none TEST=make buildall Change-Id: Ia83e31e68881ce419056716df4776e4be6786c45 Signed-off-by: Philip Chen <philipchen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1657320 Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Tested-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Tested-by: Philip Chen <philipchen@chromium.org> Commit-Queue: Philip Chen <philipchen@chromium.org>
-rw-r--r--baseboard/hatch/baseboard.c2
-rw-r--r--baseboard/hatch/usb_pd_policy.c12
-rw-r--r--board/hatch/board.h2
-rw-r--r--board/helios/board.h8
-rw-r--r--board/helios/gpio.inc3
-rw-r--r--board/kindred/board.h2
-rw-r--r--board/kohaku/board.h8
-rw-r--r--board/kohaku/gpio.inc1
8 files changed, 10 insertions, 28 deletions
diff --git a/baseboard/hatch/baseboard.c b/baseboard/hatch/baseboard.c
index 9ca4c836a5..d76227e562 100644
--- a/baseboard/hatch/baseboard.c
+++ b/baseboard/hatch/baseboard.c
@@ -281,6 +281,7 @@ void board_set_charge_limit(int port, int supplier, int charge_ma,
charge_mv);
}
+#ifdef USB_PD_PORT_TCPC_MST
void baseboard_mst_enable_control(enum mst_source src, int level)
{
static uint32_t mst_input_levels;
@@ -292,6 +293,7 @@ void baseboard_mst_enable_control(enum mst_source src, int level)
gpio_set_level(GPIO_EN_MST, mst_input_levels ? 1 : 0);
}
+#endif
/* Enable or disable input devices, based on chipset state */
#ifndef TEST_BUILD
diff --git a/baseboard/hatch/usb_pd_policy.c b/baseboard/hatch/usb_pd_policy.c
index 2eb1cb6f4d..5e39e50a58 100644
--- a/baseboard/hatch/usb_pd_policy.c
+++ b/baseboard/hatch/usb_pd_policy.c
@@ -328,8 +328,8 @@ static void svdm_dp_post_config(int port)
if (!(dp_flags[port] & DP_FLAGS_HPD_HI_PENDING))
return;
mux->hpd_update(port, 1, 0);
-#ifdef USB_PD_PORT_TCPC
- if (port == USB_PD_PORT_TCPC)
+#ifdef USB_PD_PORT_TCPC_MST
+ if (port == USB_PD_PORT_TCPC_MST)
baseboard_mst_enable_control(port, 1);
#endif
}
@@ -347,8 +347,8 @@ static int svdm_dp_attention(int port, uint32_t *payload)
return 1;
}
mux->hpd_update(port, lvl, irq);
-#ifdef USB_PD_PORT_TCPC
- if (port == USB_PD_PORT_TCPC)
+#ifdef USB_PD_PORT_TCPC_MST
+ if (port == USB_PD_PORT_TCPC_MST)
baseboard_mst_enable_control(port, lvl);
#endif
@@ -362,8 +362,8 @@ static void svdm_exit_dp_mode(int port)
svdm_safe_dp_mode(port);
mux->hpd_update(port, 0, 0);
-#ifdef USB_PD_PORT_TCPC
- if (port == USB_PD_PORT_TCPC)
+#ifdef USB_PD_PORT_TCPC_MST
+ if (port == USB_PD_PORT_TCPC_MST)
baseboard_mst_enable_control(port, 0);
#endif
}
diff --git a/board/hatch/board.h b/board/hatch/board.h
index 06a7e7945c..356d2883d8 100644
--- a/board/hatch/board.h
+++ b/board/hatch/board.h
@@ -100,7 +100,7 @@
* one Type C port. This will need to be chagned to support 2 Type C ports
* connected to the same MST chip.
*/
-#define USB_PD_PORT_TCPC 1
+#define USB_PD_PORT_TCPC_MST USB_PD_PORT_TCPC_1
/*
* Macros for GPIO signals used in common code that don't match the
diff --git a/board/helios/board.h b/board/helios/board.h
index a7b98b9bb5..ff0b803a09 100644
--- a/board/helios/board.h
+++ b/board/helios/board.h
@@ -82,14 +82,6 @@
#define CONFIG_THROTTLE_AP
#define CONFIG_STEINHART_HART_3V3_51K1_47K_4050B
-/* MST */
-/*
- * TDOD (b/124068003): This inherently assumes the MST chip is connected to only
- * one Type C port. This will need to be chagned to support 2 Type C ports
- * connected to the same MST chip.
- */
-#define USB_PD_PORT_TCPC 1
-
/*
* Macros for GPIO signals used in common code that don't match the
* schematic names. Signal names in gpio.inc match the schematic and are
diff --git a/board/helios/gpio.inc b/board/helios/gpio.inc
index f00cbacbc7..c6e9b8b911 100644
--- a/board/helios/gpio.inc
+++ b/board/helios/gpio.inc
@@ -70,9 +70,6 @@ GPIO(LED_3_L, PIN(C, 2), GPIO_OUT_HIGH)
GPIO(EC_KB_BL_EN, PIN(8, 6), GPIO_OUT_LOW) /* Keyboard backlight */
GPIO(EN_PP5000_FAN, PIN(6, 1), GPIO_OUT_LOW)
-/* TODO (b/133788856): this is a NC on Helios, but Hatch baseboard depends on this signal */
-GPIO(EN_MST, PIN(9, 6), GPIO_INPUT | GPIO_PULL_DOWN)
-
/* I2C pins - Alternate function below configures I2C module on these pins */
GPIO(I2C0_SCL, PIN(B, 5), GPIO_INPUT |
GPIO_SEL_1P8V) /* EC_I2C_SENSOR_1V8_SCL */
diff --git a/board/kindred/board.h b/board/kindred/board.h
index 06a7e7945c..356d2883d8 100644
--- a/board/kindred/board.h
+++ b/board/kindred/board.h
@@ -100,7 +100,7 @@
* one Type C port. This will need to be chagned to support 2 Type C ports
* connected to the same MST chip.
*/
-#define USB_PD_PORT_TCPC 1
+#define USB_PD_PORT_TCPC_MST USB_PD_PORT_TCPC_1
/*
* Macros for GPIO signals used in common code that don't match the
diff --git a/board/kohaku/board.h b/board/kohaku/board.h
index cbdd9f5e22..8e37e56a0a 100644
--- a/board/kohaku/board.h
+++ b/board/kohaku/board.h
@@ -101,14 +101,6 @@
#define CONFIG_THROTTLE_AP
#define CONFIG_STEINHART_HART_3V3_51K1_47K_4050B
-/* MST */
-/*
- * TDOD (b/124068003): This inherently assumes the MST chip is connected to only
- * one Type C port. This will need to be chagned to support 2 Type C ports
- * connected to the same MST chip.
- */
-#define USB_PD_PORT_TCPC 1
-
/*
* Macros for GPIO signals used in common code that don't match the
* schematic names. Signal names in gpio.inc match the schematic and are
diff --git a/board/kohaku/gpio.inc b/board/kohaku/gpio.inc
index c5acffe69b..dd60ba89b7 100644
--- a/board/kohaku/gpio.inc
+++ b/board/kohaku/gpio.inc
@@ -71,7 +71,6 @@ GPIO(LED_1_L, PIN(C, 4), GPIO_OUT_HIGH) /* Yellow (hatch
GPIO(LED_2_L, PIN(C, 3), GPIO_OUT_HIGH) /* White (hatch) */
GPIO(LED_3_L, PIN(C, 2), GPIO_OUT_HIGH)
GPIO(EC_KB_BL_EN, PIN(8, 6), GPIO_OUT_LOW) /* Keyboard backlight */
-GPIO(EN_MST, PIN(9, 6), GPIO_OUT_LOW)
GPIO(LID_ACCEL_INT_L, PIN(5, 0), GPIO_INPUT | /* Lid accelerometer */
GPIO_SEL_1P8V)