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>
diff --git a/components/service/common/psa/error.h b/components/service/common/psa/error.h
new file mode 100644
index 0000000..db8ce90
--- /dev/null
+++ b/components/service/common/psa/error.h
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2020, Arm Limited and Contributors. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#ifndef PSA_ERROR_H
+#define PSA_ERROR_H
+
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+  * Standard PSA error codes for the SPM and RoT Services
+ * As defined in PSA Firmware Framework v1.0
+ */
+
+typedef int32_t psa_status_t;
+
+#define PSA_SUCCESS			            ((psa_status_t)0)
+#define PSA_ERROR_PROGRAMMER_ERROR	    ((psa_status_t)-129)
+#define PSA_ERROR_CONNECTION_REFUSED	((psa_status_t)-130)
+#define PSA_ERROR_CONNECTION_BUSY	    ((psa_status_t)-131)
+#define PSA_ERROR_GENERIC_ERROR		    ((psa_status_t)-132)
+#define PSA_ERROR_NOT_PERMITTED		    ((psa_status_t)-133)
+#define PSA_ERROR_NOT_SUPPORTED		    ((psa_status_t)-134)
+#define PSA_ERROR_INVALID_ARGUMENT	    ((psa_status_t)-135)
+#define PSA_ERROR_INVALID_HANDLE	    ((psa_status_t)-136)
+#define PSA_ERROR_BAD_STATE		        ((psa_status_t)-137)
+#define PSA_ERROR_BUFFER_TOO_SMALL	    ((psa_status_t)-138)
+#define PSA_ERROR_ALREADY_EXISTS	    ((psa_status_t)-139)
+#define PSA_ERROR_DOES_NOT_EXIST	    ((psa_status_t)-140)
+#define PSA_ERROR_INSUFFICIENT_MEMORY	((psa_status_t)-141)
+#define PSA_ERROR_INSUFFICIENT_STORAGE	((psa_status_t)-142)
+#define PSA_ERROR_INSUFFICIENT_DATA	    ((psa_status_t)-143)
+#define PSA_ERROR_SERVICE_FAILURE	    ((psa_status_t)-144)
+#define PSA_ERROR_COMMUNICATION_FAILURE	((psa_status_t)-145)
+#define PSA_ERROR_STORAGE_FAILURE	    ((psa_status_t)-146)
+#define PSA_STATUS_HARDWARE_FAILURE	    ((psa_status_t)-147)
+#define PSA_ERROR_INVALID_SIGNATURE	    ((psa_status_t)-149)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* PSA_ERROR_H */