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>
This commit is contained in:
Shawn Nematbakhsh
2016-02-25 12:56:15 -08:00
committed by chrome-bot
parent 5a9a8f3dbf
commit e44f7b1029
3 changed files with 22 additions and 1 deletions

View File

@@ -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"

View File

@@ -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

View File

@@ -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