From 3d16ad028d69acc581095430d20463ed66f65779 Mon Sep 17 00:00:00 2001 From: Fredrik Thulin Date: Sat, 21 May 2016 13:16:58 +0200 Subject: Add code to access the keystore memory (SPI flash). --- projects/cli-test/cli-test.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'projects/cli-test/cli-test.c') diff --git a/projects/cli-test/cli-test.c b/projects/cli-test/cli-test.c index b8d5388..6bc70dd 100644 --- a/projects/cli-test/cli-test.c +++ b/projects/cli-test/cli-test.c @@ -36,6 +36,7 @@ #include "stm-led.h" #include "stm-uart.h" #include "stm-fpgacfg.h" +#include "stm-keystore.h" #include "mgmt-cli.h" #include @@ -126,6 +127,12 @@ int cmd_show_fpga_status(struct cli_def *cli, const char *command, char *argv[], return CLI_OK; } +int cmd_show_keystore_status(struct cli_def *cli, const char *command, char *argv[], int argc) +{ + cli_print(cli, "Keystore memory is %sonline", (keystore_check_id() != 1) ? "NOT ":""); + return CLI_OK; +} + /* The chunk size have to be a multiple of the SPI flash page size (256 bytes), and it has to match the chunk size in the program sending the bitstream over the UART. */ @@ -271,6 +278,10 @@ void configure_cli_show(struct cli_def *cli) cli_command_branch(show, fpga); /* show fpga status*/ cli_command_node(show_fpga, status, "Show status about the FPGA"); + + cli_command_branch(show, keystore); + /* show keystore status*/ + cli_command_node(show_keystore, status, "Show status of the keystore memory"); } void configure_cli_fpga(struct cli_def *cli) -- cgit v1.2.3