dsu.h 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554
  1. /**
  2. * \file
  3. *
  4. * \brief Component description for DSU
  5. *
  6. * Copyright (c) 2014-2015 Atmel Corporation. All rights reserved.
  7. *
  8. * \asf_license_start
  9. *
  10. * \page License
  11. *
  12. * Redistribution and use in source and binary forms, with or without
  13. * modification, are permitted provided that the following conditions are met:
  14. *
  15. * 1. Redistributions of source code must retain the above copyright notice,
  16. * this list of conditions and the following disclaimer.
  17. *
  18. * 2. Redistributions in binary form must reproduce the above copyright notice,
  19. * this list of conditions and the following disclaimer in the documentation
  20. * and/or other materials provided with the distribution.
  21. *
  22. * 3. The name of Atmel may not be used to endorse or promote products derived
  23. * from this software without specific prior written permission.
  24. *
  25. * 4. This software may only be redistributed and used in connection with an
  26. * Atmel microcontroller product.
  27. *
  28. * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
  29. * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  30. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
  31. * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
  32. * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  33. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  34. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  35. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  36. * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
  37. * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  38. * POSSIBILITY OF SUCH DAMAGE.
  39. *
  40. * \asf_license_stop
  41. *
  42. */
  43. /*
  44. * Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a>
  45. */
  46. #ifndef _SAMD21_DSU_COMPONENT_
  47. #define _SAMD21_DSU_COMPONENT_
  48. /* ========================================================================== */
  49. /** SOFTWARE API DEFINITION FOR DSU */
  50. /* ========================================================================== */
  51. /** \addtogroup SAMD21_DSU Device Service Unit */
  52. /*@{*/
  53. #define DSU_U2209
  54. #define REV_DSU 0x202
  55. /* -------- DSU_CTRL : (DSU Offset: 0x0000) ( /W 8) Control -------- */
  56. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  57. typedef union {
  58. struct {
  59. uint8_t SWRST:1; /*!< bit: 0 Software Reset */
  60. uint8_t :1; /*!< bit: 1 Reserved */
  61. uint8_t CRC:1; /*!< bit: 2 32-bit Cyclic Redundancy Check */
  62. uint8_t MBIST:1; /*!< bit: 3 Memory Built-In Self-Test */
  63. uint8_t CE:1; /*!< bit: 4 Chip Erase */
  64. uint8_t :3; /*!< bit: 5.. 7 Reserved */
  65. } bit; /*!< Structure used for bit access */
  66. uint8_t reg; /*!< Type used for register access */
  67. } DSU_CTRL_Type;
  68. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  69. #define DSU_CTRL_OFFSET 0x0000 /**< \brief (DSU_CTRL offset) Control */
  70. #define DSU_CTRL_RESETVALUE 0x00ul /**< \brief (DSU_CTRL reset_value) Control */
  71. #define DSU_CTRL_SWRST_Pos 0 /**< \brief (DSU_CTRL) Software Reset */
  72. #define DSU_CTRL_SWRST (0x1ul << DSU_CTRL_SWRST_Pos)
  73. #define DSU_CTRL_CRC_Pos 2 /**< \brief (DSU_CTRL) 32-bit Cyclic Redundancy Check */
  74. #define DSU_CTRL_CRC (0x1ul << DSU_CTRL_CRC_Pos)
  75. #define DSU_CTRL_MBIST_Pos 3 /**< \brief (DSU_CTRL) Memory Built-In Self-Test */
  76. #define DSU_CTRL_MBIST (0x1ul << DSU_CTRL_MBIST_Pos)
  77. #define DSU_CTRL_CE_Pos 4 /**< \brief (DSU_CTRL) Chip Erase */
  78. #define DSU_CTRL_CE (0x1ul << DSU_CTRL_CE_Pos)
  79. #define DSU_CTRL_MASK 0x1Dul /**< \brief (DSU_CTRL) MASK Register */
  80. /* -------- DSU_STATUSA : (DSU Offset: 0x0001) (R/W 8) Status A -------- */
  81. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  82. typedef union {
  83. struct {
  84. uint8_t DONE:1; /*!< bit: 0 Done */
  85. uint8_t CRSTEXT:1; /*!< bit: 1 CPU Reset Phase Extension */
  86. uint8_t BERR:1; /*!< bit: 2 Bus Error */
  87. uint8_t FAIL:1; /*!< bit: 3 Failure */
  88. uint8_t PERR:1; /*!< bit: 4 Protection Error */
  89. uint8_t :3; /*!< bit: 5.. 7 Reserved */
  90. } bit; /*!< Structure used for bit access */
  91. uint8_t reg; /*!< Type used for register access */
  92. } DSU_STATUSA_Type;
  93. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  94. #define DSU_STATUSA_OFFSET 0x0001 /**< \brief (DSU_STATUSA offset) Status A */
  95. #define DSU_STATUSA_RESETVALUE 0x00ul /**< \brief (DSU_STATUSA reset_value) Status A */
  96. #define DSU_STATUSA_DONE_Pos 0 /**< \brief (DSU_STATUSA) Done */
  97. #define DSU_STATUSA_DONE (0x1ul << DSU_STATUSA_DONE_Pos)
  98. #define DSU_STATUSA_CRSTEXT_Pos 1 /**< \brief (DSU_STATUSA) CPU Reset Phase Extension */
  99. #define DSU_STATUSA_CRSTEXT (0x1ul << DSU_STATUSA_CRSTEXT_Pos)
  100. #define DSU_STATUSA_BERR_Pos 2 /**< \brief (DSU_STATUSA) Bus Error */
  101. #define DSU_STATUSA_BERR (0x1ul << DSU_STATUSA_BERR_Pos)
  102. #define DSU_STATUSA_FAIL_Pos 3 /**< \brief (DSU_STATUSA) Failure */
  103. #define DSU_STATUSA_FAIL (0x1ul << DSU_STATUSA_FAIL_Pos)
  104. #define DSU_STATUSA_PERR_Pos 4 /**< \brief (DSU_STATUSA) Protection Error */
  105. #define DSU_STATUSA_PERR (0x1ul << DSU_STATUSA_PERR_Pos)
  106. #define DSU_STATUSA_MASK 0x1Ful /**< \brief (DSU_STATUSA) MASK Register */
  107. /* -------- DSU_STATUSB : (DSU Offset: 0x0002) (R/ 8) Status B -------- */
  108. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  109. typedef union {
  110. struct {
  111. uint8_t PROT:1; /*!< bit: 0 Protected */
  112. uint8_t DBGPRES:1; /*!< bit: 1 Debugger Present */
  113. uint8_t DCCD0:1; /*!< bit: 2 Debug Communication Channel 0 Dirty */
  114. uint8_t DCCD1:1; /*!< bit: 3 Debug Communication Channel 1 Dirty */
  115. uint8_t HPE:1; /*!< bit: 4 Hot-Plugging Enable */
  116. uint8_t :3; /*!< bit: 5.. 7 Reserved */
  117. } bit; /*!< Structure used for bit access */
  118. struct {
  119. uint8_t :2; /*!< bit: 0.. 1 Reserved */
  120. uint8_t DCCD:2; /*!< bit: 2.. 3 Debug Communication Channel x Dirty */
  121. uint8_t :4; /*!< bit: 4.. 7 Reserved */
  122. } vec; /*!< Structure used for vec access */
  123. uint8_t reg; /*!< Type used for register access */
  124. } DSU_STATUSB_Type;
  125. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  126. #define DSU_STATUSB_OFFSET 0x0002 /**< \brief (DSU_STATUSB offset) Status B */
  127. #define DSU_STATUSB_RESETVALUE 0x10ul /**< \brief (DSU_STATUSB reset_value) Status B */
  128. #define DSU_STATUSB_PROT_Pos 0 /**< \brief (DSU_STATUSB) Protected */
  129. #define DSU_STATUSB_PROT (0x1ul << DSU_STATUSB_PROT_Pos)
  130. #define DSU_STATUSB_DBGPRES_Pos 1 /**< \brief (DSU_STATUSB) Debugger Present */
  131. #define DSU_STATUSB_DBGPRES (0x1ul << DSU_STATUSB_DBGPRES_Pos)
  132. #define DSU_STATUSB_DCCD0_Pos 2 /**< \brief (DSU_STATUSB) Debug Communication Channel 0 Dirty */
  133. #define DSU_STATUSB_DCCD0 (1 << DSU_STATUSB_DCCD0_Pos)
  134. #define DSU_STATUSB_DCCD1_Pos 3 /**< \brief (DSU_STATUSB) Debug Communication Channel 1 Dirty */
  135. #define DSU_STATUSB_DCCD1 (1 << DSU_STATUSB_DCCD1_Pos)
  136. #define DSU_STATUSB_DCCD_Pos 2 /**< \brief (DSU_STATUSB) Debug Communication Channel x Dirty */
  137. #define DSU_STATUSB_DCCD_Msk (0x3ul << DSU_STATUSB_DCCD_Pos)
  138. #define DSU_STATUSB_DCCD(value) ((DSU_STATUSB_DCCD_Msk & ((value) << DSU_STATUSB_DCCD_Pos)))
  139. #define DSU_STATUSB_HPE_Pos 4 /**< \brief (DSU_STATUSB) Hot-Plugging Enable */
  140. #define DSU_STATUSB_HPE (0x1ul << DSU_STATUSB_HPE_Pos)
  141. #define DSU_STATUSB_MASK 0x1Ful /**< \brief (DSU_STATUSB) MASK Register */
  142. /* -------- DSU_ADDR : (DSU Offset: 0x0004) (R/W 32) Address -------- */
  143. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  144. typedef union {
  145. struct {
  146. uint32_t :2; /*!< bit: 0.. 1 Reserved */
  147. uint32_t ADDR:30; /*!< bit: 2..31 Address */
  148. } bit; /*!< Structure used for bit access */
  149. uint32_t reg; /*!< Type used for register access */
  150. } DSU_ADDR_Type;
  151. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  152. #define DSU_ADDR_OFFSET 0x0004 /**< \brief (DSU_ADDR offset) Address */
  153. #define DSU_ADDR_RESETVALUE 0x00000000ul /**< \brief (DSU_ADDR reset_value) Address */
  154. #define DSU_ADDR_ADDR_Pos 2 /**< \brief (DSU_ADDR) Address */
  155. #define DSU_ADDR_ADDR_Msk (0x3FFFFFFFul << DSU_ADDR_ADDR_Pos)
  156. #define DSU_ADDR_ADDR(value) ((DSU_ADDR_ADDR_Msk & ((value) << DSU_ADDR_ADDR_Pos)))
  157. #define DSU_ADDR_MASK 0xFFFFFFFCul /**< \brief (DSU_ADDR) MASK Register */
  158. /* -------- DSU_LENGTH : (DSU Offset: 0x0008) (R/W 32) Length -------- */
  159. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  160. typedef union {
  161. struct {
  162. uint32_t :2; /*!< bit: 0.. 1 Reserved */
  163. uint32_t LENGTH:30; /*!< bit: 2..31 Length */
  164. } bit; /*!< Structure used for bit access */
  165. uint32_t reg; /*!< Type used for register access */
  166. } DSU_LENGTH_Type;
  167. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  168. #define DSU_LENGTH_OFFSET 0x0008 /**< \brief (DSU_LENGTH offset) Length */
  169. #define DSU_LENGTH_RESETVALUE 0x00000000ul /**< \brief (DSU_LENGTH reset_value) Length */
  170. #define DSU_LENGTH_LENGTH_Pos 2 /**< \brief (DSU_LENGTH) Length */
  171. #define DSU_LENGTH_LENGTH_Msk (0x3FFFFFFFul << DSU_LENGTH_LENGTH_Pos)
  172. #define DSU_LENGTH_LENGTH(value) ((DSU_LENGTH_LENGTH_Msk & ((value) << DSU_LENGTH_LENGTH_Pos)))
  173. #define DSU_LENGTH_MASK 0xFFFFFFFCul /**< \brief (DSU_LENGTH) MASK Register */
  174. /* -------- DSU_DATA : (DSU Offset: 0x000C) (R/W 32) Data -------- */
  175. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  176. typedef union {
  177. struct {
  178. uint32_t DATA:32; /*!< bit: 0..31 Data */
  179. } bit; /*!< Structure used for bit access */
  180. uint32_t reg; /*!< Type used for register access */
  181. } DSU_DATA_Type;
  182. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  183. #define DSU_DATA_OFFSET 0x000C /**< \brief (DSU_DATA offset) Data */
  184. #define DSU_DATA_RESETVALUE 0x00000000ul /**< \brief (DSU_DATA reset_value) Data */
  185. #define DSU_DATA_DATA_Pos 0 /**< \brief (DSU_DATA) Data */
  186. #define DSU_DATA_DATA_Msk (0xFFFFFFFFul << DSU_DATA_DATA_Pos)
  187. #define DSU_DATA_DATA(value) ((DSU_DATA_DATA_Msk & ((value) << DSU_DATA_DATA_Pos)))
  188. #define DSU_DATA_MASK 0xFFFFFFFFul /**< \brief (DSU_DATA) MASK Register */
  189. /* -------- DSU_DCC : (DSU Offset: 0x0010) (R/W 32) Debug Communication Channel n -------- */
  190. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  191. typedef union {
  192. struct {
  193. uint32_t DATA:32; /*!< bit: 0..31 Data */
  194. } bit; /*!< Structure used for bit access */
  195. uint32_t reg; /*!< Type used for register access */
  196. } DSU_DCC_Type;
  197. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  198. #define DSU_DCC_OFFSET 0x0010 /**< \brief (DSU_DCC offset) Debug Communication Channel n */
  199. #define DSU_DCC_RESETVALUE 0x00000000ul /**< \brief (DSU_DCC reset_value) Debug Communication Channel n */
  200. #define DSU_DCC_DATA_Pos 0 /**< \brief (DSU_DCC) Data */
  201. #define DSU_DCC_DATA_Msk (0xFFFFFFFFul << DSU_DCC_DATA_Pos)
  202. #define DSU_DCC_DATA(value) ((DSU_DCC_DATA_Msk & ((value) << DSU_DCC_DATA_Pos)))
  203. #define DSU_DCC_MASK 0xFFFFFFFFul /**< \brief (DSU_DCC) MASK Register */
  204. /* -------- DSU_DID : (DSU Offset: 0x0018) (R/ 32) Device Identification -------- */
  205. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  206. typedef union {
  207. struct {
  208. uint32_t DEVSEL:8; /*!< bit: 0.. 7 Device Select */
  209. uint32_t REVISION:4; /*!< bit: 8..11 Revision */
  210. uint32_t DIE:4; /*!< bit: 12..15 Die Identification */
  211. uint32_t SERIES:6; /*!< bit: 16..21 Product Series */
  212. uint32_t :1; /*!< bit: 22 Reserved */
  213. uint32_t FAMILY:5; /*!< bit: 23..27 Product Family */
  214. uint32_t PROCESSOR:4; /*!< bit: 28..31 Processor */
  215. } bit; /*!< Structure used for bit access */
  216. uint32_t reg; /*!< Type used for register access */
  217. } DSU_DID_Type;
  218. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  219. #define DSU_DID_OFFSET 0x0018 /**< \brief (DSU_DID offset) Device Identification */
  220. #define DSU_DID_DEVSEL_Pos 0 /**< \brief (DSU_DID) Device Select */
  221. #define DSU_DID_DEVSEL_Msk (0xFFul << DSU_DID_DEVSEL_Pos)
  222. #define DSU_DID_DEVSEL(value) ((DSU_DID_DEVSEL_Msk & ((value) << DSU_DID_DEVSEL_Pos)))
  223. #define DSU_DID_REVISION_Pos 8 /**< \brief (DSU_DID) Revision */
  224. #define DSU_DID_REVISION_Msk (0xFul << DSU_DID_REVISION_Pos)
  225. #define DSU_DID_REVISION(value) ((DSU_DID_REVISION_Msk & ((value) << DSU_DID_REVISION_Pos)))
  226. #define DSU_DID_DIE_Pos 12 /**< \brief (DSU_DID) Die Identification */
  227. #define DSU_DID_DIE_Msk (0xFul << DSU_DID_DIE_Pos)
  228. #define DSU_DID_DIE(value) ((DSU_DID_DIE_Msk & ((value) << DSU_DID_DIE_Pos)))
  229. #define DSU_DID_SERIES_Pos 16 /**< \brief (DSU_DID) Product Series */
  230. #define DSU_DID_SERIES_Msk (0x3Ful << DSU_DID_SERIES_Pos)
  231. #define DSU_DID_SERIES(value) ((DSU_DID_SERIES_Msk & ((value) << DSU_DID_SERIES_Pos)))
  232. #define DSU_DID_FAMILY_Pos 23 /**< \brief (DSU_DID) Product Family */
  233. #define DSU_DID_FAMILY_Msk (0x1Ful << DSU_DID_FAMILY_Pos)
  234. #define DSU_DID_FAMILY(value) ((DSU_DID_FAMILY_Msk & ((value) << DSU_DID_FAMILY_Pos)))
  235. #define DSU_DID_PROCESSOR_Pos 28 /**< \brief (DSU_DID) Processor */
  236. #define DSU_DID_PROCESSOR_Msk (0xFul << DSU_DID_PROCESSOR_Pos)
  237. #define DSU_DID_PROCESSOR(value) ((DSU_DID_PROCESSOR_Msk & ((value) << DSU_DID_PROCESSOR_Pos)))
  238. #define DSU_DID_MASK 0xFFBFFFFFul /**< \brief (DSU_DID) MASK Register */
  239. /* -------- DSU_ENTRY : (DSU Offset: 0x1000) (R/ 32) Coresight ROM Table Entry n -------- */
  240. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  241. typedef union {
  242. struct {
  243. uint32_t EPRES:1; /*!< bit: 0 Entry Present */
  244. uint32_t FMT:1; /*!< bit: 1 Format */
  245. uint32_t :10; /*!< bit: 2..11 Reserved */
  246. uint32_t ADDOFF:20; /*!< bit: 12..31 Address Offset */
  247. } bit; /*!< Structure used for bit access */
  248. uint32_t reg; /*!< Type used for register access */
  249. } DSU_ENTRY_Type;
  250. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  251. #define DSU_ENTRY_OFFSET 0x1000 /**< \brief (DSU_ENTRY offset) Coresight ROM Table Entry n */
  252. #define DSU_ENTRY_RESETVALUE 0x00000002ul /**< \brief (DSU_ENTRY reset_value) Coresight ROM Table Entry n */
  253. #define DSU_ENTRY_EPRES_Pos 0 /**< \brief (DSU_ENTRY) Entry Present */
  254. #define DSU_ENTRY_EPRES (0x1ul << DSU_ENTRY_EPRES_Pos)
  255. #define DSU_ENTRY_FMT_Pos 1 /**< \brief (DSU_ENTRY) Format */
  256. #define DSU_ENTRY_FMT (0x1ul << DSU_ENTRY_FMT_Pos)
  257. #define DSU_ENTRY_ADDOFF_Pos 12 /**< \brief (DSU_ENTRY) Address Offset */
  258. #define DSU_ENTRY_ADDOFF_Msk (0xFFFFFul << DSU_ENTRY_ADDOFF_Pos)
  259. #define DSU_ENTRY_ADDOFF(value) ((DSU_ENTRY_ADDOFF_Msk & ((value) << DSU_ENTRY_ADDOFF_Pos)))
  260. #define DSU_ENTRY_MASK 0xFFFFF003ul /**< \brief (DSU_ENTRY) MASK Register */
  261. /* -------- DSU_END : (DSU Offset: 0x1008) (R/ 32) Coresight ROM Table End -------- */
  262. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  263. typedef union {
  264. struct {
  265. uint32_t END:32; /*!< bit: 0..31 End Marker */
  266. } bit; /*!< Structure used for bit access */
  267. uint32_t reg; /*!< Type used for register access */
  268. } DSU_END_Type;
  269. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  270. #define DSU_END_OFFSET 0x1008 /**< \brief (DSU_END offset) Coresight ROM Table End */
  271. #define DSU_END_RESETVALUE 0x00000000ul /**< \brief (DSU_END reset_value) Coresight ROM Table End */
  272. #define DSU_END_END_Pos 0 /**< \brief (DSU_END) End Marker */
  273. #define DSU_END_END_Msk (0xFFFFFFFFul << DSU_END_END_Pos)
  274. #define DSU_END_END(value) ((DSU_END_END_Msk & ((value) << DSU_END_END_Pos)))
  275. #define DSU_END_MASK 0xFFFFFFFFul /**< \brief (DSU_END) MASK Register */
  276. /* -------- DSU_MEMTYPE : (DSU Offset: 0x1FCC) (R/ 32) Coresight ROM Table Memory Type -------- */
  277. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  278. typedef union {
  279. struct {
  280. uint32_t SMEMP:1; /*!< bit: 0 System Memory Present */
  281. uint32_t :31; /*!< bit: 1..31 Reserved */
  282. } bit; /*!< Structure used for bit access */
  283. uint32_t reg; /*!< Type used for register access */
  284. } DSU_MEMTYPE_Type;
  285. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  286. #define DSU_MEMTYPE_OFFSET 0x1FCC /**< \brief (DSU_MEMTYPE offset) Coresight ROM Table Memory Type */
  287. #define DSU_MEMTYPE_RESETVALUE 0x00000000ul /**< \brief (DSU_MEMTYPE reset_value) Coresight ROM Table Memory Type */
  288. #define DSU_MEMTYPE_SMEMP_Pos 0 /**< \brief (DSU_MEMTYPE) System Memory Present */
  289. #define DSU_MEMTYPE_SMEMP (0x1ul << DSU_MEMTYPE_SMEMP_Pos)
  290. #define DSU_MEMTYPE_MASK 0x00000001ul /**< \brief (DSU_MEMTYPE) MASK Register */
  291. /* -------- DSU_PID4 : (DSU Offset: 0x1FD0) (R/ 32) Peripheral Identification 4 -------- */
  292. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  293. typedef union {
  294. struct {
  295. uint32_t JEPCC:4; /*!< bit: 0.. 3 JEP-106 Continuation Code */
  296. uint32_t FKBC:4; /*!< bit: 4.. 7 4KB Count */
  297. uint32_t :24; /*!< bit: 8..31 Reserved */
  298. } bit; /*!< Structure used for bit access */
  299. uint32_t reg; /*!< Type used for register access */
  300. } DSU_PID4_Type;
  301. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  302. #define DSU_PID4_OFFSET 0x1FD0 /**< \brief (DSU_PID4 offset) Peripheral Identification 4 */
  303. #define DSU_PID4_RESETVALUE 0x00000000ul /**< \brief (DSU_PID4 reset_value) Peripheral Identification 4 */
  304. #define DSU_PID4_JEPCC_Pos 0 /**< \brief (DSU_PID4) JEP-106 Continuation Code */
  305. #define DSU_PID4_JEPCC_Msk (0xFul << DSU_PID4_JEPCC_Pos)
  306. #define DSU_PID4_JEPCC(value) ((DSU_PID4_JEPCC_Msk & ((value) << DSU_PID4_JEPCC_Pos)))
  307. #define DSU_PID4_FKBC_Pos 4 /**< \brief (DSU_PID4) 4KB Count */
  308. #define DSU_PID4_FKBC_Msk (0xFul << DSU_PID4_FKBC_Pos)
  309. #define DSU_PID4_FKBC(value) ((DSU_PID4_FKBC_Msk & ((value) << DSU_PID4_FKBC_Pos)))
  310. #define DSU_PID4_MASK 0x000000FFul /**< \brief (DSU_PID4) MASK Register */
  311. /* -------- DSU_PID0 : (DSU Offset: 0x1FE0) (R/ 32) Peripheral Identification 0 -------- */
  312. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  313. typedef union {
  314. struct {
  315. uint32_t PARTNBL:8; /*!< bit: 0.. 7 Part Number Low */
  316. uint32_t :24; /*!< bit: 8..31 Reserved */
  317. } bit; /*!< Structure used for bit access */
  318. uint32_t reg; /*!< Type used for register access */
  319. } DSU_PID0_Type;
  320. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  321. #define DSU_PID0_OFFSET 0x1FE0 /**< \brief (DSU_PID0 offset) Peripheral Identification 0 */
  322. #define DSU_PID0_RESETVALUE 0x000000D0ul /**< \brief (DSU_PID0 reset_value) Peripheral Identification 0 */
  323. #define DSU_PID0_PARTNBL_Pos 0 /**< \brief (DSU_PID0) Part Number Low */
  324. #define DSU_PID0_PARTNBL_Msk (0xFFul << DSU_PID0_PARTNBL_Pos)
  325. #define DSU_PID0_PARTNBL(value) ((DSU_PID0_PARTNBL_Msk & ((value) << DSU_PID0_PARTNBL_Pos)))
  326. #define DSU_PID0_MASK 0x000000FFul /**< \brief (DSU_PID0) MASK Register */
  327. /* -------- DSU_PID1 : (DSU Offset: 0x1FE4) (R/ 32) Peripheral Identification 1 -------- */
  328. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  329. typedef union {
  330. struct {
  331. uint32_t PARTNBH:4; /*!< bit: 0.. 3 Part Number High */
  332. uint32_t JEPIDCL:4; /*!< bit: 4.. 7 Low part of the JEP-106 Identity Code */
  333. uint32_t :24; /*!< bit: 8..31 Reserved */
  334. } bit; /*!< Structure used for bit access */
  335. uint32_t reg; /*!< Type used for register access */
  336. } DSU_PID1_Type;
  337. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  338. #define DSU_PID1_OFFSET 0x1FE4 /**< \brief (DSU_PID1 offset) Peripheral Identification 1 */
  339. #define DSU_PID1_RESETVALUE 0x000000FCul /**< \brief (DSU_PID1 reset_value) Peripheral Identification 1 */
  340. #define DSU_PID1_PARTNBH_Pos 0 /**< \brief (DSU_PID1) Part Number High */
  341. #define DSU_PID1_PARTNBH_Msk (0xFul << DSU_PID1_PARTNBH_Pos)
  342. #define DSU_PID1_PARTNBH(value) ((DSU_PID1_PARTNBH_Msk & ((value) << DSU_PID1_PARTNBH_Pos)))
  343. #define DSU_PID1_JEPIDCL_Pos 4 /**< \brief (DSU_PID1) Low part of the JEP-106 Identity Code */
  344. #define DSU_PID1_JEPIDCL_Msk (0xFul << DSU_PID1_JEPIDCL_Pos)
  345. #define DSU_PID1_JEPIDCL(value) ((DSU_PID1_JEPIDCL_Msk & ((value) << DSU_PID1_JEPIDCL_Pos)))
  346. #define DSU_PID1_MASK 0x000000FFul /**< \brief (DSU_PID1) MASK Register */
  347. /* -------- DSU_PID2 : (DSU Offset: 0x1FE8) (R/ 32) Peripheral Identification 2 -------- */
  348. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  349. typedef union {
  350. struct {
  351. uint32_t JEPIDCH:3; /*!< bit: 0.. 2 JEP-106 Identity Code High */
  352. uint32_t JEPU:1; /*!< bit: 3 JEP-106 Identity Code is used */
  353. uint32_t REVISION:4; /*!< bit: 4.. 7 Revision Number */
  354. uint32_t :24; /*!< bit: 8..31 Reserved */
  355. } bit; /*!< Structure used for bit access */
  356. uint32_t reg; /*!< Type used for register access */
  357. } DSU_PID2_Type;
  358. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  359. #define DSU_PID2_OFFSET 0x1FE8 /**< \brief (DSU_PID2 offset) Peripheral Identification 2 */
  360. #define DSU_PID2_RESETVALUE 0x00000009ul /**< \brief (DSU_PID2 reset_value) Peripheral Identification 2 */
  361. #define DSU_PID2_JEPIDCH_Pos 0 /**< \brief (DSU_PID2) JEP-106 Identity Code High */
  362. #define DSU_PID2_JEPIDCH_Msk (0x7ul << DSU_PID2_JEPIDCH_Pos)
  363. #define DSU_PID2_JEPIDCH(value) ((DSU_PID2_JEPIDCH_Msk & ((value) << DSU_PID2_JEPIDCH_Pos)))
  364. #define DSU_PID2_JEPU_Pos 3 /**< \brief (DSU_PID2) JEP-106 Identity Code is used */
  365. #define DSU_PID2_JEPU (0x1ul << DSU_PID2_JEPU_Pos)
  366. #define DSU_PID2_REVISION_Pos 4 /**< \brief (DSU_PID2) Revision Number */
  367. #define DSU_PID2_REVISION_Msk (0xFul << DSU_PID2_REVISION_Pos)
  368. #define DSU_PID2_REVISION(value) ((DSU_PID2_REVISION_Msk & ((value) << DSU_PID2_REVISION_Pos)))
  369. #define DSU_PID2_MASK 0x000000FFul /**< \brief (DSU_PID2) MASK Register */
  370. /* -------- DSU_PID3 : (DSU Offset: 0x1FEC) (R/ 32) Peripheral Identification 3 -------- */
  371. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  372. typedef union {
  373. struct {
  374. uint32_t CUSMOD:4; /*!< bit: 0.. 3 ARM CUSMOD */
  375. uint32_t REVAND:4; /*!< bit: 4.. 7 Revision Number */
  376. uint32_t :24; /*!< bit: 8..31 Reserved */
  377. } bit; /*!< Structure used for bit access */
  378. uint32_t reg; /*!< Type used for register access */
  379. } DSU_PID3_Type;
  380. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  381. #define DSU_PID3_OFFSET 0x1FEC /**< \brief (DSU_PID3 offset) Peripheral Identification 3 */
  382. #define DSU_PID3_RESETVALUE 0x00000000ul /**< \brief (DSU_PID3 reset_value) Peripheral Identification 3 */
  383. #define DSU_PID3_CUSMOD_Pos 0 /**< \brief (DSU_PID3) ARM CUSMOD */
  384. #define DSU_PID3_CUSMOD_Msk (0xFul << DSU_PID3_CUSMOD_Pos)
  385. #define DSU_PID3_CUSMOD(value) ((DSU_PID3_CUSMOD_Msk & ((value) << DSU_PID3_CUSMOD_Pos)))
  386. #define DSU_PID3_REVAND_Pos 4 /**< \brief (DSU_PID3) Revision Number */
  387. #define DSU_PID3_REVAND_Msk (0xFul << DSU_PID3_REVAND_Pos)
  388. #define DSU_PID3_REVAND(value) ((DSU_PID3_REVAND_Msk & ((value) << DSU_PID3_REVAND_Pos)))
  389. #define DSU_PID3_MASK 0x000000FFul /**< \brief (DSU_PID3) MASK Register */
  390. /* -------- DSU_CID0 : (DSU Offset: 0x1FF0) (R/ 32) Component Identification 0 -------- */
  391. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  392. typedef union {
  393. struct {
  394. uint32_t PREAMBLEB0:8; /*!< bit: 0.. 7 Preamble Byte 0 */
  395. uint32_t :24; /*!< bit: 8..31 Reserved */
  396. } bit; /*!< Structure used for bit access */
  397. uint32_t reg; /*!< Type used for register access */
  398. } DSU_CID0_Type;
  399. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  400. #define DSU_CID0_OFFSET 0x1FF0 /**< \brief (DSU_CID0 offset) Component Identification 0 */
  401. #define DSU_CID0_RESETVALUE 0x0000000Dul /**< \brief (DSU_CID0 reset_value) Component Identification 0 */
  402. #define DSU_CID0_PREAMBLEB0_Pos 0 /**< \brief (DSU_CID0) Preamble Byte 0 */
  403. #define DSU_CID0_PREAMBLEB0_Msk (0xFFul << DSU_CID0_PREAMBLEB0_Pos)
  404. #define DSU_CID0_PREAMBLEB0(value) ((DSU_CID0_PREAMBLEB0_Msk & ((value) << DSU_CID0_PREAMBLEB0_Pos)))
  405. #define DSU_CID0_MASK 0x000000FFul /**< \brief (DSU_CID0) MASK Register */
  406. /* -------- DSU_CID1 : (DSU Offset: 0x1FF4) (R/ 32) Component Identification 1 -------- */
  407. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  408. typedef union {
  409. struct {
  410. uint32_t PREAMBLE:4; /*!< bit: 0.. 3 Preamble */
  411. uint32_t CCLASS:4; /*!< bit: 4.. 7 Component Class */
  412. uint32_t :24; /*!< bit: 8..31 Reserved */
  413. } bit; /*!< Structure used for bit access */
  414. uint32_t reg; /*!< Type used for register access */
  415. } DSU_CID1_Type;
  416. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  417. #define DSU_CID1_OFFSET 0x1FF4 /**< \brief (DSU_CID1 offset) Component Identification 1 */
  418. #define DSU_CID1_RESETVALUE 0x00000010ul /**< \brief (DSU_CID1 reset_value) Component Identification 1 */
  419. #define DSU_CID1_PREAMBLE_Pos 0 /**< \brief (DSU_CID1) Preamble */
  420. #define DSU_CID1_PREAMBLE_Msk (0xFul << DSU_CID1_PREAMBLE_Pos)
  421. #define DSU_CID1_PREAMBLE(value) ((DSU_CID1_PREAMBLE_Msk & ((value) << DSU_CID1_PREAMBLE_Pos)))
  422. #define DSU_CID1_CCLASS_Pos 4 /**< \brief (DSU_CID1) Component Class */
  423. #define DSU_CID1_CCLASS_Msk (0xFul << DSU_CID1_CCLASS_Pos)
  424. #define DSU_CID1_CCLASS(value) ((DSU_CID1_CCLASS_Msk & ((value) << DSU_CID1_CCLASS_Pos)))
  425. #define DSU_CID1_MASK 0x000000FFul /**< \brief (DSU_CID1) MASK Register */
  426. /* -------- DSU_CID2 : (DSU Offset: 0x1FF8) (R/ 32) Component Identification 2 -------- */
  427. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  428. typedef union {
  429. struct {
  430. uint32_t PREAMBLEB2:8; /*!< bit: 0.. 7 Preamble Byte 2 */
  431. uint32_t :24; /*!< bit: 8..31 Reserved */
  432. } bit; /*!< Structure used for bit access */
  433. uint32_t reg; /*!< Type used for register access */
  434. } DSU_CID2_Type;
  435. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  436. #define DSU_CID2_OFFSET 0x1FF8 /**< \brief (DSU_CID2 offset) Component Identification 2 */
  437. #define DSU_CID2_RESETVALUE 0x00000005ul /**< \brief (DSU_CID2 reset_value) Component Identification 2 */
  438. #define DSU_CID2_PREAMBLEB2_Pos 0 /**< \brief (DSU_CID2) Preamble Byte 2 */
  439. #define DSU_CID2_PREAMBLEB2_Msk (0xFFul << DSU_CID2_PREAMBLEB2_Pos)
  440. #define DSU_CID2_PREAMBLEB2(value) ((DSU_CID2_PREAMBLEB2_Msk & ((value) << DSU_CID2_PREAMBLEB2_Pos)))
  441. #define DSU_CID2_MASK 0x000000FFul /**< \brief (DSU_CID2) MASK Register */
  442. /* -------- DSU_CID3 : (DSU Offset: 0x1FFC) (R/ 32) Component Identification 3 -------- */
  443. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  444. typedef union {
  445. struct {
  446. uint32_t PREAMBLEB3:8; /*!< bit: 0.. 7 Preamble Byte 3 */
  447. uint32_t :24; /*!< bit: 8..31 Reserved */
  448. } bit; /*!< Structure used for bit access */
  449. uint32_t reg; /*!< Type used for register access */
  450. } DSU_CID3_Type;
  451. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  452. #define DSU_CID3_OFFSET 0x1FFC /**< \brief (DSU_CID3 offset) Component Identification 3 */
  453. #define DSU_CID3_RESETVALUE 0x000000B1ul /**< \brief (DSU_CID3 reset_value) Component Identification 3 */
  454. #define DSU_CID3_PREAMBLEB3_Pos 0 /**< \brief (DSU_CID3) Preamble Byte 3 */
  455. #define DSU_CID3_PREAMBLEB3_Msk (0xFFul << DSU_CID3_PREAMBLEB3_Pos)
  456. #define DSU_CID3_PREAMBLEB3(value) ((DSU_CID3_PREAMBLEB3_Msk & ((value) << DSU_CID3_PREAMBLEB3_Pos)))
  457. #define DSU_CID3_MASK 0x000000FFul /**< \brief (DSU_CID3) MASK Register */
  458. /** \brief DSU hardware registers */
  459. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  460. typedef struct {
  461. __O DSU_CTRL_Type CTRL; /**< \brief Offset: 0x0000 ( /W 8) Control */
  462. __IO DSU_STATUSA_Type STATUSA; /**< \brief Offset: 0x0001 (R/W 8) Status A */
  463. __I DSU_STATUSB_Type STATUSB; /**< \brief Offset: 0x0002 (R/ 8) Status B */
  464. RoReg8 Reserved1[0x1];
  465. __IO DSU_ADDR_Type ADDR; /**< \brief Offset: 0x0004 (R/W 32) Address */
  466. __IO DSU_LENGTH_Type LENGTH; /**< \brief Offset: 0x0008 (R/W 32) Length */
  467. __IO DSU_DATA_Type DATA; /**< \brief Offset: 0x000C (R/W 32) Data */
  468. __IO DSU_DCC_Type DCC[2]; /**< \brief Offset: 0x0010 (R/W 32) Debug Communication Channel n */
  469. __I DSU_DID_Type DID; /**< \brief Offset: 0x0018 (R/ 32) Device Identification */
  470. RoReg8 Reserved2[0xFE4];
  471. __I DSU_ENTRY_Type ENTRY[2]; /**< \brief Offset: 0x1000 (R/ 32) Coresight ROM Table Entry n */
  472. __I DSU_END_Type END; /**< \brief Offset: 0x1008 (R/ 32) Coresight ROM Table End */
  473. RoReg8 Reserved3[0xFC0];
  474. __I DSU_MEMTYPE_Type MEMTYPE; /**< \brief Offset: 0x1FCC (R/ 32) Coresight ROM Table Memory Type */
  475. __I DSU_PID4_Type PID4; /**< \brief Offset: 0x1FD0 (R/ 32) Peripheral Identification 4 */
  476. RoReg8 Reserved4[0xC];
  477. __I DSU_PID0_Type PID0; /**< \brief Offset: 0x1FE0 (R/ 32) Peripheral Identification 0 */
  478. __I DSU_PID1_Type PID1; /**< \brief Offset: 0x1FE4 (R/ 32) Peripheral Identification 1 */
  479. __I DSU_PID2_Type PID2; /**< \brief Offset: 0x1FE8 (R/ 32) Peripheral Identification 2 */
  480. __I DSU_PID3_Type PID3; /**< \brief Offset: 0x1FEC (R/ 32) Peripheral Identification 3 */
  481. __I DSU_CID0_Type CID0; /**< \brief Offset: 0x1FF0 (R/ 32) Component Identification 0 */
  482. __I DSU_CID1_Type CID1; /**< \brief Offset: 0x1FF4 (R/ 32) Component Identification 1 */
  483. __I DSU_CID2_Type CID2; /**< \brief Offset: 0x1FF8 (R/ 32) Component Identification 2 */
  484. __I DSU_CID3_Type CID3; /**< \brief Offset: 0x1FFC (R/ 32) Component Identification 3 */
  485. } Dsu;
  486. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  487. /*@}*/
  488. #endif /* _SAMD21_DSU_COMPONENT_ */