aboutsummaryrefslogtreecommitdiff
path: root/components/service/secure_storage/provider/secure_flash_store/flash/sfs_flash_ram.h
diff options
context:
space:
mode:
authorBalint Dobszay <balint.dobszay@arm.com>2020-11-23 18:12:54 +0100
committerGyorgy Szing <Gyorgy.Szing@arm.com>2020-11-27 16:47:03 +0100
commit8b6e686aa9c331d32ec31c36b81c02906f0a2f04 (patch)
tree813bf088663d183180dd236727ab34a9907b8601 /components/service/secure_storage/provider/secure_flash_store/flash/sfs_flash_ram.h
parent8cff2b8f95ef9f41166dc13e7687e28d842203fe (diff)
downloadtrusted-services-8b6e686aa9c331d32ec31c36b81c02906f0a2f04.tar.gz
Add secure storage service
Implements secure storage service client and provider. The client is compatible with PSA Internal Trusted Storage API. There are two provider versions implemented: * mock_store is a dummy storage for testing purposes, * secure_flash_store is a RAM based proof-of-concept storage solution based on the ITS implementation in Trusted Firmware-M. Some files in this commit were forked from Trusted Firmware-M, keeping the original license header intact: tag name: TF-Mv1.1 (8c22a260e24bc5778e5ce0dbdf9da3ccec1da880) tagged commit: a6b336c1509fd5f5522450e3cec0fcd6c060f9c8 From 'secure_fw/partitions/internal_trusted_storage/' of TF-M, to 'components/service/secure_storage/provider/secure_flash_store/': flash/its_flash.c -> flash/sfs_flash.c flash/its_flash.h -> flash/sfs_flash.h flash/its_flash_info_internal.c -> flash/sfs_flash_info.c flash/its_flash_ram.c -> flash/sfs_flash_ram.c flash/its_flash_ram.h -> flash/sfs_flash_ram.h flash_fs/its_flash_fs.c -> flash_fs/sfs_flash_fs.c flash_fs/its_flash_fs.h -> flash_fs/sfs_flash_fs.h flash_fs/its_flash_fs_check_info.h -> flash_fs/sfs_flash_fs_check_info.h flash_fs/its_flash_fs_dblock.c -> flash_fs/sfs_flash_fs_dblock.c flash_fs/its_flash_fs_dblock.h -> flash_fs/sfs_flash_fs_dblock.h flash_fs/its_flash_fs_mblock.c -> flash_fs/sfs_flash_fs_mblock.c flash_fs/its_flash_fs_mblock.h -> flash_fs/sfs_flash_fs_mblock.h its_utils.c -> sfs_utils.c its_utils.h -> sfs_utils.h tfm_internal_trusted_storage.c -> secure_flash_store.c tfm_internal_trusted_storage.h -> secure_flash_store.h Change-Id: If9eb3bb7c8a58364a8da9a0b463015b2bbc160c4 Signed-off-by: Balint Dobszay <balint.dobszay@arm.com>
Diffstat (limited to 'components/service/secure_storage/provider/secure_flash_store/flash/sfs_flash_ram.h')
-rw-r--r--components/service/secure_storage/provider/secure_flash_store/flash/sfs_flash_ram.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/components/service/secure_storage/provider/secure_flash_store/flash/sfs_flash_ram.h b/components/service/secure_storage/provider/secure_flash_store/flash/sfs_flash_ram.h
new file mode 100644
index 000000000..eecc5e57e
--- /dev/null
+++ b/components/service/secure_storage/provider/secure_flash_store/flash/sfs_flash_ram.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2019-2020, Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ *
+ */
+
+/**
+ * \file sfs_flash_ram.h
+ *
+ * \brief Implementations of the flash interface functions for an emulated flash
+ * device using RAM. See sfs_flash.h for full documentation of functions.
+ */
+
+#include "sfs_flash.h"
+
+/**
+ * \brief Initialize the Flash Interface.
+ */
+psa_status_t sfs_flash_ram_init(const struct sfs_flash_info_t *info);
+
+/**
+ * \brief Reads block data from the position specified by block ID and offset.
+ */
+psa_status_t sfs_flash_ram_read(const struct sfs_flash_info_t *info,
+ uint32_t block_id, uint8_t *buff, size_t offset,
+ size_t size);
+
+/**
+ * \brief Writes block data to the position specified by block ID and offset.
+ */
+psa_status_t sfs_flash_ram_write(const struct sfs_flash_info_t *info,
+ uint32_t block_id, const uint8_t *buff,
+ size_t offset, size_t size);
+
+/**
+ * \brief Flushes modifications to a block to flash.
+ */
+psa_status_t sfs_flash_ram_flush(const struct sfs_flash_info_t *info);
+
+/**
+ * \brief Erases block ID data.
+ */
+psa_status_t sfs_flash_ram_erase(const struct sfs_flash_info_t *info,
+ uint32_t block_id);