diff options
author | Vincent Palatin <vpalatin@chromium.org> | 2014-06-09 15:03:35 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-10-11 02:22:50 +0000 |
commit | b50e5a8b3066cdab6cb98f25038ef8649410ce2a (patch) | |
tree | 54d207d5e9f8153f017711f63649e6024ba0174b /board/twinkie/board.h | |
parent | 5822d01f99f09443dc81dd9a85143047a0e1a1c7 (diff) | |
download | chrome-ec-b50e5a8b3066cdab6cb98f25038ef8649410ce2a.tar.gz |
twinkie: add config to behave as a PD message injector
Add a compile-time configuration to make Twinkie behave as
a USB Power Delivery consumer/provider device rather than a
transparent sniffer.
To use it, edit board/twinkie/ec.tasklist:
enable the PD task and comment out the SNIFFER task.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BRANCH=none
BUG=none
TEST=connect it to a Fruitpie and use "pd charger" command on Twinkie
console, see the Fruitpie receiving the source capabilities and
answering.
Change-Id: Ic2b4ba2d166ea1d3f5f9be410453a030a4ee7b68
Reviewed-on: https://chromium-review.googlesource.com/204168
Reviewed-by: Todd Broch <tbroch@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'board/twinkie/board.h')
-rw-r--r-- | board/twinkie/board.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/board/twinkie/board.h b/board/twinkie/board.h index 51abd57353..6e4dc5c1ee 100644 --- a/board/twinkie/board.h +++ b/board/twinkie/board.h @@ -19,6 +19,16 @@ #define CONFIG_USB #define CONFIG_USB_CONSOLE +#ifdef HAS_TASK_PD /* PD message injector mode */ +#define CONFIG_USB_POWER_DELIVERY +#define CONFIG_USB_PD_DUAL_ROLE +#define CONFIG_USB_PD_INTERNAL_COMP +#define CONFIG_PD_USE_DAC_AS_REF +#define CONFIG_HW_CRC +#else /* PD sniffer mode */ +#undef CONFIG_DMA_DEFAULT_HANDLERS +#endif + #define CONFIG_ADC #define CONFIG_BOARD_PRE_INIT #define CONFIG_I2C @@ -26,7 +36,6 @@ #undef CONFIG_WATCHDOG_HELP #undef CONFIG_LID_SWITCH #undef CONFIG_TASK_PROFILING -#undef CONFIG_DMA_DEFAULT_HANDLERS /* I2C ports configuration */ #define I2C_PORT_MASTER 0 @@ -45,7 +54,6 @@ #ifndef __ASSEMBLER__ /* Timer selection */ -#define TIM_CLOCK_PD_RX 1 #define TIM_CLOCK32 2 #define TIM_ADC 3 @@ -81,7 +89,11 @@ enum usb_strings { #define USB_EP_CONTROL 0 #define USB_EP_CON_TX 1 #define USB_EP_CON_RX 2 +#ifdef HAS_TASK_SNIFFER #define USB_EP_SNIFFER 3 #define USB_EP_COUNT 4 +#else +#define USB_EP_COUNT 3 +#endif #endif /* __BOARD_H */ |