diff options
author | James_Chao <james_chao@asus.corp-partner.google.com> | 2018-11-20 19:49:34 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-12-03 16:41:01 -0800 |
commit | 1585c6fc50ddb8e070445c32d083c15d138536a1 (patch) | |
tree | 3762c8300a680c4ce39ae3bee05f5f05cf739429 /board/ampton | |
parent | f556c986d1bf6688adceaaeeb18a272a5231b7ec (diff) | |
download | chrome-ec-1585c6fc50ddb8e070445c32d083c15d138536a1.tar.gz |
Ampton: change the port0 mux to PS8751
Due to the DP measurement eye-diagram and pre-emphasize fail, we change
the mux to PS8751 on the type-c port in mainboard.
BUG=b:118728290,b:119840612
BRANCH=octopus
TEST=FAFT pass and check the mux function working on EVT.
Change-Id: I1817686f09f6aa9a557907b279ab61c889335d9e
Signed-off-by: James_Chao <james_chao@asus.corp-partner.google.com>
Reviewed-on: https://chromium-review.googlesource.com/1343642
Commit-Ready: James Chao <james_chao@asus.corp-partner.google.com>
Tested-by: James Chao <james_chao@asus.corp-partner.google.com>
Reviewed-by: Jett Rink <jettrink@chromium.org>
Reviewed-by: Diana Z <dzigterman@chromium.org>
Diffstat (limited to 'board/ampton')
-rw-r--r-- | board/ampton/board.c | 38 | ||||
-rw-r--r-- | board/ampton/gpio.inc | 2 |
2 files changed, 39 insertions, 1 deletions
diff --git a/board/ampton/board.c b/board/ampton/board.c index 7f4b7b07b3..065aea53f2 100644 --- a/board/ampton/board.c +++ b/board/ampton/board.c @@ -60,6 +60,31 @@ int ppc_get_alert_status(int port) #include "gpio_list.h" /* Must come after other header files. */ /******************************************************************************/ +/* USB-C MUX Configuration */ + +#define USB_PD_PORT_ITE_0 0 +#define USB_PD_PORT_ITE_1 1 + +struct usb_mux ampton_usb_muxes[CONFIG_USB_PD_PORT_COUNT] = { + [USB_PD_PORT_ITE_0] = { + /* Use PS8751 as mux only */ + .port_addr = MUX_PORT_AND_ADDR( + I2C_PORT_USBC0, PS8751_I2C_ADDR1), + .flags = USB_MUX_FLAG_NOT_TCPC, + .driver = &tcpci_tcpm_usb_mux_driver, + .hpd_update = &ps8xxx_tcpc_update_hpd_status, + }, + [USB_PD_PORT_ITE_1] = { + /* Use PS8751 as mux only */ + .port_addr = MUX_PORT_AND_ADDR( + I2C_PORT_USBC1, PS8751_I2C_ADDR1), + .flags = USB_MUX_FLAG_NOT_TCPC, + .driver = &tcpci_tcpm_usb_mux_driver, + .hpd_update = &ps8xxx_tcpc_update_hpd_status, + } +}; + +/******************************************************************************/ /* ADC channels */ const struct adc_t adc_channels[] = { /* Vbus C0 sensing (10x voltage divider). PPVAR_USB_C0_VBUS */ @@ -226,6 +251,14 @@ static void board_update_sensor_config_from_sku(void) } } +static void board_customize_usbc_mux(uint32_t board_version) +{ + if (board_version > 0) { + /* not proto, override the mux setting */ + memcpy(usb_muxes, ampton_usb_muxes, sizeof(ampton_usb_muxes)); + } +} + /* Read CBI from i2c eeprom and initialize variables for board variants */ static void cbi_init(void) { @@ -237,6 +270,11 @@ static void cbi_init(void) ccprints("SKU: %d", sku_id); board_update_sensor_config_from_sku(); + + if (cbi_get_board_version(&val) != EC_SUCCESS) + return; + ccprints("Board version: %d", val); + board_customize_usbc_mux(val); } DECLARE_HOOK(HOOK_INIT, cbi_init, HOOK_PRIO_INIT_I2C + 1); diff --git a/board/ampton/gpio.inc b/board/ampton/gpio.inc index a6c293eee2..2988ed44b0 100644 --- a/board/ampton/gpio.inc +++ b/board/ampton/gpio.inc @@ -101,6 +101,7 @@ GPIO(USB_C0_BC12_CHG_DET_L, PIN(A, 0), GPIO_INPUT) /* C0 BC1.2 Detect */ GPIO(USB_C1_BC12_CHG_DET_L, PIN(I, 0), GPIO_INPUT) /* C1 BC1.2 Detect */ GPIO(USB_C0_BC12_VBUS_ON, PIN(J, 4), GPIO_OUT_LOW) /* C0 BC1.2 Power */ GPIO(USB_C1_BC12_VBUS_ON, PIN(J, 5), GPIO_OUT_LOW) /* C1 BC1.2 Power */ +GPIO(USB_C0_PD_RST_ODL, PIN(L, 6), GPIO_ODR_HIGH) /* C0 PD Reset */ GPIO(USB_C1_PD_RST_ODL, PIN(L, 7), GPIO_ODR_HIGH) /* C1 PD Reset */ GPIO(CCD_MODE_ODL, PIN(C, 4), GPIO_INPUT) @@ -122,7 +123,6 @@ GPIO(GPIOG1_NC, PIN(G, 1), GPIO_INPUT | GPIO_PULL_DOWN) GPIO(GPIOH0_NC, PIN(H, 0), GPIO_INPUT | GPIO_PULL_DOWN) GPIO(GPIOL2_NC, PIN(L, 2), GPIO_INPUT | GPIO_PULL_DOWN) GPIO(GPIOL3_NC, PIN(L, 3), GPIO_INPUT | GPIO_PULL_DOWN) -GPIO(GPIOL6_NC, PIN(L, 6), GPIO_INPUT | GPIO_PULL_DOWN) GPIO(GPIOM6_NC, PIN(M, 6), GPIO_INPUT | GPIO_PULL_DOWN) GPIO(GPIOD3_NC, PIN(D, 3), GPIO_INPUT | GPIO_PULL_DOWN) GPIO(GPIOI1_NC, PIN(I, 1), GPIO_INPUT | GPIO_PULL_DOWN) |