summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYu-An Chen <yu-an.chen@quanta.corp-partner.google.com>2021-07-29 19:12:32 +0800
committerCommit Bot <commit-bot@chromium.org>2021-08-18 01:53:06 +0000
commit3ce7fec56c754fcf9eb3b145bce4d7697d7e6b9d (patch)
treea35a238951cf104603c19cd2d56e838970c04032
parent525d9260a92e8c654ce26137b06ed92da3618c0a (diff)
downloadchrome-ec-3ce7fec56c754fcf9eb3b145bce4d7697d7e6b9d.tar.gz
Chronicler: Update usb3 signal setting
Update usb3 signal setting BUG=b:194985848 BRANCH=volteer TEST=make BOARD=chronicler Signed-off-by: Yu-An Chen <yu-an.chen@quanta.corp-partner.google.com> Change-Id: I929ca1af7105b53f92c80c7e478e1815965daa00 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3060351 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
-rw-r--r--board/chronicler/usbc_config.c63
1 files changed, 63 insertions, 0 deletions
diff --git a/board/chronicler/usbc_config.c b/board/chronicler/usbc_config.c
index 1fec96a2a3..60e898aacc 100644
--- a/board/chronicler/usbc_config.c
+++ b/board/chronicler/usbc_config.c
@@ -17,6 +17,7 @@
#include "driver/ppc/sn5s330_public.h"
#include "driver/ppc/syv682x_public.h"
#include "driver/retimer/bb_retimer_public.h"
+#include "driver/retimer/ps8811.h"
#include "driver/tcpm/ps8xxx_public.h"
#include "driver/tcpm/rt1715_public.h"
#include "driver/tcpm/tusb422_public.h"
@@ -312,6 +313,68 @@ static void ps8815_reset(void)
CPRINTS("ps8815: reg 0x0f now %02x", val);
}
+static void ps8815_setup_eq(void)
+{
+ int rv;
+
+ /* TX1 EQ 19db / TX2 EQ 19db */
+ rv = i2c_write8(tcpc_config[USBC_PORT_C1].i2c_info.port,
+ tcpc_config[USBC_PORT_C1].i2c_info.addr_flags, 0x20, 0x77);
+
+ /* RX1 EQ 12db / RX2 EQ 13db */
+ rv |= i2c_write8(tcpc_config[USBC_PORT_C1].i2c_info.port,
+ tcpc_config[USBC_PORT_C1].i2c_info.addr_flags, 0x22, 0x32);
+
+ /* Swing level for upstream port output */
+ rv |= i2c_write8(tcpc_config[USBC_PORT_C1].i2c_info.port,
+ tcpc_config[USBC_PORT_C1].i2c_info.addr_flags, 0xc4, 0x03);
+
+ if (rv)
+ CPRINTS("%s fail!", __func__);
+}
+
+static void ps8811_setup_eq(void)
+{
+ int rv;
+
+ /* AEQ 12db */
+ rv = i2c_write8(I2C_PORT_USB_1_MIX,
+ PS8811_I2C_ADDR_FLAGS0 + PS8811_REG_PAGE1, 0x01, 0x26);
+ /* ADE 2.1db */
+ rv |= i2c_write8(I2C_PORT_USB_1_MIX,
+ PS8811_I2C_ADDR_FLAGS0 + PS8811_REG_PAGE1, 0x02, 0x60);
+ /* BEQ 10.5db */
+ rv |= i2c_write8(I2C_PORT_USB_1_MIX,
+ PS8811_I2C_ADDR_FLAGS0 + PS8811_REG_PAGE1, 0x05, 0x16);
+ /* BDE 2.1db */
+ rv |= i2c_write8(I2C_PORT_USB_1_MIX,
+ PS8811_I2C_ADDR_FLAGS0 + PS8811_REG_PAGE1, 0x06, 0x63);
+ /* Channel A swing level */
+ rv |= i2c_write8(I2C_PORT_USB_1_MIX,
+ PS8811_I2C_ADDR_FLAGS0 + PS8811_REG_PAGE1, 0x66, 0x20);
+ /* Channel B swing level */
+ rv |= i2c_write8(I2C_PORT_USB_1_MIX,
+ PS8811_I2C_ADDR_FLAGS0 + PS8811_REG_PAGE1, 0xa4, 0x03);
+ /* PS level foe B channel */
+ rv |= i2c_write8(I2C_PORT_USB_1_MIX,
+ PS8811_I2C_ADDR_FLAGS0 + PS8811_REG_PAGE1, 0xa5, 0x83);
+ /* DE level foe B channel */
+ rv |= i2c_write8(I2C_PORT_USB_1_MIX,
+ PS8811_I2C_ADDR_FLAGS0 + PS8811_REG_PAGE1, 0xa6, 0x14);
+
+ if (rv)
+ CPRINTS("%s fail!", __func__);
+}
+
+/* Called on AP S5 -> S0 transition */
+void board_ps8xxx_init(void)
+{
+ CPRINTS("%s", __func__);
+ ps8815_setup_eq();
+ ps8811_setup_eq();
+}
+DECLARE_HOOK(HOOK_CHIPSET_STARTUP, board_ps8xxx_init, HOOK_PRIO_LAST);
+
void board_reset_pd_mcu(void)
{
enum ec_cfg_usb_db_type usb_db = ec_cfg_usb_db_type();