summaryrefslogtreecommitdiff
path: root/board/hatch_fp/gpio.inc
Commit message (Collapse)AuthorAgeFilesLines
* bloonchipper: Refactor GPIOs to keep RO minimalTom Hughes2021-02-121-14/+4
| | | | | | | | | | | | | | | | | | | | | | | 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:178746753 TEST=On dragonclaw v0.2 with servo micro and jtrace, verify sensor ID shows on console TEST=On dragonair, test fingerprint enroll and unlock TEST=On morphius, test fingerprint enroll and unlock Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: Ia6791666b57ed9be81230d8a5f77d874f56da5a4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2673909 Reviewed-by: Craig Hesling <hesling@chromium.org>
* bloonchipper: Comment cleanupCraig Hesling2020-12-171-2/+2
| | | | | | | | | | | | | | | No code change. BRANCH=none BUG=none TEST=none Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: I6f64cf7980a00093c8403e83309988e3c00ba5c0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2587568 Reviewed-by: Yicheng Li <yichengli@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org> Commit-Queue: Tom Hughes <tomhughes@chromium.org>
* Bloonchipper: Change console from uart1 to uart2Bhanu Prakash Maiya2020-05-061-3/+3
| | | | | | | | | | | | | | | | | | Bloonchipper uses both uart ports on STM32. Debug console should now work on uart2 which is connected to servo connector. BRANCH=none BUG=b:147849609 TEST=Access console on uart2. Signed-off-by: Bhanu Prakash Maiya <bhanumaiya@google.com> Change-Id: I26b7989051404224f9bf608ce02d35af2bb566f1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2133589 Reviewed-by: Craig Hesling <hesling@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org> Tested-by: Bhanu Prakash Maiya <bhanumaiya@chromium.org> Auto-Submit: Bhanu Prakash Maiya <bhanumaiya@chromium.org> Commit-Queue: Tom Hughes <tomhughes@chromium.org>
* bloonchipper: Enable pulldown on SPI masterCraig Hesling2020-05-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | This enables the internal pulldown for the SPI master's CLK, MISO, and MOSI lines to the fingerprint sensor. The specific issue this is assumed to fix is the SPI CLK's idle state before signaling and idle state after signaling. This issue is hinted to in the STM32F412's reference manual by the following note: """ The idle state of SCK must correspond to the polarity selected in the SPIx_CR1 register (by pulling up SCK if CPOL=1 or pulling down SCK if CPOL=0). """ BRANCH=none BUG=b:151190204 TEST=Test sensor version, fpenroll, and fpmatch on dragonclaw dev board TEST=# On Dratini w/fingerprint # Test enroll and match time for i in {1..10000}; do out=$(ectool --name=cros_fp fpinfo | awk '/Fingerprint sensor/{print $7 " " $8}'); echo "Iter $i: '$out'"; if [[ "$out" != "model 21f" ]]; then echo "# FAIL !"; break; fi; done | tee ~/log.txt Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: If5c9ce9e4e0c565959c4768b19ac002175c71c8a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2148012 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* hatch_fp: Better comments for pin configCraig Hesling2020-01-101-3/+3
| | | | | | | | | | | BRANCH=nocturne,hatch BUG=none TEST=none Change-Id: I1b1e994d7e8e74c298f2452b7eaf1a567d387dc0 Signed-off-by: Craig Hesling <hesling@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1991997 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* bloonchipper: Update GPIOs for Hatch 3.0 designTom Hughes2020-01-031-7/+9
| | | | | | | | | | | | | | | Based on the following schematics: https://ee-schematics.teams.x20web.corp.google.com/hatch/hatch_p0/hatch_p0_499d1e339869c92d67ea9077ba35b66a6c103e1c.html BRANCH=none BUG=b:145847137 TEST=none Change-Id: I29c5ec5abb9bdf7650c5a1eb190309c6ea85bfce Signed-off-by: Tom Hughes <tomhughes@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1972376 Commit-Queue: Craig Hesling <hesling@chromium.org> Reviewed-by: Craig Hesling <hesling@chromium.org>
* hatch_fp: Move SLP_S0_L for Hatch Rev 2.8Craig Hesling2019-11-081-2/+2
| | | | | | | | | | | | | | | | | | | | | Previous schematic was Hatch Rev 2.6 (commit e36c8b3683475b853c21564ddabc3ec90ee64f75 in hatch ee-git): http://go/hatch-schematic-rev-2.6 New schematic is Hatch Rev 2.8 (commit defe790e8d1c863de2ec04ee50f285e270038848 in hatch ee-git): http://go/hatch-schematic-rev-2.8 BRANCH=none BUG=b:144004439 TEST=make buildall -j Change-Id: Ia40c4149f9c9d68c39e8235fec9a949347ed9c27 Signed-off-by: Tom Hughes <tomhughes@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1904652 Tested-by: Craig Hesling <hesling@chromium.org> Reviewed-by: Craig Hesling <hesling@chromium.org> Commit-Queue: Craig Hesling <hesling@chromium.org>
* hatch_fp: Switch to UNUSED pins mechanismCraig Hesling2019-11-081-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This CL enables UNUSED pins for hatch_fp. This places the unused/unconnected pins in the lowest power state. Using the UNUSED pins mechanism should be functionally equivalent to the previous method of declaring these pins as analog inputs. See crrev.com/c/1894242 for implementation details. BRANCH=nocturne,hatch BUG=b:130561737 TEST=make buildall -j TEST=make BOARD=bloonchipper # Connect dragonclaw dev board over servo micro sudo servod --board=bloonchipper --config bloonchipper_rev0.1.xml & ./util/flash_ec --board=bloonchipper minicom -D $(dut-control raw_fpmcu_uart_pty | cut -d: -f2) > sysinfo # Check that we are in RW Change-Id: I412118287893ec63cef42c6c190d0a4755de06cb Signed-off-by: Craig Hesling <hesling@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1900122 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* hatch_fp: Configure unused GPIO pins.Ravi Chandra Sadineni2019-10-311-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | By default, STM32F4 pins are configured as inputs, except some JTAG pins which can impact the power consumption of the device in different power modes because pins are very sensitive to external noise in input mode I/O. To avoid extra I/O current, all pins should be configured as analog input (AIN); in this mode the Schmitt trigger input is disabled, providing zero consumption for each I/O pin. For more info please look at "USING STM32F4 MCU POWER MODES WITH BEST DYNAMIC EFFICIENCY"("AN4365") section 1.2.6 and STM32F412 reference manual section 7.3.12. BUG=b:130561737 BRANCH=None TEST=Flash bloonchipper and measure power before and after. fpenroll and fpmatch works fine. Change-Id: I85d76589be22b892c81680763cfb263746004a80 Signed-off-by: Ravi Chandra Sadineni <ravisadineni@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1883127 Reviewed-by: Craig Hesling <hesling@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* hatch_fp: Fix slave select (NSS / CS) pin managementTom Hughes2019-04-111-2/+7
| | | | | | | | | | | BRANCH=none BUG=b:124996507 TEST=Read HWID from fingerprint sensor (slave) on hatch_fp Change-Id: I344d7e4a5afec1f7c23f45aca593159ba67e89ed Signed-off-by: Tom Hughes <tomhughes@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1558937 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* hatch_fp: initial uploadNicolas Norvez2019-04-031-0/+31
First draft, lots of features still missing. Dev key generated with this command: openssl genrsa -3 -out board/hatch_fp/dev_key.pem 3072 BRANCH=none BUG=b:124996507 TEST=make BOARD=hatch_fp Change-Id: I7d7f0ce6807f7db9ee67e2e9b72ba6b2a0b87591 Signed-off-by: Nicolas Norvez <norvez@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1482059 Reviewed-by: Tom Hughes <tomhughes@chromium.org>