summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZick Wei <zick.wei@quanta.corp-partner.google.com>2020-07-30 11:02:18 +0800
committerCommit Bot <commit-bot@chromium.org>2020-08-13 13:20:49 +0000
commitf9797e831dd3b96b0f13992a460c90b394e50dd6 (patch)
tree4b815dfcafe47bf5e15c708bbb4dac19613d5e0d
parent8848596a4a463fba7134065f39ee49db982fb448 (diff)
downloadchrome-ec-f9797e831dd3b96b0f13992a460c90b394e50dd6.tar.gz
dirinboz: update DB setting
This CL remove unuse DB code for dirinboz. BUG=b:159598016 BRANCH=none TEST=verify DB function: DP/USB3.0 can work. Signed-off-by: Zick Wei <zick.wei@quanta.corp-partner.google.com> Change-Id: Ic6b62a2f2d5428b9b88dc4bd06e099f10e083e03 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2327360 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org>
-rw-r--r--board/dirinboz/board.c132
-rw-r--r--board/dirinboz/board.h47
-rw-r--r--board/dirinboz/gpio.inc21
3 files changed, 17 insertions, 183 deletions
diff --git a/board/dirinboz/board.c b/board/dirinboz/board.c
index f37586db7d..a4e5588178 100644
--- a/board/dirinboz/board.c
+++ b/board/dirinboz/board.c
@@ -9,12 +9,10 @@
#include "driver/accel_lis2dw12.h"
#include "driver/accelgyro_lsm6dsm.h"
#include "driver/bc12/pi3usb9201.h"
-#include "driver/ioexpander/pcal6408.h"
#include "driver/ppc/aoz1380.h"
#include "driver/ppc/nx20p348x.h"
#include "driver/tcpm/nct38xx.h"
#include "driver/usb_mux/amd_fp5.h"
-#include "driver/usb_mux/ps8740.h"
#include "driver/usb_mux/ps8743.h"
#include "extpower.h"
#include "fan.h"
@@ -41,37 +39,6 @@
/* This I2C moved. Temporarily detect and support the V0 HW. */
int I2C_PORT_BATTERY = I2C_PORT_BATTERY_V1;
-/* Interrupt handler varies with DB option. */
-void (*c1_tcpc_config_interrupt)(enum gpio_signal signal) = tcpc_alert_event;
-
-void c1_tcpc_interrupt(enum gpio_signal signal)
-{
- c1_tcpc_config_interrupt(signal);
-}
-
-/* Interrupt for C1 PPC with USB-C DB, HPD with HDMI DB. */
-void (*c1_ppc_config_interrupt)(enum gpio_signal signal) = ppc_interrupt;
-
-void c1_ppc_interrupt(enum gpio_signal signal)
-{
- c1_ppc_config_interrupt(signal);
-}
-
-static void hdmi_hpd_handler(void)
-{
- /* Pass HPD through from DB OPT1 HDMI connector to AP's DP1. */
- int hpd = gpio_get_level(GPIO_USB_C1_PPC_INT_ODL);
- gpio_set_level(GPIO_DP1_HPD, hpd);
- ccprints("HDMI HPD %d", hpd);
-}
-DECLARE_DEFERRED(hdmi_hpd_handler);
-
-void hdmi_hpd_interrupt(enum gpio_signal signal)
-{
- /* Debounce for 2 msec. */
- hook_call_deferred(&hdmi_hpd_handler_data, (2 * MSEC));
-}
-
#include "gpio_list.h"
#ifdef HAS_TASK_MOTIONSENSE
@@ -177,63 +144,16 @@ unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors);
#endif /* HAS_TASK_MOTIONSENSE */
-/* These IO expander GPIOs vary with DB option. */
-enum gpio_signal IOEX_USB_A1_RETIMER_EN = IOEX_USB_A1_RETIMER_EN_OPT1;
-enum gpio_signal IOEX_USB_A1_CHARGE_EN_DB_L = IOEX_USB_A1_CHARGE_EN_DB_L_OPT1;
-
-static void pcal6408_handler(void)
-{
- pcal6408_ioex_event_handler(IOEX_HDMI_PCAL6408);
-}
-DECLARE_DEFERRED(pcal6408_handler);
-
-void pcal6408_interrupt(enum gpio_signal signal)
-{
- hook_call_deferred(&pcal6408_handler_data, 0);
-}
-
-/*****************************************************************************
- * Retimers
- */
-
-static void retimers_on(void)
-{
- /* hdmi retimer power on */
- ioex_set_level(IOEX_EN_PWR_HDMI_DB, 1);
-}
-DECLARE_HOOK(HOOK_CHIPSET_RESUME, retimers_on, HOOK_PRIO_DEFAULT);
-
-static void retimers_off(void)
-{
- /* hdmi retimer power off */
- ioex_set_level(IOEX_EN_PWR_HDMI_DB, 0);
-}
-DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, retimers_off, HOOK_PRIO_DEFAULT);
-
-static int board_ps8743_mux_set(const struct usb_mux *me,
- mux_state_t mux_state)
-{
- if (mux_state & USB_PD_MUX_DP_ENABLED)
- /* Enable IN_HPD on the DB */
- ioex_set_level(IOEX_USB_C1_HPD_IN_DB, 1);
- else
- /* Disable IN_HPD on the DB */
- ioex_set_level(IOEX_USB_C1_HPD_IN_DB, 0);
-
- return EC_SUCCESS;
-}
-
-
/*****************************************************************************
* USB-C
*/
/*
- * USB C0 port SBU mux use standalone FSUSB42UMX
+ * USB C0 port SBU mux use standalone PI3USB221
* chip and it need a board specific driver.
* Overall, it will use chained mux framework.
*/
-static int fsusb42umx_set_mux(const struct usb_mux *me, mux_state_t mux_state)
+static int pi3usb221_set_mux(const struct usb_mux *me, mux_state_t mux_state)
{
if (mux_state & USB_PD_MUX_POLARITY_INVERTED)
ioex_set_level(IOEX_USB_C0_SBU_FLIP, 1);
@@ -250,11 +170,11 @@ static int fsusb42umx_set_mux(const struct usb_mux *me, mux_state_t mux_state)
* properly.
*/
const struct usb_mux_driver usbc0_sbu_mux_driver = {
- .set = fsusb42umx_set_mux,
+ .set = pi3usb221_set_mux,
};
/*
- * Since FSUSB42UMX is not a i2c device, .i2c_port and
+ * Since PI3USB221 is not a i2c device, .i2c_port and
* .i2c_addr_flags are not required here.
*/
const struct usb_mux usbc0_sbu_mux = {
@@ -526,41 +446,6 @@ int board_pd_set_frs_enable(int port, int enable)
static void setup_fw_config(void)
{
- uint32_t board_version = 0;
-
- if (cbi_get_board_version(&board_version) == EC_SUCCESS
- && board_version >= 2) {
- ccprints("PS8743 USB MUX");
- usb_muxes[USBC_PORT_C1].i2c_addr_flags = PS8743_I2C_ADDR1_FLAG;
- usb_muxes[USBC_PORT_C1].driver = &ps8743_usb_mux_driver;
- usb_muxes[USBC_PORT_C1].board_set = &board_ps8743_mux_set;
- } else {
- ccprints("PS8740 USB MUX");
- usb_muxes[USBC_PORT_C1].i2c_addr_flags = PS8740_I2C_ADDR0_FLAG;
- usb_muxes[USBC_PORT_C1].driver = &ps8740_usb_mux_driver;
- usb_muxes[USBC_PORT_C1].board_set = NULL;
- }
-
- if (ec_config_get_usb_db() == DALBOZ_DB_D_OPT2_USBA_HDMI) {
- ccprints("DB OPT2 HDMI");
- ioex_config[IOEX_HDMI_PCAL6408].flags = 0;
- ioex_init(IOEX_HDMI_PCAL6408);
- IOEX_USB_A1_RETIMER_EN = IOEX_USB_A1_RETIMER_EN_OPT2;
- IOEX_USB_A1_CHARGE_EN_DB_L = IOEX_USB_A1_CHARGE_EN_DB_L_OPT2;
- usb_port_enable[USBA_PORT_A1] = IOEX_EN_USB_A1_5V_DB_OPT2;
- c1_tcpc_config_interrupt = pcal6408_interrupt;
- c1_ppc_config_interrupt = hdmi_hpd_interrupt;
- } else {
- ccprints("DB OPT1 USBC");
- ioex_config[IOEX_C1_NCT3807].flags = 0;
- ioex_init(IOEX_C1_NCT3807);
- IOEX_USB_A1_RETIMER_EN = IOEX_USB_A1_RETIMER_EN_OPT1;
- IOEX_USB_A1_CHARGE_EN_DB_L = IOEX_USB_A1_CHARGE_EN_DB_L_OPT1;
- usb_port_enable[USBA_PORT_A1] = IOEX_EN_USB_A1_5V_DB_OPT1;
- c1_tcpc_config_interrupt = tcpc_alert_event;
- c1_ppc_config_interrupt = ppc_interrupt;
- }
-
/* Enable PPC interrupts. */
gpio_enable_interrupt(GPIO_USB_C0_PPC_FAULT_ODL);
gpio_enable_interrupt(GPIO_USB_C1_PPC_INT_ODL);
@@ -609,20 +494,13 @@ struct ioexpander_config_t ioex_config[] = {
.i2c_host_port = I2C_PORT_TCPC1,
.i2c_slave_addr = NCT38XX_I2C_ADDR1_1_FLAGS,
.drv = &nct38xx_ioexpander_drv,
- .flags = IOEX_FLAGS_DISABLED,
- },
- [IOEX_HDMI_PCAL6408] = {
- .i2c_host_port = I2C_PORT_TCPC1,
- .i2c_slave_addr = PCAL6408_I2C_ADDR0,
- .drv = &pcal6408_ioexpander_drv,
- .flags = IOEX_FLAGS_DISABLED,
},
};
BUILD_ASSERT(ARRAY_SIZE(ioex_config) == CONFIG_IO_EXPANDER_PORT_COUNT);
int usb_port_enable[USBA_PORT_COUNT] = {
IOEX_EN_USB_A0_5V,
- IOEX_EN_USB_A1_5V_DB_OPT1,
+ IOEX_EN_USB_A1_5V_DB,
};
static void usba_retimer_on(void)
diff --git a/board/dirinboz/board.h b/board/dirinboz/board.h
index d1bfacaf1d..b935115ba4 100644
--- a/board/dirinboz/board.h
+++ b/board/dirinboz/board.h
@@ -97,7 +97,6 @@ enum pwm_channel {
enum ioex_port {
IOEX_C0_NCT3807 = 0,
IOEX_C1_NCT3807,
- IOEX_HDMI_PCAL6408,
IOEX_PORT_COUNT
};
@@ -144,63 +143,27 @@ enum ec_cfg_usb_mb_type {
};
/**
- * DALBOZ_DB_D_OPT1_USBAC
+ * DIRINBOZ_DB_OPT1_USBC
* USB-A1 Speed: 5 Gbps
- * Retimer: TUSB522
+ * Retimer: PS8719
* USB-C1 Speed: 5 Gbps
- * Retimer: PS8740
+ * Retimer: PS8743
* TCPC: NCT3807
* PPC: NX20P3483
* IOEX: TCPC
* HDMI Exists: no
* Retimer: none
* MST Hub: none
- *
- * DALBOZ_DB_D_OPT2_USBA_HDMI
- * USB-A1 Speed: 5 Gbps
- * Retimer: TUSB522
- * USB-C1 none
- * IOEX: PCAL6408
- * HDMI Exists: yes
- * Retimer: PI3HDX1204
- * MST Hub: none
*/
enum ec_cfg_usb_db_type {
- DALBOZ_DB_D_OPT1_USBAC = 0,
- DALBOZ_DB_D_OPT2_USBA_HDMI = 1,
+ DIRINBOZ_DB_OPT1_USBC = 0,
};
-#define HAS_USBC1 \
- (BIT(DALBOZ_DB_D_OPT1_USBAC))
-
-static inline bool ec_config_has_usbc1(void)
-{
- return !!(BIT(ec_config_get_usb_db()) &
- HAS_USBC1);
-}
-
-#define HAS_USBC1_RETIMER_PS8740 \
- (BIT(DALBOZ_DB_D_OPT1_USBAC))
-
-static inline bool ec_config_has_usbc1_retimer_ps8740(void)
-{
- return !!(BIT(ec_config_get_usb_db()) &
- HAS_USBC1_RETIMER_PS8740);
-}
-
-#define HAS_HDMI_RETIMER_PI3HDX1204 \
- (BIT(DALBOZ_DB_D_OPT2_USBA_HDMI))
-
static inline bool ec_config_has_hdmi_retimer_pi3hdx1204(void)
{
- return !!(BIT(ec_config_get_usb_db()) &
- HAS_HDMI_RETIMER_PI3HDX1204);
+ return 0;
}
-/* These IO expander GPIOs vary with DB option. */
-extern enum gpio_signal IOEX_USB_A1_RETIMER_EN;
-extern enum gpio_signal IOEX_USB_A1_CHARGE_EN_DB_L;
-
void board_reset_pd_mcu(void);
/* Common definition for the USB PD interrupt handlers. */
diff --git a/board/dirinboz/gpio.inc b/board/dirinboz/gpio.inc
index eee5f4f761..4b3f58f602 100644
--- a/board/dirinboz/gpio.inc
+++ b/board/dirinboz/gpio.inc
@@ -9,10 +9,9 @@
* Note: Those with interrupt handlers must be declared first. */
GPIO_INT(USB_C0_TCPC_INT_ODL, PIN(3, 4), GPIO_INT_FALLING, tcpc_alert_event)
-GPIO_INT(USB_C1_TCPC_INT_ODL, PIN(F, 1), GPIO_INT_FALLING, c1_tcpc_interrupt)
+GPIO_INT(USB_C1_TCPC_INT_ODL, PIN(F, 1), GPIO_INT_FALLING, tcpc_alert_event)
GPIO_INT(USB_C0_PPC_FAULT_ODL, PIN(6, 3), GPIO_INT_FALLING, ppc_interrupt)
-/* PPC interrupts trigger on falling edge, but HDMI HPD triggers on rising edge. */
-GPIO_INT(USB_C1_PPC_INT_ODL, PIN(D, 4), GPIO_INT_BOTH | GPIO_PULL_UP, c1_ppc_interrupt)
+GPIO_INT(USB_C1_PPC_INT_ODL, PIN(D, 4), GPIO_INT_BOTH | GPIO_PULL_UP, ppc_interrupt)
GPIO_INT(USB_C0_BC12_INT_ODL, PIN(9, 3), GPIO_INT_FALLING | GPIO_PULL_UP, bc12_interrupt)
GPIO_INT(USB_C1_BC12_INT_ODL, PIN(A, 4), GPIO_INT_FALLING | GPIO_PULL_UP, bc12_interrupt)
GPIO_INT(SLP_S3_L, PIN(7, 4), GPIO_INT_BOTH, power_signal_interrupt)
@@ -57,8 +56,8 @@ GPIO(LED_CHRG_L, PIN(C, 0), GPIO_OUT_HIGH)
GPIO(LED3_PWM, PIN(C, 3), GPIO_OUT_HIGH)
/*
- * Dalboz has 2 DB options, with different IO expanders. IOEX_C1_NCT3807 is the
- * OPT1 DB (USB-C1), IOEX_HDMI_PCAL6408 is the OPT2 DB (HDMI).
+ * Dirinboz has 1 DB options.
+ * IOEX_C1_NCT3807 is the DB (USB-C1).
*/
IOEX_INT(USB_C0_SBU_FAULT_ODL, EXPIN(IOEX_C0_NCT3807, 1, 2), GPIO_INT_FALLING, sbu_fault_interrupt)
@@ -73,19 +72,13 @@ IOEX(EN_USB_A0_5V, EXPIN(IOEX_C0_NCT3807, 1, 5), GPIO_OUT_LOW) /* A0 5V Source
IOEX(USB_A0_CHARGE_EN_L, EXPIN(IOEX_C0_NCT3807, 1, 6), GPIO_OUT_HIGH) /* A0 5V High Current Enable */
IOEX(USB_C0_SBU_FLIP, EXPIN(IOEX_C0_NCT3807, 1, 7), GPIO_OUT_LOW) /* C0 SBU Flip */
-IOEX(USB_A1_RETIMER_EN_OPT1, EXPIN(IOEX_C1_NCT3807, 0, 0), GPIO_OUT_LOW) /* A1 Retimer Enable */
+IOEX(USB_A1_RETIMER_EN, EXPIN(IOEX_C1_NCT3807, 0, 0), GPIO_OUT_LOW) /* A1 Retimer Enable */
IOEX(USB_C1_HPD_IN_DB, EXPIN(IOEX_C1_NCT3807, 0, 2), GPIO_OUT_LOW) /* C1 HPD */
IOEX(USB_C1_TCPC_FASTSW_CTL_EN, EXPIN(IOEX_C1_NCT3807, 0, 4), GPIO_OUT_LOW) /* C1 FastSwitch Control */
IOEX(USB_C1_PPC_EN_L, EXPIN(IOEX_C1_NCT3807, 1, 3), GPIO_OUT_LOW) /* C1 PPC Enable */
IOEX(USB_C1_DATA_EN, EXPIN(IOEX_C1_NCT3807, 1, 5), GPIO_OUT_HIGH) /* C1 Retimer Enable */
-IOEX(EN_USB_A1_5V_DB_OPT1, EXPIN(IOEX_C1_NCT3807, 1, 6), GPIO_OUT_LOW) /* A1 5V Source Enable */
-IOEX(USB_A1_CHARGE_EN_DB_L_OPT1,EXPIN(IOEX_C1_NCT3807, 1, 7), GPIO_OUT_HIGH) /* A1 5V High Current Enable */
-
-IOEX(USB_A1_RETIMER_EN_OPT2, EXPIN(IOEX_HDMI_PCAL6408, 0, 0), GPIO_OUT_LOW) /* A1 Retimer Enable */
-IOEX(EN_USB_A1_5V_DB_OPT2, EXPIN(IOEX_HDMI_PCAL6408, 0, 1), GPIO_OUT_LOW) /* A1 5V Source Enable */
-IOEX(USB_A1_CHARGE_EN_DB_L_OPT2,EXPIN(IOEX_HDMI_PCAL6408, 0, 2), GPIO_OUT_HIGH) /* A1 5V High Current Enable */
-IOEX(HDMI_DATA_EN_DB, EXPIN(IOEX_HDMI_PCAL6408, 0, 3), GPIO_OUT_HIGH) /* HDMI Retimer Enable */
-IOEX(EN_PWR_HDMI_DB, EXPIN(IOEX_HDMI_PCAL6408, 0, 5), GPIO_OUT_LOW) /* HDMI Retimer Power Enable */
+IOEX(EN_USB_A1_5V_DB, EXPIN(IOEX_C1_NCT3807, 1, 6), GPIO_OUT_LOW) /* A1 5V Source Enable */
+IOEX(USB_A1_CHARGE_EN_DB_L,EXPIN(IOEX_C1_NCT3807, 1, 7), GPIO_OUT_HIGH) /* A1 5V High Current Enable */
/*
* The NPCX LPC driver configures and controls SCI, so PCH_SCI_ODL [PIN(7, 6)]