summaryrefslogtreecommitdiff
path: root/board/nocturne_fp/build.mk
Commit message (Collapse)AuthorAgeFilesLines
* dartmonkey: Reintroduce sleep lines to ROCraig Hesling2021-08-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change https://crrev.com/c/2657778 removed the sleep lines from RO in an effort to minimize the RO complexity. Most notably, this isolated the deep-sleep/low-power-idle logic to RW only. Unfortunately, the sleep lines also control whether the SPI host interface is listening, which allows it to ignore spurious communication. It seems safer to reinstate the the sleep line with low power idle active and directly disable CONFIG_LOW_POWER_IDLE in subsequent CL. We reinstate the sleep line gpio logic from the following: crrev.com/c1b5095aa8404709bb447bd7a58f262d7d471a01/board/nocturne_fp/board.c This is the parent commit to the CL that refactors the sleep lines. Considering dartmonkey has a sleep line modification for dev boards, we keep this in RW only. Since nearly all functionality would need to be conditioned and communicated between RO and RW, I decided to just create a clean break between RO and RW board init. The original board.c no longer spans both RO and RW, there are exclusive board_ro.c and board_rw.c files. BRANCH=none BUG=b:178746753 TEST=# Connect servo_micro and J-Link to an icetower board. make proj-dartmonkey -j sudo servod --board=icetower ./util/flash_jlink.py --board=dartmonkey --image=./build/dartmonkey/ec.bin # Unplug J-Link and unplug/replug servo connector. dut-control fpmcu_slp:off fpmcu_slp_alt:off dut-control pp3300_dx_mcu_mw # Should be more than 40mw dut-control fpmcu_slp:on fpmcu_slp_alt:off dut-control pp3300_dx_mcu_mw # Should be less than 10mw dut-control fpmcu_slp:off fpmcu_slp_alt:on dut-control pp3300_dx_mcu_mw # Should be less than 10mw dut-control fpmcu_slp:on fpmcu_slp_alt:on dut-control pp3300_dx_mcu_mw # Should be less than 10mw dut-control fpmcu_slp:off fpmcu_slp_alt:off minicom -D$(dut-control -o raw_fpmcu_console_uart_pty) > reboot ro # Ctrl-A Q # RO does not have the code to adjust to SLP_ALT_DEV_L, thus # it will use SLP_ALT_L, which is 0. This means it will always # think sleep is asserted. dut-control fpmcu_slp:off fpmcu_slp_alt:off dut-control pp3300_dx_mcu_mw # Should be less than 10mw minicom -D$(dut-control -o raw_fpmcu_console_uart_pty) > gpioget # Should see SLP_L=1, SLP_ALT_L=0, and SLP_ALT_DEV_L=1 > reboot > fpenroll > fpmatch # Ctrl-A Q Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: Ibb2c8052bc4fb776c5e1c172eeb1f3faf356a147 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3052750 Commit-Queue: Josie Nordrum <josienordrum@google.com> Reviewed-by: Josie Nordrum <josienordrum@google.com>
* fingerprint: Add test that reads hwidKevin Shelton2021-05-081-0/+1
| | | | | | | | | | | | | | | | | | | | | BUG=b:157576189 BRANCH=none TEST=make buildall -j, Using dragonclaw v0.2 and servo_micro: ./test/run_device_test.py -t fpsensor_hw --flasher=servo_micro, Using icetower and servo_micro: ./test/run_device_test.py -t fpsensor_wh --flasher=servo_micro --board dartmonkey; note: the testrunner hung after printing Test "fpsensor_hw": PASSED, but this hang seems unrelated Cq-Depend: chromium:2872432 Change-Id: I2a3b31776cd40d7f0b422f4845869953b8f07249 Signed-off-by: Kevin Shelton <kmshelton@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2314101 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* fingerprint: Enable more on-device unit testsTom Hughes2021-02-161-0/+6
| | | | | | | | | | | | | | | | BRANCH=none BUG=b:155235321 TEST=On dragonclaw v0.2 with servo micro and jlink: ./test/run_device_test.py --board bloonchipper => tests pass TEST=On icetower v0.1 with servo micro and jlink: ./test/run_device_test.py --board dartmonkey => tests pass Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I884ee93779235a387ed64bfe02643abee2009243 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2692877 Reviewed-by: Craig Hesling <hesling@chromium.org>
* dartmonkey: Remove stm32f_rtc testTom Hughes2021-02-051-1/+0
| | | | | | | | | | | | | | The stm32f_rtc test is specific to the STM32F series, but dartmonkey is a STM32H series chip. BRANCH=none BUG=b:170432597 TEST=make BOARD=dartmonkey tests -j Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: Iff8f29444b4ac46482cbc526f0164ca3fef1752c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2676005 Reviewed-by: Craig Hesling <hesling@chromium.org>
* dartmonkey: Fix fpsensor test compilationTom Hughes2021-02-041-2/+9
| | | | | | | | | | | | | This is the same as what we already do on bloonchipper. BRANCH=none BUG=b:170432597 TEST=make BOARD=dartmonkey test-fpsensor Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I80ba0a95c012fc65d05c9a6d17698c4e97ced416 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2669415 Reviewed-by: Craig Hesling <hesling@chromium.org>
* dartmonkey: Refactor GPIOs to keep RO minimalTom Hughes2021-01-301-1/+1
| | | | | | | | | | | | | | | | | | | | | 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>
* crc32: rename test crc32->crc to allow for crc8Jett Rink2020-11-131-1/+1
| | | | | | | | | | | | | | | Instead of creating a new test for crc8, just make the existing crc32 test more generic. BRANCH=none BUG=none TEST=none Signed-off-by: Jett Rink <jettrink@chromium.org> Change-Id: Ie630d4991d4e2c7dc441842c39d63fc0281ac809 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2532690 Reviewed-by: Tom Hughes <tomhughes@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* Revert "crc32: rename test crc32->crc to allow for crc8"Jett Rink2020-11-111-1/+1
| | | | | | | | | | | | | | | | | Something slipped through CQ coverage. Need to figure out, but in the mean time, revert the 3 CLs that seemed to have caused the issue. BRANCH=none BUG=chromium:1147953 TEST=none This reverts commit 5ec269c5a71643c955fe45191ed9f06794c6113a. Change-Id: I90f812cd4d4f83ea05d34740541db0076abce392 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2533356 Tested-by: Rajat Jain <rajatja@google.com> Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* crc32: rename test crc32->crc to allow for crc8Jett Rink2020-11-111-1/+1
| | | | | | | | | | | | | | Instead of creating a new test for crc8, just make the existing crc32 test more generic. BRANCH=none BUG=none TEST=none Signed-off-by: Jett Rink <jettrink@chromium.org> Change-Id: I459e9b721a6cc0d94cef8c0d93102ad372095c34 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2527493 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* nocturne_fp: Do not build rsa unittestYicheng Li2020-11-111-1/+2
| | | | | | | | | | | | | | | nocturne_fp uses RSA exponent 3 for its own rwsig verification, so the rsa test will fail on a nocturne_fp device. If we modify the test, we won't pass rwsig verification on device. BRANCH=none BUG=b:169256204 TEST=make -j buildall Signed-off-by: Yicheng Li <yichengli@chromium.org> Change-Id: I9ca69da2ee870a672ffb029e962f5e0cc0c17c2c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2464231 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* test/fpsensor: Run the fpsensor test on deviceTom Hughes2020-10-301-0/+1
| | | | | | | | | | | | BRANCH=none BUG=b:171370392 TEST=Using dragonclaw v0.2 and servo_micro: ./test/run_device_tests.py -t fpsensor Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: Idc24d9bdd5574ca7099e97e86e3b49011844380c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2507951 Reviewed-by: Bhanu Prakash Maiya <bhanumaiya@google.com>
* stm32: Enable rsa and rsa3 on-device unit testsYicheng Li2020-06-231-0/+2
| | | | | | | | | | | | | | | | | | | | BRANCH=none BUG=b:155235321 TEST=make BOARD=nucleo-dartmonkey tests -j TEST=make BOARD=bloonchipper tests -j TEST=make BOARD=dartmonkey tests -j TEST=make BOARD=nucleo-f412zg tests -j TEST=make BOARD=nucleo-h743zi tests -j TEST=flash rsa unit test binary to nucleo-f412zg, run test => pass TEST=flash rsa3 unit test binary to nucleo-f412zg, run test => pass TEST=flash rsa unit test binary to nucleo-h743zi, run test => pass TEST=flash rsa3 unit test binary to nucleo-h743zi, run test => pass Signed-off-by: Yicheng Li <yichengli@chromium.org> Change-Id: I2ebcf6f322f9c16aba65a3a627a0a83ca00d2a02 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2240516 Commit-Queue: Tom Hughes <tomhughes@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* stm32: Enable utils on-device unit test for fingerprint boardsYicheng Li2020-06-171-0/+1
| | | | | | | | | | | | | | | | BRANCH=none BUG=b:155230812, b:155235321 TEST=make -j BOARD={dartmonkey, bloonchipper, nucleo-dartmonkey, nucleo-f412zg, nucleo-h743zi} test-utils TEST=flash the utils test binary, then runtest on bloonchipper and nucleo-f412zg ==> Pass! Signed-off-by: Yicheng Li <yichengli@chromium.org> Change-Id: Ia45b494111f2a536876a5ca60fdc12c06f870e1f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2242356 Tested-by: Tom Hughes <tomhughes@chromium.org> Commit-Queue: Tom Hughes <tomhughes@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* test: Add test for flash write protectionTom Hughes2020-05-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This test demonstrates the inconsistency between STM32H743 (dartmonkey) and STM32F412 (bloonchipper). BRANCH=none BUG=b:155897971 TEST=On bloonchipper after flashing flash_write_protect.bin test: * Enable HW WP: dut-control fw_wp_en:on * Reboot to RO: reboot ro * Enable flash protection: runtest 1 => PASS * Reboot to RO: reboot ro * Try to disable flash protection: runtest 2 => FAIL TEST=On dartmonkey after flashing flash_write_protect.bin test: * Enable HW WP: dut-control fw_wp_en:on * Reboot to RO: reboot ro * Enable flash protection: runtest 1 => PASS * Reboot to RO: reboot ro * Try to disable flash protection: runtest 2 => PASS Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I6eb69257f84f79a6609984efbdad7dd37803c8f6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2209419 Commit-Queue: Yicheng Li <yichengli@chromium.org> Tested-by: Yicheng Li <yichengli@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* test: Add flash_physical testTom Hughes2020-05-301-0/+1
| | | | | | | | | | | | | | | | | | | | | This test is intended to be used for testing the physical layer flash APIs. BRANCH=none BUG=b:155897971 TEST=On dragonclaw v0.2 with Segger J-Trace and servo micro connected: ./test/run_device_tests.py -t flash_physical => PASS TEST=On dragontalon with servo micro connected: > runtest => PASS Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: Ifd3c30da5f42ff84e77a7292cd2a7c88e8c594dd Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2220734 Commit-Queue: Yicheng Li <yichengli@chromium.org> Tested-by: Yicheng Li <yichengli@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* test: Add scratchpad testTom Hughes2020-05-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The first time the test runs it should pass. After rebooting, the test should then fail because the scratchpad register is already set. BRANCH=none BUG=b:157059753 TEST=Build and flash bloonchipper On console: > runtest => PASS > reboot > runtest => PASS, which is WRONG TEST=Build and flash dartmonkey On console: > runtest => PASS > reboot > runtest => FAILS, which is CORRECT Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I348d723d8083ecd0d9f5535785c8049f284a00b6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2209189 Commit-Queue: Abe Levkoy <alevkoy@chromium.org> Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* test: Add on-device MPU unit testTom Hughes2020-05-221-0/+1
| | | | | | | | | | | | | | | | | | BRANCH=none BUG=b:151105339, b:155229277 TEST=make BOARD=bloonchipper test-mpu -j && \ ./util/flash_jlink.py --board bloonchipper \ --image ./build/bloonchipper/mpu/mpu.bin => On console: "runtest" => All tests pass, except last which correctly panics: Data access violation, mfar = 20000000 Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I1c759f50da5075b1e9027cdba253d8c06843be5a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2202852 Commit-Queue: Yicheng Li <yichengli@chromium.org> Tested-by: Yicheng Li <yichengli@chromium.org> Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
* test: Add rollback entropy on-device unit testTom Hughes2020-05-141-0/+1
| | | | | | | | | | | | | | | | | | This unit test validates the behavior of adding entropy to rollback. BRANCH=none BUG=b:151105339 TEST=make BOARD=bloonchipper test-rollback_entropy -j && ./util/flash_jlink.py --board bloonchipper --image ./build/bloonchipper/rollback_entropy/rollback_entropy.bin Dragonclaw console: > reboot ro > runtest Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I0532104d483e3a8c16c2c3b9fd7fef8554eaadad Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2197620
* test: Add rollback unit testTom Hughes2020-05-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This test only runs on device and requires manual verification that a memory access violation occurred. Note that bloonchipper region 1 on dragonclaw fails as indicated in tests below. BRANCH=none BUG=b:155229277, b:151105339 TEST=Compile and flash bloonchipper on dragonclaw with region 0 "runtest" on console => Reboots with "Data access violation, mfar = 8020000" => PASS TEST=Compile and flash bloonchipper on dragonclaw with region 1 "runtest" on console => Memory is successfully read => FAIL TEST=Compile and flash dartmonkey on dragontalon with region 0 "runtest" on console => Reboots with "Data access violation, mfar = 80c0000" => PASS TEST=Compile and flash dartmonkey on dragontalon with region 1 "runtest" on console => Reboots with "Data access violation, mfar = 80e0000" => PASS Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I3e9cc568a0b16c6091d96c4373798fe4de4ab65b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2190829 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org> Commit-Queue: Nicolas Boichat <drinkcat@chromium.org>
* test: Add on-device unit test for STM32 RTCTom Hughes2020-04-301-0/+1
| | | | | | | | | | | | BRANCH=none BUG=b:151105339 TEST=make BOARD=bloonchipper test-stm32f_rtc -j Flash stm32f_rtc.bin and "runtest" in the console Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I3debfd93b62cb269ad61af0e4ca7e195554b5548 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2171569 Reviewed-by: Eric Yilun Lin <yllin@chromium.org>
* stm32: Enable more on-device unit testsTom Hughes2020-04-291-1/+9
| | | | | | | | | | | | | | | | | | | | | As part of the effort to run unit tests on device, we start by enabling a subset of the existing tests that compile and pass when run on device. BRANCH=none BUG=b:151105339 TEST=make BOARD=nucleo-dartmonkey tests -j TEST=make BOARD=bloonchipper tests -j TEST=make BOARD=dartmonkey tests -j TEST=make BOARD=nucleo-f412zg tests -j TEST=For each "test_name.bin" file created by above command -> flash to dragonclaw dev board -> "runtest" in the console Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: Ifbb3c1627c4da6b8aa27d2512530a879d54c86e1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2172061 Commit-Queue: Yicheng Li <yichengli@chromium.org> Reviewed-by: Yicheng Li <yichengli@chromium.org>
* nocturne_fp: Add fix for legacy reset loopCraig Hesling2020-02-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch mitigates an infinite reset loop caused by an RO bug. The reset occurs in RO when hardware write protect (wp_gpio_asserted) is disabled, but software write protect (ro_now) is still enabled. This can be seen by disabling hardware write protect and issuing a soft reset. There is one case where RO will forgo issuing this system reset. That is when it detects a power on reset. Furthermore, it retrieves its reset flags from the main system_get_reset_flags function, which combines hardware reset registers AND a special RTC backup register designed to preserve reset flags. We exploit this reset backup register mechanism to inject a fake power-on flag before resetting. As an added bonus, we also inject an ap-off flag so that we can determine on startup if the power-on flag is real or forged by this mechanism. If we detect that the power-on flag was forged, we print a warning and fix the current reset flags. In order to ensure that a power-on will be forged when a spurious reset happens (exception or pin reset), we keep the backup register loaded with the power-on and ap-off reset flags, when the hardware write protect is disabled. In order to keep the typical code path (HW+SW WP enabled) clear of complexity and false power-on reports, we only forge the power-on flag when hardware write protect is disabled. Thus, we conditionally setup the forge on startup and setup an interrupt handler to catch changes to the hardware write protect status. It is safe to use ap-off flag for our nefarious purposes, since the fingerprint controller has no functionality to control an AP and has no included code that uses this reset flag. Review: * Normal power on reset --> The ap-off flag should be cleared * Forged power on reset --> We set the ap-off flag Scenarios covered: * True power on --> No reset loop and ap-off would not be set * HW reset pulse --> We preloaded ap-off and power-on flags in the reset backup register * Exception/Watchdog --> Same as above * System reboot --> We modified the system_reset function to add ap-off and power-on to reset backup register BRANCH=nocturne,hatch BUG=b:146428434 TEST=make buildall -j TEST=Checked all of the scenarios mentioned above in the [SW-WP off + HW-WP off], [SW-WP on + HW-WP on], and [SW-WP on + HW-WP off] situations using the nucleo-h743zi board (https://crrev.com/c/1994624). TEST=Checked all of the previous using nocturne_fp board on nucleo-h743zi TEST=Checked stable RO+fixed-RW on Kohaku Change-Id: I89361fa95be8eafe78c80c30f5b3195d7a724f81 Signed-off-by: Craig Hesling <hesling@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1992740 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* bloonchipper: Add transport and sensor detectionTom Hughes2020-01-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | bloonchipper (aka hatch_fp aka dragonclaw) has a voltage divider that can be used to select the sensor and the transport type. Supported designs: * Dragonclaw rev 0.2 (green with Google logo): go/dragonclaw-schematic-rev-0.2 * Hatch reference v3.0: go/hatch-schematic-rev-3.0 The selection lines are connected to ADC inputs, so a future change will use the ADC to allow more than two transports or sensors. BRANCH=none BUG=b:147113851 TEST=flash dragonclaw rev 0.2 and view console output Change-Id: If2e4b150d34cfe41477be528c70e1645043d4d82 Signed-off-by: Tom Hughes <tomhughes@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1986322 Reviewed-by: Craig Hesling <hesling@chromium.org>
* meowth: remove meowth/zoombini overlays and repositoriesBob Moragues2018-12-081-0/+14
BRANCH=none BUG=b:118494679 TEST=Verify PreCQ build Signed-off-by: Bob Moragues <moragues@chromium.org> Change-Id: Id6889d922a2b4d812cc92ddbb35b2581d881459d Reviewed-on: https://chromium-review.googlesource.com/1354316 Commit-Ready: Bob Moragues <moragues@chromium.org> Tested-by: Bob Moragues <moragues@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>