summaryrefslogtreecommitdiff
path: root/board/tglrvpu_ite
diff options
context:
space:
mode:
authorVijay Hiremath <vijay.p.hiremath@intel.com>2020-08-18 12:01:01 -0700
committerCommit Bot <commit-bot@chromium.org>2020-08-19 23:59:28 +0000
commit386b25657e3a2224d0dbecbaafeec54ab9ea1f73 (patch)
tree77b4b08928b2630a375851b214d361141abbc79e /board/tglrvpu_ite
parentbb20158f5c2c837a6e780672add4fd49bebb833c (diff)
downloadchrome-ec-386b25657e3a2224d0dbecbaafeec54ab9ea1f73.tar.gz
BB retimer: Remove FORCE_PWR GPIO from EC driver
FORCE_PWR GPIO is used for keeping the BB retimer in active state during f/w updating. On TGLRVP, control to enable the FORCE_PWR GPIO was given to EC to support the I2C based F/W updating. I2C based f/w updating is deprecated and the LSx interface is POR hence the FORCE_PWR GPIO control is given to AP now. Thus, removing the FORCE_PWR GPIO from EC driver. BUG=b:165214747 BRANCH=none TEST=make buildall -j Change-Id: If9bb7199a68c93f704f698552e5594a58bd68f7c Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2363334 Reviewed-by: Ayushee Shah <ayushee.shah@intel.com> Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'board/tglrvpu_ite')
-rw-r--r--board/tglrvpu_ite/board.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/board/tglrvpu_ite/board.c b/board/tglrvpu_ite/board.c
index 888b893d03..aa4ff77e96 100644
--- a/board/tglrvpu_ite/board.c
+++ b/board/tglrvpu_ite/board.c
@@ -5,6 +5,7 @@
/* Intel TGL-U-RVP-ITE board-specific configuration */
+#include "bb_retimer.h"
#include "button.h"
#include "charger.h"
#include "driver/charger/isl9241.h"
@@ -155,3 +156,46 @@ int board_get_version(void)
return board_id | (fab_id << 8);
}
+
+__override void bb_retimer_power_handle(const struct usb_mux *me, int on_off)
+{
+ const struct bb_usb_control *control = &bb_controls[me->usb_port];
+
+ /*
+ * LSx based F/W updating is a POR, however to avoid the rework on
+ * RVP retain the FORCE_PWR GPIO with EC.
+ */
+ enum gpio_signal force_power_gpio = me->usb_port ?
+ GPIO_USB_C1_RETIMER_FORCE_PWR : GPIO_USB_C0_RETIMER_FORCE_PWR;
+
+ /* handle retimer's power domain */
+ if (on_off) {
+ gpio_set_level(control->usb_ls_en_gpio, 1);
+ /*
+ * Tpw, minimum time from VCC to RESET_N de-assertion is 100us.
+ * For boards that don't provide a load switch control, the
+ * retimer_init() function ensures power is up before calling
+ * this function.
+ */
+ msleep(1);
+ gpio_set_level(control->retimer_rst_gpio, 1);
+ msleep(10);
+ gpio_set_level(force_power_gpio, 1);
+
+ /*
+ * If BB retimer NVM is shared between multiple ports, allow
+ * 40ms time for all the retimers to be initialized.
+ * Else allow 20ms to initialize.
+ */
+ if (control->shared_nvm)
+ msleep(40);
+ else
+ msleep(20);
+ } else {
+ gpio_set_level(force_power_gpio, 0);
+ msleep(1);
+ gpio_set_level(control->retimer_rst_gpio, 0);
+ msleep(1);
+ gpio_set_level(control->usb_ls_en_gpio, 0);
+ }
+}