diff options
author | Tom Hughes <tomhughes@chromium.org> | 2021-01-28 13:53:45 -0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-01-30 00:44:30 +0000 |
commit | d835a61ba28a7340dce0a702aabb4fe793f6e0a8 (patch) | |
tree | a344c9567e067f72dc2d36b6900d59e8183acc12 /board/nocturne_fp/gpio_rw.inc | |
parent | c1b5095aa8404709bb447bd7a58f262d7d471a01 (diff) | |
download | chrome-ec-d835a61ba28a7340dce0a702aabb4fe793f6e0a8.tar.gz |
dartmonkey: Refactor GPIOs to keep RO minimal
We want the amount of code and number of things defined in RO to be as
minimal as possible since RO is frozen forever. By keeping RO minimal,
we can reduce surface area for attacks and also confusion when GPIOs are
removed or renamed.
The fingerprint-related code only runs in RW, so move all
fingerprint-related GPIOs and associated code into separate files that
are only included in RW.
BRANCH=none
BUG=b:175115925, b:178746753, b:b:177908650
TEST=Flash on icetower v0.1, verify sensor shows up (with SPI_SEL change)
TEST=Flash on nocturne, enroll, lock, unlock
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: Id59d4cd8011012ba4fd6823e1464c661784d4689
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2657778
Reviewed-by: Craig Hesling <hesling@chromium.org>
Diffstat (limited to 'board/nocturne_fp/gpio_rw.inc')
-rw-r--r-- | board/nocturne_fp/gpio_rw.inc | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/board/nocturne_fp/gpio_rw.inc b/board/nocturne_fp/gpio_rw.inc new file mode 100644 index 0000000000..a2032271bc --- /dev/null +++ b/board/nocturne_fp/gpio_rw.inc @@ -0,0 +1,38 @@ +/* + * Copyright 2021 The Chromium OS Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#ifndef SECTION_IS_RW +#error "This file should only be included in RW." +#endif + +/* Interrupts */ +GPIO_INT(FPS_INT, PIN(A, 0), GPIO_INT_RISING, fps_event) +GPIO_INT(PCH_SLP_S0_L, PIN(D,13), GPIO_INT_BOTH, slp_event) +GPIO_INT(PCH_SLP_S3_L, PIN(A,11), GPIO_INT_BOTH, slp_event) + +#ifdef APPLY_RESET_LOOP_FIX +GPIO_INT(WP, PIN(B, 7), GPIO_INT_BOTH, wp_event) +#endif + +/* Inputs */ +/* + * The S4 and SUS sleep lines are unused in code, but are maintained in this + * gpio list to ensure that they are not repurposed. This is because these + * inputs are driven on nocturne. + */ +GPIO(PCH_SLP_S4_L, PIN(D, 8), GPIO_INPUT) +GPIO(PCH_SLP_SUS_L, PIN(D, 3), GPIO_INPUT) +/* TODO(b/178808871): Only enable pull up when doing detection. */ +GPIO(FP_SPI_SEL, PIN(E, 1), GPIO_INPUT | GPIO_PULL_UP) + +/* Outputs */ +GPIO(DIVIDER_HIGHSIDE, PIN(B, 8), GPIO_OUT_LOW) +GPIO(FP_RST_ODL, PIN(E, 0), GPIO_OUT_HIGH) +GPIO(SPI4_NSS, PIN(E, 4), GPIO_OUT_HIGH) +GPIO(USER_PRES_L, PIN(C, 5), GPIO_ODR_HIGH) + +/* SPI4 master to sensor: PE2/5/6 (CLK/MISO/MOSI) */ +ALTERNATE(PIN_MASK(E, 0x0064), GPIO_ALT_SPI, MODULE_SPI_MASTER, 0) |