21 #ifndef __DRIVER_STORAGE_H    22 #define __DRIVER_STORAGE_H    32 #include "Driver_Common.h"    34 #define ARM_STORAGE_API_VERSION ARM_DRIVER_VERSION_MAJOR_MINOR(1,00)      37 #define _ARM_Driver_Storage_(n)      Driver_Storage##n    38 #define  ARM_Driver_Storage_(n) _ARM_Driver_Storage_(n)    40 #define ARM_STORAGE_INVALID_OFFSET  (0xFFFFFFFFFFFFFFFFULL)     43 #define ARM_STORAGE_INVALID_ADDRESS (0xFFFFFFFFUL)              47 #define ARM_STORAGE_ERROR_NOT_ERASABLE      (ARM_DRIVER_ERROR_SPECIFIC - 1)     48 #define ARM_STORAGE_ERROR_NOT_PROGRAMMABLE  (ARM_DRIVER_ERROR_SPECIFIC - 2) 
    49 #define ARM_STORAGE_ERROR_PROTECTED         (ARM_DRIVER_ERROR_SPECIFIC - 3) 
    50 #define ARM_STORAGE_ERROR_RUNTIME_OR_INTEGRITY_FAILURE (ARM_DRIVER_ERROR_SPECIFIC - 4) 
    67   uint32_t reserved      : 28;
    94 #define ARM_STORAGE_VALID_BLOCK(BLK) (((BLK)->addr != ARM_STORAGE_INVALID_OFFSET) && ((BLK)->size != 0))   102 #define ARM_STORAGE_PROGRAMMABILITY_RAM       (0x0)   103 #define ARM_STORAGE_PROGRAMMABILITY_ROM       (0x1)    104 #define ARM_STORAGE_PROGRAMMABILITY_WORM      (0x2) 
   105 #define ARM_STORAGE_PROGRAMMABILITY_ERASABLE  (0x3) 
   113 #define ARM_RETENTION_WHILE_DEVICE_ACTIVE     (0x0)    114 #define ARM_RETENTION_ACROSS_SLEEP            (0x1) 
   115 #define ARM_RETENTION_ACROSS_DEEP_SLEEP       (0x2) 
   116 #define ARM_RETENTION_BATTERY_BACKED          (0x3) 
   117 #define ARM_RETENTION_NVM                     (0x4) 
   124   uint32_t rollback_protection :  1; 
   127   uint32_t tamper_proof        :  1; 
   128   uint32_t internal_flash      :  1; 
   129   uint32_t reserved1           : 12;
   134   uint32_t software_attacks     :  1; 
   135   uint32_t board_level_attacks  :  1; 
   136   uint32_t chip_level_attacks   :  1; 
   137   uint32_t side_channel_attacks :  1; 
   138   uint32_t reserved2            : 12;
   141 #define ARM_STORAGE_PROGRAM_CYCLES_INFINITE (0UL)    169   uint32_t                      erased_value    :  1; 
   170   uint32_t                      memory_mapped   :  1; 
   174   uint32_t                      programmability :  4; 
   175   uint32_t                      retention_level :  4;
   176   uint32_t                      reserved        : 22;
   195   uint32_t asynchronous_ops :  1; 
   203   uint32_t erase_all        :  1; 
   204   uint32_t reserved         : 30;
   212   ARM_STORAGE_OPERATION_GET_VERSION,
   213   ARM_STORAGE_OPERATION_GET_CAPABILITIES,
   214   ARM_STORAGE_OPERATION_INITIALIZE,
   215   ARM_STORAGE_OPERATION_UNINITIALIZE,
   216   ARM_STORAGE_OPERATION_POWER_CONTROL,
   217   ARM_STORAGE_OPERATION_READ_DATA,
   218   ARM_STORAGE_OPERATION_PROGRAM_DATA,
   219   ARM_STORAGE_OPERATION_ERASE,
   220   ARM_STORAGE_OPERATION_ERASE_ALL,
   221   ARM_STORAGE_OPERATION_GET_STATUS,
   222   ARM_STORAGE_OPERATION_GET_INFO,
   223   ARM_STORAGE_OPERATION_RESOLVE_ADDRESS,
   224   ARM_STORAGE_OPERATION_GET_NEXT_BLOCK,
   225   ARM_STORAGE_OPERATION_GET_BLOCK
   434   int32_t (*Uninitialize)(void);
   517   int32_t (*ReadData)(uint64_t addr, 
void *data, uint32_t size);
   558   int32_t (*ProgramData)(uint64_t addr, 
const void *data, uint32_t size);
   611   int32_t (*Erase)(uint64_t addr, uint32_t size);
   639   int32_t (*EraseAll)(void);
   689   uint32_t (*ResolveAddress)(uint64_t addr);
   771 #endif // __cplusplus struct _ARM_STORAGE_SECURITY_FEATURES ARM_STORAGE_SECURITY_FEATURES
Device Data Security Protection Features. 
struct _ARM_DRIVER_STORAGE ARM_DRIVER_STORAGE
This is the set of operations constituting the Storage driver. 
uint32_t optimal_program_unit
Optimal programming page-size in bytes. 
void(* ARM_Storage_Callback_t)(int32_t status, ARM_STORAGE_OPERATION operation)
Declaration of the callback-type for command completion. 
struct _ARM_DRIVER_VERSION ARM_DRIVER_VERSION
Driver Version. 
struct _ARM_STORAGE_INFO ARM_STORAGE_INFO
Storage information. 
ARM_STORAGE_SECURITY_FEATURES security
ARM_STORAGE_SECURITY_FEATURES 
Operating status of the storage controller. 
uint64_t addr
This is the start address of the storage block. 
uint32_t erase_unit
Minimum erase size in bytes. 
Storage Driver API Capabilities. 
Attributes of the storage range within a storage block. 
ARM_STORAGE_BLOCK_ATTRIBUTES attributes
Attributes for this block. 
Device Data Security Protection Features. 
uint32_t program_cycles
A measure of endurance for reprogramming. 
uint32_t executable
This storage block can hold program data; the processor can fetch and execute code sourced from it...
uint32_t erasable
Erasing blocks is permitted with a minimum granularity of 'erase_unit'. 
uint32_t program_unit
Minimum programming size in bytes. 
uint64_t size
This is the size of the storage block, in units of bytes. 
uint32_t protectable
The entire block can be protected from program and erase operations. 
A storage block is a range of memory with uniform attributes. 
This is the set of operations constituting the Storage driver. 
struct _ARM_STORAGE_CAPABILITIES ARM_STORAGE_CAPABILITIES
Storage Driver API Capabilities. 
struct _ARM_STORAGE_STATUS ARM_STORAGE_STATUS
Operating status of the storage controller. 
struct _ARM_STORAGE_BLOCK ARM_STORAGE_BLOCK
A storage block is a range of memory with uniform attributes. 
uint64_t total_storage
Total available storage, in bytes. 
enum _ARM_POWER_STATE ARM_POWER_STATE
General power states. 
_ARM_STORAGE_OPERATION
Command opcodes for Storage. 
enum _ARM_STORAGE_OPERATION ARM_STORAGE_OPERATION
Command opcodes for Storage. 
struct _ARM_STORAGE_BLOCK_ATTRIBUTES ARM_STORAGE_BLOCK_ATTRIBUTES
Attributes of the storage range within a storage block. 
uint32_t programmable
Writing to ranges is permitted with a minimum granularity of 'program_unit'. 
uint32_t protection_unit
Minimum protectable size in bytes.