ARMv8MML_DP.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. /**************************************************************************//**
  2. * @file ARMv8MML_DP.h
  3. * @brief CMSIS Core Peripheral Access Layer Header File for
  4. * Armv8-MML Device Series (configured for Armv8-MML with double precision FPU, without DSP extension, with TrustZone)
  5. * @version V5.00
  6. * @date 10. January 2018
  7. ******************************************************************************/
  8. /*
  9. * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
  10. *
  11. * SPDX-License-Identifier: Apache-2.0
  12. *
  13. * Licensed under the Apache License, Version 2.0 (the License); you may
  14. * not use this file except in compliance with the License.
  15. * You may obtain a copy of the License at
  16. *
  17. * www.apache.org/licenses/LICENSE-2.0
  18. *
  19. * Unless required by applicable law or agreed to in writing, software
  20. * distributed under the License is distributed on an AS IS BASIS, WITHOUT
  21. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  22. * See the License for the specific language governing permissions and
  23. * limitations under the License.
  24. */
  25. #ifndef ARMv8MML_DP_H
  26. #define ARMv8MML_DP_H
  27. #ifdef __cplusplus
  28. extern "C" {
  29. #endif
  30. /* ------------------------- Interrupt Number Definition ------------------------ */
  31. typedef enum IRQn
  32. {
  33. /* -------------------- Armv8-M Mainline Processor Exceptions Numbers ----------- */
  34. NonMaskableInt_IRQn = -14, /* 2 Non Maskable Interrupt */
  35. HardFault_IRQn = -13, /* 3 HardFault Interrupt */
  36. MemoryManagement_IRQn = -12, /* 4 Memory Management Interrupt */
  37. BusFault_IRQn = -11, /* 5 Bus Fault Interrupt */
  38. UsageFault_IRQn = -10, /* 6 Usage Fault Interrupt */
  39. SecureFault_IRQn = -9, /* 7 Secure Fault Interrupt */
  40. SVCall_IRQn = -5, /* 11 SV Call Interrupt */
  41. DebugMonitor_IRQn = -4, /* 12 Debug Monitor Interrupt */
  42. PendSV_IRQn = -2, /* 14 Pend SV Interrupt */
  43. SysTick_IRQn = -1, /* 15 System Tick Interrupt */
  44. /* -------------------- ARMv8 Mainline Specific Interrupt Numbers --------------- */
  45. WDT_IRQn = 0, /* Watchdog Timer Interrupt */
  46. RTC_IRQn = 1, /* Real Time Clock Interrupt */
  47. TIM0_IRQn = 2, /* Timer0 / Timer1 Interrupt */
  48. TIM2_IRQn = 3, /* Timer2 / Timer3 Interrupt */
  49. MCIA_IRQn = 4, /* MCIa Interrupt */
  50. MCIB_IRQn = 5, /* MCIb Interrupt */
  51. UART0_IRQn = 6, /* UART0 Interrupt */
  52. UART1_IRQn = 7, /* UART1 Interrupt */
  53. UART2_IRQn = 8, /* UART2 Interrupt */
  54. UART4_IRQn = 9, /* UART4 Interrupt */
  55. AACI_IRQn = 10, /* AACI / AC97 Interrupt */
  56. CLCD_IRQn = 11, /* CLCD Combined Interrupt */
  57. ENET_IRQn = 12, /* Ethernet Interrupt */
  58. USBDC_IRQn = 13, /* USB Device Interrupt */
  59. USBHC_IRQn = 14, /* USB Host Controller Interrupt */
  60. CHLCD_IRQn = 15, /* Character LCD Interrupt */
  61. FLEXRAY_IRQn = 16, /* Flexray Interrupt */
  62. CAN_IRQn = 17, /* CAN Interrupt */
  63. LIN_IRQn = 18, /* LIN Interrupt */
  64. I2C_IRQn = 19, /* I2C ADC/DAC Interrupt */
  65. CPU_CLCD_IRQn = 28, /* CPU CLCD Combined Interrupt */
  66. UART3_IRQn = 30, /* UART3 Interrupt */
  67. SPI_IRQn = 31 /* SPI Touchscreen Interrupt */
  68. } IRQn_Type;
  69. /* ================================================================================ */
  70. /* ================ Processor and Core Peripheral Section ================ */
  71. /* ================================================================================ */
  72. /* ------- Start of section using anonymous unions and disabling warnings ------- */
  73. #if defined (__CC_ARM)
  74. #pragma push
  75. #pragma anon_unions
  76. #elif defined (__ICCARM__)
  77. #pragma language=extended
  78. #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
  79. #pragma clang diagnostic push
  80. #pragma clang diagnostic ignored "-Wc11-extensions"
  81. #pragma clang diagnostic ignored "-Wreserved-id-macro"
  82. #elif defined (__GNUC__)
  83. /* anonymous unions are enabled by default */
  84. #elif defined (__TMS470__)
  85. /* anonymous unions are enabled by default */
  86. #elif defined (__TASKING__)
  87. #pragma warning 586
  88. #elif defined (__CSMC__)
  89. /* anonymous unions are enabled by default */
  90. #else
  91. #warning Not supported compiler type
  92. #endif
  93. /* -------- Configuration of the Cortex-M4 Processor and Core Peripherals ------- */
  94. #define __ARMv8MML_REV 0x0001U /* Core revision r0p1 */
  95. #define __SAUREGION_PRESENT 1U /* SAU regions present */
  96. #define __MPU_PRESENT 1U /* MPU present */
  97. #define __VTOR_PRESENT 1U /* VTOR present */
  98. #define __NVIC_PRIO_BITS 3U /* Number of Bits used for Priority Levels */
  99. #define __Vendor_SysTickConfig 0U /* Set to 1 if different SysTick Config is used */
  100. #define __FPU_PRESENT 1U /* FPU present */
  101. #define __FPU_DP 1U /* double precision FPU */
  102. #define __DSP_PRESENT 0U /* no DSP extension present */
  103. #include "core_armv8mml.h" /* Processor and core peripherals */
  104. #include "system_ARMv8MML.h" /* System Header */
  105. /* ================================================================================ */
  106. /* ================ Device Specific Peripheral Section ================ */
  107. /* ================================================================================ */
  108. /* ================================================================================ */
  109. /* ================ CPU FPGA System (CPU_SYS) ================ */
  110. /* ================================================================================ */
  111. typedef struct
  112. {
  113. __IM uint32_t ID; /* Offset: 0x000 (R/ ) Board and FPGA Identifier */
  114. __IOM uint32_t MEMCFG; /* Offset: 0x004 (R/W) Remap and Alias Memory Control */
  115. __IM uint32_t SW; /* Offset: 0x008 (R/ ) Switch States */
  116. __IOM uint32_t LED; /* Offset: 0x00C (R/W) LED Output States */
  117. __IM uint32_t TS; /* Offset: 0x010 (R/ ) Touchscreen Register */
  118. __IOM uint32_t CTRL1; /* Offset: 0x014 (R/W) Misc Control Functions */
  119. uint32_t RESERVED0[2U];
  120. __IOM uint32_t CLKCFG; /* Offset: 0x020 (R/W) System Clock Configuration */
  121. __IOM uint32_t WSCFG; /* Offset: 0x024 (R/W) Flash Waitstate Configuration */
  122. __IOM uint32_t CPUCFG; /* Offset: 0x028 (R/W) Processor Configuration */
  123. uint32_t RESERVED1[3U];
  124. __IOM uint32_t BASE; /* Offset: 0x038 (R/W) ROM Table base Address */
  125. __IOM uint32_t ID2; /* Offset: 0x03C (R/W) Secondary Identification Register */
  126. } ARM_CPU_SYS_TypeDef;
  127. /* ================================================================================ */
  128. /* ================ DUT FPGA System (DUT_SYS) ================ */
  129. /* ================================================================================ */
  130. typedef struct
  131. {
  132. __IM uint32_t ID; /* Offset: 0x000 (R/ ) Board and FPGA Identifier */
  133. __IOM uint32_t PERCFG; /* Offset: 0x004 (R/W) Peripheral Control Signals */
  134. __IM uint32_t SW; /* Offset: 0x008 (R/ ) Switch States */
  135. __IOM uint32_t LED; /* Offset: 0x00C (R/W) LED Output States */
  136. __IOM uint32_t SEG7; /* Offset: 0x010 (R/W) 7-segment LED Output States */
  137. __IM uint32_t CNT25MHz; /* Offset: 0x014 (R/ ) Freerunning counter incrementing at 25MHz */
  138. __IM uint32_t CNT100Hz; /* Offset: 0x018 (R/ ) Freerunning counter incrementing at 100Hz */
  139. } ARM_DUT_SYS_TypeDef;
  140. /* ================================================================================ */
  141. /* ================ Timer (TIM) ================ */
  142. /* ================================================================================ */
  143. typedef struct
  144. {
  145. __IOM uint32_t Timer1Load; /* Offset: 0x000 (R/W) Timer 1 Load */
  146. __IM uint32_t Timer1Value; /* Offset: 0x004 (R/ ) Timer 1 Counter Current Value */
  147. __IOM uint32_t Timer1Control; /* Offset: 0x008 (R/W) Timer 1 Control */
  148. __OM uint32_t Timer1IntClr; /* Offset: 0x00C ( /W) Timer 1 Interrupt Clear */
  149. __IM uint32_t Timer1RIS; /* Offset: 0x010 (R/ ) Timer 1 Raw Interrupt Status */
  150. __IM uint32_t Timer1MIS; /* Offset: 0x014 (R/ ) Timer 1 Masked Interrupt Status */
  151. __IOM uint32_t Timer1BGLoad; /* Offset: 0x018 (R/W) Background Load Register */
  152. uint32_t RESERVED0[1U];
  153. __IOM uint32_t Timer2Load; /* Offset: 0x020 (R/W) Timer 2 Load */
  154. __IM uint32_t Timer2Value; /* Offset: 0x024 (R/ ) Timer 2 Counter Current Value */
  155. __IOM uint32_t Timer2Control; /* Offset: 0x028 (R/W) Timer 2 Control */
  156. __OM uint32_t Timer2IntClr; /* Offset: 0x02C ( /W) Timer 2 Interrupt Clear */
  157. __IM uint32_t Timer2RIS; /* Offset: 0x030 (R/ ) Timer 2 Raw Interrupt Status */
  158. __IM uint32_t Timer2MIS; /* Offset: 0x034 (R/ ) Timer 2 Masked Interrupt Status */
  159. __IOM uint32_t Timer2BGLoad; /* Offset: 0x038 (R/W) Background Load Register */
  160. } ARM_TIM_TypeDef;
  161. /* ================================================================================ */
  162. /* ============== Universal Asyncronous Receiver / Transmitter (UART) ============= */
  163. /* ================================================================================ */
  164. typedef struct
  165. {
  166. __IOM uint32_t DR; /* Offset: 0x000 (R/W) Data */
  167. union {
  168. __IM uint32_t RSR; /* Offset: 0x000 (R/ ) Receive Status */
  169. __OM uint32_t ECR; /* Offset: 0x000 ( /W) Error Clear */
  170. };
  171. uint32_t RESERVED0[4U];
  172. __IOM uint32_t FR; /* Offset: 0x018 (R/W) Flags */
  173. uint32_t RESERVED1[1U];
  174. __IOM uint32_t ILPR; /* Offset: 0x020 (R/W) IrDA Low-power Counter */
  175. __IOM uint32_t IBRD; /* Offset: 0x024 (R/W) Interger Baud Rate */
  176. __IOM uint32_t FBRD; /* Offset: 0x028 (R/W) Fractional Baud Rate */
  177. __IOM uint32_t LCR_H; /* Offset: 0x02C (R/W) Line Control */
  178. __IOM uint32_t CR; /* Offset: 0x030 (R/W) Control */
  179. __IOM uint32_t IFLS; /* Offset: 0x034 (R/W) Interrupt FIFO Level Select */
  180. __IOM uint32_t IMSC; /* Offset: 0x038 (R/W) Interrupt Mask Set / Clear */
  181. __IOM uint32_t RIS; /* Offset: 0x03C (R/W) Raw Interrupt Status */
  182. __IOM uint32_t MIS; /* Offset: 0x040 (R/W) Masked Interrupt Status */
  183. __OM uint32_t ICR; /* Offset: 0x044 ( /W) Interrupt Clear */
  184. __IOM uint32_t DMACR; /* Offset: 0x048 (R/W) DMA Control */
  185. } ARM_UART_TypeDef;
  186. /* -------- End of section using anonymous unions and disabling warnings -------- */
  187. #if defined (__CC_ARM)
  188. #pragma pop
  189. #elif defined (__ICCARM__)
  190. /* leave anonymous unions enabled */
  191. #elif (__ARMCC_VERSION >= 6010050)
  192. #pragma clang diagnostic pop
  193. #elif defined (__GNUC__)
  194. /* anonymous unions are enabled by default */
  195. #elif defined (__TMS470__)
  196. /* anonymous unions are enabled by default */
  197. #elif defined (__TASKING__)
  198. #pragma warning restore
  199. #elif defined (__CSMC__)
  200. /* anonymous unions are enabled by default */
  201. #else
  202. #warning Not supported compiler type
  203. #endif
  204. /* ================================================================================ */
  205. /* ================ Peripheral memory map ================ */
  206. /* ================================================================================ */
  207. /* -------------------------- CPU FPGA memory map ------------------------------- */
  208. #define ARM_FLASH_BASE (0x00000000UL)
  209. #define ARM_RAM_BASE (0x20000000UL)
  210. #define ARM_RAM_FPGA_BASE (0x1EFF0000UL)
  211. #define ARM_CPU_CFG_BASE (0xDFFF0000UL)
  212. #define ARM_CPU_SYS_BASE (ARM_CPU_CFG_BASE + 0x00000UL)
  213. #define ARM_UART3_BASE (ARM_CPU_CFG_BASE + 0x05000UL)
  214. /* -------------------------- DUT FPGA memory map ------------------------------- */
  215. #define ARM_APB_BASE (0x40000000UL)
  216. #define ARM_AHB_BASE (0x4FF00000UL)
  217. #define ARM_DMC_BASE (0x60000000UL)
  218. #define ARM_SMC_BASE (0xA0000000UL)
  219. #define ARM_TIM0_BASE (ARM_APB_BASE + 0x02000UL)
  220. #define ARM_TIM2_BASE (ARM_APB_BASE + 0x03000UL)
  221. #define ARM_DUT_SYS_BASE (ARM_APB_BASE + 0x04000UL)
  222. #define ARM_UART0_BASE (ARM_APB_BASE + 0x06000UL)
  223. #define ARM_UART1_BASE (ARM_APB_BASE + 0x07000UL)
  224. #define ARM_UART2_BASE (ARM_APB_BASE + 0x08000UL)
  225. #define ARM_UART4_BASE (ARM_APB_BASE + 0x09000UL)
  226. /* ================================================================================ */
  227. /* ================ Peripheral declaration ================ */
  228. /* ================================================================================ */
  229. /* -------------------------- CPU FPGA Peripherals ------------------------------ */
  230. #define ARM_CPU_SYS ((ARM_CPU_SYS_TypeDef *) ARM_CPU_SYS_BASE)
  231. #define ARM_UART3 (( ARM_UART_TypeDef *) ARM_UART3_BASE)
  232. /* -------------------------- DUT FPGA Peripherals ------------------------------ */
  233. #define ARM_DUT_SYS ((ARM_DUT_SYS_TypeDef *) ARM_DUT_SYS_BASE)
  234. #define ARM_TIM0 (( ARM_TIM_TypeDef *) ARM_TIM0_BASE)
  235. #define ARM_TIM2 (( ARM_TIM_TypeDef *) ARM_TIM2_BASE)
  236. #define ARM_UART0 (( ARM_UART_TypeDef *) ARM_UART0_BASE)
  237. #define ARM_UART1 (( ARM_UART_TypeDef *) ARM_UART1_BASE)
  238. #define ARM_UART2 (( ARM_UART_TypeDef *) ARM_UART2_BASE)
  239. #define ARM_UART4 (( ARM_UART_TypeDef *) ARM_UART4_BASE)
  240. #ifdef __cplusplus
  241. }
  242. #endif
  243. #endif /* ARMv8MML_DP_H */