am_reg_jedec.h 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. //*****************************************************************************
  2. //
  3. // am_reg_jedec.h
  4. //! @file
  5. //!
  6. //! @brief Register macros for the JEDEC module
  7. //
  8. //*****************************************************************************
  9. //*****************************************************************************
  10. //
  11. // Copyright (c) 2017, Ambiq Micro
  12. // All rights reserved.
  13. //
  14. // Redistribution and use in source and binary forms, with or without
  15. // modification, are permitted provided that the following conditions are met:
  16. //
  17. // 1. Redistributions of source code must retain the above copyright notice,
  18. // this list of conditions and the following disclaimer.
  19. //
  20. // 2. Redistributions in binary form must reproduce the above copyright
  21. // notice, this list of conditions and the following disclaimer in the
  22. // documentation and/or other materials provided with the distribution.
  23. //
  24. // 3. Neither the name of the copyright holder nor the names of its
  25. // contributors may be used to endorse or promote products derived from this
  26. // software without specific prior written permission.
  27. //
  28. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  29. // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  30. // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  31. // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
  32. // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  33. // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  34. // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  35. // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  36. // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  37. // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  38. // POSSIBILITY OF SUCH DAMAGE.
  39. //
  40. // This is part of revision 1.2.11 of the AmbiqSuite Development Package.
  41. //
  42. //*****************************************************************************
  43. #ifndef AM_REG_JEDEC_H
  44. #define AM_REG_JEDEC_H
  45. //*****************************************************************************
  46. //
  47. // Instance finder. (1 instance(s) available)
  48. //
  49. //*****************************************************************************
  50. #define AM_REG_JEDEC_NUM_MODULES 1
  51. #define AM_REG_JEDECn(n) \
  52. (REG_JEDEC_BASEADDR + 0x00000000 * n)
  53. //*****************************************************************************
  54. //
  55. // Register offsets.
  56. //
  57. //*****************************************************************************
  58. #define AM_REG_JEDEC_PID4_O 0xF0000FD0
  59. #define AM_REG_JEDEC_PID5_O 0xF0000FD4
  60. #define AM_REG_JEDEC_PID6_O 0xF0000FD8
  61. #define AM_REG_JEDEC_PID7_O 0xF0000FDC
  62. #define AM_REG_JEDEC_PID0_O 0xF0000FE0
  63. #define AM_REG_JEDEC_PID1_O 0xF0000FE4
  64. #define AM_REG_JEDEC_PID2_O 0xF0000FE8
  65. #define AM_REG_JEDEC_PID3_O 0xF0000FEC
  66. #define AM_REG_JEDEC_CID0_O 0xF0000FF0
  67. #define AM_REG_JEDEC_CID1_O 0xF0000FF4
  68. #define AM_REG_JEDEC_CID2_O 0xF0000FF8
  69. #define AM_REG_JEDEC_CID3_O 0xF0000FFC
  70. //*****************************************************************************
  71. //
  72. // JEDEC_PID4 - JEP Continuation Register
  73. //
  74. //*****************************************************************************
  75. // Contains the JEP Continuation bits.
  76. #define AM_REG_JEDEC_PID4_JEPCONT_S 0
  77. #define AM_REG_JEDEC_PID4_JEPCONT_M 0x0000000F
  78. #define AM_REG_JEDEC_PID4_JEPCONT(n) (((uint32_t)(n) << 0) & 0x0000000F)
  79. //*****************************************************************************
  80. //
  81. // JEDEC_PID5 - JEP reserved Register
  82. //
  83. //*****************************************************************************
  84. // Contains the value of 0x00000000.
  85. #define AM_REG_JEDEC_PID5_VALUE_S 0
  86. #define AM_REG_JEDEC_PID5_VALUE_M 0xFFFFFFFF
  87. #define AM_REG_JEDEC_PID5_VALUE(n) (((uint32_t)(n) << 0) & 0xFFFFFFFF)
  88. //*****************************************************************************
  89. //
  90. // JEDEC_PID6 - JEP reserved Register
  91. //
  92. //*****************************************************************************
  93. // Contains the value of 0x00000000.
  94. #define AM_REG_JEDEC_PID6_VALUE_S 0
  95. #define AM_REG_JEDEC_PID6_VALUE_M 0xFFFFFFFF
  96. #define AM_REG_JEDEC_PID6_VALUE(n) (((uint32_t)(n) << 0) & 0xFFFFFFFF)
  97. //*****************************************************************************
  98. //
  99. // JEDEC_PID7 - JEP reserved Register
  100. //
  101. //*****************************************************************************
  102. // Contains the value of 0x00000000.
  103. #define AM_REG_JEDEC_PID7_VALUE_S 0
  104. #define AM_REG_JEDEC_PID7_VALUE_M 0xFFFFFFFF
  105. #define AM_REG_JEDEC_PID7_VALUE(n) (((uint32_t)(n) << 0) & 0xFFFFFFFF)
  106. //*****************************************************************************
  107. //
  108. // JEDEC_PID0 - Ambiq Partnum low byte
  109. //
  110. //*****************************************************************************
  111. // Contains the low 8 bits of the Ambiq Micro device part number.
  112. #define AM_REG_JEDEC_PID0_PNL8_S 0
  113. #define AM_REG_JEDEC_PID0_PNL8_M 0x000000FF
  114. #define AM_REG_JEDEC_PID0_PNL8(n) (((uint32_t)(n) << 0) & 0x000000FF)
  115. //*****************************************************************************
  116. //
  117. // JEDEC_PID1 - Ambiq part number high-nibble, JEPID low-nibble.
  118. //
  119. //*****************************************************************************
  120. // Contains the low 4 bits of the Ambiq Micro JEDEC JEP-106 ID. The full JEPID
  121. // is therefore 0x9B.
  122. #define AM_REG_JEDEC_PID1_JEPIDL_S 4
  123. #define AM_REG_JEDEC_PID1_JEPIDL_M 0x000000F0
  124. #define AM_REG_JEDEC_PID1_JEPIDL(n) (((uint32_t)(n) << 4) & 0x000000F0)
  125. // Contains the high 4 bits of the Ambiq Micro device part number.
  126. #define AM_REG_JEDEC_PID1_PNH4_S 0
  127. #define AM_REG_JEDEC_PID1_PNH4_M 0x0000000F
  128. #define AM_REG_JEDEC_PID1_PNH4(n) (((uint32_t)(n) << 0) & 0x0000000F)
  129. //*****************************************************************************
  130. //
  131. // JEDEC_PID2 - Ambiq chip revision low-nibble, JEPID high-nibble
  132. //
  133. //*****************************************************************************
  134. // Contains the high 4 bits of the Ambiq Micro CHIPREV (see also
  135. // MCUCTRL.CHIPREV). Note that this field will change with each revision of the
  136. // chip.
  137. #define AM_REG_JEDEC_PID2_CHIPREVH4_S 4
  138. #define AM_REG_JEDEC_PID2_CHIPREVH4_M 0x000000F0
  139. #define AM_REG_JEDEC_PID2_CHIPREVH4(n) (((uint32_t)(n) << 4) & 0x000000F0)
  140. // Contains the high 3 bits of the Ambiq Micro JEPID. Note that bit3 of this
  141. // field is hard-coded to 1. The full JEPID is therefore 0x9B.
  142. #define AM_REG_JEDEC_PID2_JEPIDH_S 0
  143. #define AM_REG_JEDEC_PID2_JEPIDH_M 0x0000000F
  144. #define AM_REG_JEDEC_PID2_JEPIDH(n) (((uint32_t)(n) << 0) & 0x0000000F)
  145. //*****************************************************************************
  146. //
  147. // JEDEC_PID3 - Ambiq chip revision high-nibble.
  148. //
  149. //*****************************************************************************
  150. // Contains the low 4 bits of the Ambiq Micro CHIPREV (see also
  151. // MCUCTRL.CHIPREV). Note that this field will change with each revision of the
  152. // chip.
  153. #define AM_REG_JEDEC_PID3_CHIPREVL4_S 4
  154. #define AM_REG_JEDEC_PID3_CHIPREVL4_M 0x000000F0
  155. #define AM_REG_JEDEC_PID3_CHIPREVL4(n) (((uint32_t)(n) << 4) & 0x000000F0)
  156. // This field is hard-coded to 0x0.
  157. #define AM_REG_JEDEC_PID3_ZERO_S 0
  158. #define AM_REG_JEDEC_PID3_ZERO_M 0x0000000F
  159. #define AM_REG_JEDEC_PID3_ZERO(n) (((uint32_t)(n) << 0) & 0x0000000F)
  160. //*****************************************************************************
  161. //
  162. // JEDEC_CID0 - Coresight ROM Table.
  163. //
  164. //*****************************************************************************
  165. // Coresight ROM Table, CID0.
  166. #define AM_REG_JEDEC_CID0_CID_S 0
  167. #define AM_REG_JEDEC_CID0_CID_M 0x000000FF
  168. #define AM_REG_JEDEC_CID0_CID(n) (((uint32_t)(n) << 0) & 0x000000FF)
  169. //*****************************************************************************
  170. //
  171. // JEDEC_CID1 - Coresight ROM Table.
  172. //
  173. //*****************************************************************************
  174. // Coresight ROM Table, CID1.
  175. #define AM_REG_JEDEC_CID1_CID_S 0
  176. #define AM_REG_JEDEC_CID1_CID_M 0x000000FF
  177. #define AM_REG_JEDEC_CID1_CID(n) (((uint32_t)(n) << 0) & 0x000000FF)
  178. //*****************************************************************************
  179. //
  180. // JEDEC_CID2 - Coresight ROM Table.
  181. //
  182. //*****************************************************************************
  183. // Coresight ROM Table, CID2.
  184. #define AM_REG_JEDEC_CID2_CID_S 0
  185. #define AM_REG_JEDEC_CID2_CID_M 0x000000FF
  186. #define AM_REG_JEDEC_CID2_CID(n) (((uint32_t)(n) << 0) & 0x000000FF)
  187. //*****************************************************************************
  188. //
  189. // JEDEC_CID3 - Coresight ROM Table.
  190. //
  191. //*****************************************************************************
  192. // Coresight ROM Table, CID3.
  193. #define AM_REG_JEDEC_CID3_CID_S 0
  194. #define AM_REG_JEDEC_CID3_CID_M 0x000000FF
  195. #define AM_REG_JEDEC_CID3_CID(n) (((uint32_t)(n) << 0) & 0x000000FF)
  196. #endif // AM_REG_JEDEC_H