diff options
-rw-r--r-- | board/nucleo-dartmonkey/board.c | 64 | ||||
-rw-r--r-- | board/nucleo-dartmonkey/board.h | 35 | ||||
-rw-r--r-- | board/nucleo-dartmonkey/build.mk | 12 | ||||
-rw-r--r-- | board/nucleo-dartmonkey/dev_key.pem | 39 | ||||
-rw-r--r-- | board/nucleo-dartmonkey/ec.tasklist | 11 | ||||
-rw-r--r-- | board/nucleo-dartmonkey/gpio.inc | 18 | ||||
l--------- | board/nucleo-dartmonkey/openocd-flash.cfg | 1 | ||||
l--------- | board/nucleo-dartmonkey/openocd.cfg | 1 |
8 files changed, 181 insertions, 0 deletions
diff --git a/board/nucleo-dartmonkey/board.c b/board/nucleo-dartmonkey/board.c new file mode 100644 index 0000000000..e06408c404 --- /dev/null +++ b/board/nucleo-dartmonkey/board.c @@ -0,0 +1,64 @@ +/* Copyright 2020 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. + */ + +#include "common.h" +#include "console.h" +#include "gpio.h" +#include "hooks.h" +#include "registers.h" +#include "spi.h" +#include "system.h" +#include "task.h" +#include "util.h" + +/** + * Disable restricted commands when the system is locked. + * + * @see console.h system.c + */ +int console_is_restricted(void) +{ + return system_is_locked(); +} + +static void ap_deferred(void) +{ + /* + * in S3: SLP_S3_L is 0 and SLP_S0_L is X. + * in S0ix: SLP_S3_L is X and SLP_S0_L is 0. + * in S0: SLP_S3_L is 1 and SLP_S0_L is 1. + * in S5/G3, the FP MCU should not be running. + */ + int running = gpio_get_level(GPIO_PCH_SLP_S3_L) + && gpio_get_level(GPIO_PCH_SLP_S0_L); + + if (running) { /* S0 */ + disable_sleep(SLEEP_MASK_AP_RUN); + hook_notify(HOOK_CHIPSET_RESUME); + } else { /* S0ix/S3 */ + hook_notify(HOOK_CHIPSET_SUSPEND); + enable_sleep(SLEEP_MASK_AP_RUN); + } +} +DECLARE_DEFERRED(ap_deferred); + +/* PCH power state changes */ +static void slp_event(enum gpio_signal signal) +{ + hook_call_deferred(&ap_deferred_data, 0); +} + +#include "gpio_list.h" + +/* Initialize board. */ +static void board_init(void) +{ + /* Enable interrupt on PCH power signals */ + gpio_enable_interrupt(GPIO_PCH_SLP_S3_L); + gpio_enable_interrupt(GPIO_PCH_SLP_S0_L); + /* enable the SPI slave interface if the PCH is up */ + hook_call_deferred(&ap_deferred_data, 0); +} +DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT); diff --git a/board/nucleo-dartmonkey/board.h b/board/nucleo-dartmonkey/board.h new file mode 100644 index 0000000000..041d0e36ec --- /dev/null +++ b/board/nucleo-dartmonkey/board.h @@ -0,0 +1,35 @@ +/* Copyright 2020 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. + */ + +/* + * STM32H743 + FPC 1145 Fingerprint MCU configuration + * + * This board is designed to have nucleo-h743zi support (uart+btn+leds) with + * dartmonkey configuration (fingerprint support). + * This allows for proxy testing of dartmonkey on the Nucleo-H743ZI. + */ + +#ifndef __BOARD_H +#define __BOARD_H + +/* Baseboard features */ +#include "base-board.h" + +#undef CONFIG_SYSTEM_UNLOCKED + +/* + * These allow console commands to be flagged as restricted. + * Restricted commands will only be permitted to run when + * console_is_restricted() returns false. + * See console_is_restricted's definition in board.c. + */ +#define CONFIG_CONSOLE_COMMAND_FLAGS +#define CONFIG_RESTRICTED_CONSOLE_COMMANDS + +#ifndef __ASSEMBLER__ + +#endif /* !__ASSEMBLER__ */ + +#endif /* __BOARD_H */ diff --git a/board/nucleo-dartmonkey/build.mk b/board/nucleo-dartmonkey/build.mk new file mode 100644 index 0000000000..5b8c705a8c --- /dev/null +++ b/board/nucleo-dartmonkey/build.mk @@ -0,0 +1,12 @@ +# Copyright 2020 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. +# +# Board specific files build + +BASEBOARD:=nucleo-h743zi + +board-y=board.o + +# Enable on device tests +test-list-y=aes sha256 sha256_unrolled diff --git a/board/nucleo-dartmonkey/dev_key.pem b/board/nucleo-dartmonkey/dev_key.pem new file mode 100644 index 0000000000..5b3a7ab290 --- /dev/null +++ b/board/nucleo-dartmonkey/dev_key.pem @@ -0,0 +1,39 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIG4wIBAAKCAYEAshjw6IqptVQZ/ysb0Z5hwABKpJVjgfezpqcaeXA6Cjy97UMh +fy7C9lghQDBlE2ykiXrVICTxpKuWdonbvNgBbhCR/VBkvakBYzYdTl94VCeajguu +39PqBQmROaWmDmaFxxMfC+IV2K8TFP9rPl+g2ILxgZqXhEcZLizpn7oF494xSeLG +xH2bWkuYVeF/kFkgoTldC2gA3l98cF1mUFQ7kjq1G/VHCKAPjetZWpdUw+5vbZJQ +/Yk+UtAyHwi+v5MoEnlnEcSJE9YJu4ISxWkl4OWhDElFibDNOs+Zievj4QvKhjO5 +eISyD6HxphGBLm4wfdnCgxLJrDpMWDqy+lRus4JpTt3Cxvm2LhIqZ3X9SWtVgGZ3 +u9W7IEBVsGY3Juxend5q0vgF6KBGgPSScKseq9GazVUbs5g/Bm+NAH+UTNHOJDbf +VU7WfyCJXY/5vmgQcLyxRi0RKJRLrClGm6uIgTmpo4UKfb8Uo02BE+AIF7f5SdKh +/w+jsW8/T9gufzZBAgEDAoIBgHa7S0Wxxnjiu/9yEou+69VVhxhjl6v6d8RvZvug +JrF90/OCFlTJ107la4AgQ2JIbbD8jhVt9m3HuaRb59M6q561tqjgQykbVkIkE4mU ++uLFEbQHyeqNRq4GYNEZGV7vA9oMv11BY+XKDLiqR37qazsB9lZnD62Eu3Qd8RUm +rpfpdjFB2dhTvObdEDlA/7WQwGt7k1zwAJQ/qEro7uA4J7bRzhKjhLBqtQlHkOcP +jdf0SkkMNf5bfuHgIWoF1H+3bu+clx8IpiGvfZGRTmWOErxhYhyUOLdvPIruoCaa +NRcjxa/KO6PrSQeTpl9/Pf8Wu/2HHmQRTNv2VuCvmtvgd/RQEdXZET2Q28BYJqp5 +U0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ATW17PjQmCcuPNJ/pGY9gtpejzzsgS +Bbq/96wVJBxhhXfqAG/EtwlFVT8hjcOIkc0E2aET5rNrEzyUtvghA1QUuU7y/oNH +T4rych0oX5oSiDDX/uAKjvQCtaV9RjlVHtu8rHGb2mPw9zMCgcEAkTZ4izUWm58A +nzEeiqYrqb6Cmdg70YfK/bsW0GNcp+TLdA7ZZ2kg3sFaCTo4s4NZEruDMC0ecLng +Y7JYGOhhzJRzLDFpW1g2qNWJx+ndmAR36fAbz5m7sEKxIPCKukfxlOOzH56uy8xK +8L2I+KEHZMOYu8NeebCbLBgWBHzO5fvPXEQyNVSFAvBbbmzLHh4LvhlYg2y/mUB0 +zNpCrc1vaob1YLuaTfusXDm6blWvPr4MVKnn5iChZQBogfBrPCHc +-----END RSA PRIVATE KEY----- diff --git a/board/nucleo-dartmonkey/ec.tasklist b/board/nucleo-dartmonkey/ec.tasklist new file mode 100644 index 0000000000..593ee85a65 --- /dev/null +++ b/board/nucleo-dartmonkey/ec.tasklist @@ -0,0 +1,11 @@ +/* Copyright 2020 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. + */ + + #include "base-ec.tasklist" + +/** + * See CONFIG_TASK_LIST in config.h for details. + */ +#define CONFIG_TASK_LIST BASEBOARD_CONFIG_TASK_LIST diff --git a/board/nucleo-dartmonkey/gpio.inc b/board/nucleo-dartmonkey/gpio.inc new file mode 100644 index 0000000000..c8cfde046c --- /dev/null +++ b/board/nucleo-dartmonkey/gpio.inc @@ -0,0 +1,18 @@ +/* + * Copyright 2020 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. + */ + +/* + * Note that these pins map to the Nucleo-H743ZI V2 and are only slightly + * compatible with the original version. + * + * The V2 is denoted by "Nucleo-H743ZI2" vs. "Nucleo-H743ZI". + */ + +#include "base-gpio.inc" + +/* Interrupts */ +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) diff --git a/board/nucleo-dartmonkey/openocd-flash.cfg b/board/nucleo-dartmonkey/openocd-flash.cfg new file mode 120000 index 0000000000..904ee459ab --- /dev/null +++ b/board/nucleo-dartmonkey/openocd-flash.cfg @@ -0,0 +1 @@ +../../baseboard/nucleo-h743zi/openocd-flash.cfg
\ No newline at end of file diff --git a/board/nucleo-dartmonkey/openocd.cfg b/board/nucleo-dartmonkey/openocd.cfg new file mode 120000 index 0000000000..b3fc5796c5 --- /dev/null +++ b/board/nucleo-dartmonkey/openocd.cfg @@ -0,0 +1 @@ +../../baseboard/nucleo-h743zi/openocd.cfg
\ No newline at end of file |