22#ifndef _mcci_arm_cm7_h_
23#define _mcci_arm_cm7_h_
27#ifndef _mcci_bootloader_bits_h_
45#define MCCI_CM7_SYSM_APSR UINT32_C(0x00)
46#define MCCI_CM7_SYSM_IAPSR UINT32_C(0x01)
47#define MCCI_CM7_SYSM_EAPSR UINT32_C(0x02)
48#define MCCI_CM7_SYSM_XPSR UINT32_C(0x03)
49#define MCCI_CM7_SYSM_IPSR UINT32_C(0x05)
50#define MCCI_CM7_SYSM_EPSR UINT32_C(0x06)
51#define MCCI_CM7_SYSM_IEPSR UINT32_C(0x07)
52#define MCCI_CM7_SYSM_MSP UINT32_C(0x08)
53#define MCCI_CM7_SYSM_PSP UINT32_C(0x09)
54#define MCCI_CM7_SYSM_PRIMASK UINT32_C(0x10)
55#define MCCI_CM7_SYSM_BASEPRI UINT32_C(0x11)
56#define MCCI_CM7_SYSM_BASEPRI_MAX UINT32_C(0x12)
57#define MCCI_CM7_SYSM_FAULTMASK UINT32_C(0x13)
58#define MCCI_CM7_SYSM_CONTROL UINT32_C(0x14)
62#define MCCI_CM7_SR_PRIMASK_DISABLE (UINT32_C(1) << 0)
67#define MCCI_CM7_SR_BASEPRI_MASK (UINT32_C(0xFF) << 0)
68#define MCCI_CM7_SR_BASEPRI_VAL(n) ((n) << 0)
73#define MCCI_CM7_SR_FAULTMASK_FM (UINT32_C(1) << 0)
85#define MCCI_CM7_SCS_BASE UINT32_C(0xE000E000)
89#define MCCI_CM7_ICTR UINT32_C(0xE000E004)
90#define MCCI_CM7_ACTLR UINT32_C(0xE000E008)
95#define MCCI_CM7_SYSTICK UINT32_C(0xE000E010)
96#define MCCI_CM7_SYSTICK_CSR (MCCI_CM7_SYSTICK + 0x0)
97#define MCCI_CM7_SYSTICK_RVR (MCCI_CM7_SYSTICK + 0x4)
98#define MCCI_CM7_SYSTICK_CVR (MCCI_CM7_SYSTICK + 0x8)
99#define MCCI_CM7_SYSTICK_CALIB (MCCI_CM7_SYSTICK + 0xC)
104#define MCCI_CM7_NVIC UINT32_C(0xE000E100)
105#define MCCI_CM7_NVIC_ISER (MCCI_CM7_NVIC + 0x000)
106#define MCCI_CM7_NVIC_ISER0 (MCCI_CM7_NVIC + 0x000)
107#define MCCI_CM7_NVIC_ISER1 (MCCI_CM7_NVIC + 0x004)
108#define MCCI_CM7_NVIC_ISER2 (MCCI_CM7_NVIC + 0x008)
109#define MCCI_CM7_NVIC_ISER3 (MCCI_CM7_NVIC + 0x00C)
110#define MCCI_CM7_NVIC_ISER4 (MCCI_CM7_NVIC + 0x010)
111#define MCCI_CM7_NVIC_ISER5 (MCCI_CM7_NVIC + 0x014)
112#define MCCI_CM7_NVIC_ISER6 (MCCI_CM7_NVIC + 0x018)
113#define MCCI_CM7_NVIC_ISER7 (MCCI_CM7_NVIC + 0x01C)
114#define MCCI_CM7_NVIC_ICER (MCCI_CM7_NVIC + 0x080)
115#define MCCI_CM7_NVIC_ICER0 (MCCI_CM7_NVIC + 0x080)
116#define MCCI_CM7_NVIC_ICER1 (MCCI_CM7_NVIC + 0x084)
117#define MCCI_CM7_NVIC_ICER2 (MCCI_CM7_NVIC + 0x088)
118#define MCCI_CM7_NVIC_ICER3 (MCCI_CM7_NVIC + 0x08C)
119#define MCCI_CM7_NVIC_ICER4 (MCCI_CM7_NVIC + 0x090)
120#define MCCI_CM7_NVIC_ICER5 (MCCI_CM7_NVIC + 0x094)
121#define MCCI_CM7_NVIC_ICER6 (MCCI_CM7_NVIC + 0x098)
122#define MCCI_CM7_NVIC_ICER7 (MCCI_CM7_NVIC + 0x09C)
123#define MCCI_CM7_NVIC_ISPR (MCCI_CM7_NVIC + 0x100)
124#define MCCI_CM7_NVIC_ISPR0 (MCCI_CM7_NVIC + 0x100)
125#define MCCI_CM7_NVIC_ISPR1 (MCCI_CM7_NVIC + 0x104)
126#define MCCI_CM7_NVIC_ISPR2 (MCCI_CM7_NVIC + 0x108)
127#define MCCI_CM7_NVIC_ISPR3 (MCCI_CM7_NVIC + 0x10C)
128#define MCCI_CM7_NVIC_ISPR4 (MCCI_CM7_NVIC + 0x110)
129#define MCCI_CM7_NVIC_ISPR5 (MCCI_CM7_NVIC + 0x114)
130#define MCCI_CM7_NVIC_ISPR6 (MCCI_CM7_NVIC + 0x118)
131#define MCCI_CM7_NVIC_ISPR7 (MCCI_CM7_NVIC + 0x11C)
132#define MCCI_CM7_NVIC_ICPR (MCCI_CM7_NVIC + 0x180)
133#define MCCI_CM7_NVIC_ICPR0 (MCCI_CM7_NVIC + 0x180)
134#define MCCI_CM7_NVIC_ICPR1 (MCCI_CM7_NVIC + 0x184)
135#define MCCI_CM7_NVIC_ICPR2 (MCCI_CM7_NVIC + 0x188)
136#define MCCI_CM7_NVIC_ICPR3 (MCCI_CM7_NVIC + 0x18C)
137#define MCCI_CM7_NVIC_ICPR4 (MCCI_CM7_NVIC + 0x190)
138#define MCCI_CM7_NVIC_ICPR5 (MCCI_CM7_NVIC + 0x194)
139#define MCCI_CM7_NVIC_ICPR6 (MCCI_CM7_NVIC + 0x198)
140#define MCCI_CM7_NVIC_ICPR7 (MCCI_CM7_NVIC + 0x19C)
141#define MCCI_CM7_NVIC_IABR (MCCI_CM7_NVIC + 0x200)
142#define MCCI_CM7_NVIC_IABR0 (MCCI_CM7_NVIC + 0x200)
143#define MCCI_CM7_NVIC_IABR1 (MCCI_CM7_NVIC + 0x204)
144#define MCCI_CM7_NVIC_IABR2 (MCCI_CM7_NVIC + 0x208)
145#define MCCI_CM7_NVIC_IABR3 (MCCI_CM7_NVIC + 0x20C)
146#define MCCI_CM7_NVIC_IABR4 (MCCI_CM7_NVIC + 0x210)
147#define MCCI_CM7_NVIC_IABR5 (MCCI_CM7_NVIC + 0x214)
148#define MCCI_CM7_NVIC_IABR6 (MCCI_CM7_NVIC + 0x218)
149#define MCCI_CM7_NVIC_IABR7 (MCCI_CM7_NVIC + 0x21C)
150#define MCCI_CM7_NVIC_IPR (MCCI_CM7_NVIC + 0x300)
151#define MCCI_CM7_NVIC_IPR0 (MCCI_CM7_NVIC + 0x300)
152#define MCCI_CM7_NVIC_IPR1 (MCCI_CM7_NVIC + 0x304)
153#define MCCI_CM7_NVIC_IPR2 (MCCI_CM7_NVIC + 0x308)
154#define MCCI_CM7_NVIC_IPR3 (MCCI_CM7_NVIC + 0x30C)
155#define MCCI_CM7_NVIC_IPR4 (MCCI_CM7_NVIC + 0x310)
156#define MCCI_CM7_NVIC_IPR5 (MCCI_CM7_NVIC + 0x314)
157#define MCCI_CM7_NVIC_IPR6 (MCCI_CM7_NVIC + 0x318)
158#define MCCI_CM7_NVIC_IPR7 (MCCI_CM7_NVIC + 0x31C)
159#define MCCI_CM7_NVIC_IPR8 (MCCI_CM7_NVIC + 0x320)
160#define MCCI_CM7_NVIC_IPR9 (MCCI_CM7_NVIC + 0x324)
161#define MCCI_CM7_NVIC_IPR10 (MCCI_CM7_NVIC + 0x328)
162#define MCCI_CM7_NVIC_IPR11 (MCCI_CM7_NVIC + 0x32C)
163#define MCCI_CM7_NVIC_IPR12 (MCCI_CM7_NVIC + 0x330)
164#define MCCI_CM7_NVIC_IPR13 (MCCI_CM7_NVIC + 0x334)
165#define MCCI_CM7_NVIC_IPR14 (MCCI_CM7_NVIC + 0x338)
166#define MCCI_CM7_NVIC_IPR15 (MCCI_CM7_NVIC + 0x33C)
167#define MCCI_CM7_NVIC_IPR16 (MCCI_CM7_NVIC + 0x340)
168#define MCCI_CM7_NVIC_IPR17 (MCCI_CM7_NVIC + 0x344)
169#define MCCI_CM7_NVIC_IPR18 (MCCI_CM7_NVIC + 0x348)
170#define MCCI_CM7_NVIC_IPR19 (MCCI_CM7_NVIC + 0x34C)
171#define MCCI_CM7_NVIC_IPR20 (MCCI_CM7_NVIC + 0x350)
172#define MCCI_CM7_NVIC_IPR21 (MCCI_CM7_NVIC + 0x354)
173#define MCCI_CM7_NVIC_IPR22 (MCCI_CM7_NVIC + 0x358)
174#define MCCI_CM7_NVIC_IPR23 (MCCI_CM7_NVIC + 0x35C)
175#define MCCI_CM7_NVIC_IPR24 (MCCI_CM7_NVIC + 0x360)
176#define MCCI_CM7_NVIC_IPR25 (MCCI_CM7_NVIC + 0x364)
177#define MCCI_CM7_NVIC_IPR26 (MCCI_CM7_NVIC + 0x368)
178#define MCCI_CM7_NVIC_IPR27 (MCCI_CM7_NVIC + 0x36C)
179#define MCCI_CM7_NVIC_IPR28 (MCCI_CM7_NVIC + 0x370)
180#define MCCI_CM7_NVIC_IPR29 (MCCI_CM7_NVIC + 0x374)
181#define MCCI_CM7_NVIC_IPR30 (MCCI_CM7_NVIC + 0x378)
182#define MCCI_CM7_NVIC_IPR31 (MCCI_CM7_NVIC + 0x37C)
183#define MCCI_CM7_NVIC_IPR32 (MCCI_CM7_NVIC + 0x380)
184#define MCCI_CM7_NVIC_IPR33 (MCCI_CM7_NVIC + 0x384)
185#define MCCI_CM7_NVIC_IPR34 (MCCI_CM7_NVIC + 0x388)
186#define MCCI_CM7_NVIC_IPR35 (MCCI_CM7_NVIC + 0x38C)
187#define MCCI_CM7_NVIC_IPR36 (MCCI_CM7_NVIC + 0x390)
188#define MCCI_CM7_NVIC_IPR37 (MCCI_CM7_NVIC + 0x394)
189#define MCCI_CM7_NVIC_IPR38 (MCCI_CM7_NVIC + 0x398)
190#define MCCI_CM7_NVIC_IPR39 (MCCI_CM7_NVIC + 0x39C)
191#define MCCI_CM7_NVIC_IPR40 (MCCI_CM7_NVIC + 0x3A0)
192#define MCCI_CM7_NVIC_IPR41 (MCCI_CM7_NVIC + 0x3A4)
193#define MCCI_CM7_NVIC_IPR42 (MCCI_CM7_NVIC + 0x3A8)
194#define MCCI_CM7_NVIC_IPR43 (MCCI_CM7_NVIC + 0x3AC)
195#define MCCI_CM7_NVIC_IPR44 (MCCI_CM7_NVIC + 0x3B0)
196#define MCCI_CM7_NVIC_IPR45 (MCCI_CM7_NVIC + 0x3B4)
197#define MCCI_CM7_NVIC_IPR46 (MCCI_CM7_NVIC + 0x3B8)
198#define MCCI_CM7_NVIC_IPR47 (MCCI_CM7_NVIC + 0x3BC)
199#define MCCI_CM7_NVIC_IPR48 (MCCI_CM7_NVIC + 0x3C0)
200#define MCCI_CM7_NVIC_IPR49 (MCCI_CM7_NVIC + 0x3C4)
201#define MCCI_CM7_NVIC_IPR50 (MCCI_CM7_NVIC + 0x3C8)
202#define MCCI_CM7_NVIC_IPR51 (MCCI_CM7_NVIC + 0x3CC)
203#define MCCI_CM7_NVIC_IPR52 (MCCI_CM7_NVIC + 0x3D0)
204#define MCCI_CM7_NVIC_IPR53 (MCCI_CM7_NVIC + 0x3D4)
205#define MCCI_CM7_NVIC_IPR54 (MCCI_CM7_NVIC + 0x3D8)
206#define MCCI_CM7_NVIC_IPR55 (MCCI_CM7_NVIC + 0x3DC)
207#define MCCI_CM7_NVIC_IPR56 (MCCI_CM7_NVIC + 0x3E0)
208#define MCCI_CM7_NVIC_IPR57 (MCCI_CM7_NVIC + 0x3E4)
209#define MCCI_CM7_NVIC_IPR58 (MCCI_CM7_NVIC + 0x3E8)
210#define MCCI_CM7_NVIC_IPR59 (MCCI_CM7_NVIC + 0x3EC)
215#define MCCI_CM7_SCB UINT32_C(0xE000ED00)
216#define MCCI_CM7_SCB_CPUID (MCCI_CM7_SCB + 0x00)
217#define MCCI_CM7_SCB_ICSR (MCCI_CM7_SCB + 0x04)
218#define MCCI_CM7_SCB_VTOR (MCCI_CM7_SCB + 0x08)
219#define MCCI_CM7_SCB_AIRCR (MCCI_CM7_SCB + 0x0C)
220#define MCCI_CM7_SCB_SCR (MCCI_CM7_SCB + 0x10)
221#define MCCI_CM7_SCB_CCR (MCCI_CM7_SCB + 0x14)
222#define MCCI_CM7_SCB_SHPR1 (MCCI_CM7_SCB + 0x18)
223#define MCCI_CM7_SCB_SHPR2 (MCCI_CM7_SCB + 0x1C)
224#define MCCI_CM7_SCB_SHPR3 (MCCI_CM7_SCB + 0x20)
225#define MCCI_CM7_SCB_SHCSR (MCCI_CM7_SCB + 0x24)
226#define MCCI_CM7_SCB_CFSR (MCCI_CM7_SCB + 0x28)
227#define MCCI_CM7_SCB_HFSR (MCCI_CM7_SCB + 0x2C)
228#define MCCI_CM7_SCB_DFSR (MCCI_CM7_SCB + 0x30)
229#define MCCI_CM7_SCB_MMFAR (MCCI_CM7_SCB + 0x34)
230#define MCCI_CM7_SCB_BFAR (MCCI_CM7_SCB + 0x38)
231#define MCCI_CM7_SCB_ID_PFR0 (MCCI_CM7_SCB + 0x40)
232#define MCCI_CM7_SCB_ID_PFR1 (MCCI_CM7_SCB + 0x44)
233#define MCCI_CM7_SCB_ID_DFR0 (MCCI_CM7_SCB + 0x48)
234#define MCCI_CM7_SCB_ID_AFR0 (MCCI_CM7_SCB + 0x4C)
235#define MCCI_CM7_SCB_ID_MMFR0 (MCCI_CM7_SCB + 0x50)
236#define MCCI_CM7_SCB_ID_MMFR1 (MCCI_CM7_SCB + 0x54)
237#define MCCI_CM7_SCB_ID_MMFR2 (MCCI_CM7_SCB + 0x58)
238#define MCCI_CM7_SCB_ID_MMFR3 (MCCI_CM7_SCB + 0x5C)
239#define MCCI_CM7_SCB_ID_ISAR0 (MCCI_CM7_SCB + 0x60)
240#define MCCI_CM7_SCB_ID_ISAR1 (MCCI_CM7_SCB + 0x64)
241#define MCCI_CM7_SCB_ID_ISAR2 (MCCI_CM7_SCB + 0x68)
242#define MCCI_CM7_SCB_ID_ISAR3 (MCCI_CM7_SCB + 0x6C)
243#define MCCI_CM7_SCB_ID_ISAR4 (MCCI_CM7_SCB + 0x70)
244#define MCCI_CM7_SCB_CLIDR (MCCI_CM7_SCB + 0x78)
245#define MCCI_CM7_SCB_CTR (MCCI_CM7_SCB + 0x7C)
246#define MCCI_CM7_SCB_CCSIDR (MCCI_CM7_SCB + 0x80)
247#define MCCI_CM7_SCB_CSSELR (MCCI_CM7_SCB + 0x84)
248#define MCCI_CM7_SCB_CPACR (MCCI_CM7_SCB + 0x88)
249#define MCCI_CM7_SCB_STIR (MCCI_CM7_SCB + 0x200)
250#define MCCI_CM7_SCB_ICIALLU (MCCI_CM7_SCB + 0x250)
251#define MCCI_CM7_SCB_ICIMVAU (MCCI_CM7_SCB + 0x258)
252#define MCCI_CM7_SCB_DCIMVAC (MCCI_CM7_SCB + 0x25C)
253#define MCCI_CM7_SCB_DCISW (MCCI_CM7_SCB + 0x260)
254#define MCCI_CM7_SCB_DCCMVAU (MCCI_CM7_SCB + 0x264)
255#define MCCI_CM7_SCB_DCCMVAC (MCCI_CM7_SCB + 0x268)
256#define MCCI_CM7_SCB_DCCSW (MCCI_CM7_SCB + 0x26C)
257#define MCCI_CM7_SCB_DCCIMVAC (MCCI_CM7_SCB + 0x270)
258#define MCCI_CM7_SCB_DCCISW (MCCI_CM7_SCB + 0x274)
259#define MCCI_CM7_SCB_BPIALL (MCCI_CM7_SCB + 0x278)
260#define MCCI_CM7_SCB_ITCMCR (MCCI_CM7_SCB + 0x290)
261#define MCCI_CM7_SCB_DTCMCR (MCCI_CM7_SCB + 0x294)
262#define MCCI_CM7_SCB_AHBPCR (MCCI_CM7_SCB + 0x298)
263#define MCCI_CM7_SCB_CACR (MCCI_CM7_SCB + 0x29C)
264#define MCCI_CM7_SCB_AHBSCR (MCCI_CM7_SCB + 0x2A0)
265#define MCCI_CM7_SCB_ABFSR (MCCI_CM7_SCB + 0x2A8)
266#define MCCI_CM7_SCB_IEBR0 (MCCI_CM7_SCB + 0x2B0)
267#define MCCI_CM7_SCB_IEBR1 (MCCI_CM7_SCB + 0x2B4)
268#define MCCI_CM7_SCB_DEBR0 (MCCI_CM7_SCB + 0x2B8)
269#define MCCI_CM7_SCB_DEBR1 (MCCI_CM7_SCB + 0x2BC)
270#define MCCI_CM7_SCB_PID4 (MCCI_CM7_SCB + 0x2D0)
271#define MCCI_CM7_SCB_PID5 (MCCI_CM7_SCB + 0x2D4)
272#define MCCI_CM7_SCB_PID6 (MCCI_CM7_SCB + 0x2D8)
273#define MCCI_CM7_SCB_PID7 (MCCI_CM7_SCB + 0x2DC)
274#define MCCI_CM7_SCB_PID0 (MCCI_CM7_SCB + 0x2E0)
275#define MCCI_CM7_SCB_PID1 (MCCI_CM7_SCB + 0x2E4)
276#define MCCI_CM7_SCB_PID2 (MCCI_CM7_SCB + 0x2E8)
277#define MCCI_CM7_SCB_PID3 (MCCI_CM7_SCB + 0x2EC)
278#define MCCI_CM7_SCB_CID0 (MCCI_CM7_SCB + 0x2F0)
279#define MCCI_CM7_SCB_CID1 (MCCI_CM7_SCB + 0x2F4)
280#define MCCI_CM7_SCB_CID2 (MCCI_CM7_SCB + 0x2F8)
281#define MCCI_CM7_SCB_CID3 (MCCI_CM7_SCB + 0x2FC)
286#define MCCI_CM7_FPU UINT32_C(0xE000EF30)
287#define MCCI_CM7_FPU_FPCCR (MCCI_CM7_FPU + 0x04)
288#define MCCI_CM7_FPU_FPCAR (MCCI_CM7_FPU + 0x08)
289#define MCCI_CM7_FPU_FPDSCR (MCCI_CM7_FPU + 0x0C)
290#define MCCI_CM7_FPU_MVFR0 (MCCI_CM7_FPU + 0x10)
291#define MCCI_CM7_FPU_MVFR1 (MCCI_CM7_FPU + 0x14)
292#define MCCI_CM7_FPU_MVFR2 (MCCI_CM7_FPU + 0x18)
303#define MCCI_CM7_SYSTICK_CSR_RSV17 UINT32_C(0xFFFE0000)
304#define MCCI_CM7_SYSTICK_CSR_COUNTFLAG (UINT32_C(1) << 16)
305#define MCCI_CM7_SYSTICK_CSR_RSV3 UINT32_C(0x0000FFF8)
306#define MCCI_CM7_SYSTICK_CSR_CLKSOURCE (UINT32_C(1) << 2)
307#define MCCI_CM7_SYSTICK_CSR_TICKINT (UINT32_C(1) << 1)
308#define MCCI_CM7_SYSTICK_CSR_ENABLE (UINT32_C(1) << 0)
313#define MCCI_CM7_SYSTICK_RVR_RSV24 UINT32_C(0xFF000000)
314#define MCCI_CM7_SYSTICK_RVR_RELOAD UINT32_C(0x00FFFFFF)
319#define MCCI_CM7_SYSTICK_CVR_RSV24 UINT32_C(0xFF000000)
320#define MCCI_CM7_SYSTICK_CVR_CURRENT UINT32_C(0x00FFFFFF)
325#define MCCI_CM7_SYSTICK_CALIB_NOREF (UINT32_C(1) << 31)
326#define MCCI_CM7_SYSTICK_CALIB_SKEW (UINT32_C(1) << 30)
327#define MCCI_CM7_SYSTICK_CALIB_RSV24 (UINT32_C(0x3F) << 24)
328#define MCCI_CM7_SYSTICK_CALIB_TENMS UINT32_C(0x00FFFFFF)
333#define MCCI_CM7_SCB_CPUID_IMPLEMENTER (UINT32_C(0xFF) << 24)
334#define MCCI_CM7_SCB_CPUID_VARIANT (UINT32_C(0xF) << 20)
335#define MCCI_CM7_SCB_CPUID_ARCHITECTURE (UINT32_C(0xF) << 16)
336#define MCCI_CM7_SCB_CPUID_PARTNO (UINT32_C(0xFFF) << 4)
337#define MCCI_CM7_SCB_CPUID_REVISION (UINT32_C(0xF) << 0)
342#define MCCI_CM7_SCB_ICSR_NMIPENDSET (UINT32_C(1) << 31)
343#define MCCI_CM7_SCB_ICSR_RSV29 (UINT32_C(3) << 29)
344#define MCCI_CM7_SCB_ICSR_PENDSVSET (UINT32_C(1) << 28)
345#define MCCI_CM7_SCB_ICSR_PENDSVCLR (UINT32_C(1) << 27)
346#define MCCI_CM7_SCB_ICSR_PENDSTSET (UINT32_C(1) << 26)
347#define MCCI_CM7_SCB_ICSR_PENDSTCLR (UINT32_C(1) << 25)
348#define MCCI_CM7_SCB_ICSR_RSV24 (UINT32_C(1) << 24)
349#define MCCI_CM7_SCB_ICSR_ISRPREEMPT (UINT32_C(1) << 23)
350#define MCCI_CM7_SCB_ICSR_ISRPENDING (UINT32_C(1) << 22)
351#define MCCI_CM7_SCB_ICSR_VECTPENDING (UINT32_C(0x1FF) << 12)
352#define MCCI_CM7_SCB_ICSR_RETTOBASE (UINT32_C(1) << 11)
353#define MCCI_CM7_SCB_ICSR_VECTACTIVE (UINT32_C(0x1FF) << 0)
358#define MCCI_CM7_SCB_VTOR_TBLOFF UINT32_C(0xFFFFFF80)
363#define MCCI_CM7_SCB_AIRCR_VECTKEY (UINT32_C(0xFFFF) << 16)
364#define MCCI_CM7_SCB_AIRCR_VECTKEY_VALUE (UINT32_C(0x05FA) << 16)
365#define MCCI_CM7_SCB_AIRCR_ENDIANNESS (UINT32_C(1) << 15)
366#define MCCI_CM7_SCB_AIRCR_PRIGROUP (UINT32_C(7) << 8)
367#define MCCI_CM7_SCB_AIRCR_PRIGROUP_N(n) ((n) << 8)
368#define MCCI_CM7_SCB_AIRCR_SYSRESETREQ (UINT32_C(1) << 2)
369#define MCCI_CM7_SCB_AIRCR_VECTCLRACTIVE (UINT32_C(1) << 1)
370#define MCCI_CM7_SCB_AIRCR_VECTRESET (UINT32_C(1) << 0)
375#define MCCI_CM7_SCB_SCR_SEVONPEND (UINT32_C(1) << 4)
376#define MCCI_CM7_SCB_SCR_SLEEPDEEP (UINT32_C(1) << 2)
377#define MCCI_CM7_SCB_SCR_SLEEPONEXIT (UINT32_C(1) << 1)
382#define MCCI_CM7_SCB_CCR_BP (UINT32_C(1) << 18)
383#define MCCI_CM7_SCB_CCR_IC (UINT32_C(1) << 17)
384#define MCCI_CM7_SCB_CCR_DC (UINT32_C(1) << 16)
385#define MCCI_CM7_SCB_CCR_STKALIGN (UINT32_C(1) << 9)
386#define MCCI_CM7_SCB_CCR_BFHFNMIGN (UINT32_C(1) << 8)
387#define MCCI_CM7_SCB_CCR_DIV_0_TRP (UINT32_C(1) << 4)
388#define MCCI_CM7_SCB_CCR_UNALIGN_TRP (UINT32_C(1) << 3)
389#define MCCI_CM7_SCB_CCR_USERSETMPEND (UINT32_C(1) << 1)
390#define MCCI_CM7_SCB_CCR_NONBASETHRDENA (UINT32_C(1) << 0)
395#define MCCI_CM7_SCB_SHPR_PRI (UINT32_C(7) << 5)
397#define MCCI_CM7_PRI_INDEX_MEM_MANAGE UINT32_C(4)
398#define MCCI_CM7_PRI_INDEX_BUS_FAULT UINT32_C(5)
399#define MCCI_CM7_PRI_INDEX_USAGE_FAULT UINT32_C(6)
400#define MCCI_CM7_PRI_INDEX_SVC UINT32_C(11)
401#define MCCI_CM7_PRI_INDEX_DEBUG_MONITOR UINT32_C(12)
402#define MCCI_CM7_PRI_INDEX_PENDSV UINT32_C(14)
403#define MCCI_CM7_PRI_INDEX_SYSTICK UINT32_C(15)
406static inline uint32_t
408 uint32_t handlerIndex
411 return handlerIndex < 8
417static inline uint32_t
419 uint32_t handlerIndex
423 return UINT32_C(0xE0) << (8 * (handlerIndex & 3));
429#define MCCI_CM7_SCB_SHCSR_USGFAULTENA (UINT32_C(1) << 18)
430#define MCCI_CM7_SCB_SHCSR_BUSFAULTENA (UINT32_C(1) << 17)
431#define MCCI_CM7_SCB_SHCSR_MEMFAULTENA (UINT32_C(1) << 16)
432#define MCCI_CM7_SCB_SHCSR_SVCALLPENDED (UINT32_C(1) << 15)
433#define MCCI_CM7_SCB_SHCSR_BUSFAULTPENDED (UINT32_C(1) << 14)
434#define MCCI_CM7_SCB_SHCSR_MEMFAULTPENDED (UINT32_C(1) << 13)
435#define MCCI_CM7_SCB_SHCSR_USGFAULTPENDED (UINT32_C(1) << 12)
436#define MCCI_CM7_SCB_SHCSR_SYSTICKACT (UINT32_C(1) << 11)
437#define MCCI_CM7_SCB_SHCSR_PENDSVACT (UINT32_C(1) << 10)
438#define MCCI_CM7_SCB_SHCSR_MONITORACT (UINT32_C(1) << 8)
439#define MCCI_CM7_SCB_SHCSR_SVCALLACT (UINT32_C(1) << 7)
440#define MCCI_CM7_SCB_SHCSR_USGFAULTACT (UINT32_C(1) << 3)
441#define MCCI_CM7_SCB_SHCSR_BUSFAULTACT (UINT32_C(1) << 1)
442#define MCCI_CM7_SCB_SHCSR_MEMFAULTACT (UINT32_C(1) << 0)
453#define MCCI_CM7_IRQ_BASE UINT32_C(256)
454#define MCCI_CM7_IRQ_NonMaskableInt (MCCI_CM7_IRQ_BASE + UINT32_C(2))
455#define MCCI_CM7_IRQ_HardFault (MCCI_CM7_IRQ_BASE + UINT32_C(3))
456#define MCCI_CM7_IRQ_MemoryManagement (MCCI_CM7_IRQ_BASE + UINT32_C(4))
457#define MCCI_CM7_IRQ_BusFault (MCCI_CM7_IRQ_BASE + UINT32_C(5))
458#define MCCI_CM7_IRQ_UsageFault (MCCI_CM7_IRQ_BASE + UINT32_C(6))
459#define MCCI_CM7_IRQ_SVCall (MCCI_CM7_IRQ_BASE + UINT32_C(11))
460#define MCCI_CM7_IRQ_DebugMonitor (MCCI_CM7_IRQ_BASE + UINT32_C(12))
461#define MCCI_CM7_IRQ_PendSV (MCCI_CM7_IRQ_BASE + UINT32_C(14))
462#define MCCI_CM7_IRQ_SysTick (MCCI_CM7_IRQ_BASE + UINT32_C(15))
472__attribute__((__always_inline__))
473static inline uint32_t
476 *(
volatile uint32_t *)reg = val;
481__attribute__((__always_inline__))
482static inline uint32_t
485 return *(
volatile uint32_t *)reg;
489__attribute__((__always_inline__))
490static inline uint32_t
497 (rValue & andVal) | orVal
502__attribute__((__always_inline__))
503static inline uint32_t
515__attribute__((__always_inline__))
516static inline uint32_t
542__attribute__((__always_inline__))
543static inline uint32_t
550 (rValue & ~clearVal) | setVal
568__attribute__((__always_inline__))
569static inline uint32_t
576 rValue ^ ((rValue ^ modVal) & maskVal)
597__attribute__((__always_inline__))
static inline
603 __asm
volatile (
"MSR msp,%0\n" ::
"r"(stack): );
614__attribute__((__always_inline__))
static inline
622 __asm
volatile (
"MRS %0,primask" :
"=r"(primask));
634__attribute__((__always_inline__))
static inline
640 __asm
volatile (
"MSR primask,%0" ::
"r"(primask) :
"memory");
648__attribute__((__always_inline__))
static inline
650McciArm_disableInterrupts(
654 uint32_t
const primask = McciArm_getPRIMASK();
655 __asm
volatile (
"cpsid i" :::
"memory");
667__attribute__((always_inline))
static inline
668void McciArm_InstructionSynchBarrier(
672 __asm
volatile (
"isb 0xF" :::
"memory");
682__attribute__((always_inline))
static inline
683void McciArm_DataSynchBarrier(
687 __asm
volatile (
"dsb 0xF" :::
"memory");
698__attribute__((always_inline))
static inline
699void McciArm_NvicEnableIrq(
700 uint32_t interruptNumber
705 __asm
volatile (
"" :::
"memory");
708 (1u << (interruptNumber & 31u))
710 __asm
volatile (
"" :::
"memory");
722__attribute__((always_inline))
static inline
723void McciArm_NvicDisableIrq(
724 uint32_t interruptNumber
731 (1u << (interruptNumber & 31u))
733 __asm
volatile (
"dsb 0xF" :::
"memory");
734 __asm
volatile (
"isb 0xF" :::
"memory");
748__attribute__((always_inline))
static inline
749int McciArm_NvicGetEnableIrq(
750 uint32_t interruptNumber
757 ) & (1u << (interruptNumber & 31u)) ? 1 : 0;
775__attribute__((always_inline))
static inline
776int McciArm_NvicGetPendingIrq(
777 uint32_t interruptNumber
784 ) & (1u << (interruptNumber & 31u)) ? 1 : 0;
800__attribute__((always_inline))
static inline
801void McciArm_NvicSetPendingIrq(
802 uint32_t interruptNumber
809 (1u << (interruptNumber & 31u))
822__attribute__((always_inline))
static inline
823void McciArm_NvicClearPendingIrq(
824 uint32_t interruptNumber
831 (1u << (interruptNumber & 31u))
844__attribute__((always_inline))
static inline
845void McciArm_NvicSetPriorityGroup(
846 uint32_t priorityGroup
864__attribute__((always_inline))
static inline
865uint32_t McciArm_NvicGetPriorityGroup(
884__attribute__((always_inline))
static inline
885void McciArm_NvicSetPriority(
886 uint32_t interruptNumber,
893 (uint8_t)(priority << 4);
898 (uint8_t)(priority << 4);
912__attribute__((always_inline))
static inline
913uint32_t McciArm_NvicGetPriority(
914 uint32_t interruptNumber
937__attribute__((__noreturn__)) __attribute__((always_inline))
static inline
938void McciArm_NvicSystemReset(
942 __asm
volatile (
"dsb 0xF" :::
"memory");
948 __asm
volatile (
"dsb 0xF" :::
"memory");
951 __asm
volatile (
"nop");
956# error "Compiler not supported"
974typedef struct Mcci_CortexAppEntryContents_s
987typedef union Mcci_CortexAppEntry_u
998typedef struct Mcci_CortexM7VectorsContents_s
1000 uint32_t vectors[256];
1011typedef union Mcci_CortexM7Vectors_u
static uint32_t McciArm_putRegOr(uint32_t reg, uint32_t orVal)
or 32-bit values to a cm7 register
static uint32_t McciArm_getReg(uint32_t reg)
read a 32-bit value from a cm7 register
#define MCCI_CM7_NVIC_ISER
#define MCCI_CM7_IRQ_BASE
Cortex-M Processor Exception Number Base.
static uint32_t McciArm_putReg(uint32_t reg, uint32_t val)
write a 32-bit value to a cm7 register
#define MCCI_CM7_NVIC_ISPR
#define MCCI_CM7_SCB_SHPR3
#define MCCI_CM7_SCB_AIRCR_SYSRESETREQ
System reset request.
#define MCCI_CM7_SCB_AIRCR_VECTKEY
Vector key.
#define MCCI_CM7_SCB_AIRCR
static uint32_t McciArm_putRegClear(uint32_t reg, uint32_t clearVal)
clear out 32-bit values to a cm7 register
#define MCCI_CM7_SCB_SHPR1
#define MCCI_CM7_SCB_SHPR2
#define MCCI_CM7_NVIC_ICPR
static uint32_t McciCm7_SCB_SHPR_getRegister(uint32_t handlerIndex)
return register for a given handler index
#define MCCI_CM7_NVIC_ICER
static uint32_t McciArm_putRegClearSet(uint32_t reg, uint32_t clearVal, uint32_t setVal)
clear and set 32-bit values to a cm7 register
#define MCCI_CM7_NVIC_IPR
#define MCCI_CM7_SCB_AIRCR_VECTKEY_VALUE
Value to write to unlock register.
#define MCCI_CM7_SCB_AIRCR_PRIGROUP_N(n)
static uint32_t McciArm_putRegMasked(uint32_t reg, uint32_t maskVal, uint32_t modVal)
store to cm7 register under mask
static uint32_t McciCm7_SCB_SHPR_getMask(uint32_t handlerIndex)
return byte mask for a given handler index
static uint32_t McciArm_putRegAndOr(uint32_t reg, uint32_t andVal, uint32_t orVal)
and/or 32-bit values to a cm7 register
#define MCCI_CM7_IRQ_MemoryManagement
Cortex-M Memory Management Interrupt.
#define MCCI_CM7_SCB_AIRCR_PRIGROUP
Priority grouping position.
#define MCCI_BOOTLOADER_VALUE_GET_FIELD(val, fmask)
application entry contents
Cortex M7 interrupt vectors (low level view)
Cortex M7 interrupt vector object.
Mcci_CortexAppEntry_t CortexAppEntryCast
Mcci_CortexAppEntryContents_t CortexAppEntry
Mcci_CortexM7VectorsContents_t CortexVectors