summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Hill <ecgh@chromium.org>2020-02-26 14:27:23 -0700
committerCommit Bot <commit-bot@chromium.org>2020-02-27 00:56:17 +0000
commit29918a71d3622f9c9da9a4db37bb1843ce8f3284 (patch)
tree8ef38395d1e97fee669af2fb62ef2ea285f710ee
parent331de6dbdf9b024d4c3f6e183df868d3f7cabac2 (diff)
downloadchrome-ec-29918a71d3622f9c9da9a4db37bb1843ce8f3284.tar.gz
dalboz: update GPIOs
BUG=b:147297680 BRANCH=none TEST=able to boot dalboz AP Signed-off-by: Edward Hill <ecgh@chromium.org> Change-Id: I4a3ec2a77292e48672f5c6143990c36b9a80b6a6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2073277 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
-rw-r--r--baseboard/zork/baseboard.c21
-rw-r--r--baseboard/zork/baseboard.h16
-rw-r--r--baseboard/zork/variant_trembyle.c22
-rw-r--r--board/dalboz/board.c18
-rw-r--r--board/dalboz/board.h6
-rw-r--r--board/dalboz/gpio.inc16
6 files changed, 42 insertions, 57 deletions
diff --git a/baseboard/zork/baseboard.c b/baseboard/zork/baseboard.c
index 0b3febe39c..f64a911f94 100644
--- a/baseboard/zork/baseboard.c
+++ b/baseboard/zork/baseboard.c
@@ -315,7 +315,9 @@ void baseboard_tcpc_init(void)
/* Enable HPD interrupts */
ioex_enable_interrupt(IOEX_HDMI_CONN_HPD_3V3_DB);
+#ifdef VARIANT_ZORK_TREMBYLE
ioex_enable_interrupt(IOEX_MST_HPD_OUT);
+#endif
}
DECLARE_HOOK(HOOK_INIT, baseboard_tcpc_init, HOOK_PRIO_INIT_I2C + 1);
@@ -696,8 +698,10 @@ static int zork_c1_get_mux(int port, mux_state_t *mux_state)
const struct pi3dpx1207_usb_control pi3dpx1207_controls[] = {
[USBC_PORT_C0] = {
+#ifdef VARIANT_ZORK_TREMBYLE
.enable_gpio = IOEX_USB_C0_DATA_EN,
.dp_enable_gpio = GPIO_USB_C0_IN_HPD,
+#endif
},
[USBC_PORT_C1] = {
},
@@ -972,20 +976,3 @@ void hdmi_hpd_interrupt(enum ioex_signal signal)
/* Debounce for 2 msec. */
hook_call_deferred(&hdmi_hpd_handler_data, (2 * MSEC));
}
-
-static void mst_hpd_handler(void)
-{
- int hpd = 0;
-
- /* Pass HPD through from DB OPT3 MST hub to AP's DP1. */
- ioex_get_level(IOEX_MST_HPD_OUT, &hpd);
- gpio_set_level(GPIO_DP1_HPD, hpd);
- ccprints("MST HPD %d", hpd);
-}
-DECLARE_DEFERRED(mst_hpd_handler);
-
-void mst_hpd_interrupt(enum ioex_signal signal)
-{
- /* Debounce for 2 msec. */
- hook_call_deferred(&mst_hpd_handler_data, (2 * MSEC));
-}
diff --git a/baseboard/zork/baseboard.h b/baseboard/zork/baseboard.h
index 9f18d663a3..61719b012c 100644
--- a/baseboard/zork/baseboard.h
+++ b/baseboard/zork/baseboard.h
@@ -296,11 +296,17 @@ enum zork_c1_retimer {
};
extern enum zork_c1_retimer zork_c1_retimer;
-#define PORT_TO_HPD(port) ((port == 0) \
- ? GPIO_USB_C0_HPD \
- : (zork_c1_retimer == C1_RETIMER_PS8802) \
- ? GPIO_DP1_HPD \
- : GPIO_DP2_HPD)
+#if defined(VARIANT_ZORK_TREMBYLE)
+ #define PORT_TO_HPD(port) ((port == 0) \
+ ? GPIO_USB_C0_HPD \
+ : (zork_c1_retimer == C1_RETIMER_PS8802) \
+ ? GPIO_DP1_HPD \
+ : GPIO_DP2_HPD)
+#elif defined(VARIANT_ZORK_DALBOZ)
+ #define PORT_TO_HPD(port) ((port == 0) \
+ ? GPIO_USB3_C0_DP2_HPD \
+ : GPIO_DP1_HPD)
+#endif
/*
* Matrix to rotate accelerators into the standard reference frame. The default
diff --git a/baseboard/zork/variant_trembyle.c b/baseboard/zork/variant_trembyle.c
index 7d5c05a7ab..2b6e520136 100644
--- a/baseboard/zork/variant_trembyle.c
+++ b/baseboard/zork/variant_trembyle.c
@@ -12,6 +12,7 @@
#include "hooks.h"
#include "i2c.h"
#include "ioexpander.h"
+#include "timer.h"
#define CPRINTSUSB(format, args...) cprints(CC_USBCHARGE, format, ## args)
#define CPRINTFUSB(format, args...) cprintf(CC_USBCHARGE, format, ## args)
@@ -128,3 +129,24 @@ static void ps8811_retimer_off(void)
ioex_set_level(IOEX_USB_A1_RETIMER_EN, 0);
}
DECLARE_HOOK(HOOK_CHIPSET_SHUTDOWN, ps8811_retimer_off, HOOK_PRIO_DEFAULT);
+
+/*****************************************************************************
+ * MST hub
+ */
+
+static void mst_hpd_handler(void)
+{
+ int hpd = 0;
+
+ /* Pass HPD through from DB OPT3 MST hub to AP's DP1. */
+ ioex_get_level(IOEX_MST_HPD_OUT, &hpd);
+ gpio_set_level(GPIO_DP1_HPD, hpd);
+ ccprints("MST HPD %d", hpd);
+}
+DECLARE_DEFERRED(mst_hpd_handler);
+
+void mst_hpd_interrupt(enum ioex_signal signal)
+{
+ /* Debounce for 2 msec. */
+ hook_call_deferred(&mst_hpd_handler_data, (2 * MSEC));
+}
diff --git a/board/dalboz/board.c b/board/dalboz/board.c
index 0426545204..b813a96bc7 100644
--- a/board/dalboz/board.c
+++ b/board/dalboz/board.c
@@ -120,26 +120,8 @@ unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors);
#endif /* HAS_TASK_MOTIONSENSE */
-/* These GPIOs moved. Temporarily detect and support the V0 HW. */
-enum gpio_signal GPIO_PCH_PWRBTN_L = GPIO_EC_FCH_PWR_BTN_L;
-enum gpio_signal GPIO_PCH_SYS_PWROK = GPIO_EC_FCH_PWROK;
-
void board_update_sensor_config_from_sku(void)
{
- int data;
-
- /*
- * If the CBI EEPROM is found on the battery I2C port then we are
- * running on V0 HW so re-map the GPIOs that moved.
- */
- if ((system_get_sku_id() == 0x7fffffff)
- && (i2c_read8(I2C_PORT_BATTERY, I2C_ADDR_EEPROM_FLAGS, 0, &data)
- == EC_SUCCESS)) {
- ccprints("V0 HW detected");
- GPIO_PCH_PWRBTN_L = GPIO_EC_FCH_PWR_BTN_L_V0;
- GPIO_PCH_SYS_PWROK = GPIO_EC_FCH_PWROK_V0;
- }
-
/* Enable Gyro interrupts */
gpio_enable_interrupt(GPIO_6AXIS_INT_L);
}
diff --git a/board/dalboz/board.h b/board/dalboz/board.h
index a78beb8058..c3aa73b109 100644
--- a/board/dalboz/board.h
+++ b/board/dalboz/board.h
@@ -46,9 +46,11 @@
#define GPIO_ENABLE_BACKLIGHT_L GPIO_EC_EDP_BL_DISABLE
#define GPIO_ENTERING_RW GPIO_EC_ENTERING_RW
#define GPIO_KBD_KSO2 GPIO_EC_KSO_02_INV
+#define GPIO_PCH_PWRBTN_L GPIO_EC_FCH_PWR_BTN_L
#define GPIO_PCH_RSMRST_L GPIO_EC_FCH_RSMRST_L
#define GPIO_PCH_SLP_S3_L GPIO_SLP_S3_L
#define GPIO_PCH_SLP_S5_L GPIO_SLP_S5_L
+#define GPIO_PCH_SYS_PWROK GPIO_EC_FCH_PWROK
#define GPIO_PCH_WAKE_L GPIO_EC_FCH_WAKE_L
#define GPIO_POWER_BUTTON_L GPIO_EC_PWR_BTN_ODL
#define GPIO_S0_PGOOD GPIO_S0_PWROK_OD
@@ -60,10 +62,6 @@
#ifndef __ASSEMBLER__
-/* These GPIOs moved. Temporarily detect and support the V0 HW. */
-extern enum gpio_signal GPIO_PCH_PWRBTN_L;
-extern enum gpio_signal GPIO_PCH_SYS_PWROK;
-
enum battery_type {
BATTERY_SMP,
BATTERY_LGC,
diff --git a/board/dalboz/gpio.inc b/board/dalboz/gpio.inc
index fd9efe7816..5916fc2976 100644
--- a/board/dalboz/gpio.inc
+++ b/board/dalboz/gpio.inc
@@ -37,43 +37,33 @@ GPIO(EC_AP_INT_ODL, PIN(A, 3), GPIO_ODR_HIGH) /* Sensor MKBP event to SOC */
GPIO(EN_PWR_A, PIN(B, 7), GPIO_OUT_LOW) /* Enable Power */
GPIO(EC_EDP_BL_DISABLE, PIN(A, 2), GPIO_OUT_HIGH) /* Enable Backlight */
GPIO(EC_ENTERING_RW, PIN(E, 5), GPIO_OUT_LOW) /* EC Entering RW */
-GPIO(EC_FCH_PWR_BTN_L, PIN(6, 2), GPIO_OUT_HIGH) /* Power Button to SOC */
-GPIO(EC_FCH_PWR_BTN_L_V0, PIN(8, 6), GPIO_OUT_HIGH) /* Power Button to SOC */
+GPIO(EC_FCH_PWR_BTN_L, PIN(6, 7), GPIO_OUT_HIGH) /* Power Button to SOC */
GPIO(EC_FCH_RSMRST_L, PIN(A, 1), GPIO_OUT_LOW) /* RSMRST# to SOC */
-GPIO(EC_FCH_PWROK, PIN(D, 3), GPIO_OUT_LOW) /* Power OK to SOC */
-GPIO(EC_FCH_PWROK_V0, PIN(7, 5), GPIO_OUT_LOW) /* Power OK to SOC */
+GPIO(EC_FCH_PWROK, PIN(7, 0), GPIO_OUT_LOW) /* Power OK to SOC */
GPIO(EC_FCH_WAKE_L, PIN(0, 3), GPIO_OUT_HIGH) /* Wake SOC */
GPIO(EC_SYS_RST_L, PIN(C, 7), GPIO_ODR_HIGH) /* Cold Reset to SOC */
GPIO(USB_C0_TCPC_RST_L, PIN(E, 1), GPIO_OUT_HIGH) /* C0 TCPC Reset */
GPIO(USB_C1_TCPC_RST_L, PIN(F, 0), GPIO_OUT_HIGH) /* C1 TCPC Reset */
-GPIO(USB_C0_HPD, PIN(F, 5), GPIO_OUT_LOW) /* C0 DP Hotplug Detect */
-GPIO(USB_C0_IN_HPD, PIN(7, 3), GPIO_OUT_LOW) /* C0 IN Hotplug Detect */
+GPIO(USB3_C0_DP2_HPD, PIN(F, 5), GPIO_OUT_LOW) /* C0 DP Hotplug Detect */
GPIO(DP1_HPD, PIN(F, 4), GPIO_OUT_LOW) /* C1 DP Hotplug Detect */
-GPIO(DP2_HPD, PIN(C, 1), GPIO_OUT_LOW) /* C1 DP Hotplug Detect */
GPIO(LED_FULL_L, PIN(6, 0), GPIO_OUT_HIGH)
GPIO(LED_CHRG_L, PIN(C, 0), GPIO_OUT_HIGH)
IOEX_INT(HDMI_CONN_HPD_3V3_DB, EXPIN(USBC_PORT_C1, 1, 0), GPIO_INT_BOTH, hdmi_hpd_interrupt)
-IOEX_INT(MST_HPD_OUT, EXPIN(USBC_PORT_C1, 0, 3), GPIO_INT_BOTH, mst_hpd_interrupt)
-IOEX(USB_A0_RETIMER_EN, EXPIN(USBC_PORT_C0, 0, 0), GPIO_OUT_LOW) /* A0 Retimer Enable */
-IOEX(USB_A0_RETIMER_RST, EXPIN(USBC_PORT_C0, 0, 1), GPIO_OUT_LOW) /* A0 Retimer Reset */
IOEX(USB_C0_FAULT_ODL, EXPIN(USBC_PORT_C0, 0, 3), GPIO_ODR_HIGH) /* C0 Fault to SOC */
IOEX(USB_C0_TCPC_FASTSW_CTL_EN, EXPIN(USBC_PORT_C0, 0, 4), GPIO_OUT_LOW) /* C0 FastSwitch Control */
IOEX(USB_C1_FAULT_ODL, EXPIN(USBC_PORT_C0, 1, 0), GPIO_ODR_HIGH) /* C1 Fault to SOC */
IOEX(USB_C0_PPC_ILIM_3A_EN, EXPIN(USBC_PORT_C0, 1, 1), GPIO_OUT_LOW) /* C0 3A Current Limit Enable */
IOEX(USB_C0_SBU_FAULT_ODL, EXPIN(USBC_PORT_C0, 1, 2), GPIO_INPUT) /* C0 SBU Fault */
IOEX(KB_BL_EN, EXPIN(USBC_PORT_C0, 1, 3), GPIO_OUT_LOW) /* KB Backlight Enable */
-IOEX(USB_C0_DATA_EN, EXPIN(USBC_PORT_C0, 1, 4), GPIO_OUT_LOW) /* C0 Data Enable */
IOEX(EN_USB_A0_5V, EXPIN(USBC_PORT_C0, 1, 5), GPIO_OUT_LOW) /* A0 5V Source Enable */
IOEX(USB_A0_CHARGE_EN_L, EXPIN(USBC_PORT_C0, 1, 6), GPIO_OUT_HIGH) /* A0 5V High Current Enable */
IOEX(USB_A1_RETIMER_EN, EXPIN(USBC_PORT_C1, 0, 0), GPIO_OUT_LOW) /* A1 Retimer Enable */
-IOEX(USB_A1_RETIMER_RST_DB, EXPIN(USBC_PORT_C1, 0, 1), GPIO_OUT_LOW) /* A1 Retimer Reset */
IOEX(USB_C1_HPD_IN_DB, EXPIN(USBC_PORT_C1, 0, 2), GPIO_OUT_LOW) /* C1 HPD */
IOEX(USB_C1_TCPC_FASTSW_CTL_EN, EXPIN(USBC_PORT_C1, 0, 4), GPIO_OUT_LOW) /* C1 FastSwitch Control */
-IOEX(USB_C1_MUX_RST_DB, EXPIN(USBC_PORT_C1, 1, 1), GPIO_OUT_LOW) /* C1 Mux Reset */
IOEX(USB_C1_SBU_FAULT_DB_ODL, EXPIN(USBC_PORT_C1, 1, 2), GPIO_INPUT) /* C1 SBU Fault */
IOEX(USB_C1_PPC_EN_L, EXPIN(USBC_PORT_C1, 1, 3), GPIO_OUT_LOW) /* C1 PPC Enable */
IOEX(HDMI_DATA_EN_DB, EXPIN(USBC_PORT_C1, 1, 4), GPIO_OUT_HIGH) /* HDMI Retimer Enable */