diff options
-rw-r--r-- | baseboard/intelrvp/baseboard.h | 16 | ||||
-rw-r--r-- | baseboard/intelrvp/build.mk | 3 | ||||
-rw-r--r-- | baseboard/intelrvp/chg_usb_pd.c | 16 | ||||
-rw-r--r-- | baseboard/intelrvp/ite_ec.h | 1 | ||||
-rw-r--r-- | baseboard/intelrvp/vbus.c | 30 | ||||
-rw-r--r-- | board/jslrvp_ite/ec.tasklist | 5 | ||||
-rw-r--r-- | board/jslrvp_ite/gpio.inc | 4 | ||||
-rw-r--r-- | board/tglrvpu_ite/board.h | 4 | ||||
-rw-r--r-- | board/tglrvpu_ite/ec.tasklist | 5 | ||||
-rw-r--r-- | board/tglrvpu_ite/gpio.inc | 13 | ||||
l--------- | board/tglrvpu_ite_tcpmv1 | 1 | ||||
l--------- | board/tglrvpy_ite_tcpmv1 | 1 | ||||
-rwxr-xr-x | util/flash_ec | 2 |
13 files changed, 44 insertions, 57 deletions
diff --git a/baseboard/intelrvp/baseboard.h b/baseboard/intelrvp/baseboard.h index 49c2f7bdb9..5ee550a362 100644 --- a/baseboard/intelrvp/baseboard.h +++ b/baseboard/intelrvp/baseboard.h @@ -9,7 +9,7 @@ #define __CROS_EC_BASEBOARD_H #ifdef CHIP_FAMILY_IT83XX -#include "ite_ec.h" + #include "ite_ec.h" #endif /* CHIP_FAMILY_IT83XX */ /* @@ -81,6 +81,15 @@ #define CONFIG_USB_PID 0x8086 /* USB PD config */ +#if defined(BOARD_TGLRVPU_ITE_TCPMV1) || defined(BOARD_TGLRVPY_ITE_TCPMV1) + #define CONFIG_USB_PD_TCPMV1 +#else + #define CONFIG_USB_DRP_ACC_TRYSRC + #define CONFIG_USB_PD_DECODE_SOP + #define CONFIG_USB_PD_TCPMV2 + #define CONFIG_USB_PD_TCPM_MUX +#endif +#define CONFIG_USB_PD_DEBUG_LEVEL 1 #define CONFIG_USB_PD_ALT_MODE #define CONFIG_USB_PD_ALT_MODE_DFP #define CONFIG_USB_PD_DUAL_ROLE @@ -89,7 +98,6 @@ #define CONFIG_USB_PD_TRY_SRC #define CONFIG_USB_PD_VBUS_MEASURE_NOT_PRESENT #define CONFIG_USB_POWER_DELIVERY -#define CONFIG_USB_PD_TCPMV1 /* USB MUX */ #ifdef CONFIG_USB_MUX_VIRTUAL @@ -127,6 +135,7 @@ #define CONFIG_CRC8 #define CONFIG_SHA256_UNROLLED #define CONFIG_VBOOT_HASH + /* * Enable 1 slot of secure temporary storage to support * suspend/resume with read/write memory training. @@ -240,13 +249,12 @@ extern const struct tcpc_gpio_config_t tcpc_gpios[]; /* Reset PD MCU */ void board_reset_pd_mcu(void); -void vbus0_evt(enum gpio_signal signal); -void vbus1_evt(enum gpio_signal signal); void board_charging_enable(int port, int enable); void board_vbus_enable(int port, int enable); void board_set_vbus_source_current_limit(int port, enum tcpc_rp_value rp); int ioexpander_read_intelrvp_version(int *port0, int *port1); void board_dc_jack_interrupt(enum gpio_signal signal); +void tcpc_alert_event(enum gpio_signal signal); #endif /* !__ASSEMBLER__ */ diff --git a/baseboard/intelrvp/build.mk b/baseboard/intelrvp/build.mk index 12a62ffffc..d48d862fd5 100644 --- a/baseboard/intelrvp/build.mk +++ b/baseboard/intelrvp/build.mk @@ -24,6 +24,3 @@ baseboard-$(CONFIG_USB_MUX_ANX7440)+=usb_mux.o #USB Retimer specific files baseboard-$(CONFIG_USBC_RETIMER_INTEL_BB)+=retimer.o - -#VBUS detection specific files -baseboard-$(CONFIG_USB_PD_VBUS_DETECT_GPIO)+=vbus.o diff --git a/baseboard/intelrvp/chg_usb_pd.c b/baseboard/intelrvp/chg_usb_pd.c index c15ee886eb..8620268263 100644 --- a/baseboard/intelrvp/chg_usb_pd.c +++ b/baseboard/intelrvp/chg_usb_pd.c @@ -78,10 +78,18 @@ int pd_snk_is_vbus_provided(int port) void tcpc_alert_event(enum gpio_signal signal) { -#ifdef HAS_TASK_PDCMD - /* Exchange status with TCPCs */ - host_command_pd_send_status(PD_CHARGE_NO_CHANGE); -#endif + int port = -1; + int i; + + for (i = 0; i < CONFIG_USB_PD_PORT_MAX_COUNT; i++) { + if (tcpc_gpios[i].vbus.pin == signal) { + port = i; + break; + } + } + + if (port != -1) + schedule_deferred_pd_interrupt(port); } void board_tcpc_init(void) diff --git a/baseboard/intelrvp/ite_ec.h b/baseboard/intelrvp/ite_ec.h index 9fc5def311..a09923dbb0 100644 --- a/baseboard/intelrvp/ite_ec.h +++ b/baseboard/intelrvp/ite_ec.h @@ -10,7 +10,6 @@ /* USB PD config */ #define CONFIG_USB_PD_TCPM_ITE_ON_CHIP -#define CONFIG_USB_PD_VBUS_DETECT_GPIO #define CONFIG_USB_PD_ITE_ACTIVE_PORT_COUNT 2 /* Optional feature - used by ITE */ diff --git a/baseboard/intelrvp/vbus.c b/baseboard/intelrvp/vbus.c deleted file mode 100644 index 45ea3409cd..0000000000 --- a/baseboard/intelrvp/vbus.c +++ /dev/null @@ -1,30 +0,0 @@ -/* Copyright 2019 The Chromium OS Authors. All rights reserved. - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -/* Intel BASEBOARD-RVP VBUS detection specific configuration */ - -#include "task.h" -#include "usb_charge.h" - -/* USB VBUS detection configuration */ -#ifdef CONFIG_USB_PD_VBUS_DETECT_GPIO -void vbus0_evt(enum gpio_signal signal) -{ -#ifdef HAS_TASK_USB_CHG_P0 - task_set_event(TASK_ID_USB_CHG_P0, USB_CHG_EVENT_VBUS, 0); -#endif - task_wake(TASK_ID_PD_C0); -} - -#ifdef HAS_TASK_PD_C1 -void vbus1_evt(enum gpio_signal signal) -{ -#ifdef HAS_TASK_USB_CHG_P1 - task_set_event(TASK_ID_USB_CHG_P1, USB_CHG_EVENT_VBUS, 0); -#endif - task_wake(TASK_ID_PD_C1); -} -#endif /* HAS_TASK_PD_C1 */ -#endif /* CONFIG_USB_PD_VBUS_DETECT_GPIO */ diff --git a/board/jslrvp_ite/ec.tasklist b/board/jslrvp_ite/ec.tasklist index 6b23e8d7e2..768211c95f 100644 --- a/board/jslrvp_ite/ec.tasklist +++ b/board/jslrvp_ite/ec.tasklist @@ -13,10 +13,11 @@ TASK_ALWAYS(CHARGER, charger_task, NULL, LARGER_TASK_STACK_SIZE) \ TASK_NOTEST(CHIPSET, chipset_task, NULL, VENTI_TASK_STACK_SIZE) \ TASK_NOTEST(KEYPROTO, keyboard_protocol_task, NULL, TASK_STACK_SIZE) \ - TASK_NOTEST(PDCMD, pd_command_task, NULL, TASK_STACK_SIZE) \ TASK_ALWAYS(HOSTCMD, host_command_task, NULL, LARGER_TASK_STACK_SIZE) \ TASK_ALWAYS(CONSOLE, console_task, NULL, VENTI_TASK_STACK_SIZE) \ TASK_ALWAYS(POWERBTN, power_button_task, NULL, LARGER_TASK_STACK_SIZE) \ TASK_NOTEST(KEYSCAN, keyboard_scan_task, NULL, TASK_STACK_SIZE) \ TASK_ALWAYS(PD_C0, pd_task, NULL, VENTI_TASK_STACK_SIZE) \ - TASK_ALWAYS(PD_C1, pd_task, NULL, VENTI_TASK_STACK_SIZE) + TASK_ALWAYS(PD_C1, pd_task, NULL, VENTI_TASK_STACK_SIZE) \ + TASK_ALWAYS(PD_INT_C0, pd_interrupt_handler_task, 0, TASK_STACK_SIZE) \ + TASK_ALWAYS(PD_INT_C1, pd_interrupt_handler_task, 1, TASK_STACK_SIZE) diff --git a/board/jslrvp_ite/gpio.inc b/board/jslrvp_ite/gpio.inc index 66e0fe5595..5c0219263e 100644 --- a/board/jslrvp_ite/gpio.inc +++ b/board/jslrvp_ite/gpio.inc @@ -48,8 +48,8 @@ GPIO_INT(TABLET_MODE_L, PIN(K, 1), GPIO_INT_BOTH, gmr_tablet_switch_isr) GPIO_INT(DC_JACK_PRESENT, PIN(J, 2), GPIO_INT_BOTH, board_dc_jack_interrupt) /* Type-C interrupts */ -GPIO_INT(USB_C0_VBUS_INT, PIN(L, 5), GPIO_INT_BOTH, vbus0_evt) -GPIO_INT(USB_C1_VBUS_INT, PIN(D, 4), GPIO_INT_BOTH, vbus1_evt) +GPIO_INT(USB_C0_VBUS_INT, PIN(L, 5), GPIO_INT_BOTH, tcpc_alert_event) +GPIO_INT(USB_C1_VBUS_INT, PIN(D, 4), GPIO_INT_BOTH, tcpc_alert_event) /* Power sequencing GPIOs */ GPIO(CPU_PROCHOT, PIN(B, 2), GPIO_INPUT) diff --git a/board/tglrvpu_ite/board.h b/board/tglrvpu_ite/board.h index 9559d5526d..222295c7cd 100644 --- a/board/tglrvpu_ite/board.h +++ b/board/tglrvpu_ite/board.h @@ -44,7 +44,7 @@ #define DEDICATED_CHARGE_PORT 2 /* USB-C port's USB2 & USB3 port numbers */ -#ifdef BOARD_TGLRVPU_ITE +#if defined(BOARD_TGLRVPU_ITE) || defined(BOARD_TGLRVPU_ITE_TCPMV1) #define TYPE_C_PORT_0_USB2_NUM 6 #define TYPE_C_PORT_1_USB2_NUM 7 @@ -76,7 +76,7 @@ #define I2C_ADDR_PCA9555_BOARD_ID_GPIO 0x22 #define PORT80_I2C_ADDR MAX695X_I2C_ADDR1_FLAGS -#ifdef BOARD_TGLRVPU_ITE +#if defined(BOARD_TGLRVPU_ITE) || defined(BOARD_TGLRVPU_ITE_TCPMV1) #define I2C_PORT0_BB_RETIMER_ADDR 0x42 #define I2C_PORT1_BB_RETIMER_ADDR 0x43 #else /* BOARD_TGLRVPY_ITE */ diff --git a/board/tglrvpu_ite/ec.tasklist b/board/tglrvpu_ite/ec.tasklist index d8b1fc162c..4e65a446e4 100644 --- a/board/tglrvpu_ite/ec.tasklist +++ b/board/tglrvpu_ite/ec.tasklist @@ -14,10 +14,11 @@ TASK_ALWAYS(CHARGER, charger_task, NULL, LARGER_TASK_STACK_SIZE) \ TASK_NOTEST(CHIPSET, chipset_task, NULL, VENTI_TASK_STACK_SIZE) \ TASK_NOTEST(KEYPROTO, keyboard_protocol_task, NULL, TASK_STACK_SIZE) \ - TASK_NOTEST(PDCMD, pd_command_task, NULL, TASK_STACK_SIZE) \ TASK_ALWAYS(HOSTCMD, host_command_task, NULL, LARGER_TASK_STACK_SIZE) \ TASK_ALWAYS(CONSOLE, console_task, NULL, VENTI_TASK_STACK_SIZE) \ TASK_ALWAYS(POWERBTN, power_button_task, NULL, LARGER_TASK_STACK_SIZE) \ TASK_NOTEST(KEYSCAN, keyboard_scan_task, NULL, TASK_STACK_SIZE) \ TASK_ALWAYS(PD_C0, pd_task, NULL, VENTI_TASK_STACK_SIZE) \ - TASK_ALWAYS(PD_C1, pd_task, NULL, VENTI_TASK_STACK_SIZE) + TASK_ALWAYS(PD_C1, pd_task, NULL, VENTI_TASK_STACK_SIZE) \ + TASK_ALWAYS(PD_INT_C0, pd_interrupt_handler_task, 0, TASK_STACK_SIZE) \ + TASK_ALWAYS(PD_INT_C1, pd_interrupt_handler_task, 1, TASK_STACK_SIZE) diff --git a/board/tglrvpu_ite/gpio.inc b/board/tglrvpu_ite/gpio.inc index 34235266e0..e0bce1ddd8 100644 --- a/board/tglrvpu_ite/gpio.inc +++ b/board/tglrvpu_ite/gpio.inc @@ -47,14 +47,13 @@ GPIO_INT(TABLET_MODE_L, PIN(K, 1), GPIO_INT_BOTH, gmr_tablet_switch_isr) /* DC Jack presence coming from +VADP_OUT */ GPIO_INT(DC_JACK_PRESENT, PIN(J, 2), GPIO_INT_BOTH, board_dc_jack_interrupt) - /* Type-C interrupts */ -#ifdef BOARD_TGLRVPU_ITE -GPIO_INT(USB_C0_VBUS_INT, PIN(L, 5), GPIO_INT_BOTH, vbus0_evt) -GPIO_INT(USB_C1_VBUS_INT, PIN(D, 4), GPIO_INT_BOTH, vbus1_evt) +#if defined(BOARD_TGLRVPU_ITE) || defined(BOARD_TGLRVPU_ITE_TCPMV1) +GPIO_INT(USB_C0_VBUS_INT, PIN(L, 5), GPIO_INT_BOTH, tcpc_alert_event) +GPIO_INT(USB_C1_VBUS_INT, PIN(D, 4), GPIO_INT_BOTH, tcpc_alert_event) #else /* BOARD_TGLRVPY_ITE */ -GPIO_INT(USB_C0_VBUS_INT, PIN(D, 4), GPIO_INT_BOTH, vbus0_evt) -GPIO_INT(USB_C1_VBUS_INT, PIN(L, 5), GPIO_INT_BOTH, vbus1_evt) +GPIO_INT(USB_C0_VBUS_INT, PIN(D, 4), GPIO_INT_BOTH, tcpc_alert_event) +GPIO_INT(USB_C1_VBUS_INT, PIN(L, 5), GPIO_INT_BOTH, tcpc_alert_event) #endif /* BOARD_TGLRVPU_ITE */ /* Power sequencing GPIOs */ @@ -84,7 +83,7 @@ GPIO(PCH_PLTRST_L, PIN(E, 3), GPIO_INPUT | GPIO_PULL_UP) GPIO(EC_BATT_PRES_L, PIN(K, 0), GPIO_INPUT) /* Type-C GPIOs */ -#ifdef BOARD_TGLRVPU_ITE +#if defined(BOARD_TGLRVPU_ITE) || defined(BOARD_TGLRVPU_ITE_TCPMV1) GPIO(USB_C0_SRC_EN, PIN(L, 1), GPIO_OUT_LOW) GPIO(USB_C0_SNK_EN_L, PIN(H, 6), GPIO_ODR_LOW) GPIO(USB_C0_SRC_HI_ILIM, PIN(M, 6), GPIO_OUT_LOW) diff --git a/board/tglrvpu_ite_tcpmv1 b/board/tglrvpu_ite_tcpmv1 new file mode 120000 index 0000000000..05edd4d22f --- /dev/null +++ b/board/tglrvpu_ite_tcpmv1 @@ -0,0 +1 @@ +tglrvpu_ite
\ No newline at end of file diff --git a/board/tglrvpy_ite_tcpmv1 b/board/tglrvpy_ite_tcpmv1 new file mode 120000 index 0000000000..560115c8ab --- /dev/null +++ b/board/tglrvpy_ite_tcpmv1 @@ -0,0 +1 @@ +tglrvpy_ite
\ No newline at end of file diff --git a/util/flash_ec b/util/flash_ec index 2dff03a5d3..b8d701c5ff 100755 --- a/util/flash_ec +++ b/util/flash_ec @@ -53,7 +53,9 @@ BOARDS_IT83XX=( it83xx_evb reef_it8320 tglrvpu_ite + tglrvpu_ite_tcpmv1 tglrvpy_ite + tglrvpy_ite_tcpmv1 jslrvp_ite ) |