summaryrefslogtreecommitdiff
path: root/fuzz
diff options
context:
space:
mode:
authorYicheng Li <yichengli@chromium.org>2021-03-02 15:38:17 -0800
committerCommit Bot <commit-bot@chromium.org>2021-04-02 23:16:12 +0000
commitac08c9d1dbc9f587df3ee6b15d58c0203f7e356e (patch)
tree04cd12d6787ce1b0b99b1d4e0aff504ccfa2c35e /fuzz
parente3cbbc3461c83d2d97b78447c53db1c6540cb3be (diff)
downloadchrome-ec-ac08c9d1dbc9f587df3ee6b15d58c0203f7e356e.tar.gz
fpsensor: Support building firmware that works for both sensors
This is a refactoring to allow building FPMCU firmware that works for one FPC sensor and one ELAN sensor. 1. When both drivers implement our common functions, e.g. fp_sensor_init(), rename them to fp_sensor_init_fpc() and fp_sensor_init_elan(). 2. There are a few functions implemented not in FPC driver but in FPC private library, e.g. fp_sensor_finger_status(). I kept this as-is for FPC but renamed the one in ELAN driver to fp_sensor_finger_status_elan() 3. If building for ELAN, need to hardcode elan=1 in hatch_fp/board.c because the sensor type GPIO always says FPC. BRANCH=none BUG=b:175158241 TEST=make run-fpsensor; make run-fpsensor_status; make run-fpsensor_crypto TEST=make -j BOARD=dartmonkey TEST=add CONFIG_FP_SENSOR_ELAN515 to board/hatch_fp/board.h; make -j BOARD=bloonchipper Firmware binary fully works on Dragonair (FPC) and Voema (ELAN) TEST=run device tests with http://crrev/c/2750547 and http://crrev/i/3654297 on Dragonclaw, all pass Change-Id: I789090dbdfe35ac6aefd6a629fa4c7bde89dc437 Signed-off-by: Yicheng Li <yichengli@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2727971 Reviewed-by: Tom Hughes <tomhughes@chromium.org> Commit-Queue: Tom Hughes <tomhughes@chromium.org>
Diffstat (limited to 'fuzz')
-rw-r--r--fuzz/host_command_fuzz.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fuzz/host_command_fuzz.c b/fuzz/host_command_fuzz.c
index 4ca94ff616..01a5818b63 100644
--- a/fuzz/host_command_fuzz.c
+++ b/fuzz/host_command_fuzz.c
@@ -12,6 +12,7 @@
#include "console.h"
#include "host_command.h"
#include "host_test.h"
+#include "mock/fp_sensor_mock.h"
#include "task.h"
#include "test_util.h"
#include "timer.h"
@@ -134,6 +135,8 @@ static pthread_mutex_t lock;
void run_test(int argc, char **argv)
{
ccprints("Fuzzing task started");
+ /* Set the fingerprint driver to the mock to test fp_task. */
+ fp_driver = &fp_driver_mock;
wait_for_task_started();
while (1) {