sec_cfg_v3.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #ifndef SEC_CFG_V3_H
  2. #define SEC_CFG_V3_H
  3. /**************************************************************************
  4. * INCLUDE SEC CFG COMMON
  5. **************************************************************************/
  6. #include "sec_cfg_common.h"
  7. /**************************************************************************
  8. * INCLUDE SIGN HEADER FORMAT
  9. **************************************************************************/
  10. #include "sec_sign_header.h"
  11. /**************************************************************************
  12. * SECCFG EXTENSION REGION
  13. **************************************************************************/
  14. #define EXT_REGION_BUF_SIZE (4096) /* used to store extension headers */
  15. typedef struct {
  16. unsigned int content_len; /* total used data length */
  17. unsigned char buf[EXT_REGION_BUF_SIZE];
  18. } SECCFG_EXT_REGION;
  19. /**************************************************************************
  20. * SECURE IMAGE HEADER
  21. **************************************************************************/
  22. typedef struct {
  23. unsigned int magic_number;
  24. unsigned char name[16]; /* index for identification */
  25. unsigned int real_offset; /* download agent will update the real offset */
  26. ROM_TYPE image_type; /* yaffs2 format or raw binary */
  27. SEC_IMG_ATTR image_attr; /* image attributes */
  28. SEC_IMG_HEADER_U header; /* image sign header */
  29. unsigned int ext_offset; /* offset of extension header */
  30. unsigned int ext_len; /* length of extension header */
  31. } SECURE_IMG_INFO_V3;
  32. /**************************************************************************
  33. * SECURE CFG FORMAT
  34. **************************************************************************/
  35. #define SECURE_IMAGE_COUNT_V3 (20)
  36. /* ================================= */
  37. /* SECCFG FORMAT */
  38. /* ================================= */
  39. typedef struct {
  40. unsigned char id[16];
  41. unsigned int magic_number;
  42. unsigned int seccfg_ver;
  43. unsigned int seccfg_size;
  44. unsigned int seccfg_enc_offset;
  45. unsigned int seccfg_enc_len;
  46. unsigned char sw_sec_lock_try;
  47. unsigned char sw_sec_lock_done;
  48. unsigned short page_size;
  49. unsigned int page_count;
  50. /* ================== */
  51. /* encrypted region { */
  52. /* ================== */
  53. SECURE_IMG_INFO_V3 image_info[SECURE_IMAGE_COUNT_V3];
  54. SIU_STATUS siu_status;
  55. SECCFG_STATUS seccfg_status;
  56. SECCFG_ATTR seccfg_attr;
  57. SECCFG_EXT_REGION seccfg_ext;
  58. /* ================== */
  59. /* encrypted region } */
  60. /* ================== */
  61. unsigned int end_pattern;
  62. } SECURE_CFG_V3;
  63. #endif /* SEC_CFG_V3_H */