00001 #ifndef ROBOOT_H_
00002 #define ROBOOT_H_
00003
00030
00031
00032 #include <stdint.h>
00033 #include <stdbool.h>
00034 #include "roboot_config.h"
00035 #include "roboot_if_flash.h"
00036 #include "roboot_if_device.h"
00037
00121
00122
00124 #define ROBOOT_VER_HI 2
00126 #define ROBOOT_VER_LO 0
00127
00131 typedef enum {
00132 ROBOOT_PS_FILE_END,
00133 ROBOOT_PS_FILE_MAGIC,
00134 ROBOOT_PS_DEV_MAGIC,
00135 ROBOOT_PS_CRYPTO_KEY,
00136 ROBOOT_PS_CHECK_AREA,
00137 ROBOOT_PS_SECTION_HEADER,
00138 ROBOOT_PS_SECTION_DATA
00139 } ROBOOT_ProcesingStage_T;
00140
00141
00142
00143
00145 #define ROBOOT_INTERNAL_ERROR -1
00147 #define ROBOOT_FLS_UNLOCK_ERROR -2
00149 #define ROBOOT_FLS_ERASE_ERROR -3
00151 #define ROBOOT_FLS_WRITE_ERROR -4
00153 #define ROBOOT_IMG_VERSION_ERROR -5
00155 #define ROBOOT_IMG_HASH_MATCH_ERROR -6
00157 #define ROBOOT_IMG_CIPHER_MATCH_ERROR -7
00159 #define ROBOOT_IMG_ACIPHER_MATCH_ERROR -8
00161 #define ROBOOT_IMG_DEVKEY_LEN_ERROR -9
00163 #define ROBOOT_IMG_CHECK_TYPE_ERROR -10
00165 #define ROBOOT_IMG_DEV_VERSION_ERROR -11
00167 #define ROBOOT_IMG_APP_VERSION_ERROR -12
00169 #define ROBOOT_IMG_DEV_ID_ERROR -13
00171 #define ROBOOT_IMG_CHECK_FM_ERROR -14
00173 #define ROBOOT_IMG_CHECK_DM_ERROR -15
00175 #define ROBOOT_IMG_SM_ERROR -16
00177 #define ROBOOT_IMG_SECTION_CRC_ERROR -17
00178
00179
00190 uint8_t* ROBOOT_InitProcessing(const ROBOOT_FLASH_Operations_T* flash_oper);
00191
00192
00209 int8_t ROBOOT_ProcessPacket(uint32_t size, uint8_t **new_buf);
00210
00211
00219 const uint8_t* ROBOOT_GetFileMagic(void);
00220
00221
00229 const uint8_t* ROBOOT_GetDeviceMagic(void);
00230
00231
00239 const uint8_t* ROBOOT_GetUserData(void);
00240
00241
00249 uint8_t ROBOOT_GetHashType(void);
00250
00251
00259 uint8_t ROBOOT_GetCipherType(void);
00260
00261
00269 bool ROBOOT_IsAsymetricKeyCipherUsed(void);
00270
00271
00279 uint32_t ROBOOT_GetNumberOfSections(void);
00280
00283 #endif