diff options
author | Rong Chang <rongchang@chromium.org> | 2015-06-08 18:21:06 +0800 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-06-10 15:49:28 +0000 |
commit | 483eba41c13631d8ebacd720b29b819a128b11e0 (patch) | |
tree | 30aa8e3a4834fdc78435bd9c72ce187ec2d7bb66 /board | |
parent | 63a9dc19b580d9a3ec2bc4f73c76b6a016b8802f (diff) | |
download | chrome-ec-483eba41c13631d8ebacd720b29b819a128b11e0.tar.gz |
oak: add PD support for type-C port 1
Port CL:275072 to oak. Oak rev1 and rev1.5 type-C VBUS input controls
are connected to PD phy instead of EC. This change wakes both USB PD
task to handle power status change. This issue will be fixed in next
hardware revision, or enable TCPC power status alert.
BRANCH=none
BUG=chrome-os-partner:41167
BUG=chrome-os-partner:41226
TEST=manual
plug type-C charger into port 1
Change-Id: Ifea19276d0eb74f3e4cac509abece362e6e8af17
Signed-off-by: Rong Chang <rongchang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/275851
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'board')
-rw-r--r-- | board/oak/board.c | 11 | ||||
-rw-r--r-- | board/oak/board.h | 2 | ||||
-rw-r--r-- | board/oak/ec.tasklist | 3 | ||||
-rw-r--r-- | board/oak_pd/board.c | 4 | ||||
-rw-r--r-- | board/oak_pd/board.h | 5 | ||||
-rw-r--r-- | board/oak_pd/ec.tasklist | 7 |
6 files changed, 21 insertions, 11 deletions
diff --git a/board/oak/board.c b/board/oak/board.c index 77a1d4c3b9..70cb91de7a 100644 --- a/board/oak/board.c +++ b/board/oak/board.c @@ -53,7 +53,16 @@ void vbus_wake_interrupt(enum gpio_signal signal) CPRINTF("VBUS %d\n", !gpio_get_level(signal)); gpio_set_level(GPIO_USB_PD_VBUS_WAKE, !gpio_get_level(GPIO_VBUS_WAKE_L)); - task_wake(TASK_ID_PD); + /* + * TODO(crosbug.com/p/41226): + * rev1/rev2 boards don't have vbus input on ec. vbus_wake is a + * logical OR of two vbus status. to workaround the power status + * issue, wake up both pd tasks on vbus_wake interrupt. a proper + * hardware fix will be in rev3. + * enable TCPC POWER_STATUS ALERT1 can solve this issue too. + */ + task_wake(TASK_ID_PD_C0); + task_wake(TASK_ID_PD_C1); } void pd_mcu_interrupt(enum gpio_signal signal) diff --git a/board/oak/board.h b/board/oak/board.h index ced0b44075..c810b0d4f3 100644 --- a/board/oak/board.h +++ b/board/oak/board.h @@ -52,7 +52,7 @@ #define CONFIG_USB_PD_ALT_MODE_DFP #define CONFIG_USB_PD_CUSTOM_VDM #define CONFIG_USB_PD_DUAL_ROLE -#define CONFIG_USB_PD_PORT_COUNT 1 +#define CONFIG_USB_PD_PORT_COUNT 2 #define CONFIG_USB_PD_TCPM_TCPCI #define CONFIG_SPI #define CONFIG_STM_HWTIMER32 diff --git a/board/oak/ec.tasklist b/board/oak/ec.tasklist index 5cc15a1cfe..35c72c3acf 100644 --- a/board/oak/ec.tasklist +++ b/board/oak/ec.tasklist @@ -24,4 +24,5 @@ TASK_ALWAYS(HOSTCMD, host_command_task, NULL, TASK_STACK_SIZE) \ TASK_ALWAYS(CONSOLE, console_task, NULL, TASK_STACK_SIZE) \ TASK_NOTEST(KEYSCAN, keyboard_scan_task, NULL, TASK_STACK_SIZE) \ - TASK_ALWAYS(PD, pd_task, NULL, LARGER_TASK_STACK_SIZE) + TASK_ALWAYS(PD_C0, pd_task, NULL, LARGER_TASK_STACK_SIZE) \ + TASK_ALWAYS(PD_C1, pd_task, NULL, LARGER_TASK_STACK_SIZE) diff --git a/board/oak_pd/board.c b/board/oak_pd/board.c index 261fdf55cf..a29d143054 100644 --- a/board/oak_pd/board.c +++ b/board/oak_pd/board.c @@ -35,14 +35,12 @@ void pd_send_ec_int(void) void vbus0_evt(enum gpio_signal signal) { - task_wake(TASK_ID_PD); + task_wake(TASK_ID_PD_C0); } void vbus1_evt(enum gpio_signal signal) { -#ifdef HAS_TASK_PD_C1 task_wake(TASK_ID_PD_C1); -#endif } void board_config_pre_init(void) diff --git a/board/oak_pd/board.h b/board/oak_pd/board.h index 07e763057a..e2262fbca0 100644 --- a/board/oak_pd/board.h +++ b/board/oak_pd/board.h @@ -42,7 +42,8 @@ #undef CONFIG_CMD_SHMEM #define CONFIG_COMMON_GPIO_SHORTNAMES #define CONFIG_CONSOLE_CMDHELP -#define CONFIG_CONSOLE_HISTORY 3 +#undef CONFIG_CONSOLE_HISTORY +#define CONFIG_CONSOLE_HISTORY 2 #undef CONFIG_DEBUG_ASSERT #define CONFIG_FORCE_CONSOLE_RESUME #define CONFIG_HIBERNATE_WAKEUP_PINS (STM32_PWR_CSR_EWUP2) @@ -59,7 +60,7 @@ #define CONFIG_UART_TX_BUF_SIZE 128 #define CONFIG_USB_PD_DUAL_ROLE #define CONFIG_USB_PD_INTERNAL_COMP -#define CONFIG_USB_PD_PORT_COUNT 1 +#define CONFIG_USB_PD_PORT_COUNT 2 #define CONFIG_USB_PD_TCPC #define CONFIG_USBC_VCONN #define CONFIG_VBOOT_HASH diff --git a/board/oak_pd/ec.tasklist b/board/oak_pd/ec.tasklist index c001ade46f..676c13e60d 100644 --- a/board/oak_pd/ec.tasklist +++ b/board/oak_pd/ec.tasklist @@ -18,6 +18,7 @@ */ #define CONFIG_TASK_LIST \ TASK_ALWAYS(HOOKS, hook_task, NULL, LARGER_TASK_STACK_SIZE) \ - TASK_NOTEST(HOSTCMD, host_command_task, NULL, LARGER_TASK_STACK_SIZE) \ - TASK_ALWAYS(CONSOLE, console_task, NULL, LARGER_TASK_STACK_SIZE) \ - TASK_ALWAYS(PD, pd_task, NULL, LARGER_TASK_STACK_SIZE) + TASK_NOTEST(HOSTCMD, host_command_task, NULL, TASK_STACK_SIZE) \ + TASK_ALWAYS(CONSOLE, console_task, NULL, TASK_STACK_SIZE) \ + TASK_ALWAYS(PD_C0, pd_task, NULL, TASK_STACK_SIZE) \ + TASK_ALWAYS(PD_C1, pd_task, NULL, TASK_STACK_SIZE) |