aboutsummaryrefslogtreecommitdiff
path: root/stm-keystore.h
diff options
context:
space:
mode:
authorFredrik Thulin <fredrik@thulin.net>2016-05-21 14:40:11 +0200
committerFredrik Thulin <fredrik@thulin.net>2016-05-21 14:40:11 +0200
commitac2357b001b970ff281d05566697c3d73f66ea4a (patch)
treeba877047fcf3538eebd2ae43941301e5bae00725 /stm-keystore.h
parent3d16ad028d69acc581095430d20463ed66f65779 (diff)
Add code to test reading, writing and erasing keystore data.
Diffstat (limited to 'stm-keystore.h')
-rw-r--r--stm-keystore.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/stm-keystore.h b/stm-keystore.h
index 9120340..2c493d2 100644
--- a/stm-keystore.h
+++ b/stm-keystore.h
@@ -38,6 +38,9 @@
#include "stm32f4xx_hal.h"
#include "spiflash_n25q128.h"
+#define KEYSTORE_PAGE_SIZE N25Q128_PAGE_SIZE
+#define KEYSTORE_SECTOR_SIZE N25Q128_SECTOR_SIZE
+
/* Pins connected to the FPGA config memory (SPI flash) */
#define KSM_PROM_CS_N_Pin GPIO_PIN_0
#define KSM_PROM_CS_N_GPIO_Port GPIOB
@@ -51,6 +54,7 @@
extern SPI_HandleTypeDef hspi_keystore;
extern int keystore_check_id(void);
+extern int keystore_read_data(uint32_t offset, uint8_t *buf, const uint32_t len);
extern int keystore_write_data(uint32_t offset, const uint8_t *buf, const uint32_t len);
extern int keystore_erase_sectors(int num);