fsl_sec.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /*
  2. * Common internal memory map for some Freescale SoCs
  3. *
  4. * Copyright 2014 Freescale Semiconductor, Inc.
  5. *
  6. */
  7. #ifndef __FSL_SEC_H
  8. #define __FSL_SEC_H
  9. #include <common.h>
  10. #include <asm/io.h>
  11. #ifdef CONFIG_SYS_FSL_SEC_LE
  12. #define sec_in32(a) in_le32(a)
  13. #define sec_out32(a, v) out_le32(a, v)
  14. #define sec_in16(a) in_le16(a)
  15. #define sec_clrbits32 clrbits_le32
  16. #define sec_setbits32 setbits_le32
  17. #elif defined(CONFIG_SYS_FSL_SEC_BE)
  18. #define sec_in32(a) in_be32(a)
  19. #define sec_out32(a, v) out_be32(a, v)
  20. #define sec_in16(a) in_be16(a)
  21. #define sec_clrbits32 clrbits_be32
  22. #define sec_setbits32 setbits_be32
  23. #else
  24. #error Neither CONFIG_SYS_FSL_SEC_LE nor CONFIG_SYS_FSL_SEC_BE is defined
  25. #endif
  26. /* Security Engine Block (MS = Most Sig., LS = Least Sig.) */
  27. #if CONFIG_SYS_FSL_SEC_COMPAT >= 4
  28. typedef struct ccsr_sec {
  29. u32 res0;
  30. u32 mcfgr; /* Master CFG Register */
  31. u8 res1[0x4];
  32. u32 scfgr;
  33. struct {
  34. u32 ms; /* Job Ring LIODN Register, MS */
  35. u32 ls; /* Job Ring LIODN Register, LS */
  36. } jrliodnr[4];
  37. u8 res2[0x2c];
  38. u32 jrstartr; /* Job Ring Start Register */
  39. struct {
  40. u32 ms; /* RTIC LIODN Register, MS */
  41. u32 ls; /* RTIC LIODN Register, LS */
  42. } rticliodnr[4];
  43. u8 res3[0x1c];
  44. u32 decorr; /* DECO Request Register */
  45. struct {
  46. u32 ms; /* DECO LIODN Register, MS */
  47. u32 ls; /* DECO LIODN Register, LS */
  48. } decoliodnr[8];
  49. u8 res4[0x40];
  50. u32 dar; /* DECO Avail Register */
  51. u32 drr; /* DECO Reset Register */
  52. u8 res5[0xe78];
  53. u32 crnr_ms; /* CHA Revision Number Register, MS */
  54. u32 crnr_ls; /* CHA Revision Number Register, LS */
  55. u32 ctpr_ms; /* Compile Time Parameters Register, MS */
  56. u32 ctpr_ls; /* Compile Time Parameters Register, LS */
  57. u8 res6[0x10];
  58. u32 far_ms; /* Fault Address Register, MS */
  59. u32 far_ls; /* Fault Address Register, LS */
  60. u32 falr; /* Fault Address LIODN Register */
  61. u32 fadr; /* Fault Address Detail Register */
  62. u8 res7[0x4];
  63. u32 csta; /* CAAM Status Register */
  64. u8 res8[0x8];
  65. u32 rvid; /* Run Time Integrity Checking Version ID Reg.*/
  66. u32 ccbvid; /* CHA Cluster Block Version ID Register */
  67. u32 chavid_ms; /* CHA Version ID Register, MS */
  68. u32 chavid_ls; /* CHA Version ID Register, LS */
  69. u32 chanum_ms; /* CHA Number Register, MS */
  70. u32 chanum_ls; /* CHA Number Register, LS */
  71. u32 secvid_ms; /* SEC Version ID Register, MS */
  72. u32 secvid_ls; /* SEC Version ID Register, LS */
  73. u8 res9[0x6020];
  74. u32 qilcr_ms; /* Queue Interface LIODN CFG Register, MS */
  75. u32 qilcr_ls; /* Queue Interface LIODN CFG Register, LS */
  76. u8 res10[0x8fd8];
  77. } ccsr_sec_t;
  78. #define SEC_CTPR_MS_AXI_LIODN 0x08000000
  79. #define SEC_CTPR_MS_QI 0x02000000
  80. #define SEC_CTPR_MS_VIRT_EN_INCL 0x00000001
  81. #define SEC_CTPR_MS_VIRT_EN_POR 0x00000002
  82. #define SEC_RVID_MA 0x0f000000
  83. #define SEC_CHANUM_MS_JRNUM_MASK 0xf0000000
  84. #define SEC_CHANUM_MS_JRNUM_SHIFT 28
  85. #define SEC_CHANUM_MS_DECONUM_MASK 0x0f000000
  86. #define SEC_CHANUM_MS_DECONUM_SHIFT 24
  87. #define SEC_SECVID_MS_IPID_MASK 0xffff0000
  88. #define SEC_SECVID_MS_IPID_SHIFT 16
  89. #define SEC_SECVID_MS_MAJ_REV_MASK 0x0000ff00
  90. #define SEC_SECVID_MS_MAJ_REV_SHIFT 8
  91. #define SEC_CCBVID_ERA_MASK 0xff000000
  92. #define SEC_CCBVID_ERA_SHIFT 24
  93. #define SEC_SCFGR_RDBENABLE 0x00000400
  94. #define SEC_SCFGR_VIRT_EN 0x00008000
  95. #define SEC_CHAVID_LS_RNG_SHIFT 16
  96. #define SEC_CHAVID_RNG_LS_MASK 0x000f0000
  97. #endif
  98. #endif /* __FSL_SEC_H */