sec_cfg_common.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #ifndef SEC_CFG_COMMON_H
  2. #define SEC_CFG_COMMON_H
  3. /* ========================================================================= */
  4. /* ROM TYPE */
  5. /* ========================================================================= */
  6. typedef enum {
  7. NORMAL_ROM = 0x01,
  8. YAFFS_IMG = 0x08,
  9. } ROM_TYPE;
  10. /* ========================================================================= */
  11. /* SECURE IMAGE HEADER */
  12. /* ========================================================================= */
  13. /* one image comes with one secure image information. */
  14. #define SEC_IMG_MAGIC_NUM (0x49494949) /* IIII */
  15. typedef enum {
  16. ATTR_SEC_IMG_UPDATE = 0x10, /* only used in FlashTool */
  17. ATTR_SEC_IMG_COMPLETE = 0x43434343, /* CCCC */
  18. ATTR_SEC_IMG_INCOMPLETE = 0x49494949, /* IIII */
  19. ATTR_SEC_IMG_FORCE_UPDATE = 0x46464646 /* FFFF */
  20. } SEC_IMG_ATTR;
  21. /* ========================================================================= */
  22. /* SECURE CFG STORAGE CONFIG */
  23. /* ========================================================================= */
  24. /* buffer allocated in DA */
  25. #define SEC_BUF_LEN (0x3000)
  26. /* ========================================================================= */
  27. /* SECURE CFG VERSION */
  28. /* ========================================================================= */
  29. #define SECCFG_SUPPORT_VERSION (0x1)
  30. /* ========================================================================= */
  31. /* SECURE CFG FORMAT */
  32. /* ========================================================================= */
  33. #define SEC_CFG_MAGIC_NUM (0x4D4D4D4D) /* MMMM */
  34. #define SEC_CFG_BEGIN "AND_SECCFG_v"
  35. #define SEC_CFG_BEGIN_LEN (12)
  36. /* in order to avoid power loss potential issue */
  37. /* before sec cfg start to update, status will be set as in-complete. */
  38. typedef enum {
  39. SEC_CFG_COMPLETE_NUM = 0x43434343, /* CCCC */
  40. SEC_CFG_INCOMPLETE_NUM = 0x49494949 /* IIII */
  41. } SECCFG_STATUS;
  42. /* attributes which can disable secure boot (internal use only) */
  43. typedef enum {
  44. ATTR_DEFAULT = 0x33333333, /* 3333 */
  45. ATTR_DISABLE_IMG_CHECK = 0x44444444 /* DDDD */
  46. } SECCFG_ATTR;
  47. /* specify image was upgraded by SIU or flash tool */
  48. typedef enum {
  49. UBOOT_UPDATED_BY_SIU = 0x0001,
  50. BOOT_UPDATED_BY_SIU = 0x0010,
  51. RECOVERY_UPDATED_BY_SIU = 0x0100,
  52. SYSTEM_UPDATED_BY_SIU = 0x1000
  53. } SIU_STATUS;
  54. /* end pattern for debugging */
  55. #define SEC_CFG_END_PATTERN (0x45454545) /* EEEE */
  56. #endif /* SEC_CFG_COMMON_H */