summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShawn Nematbakhsh <shawnn@chromium.org>2016-02-25 12:56:15 -0800
committerchrome-bot <chrome-bot@chromium.org>2016-02-25 18:25:41 -0800
commite44f7b102915db39d9567e67cd1983f8d5357318 (patch)
tree9c38db9c10eb81f44c0c58402390a3deddcdbd10
parent5a9a8f3dbf93cb651bef6ffbd420a24ca5ee01aa (diff)
downloadchrome-ec-e44f7b102915db39d9567e67cd1983f8d5357318.tar.gz
glados_pd: Add WP_L input GPIO for future boards
Future glados-derived boards are adding a WP_L GPIO input. Add support for this input, which will apply only if CONFIG_SYSTEM_UNLOCKED is not defined. Undefining CONFIG_SYSTEM_UNLOCKED will result in unpredictable WP GPIO behavior for all boards that currently exist, so it should only be undef'd right before MP FW is released. BUG=chrome-os-partner:50518, chrome-os-partner:50519 BRANCH=glados TEST=Verify 'ectool gpioget A13 --dev=1' always indicates a GPIO state '1' on an old chell_pd without WP_L input. Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Change-Id: Id50a13cce54bc2013d83613ce5599ffde6a6837b Reviewed-on: https://chromium-review.googlesource.com/329370 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
-rw-r--r--board/glados_pd/board.c1
-rw-r--r--board/glados_pd/board.h6
-rw-r--r--board/glados_pd/gpio.inc16
3 files changed, 22 insertions, 1 deletions
diff --git a/board/glados_pd/board.c b/board/glados_pd/board.c
index f03af33041..230cc1ea2d 100644
--- a/board/glados_pd/board.c
+++ b/board/glados_pd/board.c
@@ -14,6 +14,7 @@
#include "host_command.h"
#include "i2c.h"
#include "registers.h"
+#include "switch.h"
#include "system.h"
#include "task.h"
#include "usb_pd.h"
diff --git a/board/glados_pd/board.h b/board/glados_pd/board.h
index b576a257e9..d4924b189b 100644
--- a/board/glados_pd/board.h
+++ b/board/glados_pd/board.h
@@ -69,6 +69,12 @@
#define CONFIG_WATCHDOG
#undef CONFIG_WATCHDOG_HELP
+/*
+ * TODO(crosbug.com/p/50519): Remove CONFIG_SYSTEM_UNLOCKED prior to building
+ * MP FW.
+ */
+#define CONFIG_SYSTEM_UNLOCKED
+
#ifdef HAS_TASK_CONSOLE
#undef CONFIG_CONSOLE_HISTORY
#define CONFIG_CONSOLE_HISTORY 2
diff --git a/board/glados_pd/gpio.inc b/board/glados_pd/gpio.inc
index df0020e958..083085d094 100644
--- a/board/glados_pd/gpio.inc
+++ b/board/glados_pd/gpio.inc
@@ -12,6 +12,21 @@
GPIO_INT(USB_C0_VBUS_WAKE_L, PIN(C, 14), GPIO_INT_BOTH, pd_vbus_evt_p0)
GPIO_INT(USB_C1_VBUS_WAKE_L, PIN(C, 15), GPIO_INT_BOTH, pd_vbus_evt_p1)
+/*
+ * Older boards have A13 connected to a test point with no PU / PD, so we must
+ * enable an internal PU.
+ * Newer boards have A13 connected to 3.3V / GND through a 100K resistor, so
+ * we must not enable an internal PU. All MP boards will use the newer config.
+ * TODO(crosbug.com/p/50518): Remove CONFIG_SYSTEM_UNLOCKED prior to building
+ * MP FW.
+ */
+#ifdef CONFIG_SYSTEM_UNLOCKED
+GPIO_INT(WP_L, PIN(A, 13), GPIO_INT_BOTH | GPIO_PULL_UP,
+ switch_interrupt)
+#else
+GPIO_INT(WP_L, PIN(A, 13), GPIO_INT_BOTH, switch_interrupt)
+#endif
+
/* PD RX/TX */
GPIO(USB_C0_CC1_PD, PIN(A, 2), GPIO_ANALOG)
GPIO(USB_C_REF, PIN(A, 1), GPIO_ANALOG)
@@ -51,7 +66,6 @@ GPIO(EC_INT, PIN(B, 5), GPIO_OUT_HIGH)
GPIO(EC_INT, PIN(A, 14), GPIO_ODR_HIGH)
#endif
-UNIMPLEMENTED(WP_L)
UNIMPLEMENTED(ENTERING_RW)
#if 0