summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAseda Aboagye <aaboagye@google.com>2021-02-24 16:30:15 -0800
committerAseda Aboagye <aaboagye@chromium.org>2021-02-25 00:48:54 +0000
commit7c09def584ff3bccbd5916b02f7ff7da234be13c (patch)
tree41c740fdf9ea7b8bfeae95e391566bf5b785dc0f
parentf53280aae9db6fd71f4986d2b3c6ab10a84afc83 (diff)
downloadchrome-ec-7c09def584ff3bccbd5916b02f7ff7da234be13c.tar.gz
draw*: Add GPIO_EC_ENTERING_RW2
This commit adds a new GPIO, GPIO_EC_ENTERING_RW2 which does the same thing as GPIO_EC_ENTERING_RW. However, it's on a pin that's more well behaved around init time. This commit also overrides the board_pulse_ec_entering_rw() function such that both lines can be pulsed. BUG=b:180965428,b:181051734,b:181085178 BRANCH=dedede TEST=Build and flash draw*, verify it boots. Signed-off-by: Aseda Aboagye <aaboagye@google.com> Change-Id: Ia9cfba97b8fcad5975e412523686a7ba53ea7399 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2719104 Reviewed-by: Diana Z <dzigterman@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org>
-rw-r--r--board/drawcia/board.c15
-rw-r--r--board/drawcia/gpio.inc1
2 files changed, 16 insertions, 0 deletions
diff --git a/board/drawcia/board.c b/board/drawcia/board.c
index f160335e53..e1f91871dd 100644
--- a/board/drawcia/board.c
+++ b/board/drawcia/board.c
@@ -450,6 +450,21 @@ __override void board_ocpc_init(struct ocpc_data *ocpc)
ocpc->chg_flags[CHARGER_SECONDARY] |= OCPC_NO_ISYS_MEAS_CAP;
}
+__override void board_pulse_entering_rw(void)
+{
+ /*
+ * On the ITE variants, the EC_ENTERING_RW signal was connected to a pin
+ * which is active high by default. This causes Cr50 to think that the
+ * EC has jumped to its RW image even though this may not be the case.
+ * The pin is changed to GPIO_EC_ENTERING_RW2.
+ */
+ gpio_set_level(GPIO_EC_ENTERING_RW, 1);
+ gpio_set_level(GPIO_EC_ENTERING_RW2, 1);
+ usleep(MSEC);
+ gpio_set_level(GPIO_EC_ENTERING_RW, 0);
+ gpio_set_level(GPIO_EC_ENTERING_RW2, 0);
+}
+
void board_reset_pd_mcu(void)
{
/*
diff --git a/board/drawcia/gpio.inc b/board/drawcia/gpio.inc
index 429b952eef..890b6ee9e4 100644
--- a/board/drawcia/gpio.inc
+++ b/board/drawcia/gpio.inc
@@ -98,6 +98,7 @@ GPIO(EC_SUB_IO_2_1, PIN(F, 1), GPIO_INPUT)
/* Misc */
GPIO(EN_BL_OD, PIN(K, 4), GPIO_ODR_LOW)
GPIO(EC_ENTERING_RW, PIN(G, 0), GPIO_OUT_LOW)
+GPIO(EC_ENTERING_RW2, PIN(C, 7), GPIO_OUT_LOW)
GPIO(CCD_MODE_ODL, PIN(H, 5), GPIO_INPUT)
GPIO(EC_BATTERY_PRES_ODL, PIN(I, 4), GPIO_INPUT)
GPIO(EN_KB_BL, PIN(J, 3), GPIO_OUT_LOW) /* Currently unused */