summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLu Zhang <lu.zhang@bitland.corp-partner.google.com>2019-09-28 17:07:25 +0800
committerCommit Bot <commit-bot@chromium.org>2019-10-15 15:46:46 +0000
commit404b41004f927f97cd2a805026c18348d9de9430 (patch)
tree6638426af053bac852f9630246996db8f8db72a7
parentfb9d900c7e349d82d3cfddcfb53a3a8416de7666 (diff)
downloadchrome-ec-404b41004f927f97cd2a805026c18348d9de9430.tar.gz
treeya: apply USB EQ setting to PS8751 USB mux
The default USB TYPE C connector facing receiver equalization setting is 0x90, compensate for channel loss up to 15.4dB It's high for some dongles. Apply lower USB EQ to 8.7dB BUG=b:140472120 BRANCH=none TEST=build and boot on, read back registers to verify > ectool i2cread 8 2 0x16 0xe7 0x40 Signed-off-by: Lu Zhang <lu.zhang@bitland.corp-partner.google.com> Change-Id: I1fce255d0dbe8c5a12cf8c8ff5b3c506e8d19475 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1830538 Reviewed-by: Edward Hill <ecgh@chromium.org> Reviewed-by: Paul Ma <magf@bitland.corp-partner.google.com> Tested-by: Paul Ma <magf@bitland.corp-partner.google.com> (cherry picked from commit c469aa1bcbef30ee57f12e4f99799ca8b95d576c) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1862871 Commit-Queue: Edward Hill <ecgh@chromium.org>
-rw-r--r--baseboard/grunt/baseboard.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/baseboard/grunt/baseboard.c b/baseboard/grunt/baseboard.c
index 8350f3a060..a86246f65e 100644
--- a/baseboard/grunt/baseboard.c
+++ b/baseboard/grunt/baseboard.c
@@ -277,6 +277,17 @@ void board_reset_pd_mcu(void)
#endif
}
+static uint32_t sku_id;
+
+static int ps8751_tune_mux(int port)
+{
+ /* Tune USB mux registers for treeya's port 1 Rx measurement */
+ if ((sku_id >= 0xa0) && (sku_id <= 0xaf))
+ mux_write(port, PS8XXX_REG_MUX_USB_C2SS_EQ, 0x40);
+
+ return EC_SUCCESS;
+}
+
struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_COUNT] = {
#ifdef VARIANT_GRUNT_TCPC_0_ANX3429
[USB_PD_PORT_ANX74XX] = {
@@ -292,6 +303,7 @@ struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_COUNT] = {
[USB_PD_PORT_PS8751] = {
.driver = &tcpci_tcpm_usb_mux_driver,
.hpd_update = &ps8xxx_tcpc_update_hpd_status,
+ .board_init = &ps8751_tune_mux,
}
};
@@ -700,7 +712,6 @@ static int board_get_gpio_board_version(void)
}
static int board_version;
-static uint32_t sku_id;
static void cbi_init(void)
{