TF-M Reference Manual  1.2.0
TrustedFirmware-M
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
its_flash.h File Reference
#include <stddef.h>
#include <stdint.h>
#include "flash_layout.h"
#include "psa/error.h"
#include "its_utils.h"
Include dependency graph for its_flash.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  flash_fs_info_t
 flash filesystem configuration structure More...
 
struct  its_flash_info_t
 Structure containing the required information about a flash device to be used by the ITS Flash FS. More...
 

Macros

#define ITS_BLOCK_INVALID_ID   0xFFFFFFFFU
 
#define ITS_FLASH_ALIGNMENT   ITS_FLASH_PROGRAM_UNIT
 
#define PS_FLASH_ALIGNMENT   PS_FLASH_PROGRAM_UNIT
 
#define ITS_FLASH_MAX_ALIGNMENT
 Provides a compile-time constant for the maximum program unit required by any flash device that can be accessed through this interface. More...
 

Enumerations

enum  its_flash_id_t { ITS_FLASH_ID_INTERNAL = 0, ITS_FLASH_ID_EXTERNAL }
 Enumerates the available flash devices. More...
 

Functions

const struct its_flash_info_tits_flash_get_info (enum its_flash_id_t id)
 Gets the flash info structure for the provided flash device. More...
 
psa_status_t its_flash_block_to_block_move (const struct its_flash_info_t *info, uint32_t dst_block, size_t dst_offset, uint32_t src_block, size_t src_offset, size_t size)
 Moves data from source block ID to destination block ID. More...
 

Macro Definition Documentation

#define ITS_BLOCK_INVALID_ID   0xFFFFFFFFU

Definition at line 24 of file its_flash.h.

#define ITS_FLASH_ALIGNMENT   ITS_FLASH_PROGRAM_UNIT

Definition at line 28 of file its_flash.h.

#define ITS_FLASH_MAX_ALIGNMENT
Value:
#define ITS_FLASH_ALIGNMENT
Definition: its_flash.h:28
#define ITS_UTILS_MAX(x, y)
Evaluates to the maximum of the two parameters.
Definition: its_utils.h:46
#define PS_FLASH_ALIGNMENT
Definition: its_flash.h:34

Provides a compile-time constant for the maximum program unit required by any flash device that can be accessed through this interface.

Definition at line 43 of file its_flash.h.

#define PS_FLASH_ALIGNMENT   PS_FLASH_PROGRAM_UNIT

Definition at line 34 of file its_flash.h.

Enumeration Type Documentation

Enumerates the available flash devices.

Note
The enumeration constants are used as array indexes. They should be sequential starting from zero to minimise the array size.
Enumerator
ITS_FLASH_ID_INTERNAL 
ITS_FLASH_ID_EXTERNAL 

Definition at line 52 of file its_flash.h.

Function Documentation

psa_status_t its_flash_block_to_block_move ( const struct its_flash_info_t info,
uint32_t  dst_block,
size_t  dst_offset,
uint32_t  src_block,
size_t  src_offset,
size_t  size 
)

Moves data from source block ID to destination block ID.

Parameters
[in]infoFlash device information
[in]dst_blockDestination block ID
[in]dst_offsetDestination offset position from the init of the destination block
[in]src_blockSource block ID
[in]src_offsetSource offset position from the init of the source block
[in]sizeNumber of bytes to moves
Note
This function assumes all input values are valid. That is, the address range, based on blockid, offset and size, is a valid range in flash. It also assumes that the destination block is already erased and ready to be written.
Returns
Returns PSA_SUCCESS if the function is executed correctly. Otherwise, it returns PSA_ERROR_STORAGE_FAILURE.

Definition at line 56 of file its_flash.c.

Here is the caller graph for this function:

const struct its_flash_info_t* its_flash_get_info ( enum its_flash_id_t  id)

Gets the flash info structure for the provided flash device.

Parameters
[in]idIdentifier of the flash device.
Returns
Pointer to the flash info struct.

Definition at line 27 of file its_flash.c.

Here is the call graph for this function:

Here is the caller graph for this function: