summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorPatryk Duda <pdk@semihalf.com>2021-07-09 13:37:37 +0200
committerCommit Bot <commit-bot@chromium.org>2021-07-16 09:28:42 +0000
commit7b139d1d2f8d78fdfe05a108b97b13ef8b73852c (patch)
tree0f06a3d5a9ac64597ba828e3c733bcf4f07cac0a /board
parenta4e494dabda23e842a6861506af43c265a0bf7b5 (diff)
downloadchrome-ec-7b139d1d2f8d78fdfe05a108b97b13ef8b73852c.tar.gz
hatch_fp/board_rw: Explicitly reset FP_RST_ODL to default on RW init
FP_RST_ODL pin is only defined in gpio_rw.inc, so this pin won't be initialized to 1 by RO. Also, RW won't set this pin because sysjump to RW is a warm reset actually and we are not setting GPIO pins to their defaults after the warm reset to avoid undesired effects (see gpio_pre_init() in chip/stm32/gpio.c). As a result fpsensor_hw hardware unit test was not working, because FPMCU was keeping sensor in reset. Build with FP private driver is working because the driver performs sensor reset during initialization. BUG=b:170432597 BRANCH=none TEST=`make BOARD=bloonchipper` Signed-off-by: Patryk Duda <pdk@semihalf.com> Change-Id: Ib88d1965dc1410c08c3e3a51ad4f90d27f8ea1b0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3017987 Reviewed-by: Craig Hesling <hesling@chromium.org>
Diffstat (limited to 'board')
-rw-r--r--board/hatch_fp/board_rw.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/board/hatch_fp/board_rw.c b/board/hatch_fp/board_rw.c
index 6b8cc34e30..6e6b50b47c 100644
--- a/board/hatch_fp/board_rw.c
+++ b/board/hatch_fp/board_rw.c
@@ -83,6 +83,15 @@ void board_init_rw(void)
{
enum fp_transport_type ret_transport = get_fp_transport_type();
+ /*
+ * FP_RST_ODL pin is defined in gpio_rw.inc (with GPIO_OUT_HIGH
+ * flag) but not in gpio.inc, so RO leaves this pin set to 0 (reset
+ * default), but RW doesn't initialize this pin to 1 because sysjump
+ * to RW is a warm reset (see gpio_pre_init() in chip/stm32/gpio.c).
+ * Explicitly reset FP_RST_ODL pin to default value.
+ */
+ gpio_reset(GPIO_FP_RST_ODL);
+
if (ret_transport == FP_TRANSPORT_TYPE_UART) {
/*
* The Zork variants currently have a broken SLP_S0_L signal