Snappy: Recondition USB3.0 RX

The loss between PS8751 and Type-C connector is large and requires
a larger EQ and low squelch threshold for compensation.

- USB Type-c connector facing receiver equalization setting:
	Compensate for channel loss up to 10.9dB
- High Speed Signal Detector threshold adjustment: -25%

BUG=chrome-os-partner:61101
BRANCH=none
TEST=Boot & charge

Change-Id: Ie74e2d0b8ad7206f5e60fb013613c382980c0eac
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/433846
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
This commit is contained in:
Daisuke Nojiri
2017-01-26 16:42:21 -08:00
committed by chrome-bot
parent 60f008c7af
commit 591eec2cd2
3 changed files with 21 additions and 3 deletions

View File

@@ -225,8 +225,10 @@ const int i2c_test_dev_used = ARRAY_SIZE(i2c_stress_tests);
#endif /* CONFIG_CMD_I2C_STRESS_TEST */
const struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_COUNT] = {
{NPCX_I2C_PORT0_0, 0x50, &anx74xx_tcpm_drv, TCPC_ALERT_ACTIVE_LOW},
{NPCX_I2C_PORT0_1, 0x16, &tcpci_tcpm_drv, TCPC_ALERT_ACTIVE_LOW},
{NPCX_I2C_PORT0_0, TCPC_PORT0_I2C_ADDR, &anx74xx_tcpm_drv,
TCPC_ALERT_ACTIVE_LOW},
{NPCX_I2C_PORT0_1, TCPC_PORT1_I2C_ADDR, &tcpci_tcpm_drv,
TCPC_ALERT_ACTIVE_LOW},
};
uint16_t tcpc_get_alert_status(void)
@@ -254,6 +256,16 @@ const enum gpio_signal hibernate_wake_pins[] = {
const int hibernate_wake_pins_used = ARRAY_SIZE(hibernate_wake_pins);
static int ps8751_tune_mux(const struct usb_mux *mux)
{
/* Snappy specific signal reconditioning */
i2c_write8(mux->port_addr, TCPC_PORT1_I2C_ADDR,
PS8751_REG_MUX_USB_C2SS_EQ, 0x50);
i2c_write8(mux->port_addr, TCPC_PORT1_I2C_ADDR,
PS8751_REG_MUX_USB_C2SS_HS_THRESHOLD, 0x80);
return EC_SUCCESS;
}
struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_COUNT] = {
{
.port_addr = 0, /* don't care / unused */
@@ -261,9 +273,10 @@ struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_COUNT] = {
.hpd_update = &anx74xx_tcpc_update_hpd_status,
},
{
.port_addr = 1,
.port_addr = 1, /* port # not i2c address */
.driver = &tcpci_tcpm_usb_mux_driver,
.hpd_update = &ps8751_tcpc_update_hpd_status,
.board_init = &ps8751_tune_mux,
}
};

View File

@@ -324,6 +324,9 @@ void board_reset_pd_mcu(void);
int board_get_version(void);
#define TCPC_PORT0_I2C_ADDR 0x50
#define TCPC_PORT1_I2C_ADDR 0x16
void board_set_tcpc_power_mode(int port, int mode);
void board_print_tcpc_fw_version(int port);

View File

@@ -18,6 +18,8 @@
#define PS8751_REG_CTRL_1 0xD0
#define PS8751_REG_CTRL_1_HPD (1 << 0)
#define PS8751_REG_CTRL_1_IRQ (1 << 1)
#define PS8751_REG_MUX_USB_C2SS_EQ 0xe7
#define PS8751_REG_MUX_USB_C2SS_HS_THRESHOLD 0xe8
void ps8751_tcpc_update_hpd_status(int port, int hpd_lvl, int hpd_irq);
int ps8751_tcpc_get_fw_version(int port, int *version);