bsec3_reg.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /*
  2. * Copyright (c) 2024, STMicroelectronics - All Rights Reserved
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef BSEC3_REG_H
  7. #define BSEC3_REG_H
  8. #include <lib/utils_def.h>
  9. /* BSEC REGISTER OFFSET (base relative) */
  10. #define BSEC_FVR(x) (U(0x000) + 4U * (x))
  11. #define BSEC_SPLOCK(x) (U(0x800) + 4U * (x))
  12. #define BSEC_SWLOCK(x) (U(0x840) + 4U * (x))
  13. #define BSEC_SRLOCK(x) (U(0x880) + 4U * (x))
  14. #define BSEC_OTPVLDR(x) (U(0x8C0) + 4U * (x))
  15. #define BSEC_SFSR(x) (U(0x940) + 4U * (x))
  16. #define BSEC_OTPCR U(0xC04)
  17. #define BSEC_WDR U(0xC08)
  18. #define BSEC_SCRATCHR0 U(0xE00)
  19. #define BSEC_SCRATCHR1 U(0xE04)
  20. #define BSEC_SCRATCHR2 U(0xE08)
  21. #define BSEC_SCRATCHR3 U(0xE0C)
  22. #define BSEC_LOCKR U(0xE10)
  23. #define BSEC_JTAGINR U(0xE14)
  24. #define BSEC_JTAGOUTR U(0xE18)
  25. #define BSEC_DENR U(0xE20)
  26. #define BSEC_UNMAPR U(0xE24)
  27. #define BSEC_SR U(0xE40)
  28. #define BSEC_OTPSR U(0xE44)
  29. #define BSEC_WRCR U(0xF00)
  30. #define BSEC_HWCFGR U(0xFF0)
  31. #define BSEC_VERR U(0xFF4)
  32. #define BSEC_IPIDR U(0xFF8)
  33. #define BSEC_SIDR U(0xFFC)
  34. /* BSEC_OTPCR register fields */
  35. #define BSEC_OTPCR_ADDR_MASK GENMASK_32(8, 0)
  36. #define BSEC_OTPCR_ADDR_SHIFT U(0)
  37. #define BSEC_OTPCR_PROG BIT_32(13)
  38. #define BSEC_OTPCR_PPLOCK BIT_32(14)
  39. #define BSEC_OTPCR_LASTCID_MASK GENMASK_32(21, 19)
  40. #define BSEC_OTPCR_LASTCID_SHIFT U(19)
  41. /* BSEC_LOCKR register fields */
  42. #define BSEC_LOCKR_GWLOCK_MASK BIT_32(0)
  43. #define BSEC_LOCKR_GWLOCK_SHIFT U(0)
  44. #define BSEC_LOCKR_DENLOCK_MASK BIT_32(1)
  45. #define BSEC_LOCKR_DENLOCK_SHIFT U(1)
  46. #define BSEC_LOCKR_HKLOCK_MASK BIT_32(2)
  47. #define BSEC_LOCKR_HKLOCK_SHIFT U(2)
  48. /* BSEC_DENR register fields */
  49. #define BSEC_DENR_LPDBGEN BIT_32(0)
  50. #define BSEC_DENR_DBGENA BIT_32(1)
  51. #define BSEC_DENR_NIDENA BIT_32(2)
  52. #define BSEC_DENR_DEVICEEN BIT_32(3)
  53. #define BSEC_DENR_HDPEN BIT_32(4)
  54. #define BSEC_DENR_SPIDENA BIT_32(5)
  55. #define BSEC_DENR_SPNIDENA BIT_32(6)
  56. #define BSEC_DENR_DBGSWEN BIT_32(7)
  57. #define BSEC_DENR_DBGENM BIT_32(8)
  58. #define BSEC_DENR_NIDENM BIT_32(9)
  59. #define BSEC_DENR_SPIDENM BIT_32(10)
  60. #define BSEC_DENR_SPNIDENM BIT_32(11)
  61. #define BSEC_DENR_CFGSDIS BIT_32(12)
  62. #define BSEC_DENR_CP15SDIS_MASK GENMASK_32(14, 13)
  63. #define BSEC_DENR_CP15SDIS_SHIFT U(13)
  64. #define BSEC_DENR_LPDBGDIS BIT_32(15)
  65. #define BSEC_DENR_ALL_MSK GENMASK_32(15, 0)
  66. /* BSEC_SR register fields */
  67. #define BSEC_SR_BUSY BIT_32(0)
  68. #define BSEC_SR_HVALID BIT_32(1)
  69. #define BSEC_SR_RNGERR BIT_32(2)
  70. #define BSEC_SR_HKWW_MASK GENMASK_32(15, 8)
  71. #define BSEC_SR_HKWW_SHIFT U(8)
  72. #define BSEC_SR_NVSTATE_MASK GENMASK_32(31, 26)
  73. #define BSEC_SR_NVSTATE_SHIFT U(26)
  74. #define BSEC_SR_NVSTATE_OPEN U(0x16)
  75. #define BSEC_SR_NVSTATE_CLOSED U(0x0D)
  76. #define BSEC_SR_NVSTATE_OTP_LOCKED U(0x23)
  77. /* BSEC_OTPSR register fields */
  78. #define BSEC_OTPSR_BUSY BIT_32(0)
  79. #define BSEC_OTPSR_FUSEOK BIT_32(1)
  80. #define BSEC_OTPSR_HIDEUP BIT_32(2)
  81. #define BSEC_OTPSR_OTPNVIR BIT_32(4)
  82. #define BSEC_OTPSR_OTPERR BIT_32(5)
  83. #define BSEC_OTPSR_OTPSEC BIT_32(6)
  84. #define BSEC_OTPSR_PROGFAIL BIT_32(16)
  85. #define BSEC_OTPSR_DISTURBF BIT_32(17)
  86. #define BSEC_OTPSR_DEDF BIT_32(18)
  87. #define BSEC_OTPSR_SECF BIT_32(19)
  88. #define BSEC_OTPSR_PPLF BIT_32(20)
  89. #define BSEC_OTPSR_PPLMF BIT_32(21)
  90. #define BSEC_OTPSR_AMEF BIT_32(22)
  91. /* BSEC_VERR register fields */
  92. #define BSEC_VERR_MASK GENMASK_32(7, 0)
  93. #endif /* BSEC3_REG_H */