sec_cfg_v1.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. #ifndef SEC_CFG_V1_H
  2. #define SEC_CFG_V1_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. * SECURE DOWNLOAD LOCK TABLE
  13. **************************************************************************/
  14. #define MAX_IMG_LOCK_COUNT (20)
  15. #define IMAGE_LOCK_MAGIC (0x4C4C4C4C) /* LLLL */
  16. typedef struct {
  17. unsigned int magic_number;
  18. unsigned char name[32]; /* partition name */
  19. unsigned char unlocked;
  20. } IMAGE_DL_LOCK_INFO;
  21. typedef struct {
  22. unsigned int magic_number;
  23. unsigned char lock_not_all;
  24. IMAGE_DL_LOCK_INFO lock_info[MAX_IMG_LOCK_COUNT];
  25. } SECURE_DL_LOCK_TABLE;
  26. /**************************************************************************
  27. * SECURE IMAGE HEADER
  28. **************************************************************************/
  29. typedef struct {
  30. unsigned int magic_number;
  31. unsigned char name[16]; /* index for identification */
  32. unsigned int real_offset; /* download agent will update the real offset */
  33. ROM_TYPE image_type; /* yaffs2 format or raw binary */
  34. SEC_IMG_ATTR attr; /* image attributes */
  35. SEC_IMG_HEADER_U header;
  36. unsigned char signature_hash[HASH_SIG_LEN];
  37. } SECURE_IMG_INFO_V1;
  38. /**************************************************************************
  39. * SECURE CFG FORMAT
  40. **************************************************************************/
  41. #define SECURE_IMAGE_COUNT (12)
  42. #define SEC_CFG_RESERVED (4)
  43. /* ================================= */
  44. /* SECCFG FORMAT */
  45. /* ================================= */
  46. typedef struct {
  47. unsigned char id[16];
  48. unsigned int magic_number;
  49. unsigned int lib_ver;
  50. unsigned int sec_cfg_size;
  51. unsigned char sw_sec_lock_try;
  52. unsigned char sw_sec_lock_done;
  53. unsigned short page_size;
  54. unsigned int page_count;
  55. /* ================== */
  56. /* encrypted region { */
  57. /* ================== */
  58. SECURE_IMG_INFO_V1 image_info[SECURE_IMAGE_COUNT];
  59. SIU_STATUS siu_status;
  60. unsigned char reserve[SEC_CFG_RESERVED];
  61. SECCFG_STATUS status;
  62. SECCFG_ATTR attr;
  63. /* ================== */
  64. /* encrypted region } */
  65. /* ================== */
  66. SECURE_DL_LOCK_TABLE lock_table;
  67. unsigned int end_pattern;
  68. } SECURE_CFG_V1;
  69. #endif /* SEC_CFG_V1_H */