TF-M Reference Manual  1.2.0
TrustedFirmware-M
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
its_flash_info_t Struct Reference

Structure containing the required information about a flash device to be used by the ITS Flash FS. More...

#include <secure_fw/partitions/internal_trusted_storage/flash/its_flash.h>

Collaboration diagram for its_flash_info_t:

Data Fields

psa_status_t(* init )(const struct its_flash_info_t *info)
 Initialize the Flash Interface. More...
 
psa_status_t(* read )(const struct its_flash_info_t *info, uint32_t block_id, uint8_t *buff, size_t offset, size_t size)
 Reads block data from the position specified by block ID and offset. More...
 
psa_status_t(* write )(const struct its_flash_info_t *info, uint32_t block_id, const uint8_t *buff, size_t offset, size_t size)
 Writes block data to the position specified by block ID and offset. More...
 
psa_status_t(* flush )(const struct its_flash_info_t *info)
 Flushes modifications to a block to flash. Must be called after a sequence of calls to write() (including via its_flash_block_to_block_move()) for one block ID, before any call to the same functions for a different block ID. More...
 
psa_status_t(* erase )(const struct its_flash_info_t *info, uint32_t block_id)
 Erases block ID data. More...
 
void * flash_dev
 
struct flash_fs_info_t fs_info
 
uint16_t sector_size
 
uint16_t block_size
 
uint16_t num_blocks
 
uint16_t program_unit
 
uint16_t max_file_size
 
uint16_t max_num_files
 
uint8_t erase_val
 

Detailed Description

Structure containing the required information about a flash device to be used by the ITS Flash FS.

Definition at line 73 of file its_flash.h.

Field Documentation

uint16_t block_size

Size of a logical erase unit presented by the flash interface, a multiple of sector_size.

Definition at line 160 of file its_flash.h.

psa_status_t(* erase)(const struct its_flash_info_t *info, uint32_t block_id)

Erases block ID data.

Parameters
[in]infoFlash device information
[in]block_idBlock ID
Note
This function assumes the input value is valid.
Returns
Returns PSA_SUCCESS if the function is executed correctly. Otherwise, it returns PSA_ERROR_STORAGE_FAILURE.

Definition at line 152 of file its_flash.h.

uint8_t erase_val

Value of a byte after erase (usually 0xFF)

Definition at line 168 of file its_flash.h.

void* flash_dev

Pointer to the flash device

Definition at line 155 of file its_flash.h.

psa_status_t(* flush)(const struct its_flash_info_t *info)

Flushes modifications to a block to flash. Must be called after a sequence of calls to write() (including via its_flash_block_to_block_move()) for one block ID, before any call to the same functions for a different block ID.

Parameters
[in]infoFlash device information
Note
It is permitted for write() to commit block updates immediately, in which case this function is a no-op.
Returns
Returns PSA_SUCCESS if the function is executed correctly. Otherwise, it returns PSA_ERROR_STORAGE_FAILURE.

Definition at line 139 of file its_flash.h.

struct flash_fs_info_t fs_info

Filesystem configuration

Definition at line 156 of file its_flash.h.

psa_status_t(* init)(const struct its_flash_info_t *info)

Initialize the Flash Interface.

Parameters
[in]infoFlash device information
Returns
Returns PSA_SUCCESS if the function is executed correctly. Otherwise, it returns PSA_ERROR_STORAGE_FAILURE.

Definition at line 82 of file its_flash.h.

uint16_t max_file_size

Maximum file size

Definition at line 166 of file its_flash.h.

uint16_t max_num_files

Maximum number of files

Definition at line 167 of file its_flash.h.

uint16_t num_blocks

Number of logical erase blocks

Definition at line 164 of file its_flash.h.

uint16_t program_unit

Minimum size of a program operation

Definition at line 165 of file its_flash.h.

psa_status_t(* read)(const struct its_flash_info_t *info, uint32_t block_id, uint8_t *buff, size_t offset, size_t size)

Reads block data from the position specified by block ID and offset.

Parameters
[in]infoFlash device information
[in]block_idBlock ID
[out]buffBuffer pointer to store the data read
[in]offsetOffset position from the init of the block
[in]sizeNumber of bytes to read
Note
This function assumes all input values are valid. That is, the address range, based on block_id, offset and size, is a valid range in flash.
Returns
Returns PSA_SUCCESS if the function is executed correctly. Otherwise, it returns PSA_ERROR_STORAGE_FAILURE.

Definition at line 101 of file its_flash.h.

uint16_t sector_size

Size of the flash device's physical erase unit

Definition at line 157 of file its_flash.h.

psa_status_t(* write)(const struct its_flash_info_t *info, uint32_t block_id, const uint8_t *buff, size_t offset, size_t size)

Writes block data to the position specified by block ID and offset.

Parameters
[in]infoFlash device information
[in]block_idBlock ID
[in]buffBuffer pointer to the write data
[in]offsetOffset position from the init of the block
[in]sizeNumber of bytes to write
Note
This function assumes all input values are valid. That is, the address range, based on block_id, offset and size, is a valid range in flash.
Returns
Returns PSA_SUCCESS if the function is executed correctly. Otherwise, it returns PSA_ERROR_STORAGE_FAILURE.

Definition at line 121 of file its_flash.h.


The documentation for this struct was generated from the following file: